h1:focus {
    outline: none;
}

:root {
    --font-main: Arial, Helvetica, sans-serif;
    --page-bg: #050509;
    --surface: rgba(14, 15, 22, 0.9);
    --surface-soft: rgba(25, 21, 41, 0.92);
    --surface-muted: rgba(20, 23, 34, 0.88);
    --text: #f7f4ff;
    --text-muted: #b6aec8;
    --line: rgba(255, 255, 255, 0.14);
    --primary: #df2bd2;
    --primary-strong: #61dfff;
    --warm: rgba(247, 41, 185, 0.18);
    --warm-strong: #ffffff;
    --danger: #ff5f7a;
    --shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
    --neon-pink: #ff2bd6;
    --neon-blue: #4fe6ff;
    --deep-panel: rgba(9, 10, 16, 0.76);
}

body {
    margin: 0;
    font-family: var(--font-main);
    color: var(--text);
    background: var(--page-bg);
}

a {
    color: var(--primary-strong);
}

.site-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--text);
    background:
        linear-gradient(90deg, rgba(255, 43, 214, 0.12), transparent 22%, transparent 78%, rgba(79, 230, 255, 0.08)),
        linear-gradient(180deg, #0f1018 0%, #050509 44%, #030305 100%);
    overflow-x: hidden;
}

.site-shell.dark-theme {
    color-scheme: dark;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 68px;
    padding: 12px clamp(16px, 5vw, 56px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(6, 6, 10, 0.76);
    backdrop-filter: blur(14px);
}

.dark-theme .app-header {
    border-bottom-color: rgba(255, 255, 255, 0.14);
    background: rgba(6, 6, 10, 0.76);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.brand-mark {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid rgba(79, 230, 255, 0.34);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(79, 230, 255, 0.08);
    box-shadow: 0 0 18px rgba(79, 230, 255, 0.18);
    font-size: 13px;
    letter-spacing: 0;
}

.app-header nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.app-header nav a,
.nav-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    background: transparent;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}

.nav-button.ghost {
    border-color: rgba(79, 230, 255, 0.34);
    background: rgba(255, 255, 255, 0.03);
}

.nav-button.secondary {
    border-color: rgba(255, 43, 214, 0.32);
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    box-shadow: 0 0 18px rgba(255, 43, 214, 0.16);
}

.user-email {
    max-width: 210px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-content {
    flex: 1;
    min-height: calc(100vh - 68px);
    padding: clamp(18px, 4vw, 48px);
}

.app-content:has(.neon-home),
.app-content:has(.legal-page),
.app-content:has(.test-taking-page) {
    padding: 0;
}

.app-footer {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    justify-content: center;
    padding: 14px clamp(16px, 5vw, 56px) 18px;
    background: rgba(13, 13, 18, 0.86);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 20px;
}

.footer-legal-links a {
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.92rem;
    text-decoration: none;
}

.footer-legal-links a:hover,
.footer-legal-links a:focus-visible {
    color: #ffffff;
}

.footer-help-button {
    display: inline-flex;
    min-width: 168px;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 43, 214, 0.72);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.03);
    box-shadow:
        0 0 18px rgba(255, 43, 214, 0.28),
        inset 0 0 18px rgba(79, 230, 255, 0.06);
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
}

.home-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
    min-height: calc(100vh - 154px);
    align-items: center;
    gap: clamp(28px, 7vw, 84px);
    padding: clamp(42px, 8vw, 92px) clamp(18px, 5vw, 72px);
    overflow: hidden;
}

.neon-home {
    background:
        linear-gradient(90deg, rgba(255, 43, 214, 0.12), transparent 28%, transparent 72%, rgba(255, 43, 214, 0.16)),
        linear-gradient(180deg, rgba(35, 43, 49, 0.42), rgba(2, 2, 5, 0.88) 42%, rgba(2, 2, 4, 0.98));
}

.neon-home::before,
.neon-home::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.neon-home::before {
    background:
        linear-gradient(135deg, transparent 0 9%, rgba(255, 43, 214, 0.86) 9.3% 9.7%, transparent 10% 100%) left 70% / 280px 280px no-repeat,
        linear-gradient(315deg, transparent 0 11%, rgba(255, 43, 214, 0.72) 11.2% 11.6%, transparent 12% 100%) right 24% / 300px 300px no-repeat,
        linear-gradient(90deg, transparent 0 45%, rgba(79, 230, 255, 0.32) 45% 46%, transparent 46.4% 100%) left 64% / 190px 160px no-repeat,
        linear-gradient(90deg, transparent 0 44%, rgba(255, 43, 214, 0.36) 44% 45%, transparent 45.4% 100%) right 18% / 180px 180px no-repeat;
    opacity: 0.86;
}

