:root {
    --blue-700: #4d7cff;
    --blue-600: #105cff;
    --blue-100: rgba(77, 124, 255, 0.22);
    --blue-50: rgba(16, 92, 255, 0.12);
    --gray-900: #f7fbff;
    --gray-700: #c5d4ff;
    --gray-500: #8492a1;
    --gray-200: rgba(132, 146, 161, 0.28);
    --gray-100: #08143a;
    --white: #0c1b4f;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}



html[data-theme="light"] {
    --blue-700: #1688cb;
    --blue-600: #209de7;
    --blue-100: rgba(32, 157, 231, 0.18);
    --blue-50: rgba(32, 157, 231, 0.1);
    --gray-900: #071226;
    --gray-700: #334155;
    --gray-500: #667583;
    --gray-200: rgba(168, 178, 187, 0.46);
    --gray-100: #dfe5eb;
    --white: #fcfcfc;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: var(--gray-900);
    background:
        radial-gradient(circle at 78% 8%, rgba(16, 92, 255, 0.24), transparent 28%),
        radial-gradient(circle at 12% 16%, rgba(77, 124, 255, 0.18), transparent 30%),
        linear-gradient(180deg, #020718 0%, #05113a 52%, #020718 100%);
    min-height: 100vh;
}

html[data-theme="light"] body {
    background:
        radial-gradient(circle at 78% 8%, rgba(32, 157, 231, 0.12), transparent 28%),
        radial-gradient(circle at 12% 16%, rgba(168, 178, 187, 0.18), transparent 30%),
        #fcfcfc;
}

.landing-body {
    height: 100vh;
    overflow: hidden;
}

.landing-shell {
    height: 100vh;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 0;
}

.landing-body .home-entry {
    width: 100%;
    min-height: auto;
}

.landing-body .home-entry-card {
    margin: 0 auto;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(2, 7, 24, 0.9);
    border-bottom: 1px solid var(--gray-200);
    backdrop-filter: blur(14px);
}

html[data-theme="light"] .site-header {
    background: rgba(248, 251, 255, 0.9);
}

.header-inner {
    width: calc(100% - 32px);
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    font-weight: 800;
}

.brand-mark {
    width: 56px;
    height: 56px;
    font-size: 22px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(180deg, #4d7cff, #061ec2);
    box-shadow: 0 0 28px rgba(77, 124, 255, 0.42);
}

.brand-text {
    font-size: 30px;
    color: var(--gray-900);
    text-shadow: 0 0 16px rgba(77, 124, 255, 0.48);
}

.site-search {
    width: min(460px, 48vw);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 0;
}

.site-search input,
.search-page-form input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0 14px;
    color: var(--gray-900);
    background: rgba(6, 16, 55, 0.9);
    font: inherit;
    font-size: 14px;
    outline: none;
}

.site-search input:focus,
.search-page-form input:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(77, 124, 255, 0.18);
}

.site-search button {
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: var(--blue-600);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.site-search button:hover {
    background: var(--blue-700);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 34px;
    padding: 3px;
    border: 1px solid rgba(77, 124, 255, 0.38);
    border-radius: 999px;
    background:
        radial-gradient(circle at 72% 34%, rgba(147, 197, 253, 0.24), transparent 18%),
        linear-gradient(135deg, rgba(3, 10, 32, 0.96), rgba(10, 31, 92, 0.9));
    cursor: pointer;
    box-shadow: inset 0 0 14px rgba(1, 4, 143, 0.28), 0 0 18px rgba(77, 124, 255, 0.18);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.theme-toggle:hover {
    border-color: rgba(77, 124, 255, 0.72);
    box-shadow: 0 0 24px rgba(77, 124, 255, 0.3);
}

.theme-toggle-orb {
    position: relative;
    width: 26px;
    height: 26px;
    margin-right: auto;
    border-radius: 50%;
    background:
        radial-gradient(circle at 38% 34%, #ffffff 0 18%, transparent 19%),
        radial-gradient(circle at 58% 58%, #93c5fd 0 48%, #4d7cff 52% 100%);
    box-shadow: 0 0 16px rgba(147, 197, 253, 0.55);
    transition: transform 0.32s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.theme-toggle-orb::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    right: 3px;
    top: 3px;
    border-radius: 50%;
    background: rgba(3, 10, 32, 0.92);
    box-shadow:
        -12px 10px 0 -4px rgba(147, 197, 253, 0.7),
        -4px 15px 0 -5px rgba(147, 197, 253, 0.7);
    transition: opacity 0.2s ease;
}

html[data-theme="light"] .theme-toggle {
    background:
        radial-gradient(circle at 28% 36%, rgba(250, 204, 21, 0.28), transparent 20%),
        linear-gradient(135deg, rgba(219, 234, 254, 0.92), rgba(255, 255, 255, 0.94));
    box-shadow: inset 0 0 12px rgba(132, 146, 161, 0.2), 0 0 18px rgba(250, 204, 21, 0.16);
}

html[data-theme="light"] .theme-toggle-orb {
    transform: translateX(28px);
    background:
        radial-gradient(circle at 36% 34%, #fff7ad 0 22%, transparent 23%),
        radial-gradient(circle at center, #facc15 0 45%, #f59e0b 58% 100%);
    box-shadow: 0 0 16px rgba(250, 204, 21, 0.48);
}

html[data-theme="light"] .theme-toggle-orb::after {
    opacity: 0;
}

html[data-theme="light"] .site-search input {
    background: rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .side-nav {
    background: rgba(246, 249, 254, 0.94);
}

.side-nav {
    position: fixed;
    top: 76px;
    left: 0;
    bottom: 0;
    z-index: 15;
    width: 248px;
    padding: 18px 14px;
    border-right: 1px solid var(--gray-200);
    background: rgba(3, 10, 32, 0.94);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

.main-nav {
    display: grid;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.nav-link,
.account-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.side-nav .nav-link {
    width: 100%;
    justify-content: flex-start;
    color: var(--gray-700);
}

.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.dropdown-arrow {
    margin-left: auto;
    font-size: 12px;
}

.dropdown-menu {
    position: static;
    max-height: 0;
    overflow: hidden;
    display: grid;
    gap: 4px;
    padding: 0 0 0 10px;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: max-height 0.18s ease, padding 0.18s ease;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
    max-height: 360px;
    padding-top: 6px;
}

.nav-dropdown:hover .dropdown-toggle,
.nav-dropdown:focus-within .dropdown-toggle,
.nav-dropdown.open .dropdown-toggle {
    color: var(--blue-700);
    background: var(--blue-100);
}

.dropdown-link {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 700;
}

.dropdown-link:hover,
.dropdown-link.active {
    color: var(--blue-700);
    background: var(--blue-50);
}

.submenu-title,
.submenu-title:hover {
    cursor: default;
    color: #ffffff;
    background: rgba(77, 124, 255, 0.1);
}

.submenu-item {
    display: grid;
    gap: 2px;
}

.submenu-menu {
    display: grid;
    gap: 2px;
    max-height: 0;
    overflow: hidden;
    padding-left: 12px;
    transition: max-height 0.18s ease;
}

.submenu-item:hover .submenu-menu,
.submenu-item:focus-within .submenu-menu {
    max-height: 220px;
}

.submenu-menu .dropdown-link {
    min-height: 32px;
    padding-left: 14px;
    font-size: 13px;
    font-weight: 600;
    border-left: 2px solid var(--gray-200);
    border-radius: 0 8px 8px 0;
}

.nav-link:hover,
.account-link:hover,
.nav-link.active,
.account-link.active {
    color: var(--blue-700);
    background: rgba(12, 27, 79, 0.86);
}

.account-link {
    border: 1px solid var(--gray-200);
    background: rgba(12, 27, 79, 0.86);
    flex: 0 0 auto;
}

.account-menu,
.side-account {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.side-account {
    display: grid;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--gray-200);
}

.side-account .account-link,
.side-account .logout-link,
.side-account .contact-link {
    width: 100%;
    justify-content: center;
}

.logout-link,
.contact-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--blue-700);
    background: var(--white);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.contact-link {
    color: var(--blue-700);
    border: 1px solid var(--white);
    background: var(--white);
}

.admin-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--blue-600);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.search-panel {
    margin-bottom: 18px;
}

.search-page-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-results {
    display: grid;
    gap: 12px;
}

.search-result {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
}

.search-result:hover {
    border-color: var(--blue-600);
    box-shadow: var(--shadow);
}

.search-result span {
    color: var(--blue-700);
    font-size: 12px;
    font-weight: 800;
}

.search-result strong {
    color: var(--gray-900);
    font-size: 17px;
}

.search-result p {
    margin: 0;
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.55;
}

.contact-info-panel {
    align-self: start;
}

.contact-info-list {
    display: grid;
    gap: 12px;
}

.contact-info-list p {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--blue-50);
}

.contact-info-list strong {
    color: var(--blue-700);
    font-size: 14px;
}

.contact-info-list span {
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.5;
}

.site-feedback-panel {
    display: block;
    margin-bottom: 20px;
    min-height: 0;
    overflow: visible;
}

.contact-page-header {
    margin-bottom: 13px;
}

.contact-page-header h1 {
    margin: 0 0 6px;
    font-size: 28px;
}

.contact-page-header p {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
}

.site-feedback-panel .section-heading {
    margin-bottom: 20px;
}

.site-feedback-list {
    max-height: none;
    min-height: 0;
    height: auto;
    overflow: visible;
    padding: 0;
}

.feedback-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px;
    border: 1px solid rgba(25, 211, 255, 0.28);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(8, 26, 84, 0.92), rgba(2, 7, 24, 0.84));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 18px rgba(25, 211, 255, 0.09);
    position: relative;
    z-index: 2;
}

.feedback-form textarea {
    min-height: 74px;
    max-height: 120px;
    resize: vertical;
}

.feedback-extra.is-hidden,
.feedback-replies.is-hidden {
    display: none;
}

.feedback-more-button {
    display: flex;
    width: fit-content;
    margin-right: auto;
    margin-left: auto;
    margin-top: 14px;
}

.reply-toggle-button {
    margin-top: 10px;
    border: 0;
    padding: 0;
    color: #78e7ff;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-shadow: 0 0 10px rgba(25, 211, 255, 0.18);
}

.reply-toggle-button:hover {
    color: #ffffff;
}

.feedback-replies {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.contact-bottom {
    margin-top: 18px;
}

.logout-link:hover,
.contact-link:hover,
.contact-link.active {
    color: var(--blue-700);
    background: var(--blue-100);
}

.admin-link:hover,
.admin-link.active {
    background: var(--blue-700);
}

.page-shell {
    width: auto;
    max-width: 1180px;
    margin: 0 24px 0 272px;
    padding: 44px 0 64px;
}

.auth-page .page-shell {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

.auth-page .site-footer {
    margin-left: 0;
}

.auth-page .auth-copy h1 {
    font-size: clamp(28px, 3.6vw, 44px);
}

.path-game-page {
    height: 100vh;
    overflow: hidden;
}

.path-game-page .page-shell {
    max-width: none;
    height: calc(100vh - 76px);
    margin: 0 0 0 248px;
    padding: 12px;
    overflow: hidden;
}

.path-game-page .site-footer {
    display: none;
}

.hero-section {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 28px;
    align-items: center;
    min-height: calc(100vh - 220px);
}

.home-entry {
    min-height: calc(100vh - 168px);
    display: grid;
    justify-items: center;
    align-content: center;
}

.home-entry-card {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    padding: 16px 54px 14px;
    border: 0;
    border-radius: 0;
    background:
        linear-gradient(180deg, rgba(2, 6, 28, 0.08), rgba(2, 6, 28, 0.2)),
        url("../img/landing/dyntest_background_1920x920.svg") center center / cover no-repeat,
        radial-gradient(circle at 50% 7%, rgba(24, 52, 145, 0.34), transparent 30%),
        radial-gradient(circle at 18% 24%, rgba(13, 34, 112, 0.22), transparent 24%),
        radial-gradient(circle at 84% 22%, rgba(24, 58, 150, 0.2), transparent 25%),
        linear-gradient(180deg, #050d3b 0%, #020829 50%, #01041a 100%);
    box-shadow:
        0 0 58px rgba(16, 92, 255, 0.18) inset;
    overflow: hidden;
}

.home-entry-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.72) 0 1px, transparent 5px),
        radial-gradient(circle at 92% 18%, rgba(255, 220, 96, 0.38) 0 1px, transparent 5px),
        linear-gradient(90deg, transparent 0 18%, rgba(77, 124, 255, 0.09) 50%, transparent 82%),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.024) 0 1px, transparent 1px 88px);
}

.home-logo-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: min(650px, 70%);
    margin: 0 auto 2px;
}

.home-logo-wrap img {
    width: 100%;
    max-height: 104px;
    display: block;
    transform: translateX(38px);
    filter: drop-shadow(0 0 18px rgba(51, 112, 255, 0.7));
}

.home-logo-wrap .home-main-logo {
    width: min(670px, 58vw);
    max-height: 138px;
    object-fit: contain;
    transform: translateX(0);
    filter: drop-shadow(0 0 22px rgba(51, 112, 255, 0.72));
}

.home-logo-wrap strong {
    color: #dfe8ff;
    font-size: clamp(52px, 8vw, 92px);
    font-weight: 900;
    letter-spacing: 3px;
    line-height: 1;
    text-shadow:
        0 0 10px rgba(77, 124, 255, 0.95),
        0 0 28px rgba(16, 92, 255, 0.78),
        0 4px 0 #071160;
}

.home-logo-wrap strong span {
    color: #9eb8ff;
}

.home-logo-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(77, 124, 255, 0.45);
    border-radius: 8px;
    color: #ffd45a;
    background: rgba(5, 19, 68, 0.9);
    box-shadow: 0 0 20px rgba(77, 124, 255, 0.36);
    font-weight: 900;
}

.landing-art,
.home-visual {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.landing-book {
    left: 94px;
    top: 124px;
    width: 210px;
}

.landing-chart {
    left: 234px;
    top: 67px;
    width: 58px;
    transform: rotate(-10deg);
}

.landing-check {
    left: 130px;
    top: 86px;
    width: 46px;
    transform: rotate(-12deg);
}

.landing-laptop {
    right: 170px;
    top: 55px;
    width: 248px;
}

.landing-lightbulb {
    left: 300px;
    right: auto;
    top: 104px;
    width: 70px;
}

.landing-trophy {
    right: 86px;
    top: 90px;
    width: 82px;
    transform: rotate(10deg);
}

.landing-bars {
    right: 134px;
    top: 168px;
    width: 118px;
}

.landing-growth {
    right: 48px;
    top: 274px;
    width: 104px;
}

.visual-left {
    left: 24px;
    top: 70px;
    width: 170px;
    height: 150px;
}

.visual-right {
    right: 28px;
    top: 64px;
    width: 180px;
    height: 158px;
}

.visual-book {
    position: absolute;
    left: 0;
    bottom: 20px;
    width: 92px;
    height: 48px;
    border: 3px solid #9ec4ff;
    border-radius: 6px 6px 18px 18px;
    background: linear-gradient(90deg, #f8fbff 0 48%, #d7e6ff 48% 52%, #f8fbff 52%);
    box-shadow: 0 0 24px rgba(77, 124, 255, 0.55);
    transform: rotate(6deg);
}

.visual-check,
.visual-chart,
.visual-screen,
.visual-light {
    position: absolute;
    display: grid;
    place-items: center;
    border: 1px solid rgba(77, 124, 255, 0.5);
    border-radius: 8px;
    color: #dfe8ff;
    background: rgba(12, 35, 104, 0.9);
    box-shadow: 0 0 20px rgba(77, 124, 255, 0.35);
    font-weight: 900;
}

.visual-check {
    left: 16px;
    top: 36px;
    width: 42px;
    height: 42px;
    color: #6ee7ff;
}

.visual-chart {
    left: 70px;
    top: 14px;
    width: 46px;
    height: 46px;
    color: #9effb0;
}

.visual-screen {
    right: 46px;
    top: 34px;
    width: 96px;
    height: 68px;
    justify-items: start;
    padding-left: 16px;
    color: #90d1ff;
}

.visual-screen::after {
    content: "";
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 46px;
    height: 8px;
    border-radius: 999px;
    background: #65e46f;
    box-shadow: 0 -16px 0 rgba(77, 124, 255, 0.35), 0 -32px 0 rgba(77, 124, 255, 0.2);
}

.visual-light {
    right: 4px;
    top: 0;
    width: 44px;
    height: 54px;
    color: #ffd45a;
    border-radius: 50% 50% 8px 8px;
}

.visual-bars {
    position: absolute;
    right: 4px;
    bottom: 12px;
    width: 78px;
    height: 58px;
    border-bottom: 4px solid #7aa5ff;
    border-left: 4px solid #7aa5ff;
}

.visual-bars::before {
    content: "";
    position: absolute;
    bottom: 4px;
    left: 10px;
    width: 12px;
    height: 20px;
    background: #49d96a;
    box-shadow: 20px -12px 0 #ffd45a, 40px -28px 0 #8d69ff;
}

.home-subtitle {
    position: relative;
    z-index: 1;
    width: min(650px, 70%);
    margin: 0 0 10px;
    margin-left: auto;
    margin-right: auto;
    color: #f5f8ff;
    text-align: center;
    font-size: 21px;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(77, 124, 255, 0.55);
}

.home-info-panels {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
    width: min(900px, 100%);
    margin: 10px auto 0;
}

.home-info-panel {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-height: 96px;
    padding: 12px 20px;
    border: 1px solid rgba(77, 124, 255, 0.32);
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(9, 28, 92, 0.92), rgba(5, 17, 58, 0.84));
    box-shadow: 0 0 24px rgba(16, 92, 255, 0.13) inset;
}

.home-info-icon {
    width: 62px;
    height: 62px;
    display: block;
    justify-self: center;
    filter: drop-shadow(0 0 15px rgba(77, 124, 255, 0.36));
}

.home-info-panel h2 {
    margin: 0 0 5px;
    color: #b9ccff;
    font-size: 19px;
    text-transform: uppercase;
}

.home-info-panel p {
    margin: 0;
    color: #e8efff;
    font-size: 14px;
    line-height: 1.42;
}

.home-entry-card h1 {
    max-width: 760px;
    margin: 12px 0 18px;
    color: var(--gray-900);
    font-size: clamp(42px, 6vw, 74px);
    line-height: 1.02;
}

.home-entry-card .hero-text {
    max-width: 720px;
    margin: 0;
    font-size: 18px;
}

.home-login-wrap {
    display: flex;
    position: relative;
    z-index: 1;
    justify-content: center;
    width: 100%;
    margin: 10px 0 12px;
}

.home-login-button {
    display: inline-flex;
    width: fit-content;
    margin: 0;
    min-width: 310px;
    min-height: 54px;
    font-size: 19px;
    box-shadow: 0 0 20px rgba(77, 124, 255, 0.65);
}

.hero-content h1,
.page-header h1,
.auth-copy h1 {
    margin: 10px 0 16px;
    font-size: clamp(36px, 6vw, 68px);
    line-height: 1.06;
    color: var(--gray-900);
}

.hero-text,
.page-header p,
.auth-copy p,
.content-panel p,
.feature-card p {
    color: var(--gray-700);
    font-size: 17px;
    line-height: 1.7;
}

.eyebrow {
    margin: 0;
    color: var(--blue-700);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 8px;
    border: 1px solid var(--blue-600);
    font-weight: 800;
    cursor: pointer;
}

.primary-button {
    color: #ffffff;
    background: linear-gradient(180deg, #2f75ff, #061ec2);
    box-shadow: 0 0 16px rgba(77, 124, 255, 0.32);
}

.secondary-button {
    color: #dfe8ff;
    background: rgba(12, 27, 79, 0.9);
}

.full-width {
    width: 100%;
}

.hero-panel,
.content-panel,
.feature-card,
.auth-card {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: rgba(7, 22, 71, 0.9);
    box-shadow: var(--shadow);
}

.hero-panel {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.stat-card {
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(132, 146, 161, 0.22);
    background: rgba(7, 22, 71, 0.86);
}

.stat-card strong {
    display: block;
    color: var(--blue-700);
    font-size: 30px;
    margin-bottom: 6px;
}

.stat-card span {
    color: var(--gray-700);
    font-weight: 700;
}

.content-panel h2,
.feature-card h3,
.section-heading h2 {
    color: var(--gray-900);
}

.section-block {
    padding: 42px 0 0;
}

.home-info-section {
    padding-top: 18px;
}

.section-heading {
    margin-bottom: 20px;
}

.section-heading h2,
.content-panel h2,
.feature-card h3 {
    margin: 8px 0 10px;
}

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

.feature-card,
.content-panel {
    padding: 24px;
}

.home-feature-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    width: min(980px, 100%);
    margin: 22px auto 0;
}

.home-feature-grid .feature-card {
    min-height: 108px;
    padding: 10px 12px 12px;
    border: 1px solid rgba(77, 124, 255, 0.26);
    background: rgba(5, 18, 63, 0.88);
    box-shadow: 0 0 20px rgba(16, 92, 255, 0.1) inset;
    text-align: center;
}

.home-feature-grid .feature-card h3 {
    color: #eaf0ff;
    margin: 6px 0 5px;
    font-size: 15px;
}

.home-feature-grid .feature-card p {
    color: #aebff0;
    font-size: 13px;
    line-height: 1.4;
}

.feature-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 4px;
    display: block;
    filter: drop-shadow(0 0 12px rgba(77, 124, 255, 0.32));
}

.page-header {
    max-width: 820px;
    margin-bottom: 26px;
}

.page-matching .page-header {
    max-width: min(100%, 960px);
}

.page-matching .page-header h1 {
    font-size: clamp(30px, 4.2vw, 52px);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.about-page-header {
    max-width: 980px;
}

.about-main-panel {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    margin-bottom: 20px;
}

.about-main-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(180deg, #2f75ff, #061ec2);
    box-shadow: 0 0 24px rgba(77, 124, 255, 0.45);
    font-size: 30px;
    font-weight: 900;
}

.about-main-panel h2 {
    margin: 8px 0 0;
    color: var(--gray-900);
    font-size: 24px;
    line-height: 1.45;
}

.about-feature-grid .feature-card {
    min-height: 170px;
    border-top: 4px solid var(--blue-700);
}

.two-column,
.auth-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.auth-layout {
    min-height: calc(100vh - 220px);
    align-items: center;
}

.auth-card {
    padding: 24px;
}

.tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.tabs.three-tabs {
    grid-template-columns: repeat(3, 1fr);
}

.tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--gray-700);
    background: var(--white);
    font-weight: 800;
}

.tab.active {
    color: var(--blue-700);
    background: var(--blue-100);
    border-color: var(--blue-100);
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 700;
    line-height: 1.5;
}

.alert p {
    margin: 0;
}

.alert p + p {
    margin-top: 6px;
}

.alert.success {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

.alert.error {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.form-feedback {
    margin-top: 14px;
}

#question-builder {
    scroll-margin-top: 24px;
}

.auth-form {
    display: grid;
    gap: 10px;
}

.auth-form label,
.admin-form label {
    color: var(--gray-700);
    font-weight: 800;
}

.auth-form input,
.admin-form input,
.admin-form textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0 14px;
    color: var(--gray-900);
    background: var(--white);
}

.admin-form {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 12px 16px;
}

.admin-form label {
    align-self: end;
}

.admin-form textarea {
    min-height: 110px;
    padding: 12px 14px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

.compact-form {
    display: grid;
    gap: 12px;
}

.compact-form input,
.compact-form select,
.compact-form textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--gray-900);
    background: var(--white);
    font: inherit;
    font-size: 14px;
}