.neon-home::after {
    background:
        linear-gradient(120deg, rgba(255, 43, 214, 0.48), transparent 22%) left bottom / 320px 320px no-repeat,
        linear-gradient(235deg, rgba(255, 43, 214, 0.46), transparent 24%) right center / 330px 340px no-repeat,
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 24%);
    mix-blend-mode: screen;
    opacity: 0.72;
}

.hero-main,
.telegram-promo {
    position: relative;
    z-index: 1;
}

.hero-main {
    display: grid;
    gap: clamp(56px, 10vw, 96px);
    align-self: stretch;
    align-content: center;
}

.hero-copy {
    display: grid;
    gap: 18px;
    text-align: center;
}

.hero-title.mud-typography {
    color: #ffffff;
    font-size: clamp(2.4rem, 5.7vw, 4.7rem);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: 0;
    text-shadow: 0 0 28px rgba(255, 255, 255, 0.18);
}

.hero-subtitle.mud-typography {
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(1.25rem, 2.8vw, 2rem);
    font-weight: 400;
    letter-spacing: 0;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.hero-tests-button.mud-button-root {
    min-width: 148px;
    min-height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(90deg, #7431f2, #ef2aa7);
    box-shadow:
        0 0 24px rgba(255, 43, 214, 0.34),
        inset 0 0 16px rgba(255, 255, 255, 0.12);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.telegram-promo {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 12px;
    text-align: center;
}

.telegram-promo img {
    width: min(320px, 100%);
    aspect-ratio: 1;
    object-fit: contain;
    filter: drop-shadow(0 0 28px rgba(255, 43, 214, 0.35));
}

.telegram-promo p {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.1rem, 2.2vw, 1.55rem);
    font-weight: 700;
    line-height: 1.15;
    text-transform: lowercase;
}

.telegram-promo span {
    color: #bd77ff;
    font-size: clamp(1rem, 1.9vw, 1.35rem);
    font-weight: 700;
}

.telegram-promo a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    border: 1px solid rgba(79, 230, 255, 0.72);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.02);
    box-shadow:
        0 0 18px rgba(79, 230, 255, 0.22),
        inset 0 0 16px rgba(255, 43, 214, 0.1);
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
}

.home-section {
    display: grid;
    gap: 26px;
    max-width: 1120px;
    margin: 0 auto;
    padding: clamp(46px, 8vw, 90px) 0;
}

.section-heading {
    display: grid;
    gap: 8px;
    max-width: 720px;
}

.section-heading p,
.section-heading .mud-typography-body1 {
    color: var(--text-muted);
}

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

.feature-item,
.pricing-card,
.catalog-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(34, 74, 80, 0.08);
}

.feature-item {
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 22px;
}

.feature-item h3,
.feature-item p {
    margin: 0;
}

.feature-item p {
    color: var(--text-muted);
    line-height: 1.55;
}

.pricing-card {
    display: grid;
    gap: 6px;
    padding: 20px;
}

.pricing-card span,
.pricing-card small {
    color: var(--text-muted);
}

.pricing-card strong {
    color: var(--text);
    font-size: 2rem;
}

.pricing-action.mud-button-root {
    justify-self: start;
}

.purchase-legal-panel {
    display: grid;
    gap: 12px;
    max-width: 860px;
    padding: 18px;
    border: 1px solid rgba(160, 151, 255, 0.22);
    border-radius: 8px;
    background:
        radial-gradient(circle at 92% 0%, rgba(255, 43, 214, 0.12), transparent 36%),
        rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
}

.purchase-legal-panel h2,
.purchase-legal-panel p {
    margin: 0;
}

.purchase-legal-panel h2 {
    color: var(--text);
    font-size: 1.2rem;
}

.purchase-legal-panel a {
    color: var(--primary-strong);
    font-weight: 700;
    text-decoration: none;
}

.purchase-legal-panel a:hover,
.purchase-legal-panel a:focus-visible {
    text-decoration: underline;
}

.catalog-page {
    display: grid;
    gap: 24px;
    max-width: 1160px;
    margin: 0 auto;
}

.catalog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.catalog-heading p,
.catalog-heading .mud-typography-body1 {
    color: var(--text-muted);
}

.catalog-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(180px, 260px) minmax(180px, 260px);
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

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

.catalog-card {
    display: grid;
    gap: 18px;
    padding: clamp(18px, 3vw, 26px);
}

.catalog-card-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.catalog-card h2,
.catalog-card p {
    margin: 0;
}

.catalog-card h2 {
    margin-top: 5px;
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    letter-spacing: 0;
}

.catalog-card p,
.catalog-test-info span,
.catalog-test-info small,
.catalog-meta {
    color: var(--text-muted);
}

.catalog-meta {
    font-size: 0.9rem;
    font-weight: 700;
}

.catalog-tests {
    display: grid;
    gap: 10px;
}