.compact-form textarea {
    padding: 12px;
    resize: vertical;
    line-height: 1.55;
}

.compact-form label {
    display: grid;
    gap: 6px;
    color: var(--gray-700);
    font-weight: 800;
}

.compact-form label span {
    font-size: 14px;
}

.form-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ai-settings-form {
    display: block;
}

.ai-settings-form .form-grid-two {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
}

.ai-settings-form .form-hint {
    margin-top: 12px;
}

.question-builder-form {
    gap: 14px;
}

.answer-options-grid {
    display: grid;
    gap: 10px;
}

.answer-option-row {
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-100);
}

.answer-option-row input[type="radio"] {
    width: 16px;
    min-height: auto;
}

.answer-option-row span {
    color: var(--blue-700);
    font-size: 13px;
    font-weight: 800;
}

.option-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding-left: 18px;
}

.option-list li {
    color: var(--gray-700);
    font-size: 13px;
    line-height: 1.4;
}

.option-list li.correct {
    color: var(--blue-700);
    font-weight: 800;
}

.question-base-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.question-base-head h2 {
    margin: 0;
}

.question-template {
    display: grid;
    gap: 12px;
}

.question-template[hidden],
.choice-only[hidden],
.adaptive-only[hidden] {
    display: none;
}

.question-bank-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.question-bank-grid article {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-100);
}

.question-bank-grid h3 {
    margin: 0;
    color: var(--blue-700);
    font-size: 17px;
}

.bank-item {
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
}

.bank-item strong {
    color: var(--gray-900);
    font-size: 13px;
}

.bank-item p {
    margin: 0;
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.45;
}

.bank-item span {
    color: var(--blue-700);
    font-size: 13px;
    font-weight: 800;
}

.test-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.test-entry-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 16px;
    align-items: start;
}

.test-entry-layout .test-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.live-join-panel {
    position: sticky;
    top: 16px;
}

.live-code-box {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid rgba(77, 124, 255, 0.42);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(77, 124, 255, 0.18), rgba(2, 7, 24, 0.22));
    text-align: center;
}

.live-code-box span,
.live-code-box small {
    color: var(--gray-700);
    font-weight: 800;
}

.live-code-box strong {
    color: #ffffff;
    font-size: 42px;
    letter-spacing: 6px;
}

.live-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.test-card {
    display: grid;
    gap: 8px;
    min-height: 150px;
    padding: 20px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.test-card:hover {
    border-color: var(--blue-600);
    transform: translateY(-2px);
}

.test-card span,
.test-meta-label,
.test-question-head span {
    color: var(--blue-700);
    font-size: 13px;
    font-weight: 800;
}

.test-card h2 {
    margin: 0;
    color: var(--gray-900);
    font-size: 22px;
}

.test-card p {
    margin: 0;
    color: var(--gray-700);
    font-size: 15px;
}

.test-summary-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.test-summary-panel div {
    display: grid;
    gap: 4px;
    padding: 14px;
    border-radius: 8px;
    background: var(--gray-100);
}

.test-summary-panel strong {
    color: var(--gray-900);
    font-size: 18px;
}

.test-question-list {
    display: grid;
    gap: 16px;
}

.test-question-card {
    display: grid;
    gap: 14px;
}

.test-question-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.test-question-head strong {
    padding: 5px 10px;
    border-radius: 999px;
    color: var(--blue-700);
    background: var(--blue-100);
    font-size: 13px;
}

.test-question-card h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.45;
}

.public-options-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.public-options-list div {
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--gray-700);
    background: var(--white);
    font-size: 15px;
}

.public-options-list div.correct {
    color: var(--blue-700);
    border-color: var(--blue-100);
    background: var(--blue-50);
    font-weight: 800;
}

.question-explanation {
    margin: 0;
    padding: 12px;
    border-left: 3px solid var(--blue-600);
    border-radius: 8px;
    background: var(--gray-100);
}

.four-choice-explanation {
    display: grid;
    gap: 6px;
    margin: 16px 0 0;
    padding: 14px 16px;
    border: 1px solid rgba(96, 165, 250, 0.5);
    border-left-width: 4px;
    border-radius: 8px;
    color: var(--gray-900);
    background: rgba(59, 130, 246, 0.1);
}

.four-choice-explanation[hidden] {
    display: none;
}

.four-choice-explanation.correct {
    border-color: rgba(34, 197, 94, 0.72);
    background: rgba(34, 197, 94, 0.12);
}

.four-choice-explanation.wrong {
    border-color: rgba(239, 68, 68, 0.72);
    background: rgba(239, 68, 68, 0.12);
}

.four-choice-explanation strong {
    color: inherit;
}

.active-test-card,
.test-finished-panel {
    display: grid;
    gap: 16px;
    scroll-margin-top: 96px;
}

.test-summary-panel {
    scroll-margin-top: 88px;
}

.active-test-card h2,
.test-result-card h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.45;
}

.test-answer-form {
    display: grid;
    gap: 16px;
}

.test-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.test-question-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--gray-200);
}

.question-nav-button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--gray-900);
    background: var(--white);
    font-weight: 900;
    cursor: pointer;
}

.question-nav-button:hover,
.question-nav-button.current {
    border-color: var(--blue-600);
    color: #ffffff;
    background: var(--blue-600);
}

.question-nav-button.answered {
    border-color: rgba(132, 146, 161, 0.62);
    color: #ffffff;
    background: linear-gradient(180deg, #8492a1, #4f6f96);
}

.question-nav-button.answered.current {
    color: #ffffff;
    background: linear-gradient(180deg, #416a9f, #01048f);
}

.question-nav-button.unanswered:not(.current) {
    color: var(--gray-700);
    background: var(--gray-100);
}

.question-nav-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.quiz-options-list {
    display: grid;
    gap: 10px;
}

.quiz-options-list label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
}

.quiz-options-list label:hover,
.quiz-options-list label:focus-within {
    border-color: var(--blue-600);
    background: var(--blue-50);
}

.quiz-options-list input {
    width: 16px;
    height: 16px;
}

.quiz-options-list span {
    color: var(--gray-900);
    font-size: 16px;
    line-height: 1.45;
}

.test-result-card {
    display: grid;
    gap: 14px;
}

.result-lines {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.result-lines p {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-100);
}

.result-lines span {
    color: var(--blue-700);
    font-size: 13px;
    font-weight: 800;
}

.result-lines strong {
    color: var(--gray-900);
    font-size: 15px;
    line-height: 1.45;
}

.result-lines p.answer-correct {
    border-color: #15803d;
    background: #bbf7d0;
}

.result-lines p.answer-wrong {
    border-color: #b91c1c;
    background: #fecaca;
}

.result-lines p.answer-correct span,
.result-lines p.answer-correct strong {
    color: #14532d;
}

.result-lines p.answer-wrong span,
.result-lines p.answer-wrong strong {
    color: #7f1d1d;
}

.game-layout,
.crossword-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
    align-items: start;
}

.game-selector-panel {
    max-width: 760px;
}

.game-selector-panel h2 {
    margin: 0 0 14px;
    color: var(--gray-900);
    font-size: 22px;
}

.game-selector-panel .primary-button {
    width: fit-content;
}

.game-question-card {
    min-height: 360px;
}

.game-question-card h2 {
    margin: 0;
    color: var(--gray-900);
    font-size: 24px;
    line-height: 1.5;
}

.game-answer-grid,
.statement-answer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.game-option-button {
    min-height: 74px;
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--gray-900);
    background: var(--white);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.game-option-button:hover,
.game-option-button:focus {
    border-color: var(--blue-600);
    background: var(--blue-50);
    transform: translateY(-1px);
}

.game-option-button.answer-correct,
.game-option-button.answer-correct:disabled {
    border-color: #15803d;
    color: #14532d;
    background: #bbf7d0;
}

.game-option-button.answer-wrong,
.game-option-button.answer-wrong:disabled {
    border-color: #b91c1c;
    color: #7f1d1d;
    background: #fecaca;
}

.game-option-button:disabled {
    cursor: default;
    transform: none;
}

.timer-panel {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 10px;
    text-align: center;
}

.timer-panel span {
    color: var(--blue-700);
    font-weight: 800;
}

.timer-panel strong {
    color: var(--blue-700);
    font-size: 56px;
    line-height: 1;
}

.timer-panel p,
.game-hint {
    margin: 0;
    color: var(--gray-700);
}

.game-round-stats,
.round-feedback {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--gray-700);
    background: var(--gray-100);
    font-size: 14px;
    font-weight: 800;
}

.game-round-stats form {
    margin: 0;
}

.statement-bundle-card,
.statement-round-form {
    display: grid;
    gap: 14px;
}

.statement-round-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 12px;
    padding: 14px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
}

.statement-round-item > strong {
    color: var(--blue-700);
}

.statement-round-item p {
    margin: 0;
    color: var(--gray-900);
    font-weight: 800;
    line-height: 1.45;
}

.statement-choice-row {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.statement-choice-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--gray-800);
    background: var(--gray-100);
    font-weight: 800;
    cursor: pointer;
}

.statement-choice-row label:hover,
.statement-choice-row label:focus-within {
    border-color: var(--blue-600);
    background: var(--blue-50);
}

.statement-choice-row input {
    width: 16px;
    height: 16px;
}

.matching-game {
    display: grid;
    gap: 16px;
}

.matching-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}

.matching-column {
    display: grid;
    gap: 10px;
    align-content: start;
}

.matching-column h2,
.crossword-clues h2 {
    margin: 0 0 4px;
    color: var(--blue-700);
    font-size: 18px;
}

.match-card {
    min-height: 54px;
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--gray-900);
    background: var(--white);
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.match-card.selected {
    border-color: var(--blue-600);
    background: var(--blue-50);
}

.match-card.matched {
    color: #166534;
    border-color: #bbf7d0;
    background: #dcfce7;
    cursor: default;
}

.match-card.wrong {
    color: #991b1b;
    border-color: #fecaca;
    background: #fee2e2;
}

.crossword-board-panel {
    display: grid;
    gap: 16px;
    overflow-x: auto;
}

.crossword-grid {
    display: grid;
    gap: 4px;
    width: max-content;
}

.crossword-cell {
    position: relative;
    width: 38px;
    height: 38px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: var(--gray-200);
}

.crossword-cell.empty {
    border-color: #ffffff;
    background: #ffffff;
}

.crossword-cell small {
    position: absolute;
    top: 2px;
    left: 4px;
    z-index: 1;
    color: var(--blue-700);
    font-size: 9px;
    font-weight: 900;
}

.crossword-cell input {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 8px 4px 4px;
    border: 0;
    border-radius: 6px;
    color: var(--gray-900);
    background: transparent;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
}

.crossword-cell input.correct {
    background: #dcfce7;
}

.crossword-cell input.wrong {
    background: #fee2e2;
}

.crossword-clues {
    display: grid;
    gap: 10px;
    max-height: 620px;
    overflow-y: auto;
}

.clue-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-100);
}

.clue-item strong {
    color: var(--blue-700);
}

.clue-item p {
    margin: 0;
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.45;
}

.path-game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    gap: 18px;
    align-items: start;
}

.path-road-panel,
.path-task-panel,
.path-history-panel {
    display: grid;
    gap: 16px;
}

.path-road-head {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.path-road-head div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-100);
}

.path-road-head span {
    color: var(--blue-700);
    font-size: 13px;
    font-weight: 900;
}

.path-road-head strong {
    color: var(--gray-900);
    font-size: 20px;
}

.knowledge-road {
    --road-width: min(100%, 760px);
    position: relative;
    width: var(--road-width);
    min-height: 360px;
    margin: 0 auto;
    border-radius: 8px;
    background:
        radial-gradient(circle at 18% 20%, rgba(80, 125, 255, 0.22), transparent 22%),
        radial-gradient(circle at 84% 72%, rgba(34, 197, 94, 0.13), transparent 28%),
        linear-gradient(135deg, rgba(9, 28, 92, 0.92), rgba(3, 7, 38, 0.96));
    border: 1px solid rgba(132, 146, 161, 0.35);
    overflow: hidden;
}

.road-line {
    position: absolute;
    inset: 42px 46px;
    border: 18px solid transparent;
    border-top-color: rgba(80, 125, 255, 0.42);
    border-right-color: rgba(80, 125, 255, 0.42);
    border-bottom-color: rgba(80, 125, 255, 0.42);
    border-radius: 130px;
    transform: skewX(-8deg);
    filter: drop-shadow(0 0 16px rgba(80, 125, 255, 0.22));
}

.road-node {
    position: absolute;
    left: calc(8% + var(--node-col) * 27%);
    top: calc(16% + var(--node-row) * 31%);
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 3px solid var(--white);
    border-radius: 50%;
    color: var(--gray-700);
    background: var(--gray-300);
    box-shadow: var(--shadow);
    font-weight: 900;
}

.road-node form {
    width: 100%;
    height: 100%;
}

.road-node button,
.road-node span {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.road-node button {
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.road-node.done {
    color: #ffffff;
    background: #16a34a;
}

.road-node.active {
    color: #ffffff;
    background: var(--blue-700);
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(80, 125, 255, 0.18), 0 0 22px rgba(80, 125, 255, 0.55);
}

.road-node.active:hover {
    transform: scale(1.17);
}

.path-runner {
    position: absolute;
    left: calc(8% + var(--runner-col) * 27% + 38px);
    top: calc(16% + var(--runner-row) * 31% - 10px);
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 3px solid var(--white);
    border-radius: 50%;
    color: #ffffff;
    background: #01048f;
    box-shadow: var(--shadow);
    transition: left 0.25s ease, top 0.25s ease;
}

.path-task-panel h2 {
    margin: 0;
    color: var(--gray-900);
    font-size: 22px;
    line-height: 1.45;
}

.path-empty-task {
    display: grid;
    gap: 12px;
}

.path-empty-task span {
    width: fit-content;
    padding: 7px 10px;
    border-radius: 8px;
    color: #dbeafe;
    background: rgba(80, 125, 255, 0.18);
    font-weight: 900;
}

.path-answer-form {
    display: grid;
    gap: 10px;
}

.path-answer-form label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-100);
    color: var(--gray-900);
    font-weight: 800;
    cursor: pointer;
}

.path-answer-form label:hover,
.path-answer-form label:focus-within {
    border-color: var(--blue-600);
    background: var(--blue-50);
}

.path-answer-form input {
    width: 16px;
    height: 16px;
}

.path-history-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.path-history-item {
    display: grid;
    gap: 6px;
    padding: 12px;
    border-left: 5px solid var(--gray-300);
    border-radius: 8px;
    background: var(--gray-100);
}

.path-history-item.correct {
    border-left-color: #16a34a;
}

.path-history-item.wrong {
    border-left-color: #dc2626;
}

.path-history-item strong {
    color: var(--blue-700);
}

.path-history-item span {
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 900;
}

.path-history-item p {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
}

.path-world-stage {
    position: relative;
    height: 100%;
    min-height: 0;
    padding: 18px;
    border: 1px solid rgba(80, 125, 255, 0.35);
    border-radius: 8px;
    background-image:
        linear-gradient(180deg, rgba(3, 7, 38, 0.04), rgba(3, 7, 38, 0.16)),
        var(--path-bg);
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    background-size: cover, contain;
    background-color: #02071b;
    box-shadow: 0 0 42px rgba(16, 92, 255, 0.28);
    overflow: hidden;
}

.path-class-selector {
    margin-bottom: 18px;
}

.path-class-selector .game-selector-panel {
    max-width: none;
}

.path-class-selector .game-selector-panel h2 {
    font-size: 18px;
}

.path-world-top {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 18px;
}

.path-world-title {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #ffffff;
    text-shadow: 0 0 18px rgba(80, 125, 255, 0.75);
}

.path-world-title > span {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    color: #3b82f6;
    font-size: 36px;
}

.path-world-title h2 {
    margin: 0;
    color: #f8fbff;
    font-size: clamp(34px, 4vw, 56px);
}

.path-world-title p {
    margin: 6px 0 0;
    color: #c8d7ff;
    font-size: 17px;
}

.path-world-actions {
    display: flex;
    gap: 12px;
}

.path-stat-button {
    min-width: 170px;
    padding: 14px 18px;
    border: 1px solid rgba(80, 125, 255, 0.52);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(4, 13, 58, 0.78);
    box-shadow: 0 0 24px rgba(16, 92, 255, 0.18) inset;
    text-align: left;
}

button.path-stat-button {
    cursor: pointer;
}

.path-stat-button strong,
.path-stat-button span {
    display: block;
}

.path-stat-button span {
    margin-top: 5px;
    color: #b8c8f6;
    font-size: 13px;
}

.path-progress-card,
.path-question-card {
    position: absolute;
    z-index: 4;
    right: 28px;
    bottom: 28px;
    width: min(420px, calc(100% - 56px));
    padding: 20px;
    border: 1px solid rgba(80, 125, 255, 0.55);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(4, 13, 58, 0.82);
    box-shadow: 0 0 30px rgba(16, 92, 255, 0.22) inset;
}

.path-question-card {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(560px, calc(100% - 44px));
    max-height: calc(100% - 80px);
    padding-top: 58px;
    transform: translate(-50%, -50%);
    background: rgba(4, 13, 58, 0.96);
    overflow-y: auto;
    text-align: center;
}

.path-question-close-form {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    margin: 0;
}

.path-question-card .test-question-head {
    justify-content: center;
    flex-wrap: wrap;
    padding: 0 48px;
}

.path-question-close-form button {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid rgba(191, 219, 254, 0.55);
    border-radius: 50%;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.88);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.path-matching-grid {
    display: grid;
    gap: 8px;
    text-align: left;
}

.path-question-card .path-answer-form .path-match-row {
    display: grid;
    grid-template-columns: minmax(100px, 0.8fr) minmax(180px, 1.4fr);
    align-items: center;
    gap: 8px;
    min-height: 0;
    padding: 8px 12px;
}

.path-match-row select {
    width: 100%;
    min-height: 36px;
    padding: 6px 34px 6px 10px;
    border: 1px solid rgba(96, 165, 250, 0.46);
    border-radius: 8px;
    color: #eaf2ff;
    background: rgba(3, 7, 38, 0.92);
    font-size: 14px;
}

.path-score-badge {
    position: absolute;
    left: 22px;
    top: 22px;
    z-index: 4;
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 124px;
    padding: 10px 14px;
    border: 1px solid rgba(96, 165, 250, 0.62);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(4, 13, 58, 0.76);
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.28) inset;
}

.path-score-badge strong {
    font-size: 26px;
    line-height: 1;
}

.path-score-badge span {
    color: #c8d7ff;
    font-size: 13px;
}

.path-question-progress {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    color: #c8d7ff;
    font-size: 13px;
}

.path-result-modal {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(1, 6, 24, 0.46);
    backdrop-filter: blur(2px);
}

.path-result-box {
    position: relative;
    width: min(420px, 100%);
    padding: 24px;
    border: 1px solid rgba(96, 165, 250, 0.72);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(4, 13, 58, 0.92);
    box-shadow: 0 0 38px rgba(37, 99, 235, 0.36), 0 0 28px rgba(59, 130, 246, 0.22) inset;
    text-align: center;
}

.path-result-close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid rgba(191, 219, 254, 0.55);
    border-radius: 50%;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.88);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.path-result-box h2 {
    margin: 0 0 14px;
}

.path-result-stars {
    margin: 6px 0 14px;
    color: rgba(148, 163, 184, 0.78);
    font-size: 38px;
    letter-spacing: 5px;
}

.path-result-stars .earned {
    color: #facc15;
    text-shadow: 0 0 16px rgba(250, 204, 21, 0.85);
}

.path-progress-card h3,
.path-question-card h2 {
    margin: 0 0 12px;
    color: #ffffff;
    font-size: clamp(18px, 1.8vw, 24px);
}

.path-progress-card p,
.path-question-card p {
    color: #c8d7ff;
}

.path-question-card .test-question-head span,
.path-question-card .test-question-head strong {
    color: #dbeafe;
}

.path-question-card .path-answer-form label {
    border-color: rgba(80, 125, 255, 0.32);
    color: #eef4ff;
    background: rgba(15, 23, 42, 0.72);
}

.path-question-card .path-answer-form label:hover,
.path-question-card .path-answer-form label:focus-within {
    border-color: rgba(147, 197, 253, 0.78);
    background: rgba(30, 64, 175, 0.64);
}

.path-question-card .path-answer-form input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.path-question-card .path-answer-form label:has(input[type="radio"]:checked) {
    border-color: rgba(56, 189, 248, 0.9);
    background: rgba(37, 99, 235, 0.42);
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.24);
}

.path-question-card .path-answer-form .path-match-row {
    min-height: 0;
    padding: 8px 12px;
}

.path-question-card .path-answer-form .path-match-row span {
    font-size: 15px;
    line-height: 1.25;
}

.path-progress-line {
    height: 14px;
    border-radius: 999px;
    background: rgba(80, 125, 255, 0.22);
    overflow: hidden;
}

.path-progress-line span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #38bdf8);
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.62);
}

.path-stage-map {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.path-stage-node {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: clamp(42px, 4.05vw, 68px);
    height: clamp(42px, 4.05vw, 68px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.path-stage-node form {
    width: 100%;
    height: 100%;
    margin: 0;
}

.path-stage-node span,
.path-stage-node button {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid rgba(199, 210, 254, 0.55);
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 0 22px rgba(148, 163, 184, 0.28);
    font-size: clamp(18px, 1.8vw, 28px);
    font-weight: 900;
}

.path-stage-node button {
    cursor: pointer;
}

.path-stage-node.done span {
    border-color: rgba(74, 222, 128, 0.9);
    background: rgba(20, 83, 45, 0.82);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.75);
}

.path-stage-node.done button {
    border-color: rgba(74, 222, 128, 0.9);
    background: rgba(20, 83, 45, 0.82);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.75);
}

.path-stage-node.done::after {
    content: "✓";
    position: absolute;
    right: -4px;
    bottom: -8px;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: #22c55e;
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.8);
    font-weight: 900;
}

.path-stage-node.active button {
    border-color: #93c5fd;
    color: #ffffff;
    background: rgba(29, 78, 216, 0.9);
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.18), 0 0 34px rgba(96, 165, 250, 0.9);
}

.path-stage-node.locked span {
    opacity: 0.62;
}

.path-stage-stars {
    position: absolute;
    left: 50%;
    top: -35px;
    transform: translateX(-50%);
    color: #facc15;
    font-size: 31px;
    letter-spacing: 3px;
    line-height: 1;
    text-shadow: 0 0 18px rgba(250, 204, 21, 0.98), 0 2px 5px rgba(5, 18, 55, 0.42);
    white-space: nowrap;
}

.path-stage-stars i {
    font-style: normal;
}

.path-stage-stars i:not(.earned) {
    color: rgba(148, 163, 184, 0.72);
    text-shadow: 0 0 8px rgba(15, 23, 42, 0.45);
}

.path-phase-badge {
    position: absolute;
    left: 56px;
    right: auto;
    bottom: 4px;
    z-index: 5;
    min-width: 96px;
    padding: 8px 15px 9px 17px;
    border: 1px solid rgba(119, 190, 255, 0.74);
    border-radius: 2px;
    color: #f8fbff;
    background: linear-gradient(160deg, #2f91df 0%, #1e69bd 58%, #1754a5 100%);
    box-shadow:
        0 7px 10px rgba(31, 82, 150, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -6px 9px rgba(10, 50, 119, 0.24);
    font-weight: 900;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 13px;
    transform: rotate(-2deg) skewX(-2deg);
    transform-origin: center;
    text-shadow: 0 1px 4px rgba(5, 18, 55, 0.35);
}

.path-world-stage.template-ashxinf,
.path-world-stage.template-nk1,
.path-world-stage.template-nk3,
.path-world-stage.template-nk4,
.path-world-stage.template-nk5,
.path-world-stage.template-nk6 {
    display: grid;
    place-items: center;
    background-image: linear-gradient(180deg, rgba(3, 7, 38, 0.06), rgba(3, 7, 38, 0.12));
    background-size: cover;
    background-position: center;
    padding: 0;
    border: 0;
    box-shadow: none;
}

.path-image-layer {
    position: relative;
    width: min(100%, calc(100vh * 2.142356));
    max-width: 1836px;
    aspect-ratio: 1836 / 857;
    overflow: hidden;
}

.path-world-stage.template-nk1 .path-image-layer {
    width: min(100%, calc(100vh * 2.137529));
    max-width: 1834px;
    aspect-ratio: 1834 / 858;
}

.path-world-stage.template-nk3 .path-image-layer {
    width: min(100%, calc(100vh * 2.142356));
    max-width: 1836px;
    aspect-ratio: 1836 / 857;
}

.path-world-stage.template-nk4 .path-image-layer {
    width: min(100%, calc(100vh * 2.136364));
    max-width: 1833px;
    aspect-ratio: 1833 / 858;
}

.path-world-stage.template-nk5 .path-image-layer {
    width: min(100%, calc(100vh * 2.146028));
    max-width: 1837px;
    aspect-ratio: 1837 / 856;
}

.path-world-stage.template-nk6 .path-image-layer {
    width: min(100%, calc(100vh * 2.144860));
    max-width: 1836px;
    aspect-ratio: 1836 / 856;
}

.path-world-stage.template-nk3 .path-stage-node {
    width: 5.4237%;
    height: 11.6110%;
    transform: none;
}

.path-world-stage.template-nk4 .path-stage-node {
    width: clamp(42px, 4.05vw, 68px);
    height: clamp(42px, 4.05vw, 68px);
    transform: none;
}

.path-world-stage.template-nk5 .path-stage-node {
    width: clamp(42px, 4.05vw, 68px);
    height: clamp(42px, 4.05vw, 68px);
    transform: none;
}

.path-world-stage.template-nk6 .path-stage-node {
    width: clamp(42px, 4.05vw, 68px);
    height: clamp(42px, 4.05vw, 68px);
    transform: none;
}

.path-world-background-img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
}

.path-world-stage.template-ashxinf .path-stage-map,
.path-world-stage.template-ashxinf .path-world-top,
.path-world-stage.template-ashxinf .path-progress-card,
.path-world-stage.template-ashxinf .path-question-card,
.path-world-stage.template-ashxinf .path-phase-badge,
.path-world-stage.template-nk1 .path-stage-map,
.path-world-stage.template-nk1 .path-world-top,
.path-world-stage.template-nk1 .path-progress-card,
.path-world-stage.template-nk1 .path-question-card,
.path-world-stage.template-nk1 .path-phase-badge,
.path-world-stage.template-nk3 .path-stage-map,
.path-world-stage.template-nk3 .path-world-top,
.path-world-stage.template-nk3 .path-progress-card,
.path-world-stage.template-nk3 .path-question-card,
.path-world-stage.template-nk3 .path-phase-badge,
.path-world-stage.template-nk4 .path-stage-map,
.path-world-stage.template-nk4 .path-world-top,
.path-world-stage.template-nk4 .path-progress-card,
.path-world-stage.template-nk4 .path-question-card,
.path-world-stage.template-nk4 .path-phase-badge,
.path-world-stage.template-nk5 .path-stage-map,
.path-world-stage.template-nk5 .path-world-top,
.path-world-stage.template-nk5 .path-progress-card,
.path-world-stage.template-nk5 .path-question-card,
.path-world-stage.template-nk5 .path-phase-badge,
.path-world-stage.template-nk6 .path-stage-map,
.path-world-stage.template-nk6 .path-world-top,
.path-world-stage.template-nk6 .path-progress-card,
.path-world-stage.template-nk6 .path-question-card,
.path-world-stage.template-nk6 .path-phase-badge {
    z-index: 3;
}

.path-world-stage.template-ashxinf .path-stage-node span,
.path-world-stage.template-ashxinf .path-stage-node button {
    border-color: rgba(186, 230, 253, 0.78);
    color: #075985;
    background: rgba(226, 232, 240, 0.88);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.28);
}

.path-world-stage.template-ashxinf .path-stage-node.done span,
.path-world-stage.template-ashxinf .path-stage-node.done button {
    border-color: rgba(34, 211, 238, 0.98);
    color: #ffffff;
    background: linear-gradient(135deg, #0284c7, #06b6d4);
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.82);
}

.path-world-stage.template-ashxinf .path-stage-node.active button {
    border-color: #ffffff;
    color: #ffffff;
    background: linear-gradient(135deg, #1d4ed8, #38bdf8);
    box-shadow: 0 0 0 8px rgba(56, 189, 248, 0.2), 0 0 36px rgba(14, 165, 233, 0.92);
}

.path-world-stage.template-ashxinf .path-stage-node.locked span {
    opacity: 1;
    border-color: rgba(41, 91, 145, 0.82);
    color: #d7e7ff;
    background: linear-gradient(135deg, #1f4c84, #102d60);
    box-shadow: 0 0 14px rgba(15, 58, 124, 0.42);
}

.path-world-stage.template-nk1 .path-phase-badge {
    left: 84px;
    bottom: 26px;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(30, 98, 196, 0.92), rgba(28, 76, 164, 0.96));
    border-color: rgba(191, 219, 254, 0.7);
}

.path-world-stage.template-nk1 .path-stage-node span,
.path-world-stage.template-nk1 .path-stage-node button {
    border-color: rgba(191, 219, 254, 0.88);
    color: #0f2f67;
    background: rgba(239, 246, 255, 0.92);
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.24);
}

.path-world-stage.template-nk1 .path-stage-node.done span,
.path-world-stage.template-nk1 .path-stage-node.done button {
    border-color: rgba(250, 204, 21, 0.95);
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.72), 0 0 18px rgba(250, 204, 21, 0.42);
}