.catalog-test-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.catalog-test-info {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.catalog-test-info strong,
.catalog-test-info span {
    overflow-wrap: anywhere;
}

.catalog-test-action.mud-button-root {
    min-width: 140px;
}

.learn-page {
    display: grid;
    gap: 26px;
    max-width: 1180px;
    margin: 0 auto;
}

.learn-heading {
    display: grid;
    gap: 10px;
}

.learn-heading .mud-typography-h3 {
    color: var(--text);
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    font-weight: 700;
    letter-spacing: 0;
}

.learn-heading .mud-typography-body1 {
    color: var(--text-muted);
    font-size: clamp(1rem, 1.8vw, 1.15rem);
}

.learn-tree {
    display: grid;
    gap: 14px;
}

.learn-subject {
    padding: clamp(14px, 2vw, 22px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 18px 42px rgba(34, 74, 80, 0.08);
}

.learn-node {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    width: 100%;
    border: 0;
    color: var(--text);
    font: inherit;
    text-align: left;
}

button.learn-node {
    cursor: pointer;
}

.learn-subject-node {
    padding: 8px 0 16px;
    background: transparent;
}

.learn-node-icon {
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    flex: 0 0 auto;
}

.subject-icon {
    color: #ffffff;
    background: rgba(115, 49, 242, 0.28);
}

.semester-icon {
    color: #ffffff;
    background: rgba(138, 77, 255, 0.24);
}

.colloquium-icon {
    color: #ffffff;
    background: rgba(79, 230, 255, 0.16);
}

.test-icon {
    color: #ffffff;
    background: rgba(255, 43, 214, 0.15);
}

.learn-node-main {
    display: flex;
    gap: 22px;
    align-items: baseline;
    min-width: 0;
}

.learn-node-main strong {
    color: var(--text);
    font-size: 1.25rem;
    overflow-wrap: anywhere;
}

.learn-node-main small {
    color: var(--text-muted);
    font-size: 0.95rem;
    white-space: nowrap;
}

.learn-children {
    display: grid;
}

.learn-collapse {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
        grid-template-rows 190ms ease,
        opacity 160ms ease,
        margin 190ms ease,
        padding 190ms ease,
        border-color 190ms ease;
}

.learn-collapse.is-expanded {
    grid-template-rows: 1fr;
    opacity: 1;
    pointer-events: auto;
}

.learn-panel-inner {
    min-height: 0;
    overflow: hidden;
}

.subject-children {
    gap: 12px;
    padding: 0 6px;
}

.learn-semester {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.learn-semester-node {
    min-height: 66px;
    padding: 12px 16px;
    background: linear-gradient(90deg, rgba(60, 34, 92, 0.78), rgba(18, 20, 31, 0.9));
}

.question-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.semester-children {
    position: relative;
    gap: 10px;
    padding: 12px 12px 12px 34px;
    background: rgba(9, 14, 22, 0.92);
}

.semester-children.is-collapsed {
    padding-top: 0;
    padding-bottom: 0;
}

.semester-children::before {
    content: "";
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 18px;
    width: 3px;
    border-radius: 99px;
    background: #b9d9f4;
    opacity: 1;
    transition: opacity 160ms ease;
}

.semester-children.is-collapsed::before {
    opacity: 0;
}

.learn-colloquium {
    overflow: hidden;
    border: 1px solid rgba(79, 230, 255, 0.22);
    border-radius: 8px;
    background: rgba(8, 12, 20, 0.88);
    box-shadow: 0 8px 20px rgba(37, 103, 184, 0.08);
}

.learn-colloquium-node {
    min-height: 66px;
    padding: 12px 18px;
    border-left: 4px solid var(--neon-blue);
    background: linear-gradient(90deg, rgba(28, 64, 86, 0.62), rgba(12, 17, 28, 0.92));
}

.learn-node-toggle {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    min-width: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.learn-icon-button {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 0;
    color: #15355b;
    background: transparent;
    cursor: pointer;
}

.telegram-link {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: #1e63d6;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.learn-tests {
    display: grid;
    gap: 0;
    margin: 0 10px 12px 58px;
    padding: 8px 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.learn-tests.is-collapsed {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-color: transparent;
}

.learn-test-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 16px;
    align-items: center;
    min-height: 78px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.learn-test-row:last-child {
    border-bottom: 0;
}

.learn-test-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.learn-test-main strong {
    color: var(--text);
    overflow-wrap: anywhere;
}

.learn-test-main span {
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.question-count {
    color: #dcecff;
    background: rgba(79, 230, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(79, 230, 255, 0.18);
}

.learn-test-action.mud-button-root {
    min-width: 116px;
    min-height: 44px;
    border-radius: 8px;
    font-weight: 700;
}

.learn-note {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin: 8px 0 0;
    color: var(--text-muted);
    text-align: center;
}

.dark-theme .learn-semester-node,
.dark-theme .learn-colloquium-node {
    background: var(--surface-muted);
}

.dark-theme .semester-children {
    background: #14201f;
}

.dark-theme .question-count {
    color: #c8d6e5;
    background: #202b33;
    box-shadow: inset 0 0 0 1px #31404c;
}

.dark-theme .learn-icon-button {
    color: var(--text);
}

.dark-theme .semester-children::before {
    background: #365c78;
}

.dark-theme .learn-colloquium {
    border-color: #29445c;
    background: var(--surface);
}

.test-runner {
    max-width: 760px;
    margin: 0 auto;
}

.test-taking-page {
    position: relative;
    min-height: calc(100vh - 136px);
    padding: clamp(22px, 5vw, 64px);
    overflow: hidden;
    background:
        linear-gradient(135deg, transparent 0 8%, rgba(255, 43, 214, 0.78) 8.2% 8.6%, transparent 8.9% 100%) left center / 260px 360px no-repeat,
        linear-gradient(315deg, transparent 0 8%, rgba(255, 43, 214, 0.7) 8.2% 8.7%, transparent 9% 100%) right center / 280px 360px no-repeat,
        linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 18%),
        linear-gradient(90deg, #10151b 0 10%, #65717b 22%, #78848c 50%, #65717b 78%, #10151b 90% 100%);
}

.test-taking-page::before,
.test-taking-page::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.test-taking-page::before {
    inset: 0;
    background:
        linear-gradient(90deg, rgba(4, 5, 8, 0.92), transparent 18%, transparent 82%, rgba(4, 5, 8, 0.92)),
        linear-gradient(180deg, rgba(5, 6, 10, 0.9), transparent 16%, transparent 84%, rgba(5, 6, 10, 0.9)),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 18px);
    mix-blend-mode: multiply;
}

.test-taking-page::after {
    inset: 0;
    background:
        linear-gradient(90deg, transparent 0 45%, rgba(255, 43, 214, 0.55) 45.2% 45.8%, transparent 46% 100%) left top / 360px 90px no-repeat,
        linear-gradient(90deg, transparent 0 45%, rgba(255, 43, 214, 0.55) 45.2% 45.8%, transparent 46% 100%) right bottom / 360px 90px no-repeat,
        linear-gradient(135deg, transparent 0 10%, rgba(79, 230, 255, 0.38) 10.2% 10.6%, transparent 10.9% 100%) left bottom / 240px 240px no-repeat;
    opacity: 0.72;
}

.test-taking-page > * {
    position: relative;
    z-index: 1;
}

.test-taking-page .test-runner {
    max-width: min(860px, 100%);
}

.test-taking-page .mud-typography-h5,
.test-taking-page .mud-typography-h6,
.pending-session-panel .mud-typography-h4 {
    color: #ffffff;
    text-shadow: 0 0 18px rgba(0, 0, 0, 0.28);
}

.runner-card.mud-paper {
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    color: #f8fbff;
    background: rgba(11, 12, 18, 0.76);
    box-shadow:
        0 18px 48px rgba(0, 0, 0, 0.36),
        inset 0 0 24px rgba(79, 230, 255, 0.04);
    backdrop-filter: blur(12px);
}

.answer-option-card.mud-paper {
    border-color: rgba(255, 255, 255, 0.18) !important;
    border-radius: 8px;
    color: #f8fbff;
    background: rgba(255, 255, 255, 0.055);
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.answer-option-card.mud-paper:hover {
    border-color: rgba(79, 230, 255, 0.56) !important;
    background: rgba(79, 230, 255, 0.08);
    box-shadow: 0 0 18px rgba(79, 230, 255, 0.08);
}

.runner-question {
    min-height: 320px;
}

.admin-question-image-preview,
.test-question-image {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 8px;
}

.admin-question-image-preview {
    max-width: 420px;
    padding: 8px;
    border: 1px solid rgba(7, 30, 42, 0.16);
    background: #f8fbff;
}

.test-question-image {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.22);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
}

.result-question-image {
    max-height: 320px;
    border-color: rgba(7, 30, 42, 0.14);
    background: #f8fbff;
    box-shadow: none;
}

.result-answer {
    border-radius: 8px;
}

.answer-correct {
    background: #effaf1;
    border-color: #8fd19e;
}

.answer-wrong {
    background: #fff0f0;
    border-color: #f2a6a6;
}

.answer-neutral {
    background: #ffffff;
}

@media (max-width: 640px) {
    .app-header {
        align-items: stretch;
        padding: 14px 16px;
        gap: 12px;
    }

    .brand {
        justify-content: center;
    }

    .app-header nav {
        justify-content: center;
        gap: 10px;
    }

    .app-header nav a,
    .nav-button {
        min-height: 36px;
        padding: 7px 10px;
        font-size: 0.9rem;
    }

    .app-content {
        padding: 16px;
    }

    .home-hero {
        grid-template-columns: 1fr;
        min-height: calc(100vh - 146px);
        gap: 34px;
        padding: 40px 18px 58px;
        text-align: center;
    }

    .hero-tests-button.mud-button-root {
        justify-self: center;
        min-height: 46px;
        font-size: 0.95rem;
    }

    .telegram-promo img {
        width: min(230px, 72vw);
    }

    .telegram-promo p {
        font-size: 1.05rem;
    }

    .telegram-promo span {
        font-size: 1rem;
    }

    .feature-grid,
    .pricing-grid,
    .catalog-filters {
        grid-template-columns: 1fr;
    }

    .catalog-heading,
    .catalog-card-head,
    .catalog-test-row {
        display: grid;
    }

    .catalog-test-action.mud-button-root {
        width: 100%;
    }

    .learn-page {
        gap: 18px;
    }

    .learn-subject {
        padding: 12px;
    }

    .learn-node,
    .learn-colloquium-node {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .learn-subject-node,
    .learn-semester-node {
        grid-template-columns: auto minmax(0, 1fr) auto;
        padding: 10px 4px;
    }

    .learn-node-main {
        display: grid;
        gap: 3px;
    }

    .learn-node-main strong {
        font-size: 1.05rem;
    }

    .telegram-link {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .semester-children {
        padding: 10px 8px 10px 24px;
    }

    .semester-children::before {
        left: 10px;
    }

    .learn-colloquium-node {
        padding: 12px;
    }

    .learn-node-toggle {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .learn-tests {
        margin: 0 8px 10px 20px;
        padding: 6px 14px;
    }

    .learn-test-row {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        padding: 14px 0;
    }

    .question-count,
    .learn-test-action.mud-button-root {
        grid-column: 1 / -1;
        width: 100%;
    }

    .runner-question {
        min-height: 260px;
    }
}

.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 20px;
    background:
        linear-gradient(90deg, rgba(255, 43, 214, 0.12), rgba(79, 230, 255, 0.08)) top / 100% 74px no-repeat,
        linear-gradient(135deg, transparent 0 14%, rgba(255, 43, 214, 0.42) 14.2% 14.6%, transparent 15% 100%) left bottom / 320px 320px no-repeat,
        var(--page-bg);
}

.auth-shell {
    display: grid;
    width: min(440px, 100%);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin-bottom: 26px;
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.auth-panel {
    width: 100%;
    box-sizing: border-box;
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(12, 13, 20, 0.88);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.auth-panel-heading {
    display: grid;
    margin-bottom: 22px;
}

.auth-panel-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.8rem;
    letter-spacing: 0;
}

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

.form-field {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.auth-panel input {
    box-sizing: border-box;
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: var(--surface-muted);
    font: inherit;
}

.auth-panel input:focus {
    border-color: var(--primary-strong);
    outline: 3px solid rgba(142, 215, 210, 0.32);
}

.auth-panel button {
    margin-top: 8px;
    min-height: 48px;
    padding: 11px 16px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(90deg, #7431f2, #ef2aa7);
    box-shadow: 0 0 22px rgba(255, 43, 214, 0.28);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.auth-action-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 11px 16px;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(90deg, #7431f2, #ef2aa7);
    box-shadow: 0 0 22px rgba(255, 43, 214, 0.28);
    font-weight: 700;
    text-decoration: none;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-weight: 400;
}

.checkbox-row input {
    width: 18px;
    min-height: 18px;
}

.legal-consent-row {
    align-items: flex-start;
    font-size: 0.92rem;
    line-height: 1.4;
}

.legal-consent-row input {
    flex: 0 0 auto;
    margin-top: 2px;
    accent-color: #ef2aa7;
}

.legal-consent-row a {
    color: var(--primary-strong);
    font-weight: 700;
    text-decoration: none;
}

.legal-consent-row a:hover,
.legal-consent-row a:focus-visible {
    text-decoration: underline;
}

.auth-switch {
    margin: 20px 0 0;
    color: var(--text-muted);
    text-align: center;
}

.auth-switch a {
    color: var(--primary-strong);
    font-weight: 700;
    text-decoration: none;
}

.validation-summary,
.field-validation-error {
    color: var(--danger);
}

.validation-summary ul {
    margin: 0;
    padding-left: 20px;
}

.legal-page {
    display: grid;
    min-height: calc(100vh - 68px);
    place-items: center;
    padding: clamp(18px, 4vw, 56px);
}

.legal-card {
    display: grid;
    gap: 18px;
    width: min(100%, 760px);
    padding: clamp(22px, 4vw, 38px);
    border: 1px solid rgba(160, 151, 255, 0.22);
    border-radius: 8px;
    background:
        radial-gradient(circle at 88% 10%, rgba(255, 43, 214, 0.12), transparent 34%),
        rgba(12, 13, 20, 0.9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.legal-card .auth-brand {
    margin-bottom: 6px;
}

.legal-eyebrow {
    margin: 0;
    color: var(--primary-strong);
    font-weight: 700;
    text-transform: uppercase;
}

.legal-card h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.9rem, 4vw, 3rem);
    letter-spacing: 0;
    line-height: 1.05;
}

.legal-version {
    margin: -8px 0 0;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.95rem;
}

.legal-warning {
    padding: 14px 16px;
    border: 1px solid rgba(255, 199, 95, 0.4);
    border-radius: 8px;
    color: #ffe0a6;
    background: rgba(255, 179, 38, 0.08);
    line-height: 1.45;
}

.legal-placeholder {
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-muted);
    line-height: 1.55;
}

.legal-placeholder h2 {
    margin: 14px 0 0;
    color: var(--text);
    font-size: 1.08rem;
    line-height: 1.3;
}

.legal-placeholder h2:first-child {
    margin-top: 0;
}

.legal-placeholder p {
    margin: 0;
}

.legal-back-link {
    color: var(--primary-strong);
    font-weight: 700;
    text-decoration: none;
}

.legal-back-link:hover,
.legal-back-link:focus-visible {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .auth-page {
        align-items: start;
        padding: 18px 14px;
    }

    .auth-panel {
        padding: 20px;
    }
}

.empty-state {
    max-width: 720px;
    padding: 32px;
    border: 1px solid #e4deeb;
    border-radius: 8px;
    background: #ffffff;
}

.muted {
    color: #625a6a;
}

.admin-page {
    display: grid;
    gap: 24px;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.page-heading h1 {
    margin: 0 0 8px;
}

.page-heading p {
    margin: 0;
    color: #625a6a;
}

.admin-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.admin-nav-item {
    display: grid;
    gap: 6px;
    padding: 20px;
    border: 1px solid #e4deeb;
    border-radius: 8px;
    background: #ffffff;
    text-decoration: none;
}

.admin-nav-item strong {
    color: #161318;
}

.admin-nav-item span {
    color: #625a6a;
}

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

.admin-panel {
    display: grid;
    gap: 16px;
    padding: 20px;
    border: 1px solid #e4deeb;
    border-radius: 8px;
    background: #ffffff;
}

.admin-panel h2 {
    margin: 0;
    font-size: 20px;
}

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

.admin-panel label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.admin-panel input,
.admin-panel textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #cbc3d5;
    border-radius: 6px;
    font: inherit;
}

.admin-panel textarea {
    min-height: 90px;
    resize: vertical;
}

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

.form-actions button,
.table-actions button {
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    background: #5d2fd6;
    font: inherit;
    cursor: pointer;
}

.secondary-button,
.form-actions .secondary-button {
    color: #332b3b;
    background: #eee9f5;
}

.danger-button,
.table-actions .danger-button {
    background: #b42318;
}

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

.admin-table th,
.admin-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #ebe6f0;
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: #625a6a;
    font-size: 14px;
}

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

    .page-heading {
        display: grid;
    }
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Landing redesign */
.site-shell {
    background:
        radial-gradient(circle at 16% 78%, rgba(197, 22, 212, 0.24), transparent 28%),
        radial-gradient(circle at 74% 18%, rgba(125, 43, 255, 0.18), transparent 30%),
        radial-gradient(circle at 92% 44%, rgba(255, 43, 155, 0.18), transparent 24%),
        linear-gradient(180deg, #030308 0%, #05050b 46%, #020205 100%);
}

.site-shell.mobile-menu-open {
    height: 100vh;
    overflow: hidden;
}

.app-header {
    min-height: 88px;
    padding: 14px clamp(20px, 4vw, 64px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(3, 3, 8, 0.82);
    box-shadow: none;
}

.brand {
    gap: 14px;
    font-size: clamp(1rem, 1.4vw, 1.35rem);
    font-weight: 700;
}

.brand-logo {
    width: 76px;
    height: 54px;
    object-fit: contain;
    filter: drop-shadow(0 0 14px rgba(255, 43, 214, 0.42));
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 34px);
}

.app-header .desktop-nav a:not(.nav-button) {
    min-height: 44px;
    padding: 8px 2px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
}

.app-header .desktop-nav a:not(.nav-button):hover,
.app-header .desktop-nav a:not(.nav-button):focus-visible {
    color: #ffffff;
}

.nav-button.ghost {
    min-width: 104px;
    min-height: 48px;
    border-color: rgba(160, 151, 255, 0.34);
    border-radius: 14px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.02);
}

.nav-button.secondary {
    min-width: 148px;
    min-height: 48px;
    border-color: rgba(255, 43, 214, 0.56);
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(100deg, #6d32df 0%, #ef2aa2 100%);
    box-shadow: 0 0 22px rgba(255, 43, 214, 0.22);
}

.mobile-menu-button,
.mobile-menu-backdrop,
.mobile-nav-panel {
    display: none;
}

.app-content:has(.neon-home) {
    padding: 0;
}

.home-hero.neon-home {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    align-content: start;
    gap: clamp(12px, 1.8vw, 24px);
    min-height: calc(100vh - 88px);
    padding: clamp(10px, 1.8vw, 28px) clamp(20px, 4vw, 70px) 24px;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 88%, rgba(192, 18, 214, 0.3), transparent 28%),
        radial-gradient(circle at 70% 18%, rgba(110, 32, 220, 0.22), transparent 28%),
        radial-gradient(circle at 88% 44%, rgba(236, 34, 167, 0.18), transparent 26%),
        linear-gradient(180deg, #030309 0%, #05050b 55%, #020205 100%);
}

.neon-home::before {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 14%, transparent 86%, rgba(255, 255, 255, 0.035)),
        radial-gradient(circle at 32% 58%, rgba(255, 43, 214, 0.08), transparent 36%);
    opacity: 1;
}

.neon-home::after {
    background:
        linear-gradient(135deg, rgba(255, 43, 214, 0.38), transparent 20%) left bottom / 380px 340px no-repeat,
        linear-gradient(235deg, rgba(79, 230, 255, 0.18), transparent 22%) right top / 420px 320px no-repeat;
    opacity: 0.72;
}

.home-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 0.96fr) minmax(420px, 1.04fr);
    grid-template-areas: "copy artwork";
    align-items: center;
    gap: clamp(8px, 1.4vw, 18px) clamp(28px, 5vw, 74px);
    width: min(100%, 1540px);
    margin-inline: auto;
}

.hero-copy {
    grid-area: copy;
    display: grid;
    gap: 14px;
    max-width: 740px;
    text-align: left;
}

.hero-title.mud-typography {
    color: #ffffff;
    font-size: clamp(2.85rem, 5vw, 5.65rem);
    font-weight: 600;
    line-height: 0.98;
    letter-spacing: 0;
    text-shadow: 0 0 28px rgba(255, 255, 255, 0.1);
}

.hero-title span {
    color: transparent;
    background: linear-gradient(95deg, #ffffff 0%, #ff9bea 44%, #f050d7 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-subtitle.mud-typography {
    color: rgba(255, 255, 255, 0.66);
    font-size: clamp(1.25rem, 2vw, 1.7rem);
    font-weight: 500;
}

.hero-artwork {
    grid-area: artwork;
    display: grid;
    justify-items: center;
    align-self: end;
}

.hero-logo-art {
    width: min(100%, clamp(280px, 26vw, 520px));
    object-fit: contain;
    filter:
        drop-shadow(0 0 28px rgba(255, 43, 214, 0.36))
        drop-shadow(0 0 30px rgba(79, 230, 255, 0.22));
}

.home-steps {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(14px, 2vw, 26px);
    width: min(100%, 1540px);
    margin-inline: auto;
    margin-top: clamp(-10px, -0.8vw, -4px);
}

.home-step-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 112px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 43, 214, 0.54);
    border-radius: 22px;
    background: rgba(16, 10, 27, 0.72);
    box-shadow:
        0 18px 46px rgba(0, 0, 0, 0.3),
        inset 0 0 24px rgba(255, 43, 214, 0.035);
    color: inherit;
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.home-step-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 83, 223, 0.74);
    background: rgba(22, 11, 36, 0.82);
}

.home-step-card h2,
.home-step-card p {
    margin: 0;
    min-width: 0;
}

.home-step-card h2 {
    color: #ffffff;
    font-size: clamp(1.1rem, 1.45vw, 1.38rem);
    line-height: 1.2;
}

.home-step-card p {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.74);
    line-height: 1.42;
}

.step-card-blue {
    border-color: rgba(100, 118, 255, 0.6);
}

.step-card-blue:hover {
    border-color: rgba(120, 197, 255, 0.78);
}

.step-number {
    display: inline-grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 1px solid rgba(255, 83, 223, 0.84);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 43, 214, 0.16);
    box-shadow:
        0 0 24px rgba(255, 43, 214, 0.42),
        inset 0 0 18px rgba(255, 255, 255, 0.08);
    font-size: 1.58rem;
    font-weight: 700;
}

.step-card-blue .step-number {
    border-color: rgba(105, 130, 255, 0.88);
    background: rgba(74, 86, 255, 0.18);
    box-shadow: 0 0 24px rgba(79, 107, 255, 0.42);
}

.step-icon {
    color: #f069ff;
    filter: drop-shadow(0 0 14px rgba(255, 43, 214, 0.44));
    font-size: 42px !important;
}

.step-card-blue .step-icon {
    color: #7cd8ff;
    filter: drop-shadow(0 0 14px rgba(79, 230, 255, 0.38));
}

.step-connector {
    color: #f35fff;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1;
    text-shadow: 0 0 18px rgba(255, 43, 214, 0.42);
}

.app-footer {
    padding: 0 clamp(16px, 5vw, 56px) 30px;
    background: #020205;
    border-top: 0;
}

.footer-help-button {
    gap: 10px;
    min-width: 190px;
    min-height: 54px;
    border-color: rgba(255, 255, 255, 0.34);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
    font-size: 1.1rem;
    text-transform: none;
}

.footer-help-button::before {
    content: "?";
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 999px;
}

.app-header a:focus-visible,
.home-step-card:focus-visible,
.mobile-menu-button:focus-visible,
.mobile-nav-panel button:focus-visible,
.mobile-menu-backdrop:focus-visible,
.footer-help-button:focus-visible {
    outline: 2px solid rgba(79, 230, 255, 0.9);
    outline-offset: 3px;
}

@media (max-width: 1160px) {
    .desktop-nav {
        gap: 12px;
    }

    .app-header .desktop-nav a:not(.nav-button) {
        font-size: 0.95rem;
    }

    .home-hero-inner {
        grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
    }

    .home-step-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .step-icon {
        grid-column: 1 / -1;
        justify-self: end;
    }
}

@media (max-width: 860px) {
    .app-header {
        min-height: 74px;
        padding: 12px 16px;
    }

    .brand {
        min-width: 0;
        font-size: 1rem;
    }

    .brand-logo {
        width: 58px;
        height: 44px;
    }

    .app-header .desktop-nav {
        display: none;
    }

    .mobile-menu-button {
        display: inline-grid;
        width: 48px;
        height: 48px;
        place-items: center;
        border: 1px solid rgba(160, 151, 255, 0.34);
        border-radius: 14px;
        color: #ffffff;
        background: rgba(255, 255, 255, 0.04);
        font: inherit;
        font-size: 1.45rem;
        cursor: pointer;
    }

    .mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 30;
        display: block;
        border: 0;
        background: rgba(0, 0, 0, 0.62);
        cursor: default;
    }

    .mobile-nav-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 31;
        display: grid;
        align-content: start;
        gap: 20px;
        width: min(86vw, 360px);
        padding: 18px;
        border-left: 1px solid rgba(255, 255, 255, 0.12);
        background:
            radial-gradient(circle at 80% 10%, rgba(255, 43, 214, 0.18), transparent 36%),
            #06060d;
        box-shadow: -22px 0 60px rgba(0, 0, 0, 0.42);
    }

    .mobile-nav-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: #ffffff;
        font-weight: 700;
    }

    .mobile-nav-head button {
        width: 44px;
        height: 44px;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 12px;
        color: #ffffff;
        background: rgba(255, 255, 255, 0.04);
        font: inherit;
        font-size: 1.4rem;
        cursor: pointer;
    }

    .mobile-nav-panel nav {
        display: grid;
        gap: 12px;
    }

    .mobile-nav-panel nav a,
    .mobile-nav-panel .nav-button {
        min-height: 48px;
        justify-content: flex-start;
        padding: 12px 14px;
        border-radius: 12px;
        color: #ffffff;
        text-decoration: none;
    }

    .mobile-nav-panel nav a:not(.nav-button) {
        background: rgba(255, 255, 255, 0.035);
    }

    .mobile-nav-panel .user-email {
        max-width: 100%;
        padding: 4px 14px;
    }

    .neon-home {
        display: flex;
        flex-direction: column;
        min-height: auto;
        padding: 18px 16px 24px;
    }

    .home-hero-inner {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "artwork"
            "copy";
        gap: 12px;
        width: 100%;
    }

    .hero-artwork {
        justify-items: center;
    }

    .hero-logo-art {
        width: min(55vw, 220px);
    }

    .hero-copy {
        justify-items: center;
        gap: 16px;
        max-width: 620px;
        margin-inline: auto;
        text-align: center;
    }

    .hero-title.mud-typography {
        font-size: clamp(2.35rem, 11vw, 3.65rem);
        line-height: 1.04;
    }

    .hero-subtitle.mud-typography {
        font-size: clamp(1.05rem, 4.6vw, 1.38rem);
        line-height: 1.35;
    }

    .home-steps {
        display: flex;
        flex-direction: column;
        gap: 14px;
        width: min(100%, 430px);
        margin-top: 6px;
    }

    .home-step-card {
        width: 100%;
        min-height: 0;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 16px;
        padding: 20px;
        border-radius: 18px;
    }

    .home-step-card:hover {
        transform: none;
    }

    .step-number {
        width: 52px;
        height: 52px;
        font-size: 1.55rem;
    }

    .step-icon {
        grid-column: auto;
        font-size: 36px !important;
    }

    .step-connector {
        transform: rotate(90deg);
    }

}

@media (max-width: 430px) {
    .brand span {
        max-width: 190px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .home-steps {
        width: 100%;
    }

    .home-step-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
    }
}