.path-world-stage.template-nk1 .path-stage-node.active button {
    border-color: #ffffff;
    color: #ffffff;
    background: linear-gradient(135deg, #f59e0b, #2563eb);
    box-shadow: 0 0 0 8px rgba(250, 204, 21, 0.22), 0 0 34px rgba(37, 99, 235, 0.82);
}

.path-world-stage.template-nk1 .path-stage-node.locked span {
    opacity: 1;
    border-color: rgba(96, 165, 250, 0.72);
    color: #dbeafe;
    background: linear-gradient(135deg, #25406c, #142b52);
    box-shadow: 0 0 14px rgba(30, 64, 175, 0.32);
}

.path-world-stage.template-nk3 .path-phase-badge {
    left: 88px;
    bottom: 28px;
    color: #fff7ed;
    background: linear-gradient(135deg, rgba(146, 64, 14, 0.94), rgba(88, 45, 23, 0.96));
    border-color: rgba(251, 191, 36, 0.64);
}

.path-world-stage.template-nk3 .path-stage-node span,
.path-world-stage.template-nk3 .path-stage-node button {
    border-color: rgba(251, 191, 36, 0.78);
    color: #451a03;
    background: rgba(255, 237, 213, 0.94);
    box-shadow: 0 0 16px rgba(251, 146, 60, 0.28);
}

.path-world-stage.template-nk3 .path-stage-node.done span,
.path-world-stage.template-nk3 .path-stage-node.done button {
    border-color: rgba(250, 204, 21, 0.95);
    color: #ffffff;
    background: linear-gradient(135deg, #b45309, #f59e0b);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.72), 0 0 18px rgba(250, 204, 21, 0.42);
}

.path-world-stage.template-nk3 .path-stage-node.active button {
    border-color: #fff7ed;
    color: #ffffff;
    background: linear-gradient(135deg, #92400e, #f59e0b);
    box-shadow: 0 0 0 8px rgba(251, 191, 36, 0.2), 0 0 34px rgba(245, 158, 11, 0.82);
}

.path-world-stage.template-nk3 .path-stage-node.locked span {
    opacity: 1;
    border-color: rgba(180, 83, 9, 0.72);
    color: #fed7aa;
    background: linear-gradient(135deg, #4a2b1a, #23150f);
    box-shadow: 0 0 14px rgba(180, 83, 9, 0.34);
}

.path-world-stage.template-nk4 .path-phase-badge {
    left: 88px;
    bottom: 28px;
    color: #fff7ed;
    background: linear-gradient(135deg, rgba(133, 77, 14, 0.94), rgba(69, 36, 18, 0.96));
    border-color: rgba(251, 191, 36, 0.64);
}

.path-world-stage.template-nk4 .path-stage-node span,
.path-world-stage.template-nk4 .path-stage-node button {
    border-color: rgba(251, 191, 36, 0.78);
    color: #451a03;
    background: rgba(255, 237, 213, 0.94);
    box-shadow: 0 0 16px rgba(251, 146, 60, 0.28);
}

.path-world-stage.template-nk4 .path-stage-node.done span,
.path-world-stage.template-nk4 .path-stage-node.done button {
    border-color: rgba(250, 204, 21, 0.95);
    color: #ffffff;
    background: linear-gradient(135deg, #a16207, #f59e0b);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.72), 0 0 18px rgba(250, 204, 21, 0.42);
}

.path-world-stage.template-nk4 .path-stage-node.active button {
    border-color: #fff7ed;
    color: #ffffff;
    background: linear-gradient(135deg, #854d0e, #f59e0b);
    box-shadow: 0 0 0 8px rgba(251, 191, 36, 0.2), 0 0 34px rgba(245, 158, 11, 0.82);
}

.path-world-stage.template-nk4 .path-stage-node.locked span {
    opacity: 1;
    border-color: rgba(180, 83, 9, 0.72);
    color: #fed7aa;
    background: linear-gradient(135deg, #4a2b1a, #23150f);
    box-shadow: 0 0 14px rgba(180, 83, 9, 0.34);
}

.path-world-stage.template-nk5 .path-phase-badge {
    left: 88px;
    bottom: 28px;
    color: #ecfeff;
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.92), rgba(15, 23, 42, 0.96));
    border-color: rgba(103, 232, 249, 0.7);
}

.path-world-stage.template-nk5 .path-stage-node span,
.path-world-stage.template-nk5 .path-stage-node button {
    border-color: rgba(103, 232, 249, 0.86);
    color: #ecfeff;
    background: rgba(8, 47, 73, 0.9);
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.42);
}

.path-world-stage.template-nk5 .path-stage-node.done span,
.path-world-stage.template-nk5 .path-stage-node.done button {
    border-color: rgba(125, 211, 252, 0.95);
    color: #ffffff;
    background: linear-gradient(135deg, #0284c7, #06b6d4);
    box-shadow: 0 0 26px rgba(34, 211, 238, 0.78);
}

.path-world-stage.template-nk5 .path-stage-node.active button {
    border-color: #ecfeff;
    color: #ffffff;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    box-shadow: 0 0 0 8px rgba(34, 211, 238, 0.22), 0 0 36px rgba(14, 165, 233, 0.88);
}

.path-world-stage.template-nk5 .path-stage-node.locked span {
    opacity: 1;
    border-color: rgba(8, 145, 178, 0.72);
    color: #cffafe;
    background: linear-gradient(135deg, #123a55, #081827);
    box-shadow: 0 0 16px rgba(34, 211, 238, 0.26);
}

.path-world-stage.template-nk6 .path-phase-badge {
    left: 88px;
    bottom: 28px;
    color: #fff7ed;
    background: linear-gradient(135deg, rgba(194, 65, 12, 0.92), rgba(69, 26, 3, 0.96));
    border-color: rgba(251, 191, 36, 0.68);
}

.path-world-stage.template-nk6 .path-stage-node span,
.path-world-stage.template-nk6 .path-stage-node button {
    border-color: rgba(251, 191, 36, 0.82);
    color: #451a03;
    background: rgba(255, 237, 213, 0.94);
    box-shadow: 0 0 17px rgba(251, 146, 60, 0.32);
}

.path-world-stage.template-nk6 .path-stage-node.done span,
.path-world-stage.template-nk6 .path-stage-node.done button {
    border-color: rgba(250, 204, 21, 0.96);
    color: #ffffff;
    background: linear-gradient(135deg, #c2410c, #f59e0b);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.74), 0 0 18px rgba(250, 204, 21, 0.42);
}

.path-world-stage.template-nk6 .path-stage-node.active button {
    border-color: #fff7ed;
    color: #ffffff;
    background: linear-gradient(135deg, #ea580c, #f59e0b);
    box-shadow: 0 0 0 8px rgba(251, 191, 36, 0.2), 0 0 34px rgba(245, 158, 11, 0.82);
}

.path-world-stage.template-nk6 .path-stage-node.locked span {
    opacity: 1;
    border-color: rgba(194, 65, 12, 0.72);
    color: #fed7aa;
    background: linear-gradient(135deg, #4a2b1a, #23150f);
    box-shadow: 0 0 14px rgba(180, 83, 9, 0.34);
}

.path-preview-shell {
    display: grid;
    gap: 18px;
    padding-bottom: 60px;
    justify-items: center;
}

.path-template-preview-stage {
    width: 100%;
    max-width: 1360px;
    min-height: 0;
}

.path-template-preview-stage .path-image-layer {
    width: 100%;
}

.path-leaders-modal {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: grid;
    place-items: center;
    background: rgba(3, 7, 38, 0.55);
}

.path-leaders-modal[hidden] {
    display: none;
}

.path-leaders-box {
    width: min(420px, calc(100% - 40px));
    padding: 22px;
    border: 1px solid rgba(80, 125, 255, 0.58);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(4, 13, 58, 0.95);
    box-shadow: 0 0 36px rgba(16, 92, 255, 0.34);
}

.path-leaders-close {
    float: right;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(80, 125, 255, 0.55);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(80, 125, 255, 0.2);
    cursor: pointer;
}

.path-leaders-box ol {
    display: grid;
    gap: 10px;
    margin: 16px 0 0;
    padding-left: 22px;
}

.path-leaders-box li {
    padding: 10px;
    border-radius: 8px;
    background: rgba(80, 125, 255, 0.14);
}

.path-leaders-box li strong {
    float: right;
    color: #facc15;
}

.game-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.path-settings-main {
    max-width: 620px;
    margin-bottom: 24px;
}

.path-world-settings-block {
    display: grid;
    gap: 18px;
}

.path-world-settings-block .section-heading {
    margin-bottom: 0;
}

.path-world-create-panel,
.path-world-database-panel {
    width: 100%;
}

.path-world-create-form {
    grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr) auto auto;
    align-items: end;
}

.path-world-create-form .path-world-selector {
    grid-column: span 2;
}

.path-world-create-form .checkbox-line {
    align-self: center;
}

.path-world-list {
    display: grid;
    gap: 12px;
    max-height: 520px;
    overflow-y: auto;
}

.path-world-item {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid rgba(132, 146, 161, 0.28);
    border-radius: 8px;
    background: rgba(9, 28, 92, 0.72);
}

.path-world-item img {
    width: 170px;
    height: 104px;
    object-fit: cover;
    border-radius: 8px;
}

.path-world-edit-form {
    display: grid;
    grid-template-columns: minmax(240px, 1.5fr) minmax(190px, 1fr) minmax(120px, .7fr) auto auto;
    gap: 10px;
    align-items: center;
}

.path-world-edit-form input,
.path-world-edit-form select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0 10px;
    color: var(--gray-900);
    background: var(--white);
}

.path-world-meta {
    color: #b8c8f6;
    font-size: 13px;
    font-weight: 800;
}

.path-world-item strong,
.path-world-item span {
    display: block;
}

.path-world-item span {
    margin-top: 4px;
    color: #b8c8f6;
    font-size: 13px;
}

.admin-form .primary-button {
    width: fit-content;
    margin-top: 8px;
}

.site-footer {
    border-top: 1px solid var(--gray-200);
    background: var(--white);
    margin-left: 248px;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.account-dashboard {
    display: grid;
    gap: 16px;
}

.account-hero {
    padding: 8px 4px 6px;
}

.account-hero h1 {
    margin: 8px 0 10px;
    color: #ffffff;
    font-size: 44px;
    line-height: 1.1;
    text-shadow: 0 0 18px rgba(77, 124, 255, 0.36);
}

.account-hero p:not(.eyebrow) {
    margin: 0;
    color: var(--gray-700);
    font-size: 15px;
}

.account-profile-panel {
    display: grid;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 14px;
    border: 1px solid rgba(132, 146, 161, 0.32);
    border-radius: 8px;
    background:
        radial-gradient(circle at 12% 0%, rgba(77, 124, 255, 0.2), transparent 34%),
        linear-gradient(145deg, rgba(9, 28, 92, 0.92), rgba(5, 10, 54, 0.94));
    box-shadow: var(--shadow);
}

.account-profile-info {
    display: grid;
    gap: 6px;
}

.account-profile-info div {
    display: grid;
    gap: 2px;
    padding: 0 0 8px;
    border-bottom: 1px solid rgba(132, 146, 161, 0.2);
}

.account-profile-info span,
.account-settings-form label span {
    color: var(--gray-700);
    font-size: 11px;
    font-weight: 800;
}

.account-profile-info strong {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.25;
    word-break: break-word;
}

.account-profile-forms {
    display: grid;
    gap: 6px;
}

.account-action-item {
    display: grid;
    border-bottom: 1px solid rgba(132, 146, 161, 0.2);
}

.account-action-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 7px 0;
    border: 0;
    background: transparent;
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 900;
    text-align: left;
    cursor: pointer;
}

.account-action-toggle b {
    color: var(--blue-700);
    transition: transform 0.2s ease;
}

.account-settings-form {
    align-content: start;
    padding: 12px;
    border: 1px solid rgba(132, 146, 161, 0.26);
    border-radius: 8px;
    background: rgba(2, 7, 24, 0.18);
}

.account-settings-form h2 {
    margin: 0;
    color: #ffffff;
    font-size: 15px;
}

.account-settings-form p {
    margin: 0;
    color: var(--gray-700);
    font-size: 13px;
    line-height: 1.5;
}

.account-delete-form {
    border-color: rgba(248, 113, 113, 0.34);
    background:
        linear-gradient(90deg, rgba(248, 113, 113, 0.12), transparent 60%),
        rgba(2, 7, 24, 0.18);
}

.danger-button {
    border-color: rgba(248, 113, 113, 0.66);
    background: linear-gradient(135deg, #dc2626, #991b1b);
}

.account-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 18px;
    background: rgba(2, 7, 24, 0.34);
}

.account-popup-backdrop.is-open {
    display: flex;
}

.account-popup {
    position: relative;
    display: none;
    width: min(360px, calc(100vw - 32px));
    max-height: min(440px, calc(100vh - 36px));
    overflow-y: auto;
    border: 1px solid rgba(77, 124, 255, 0.44);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(9, 28, 92, 0.98), rgba(5, 10, 54, 0.98));
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
    transform: translateY(-22px);
    animation: accountPopupDrop 0.22s ease forwards;
}

.account-popup.is-open {
    display: block;
}

.account-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(132, 146, 161, 0.34);
    border-radius: 999px;
    background: rgba(2, 7, 24, 0.48);
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.account-popup .account-settings-form {
    padding-top: 18px;
}

@keyframes accountPopupDrop {
    to {
        transform: translateY(0);
    }
}

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

.account-stat-card,
.account-games-panel,
.account-progress-panel,
.account-list-panel {
    border: 1px solid rgba(132, 146, 161, 0.32);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(9, 28, 92, 0.92), rgba(5, 10, 54, 0.94));
    box-shadow: var(--shadow);
}

.account-games-panel {
    padding: 18px;
}

.account-game-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.account-game-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 70px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--row-accent, #4d7cff) 34%, rgba(132, 146, 161, 0.24));
    border-radius: 8px;
    color: inherit;
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--row-accent, #4d7cff) 15%, transparent), transparent 46%),
        rgba(2, 7, 24, 0.18);
    text-decoration: none;
}

.account-game-row:nth-child(1),
.account-test-progress-row:nth-child(1),
.account-result-row:nth-child(1) {
    --row-accent: #4d7cff;
}

.account-game-row:nth-child(2),
.account-test-progress-row:nth-child(2),
.account-result-row:nth-child(2) {
    --row-accent: #22c55e;
}

.account-game-row:nth-child(3),
.account-test-progress-row:nth-child(3),
.account-result-row:nth-child(3) {
    --row-accent: #a855f7;
}

.account-game-row:nth-child(4),
.account-test-progress-row:nth-child(4),
.account-result-row:nth-child(4) {
    --row-accent: #f59e0b;
}

.account-game-row:nth-child(5),
.account-test-progress-row:nth-child(5),
.account-result-row:nth-child(5) {
    --row-accent: #06b6d4;
}

.account-game-row:hover {
    border-color: color-mix(in srgb, var(--row-accent, #4d7cff) 78%, white 0%);
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--row-accent, #4d7cff) 22%, transparent), transparent 54%),
        rgba(77, 124, 255, 0.12);
}

.account-game-row strong {
    display: block;
    color: #ffffff;
    font-weight: 900;
}

.account-game-row small {
    display: block;
    margin-top: 4px;
    color: var(--gray-700);
    font-size: 12px;
    line-height: 1.35;
}

.account-game-row b {
    color: color-mix(in srgb, var(--row-accent, #4d7cff) 78%, #ffffff 10%);
    font-size: 14px;
    white-space: nowrap;
}

.account-game-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(92px, auto));
    gap: 10px;
    margin-left: auto;
}

.account-game-results span {
    display: grid;
    gap: 2px;
    min-width: 92px;
    padding: 8px 10px;
    border: 1px solid color-mix(in srgb, var(--row-accent, #4d7cff) 30%, rgba(132, 146, 161, 0.2));
    border-radius: 8px;
    background: rgba(2, 7, 24, 0.22);
}

.account-game-results small {
    margin: 0;
    color: #b9c8df;
    font-size: 12px;
}

.account-game-results b {
    font-size: 16px;
}

.account-stat-card {
    display: flex;
    gap: 14px;
    min-height: 132px;
    padding: 18px;
}

.account-stat-icon,
.account-mini-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 900;
}

.account-stat-icon {
    width: 56px;
    height: 56px;
    font-size: 22px;
}

.account-stat-icon.blue,
.account-mini-icon {
    background: linear-gradient(180deg, color-mix(in srgb, var(--row-accent, #4d7cff) 92%, #ffffff 0%), color-mix(in srgb, var(--row-accent, #4d7cff) 58%, #020718 42%));
    box-shadow: 0 0 20px color-mix(in srgb, var(--row-accent, #4d7cff) 32%, transparent);
}

.account-stat-icon.green {
    background: linear-gradient(180deg, #0f9f8e, #07515d);
}

.account-stat-icon.violet {
    background: linear-gradient(180deg, #8b5cf6, #3b1b82);
}

.account-stat-icon.gold {
    background: linear-gradient(180deg, #f6c34d, #6d4a09);
}

.account-stat-card p {
    margin: 2px 0 8px;
    color: var(--gray-700);
    font-weight: 800;
}

.account-stat-card strong {
    display: block;
    margin-bottom: 10px;
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
}

.account-stat-card a,
.account-panel-head a {
    color: var(--blue-700);
    font-size: 13px;
    font-weight: 800;
}

.account-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

.account-bottom-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 14px;
}

.account-progress-panel,
.account-list-panel {
    padding: 18px;
}

.account-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.account-panel-head h2,
.account-list-panel h2 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
}

.account-progress-list,
.account-test-progress-list,
.account-result-list,
.account-link-list {
    display: grid;
    gap: 12px;
}

.account-progress-row,
.account-test-progress-row,
.account-result-row,
.account-link-list a,
.account-tool-link {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(132, 146, 161, 0.2);
}

.account-test-progress-row {
    grid-template-columns: minmax(0, 1fr) minmax(150px, auto) minmax(150px, auto);
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--row-accent, #4d7cff) 32%, rgba(132, 146, 161, 0.22));
    border-radius: 8px;
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--row-accent, #4d7cff) 12%, transparent), transparent 52%),
        rgba(2, 7, 24, 0.16);
    text-decoration: none;
}

.account-test-progress-row:hover {
    border-color: color-mix(in srgb, var(--row-accent, #4d7cff) 74%, white 0%);
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--row-accent, #4d7cff) 19%, transparent), transparent 58%),
        rgba(77, 124, 255, 0.12);
}

.account-test-progress-row strong {
    display: block;
    color: #ffffff;
    font-weight: 900;
}

.account-test-progress-row small {
    display: block;
    color: var(--gray-700);
    font-size: 12px;
    line-height: 1.35;
}

.account-test-progress-row span {
    display: grid;
    gap: 4px;
    justify-items: end;
}

.account-test-progress-row b {
    color: color-mix(in srgb, var(--row-accent, #4d7cff) 78%, #ffffff 10%);
    font-size: 15px;
}

.account-progress-row:last-child,
.account-result-row:last-child,
.account-link-list a:last-child {
    border-bottom: 0;
}

.account-mini-icon {
    width: 38px;
    height: 38px;
    font-size: 15px;
}

.account-progress-row strong,
.account-result-row strong,
.account-link-list a,
.account-tool-link {
    color: #ffffff;
    font-weight: 900;
}

.account-progress-row b,
.account-result-row b,
.account-link-list b,
.account-tool-link b {
    color: color-mix(in srgb, var(--row-accent, #4d7cff) 78%, #ffffff 10%);
}

.account-progress-track {
    overflow: hidden;
    height: 8px;
    margin-top: 8px;
    border-radius: 999px;
    background: rgba(132, 146, 161, 0.18);
}

.account-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2866ff, #4d7cff);
}

.account-result-row small,
.account-empty {
    color: var(--gray-700);
}

.account-link-list a,
.account-tool-link {
    grid-template-columns: auto minmax(0, 1fr) auto;
    text-decoration: none;
}

.account-link-list span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(77, 124, 255, 0.42), rgba(16, 92, 255, 0.16));
    color: #ffffff;
    font-weight: 900;
}

.account-tool-link {
    width: 100%;
    border: 0;
    border-bottom: 1px solid rgba(132, 146, 161, 0.2);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.admin-card {
    display: block;
    min-height: 170px;
    padding: 24px;
    border: 1px solid rgba(132, 146, 161, 0.35);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(9, 28, 92, 0.96), rgba(5, 10, 54, 0.94));
    box-shadow: var(--shadow);
}

.admin-card:hover {
    border-color: rgba(80, 125, 255, 0.7);
    background: linear-gradient(145deg, rgba(15, 45, 135, 0.98), rgba(5, 10, 54, 0.96));
}

.admin-card h2 {
    margin: 0 0 10px;
    color: #ffffff;
}

.admin-card p {
    margin: 0;
    color: rgba(226, 232, 240, 0.84);
    line-height: 1.65;
}

.page-admin-dashboard .admin-grid .admin-card {
    border-color: rgba(132, 146, 161, 0.42);
    background:
        radial-gradient(circle at 100% 0%, rgba(148, 163, 184, 0.18), transparent 36%),
        linear-gradient(145deg, rgba(50, 56, 64, 0.96), rgba(27, 31, 37, 0.94));
}

.page-admin-dashboard .admin-grid .admin-card:hover {
    border-color: rgba(148, 163, 184, 0.68);
    background:
        radial-gradient(circle at 100% 0%, rgba(148, 163, 184, 0.24), transparent 36%),
        linear-gradient(145deg, rgba(61, 68, 78, 0.98), rgba(34, 39, 47, 0.96));
}

.ai-card-counter {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    margin-bottom: 12px;
    padding: 0 10px;
    border: 1px solid rgba(56, 189, 248, 0.36);
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.12);
    color: #9ee7ff;
    font-size: 13px;
    font-weight: 800;
}

.ai-card-counter.is-danger,
.stat-card.is-danger {
    border-color: rgba(248, 113, 113, 0.78);
    background: linear-gradient(145deg, rgba(127, 29, 29, 0.72), rgba(69, 10, 10, 0.52));
    color: #fecaca;
    box-shadow: 0 0 22px rgba(248, 113, 113, 0.22);
}

.stat-card.is-danger strong {
    color: #fecaca;
    text-shadow: 0 0 20px rgba(248, 113, 113, 0.38);
}

.ai-limit-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
}

.ai-limit-summary span {
    color: #c6d5f0;
    font-weight: 700;
}

.ai-limit-summary strong {
    color: #ffffff;
    font-size: clamp(32px, 5vw, 58px);
    line-height: 1;
    text-shadow: 0 0 22px rgba(56, 189, 248, 0.45);
}

.admin-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.admin-choice-card {
    display: block;
    min-height: 230px;
    padding: 28px;
    border: 1px solid rgba(132, 146, 161, 0.38);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(9, 28, 92, 0.96), rgba(3, 7, 38, 0.94));
    box-shadow: var(--shadow);
}

.admin-choice-card:hover {
    border-color: rgba(80, 125, 255, 0.72);
    transform: translateY(-2px);
}

.admin-choice-card span {
    display: inline-flex;
    margin-bottom: 18px;
    padding: 7px 10px;
    border-radius: 8px;
    color: #dbeafe;
    background: rgba(80, 125, 255, 0.18);
    font-weight: 800;
}

.admin-choice-card h2 {
    margin: 0 0 12px;
    color: #ffffff;
}

.admin-choice-card p {
    margin: 0;
    color: rgba(226, 232, 240, 0.84);
    line-height: 1.7;
}

.table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.admin-table th,
.admin-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--gray-200);
    text-align: left;
}

.admin-table th {
    color: var(--gray-700);
    background: var(--gray-100);
}

.lesson-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.lesson-card {
    overflow: hidden;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--gray-100);
}

.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-frame video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000000;
}

.lesson-body {
    padding: 20px;
}

.lesson-body h2 {
    margin: 0 0 10px;
}

.lesson-body p {
    color: var(--gray-700);
    line-height: 1.7;
}

.watch-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
    gap: 20px;
    align-items: start;
}

.material-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
    gap: 20px;
    align-items: stretch;
    min-height: calc(100vh - 160px);
}

.material-view-header {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(0, 760px) minmax(120px, 1fr);
    align-items: start;
    gap: 16px;
    margin-bottom: 18px;
}

.material-view-header-split {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    align-items: stretch;
}

.material-title-block {
    text-align: center;
}

.material-view-header-split .material-title-block {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    text-align: left;
    align-self: center;
    align-items: center;
}

.material-title-block h1 {
    margin: 6px 0 8px;
    color: var(--gray-900);
    font-size: 28px;
    line-height: 1.25;
}

.material-view-header-split .material-title-block h1 {
    position: relative;
    padding-right: 18px;
    font-size: 22px;
}

.material-view-header-split .material-title-block h1::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 0;
    width: 1px;
    height: calc(100% - 8px);
    min-height: 24px;
    background: rgba(148, 163, 184, 0.55);
}

.material-title-block p:not(.eyebrow) {
    margin: 0;
    color: var(--gray-700);
    font-size: 15px;
    line-height: 1.6;
}

.material-view-header-split .material-title-block p:not(.eyebrow) {
    max-width: 760px;
    font-size: 13px;
    line-height: 1.45;
}

.material-view-header .secondary-button {
    justify-self: end;
}

.related-materials-panel {
    display: grid;
    gap: 10px;
    min-height: 0;
    padding: 12px;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 8px;
    background: rgba(241, 245, 249, 0.78);
}

.related-materials-panel.return-panel {
    align-content: center;
    justify-items: stretch;
}

.related-materials-panel.return-panel .secondary-button {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.related-materials-panel h2 {
    margin: 0;
    color: var(--blue-700);
    font-size: 15px;
    line-height: 1.2;
}

.related-materials-list {
    display: grid;
    gap: 8px;
    max-height: 142px;
    overflow-y: auto;
    padding-right: 4px;
}

.related-materials-list a {
    display: grid;
    gap: 3px;
    padding: 8px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--gray-800);
    background: var(--white);
    text-decoration: none;
}

.related-materials-list a.active {
    border-color: var(--blue-600);
    background: var(--blue-50);
}

.related-materials-list strong {
    font-size: 13px;
    line-height: 1.25;
}

.related-materials-list span {
    color: var(--gray-600);
    font-size: 11px;
    line-height: 1.35;
}

.material-view-shell {
    display: block;
}

.clean-material-shell {
    margin-inline: -2px;
}

.watch-player {
    overflow: hidden;
    border-radius: 8px;
    background: #000000;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

.watch-player iframe,
.watch-player video {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.watch-player video {
    object-fit: contain;
}

.video-view-player {
    width: 100%;
    min-height: 560px;
}

.useful-links-list {
    display: grid;
    gap: 16px;
}

.useful-link-item {
    display: grid;
    gap: 10px;
}

.useful-link-item h2 {
    margin: 0;
}

.useful-link-item .secondary-button {
    width: fit-content;
    max-width: 100%;
    overflow-wrap: anywhere;
    justify-content: flex-start;
}

.material-preview {
    overflow: hidden;
    min-height: 430px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.clean-material-shell .material-preview {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.material-preview.pdf-preview {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    height: auto;
    min-height: 720px;
    overflow: visible;
}

.material-preview iframe {
    width: 100%;
    min-height: 640px;
    border: 0;
    display: block;
}

.material-preview.pdf-preview iframe {
    width: 100%;
    height: max(720px, calc(var(--pdf-pages, 1) * 1120px));
    min-height: 720px;
    background: var(--white);
}

.material-side {
    display: grid;
    grid-template-rows: auto minmax(320px, 1fr);
    gap: 6px;
    min-height: calc(100vh - 170px);
}

.material-info {
    overflow-y: auto;
    min-height: 0;
    max-height: calc(25vh + 15px);
    margin-bottom: 0;
    padding: 16px;
}

.material-info h1 {
    font-size: 18px;
}

.material-info .eyebrow {
    color: var(--blue-700);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.material-preview img {
    width: 100%;
    display: block;
}

.material-preview pre {
    margin: 0;
    padding: 22px;
    color: var(--gray-900);
    white-space: pre-wrap;
    line-height: 1.7;
}

.form-note {
    margin: 0;
    color: var(--gray-500);
    font-size: 14px;
}

.comments-panel {
    margin-top: 28px;
    padding: 24px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.comments-panel.inline-comments {
    margin-top: 0;
    width: 440px;
    max-width: 100%;
    height: 360px;
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    box-shadow: none;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inline-comments .section-heading h2 {
    font-size: 16px;
    margin: 4px 0 0;
}

.inline-comments .section-heading {
    margin-bottom: 8px;
}

.inline-comments .comment-form textarea,
.inline-comments .reply-form textarea {
    min-height: 34px;
    max-height: 70px;
    padding: 8px 10px;
    font-size: 13px;
}

.inline-comments .primary-button,
.inline-comments .secondary-button,
.inline-comments .small-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
}

.inline-comments .comments-list {
    flex: 1;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    margin-top: 0;
}

.comment-form,
.reply-form {
    display: grid;
    gap: 10px;
}

.inline-comments .comment-form {
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 8px;
    margin-top: 8px;
}

.comment-form textarea,
.reply-form textarea {
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px 14px;
    font-family: inherit;
    resize: vertical;
}

.comments-list {
    display: grid;
    gap: 20px;
    margin-top: 22px;
}

.comment-item {
    padding: 8px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
}

.inline-comments .comment-item {
    padding: 8px;
    font-size: 14px;
}

.comment-item.reply {
    margin-left: 28px;
    background: var(--blue-50);
}

.inline-comments .comment-item.reply {
    margin-left: 10px;
}

.comment-head,
.comment-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.comment-head {
    justify-content: space-between;
}

.inline-comments .comment-head strong {
    font-size: 13px;
}

.comment-head span,
.like-count,
.empty-text {
    color: var(--gray-500);
    font-size: 14px;
}

.comment-item p {
    margin: 4px 0 0;
    color: var(--gray-700);
    line-height: 1.45;
}

.inline-comments .comment-item p {
    margin: 6px 0 8px;
    font-size: 13px;
    line-height: 1.45;
}

.reply-form {
    margin-top: 6px;
    grid-template-columns: 1fr auto;
    align-items: end;
}

.like-button {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 26px;
    padding: 0 6px;
    border: 0;
    border-radius: 999px;
    color: var(--gray-500);
    background: transparent;
    font-size: 14px;
    cursor: pointer;
}

.like-button.liked,
.like-button:hover {
    color: #dc2626;
    background: #fee2e2;
}

.comment-login {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-200);
}

.comment-login p {
    margin: 0;
    color: var(--gray-700);
    font-size: 13px;
}

.checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
}

.checkbox-line input {
    width: auto;
    min-height: auto;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-actions form {
    margin: 0;
}

.small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--blue-700);
    background: var(--white);
    font-weight: 800;
    cursor: pointer;
}

.small-button.danger {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fecaca;
}

.inline-role-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-role-form select {
    min-height: 34px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0 10px;
    color: var(--gray-900);
    background: var(--white);
    font-weight: 700;
}

.admin-users-filter {
    display: grid;
    grid-template-columns: minmax(180px, 1.1fr) repeat(2, minmax(150px, 0.8fr));
    gap: 12px;
    max-width: 900px;
    margin-bottom: 22px;
}

.admin-users-filter label {
    display: block;
    margin-bottom: 8px;
    color: #9fb8ff;
    font-weight: 700;
}

.admin-users-filter select {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(77, 124, 255, 0.42);
    border-radius: 8px;
    background: rgba(7, 18, 55, 0.82);
    color: #f8fbff;
    padding: 0 14px;
    box-shadow: 0 0 20px rgba(29, 92, 255, 0.12);
}

.admin-users-filter select:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.admin-result-pill {
    display: inline-grid;
    gap: 2px;
    min-width: 104px;
    padding: 8px 10px;
    border: 1px solid rgba(77, 124, 255, 0.34);
    border-radius: 8px;
    background: rgba(4, 15, 48, 0.72);
    color: #f8fbff;
    box-shadow: inset 0 0 18px rgba(77, 124, 255, 0.08);
}

.admin-result-pill strong {
    color: #ffffff;
    font-size: 15px;
}

.admin-result-pill small {
    color: #9fb0c9;
    font-size: 11px;
}

@media (max-width: 760px) {
    .admin-users-filter {
        grid-template-columns: 1fr;
    }
}

.ai-assistant {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 80;
    font-family: inherit;
}

.ai-assistant-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 148px;
    min-height: 46px;
    border: 1px solid rgba(88, 147, 255, 0.62);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(10, 31, 92, 0.96), rgba(20, 70, 185, 0.92));
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 16px 34px rgba(0, 11, 38, 0.42), 0 0 26px rgba(51, 112, 255, 0.28);
}

.ai-assistant-panel {
    position: absolute;
    right: 0;
    bottom: 60px;
    display: none;
    width: min(360px, calc(100vw - 32px));
    height: 460px;
    overflow: hidden;
    border: 1px solid rgba(88, 147, 255, 0.38);
    border-radius: 10px;
    background: rgba(5, 14, 43, 0.96);
    box-shadow: 0 24px 70px rgba(0, 6, 26, 0.56), 0 0 34px rgba(51, 112, 255, 0.18);
}

.ai-assistant.is-open .ai-assistant-panel {
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.ai-assistant-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(88, 147, 255, 0.2);
    background: rgba(10, 28, 78, 0.7);
}

.ai-assistant-head strong,
.ai-assistant-head span {
    display: block;
}

.ai-assistant-head strong {
    color: #ffffff;
    font-size: 16px;
}

.ai-assistant-head span {
    margin-top: 2px;
    color: #9fb8ff;
    font-size: 12px;
}

.ai-quota-line {
    display: block;
    margin-top: 4px;
    color: rgba(199, 214, 255, 0.72);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
}

.ai-assistant-head button {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.ai-assistant-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    overflow-y: auto;
}

.ai-message {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 9px;
    color: #eaf1ff;
    font-size: 14px;
    line-height: 1.45;
}

.ai-message.assistant {
    align-self: flex-start;
    border: 1px solid rgba(88, 147, 255, 0.24);
    background: rgba(18, 39, 96, 0.72);
}

.ai-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #1d5cff, #3370ff);
    color: #ffffff;
}

.ai-message.error {
    border-color: rgba(248, 113, 113, 0.42);
    background: rgba(127, 29, 29, 0.46);
}

.ai-message.is-loading {
    color: #b9c8df;
}

.ai-assistant-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(88, 147, 255, 0.2);
    background: rgba(4, 12, 36, 0.9);
}

.ai-input-wrap {
    position: relative;
    min-width: 0;
}

.ai-assistant-form input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    border: 1px solid rgba(88, 147, 255, 0.32);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    color: #071226;
    padding: 0 68px 0 12px;
}

.ai-input-wrap small {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(76, 100, 145, 0.72);
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    pointer-events: none;
}

.ai-assistant-form button {
    min-height: 42px;
    border: 1px solid rgba(88, 147, 255, 0.6);
    border-radius: 8px;
    background: #1d5cff;
    color: #ffffff;
    padding: 0 12px;
    font-weight: 800;
    cursor: pointer;
}

.ai-assistant-form input:disabled,
.ai-assistant-form button:disabled {
    opacity: 0.7;
    cursor: wait;
}

@media (max-width: 640px) {
    .ai-assistant {
        right: clamp(8px, 3vw, 14px);
        bottom: clamp(8px, 3vw, 14px);
        max-width: calc(100vw - 16px);
    }

    .ai-assistant-toggle {
        min-width: clamp(104px, 36vw, 148px);
        min-height: clamp(34px, 11vw, 46px);
        padding: 0 clamp(10px, 3vw, 16px);
        font-size: clamp(11px, 3.5vw, 14px);
    }

    .ai-assistant-panel {
        right: 0;
        bottom: clamp(44px, 14vw, 60px);
        width: min(360px, calc(100vw - 16px));
        height: min(420px, calc(100dvh - 76px));
        border-radius: clamp(7px, 2.5vw, 10px);
    }

    .ai-assistant-head {
        gap: clamp(6px, 2vw, 12px);
        padding: clamp(8px, 2.8vw, 14px) clamp(9px, 3.2vw, 16px);
    }

    .ai-assistant-head strong {
        font-size: clamp(12px, 4vw, 16px);
    }

    .ai-assistant-head span {
        font-size: clamp(9px, 3vw, 12px);
    }

    .ai-quota-line {
        margin-top: clamp(2px, 1vw, 4px);
        font-size: clamp(8px, 2.7vw, 11px);
    }

    .ai-assistant-head button {
        flex: 0 0 auto;
        width: clamp(25px, 8vw, 32px);
        height: clamp(25px, 8vw, 32px);
        font-size: clamp(17px, 5.5vw, 22px);
    }

    .ai-assistant-messages {
        gap: clamp(6px, 2.5vw, 10px);
        padding: clamp(8px, 3vw, 14px);
    }

    .ai-message {
        max-width: 92%;
        padding: clamp(7px, 2.5vw, 10px) clamp(8px, 3vw, 12px);
        border-radius: clamp(6px, 2.2vw, 9px);
        font-size: clamp(10px, 3.5vw, 14px);
        line-height: 1.4;
    }

    .ai-assistant-form {
        gap: clamp(5px, 2vw, 8px);
        padding: clamp(7px, 2.7vw, 12px);
    }

    .ai-assistant-form input,
    .ai-assistant-form button {
        min-height: clamp(34px, 10.5vw, 42px);
        font-size: clamp(10px, 3.2vw, 14px);
    }

    .ai-assistant-form input {
        padding-right: clamp(48px, 18vw, 68px);
        padding-left: clamp(8px, 3vw, 12px);
    }

    .ai-assistant-form button {
        padding: 0 clamp(7px, 2.7vw, 12px);
    }

    .ai-input-wrap small {
        right: clamp(6px, 2.5vw, 10px);
        font-size: clamp(8px, 2.7vw, 11px);
    }
}

@media (max-width: 360px) {
    .ai-assistant-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .ai-assistant-form button {
        width: 100%;
    }
}

.inline-edit-admin-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.inline-edit-admin-panel h2,
.inline-edit-admin-panel p {
    margin: 0;
}

.inline-edit-admin-panel p {
    margin-top: 6px;
}

.editable-text {
    display: inline;
    min-width: 18px;
    border-radius: 6px;
    outline: 1px dashed transparent;
    outline-offset: 3px;
    cursor: default;
    transition: background 0.2s ease, outline-color 0.2s ease, box-shadow 0.2s ease;
}

.editable-text.multiline {
    display: block;
}

.inline-editing-active .editable-text {
    outline-color: rgba(77, 124, 255, 0.45);
    cursor: text;
}

.inline-editing-active .editable-text:hover,
.inline-editing-active .editable-text:focus {
    outline-color: rgba(77, 124, 255, 0.95);
    background: rgba(77, 124, 255, 0.12);
    box-shadow: 0 0 0 4px rgba(77, 124, 255, 0.08);
}

.inline-edit-toolbar {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(77, 124, 255, 0.4);
    border-radius: 8px;
    color: #eaf0ff;
    background: rgba(2, 7, 24, 0.92);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(14px);
}

.inline-edit-toolbar span {
    font-weight: 800;
    white-space: nowrap;
}

.inline-style-tool {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 8px;
    border: 1px solid rgba(77, 124, 255, 0.28);
    border-radius: 8px;
    color: #eaf0ff;
    font-size: 13px;
    font-weight: 800;
    background: rgba(12, 27, 79, 0.82);
}

.inline-style-tool input,
.inline-style-tool select {
    height: 26px;
    border: 1px solid rgba(226, 232, 240, 0.28);
    border-radius: 6px;
    color: #eaf0ff;
    background: rgba(2, 7, 24, 0.7);
}

.inline-style-tool input {
    width: 34px;
    padding: 0;
}

.inline-style-tool select {
    min-width: 72px;
    padding: 0 6px;
}

.inline-edit-toolbar .primary-button,
.inline-edit-toolbar .secondary-button {
    min-height: 36px;
}

.inline-edit-toolbar .inline-edit-cancel,
.inline-edit-toolbar .inline-edit-save {
    display: none;
}

.inline-editing-active .inline-edit-toolbar .inline-edit-start {
    display: none;
}

.inline-editing-active .inline-edit-toolbar .inline-edit-cancel,
.inline-editing-active .inline-edit-toolbar .inline-edit-save {
    display: inline-flex;
}

.footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0;
    color: var(--gray-500);
    font-size: 14px;
}

/* Site-wide dark blue refinement */
.page-header,
.about-page-header,
.contact-page-header,
.auth-card,
.content-panel,
.admin-card,
.stat-card,
.test-card,
.lesson-card,
.related-materials-panel,
.material-info,
.material-side,
.comments-panel,
.site-feedback-panel,
.table-wrap,
.bank-item,
.comment-item,
.comment-login {
    border-color: rgba(132, 146, 161, 0.28);
    background:
        linear-gradient(145deg, rgba(9, 28, 92, 0.92), rgba(5, 10, 54, 0.94));
    box-shadow: var(--shadow);
}

.page-header,
.about-page-header,
.contact-page-header {
    padding: 22px;
    border: 1px solid rgba(132, 146, 161, 0.22);
    border-radius: 8px;
}

.page-header h1,
.about-page-header h1,
.contact-page-header h1,
.content-panel h2,
.admin-card h2,
.test-card h2,
.lesson-card h2,
.material-title-block h1,
.related-materials-panel h2,
.comment-head strong,
.bank-item strong {
    color: #ffffff;
}

.page-header p,
.about-page-header p,
.contact-page-header p,
.content-panel p,
.admin-card p,
.test-card p,
.lesson-card p,
.material-title-block p:not(.eyebrow),
.related-materials-list span,
.comment-item p,
.bank-item p,
.bank-item span {
    color: var(--gray-700);
}

.compact-form input,
.compact-form select,
.compact-form textarea,
.auth-form input,
.auth-form select,
.auth-form textarea,
.admin-form input,
.admin-form select,
.admin-form textarea,
.site-feedback-panel textarea,
.comment-form textarea,
.reply-form textarea,
.search-page-form input {
    border-color: rgba(132, 146, 161, 0.3);
    color: var(--gray-900);
    background: rgba(2, 7, 24, 0.42);
}

.compact-form input:focus,
.compact-form select:focus,
.compact-form textarea:focus,
.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus,
.site-feedback-panel textarea:focus,
.comment-form textarea:focus,
.reply-form textarea:focus {
    border-color: rgba(77, 124, 255, 0.78);
    box-shadow: 0 0 0 3px rgba(77, 124, 255, 0.16);
}

.related-materials-list a,
.account-link-list a,
.account-tool-link,
.admin-table th,
.admin-table td {
    border-color: rgba(132, 146, 161, 0.2);
}

.related-materials-list a,
.admin-table th {
    background: rgba(2, 7, 24, 0.24);
}

.related-materials-list a.active,
.related-materials-list a:hover,
.test-card:hover,
.admin-card:hover,
.lesson-card:hover {
    border-color: rgba(77, 124, 255, 0.72);
    background:
        linear-gradient(145deg, rgba(15, 45, 135, 0.96), rgba(5, 10, 54, 0.94));
}

.material-preview,
.video-frame,
.watch-player,
.clean-material-shell {
    border-color: rgba(132, 146, 161, 0.28);
    background: rgba(2, 7, 24, 0.32);
}

.alert.success {
    color: #dcffe8;
    border: 1px solid rgba(34, 197, 94, 0.38);
    background: rgba(20, 83, 45, 0.55);
}

.alert.error {
    color: #ffe4e6;
    border: 1px solid rgba(248, 113, 113, 0.4);
    background: rgba(127, 29, 29, 0.48);
}

/* Site-wide accent layer matching the editor/account dashboard palette */
.content-panel,
.admin-card,
.test-card,
.lesson-card,
.stat-card,
.bank-item,
.account-games-panel,
.account-progress-panel,
.account-list-panel {
    position: relative;
    overflow: hidden;
}

.content-panel::before,
.admin-card::before,
.test-card::before,
.lesson-card::before,
.stat-card::before,
.bank-item::before,
.account-games-panel::before,
.account-progress-panel::before,
.account-list-panel::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--panel-accent, #4d7cff), rgba(77, 124, 255, 0.08));
    opacity: 0.8;
}

.admin-card:nth-child(4n + 1),
.test-card:nth-child(4n + 1),
.lesson-card:nth-child(4n + 1),
.bank-item:nth-child(4n + 1),
.account-game-row:nth-child(4n + 1),
.account-test-progress-row:nth-child(4n + 1),
.account-result-row:nth-child(4n + 1) {
    --panel-accent: #4d7cff;
    --row-accent: #4d7cff;
}

.admin-card:nth-child(4n + 2),
.test-card:nth-child(4n + 2),
.lesson-card:nth-child(4n + 2),
.bank-item:nth-child(4n + 2),
.account-game-row:nth-child(4n + 2),
.account-test-progress-row:nth-child(4n + 2),
.account-result-row:nth-child(4n + 2) {
    --panel-accent: #19d3ff;
    --row-accent: #19d3ff;
}

.admin-card:nth-child(4n + 3),
.test-card:nth-child(4n + 3),
.lesson-card:nth-child(4n + 3),
.bank-item:nth-child(4n + 3),
.account-game-row:nth-child(4n + 3),
.account-test-progress-row:nth-child(4n + 3),
.account-result-row:nth-child(4n + 3) {
    --panel-accent: #8b5cf6;
    --row-accent: #8b5cf6;
}

.admin-card:nth-child(4n + 4),
.test-card:nth-child(4n + 4),
.lesson-card:nth-child(4n + 4),
.bank-item:nth-child(4n + 4),
.account-game-row:nth-child(4n + 4),
.account-test-progress-row:nth-child(4n + 4),
.account-result-row:nth-child(4n + 4) {
    --panel-accent: #38bdf8;
    --row-accent: #38bdf8;
}

.content-panel,
.admin-card,
.test-card,
.lesson-card,
.stat-card,
.bank-item {
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--panel-accent, #4d7cff) 22%, transparent), transparent 34%),
        linear-gradient(145deg, rgba(9, 28, 92, 0.94), rgba(5, 10, 54, 0.96));
}

.content-panel:hover,
.admin-card:hover,
.test-card:hover,
.lesson-card:hover,
.bank-item:hover {
    border-color: color-mix(in srgb, var(--panel-accent, #4d7cff) 70%, rgba(132, 146, 161, 0.24));
}

.primary-button {
    background: linear-gradient(180deg, #2f75ff, #061ec2);
    box-shadow: 0 0 18px rgba(77, 124, 255, 0.24);
}

.secondary-button {
    border-color: rgba(77, 124, 255, 0.44);
    color: #dbe7ff;
    background: rgba(12, 27, 79, 0.9);
}

.nav-link.active,
.dropdown-link.active,
.account-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(77, 124, 255, 0.42), rgba(16, 92, 255, 0.18));
}

.site-header,
.side-nav {
    background:
        radial-gradient(circle at 20% 0%, rgba(77, 124, 255, 0.18), transparent 32%),
        rgba(2, 7, 24, 0.93);
}

html[data-theme="light"] .site-header,
html[data-theme="light"] .side-nav {
    background:
        radial-gradient(circle at 20% 0%, rgba(77, 124, 255, 0.12), transparent 32%),
        rgba(248, 251, 255, 0.94);
}

html[data-theme="light"] .page-header,
html[data-theme="light"] .content-panel,
html[data-theme="light"] .admin-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .test-card,
html[data-theme="light"] .lesson-card,
html[data-theme="light"] .search-result,
html[data-theme="light"] .contact-info-panel,
html[data-theme="light"] .site-feedback-panel,
html[data-theme="light"] .account-games-panel,
html[data-theme="light"] .account-progress-panel,
html[data-theme="light"] .account-list-panel,
html[data-theme="light"] .related-materials-panel,
html[data-theme="light"] .material-info,
html[data-theme="light"] .bank-item,
html[data-theme="light"] .modal-card {
    border-color: rgba(132, 146, 161, 0.28);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(238, 243, 249, 0.86));
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .admin-card:hover,
html[data-theme="light"] .test-card:hover,
html[data-theme="light"] .lesson-card:hover,
html[data-theme="light"] .search-result:hover,
html[data-theme="light"] .bank-item:hover {
    border-color: rgba(1, 4, 143, 0.42);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(229, 237, 249, 0.92));
}

html[data-theme="light"] .nav-link,
html[data-theme="light"] .dropdown-link,
html[data-theme="light"] .account-link,
html[data-theme="light"] .logout-link,
html[data-theme="light"] .contact-link {
    color: #334155;
}

html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link.active,
html[data-theme="light"] .dropdown-link:hover,
html[data-theme="light"] .dropdown-link.active,
html[data-theme="light"] .account-link:hover,
html[data-theme="light"] .account-link.active,
html[data-theme="light"] .contact-link:hover,
html[data-theme="light"] .contact-link.active {
    color: #01048f;
    background: rgba(1, 4, 143, 0.08);
}

html[data-theme="light"] .dropdown-menu,
html[data-theme="light"] .submenu-menu {
    border-color: rgba(132, 146, 161, 0.28);
    background: rgba(255, 255, 255, 0.94);
}

html[data-theme="light"] .site-search input,
html[data-theme="light"] .search-page-form input,
html[data-theme="light"] .admin-form input,
html[data-theme="light"] .admin-form select,
html[data-theme="light"] .admin-form textarea,
html[data-theme="light"] .auth-form input,
html[data-theme="light"] .comment-form textarea,
html[data-theme="light"] .reply-form textarea,
html[data-theme="light"] .site-feedback-panel textarea {
    border-color: rgba(132, 146, 161, 0.34);
    background: rgba(255, 255, 255, 0.94);
    color: #071226;
}

html[data-theme="light"] .admin-table th,
html[data-theme="light"] .admin-table td {
    border-color: rgba(132, 146, 161, 0.24);
}

html[data-theme="light"] .admin-table thead,
html[data-theme="light"] .table-wrap {
    background: rgba(255, 255, 255, 0.78);
}

html[data-theme="light"] .ai-assistant-panel,
html[data-theme="light"] .ai-assistant-head,
html[data-theme="light"] .ai-assistant-form {
    background: rgba(255, 255, 255, 0.94);
}

html[data-theme="light"] .ai-message.assistant {
    background: rgba(238, 243, 249, 0.94);
    color: #071226;
}

html[data-theme="light"] .page-admin-dashboard .admin-grid .admin-card {
    border-color: rgba(148, 163, 184, 0.38);
    background:
        radial-gradient(circle at 100% 0%, rgba(148, 163, 184, 0.14), transparent 36%),
        linear-gradient(145deg, rgba(243, 244, 246, 0.98), rgba(229, 231, 235, 0.94));
}

html[data-theme="light"] .page-admin-dashboard .admin-grid .admin-card:hover {
    border-color: rgba(107, 114, 128, 0.58);
    background:
        radial-gradient(circle at 100% 0%, rgba(148, 163, 184, 0.18), transparent 36%),
        linear-gradient(145deg, rgba(249, 250, 251, 0.98), rgba(209, 213, 219, 0.94));
}

.brand-mark,
.account-mini-icon,
.account-link-list span,
.question-nav-button.current,
.question-nav-button.answered.current {
    box-shadow: 0 0 20px rgba(77, 124, 255, 0.36);
}

.content-panel,
.admin-card,
.test-card,
.lesson-card,
.account-games-panel,
.account-progress-panel,
.account-list-panel {
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 0 24px color-mix(in srgb, var(--panel-accent, #4d7cff) 10%, transparent);
}

/* Text-only neon accents */
.page-header h1,
.about-page-header h1,
.contact-page-header h1,
.auth-copy h1,
.account-hero h1,
.material-title-block h1,
.path-world-title h2,
.active-test-card h2,
.test-finished-panel h2 {
    color: #f7fbff;
    text-shadow:
        0 0 14px rgba(25, 211, 255, 0.22),
        0 0 28px rgba(77, 124, 255, 0.16);
}

.content-panel h2,
.section-heading h2,
.admin-card h2,
.test-card h2,
.lesson-card h2,
.related-materials-panel h2,
.account-panel-head h2,
.account-list-panel h2,
.game-selector-panel h2,
.crossword-clues h2,
.matching-column h2 {
    color: #dff7ff;
    text-shadow: 0 0 12px rgba(25, 211, 255, 0.18);
}

.eyebrow,
.test-card span,
.test-meta-label,
.test-question-head span,
.admin-choice-card span,
.stat-card span,
.account-profile-info span,
.account-stat-card p,
.account-game-row small,
.account-test-progress-row small,
.material-info .eyebrow {
    color: #78e7ff;
    text-shadow: 0 0 10px rgba(25, 211, 255, 0.18);
}

.admin-card h2,
.test-card h2,
.lesson-card h2,
.account-game-row strong,
.account-test-progress-row strong,
.account-result-row strong,
.bank-item strong,
.comment-head strong {
    background: linear-gradient(90deg, #ffffff 0%, color-mix(in srgb, var(--panel-accent, #19d3ff) 74%, #ffffff 18%) 58%, #e8e2ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
}

.stat-card strong,
.account-stat-card strong,
.test-summary-panel strong,
.path-stat-button strong,
.account-game-row b,
.account-test-progress-row b,
.account-result-row b,
.question-nav-button.current,
.question-nav-button.answered.current {
    color: color-mix(in srgb, var(--panel-accent, #19d3ff) 78%, #ffffff 18%);
    text-shadow:
        0 0 10px color-mix(in srgb, var(--panel-accent, #19d3ff) 35%, transparent),
        0 0 20px rgba(77, 124, 255, 0.12);
}

.nav-link.active,
.dropdown-link.active,
.account-link.active,
.related-materials-list a.active,
.account-link-list a:hover,
.account-tool-link:hover,
.secondary-button:hover {
    color: #ecfeff;
    text-shadow: 0 0 12px rgba(25, 211, 255, 0.28);
}

.primary-button,
.auth-tabs a.active,
.auth-tabs button.active {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(220, 245, 255, 0.34);
}

.bank-list {
    display: grid;
    gap: 14px;
}

.bank-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.bank-item-head p,
.bank-item-head span {
    margin: 4px 0 0;
}

.status-pill {
    flex: 0 0 auto;
    border: 1px solid rgba(132, 146, 161, 0.3);
    border-radius: 999px;
    padding: 6px 10px;
    color: #b8c6dd;
    background: rgba(2, 7, 24, 0.32);
    font-size: 13px;
    font-weight: 700;
}

.status-pill.active {
    border-color: rgba(25, 211, 255, 0.48);
    color: #dff7ff;
    background: rgba(25, 211, 255, 0.12);
    text-shadow: 0 0 10px rgba(25, 211, 255, 0.28);
}

.bank-item.unread-message {
    border-color: rgba(25, 211, 255, 0.42);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.contact-bottom {
    display: block;
}

.unread-badge,
.unread-notice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(248, 113, 113, 0.62);
    color: #ffffff;
    background: linear-gradient(180deg, #ef4444, #991b1b);
    box-shadow: 0 0 18px rgba(248, 113, 113, 0.35);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.24);
    font-weight: 800;
}

.unread-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    min-width: 30px;
    height: 30px;
    border-radius: 999px;
    padding: 0 9px;
    font-size: 14px;
}

.unread-notice {
    width: fit-content;
    margin-top: 14px;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 15px;
}

@media (max-width: 980px) {
    .header-inner {
        flex-wrap: wrap;
        padding: 12px 0;
    }

    .site-search {
        order: 2;
        width: 100%;
        margin-left: 0;
    }

    .side-nav {
        position: sticky;
        top: 76px;
        width: 100%;
        max-height: 230px;
        padding: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--gray-200);
        display: block;
        overflow: visible;
    }

    .main-nav {
        display: flex;
        align-items: center;
        gap: 8px;
        overflow-x: auto;
        overflow-y: visible;
        flex: initial;
        scrollbar-width: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .side-nav .nav-link {
        width: auto;
        justify-content: center;
    }

    .dropdown-menu {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        min-width: 220px;
        max-height: none;
        display: grid;
        padding: 8px;
        border: 1px solid var(--gray-200);
        border-radius: 8px;
        background: var(--white);
        box-shadow: var(--shadow);
        opacity: 0;
        visibility: hidden;
        transform: translateY(6px);
        transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
    }

    .nav-dropdown:hover .dropdown-menu,
    .nav-dropdown:focus-within .dropdown-menu,
    .nav-dropdown.open .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .page-shell,
    .site-footer {
        margin-left: 0;
    }

    .side-account {
        display: flex;
        gap: 8px;
        margin-top: 10px;
        padding-top: 10px;
        overflow-x: auto;
    }

    .side-account .account-link,
    .side-account .logout-link,
    .side-account .contact-link {
        width: auto;
    }

    .page-shell {
        width: min(1180px, calc(100% - 32px));
        margin-right: auto;
        margin-left: auto;
    }

    .hero-section,
    .two-column,
    .auth-layout,
    .account-grid,
    .account-stat-grid,
    .account-profile-forms,
    .account-game-list,
    .account-main-grid,
    .account-bottom-grid,
    .admin-stats,
    .admin-grid,
    .admin-choice-grid,
    .game-settings-grid,
    .path-world-settings-block,
    .admin-form,
    .form-grid-two,
    .question-bank-grid,
    .lesson-grid,
    .test-card-grid,
    .test-entry-layout,
    .test-summary-panel,
    .public-options-list,
    .result-lines,
    .game-layout,
    .crossword-layout,
    .matching-board,
    .path-game-layout,
    .path-history-list,
    .watch-layout,
    .material-view-header,
    .material-layout {
        grid-template-columns: 1fr;
    }

    .account-test-progress-row {
        grid-template-columns: 1fr;
    }

    .account-test-progress-row span {
        justify-items: start;
    }

    .material-view-header .secondary-button {
        justify-self: center;
    }

    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .landing-book,
    .landing-chart,
    .landing-check,
    .landing-laptop,
    .landing-lightbulb,
    .landing-trophy,
    .landing-growth {
        opacity: 0.34;
    }
}

.crossword-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.test-result-card .question-explanation {
    display: grid;
    gap: 6px;
    margin-top: 14px;
}

.test-result-card .question-explanation.answer-correct {
    border-left-color: #15803d;
}

.test-result-card .question-explanation.answer-wrong {
    border-left-color: #b91c1c;
}

@media (max-width: 620px) {
    .header-inner,
    .page-shell,
    .footer-inner {
        width: min(100% - 24px, 1180px);
    }

    .brand-text {
        font-size: 19px;
    }

    .account-menu {
        width: auto;
        justify-content: space-between;
    }

    .site-search,
    .search-page-form,
    .feedback-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .hero-content h1,
    .page-header h1,
    .auth-copy h1 {
        font-size: 34px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .home-entry-card {
        padding: 26px 16px 16px;
    }

    .home-logo-wrap img {
        width: min(420px, 92%);
    }

    .landing-art {
        display: none;
    }

    .comment-item.reply {
        margin-left: 10px;
    }

    .path-world-stage {
        min-height: 0;
        padding: 18px;
    }

    .path-world-create-form,
    .path-world-edit-form,
    .path-world-item {
        grid-template-columns: 1fr;
    }

    .path-world-create-form .path-world-selector {
        grid-column: auto;
    }

    .path-world-item img {
        width: 100%;
        height: 180px;
    }

    .path-world-top,
    .path-world-actions {
        display: grid;
    }

    .path-stat-button {
        min-width: 0;
    }

    .path-question-card,
    .path-progress-card {
        right: 18px;
        width: calc(100% - 36px);
    }

    .path-question-card {
        top: 190px;
    }

    .path-game-page .path-question-card {
        top: 132px;
        max-height: calc(100% - 154px);
    }

}

/* Final palette tuning */
.page-admin-dashboard .admin-grid .admin-card {
    border-color: rgba(77, 124, 255, 0.46);
    background:
        radial-gradient(circle at 100% 0%, rgba(32, 157, 231, 0.2), transparent 36%),
        linear-gradient(145deg, rgba(9, 28, 92, 0.96), rgba(5, 10, 54, 0.96));
}

.page-admin-dashboard .admin-grid .admin-card:hover {
    border-color: rgba(32, 157, 231, 0.72);
    background:
        radial-gradient(circle at 100% 0%, rgba(32, 157, 231, 0.26), transparent 36%),
        linear-gradient(145deg, rgba(14, 46, 132, 0.98), rgba(5, 10, 54, 0.96));
}

html[data-theme="light"] .site-header,
html[data-theme="light"] .side-nav {
    border-color: rgba(168, 178, 187, 0.42);
    background:
        radial-gradient(circle at 20% 0%, rgba(32, 157, 231, 0.12), transparent 32%),
        rgba(252, 252, 252, 0.96);
}

html[data-theme="light"] .page-header,
html[data-theme="light"] .about-page-header,
html[data-theme="light"] .contact-page-header,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .content-panel,
html[data-theme="light"] .admin-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .test-card,
html[data-theme="light"] .lesson-card,
html[data-theme="light"] .search-result,
html[data-theme="light"] .contact-info-panel,
html[data-theme="light"] .site-feedback-panel,
html[data-theme="light"] .account-games-panel,
html[data-theme="light"] .account-progress-panel,
html[data-theme="light"] .account-list-panel,
html[data-theme="light"] .related-materials-panel,
html[data-theme="light"] .material-info,
html[data-theme="light"] .material-side,
html[data-theme="light"] .comments-panel,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .bank-item,
html[data-theme="light"] .comment-item,
html[data-theme="light"] .modal-card {
    border-color: rgba(168, 178, 187, 0.52);
    background:
        radial-gradient(circle at 100% 0%, rgba(32, 157, 231, 0.08), transparent 34%),
        linear-gradient(145deg, rgba(168, 178, 187, 0.28), rgba(252, 252, 252, 0.96));
    box-shadow: 0 16px 34px rgba(90, 103, 116, 0.12);
}

html[data-theme="light"] .admin-card:hover,
html[data-theme="light"] .test-card:hover,
html[data-theme="light"] .lesson-card:hover,
html[data-theme="light"] .search-result:hover,
html[data-theme="light"] .bank-item:hover,
html[data-theme="light"] .content-panel:hover {
    border-color: rgba(32, 157, 231, 0.58);
    background:
        radial-gradient(circle at 100% 0%, rgba(32, 157, 231, 0.12), transparent 34%),
        linear-gradient(145deg, rgba(168, 178, 187, 0.42), rgba(252, 252, 252, 0.98));
}

html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link.active,
html[data-theme="light"] .dropdown-link:hover,
html[data-theme="light"] .dropdown-link.active,
html[data-theme="light"] .account-link:hover,
html[data-theme="light"] .account-link.active,
html[data-theme="light"] .contact-link:hover,
html[data-theme="light"] .contact-link.active {
    color: #071226;
    background: rgba(168, 178, 187, 0.38);
}

html[data-theme="light"] .primary-button,
html[data-theme="light"] .admin-form .primary-button,
html[data-theme="light"] .auth-submit,
html[data-theme="light"] .search-submit {
    border-color: rgba(32, 157, 231, 0.58);
    background: linear-gradient(180deg, #35b5f1, #209de7);
    color: #ffffff;
}

html[data-theme="light"] .eyebrow,
html[data-theme="light"] .section-heading h2,
html[data-theme="light"] .content-panel h2,
html[data-theme="light"] .admin-card h2,
html[data-theme="light"] .test-card h2,
html[data-theme="light"] .lesson-card h2,
html[data-theme="light"] .admin-choice-card span,
html[data-theme="light"] .stat-card span {
    color: #209de7;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    text-shadow: none;
}

html[data-theme="light"] .content-panel p,
html[data-theme="light"] .admin-card p,
html[data-theme="light"] .test-card p,
html[data-theme="light"] .lesson-card p,
html[data-theme="light"] .admin-table th,
html[data-theme="light"] .admin-table td {
    color: #334155;
}

html[data-theme="light"] .compact-form input,
html[data-theme="light"] .compact-form select,
html[data-theme="light"] .compact-form textarea,
html[data-theme="light"] .auth-form input,
html[data-theme="light"] .auth-form select,
html[data-theme="light"] .auth-form textarea,
html[data-theme="light"] .admin-form input,
html[data-theme="light"] .admin-form select,
html[data-theme="light"] .admin-form textarea,
html[data-theme="light"] .site-search input,
html[data-theme="light"] .search-page-form input,
html[data-theme="light"] .site-feedback-panel textarea,
html[data-theme="light"] .comment-form textarea,
html[data-theme="light"] .reply-form textarea {
    border-color: rgba(168, 178, 187, 0.62);
    background: rgba(252, 252, 252, 0.96);
    color: #071226;
}

html[data-theme="light"] .compact-form input:focus,
html[data-theme="light"] .compact-form select:focus,
html[data-theme="light"] .compact-form textarea:focus,
html[data-theme="light"] .auth-form input:focus,
html[data-theme="light"] .auth-form select:focus,
html[data-theme="light"] .auth-form textarea:focus,
html[data-theme="light"] .admin-form input:focus,
html[data-theme="light"] .admin-form select:focus,
html[data-theme="light"] .admin-form textarea:focus,
html[data-theme="light"] .site-search input:focus,
html[data-theme="light"] .search-page-form input:focus,
html[data-theme="light"] .site-feedback-panel textarea:focus,
html[data-theme="light"] .comment-form textarea:focus,
html[data-theme="light"] .reply-form textarea:focus {
    border-color: #209de7;
    box-shadow: 0 0 0 3px rgba(32, 157, 231, 0.16);
}

html[data-theme="light"] .nav-link,
html[data-theme="light"] .dropdown-link,
html[data-theme="light"] .account-link,
html[data-theme="light"] .logout-link,
html[data-theme="light"] .contact-link {
    color: #209de7;
}

html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link.active,
html[data-theme="light"] .dropdown-link:hover,
html[data-theme="light"] .dropdown-link.active,
html[data-theme="light"] .account-link:hover,
html[data-theme="light"] .account-link.active,
html[data-theme="light"] .logout-link:hover,
html[data-theme="light"] .contact-link:hover,
html[data-theme="light"] .contact-link.active {
    color: #071226;
    background: rgba(168, 178, 187, 0.42);
}

html[data-theme="light"] .page-header h1,
html[data-theme="light"] .about-page-header h1,
html[data-theme="light"] .contact-page-header h1,
html[data-theme="light"] .auth-copy h1,
html[data-theme="light"] .account-hero h1,
html[data-theme="light"] .material-title-block h1,
html[data-theme="light"] .active-test-card h2,
html[data-theme="light"] .test-finished-panel h2,
html[data-theme="light"] .content-panel h2,
html[data-theme="light"] .section-heading h2,
html[data-theme="light"] .test-card h2,
html[data-theme="light"] .lesson-card h2,
html[data-theme="light"] .related-materials-panel h2,
html[data-theme="light"] .account-panel-head h2,
html[data-theme="light"] .account-list-panel h2,
html[data-theme="light"] .game-selector-panel h2,
html[data-theme="light"] .crossword-clues h2,
html[data-theme="light"] .matching-column h2 {
    color: #071226;
    text-shadow: none;
}

html[data-theme="light"] .eyebrow,
html[data-theme="light"] .test-card span,
html[data-theme="light"] .test-meta-label,
html[data-theme="light"] .test-question-head span,
html[data-theme="light"] .admin-choice-card span,
html[data-theme="light"] .stat-card span,
html[data-theme="light"] .account-profile-info span,
html[data-theme="light"] .account-stat-card p,
html[data-theme="light"] .account-game-row small,
html[data-theme="light"] .account-test-progress-row small,
html[data-theme="light"] .material-info .eyebrow {
    color: #209de7;
    text-shadow: none;
}

html[data-theme="light"] .admin-card h2,
html[data-theme="light"] .test-card h2,
html[data-theme="light"] .lesson-card h2,
html[data-theme="light"] .account-game-row strong,
html[data-theme="light"] .account-test-progress-row strong,
html[data-theme="light"] .account-result-row strong,
html[data-theme="light"] .bank-item strong,
html[data-theme="light"] .comment-head strong {
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    color: #071226;
}

html[data-theme="light"] .content-panel,
html[data-theme="light"] .admin-card,
html[data-theme="light"] .test-card,
html[data-theme="light"] .lesson-card,
html[data-theme="light"] .bank-item,
html[data-theme="light"] .comment-item,
html[data-theme="light"] .site-feedback-panel,
html[data-theme="light"] .contact-info-panel {
    color: #209de7;
}

html[data-theme="light"] .page-header h1,
html[data-theme="light"] .about-page-header h1,
html[data-theme="light"] .contact-page-header h1,
html[data-theme="light"] .auth-copy h1,
html[data-theme="light"] .account-hero h1,
html[data-theme="light"] .material-title-block h1,
html[data-theme="light"] .active-test-card h2,
html[data-theme="light"] .test-finished-panel h2,
html[data-theme="light"] .content-panel h2,
html[data-theme="light"] .section-heading h2,
html[data-theme="light"] .admin-card h2,
html[data-theme="light"] .test-card h2,
html[data-theme="light"] .lesson-card h2,
html[data-theme="light"] .related-materials-panel h2,
html[data-theme="light"] .account-panel-head h2,
html[data-theme="light"] .account-list-panel h2,
html[data-theme="light"] .game-selector-panel h2,
html[data-theme="light"] .crossword-clues h2,
html[data-theme="light"] .matching-column h2,
html[data-theme="light"] .content-panel p,
html[data-theme="light"] .admin-card p,
html[data-theme="light"] .test-card p,
html[data-theme="light"] .lesson-card p,
html[data-theme="light"] .admin-table th,
html[data-theme="light"] .admin-table td,
html[data-theme="light"] .bank-item p,
html[data-theme="light"] .bank-item span,
html[data-theme="light"] .comment-item p {
    color: #209de7;
    text-shadow: none;
}

html[data-theme="light"] .admin-card h2,
html[data-theme="light"] .test-card h2,
html[data-theme="light"] .lesson-card h2,
html[data-theme="light"] .account-game-row strong,
html[data-theme="light"] .account-test-progress-row strong,
html[data-theme="light"] .account-result-row strong,
html[data-theme="light"] .bank-item strong,
html[data-theme="light"] .comment-head strong {
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    color: #209de7;
}

html[data-theme="light"] .primary-button,
html[data-theme="light"] .admin-form .primary-button,
html[data-theme="light"] .auth-submit,
html[data-theme="light"] .search-submit,
html[data-theme="light"] .nav-link.active,
html[data-theme="light"] .dropdown-link.active,
html[data-theme="light"] .account-link.active,
html[data-theme="light"] .contact-link.active {
    border-color: rgba(32, 157, 231, 0.68);
    background: #209de7;
    color: #fcfcfc;
}

html[data-theme="light"] .primary-button *,
html[data-theme="light"] .admin-form .primary-button *,
html[data-theme="light"] .auth-submit *,
html[data-theme="light"] .search-submit *,
html[data-theme="light"] .nav-link.active *,
html[data-theme="light"] .dropdown-link.active *,
html[data-theme="light"] .account-link.active *,
html[data-theme="light"] .contact-link.active * {
    color: #fcfcfc;
}

html[data-theme="light"] .brand-mark,
html[data-theme="light"] .primary-button,
html[data-theme="light"] .secondary-button,
html[data-theme="light"] .auth-submit,
html[data-theme="light"] .search-submit,
html[data-theme="light"] .admin-form .primary-button,
html[data-theme="light"] .question-nav-button.current,
html[data-theme="light"] .question-nav-button.answered.current,
html[data-theme="light"] .question-nav-button.answered,
html[data-theme="light"] .path-step-marker,
html[data-theme="light"] .account-mini-icon,
html[data-theme="light"] .account-link-list span,
html[data-theme="light"] .admin-choice-card span,
html[data-theme="light"] .nav-link.active,
html[data-theme="light"] .dropdown-link.active,
html[data-theme="light"] .account-link.active,
html[data-theme="light"] .contact-link.active,
html[data-theme="light"] .logout-link:hover {
    border-color: rgba(32, 157, 231, 0.68);
    background: #209de7;
    color: #fcfcfc;
}

html[data-theme="light"] .brand-mark *,
html[data-theme="light"] .primary-button *,
html[data-theme="light"] .secondary-button *,
html[data-theme="light"] .auth-submit *,
html[data-theme="light"] .search-submit *,
html[data-theme="light"] .admin-form .primary-button *,
html[data-theme="light"] .question-nav-button.current *,
html[data-theme="light"] .question-nav-button.answered.current *,
html[data-theme="light"] .question-nav-button.answered *,
html[data-theme="light"] .path-step-marker *,
html[data-theme="light"] .account-mini-icon *,
html[data-theme="light"] .account-link-list span *,
html[data-theme="light"] .admin-choice-card span *,
html[data-theme="light"] .nav-link.active *,
html[data-theme="light"] .dropdown-link.active *,
html[data-theme="light"] .account-link.active *,
html[data-theme="light"] .contact-link.active *,
html[data-theme="light"] .logout-link:hover * {
    color: #fcfcfc;
}

html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .dropdown-link:hover,
html[data-theme="light"] .account-link:hover,
html[data-theme="light"] .contact-link:hover {
    color: #fcfcfc;
    background: #209de7;
}

html[data-theme="light"] .brand-text,
html[data-theme="light"] .page-header h1,
html[data-theme="light"] .about-page-header h1,
html[data-theme="light"] .contact-page-header h1,
html[data-theme="light"] .auth-copy h1,
html[data-theme="light"] .account-hero h1,
html[data-theme="light"] .material-title-block h1,
html[data-theme="light"] .active-test-card h2,
html[data-theme="light"] .test-finished-panel h2,
html[data-theme="light"] .content-panel h2,
html[data-theme="light"] .section-heading h2,
html[data-theme="light"] .admin-card h2,
html[data-theme="light"] .test-card h2,
html[data-theme="light"] .lesson-card h2,
html[data-theme="light"] .related-materials-panel h2,
html[data-theme="light"] .account-panel-head h2,
html[data-theme="light"] .account-list-panel h2,
html[data-theme="light"] .game-selector-panel h2,
html[data-theme="light"] .crossword-clues h2,
html[data-theme="light"] .matching-column h2,
html[data-theme="light"] .admin-card p,
html[data-theme="light"] .content-panel p,
html[data-theme="light"] .test-card p,
html[data-theme="light"] .lesson-card p,
html[data-theme="light"] .admin-table th,
html[data-theme="light"] .admin-table td,
html[data-theme="light"] .bank-item p,
html[data-theme="light"] .bank-item span,
html[data-theme="light"] .comment-item p,
html[data-theme="light"] .ai-input-wrap textarea,
html[data-theme="light"] .compact-form input,
html[data-theme="light"] .compact-form select,
html[data-theme="light"] .compact-form textarea,
html[data-theme="light"] .auth-form input,
html[data-theme="light"] .auth-form select,
html[data-theme="light"] .auth-form textarea,
html[data-theme="light"] .admin-form input,
html[data-theme="light"] .admin-form select,
html[data-theme="light"] .admin-form textarea,
html[data-theme="light"] .site-search input,
html[data-theme="light"] .search-page-form input,
html[data-theme="light"] .site-feedback-panel textarea,
html[data-theme="light"] .comment-form textarea,
html[data-theme="light"] .reply-form textarea {
    color: #209de7;
}

html[data-theme="light"] .feature-card,
html[data-theme="light"] .about-feature-grid .feature-card,
html[data-theme="light"] .ai-assistant-toggle,
html[data-theme="light"] .ai-assistant-form button,
html[data-theme="light"] .about-main-icon,
html[data-theme="light"] .brand-mark {
    border-color: rgba(32, 157, 231, 0.7);
    background: #209de7;
    color: #fcfcfc;
}

html[data-theme="light"] .feature-card *,
html[data-theme="light"] .about-feature-grid .feature-card *,
html[data-theme="light"] .ai-assistant-toggle *,
html[data-theme="light"] .ai-assistant-form button *,
html[data-theme="light"] .about-main-icon *,
html[data-theme="light"] .brand-mark * {
    color: #fcfcfc;
    text-shadow: none;
}

html[data-theme="light"] .feature-card h3,
html[data-theme="light"] .feature-card p,
html[data-theme="light"] .about-feature-grid .feature-card h3,
html[data-theme="light"] .about-feature-grid .feature-card p {
    color: #fcfcfc;
    text-shadow: none;
}

html[data-theme="light"] .feature-card:hover,
html[data-theme="light"] .about-feature-grid .feature-card:hover,
html[data-theme="light"] .ai-assistant-toggle:hover {
    border-color: rgba(32, 157, 231, 0.86);
    background: #209de7;
    box-shadow: 0 18px 34px rgba(32, 157, 231, 0.22);
}

html[data-theme="light"] .side-account .admin-link,
html[data-theme="light"] .side-account .account-link,
html[data-theme="light"] .side-account .logout-link,
html[data-theme="light"] .side-account .contact-link {
    color: #209de7;
}

html[data-theme="light"] .side-account .admin-link {
    border-color: rgba(32, 157, 231, 0.7);
    background: #209de7;
    color: #fcfcfc;
}

html[data-theme="light"] .side-account .admin-link.active,
html[data-theme="light"] .side-account .admin-link:hover,
html[data-theme="light"] .side-account .account-link.active,
html[data-theme="light"] .side-account .account-link:hover,
html[data-theme="light"] .side-account .logout-link:hover,
html[data-theme="light"] .side-account .contact-link.active,
html[data-theme="light"] .side-account .contact-link:hover {
    background: #209de7;
    color: #fcfcfc;
}

html[data-theme="light"] .side-account .admin-link *,
html[data-theme="light"] .side-account .admin-link.active *,
html[data-theme="light"] .side-account .admin-link:hover * {
    color: #fcfcfc;
}

html[data-theme="light"] .side-account .account-link.active,
html[data-theme="light"] .side-account a.account-link.active {
    border-color: rgba(32, 157, 231, 0.7) !important;
    background: #209de7 !important;
    color: #fcfcfc !important;
}

html[data-theme="light"] .side-account .account-link.active *,
html[data-theme="light"] .side-account a.account-link.active * {
    color: #fcfcfc !important;
}

html[data-theme="light"] .side-account a.account-link.active {
    border-color: rgba(32, 157, 231, 0.72) !important;
    background: #209de7 !important;
    color: #fcfcfc !important;
}

html[data-theme="light"] .side-account a.account-link.active:hover {
    border-color: rgba(168, 178, 187, 0.86) !important;
    background: #a8b2bb !important;
    color: #209de7 !important;
}

html[data-theme="light"] .side-account a.account-link.active:hover * {
    color: #209de7 !important;
}

html[data-theme="light"] .side-account .role-panel-link.admin-menu-link {
    border-color: rgba(32, 157, 231, 0.72) !important;
    background: #209de7 !important;
    color: #fcfcfc !important;
}

html[data-theme="light"] .side-account .role-panel-link.admin-menu-link:hover {
    border-color: rgba(168, 178, 187, 0.86) !important;
    background: #a8b2bb !important;
    color: #209de7 !important;
}

html[data-theme="light"] .side-account .role-panel-link.admin-menu-link *,
html[data-theme="light"] .side-account .role-panel-link.admin-menu-link:hover * {
    color: inherit !important;
}

/* Responsive layout layer */
.mobile-menu-toggle,
.mobile-nav-backdrop {
    display: none;
}

.mobile-menu-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    place-items: center;
    gap: 5px;
    border: 1px solid rgba(80, 125, 255, 0.38);
    border-radius: 8px;
    background: rgba(7, 18, 58, 0.76);
    box-shadow: 0 0 18px rgba(32, 157, 231, 0.16);
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #fcfcfc;
}

html[data-theme="light"] .mobile-menu-toggle {
    border-color: rgba(32, 157, 231, 0.42);
    background: #209de7;
}

.path-world-stage.template-ashxinf,
.path-world-stage.template-nk1,
.path-world-stage.template-nk3,
.path-world-stage.template-nk4,
.path-world-stage.template-nk5,
.path-world-stage.template-nk6 {
    align-items: center;
    justify-items: center;
}

.path-world-stage.template-ashxinf .path-image-layer,
.path-world-stage.template-nk1 .path-image-layer,
.path-world-stage.template-nk3 .path-image-layer,
.path-world-stage.template-nk4 .path-image-layer,
.path-world-stage.template-nk5 .path-image-layer,
.path-world-stage.template-nk6 .path-image-layer {
    max-height: 100%;
}

.path-world-stage.template-ashxinf .path-stage-map,
.path-world-stage.template-nk1 .path-stage-map,
.path-world-stage.template-nk3 .path-stage-map,
.path-world-stage.template-nk4 .path-stage-map,
.path-world-stage.template-nk5 .path-stage-map,
.path-world-stage.template-nk6 .path-stage-map {
    width: 100%;
    height: 100%;
}

.path-world-stage.template-ashxinf .path-stage-node,
.path-world-stage.template-nk1 .path-stage-node,
.path-world-stage.template-nk3 .path-stage-node,
.path-world-stage.template-nk4 .path-stage-node,
.path-world-stage.template-nk5 .path-stage-node,
.path-world-stage.template-nk6 .path-stage-node {
    aspect-ratio: 1;
}

@media (max-width: 980px) {
    body.mobile-nav-open {
        overflow: hidden;
    }

    .site-header {
        position: sticky;
        top: 0;
        z-index: 1200;
    }

    .header-inner {
        width: min(100% - 24px, 1180px);
        min-height: 70px;
        flex-wrap: nowrap;
        gap: 10px;
        padding: 8px 0;
    }

    .mobile-menu-toggle {
        display: grid;
    }

    .brand {
        min-width: 0;
    }

    .brand-mark {
        width: 46px;
        height: 46px;
        font-size: 18px;
    }

    .brand-text {
        font-size: clamp(20px, 4.8vw, 34px);
    }

    .site-search {
        order: 0;
        width: min(360px, 34vw);
        min-width: 180px;
        margin-left: auto;
    }

    .side-nav {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1300;
        display: flex;
        width: min(320px, 86vw);
        max-height: none;
        height: 100dvh;
        padding: 84px 14px 18px;
        border-right: 1px solid rgba(80, 125, 255, 0.34);
        border-bottom: 0;
        overflow: hidden;
        transform: translateX(-108%);
        transition: transform 0.22s ease;
    }

    body.mobile-nav-open .side-nav {
        transform: translateX(0);
    }

    .main-nav {
        display: grid;
        align-items: stretch;
        gap: 8px;
        flex: 1;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-width: thin;
    }

    .side-nav .nav-link {
        width: 100%;
        justify-content: flex-start;
    }

    .dropdown-menu {
        position: static;
        min-width: 0;
        max-height: 0;
        padding: 0 0 0 10px;
        border: 0;
        background: transparent;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-dropdown:hover .dropdown-menu,
    .nav-dropdown:focus-within .dropdown-menu,
    .nav-dropdown.open .dropdown-menu {
        max-height: 360px;
        padding-top: 6px;
        transform: none;
    }

    .side-account {
        display: grid;
        gap: 8px;
        margin-top: auto;
        padding-top: 14px;
        overflow-x: hidden;
    }

    .side-account .account-link,
    .side-account .logout-link,
    .side-account .contact-link {
        width: 100%;
    }

    .mobile-nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1250;
        width: 100%;
        height: 100%;
        border: 0;
        background: rgba(1, 6, 24, 0.56);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
    }

    body.mobile-nav-open .mobile-nav-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .page-shell,
    .site-footer {
        margin-left: 0 !important;
    }

    .page-shell {
        width: min(1180px, calc(100% - 28px));
        margin-right: auto !important;
        margin-left: auto !important;
    }

    .path-game-page {
        min-height: 100dvh;
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .path-game-page .page-shell {
        width: 100%;
        height: auto;
        min-height: calc(100dvh - 70px);
        margin: 0 !important;
        padding: 8px;
    }

    .path-world-stage {
        min-height: calc(100dvh - 86px);
        overflow: auto;
    }

    .path-world-stage.template-ashxinf .path-image-layer,
    .path-world-stage.template-nk1 .path-image-layer,
    .path-world-stage.template-nk3 .path-image-layer,
    .path-world-stage.template-nk4 .path-image-layer,
    .path-world-stage.template-nk5 .path-image-layer,
    .path-world-stage.template-nk6 .path-image-layer {
        width: min(100%, calc((100dvh - 104px) * 2.14));
    }

}

@media (max-width: 700px) {
    .header-inner {
        flex-wrap: wrap;
        align-content: center;
    }

    .site-search {
        order: 3;
        width: 100%;
        flex: 1 0 100%;
    }

    .site-search input {
        min-width: 0;
    }

    .theme-toggle {
        margin-left: auto;
    }

    .page-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 24px;
        padding-bottom: 36px;
    }

    .hero-section,
    .two-column,
    .auth-layout,
    .account-grid,
    .account-stat-grid,
    .account-profile-forms,
    .account-game-list,
    .account-main-grid,
    .account-bottom-grid,
    .admin-stats,
    .admin-grid,
    .admin-choice-grid,
    .game-settings-grid,
    .path-world-settings-block,
    .admin-form,
    .form-grid-two,
    .question-bank-grid,
    .lesson-grid,
    .test-card-grid,
    .test-entry-layout,
    .test-summary-panel,
    .public-options-list,
    .result-lines,
    .game-layout,
    .crossword-layout,
    .matching-board,
    .path-game-layout,
    .path-history-list,
    .watch-layout,
    .material-view-header,
    .material-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .path-game-page .page-shell {
        padding-top: 8px;
    }

    .path-world-stage {
        min-height: calc(100dvh - 138px);
        padding: 8px;
    }

    .path-world-stage.template-ashxinf .path-image-layer,
    .path-world-stage.template-nk1 .path-image-layer,
    .path-world-stage.template-nk3 .path-image-layer,
    .path-world-stage.template-nk4 .path-image-layer,
    .path-world-stage.template-nk5 .path-image-layer,
    .path-world-stage.template-nk6 .path-image-layer {
        width: 100%;
    }


    .path-question-card {
        width: calc(100% - 24px);
        max-height: calc(100dvh - 168px);
        padding: 52px 12px 16px;
    }

    .path-question-card .path-answer-form .path-match-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Fluid details for very different screens */
.crossword-grid {
    --crossword-cell-size: clamp(28px, 3.1vw, 38px);
    gap: clamp(2px, 0.35vw, 4px);
}

.crossword-cell {
    width: var(--crossword-cell-size);
    height: var(--crossword-cell-size);
    border-radius: clamp(4px, 0.6vw, 6px);
}

.crossword-cell input {
    padding: clamp(5px, 0.8vw, 8px) 3px 3px;
    font-size: clamp(13px, 1.55vw, 18px);
}

.crossword-cell small {
    font-size: clamp(7px, 0.8vw, 9px);
}

@media (max-width: 1180px), (max-height: 760px) {
    .landing-body {
        overflow: hidden;
    }

    .landing-shell,
    .landing-body .home-entry,
    .home-entry-card {
        min-height: 100dvh;
        height: 100dvh;
    }

    .home-entry-card {
        padding: clamp(10px, 1.7vh, 16px) clamp(16px, 3.6vw, 54px) clamp(8px, 1.6vh, 14px);
    }

    .home-logo-wrap {
        width: min(560px, 58vw);
        margin-bottom: clamp(0px, 0.4vh, 2px);
    }

    .home-logo-wrap .home-main-logo {
        width: min(560px, 54vw);
        max-height: clamp(70px, 13vh, 128px);
    }

    .home-subtitle {
        width: min(620px, 68vw);
        margin-bottom: clamp(5px, 1.1vh, 10px);
        font-size: clamp(14px, 2.2vw, 21px);
    }

    .home-info-panels {
        width: min(860px, 74vw);
        gap: clamp(6px, 1.1vh, 10px);
        margin-top: clamp(4px, 1vh, 10px);
    }

    .home-info-panel {
        grid-template-columns: clamp(48px, 6.4vw, 86px) minmax(0, 1fr);
        min-height: clamp(66px, 10.4vh, 96px);
        padding: clamp(8px, 1.35vh, 12px) clamp(12px, 1.9vw, 20px);
        gap: clamp(8px, 1.4vw, 14px);
    }

    .home-info-icon {
        width: clamp(40px, 5.2vw, 62px);
        height: clamp(40px, 5.2vw, 62px);
    }

    .home-info-panel h2 {
        font-size: clamp(13px, 1.7vw, 19px);
    }

    .home-info-panel p {
        font-size: clamp(11px, 1.25vw, 14px);
        line-height: 1.35;
    }

    .home-login-wrap {
        margin: clamp(6px, 1vh, 10px) 0 clamp(8px, 1.4vh, 12px);
    }

    .home-login-button {
        min-width: clamp(190px, 25vw, 310px);
        min-height: clamp(42px, 6vh, 54px);
        font-size: clamp(15px, 1.8vw, 19px);
    }

    .home-feature-grid {
        gap: clamp(6px, 1vw, 12px);
        width: min(1120px, 90vw);
    }

    .feature-card {
        padding: clamp(8px, 1.3vh, 16px) clamp(8px, 1.3vw, 14px);
    }

    .feature-icon {
        width: clamp(34px, 4.2vw, 54px);
        height: clamp(34px, 4.2vw, 54px);
    }

    .feature-card h3 {
        font-size: clamp(12px, 1.4vw, 16px);
    }

    .feature-card p {
        font-size: clamp(10px, 1.05vw, 13px);
        line-height: 1.35;
    }

    .landing-book {
        left: clamp(24px, 4.9vw, 94px);
        top: clamp(66px, 13.5vh, 124px);
        width: clamp(96px, 10.9vw, 210px);
    }

    .landing-chart {
        left: clamp(112px, 12.2vw, 234px);
        top: clamp(38px, 7.3vh, 67px);
        width: clamp(28px, 3.1vw, 58px);
    }

    .landing-check {
        left: clamp(62px, 6.8vw, 130px);
        top: clamp(48px, 9.3vh, 86px);
        width: clamp(24px, 2.4vw, 46px);
    }

    .landing-laptop {
        right: clamp(52px, 8.9vw, 170px);
        top: clamp(30px, 6vh, 55px);
        width: clamp(118px, 12.9vw, 248px);
    }

    .landing-lightbulb {
        left: clamp(144px, 15.6vw, 300px);
        top: clamp(58px, 11.3vh, 104px);
        width: clamp(34px, 3.65vw, 70px);
    }

    .landing-trophy {
        right: clamp(38px, 4.5vw, 86px);
        top: clamp(50px, 9.8vh, 90px);
        width: clamp(42px, 4.3vw, 82px);
    }

    .landing-bars {
        right: clamp(60px, 7vw, 134px);
        top: clamp(94px, 18.3vh, 168px);
        width: clamp(58px, 6.15vw, 118px);
    }
}

@media (max-width: 760px) {
    .landing-body {
        overflow-y: auto;
    }

    .landing-shell,
    .landing-body .home-entry,
    .home-entry-card {
        min-height: 100dvh;
        height: auto;
    }

    .home-entry-card {
        display: grid;
        align-content: start;
        padding: 12px 14px 18px;
        overflow: hidden;
    }

    .landing-art {
        display: block;
        opacity: 0.42;
    }

    .home-logo-wrap,
    .home-subtitle,
    .home-info-panels,
    .home-feature-grid {
        width: min(100%, 560px);
    }

    .home-logo-wrap .home-main-logo {
        width: min(360px, 78vw);
        max-height: 86px;
    }

    .home-info-panel {
        grid-template-columns: 46px minmax(0, 1fr);
        min-height: auto;
    }

    .home-feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .landing-book {
        left: 2vw;
        top: 92px;
        width: min(25vw, 120px);
    }

    .landing-chart {
        left: 22vw;
        top: 48px;
        width: min(7vw, 34px);
    }

    .landing-check {
        left: 10vw;
        top: 62px;
        width: min(6vw, 30px);
    }

    .landing-laptop {
        right: 3vw;
        top: 72px;
        width: min(30vw, 142px);
    }

    .landing-lightbulb {
        left: auto;
        right: 28vw;
        top: 72px;
        width: min(8vw, 38px);
    }

    .landing-trophy {
        right: 3vw;
        top: 138px;
        width: min(10vw, 48px);
    }

    .landing-bars {
        right: 10vw;
        top: 182px;
        width: min(13vw, 64px);
    }
}

@media (max-width: 480px) {
    .home-feature-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-info-panel p,
    .feature-card p {
        font-size: 11px;
    }

    .landing-art {
        opacity: 0.28;
    }
}

@media (max-width: 980px), (max-height: 760px) {
    .path-question-card h2 {
        font-size: clamp(16px, 2vw, 22px);
    }

    .path-question-card p,
    .path-question-progress {
        font-size: clamp(11px, 1.35vw, 14px);
    }

    .path-question-card {
        z-index: 12;
        width: min(520px, calc(100% - 24px));
        max-height: min(620px, calc(100dvh - 110px));
        padding: clamp(46px, 5.4vw, 58px) clamp(12px, 2vw, 20px) clamp(14px, 2vw, 20px);
    }

    .path-question-card .test-question-head {
        padding: 0 clamp(28px, 4vw, 48px);
        gap: 8px;
    }

    .path-question-close-form button,
    .path-result-close {
        width: clamp(28px, 3.6vw, 30px);
        height: clamp(28px, 3.6vw, 30px);
    }

    .crossword-layout {
        gap: clamp(10px, 2vw, 18px);
    }

    .crossword-board-panel,
    .crossword-clues {
        padding: clamp(12px, 2.2vw, 20px);
    }
}

@media (max-width: 620px) {
    .crossword-grid {
        --crossword-cell-size: clamp(24px, 7.2vw, 32px);
    }

    .crossword-board-panel {
        justify-items: start;
    }

    .crossword-clues {
        max-height: 42dvh;
    }

    .path-question-card {
        top: 50% !important;
        transform: translate(-50%, -50%);
        max-height: calc(100dvh - 150px);
    }
}

/* Keep Knowledge Path overlays proportional to the rendered game image on phones. */
@media (min-width: 0px) {
    .path-image-layer {
        container-type: inline-size;
    }

    .path-score-badge {
        left: 1.2cqi;
        top: 1.2cqi;
min-width: 9.1cqi;
padding: 0.74cqi 1.03cqi;
gap: 0.59cqi;
        border-width: max(1px, 0.055cqi);
border-radius: 0.59cqi;
    }

    .path-score-badge strong {
font-size: 1.92cqi;
    }

    .path-score-badge span {
font-size: 0.96cqi;
    }

    .path-progress-card {
right: 2.07cqi;
bottom: 2.07cqi;
width: 30.89cqi;
padding: 1.47cqi;
        border-width: max(1px, 0.055cqi);
        border-radius: 0.44cqi;
    }

    .path-progress-card h3 {
margin-bottom: 0.59cqi;
font-size: 1.62cqi;
    }

    .path-progress-card p {
margin-top: 0.59cqi;
font-size: 1.03cqi;
    }

    .path-progress-line {
height: 1.03cqi;
    }

    .path-world-stage .path-phase-badge {
left: 6.18cqi;
bottom: 1.92cqi;
min-width: 7.06cqi;
padding: 0.59cqi 1.11cqi 0.66cqi 1.26cqi;
gap: 0.96cqi;
        border-width: max(1px, 0.055cqi);
font-size: 1.17cqi;
    }

    .path-world-stage.template-ashxinf .path-stage-node,
    .path-world-stage.template-nk1 .path-stage-node,
    .path-world-stage.template-nk4 .path-stage-node,
    .path-world-stage.template-nk5 .path-stage-node,
    .path-world-stage.template-nk6 .path-stage-node {
width: 5% !important;
height: 10.7% !important;
    }

    .path-world-stage.template-nk3 .path-stage-node {
width: 7.32% !important;
height: 15.68% !important;
    }

    .path-stage-node span,
    .path-stage-node button {
        border-width: max(1px, 0.11cqi);
font-size: 1.62cqi;
    }

    .path-stage-node.done::after {
right: -0.3cqi;
bottom: -0.59cqi;
width: 2.2cqi;
height: 2.2cqi;
font-size: 1.11cqi;
    }

    .path-stage-stars {
top: -2.58cqi;
font-size: 2.28cqi;
letter-spacing: 0.22cqi;
    }
}

/* Proportional landing artwork and a single-column mobile content flow. */
.home-entry-card {
    container-type: inline-size;
}

@media (max-width: 760px) {
.landing-book {
    left: 4.9cqi;
    top: calc(6.46cqi + min(200px, 10.42cqi));
    width: 15.1cqi;
}

.landing-chart {
    left: 12.19cqi;
    top: calc(3.49cqi + min(200px, 10.42cqi));
    width: 4.16cqi;
}

.landing-check {
    left: 6.77cqi;
    top: calc(4.48cqi + min(200px, 10.42cqi));
    width: 3.31cqi;
}

.landing-laptop {
    right: 8.85cqi;
    top: calc(2.86cqi + min(200px, 10.42cqi));
    width: 17.83cqi;
}

.landing-lightbulb {
    left: 15.63cqi;
    right: auto;
    top: calc(5.42cqi + min(200px, 10.42cqi));
    width: 5.04cqi;
}

.landing-trophy {
    right: 4.48cqi;
    top: calc(4.69cqi + min(200px, 10.42cqi));
    width: 5.89cqi;
}

.landing-bars {
    right: 6.98cqi;
    top: calc(8.75cqi + min(200px, 10.42cqi));
    width: 8.48cqi;
}
}

@media (max-width: 760px) {
    .home-info-panels,
    .home-feature-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: clamp(8px, 2.7cqi, 14px);
    }

    .home-logo-wrap,
    .home-subtitle,
    .home-info-panels,
    .home-login-wrap,
    .home-feature-grid {
        width: min(100%, 560px);
        margin-right: auto;
        margin-left: auto;
    }

    .home-info-panel,
    .home-feature-grid .feature-card {
        min-height: auto;
    }

    .home-login-wrap {
        margin-top: clamp(8px, 2.7cqi, 14px);
        margin-bottom: clamp(8px, 2.7cqi, 14px);
    }

    .home-feature-grid {
        margin-top: clamp(8px, 2.7cqi, 14px);
    }

    .home-info-icon,
    .feature-icon {
        width: clamp(28px, 9cqi, 46px);
        height: clamp(28px, 9cqi, 46px);
    }

    .home-login-button {
        width: 100%;
        min-width: 0;
    }
}

/* Landing page sizing, spacing and scrolling. */
.landing-body {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

.landing-shell,
.landing-body .home-entry,
.landing-body .home-entry-card {
    height: auto;
    min-height: 100vh;
}

.home-entry-card {
    padding-bottom: clamp(32px, 4cqi, 72px);
    overflow-x: hidden;
    overflow-y: visible;
}

@media (max-width: 760px) {
    .home-logo-wrap {
        width: min(300px, 66cqi);
    }

    .home-logo-wrap .home-main-logo {
        width: min(300px, 62cqi);
        max-height: 72px;
    }

    .landing-art {
    opacity: 1;
    }
}

@media (min-width: 761px) {
    .home-logo-wrap {
        width: min(975px, 90%);
        margin-bottom: 2px;
    }

    .home-logo-wrap .home-main-logo {
        width: min(1005px, 87vw);
        max-height: 207px;
    }
}

/* Keep the active Knowledge Path question above every decorative/game layer. */
.path-world-stage .path-question-card {
    z-index: 60 !important;
}

/* Crossword: clearer feedback and a softer blue panel color. */
html:not([data-theme="light"]) .crossword-layout .crossword-board-panel,
html:not([data-theme="light"]) .crossword-layout .crossword-clues {
    border-color: #2f4da7;
    background: linear-gradient(145deg, #3658bd 0%, #2f4da7 56%, #29438f 100%);
}

html:not([data-theme="light"]) .crossword-layout .crossword-clues h2,
html:not([data-theme="light"]) .crossword-layout .crossword-clues .clue-item,
html:not([data-theme="light"]) .crossword-layout .crossword-clues .clue-item p,
html:not([data-theme="light"]) .crossword-layout .crossword-clues .clue-item strong,
html:not([data-theme="light"]) .crossword-layout .crossword-board-panel .test-question-head,
html:not([data-theme="light"]) .crossword-layout .crossword-board-panel .game-hint {
    color: #ffffff;
}

.crossword-cell input.correct {
    color: #ffffff;
    background: #15803d;
}

.crossword-cell input.wrong {
    color: #ffffff;
    background: #b91c1c;
}

/* Live-test control room and test archive. */
.live-panel-heading,
.live-section-heading,
.live-participant-heading,
.live-test-card-head,
.live-test-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.live-panel-heading {
    align-items: flex-start;
    margin-bottom: 16px;
}

.live-panel-heading h2,
.live-section-heading h2,
.live-test-card h3,
.live-test-card p {
    margin: 0;
}

.live-panel-heading small {
    color: var(--gray-700);
    font-weight: 700;
}

.live-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.live-status-badge.status-waiting { background: #b45309; }
.live-status-badge.status-active { background: #15803d; }
.live-status-badge.status-finished { background: #475569; }

.live-participant-heading {
    margin: 4px 0 10px;
}

.live-participant-heading > span,
.live-section-heading > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #ffffff;
    background: #2f4da7;
    font-size: 12px;
    font-weight: 900;
}

.live-participant-list {
    max-height: 330px;
    overflow-y: auto;
}

.live-tests-section {
    margin-top: 20px;
}

.live-section-heading {
    align-items: flex-start;
    margin-bottom: 18px;
}

.live-section-heading p {
    margin: 5px 0 0;
}

.live-tests-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.live-test-card {
    display: grid;
    gap: 15px;
    padding: 18px;
    border: 1px solid rgba(132, 146, 161, 0.34);
    border-radius: 12px;
    background: rgba(7, 22, 71, 0.62);
}

.live-test-card.is-selected {
    border-color: #2f4da7;
    box-shadow: 0 0 0 2px rgba(68, 110, 230, 0.22);
}

.live-test-card-head {
    align-items: flex-start;
}

.live-test-card-head > div > span,
.live-test-code > span {
    color: var(--gray-700);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.live-test-card h3 {
    margin-top: 4px;
    color: var(--gray-900);
    font-size: 18px;
}

.live-test-card p {
    color: var(--gray-700);
    font-weight: 700;
}

.live-test-code {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 13px;
    border-radius: 9px;
    background: rgba(68, 110, 230, 0.18);
}

.live-test-code strong {
    color: #ffffff;
    font-size: 21px;
    letter-spacing: 0.12em;
}

.live-test-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.live-test-meta > span {
    display: grid;
    gap: 2px;
    padding: 9px;
    border: 1px solid rgba(132, 146, 161, 0.25);
    border-radius: 8px;
    color: var(--gray-700);
    font-size: 12px;
    text-align: center;
}

.live-test-meta strong {
    color: var(--gray-900);
    font-size: 18px;
}

.live-test-card-actions {
    align-items: stretch;
}

.live-test-card-actions form {
    margin: 0;
}

html[data-theme="light"] .live-test-card {
    background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .live-test-code strong {
    color: #1e3a8a;
}

@media (max-width: 900px) {
    .live-tests-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .live-panel-heading,
    .live-section-heading,
    .live-test-card-head,
    .live-test-card-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .live-status-badge {
        align-self: flex-start;
    }

    .live-test-meta {
        grid-template-columns: 1fr;
    }
}

/* Unified site-wide panel color requested for all primary cards/windows. */
html:not([data-theme="light"]) .page-header,
html:not([data-theme="light"]) .hero-panel,
html:not([data-theme="light"]) .content-panel,
html:not([data-theme="light"]) .feature-card,
html:not([data-theme="light"]) .auth-card,
html:not([data-theme="light"]) .admin-card,
html:not([data-theme="light"]) .test-card,
html:not([data-theme="light"]) .lesson-card,
html:not([data-theme="light"]) .stat-card,
html:not([data-theme="light"]) .bank-item,
html:not([data-theme="light"]) .account-games-panel,
html:not([data-theme="light"]) .account-progress-panel,
html:not([data-theme="light"]) .account-list-panel,
html:not([data-theme="light"]) .search-result,
html:not([data-theme="light"]) .contact-info-panel,
html:not([data-theme="light"]) .site-feedback-panel,
html:not([data-theme="light"]) .related-materials-panel,
html:not([data-theme="light"]) .material-info,
html:not([data-theme="light"]) .material-side,
html:not([data-theme="light"]) .comments-panel,
html:not([data-theme="light"]) .comment-item,
html:not([data-theme="light"]) .modal-card {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: linear-gradient(145deg, #3658bd 0%, #2f4da7 56%, #29438f 100%) !important;
}

html:not([data-theme="light"]) .page-header,
html:not([data-theme="light"]) .hero-panel,
html:not([data-theme="light"]) .content-panel,
html:not([data-theme="light"]) .feature-card,
html:not([data-theme="light"]) .auth-card,
html:not([data-theme="light"]) .admin-card,
html:not([data-theme="light"]) .test-card,
html:not([data-theme="light"]) .lesson-card,
html:not([data-theme="light"]) .stat-card,
html:not([data-theme="light"]) .bank-item,
html:not([data-theme="light"]) .account-games-panel,
html:not([data-theme="light"]) .account-progress-panel,
html:not([data-theme="light"]) .account-list-panel,
html:not([data-theme="light"]) .search-result,
html:not([data-theme="light"]) .contact-info-panel,
html:not([data-theme="light"]) .site-feedback-panel,
html:not([data-theme="light"]) .related-materials-panel,
html:not([data-theme="light"]) .material-info,
html:not([data-theme="light"]) .material-side,
html:not([data-theme="light"]) .comments-panel,
html:not([data-theme="light"]) .comment-item,
html:not([data-theme="light"]) .modal-card {
    color: #ffffff;
}

/* Refined dark palette: deep navy balanced with the selected #2f4da7 blue. */
html:not([data-theme="light"]) {
    --blue-700: #86a0ff;
    --blue-600: #6383ee;
    --blue-100: rgba(111, 143, 255, 0.24);
    --blue-50: rgba(78, 111, 224, 0.16);
    --gray-900: #f7f9ff;
    --gray-700: #d5def8;
    --gray-500: #9aa9d3;
    --gray-200: rgba(151, 172, 238, 0.3);
    --gray-100: #101f54;
    --white: #142760;
    --shadow: 0 18px 44px rgba(1, 7, 31, 0.32);
}

html:not([data-theme="light"]) body {
    background:
        radial-gradient(circle at 78% 5%, rgba(47, 77, 167, 0.34), transparent 30%),
        radial-gradient(circle at 12% 18%, rgba(62, 94, 194, 0.22), transparent 34%),
        linear-gradient(155deg, #030a25 0%, #091744 48%, #02071d 100%);
}

html:not([data-theme="light"]) .site-header,
html:not([data-theme="light"]) .side-nav {
    border-color: rgba(126, 151, 235, 0.28);
    background:
        linear-gradient(135deg, rgba(19, 37, 96, 0.94), rgba(3, 11, 42, 0.96));
    box-shadow: 0 12px 34px rgba(1, 6, 28, 0.2);
    backdrop-filter: blur(18px);
}

html:not([data-theme="light"]) .page-header,
html:not([data-theme="light"]) .hero-panel,
html:not([data-theme="light"]) .content-panel,
html:not([data-theme="light"]) .feature-card,
html:not([data-theme="light"]) .auth-card,
html:not([data-theme="light"]) .admin-card,
html:not([data-theme="light"]) .test-card,
html:not([data-theme="light"]) .lesson-card,
html:not([data-theme="light"]) .stat-card,
html:not([data-theme="light"]) .bank-item,
html:not([data-theme="light"]) .account-games-panel,
html:not([data-theme="light"]) .account-progress-panel,
html:not([data-theme="light"]) .account-list-panel,
html:not([data-theme="light"]) .search-result,
html:not([data-theme="light"]) .contact-info-panel,
html:not([data-theme="light"]) .site-feedback-panel,
html:not([data-theme="light"]) .related-materials-panel,
html:not([data-theme="light"]) .material-info,
html:not([data-theme="light"]) .material-side,
html:not([data-theme="light"]) .comments-panel,
html:not([data-theme="light"]) .comment-item,
html:not([data-theme="light"]) .modal-card {
    border-color: rgba(132, 157, 240, 0.4) !important;
    background:
        radial-gradient(circle at 100% 0%, rgba(112, 143, 255, 0.2), transparent 38%),
        linear-gradient(145deg, #2f4da7 0%, #294493 48%, #1b326f 100%) !important;
    box-shadow:
        0 18px 42px rgba(1, 7, 31, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html:not([data-theme="light"]) .content-panel .bank-item,
html:not([data-theme="light"]) .content-panel .live-test-card,
html:not([data-theme="light"]) .admin-card .bank-item,
html:not([data-theme="light"]) .account-games-panel .bank-item,
html:not([data-theme="light"]) .account-progress-panel .bank-item {
    border-color: rgba(151, 174, 244, 0.3) !important;
    background:
        linear-gradient(135deg, rgba(13, 30, 82, 0.58), rgba(35, 61, 142, 0.5)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html:not([data-theme="light"]) .page-header h1,
html:not([data-theme="light"]) .content-panel h2,
html:not([data-theme="light"]) .content-panel h3,
html:not([data-theme="light"]) .admin-card h2,
html:not([data-theme="light"]) .admin-card h3,
html:not([data-theme="light"]) .feature-card h3,
html:not([data-theme="light"]) .test-card h2,
html:not([data-theme="light"]) .test-card h3,
html:not([data-theme="light"]) .lesson-card h2,
html:not([data-theme="light"]) .lesson-card h3 {
    color: #f8faff;
    text-shadow: 0 2px 14px rgba(4, 12, 49, 0.3);
}

html:not([data-theme="light"]) .page-header p,
html:not([data-theme="light"]) .content-panel p,
html:not([data-theme="light"]) .admin-card p,
html:not([data-theme="light"]) .feature-card p,
html:not([data-theme="light"]) .test-card p,
html:not([data-theme="light"]) .lesson-card p {
    color: #dce5ff;
}

html:not([data-theme="light"]) .primary-button,
html:not([data-theme="light"]) .auth-submit,
html:not([data-theme="light"]) .search-submit {
    border-color: rgba(163, 183, 255, 0.42);
    color: #ffffff;
    background: linear-gradient(180deg, #6685ed, #3655b8);
    box-shadow: 0 9px 22px rgba(4, 14, 59, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

html:not([data-theme="light"]) .primary-button:hover,
html:not([data-theme="light"]) .auth-submit:hover,
html:not([data-theme="light"]) .search-submit:hover {
    background: linear-gradient(180deg, #7896fa, #4464ca);
    box-shadow: 0 12px 28px rgba(3, 12, 54, 0.38), 0 0 18px rgba(106, 137, 239, 0.2);
}

html:not([data-theme="light"]) .secondary-button,
html:not([data-theme="light"]) .small-button {
    border-color: rgba(158, 180, 250, 0.4);
    color: #eef3ff;
    background: rgba(14, 32, 88, 0.52);
}

html:not([data-theme="light"]) input,
html:not([data-theme="light"]) select,
html:not([data-theme="light"]) textarea {
    border-color: rgba(150, 173, 241, 0.34);
    color: #f5f7ff;
    background: rgba(5, 16, 57, 0.7);
}

html:not([data-theme="light"]) input:focus,
html:not([data-theme="light"]) select:focus,
html:not([data-theme="light"]) textarea:focus {
    border-color: #8ea8ff;
    box-shadow: 0 0 0 3px rgba(112, 143, 255, 0.2);
    outline: 0;
}

html:not([data-theme="light"]) .nav-link:hover,
html:not([data-theme="light"]) .nav-link.active,
html:not([data-theme="light"]) .dropdown-link:hover,
html:not([data-theme="light"]) .dropdown-link.active,
html:not([data-theme="light"]) .account-link:hover,
html:not([data-theme="light"]) .account-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(79, 109, 211, 0.72), rgba(47, 77, 167, 0.44));
    box-shadow: inset 0 0 0 1px rgba(148, 171, 248, 0.16);
}

html:not([data-theme="light"]) .admin-table th {
    color: #f1f5ff;
    background: rgba(12, 29, 80, 0.58);
}

html:not([data-theme="light"]) .admin-table td {
    color: #dce5ff;
    border-color: rgba(151, 172, 238, 0.2);
}

html:not([data-theme="light"]) .side-account .account-link,
html:not([data-theme="light"]) .side-account .logout-link,
html:not([data-theme="light"]) .side-account .contact-link {
    border: 1px solid rgba(157, 179, 250, 0.38);
    color: #f4f7ff;
    background: linear-gradient(135deg, rgba(72, 101, 196, 0.86), rgba(47, 77, 167, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 7px 16px rgba(2, 8, 35, 0.16);
}

html:not([data-theme="light"]) .side-account .account-link.active,
html:not([data-theme="light"]) .side-account .role-panel-link {
    border-color: rgba(174, 192, 255, 0.58);
    color: #ffffff;
    background: linear-gradient(135deg, #5b78d8, #3e5cbd);
}

html:not([data-theme="light"]) .side-account .account-link:hover,
html:not([data-theme="light"]) .side-account .logout-link:hover,
html:not([data-theme="light"]) .side-account .contact-link:hover {
    border-color: rgba(196, 210, 255, 0.72);
    color: #ffffff;
    background: linear-gradient(135deg, #6b87e5, #4a68ca);
}

html:not([data-theme="light"]) .admin-choice-card {
    border-color: rgba(145, 168, 245, 0.46);
    background:
        radial-gradient(circle at 100% 0%, rgba(126, 151, 240, 0.18), transparent 38%),
        linear-gradient(145deg, #2f4da7 0%, #294493 54%, #20397d 100%);
    box-shadow: 0 18px 38px rgba(1, 7, 31, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html:not([data-theme="light"]) .admin-choice-card:hover {
    border-color: rgba(184, 201, 255, 0.7);
    background:
        radial-gradient(circle at 100% 0%, rgba(150, 173, 255, 0.24), transparent 40%),
        linear-gradient(145deg, #3b5ab7 0%, #3150a5 54%, #29458f 100%);
}

html:not([data-theme="light"]) .admin-choice-card span {
    color: #f2f6ff;
    background: rgba(105, 136, 235, 0.56);
    box-shadow: inset 0 0 0 1px rgba(190, 205, 255, 0.12);
}

html:not([data-theme="light"]) .admin-choice-card p {
    color: #dce5ff;
}

/* Keep every sidebar label inside the menu without horizontal scrolling. */
.side-nav,
.side-nav .main-nav,
.side-nav .nav-dropdown,
.side-nav .dropdown-menu,
.side-nav .submenu-item,
.side-nav .submenu-menu {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.side-nav .nav-link,
.side-nav .dropdown-toggle,
.side-nav .dropdown-link,
.side-nav .account-link,
.side-nav .logout-link,
.side-nav .contact-link {
    max-width: 100%;
    height: auto;
    min-height: 40px;
    padding-top: 9px;
    padding-bottom: 9px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.28;
    text-align: left;
}

.side-nav .dropdown-toggle {
    gap: 8px;
}

.side-nav .dropdown-arrow {
    flex: 0 0 auto;
}

@media (max-width: 980px) {
    .side-nav .main-nav {
        display: grid;
        align-items: stretch;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .side-nav .nav-link,
    .side-nav .dropdown-toggle,
    .side-nav .dropdown-link {
        width: 100%;
        justify-content: flex-start;
    }
}
