/* ==========================================================================
   TestHub — единая дизайн-система
   Mobile-first, светлая тема, карточки, мягкие анимации.
   ========================================================================== */

/* ------------------------------ Переменные ------------------------------ */
:root {
    --brand: #4f46e5;
    --brand-strong: #4338ca;
    --brand-soft: #eef2ff;
    --accent: #8b5cf6;

    --ink: #0f172a;
    --ink-soft: #334155;
    --muted: #64748b;
    --muted-light: #94a3b8;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-tint: #f1f5f9;

    --success: #059669;
    --success-soft: #ecfdf5;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --warning: #d97706;
    --warning-soft: #fffbeb;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 10px 30px -12px rgba(15, 23, 42, .18);
    --shadow-lg: 0 28px 70px -30px rgba(15, 23, 42, .35);

    --container: 1160px;
    --header-h: 64px;

    --font: "Manrope", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

    --ease: cubic-bezier(.22, .61, .36, 1);
    --transition: 180ms var(--ease);
}

/* ------------------------------- Сброс ---------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 10px);
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.nav-open {
    overflow: hidden;
}

img,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4 {
    margin: 0 0 .55em;
    line-height: 1.18;
    letter-spacing: -.025em;
    font-weight: 800;
    color: var(--ink);
}

h1 {
    font-size: clamp(1.85rem, 5vw, 3.15rem);
}

h2 {
    font-size: clamp(1.45rem, 3.4vw, 2.15rem);
}

h3 {
    font-size: clamp(1.12rem, 2.4vw, 1.4rem);
}

p {
    margin: 0 0 1.15em;
}

a {
    color: var(--brand);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--brand-strong);
}

ul, ol {
    margin: 0 0 1.2em;
    padding-left: 1.3em;
}

li {
    margin-bottom: .45em;
}

strong {
    font-weight: 700;
}

small {
    font-size: .82em;
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 2rem 0;
}

::selection {
    background: rgba(99, 102, 241, .22);
}

:focus-visible {
    outline: 3px solid rgba(99, 102, 241, .55);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ------------------------------- Утилиты -------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 18px;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -100px;
    z-index: 1000;
    padding: 10px 16px;
    background: var(--ink);
    color: #fff;
    border-radius: 0 0 10px 10px;
    text-decoration: none;
    transition: top var(--transition);
}

.skip-link:focus {
    top: 0;
    color: #fff;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.lead {
    font-size: clamp(1.02rem, 2.4vw, 1.2rem);
    color: var(--ink-soft);
    max-width: 68ch;
}

.muted {
    color: var(--muted);
}

.text-center {
    text-align: center;
}

.section {
    padding: clamp(44px, 7vw, 84px) 0;
}

.section--tint {
    background: linear-gradient(180deg, var(--surface-soft), #fff);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.section-head {
    max-width: 720px;
    margin: 0 auto clamp(26px, 4vw, 44px);
    text-align: center;
}

.section-head .lead {
    margin-left: auto;
    margin-right: auto;
}

/* ------------------------------- Кнопки --------------------------------- */
.btn {
    --btn-bg: var(--brand);
    --btn-color: #fff;
    --btn-border: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 22px;
    border: 1px solid var(--btn-border);
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--btn-color);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
    box-shadow: 0 8px 20px -10px rgba(79, 70, 229, .6);
}

.btn:hover {
    color: var(--btn-color);
    background: var(--brand-strong);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px -14px rgba(79, 70, 229, .7);
}

.btn:active {
    transform: translateY(0);
}

.btn--ghost {
    --btn-bg: #fff;
    --btn-color: var(--ink);
    --btn-border: var(--line-strong);
    box-shadow: none;
}

.btn--ghost:hover {
    background: var(--surface-tint);
    color: var(--ink);
}

.btn--light {
    --btn-bg: #fff;
    --btn-color: var(--brand-strong);
}

.btn--light:hover {
    background: #f8fafc;
    color: var(--brand-strong);
}

.btn--block {
    width: 100%;
}

.btn--lg {
    min-height: 56px;
    padding: 16px 28px;
    font-size: 1.05rem;
}

.btn[disabled],
.btn.is-loading {
    opacity: .65;
    cursor: progress;
    transform: none;
}

.btn .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

/* ------------------------------- Шапка ---------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: saturate(170%) blur(12px);
    backdrop-filter: saturate(170%) blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, .85);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 62px;
    padding-top: 0;
    padding-bottom: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    color: var(--ink);
    text-decoration: none;
}

.brand:hover {
    color: var(--ink);
}

.brand-mark {
    flex: 0 0 auto;
    line-height: 0;
    filter: drop-shadow(0 6px 12px rgba(79, 70, 229, .28));
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-text strong {
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.brand-text small {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Быстрые категории — только на широких экранах. */
.header-quick {
    display: none;
    align-items: center;
    gap: 2px;
    margin: 0 auto;
}

.header-quick__link {
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}

.header-quick__link:hover {
    background: var(--surface-tint);
    color: var(--brand-strong);
}

.nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    height: 40px;
    margin-left: auto;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-soft);
    font-family: inherit;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.nav-toggle:hover {
    border-color: #c7d2fe;
    color: var(--brand-strong);
    box-shadow: 0 8px 18px -14px rgba(79, 70, 229, .9);
}

.nav-toggle__burger {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    width: 15px;
}

.nav-toggle__burger span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__burger span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__burger span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__burger span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

/* --------------------- Выезжающее меню-каталог -------------------------- */
.nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(15, 23, 42, .4);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s var(--ease), visibility .3s var(--ease);
}

.nav-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 130;
    display: flex;
    flex-direction: column;
    width: min(400px, 100vw);
    height: 100dvh;
    background: #fff;
    box-shadow: -30px 0 70px -40px rgba(15, 23, 42, .65);
    transform: translateX(102%);
    visibility: hidden;
    transition: transform .34s var(--ease), visibility .34s var(--ease);
}

.nav-drawer.is-open {
    transform: none;
    visibility: visible;
}

.nav-drawer__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 20px 14px;
    border-bottom: 1px solid var(--line);
}

.nav-drawer__eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.nav-drawer__title {
    margin: 0;
    font-size: 1.2rem;
    letter-spacing: -.02em;
}

.nav-drawer__close {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--ink-soft);
    font-family: inherit;
    font-size: .9rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.nav-drawer__close:hover {
    border-color: #c7d2fe;
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.nav-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 24px;
    overscroll-behavior: contain;
}

.nav-group + .nav-group {
    margin-top: 18px;
}

.nav-group__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 0 6px 8px;
}

.nav-group__head h3 {
    margin: 0;
    color: var(--ink);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.nav-group__head p {
    margin: 2px 0 0;
    color: var(--muted-light);
    font-size: .72rem;
    font-weight: 600;
}

.nav-group__count {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--surface-tint);
    color: var(--muted);
    font-size: .7rem;
    font-weight: 800;
}

.nav-group__list {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 9px;
    border-radius: 12px;
    color: var(--ink-soft);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.nav-item:hover {
    background: var(--surface-soft);
    color: var(--ink);
}

.nav-item.is-active {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.nav-item__icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: transparent;
}

.nav-item__icon .ti {
    width: 30px;
    height: 30px;
}

.nav-item.is-active .nav-item__icon {
    background: #fff;
}

.nav-item__icon--emoji {
    background: #fff;
    font-size: .95rem;
    box-shadow: inset 0 0 0 1px var(--line);
}

.nav-item__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.nav-item__text strong {
    font-size: .86rem;
    font-weight: 700;
}

.nav-item__text small {
    color: var(--muted-light);
    font-size: .71rem;
    font-weight: 600;
}

.nav-item__arrow {
    margin-left: auto;
    color: var(--brand);
    font-size: .9rem;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity var(--transition), transform var(--transition);
}

.nav-item:hover .nav-item__arrow,
.nav-item.is-active .nav-item__arrow {
    opacity: 1;
    transform: none;
}

.nav-drawer__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--line);
    background: var(--surface-soft);
}

.nav-drawer__foot .btn {
    min-height: 40px;
    padding: 8px 16px;
    font-size: .84rem;
}

.nav-drawer__link {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-drawer__link:hover {
    color: var(--brand-strong);
}

@media (min-width: 900px) {
    .header-quick {
        display: flex;
    }

    .nav-drawer {
        width: min(400px, 92vw);
    }
}

/* ------------------------------- Хиро ----------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(24px, 3.6vw, 44px) 0 clamp(18px, 2.6vw, 30px);
    background:
        radial-gradient(900px 420px at 12% -10%, rgba(99, 102, 241, .16), transparent 60%),
        radial-gradient(760px 380px at 94% 0%, rgba(139, 92, 246, .14), transparent 58%),
        linear-gradient(180deg, #fbfcff, #fff);
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -120px -160px auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, .12), transparent 65%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 780px;
}

.hero h1 {
    margin-bottom: .3em;
    font-size: clamp(1.75rem, 4.2vw, 2.75rem);
}

.hero .lead {
    margin-bottom: .95em;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.hero-meta li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-soft);
    font-size: .82rem;
    font-weight: 600;
}

.hero-meta li::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.hero-note {
    margin-top: 12px;
    color: var(--muted);
    font-size: .82rem;
}

/* --------------------------- Сетка тестов ------------------------------- */
.test-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.test-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--ink);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.test-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--card-accent, var(--brand)), transparent 80%);
    opacity: .9;
}

.test-card:hover {
    transform: translateY(-3px);
    border-color: #dbe2ef;
    box-shadow: var(--shadow);
    color: var(--ink);
}

.test-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background: var(--card-accent-soft, var(--brand-soft));
    color: var(--card-accent, var(--brand));
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

/* Компактные SVG-иллюстрации в карточках и перелинковке */
.test-illustration--compact,
.test-illustration--mini,
.test-illustration--nav,
.test-illustration--fun {
    display: block;
    width: 100%;
    height: 100%;
}

.test-card__icon .ti {
    width: 100%;
    height: 100%;
    transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}

.test-card:hover .test-card__icon .ti {
    transform: scale(1.08) rotate(-3deg);
}

.test-card__title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -.015em;
}

.test-card__desc {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.test-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
    color: var(--muted-light);
    font-size: .76rem;
    font-weight: 600;
}

.test-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.test-card__arrow {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-tint);
    color: var(--muted);
    font-size: .9rem;
    transition: transform var(--transition), background var(--transition), color var(--transition);
}

.test-card:hover .test-card__arrow {
    transform: translateX(2px);
    background: var(--card-accent, var(--brand));
    color: #fff;
}

/* Акценты карточек */
.accent-indigo  { --card-accent: #4f46e5; --card-accent-soft: #eef2ff; }
.accent-violet  { --card-accent: #7c3aed; --card-accent-soft: #f5f3ff; }
.accent-cyan    { --card-accent: #0891b2; --card-accent-soft: #ecfeff; }
.accent-amber   { --card-accent: #d97706; --card-accent-soft: #fffbeb; }
.accent-emerald { --card-accent: #059669; --card-accent-soft: #ecfdf5; }
.accent-rose    { --card-accent: #e11d48; --card-accent-soft: #fff1f2; }
.accent-sky     { --card-accent: #0284c7; --card-accent-soft: #f0f9ff; }
.accent-blue    { --card-accent: #2563eb; --card-accent-soft: #eff6ff; }
.accent-teal    { --card-accent: #0d9488; --card-accent-soft: #f0fdfa; }
.accent-orange  { --card-accent: #ea580c; --card-accent-soft: #fff7ed; }

/* --------------------------- Преимущества ------------------------------- */
.value-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.value-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.value-card h3 {
    margin-bottom: .35em;
    font-size: 1.02rem;
}

.value-card p {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
}

.value-card__num {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 12px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: .82rem;
    font-weight: 800;
}

/* ------------------------------- Шаги ----------------------------------- */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.steps li {
    position: relative;
    margin: 0;
    padding: 18px 18px 18px 60px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink-soft);
    font-size: .94rem;
}

.steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 18px;
    top: 17px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: .82rem;
    font-weight: 800;
}

/* --------------------------- Страница теста ----------------------------- */
.test-hero {
    padding: clamp(14px, 2.2vw, 24px) 0 clamp(10px, 1.6vw, 16px);
    background:
        radial-gradient(700px 320px at 50% -20%, rgba(99, 102, 241, .12), transparent 60%),
        linear-gradient(180deg, #fbfcff, #fff);
}

.test-hero__head {
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: .75rem;
}

.breadcrumbs li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.breadcrumbs li + li::before {
    content: "/";
    color: var(--line-strong);
}

.breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--brand);
}

.test-hero h1 {
    max-width: 22ch;
    margin: 0 auto 6px;
    font-size: clamp(1.5rem, 3.2vw, 2.15rem);
    line-height: 1.2;
}

.test-hero .lead {
    display: -webkit-box;
    max-width: 680px;
    margin: 0 auto 10px;
    overflow: hidden;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.55;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.test-facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.test-facts li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--surface-tint);
    color: var(--ink-soft);
    font-size: .75rem;
    font-weight: 600;
}

.test-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
    align-items: start;
}

.test-aside {
    display: none;
}

/* ------------------------------- Квиз ----------------------------------- */
.quiz-app {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.quiz-app[hidden] {
    display: none;
}

.quiz-start {
    padding: clamp(20px, 3.4vw, 34px);
    text-align: center;
}

/* Тематическая SVG-иллюстрация внутри стартовой карточки */
.start-art {
    display: grid;
    place-items: center;
    width: 104px;
    height: 104px;
    margin: 0 auto 12px;
    border: 1px solid #e0e7ff;
    border-radius: 28px;
    background:
        radial-gradient(circle at 30% 20%, #fff 0%, var(--brand-soft) 74%);
}

.start-art .ti {
    width: 88px;
    height: 88px;
}

.quiz-start__icon {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    border-radius: 20px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 1.1rem;
    font-weight: 800;
}

.quiz-start h2 {
    margin-bottom: .3em;
}

.quiz-start p {
    max-width: 54ch;
    margin-left: auto;
    margin-right: auto;
    color: var(--muted);
}

.quiz-start .btn {
    margin-top: 8px;
}

.quiz-shell[hidden] {
    display: none;
}

.quiz-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px clamp(18px, 3vw, 28px);
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

.quiz-progress__track {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: var(--surface-tint);
    overflow: hidden;
}

.quiz-progress__bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    transition: width 260ms var(--ease);
}

.quiz-card {
    display: flex;
    flex-direction: column;
    min-height: clamp(300px, 50vh, 430px);
    padding: clamp(20px, 4vw, 34px);
}

#quiz-body {
    flex: 1;
}

.quiz-question {
    margin: 0 0 18px;
    font-size: clamp(1.1rem, 2.6vw, 1.35rem);
    font-weight: 800;
    line-height: 1.35;
}

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

.quiz-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink-soft);
    font-size: .95rem;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.quiz-option:hover {
    border-color: #c7d2fe;
    background: #fbfcff;
}

.quiz-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.quiz-option__mark {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    background: #fff;
    transition: border-color var(--transition), background var(--transition);
}

.quiz-option:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.quiz-option:has(input:checked) .quiz-option__mark {
    border-color: var(--brand);
    background: radial-gradient(circle, var(--brand) 0 45%, #fff 47% 100%);
}

.quiz-option.is-selected {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.quiz-option.is-selected .quiz-option__mark {
    border-color: var(--brand);
    background: radial-gradient(circle, var(--brand) 0 45%, #fff 47% 100%);
}

.quiz-liker {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.quiz-liker label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 12px 6px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.quiz-liker label:hover {
    border-color: #c7d2fe;
}

.quiz-liker input {
    position: absolute;
    opacity: 0;
}

.quiz-liker__dot {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    color: var(--ink-soft);
    font-size: .8rem;
    font-weight: 800;
    transition: all var(--transition);
}

.quiz-liker label:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.quiz-liker label:has(input:checked) .quiz-liker__dot {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.quiz-liker label.is-selected {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.quiz-liker label.is-selected .quiz-liker__dot {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.quiz-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin-top: 22px;
}

.quiz-actions .btn {
    flex: 1 1 auto;
}

.quiz-hint {
    margin: 14px 0 0;
    color: var(--muted-light);
    font-size: .78rem;
}

.quiz-error {
    margin: 14px 0 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: .86rem;
    font-weight: 600;
}

.quiz-error[hidden] {
    display: none;
}

/* Дата рождения */
.date-field {
    display: grid;
    gap: 8px;
    max-width: 340px;
}

.date-field label {
    font-size: .86rem;
    font-weight: 700;
    color: var(--ink-soft);
}

.date-field input {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 1.5px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
}

/* Игра памяти */
.memory-stage {
    display: grid;
    place-items: center;
    min-height: 180px;
    margin-bottom: 18px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-soft);
    text-align: center;
    padding: 18px;
}

.memory-digit {
    font-size: clamp(3.5rem, 14vw, 6rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: .04em;
    color: var(--brand);
    animation: digitIn 260ms var(--ease);
}

.memory-round-label {
    margin: 0;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.memory-input {
    width: 100%;
    min-height: 58px;
    padding: 12px 16px;
    border: 1.5px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    font-size: 1.4rem;
    letter-spacing: .35em;
    text-align: center;
}

.memory-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
}

.memory-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--line);
}

.memory-dots span.is-done {
    background: var(--brand);
}

.memory-dots span.is-current {
    background: var(--accent);
    transform: scale(1.25);
}

/* --------------------------- Рекламные слоты ---------------------------- */
.ad-slot {
    display: block;
    width: 100%;
    margin: clamp(26px, 4vw, 44px) auto;
    padding: 0;
    text-align: center;
    overflow: hidden;
}

.ad-slot > * {
    max-width: 100%;
}

.ad-slot--header {
    margin-top: 20px;
}

.ad-slot--in_article {
    margin: 36px auto;
}

.ad-slot--before_result {
    margin: 30px auto;
}

.ad-slot--video_slot {
    margin: 30px auto;
}

.ad-slot--footer {
    margin: 0 auto 30px;
    filter: none;
}

/* ----------------------------- Статья SEO ------------------------------- */
.article {
    max-width: 760px;
    color: var(--ink-soft);
    font-size: 1.02rem;
}

.article > .eyebrow {
    margin-bottom: 10px;
}

.article h2 {
    margin-top: 2.1em;
    color: var(--ink);
}

.article h3 {
    margin-top: 1.6em;
    color: var(--ink);
}

.article p,
.article li {
    color: #3b4a60;
}

.article ul,
.article ol {
    padding-left: 1.25em;
}

.article blockquote {
    margin: 1.6em 0;
    padding: 14px 18px;
    border-left: 4px solid var(--brand);
    border-radius: 0 12px 12px 0;
    background: var(--brand-soft);
    color: var(--ink-soft);
}

.article blockquote p:last-child {
    margin-bottom: 0;
}

.article__note {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
    font-size: .92rem;
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    font-size: .9rem;
}

.article-table th,
.article-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.article-table th {
    background: var(--surface-soft);
    color: var(--ink);
    font-weight: 700;
}

/* ------------------------------- FAQ ------------------------------------ */
.faq-list {
    display: grid;
    gap: 10px;
    max-width: 820px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.faq-item summary {
    position: relative;
    padding: 16px 48px 16px 18px;
    color: var(--ink);
    font-size: .96rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--brand);
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1;
    transition: transform var(--transition);
}

.faq-item[open] summary::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-item__body {
    padding: 0 18px 16px;
    color: var(--muted);
    font-size: .92rem;
}

.faq-item__body p:last-child {
    margin-bottom: 0;
}

/* ---------------------------- Страница результата ----------------------- */
.result-hero {
    padding: clamp(26px, 4vw, 46px) 0 20px;
    background:
        radial-gradient(700px 340px at 80% -20%, rgba(139, 92, 246, .14), transparent 60%),
        linear-gradient(180deg, #fbfcff, #fff);
}

.result-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow);
    padding: clamp(22px, 4vw, 38px);
}

.result-card__kicker {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.result-summary {
    margin: 0 0 10px;
    font-size: clamp(1.9rem, 5vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.1;
    color: var(--brand-strong);
}

.result-headline {
    margin: 0 0 12px;
    font-size: clamp(1.15rem, 2.6vw, 1.4rem);
}

.result-description {
    max-width: 70ch;
    color: var(--ink-soft);
}

.metric-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.metric {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.metric__label {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.metric__value {
    display: block;
    color: var(--ink);
    font-size: .98rem;
    font-weight: 700;
}

.metric__bar {
    display: block;
    height: 6px;
    margin-top: 9px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
}

.metric__bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--brand);
}

.insight-list {
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.insight-list li {
    position: relative;
    margin: 0;
    padding-left: 24px;
    color: var(--ink-soft);
    font-size: .92rem;
}

.insight-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--success);
    font-weight: 800;
}

.round-review {
    margin: 26px 0 0;
}

.round-review__lead {
    margin: 0 0 14px;
    color: var(--muted);
}

.round-review__list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.round-review__item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-left: 4px solid #cbd5e1;
    border-radius: 12px;
    background: var(--surface-soft);
}

.round-review__item.is-correct {
    border-left-color: #10b981;
}

.round-review__item.is-wrong {
    border-left-color: #ef4444;
}

.round-review__mark {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    font-size: .82rem;
    font-weight: 800;
}

.round-review__item.is-correct .round-review__mark {
    background: #d1fae5;
    color: #047857;
}

.round-review__item.is-wrong .round-review__mark {
    background: #fee2e2;
    color: #b91c1c;
}

.round-review__body {
    min-width: 0;
}

.round-review__head {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: .94rem;
    font-weight: 800;
}

.round-review__status {
    margin-left: 6px;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

.round-review__text {
    margin: 0;
    color: var(--ink-soft);
    font-size: .92rem;
    line-height: 1.55;
}

.round-review__item + .round-review__item {
    margin-top: 0;
}

@media (max-width: 620px) {
    .round-review__item {
        padding: 12px;
    }
}

.result-disclaimer {
    margin: 24px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted-light);
    font-size: .8rem;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.result-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 24px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--success-soft);
    color: #065f46;
    font-size: .92rem;
    font-weight: 600;
}

.result-notice--error {
    background: var(--danger-soft);
    color: #991b1b;
}

/* -------------------- Виджет сертификата (превью) ----------------------- */
.cert-widget {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 26px;
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(500px 260px at 100% 0%, rgba(99, 102, 241, .08), transparent 60%),
        #fff;
}

@media (min-width: 860px) {
    .cert-widget {
        grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
        align-items: start;
    }
}

.cert-widget__head {
    max-width: 46ch;
}

.cert-widget__head h2 {
    margin-bottom: .3em;
    font-size: 1.35rem;
}

.cert-widget__head p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: .92rem;
}

.cert-widget__price {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 12px;
    color: var(--ink);
    font-size: 1.6rem;
    font-weight: 800;
}

.cert-widget__price small {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 600;
}

.cert-widget__list {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 7px;
}

.cert-widget__list li {
    position: relative;
    margin: 0;
    padding-left: 22px;
    color: var(--ink-soft);
    font-size: .88rem;
}

.cert-widget__list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 800;
}

/* Превью документа: вертикальный A4, повторяющий PDF-макет */
.cert-widget__preview {
    width: 100%;
    max-width: 366px;
    margin: 0 auto;
}

.cert-widget__caption {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.45;
    text-align: center;
}

.cert-preview {
    position: relative;
    width: 100%;
    container-type: inline-size;
    border-radius: 10px;
    overflow: hidden;
    background: #fffdf7;
    box-shadow:
        0 24px 46px -26px rgba(20, 38, 79, .58),
        0 0 0 1px rgba(30, 58, 138, .14);
    isolation: isolate;
}

.cert-preview__inner {
    color: #14264f;
    background: #fffdf7;
}

.cert-preview.is-locked .cert-preview__inner {
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
}

.cert-preview__lock {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: linear-gradient(180deg, rgba(15, 23, 42, .18), rgba(15, 23, 42, .55));
    color: #fff;
    text-align: center;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.cert-preview__lock svg {
    width: 34px;
    height: 34px;
    opacity: .95;
}

.cert-preview__lock span {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(6px);
}

.cert-preview:not(.is-locked) .cert-preview__lock {
    display: none;
}

/* Лист A4: все размеры в em от базовой единицы, привязанной к ширине листа */
.cert-sheet {
    position: relative;
    display: flex;
    width: 100%;
    aspect-ratio: 210 / 297;
    overflow: hidden;
    background:
        radial-gradient(140% 82% at 50% 0%, #fffefc 0%, #fffdf7 54%, #faf4e6 100%);
    color: #14264f;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 6px;
    line-height: 1.35;
    -webkit-font-smoothing: antialiased;
}

@supports (font-size: 1cqw) {
    .cert-sheet {
        font-size: 1.72cqw;
    }
}

.cert-sheet__frame {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cert-sheet__watermark-wrap {
    position: absolute;
    top: 9.4%;
    left: 14%;
    z-index: 0;
    width: 72%;
    aspect-ratio: 1;
    opacity: .1;
    pointer-events: none;
}

.cert-sheet__watermark {
    display: block;
    width: 100%;
    height: 100%;
}

.cert-sheet__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 4.4em 10.5% 3.4em;
    box-sizing: border-box;
}

/* Шапка */
.cert-sheet__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
}

.cert-sheet__brand {
    display: inline-flex;
    align-items: center;
    gap: .58em;
    min-width: 0;
}

.cert-sheet__mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.9em;
    height: 2.9em;
    background: #1e3a8a;
    color: #fffdf7;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1em;
    font-weight: 700;
    line-height: 1;
}

.cert-sheet__mark span {
    display: block;
    font-size: 1.35em;
    line-height: 1;
}

.cert-sheet__brandtext {
    display: block;
    min-width: 0;
}

.cert-sheet__brandname {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.6em;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: .005em;
    color: #1e3a8a;
}

.cert-sheet__brandsub {
    display: block;
    margin-top: .2em;
    font-size: .55em;
    font-weight: 600;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: #8a6a2f;
    white-space: nowrap;
}

.cert-sheet__number {
    flex: 0 0 auto;
    text-align: right;
}

.cert-sheet__number span {
    display: block;
    font-size: .55em;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #8a6a2f;
}

.cert-sheet__number strong {
    display: block;
    margin-top: .22em;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.02em;
    font-weight: 700;
    letter-spacing: .01em;
    color: #14264f;
    white-space: nowrap;
}

/* Основной блок */
.cert-sheet__main {
    margin-top: 3.7em;
    text-align: center;
}

.cert-sheet__title {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.94em;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: .43em;
    padding-left: .43em;
    color: #1e3a8a;
    white-space: nowrap;
}

.cert-sheet__label {
    margin: .34em 0 0;
    font-size: .7em;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: #8a6a2f;
}

.cert-sheet__name {
    margin: .3em 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.45em;
    font-weight: 400;
    line-height: 1.12;
    color: #14264f;
    overflow-wrap: anywhere;
}

.cert-sheet__rule {
    position: relative;
    display: block;
    width: 54%;
    height: 2px;
    margin: .42em auto .62em;
    background: linear-gradient(90deg, rgba(180, 138, 62, 0), #b48a3e 20%, #b48a3e 80%, rgba(180, 138, 62, 0));
}

.cert-sheet__rule::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: .58em;
    height: .58em;
    background: #b48a3e;
    transform: translate(-50%, -50%) rotate(45deg);
}

.cert-sheet__lead {
    margin: 0;
    font-size: .74em;
    letter-spacing: .02em;
    color: #5a6478;
}

.cert-sheet__test {
    width: 84%;
    margin: .58em auto 0;
    padding: 1.1em .8em;
    box-sizing: border-box;
    border-top: 1px solid #b48a3e;
    border-bottom: 1px solid #b48a3e;
    background: #f5f1e4;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.08em;
    line-height: 1.3;
    color: #1e3a8a;
}

.cert-sheet__result {
    width: 86%;
    margin: 2.1em auto 0;
    padding: .95em 1em 1em;
    box-sizing: border-box;
    border: 1.5px solid #b48a3e;
    background: #1e3a8a;
    color: #fffdf7;
    text-align: center;
}

.cert-sheet__result span {
    display: block;
    margin-bottom: .45em;
    font-size: .58em;
    font-weight: 600;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: #e8d9ae;
}

.cert-sheet__result strong {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.78em;
    font-weight: 700;
    line-height: 1.05;
}

.cert-sheet__headline {
    margin: 1.15em 0 0;
    font-size: .9em;
    font-weight: 700;
    color: #14264f;
}

.cert-sheet__desc {
    max-width: 92%;
    margin: .42em auto 0;
    font-size: .72em;
    line-height: 1.45;
    color: #4b5468;
}

.cert-sheet__metrics {
    width: 88%;
    margin: 4.7em auto 0;
    border-collapse: collapse;
    font-size: .78em;
    color: #4b5468;
    text-align: left;
}

.cert-sheet__metrics td {
    padding: .66em 0;
    border-bottom: 1px solid #e4dcc8;
    vertical-align: middle;
}

.cert-sheet__metrics td:last-child {
    text-align: right;
    font-weight: 700;
    color: #1e3a8a;
}

.cert-sheet__spacer {
    display: block;
    flex: 1 1 auto;
    min-height: .6em;
}

.cert-sheet__footrule {
    position: absolute;
    left: 10.5%;
    right: 10.5%;
    bottom: 33.4%;
    display: block;
    height: 1px;
    background: linear-gradient(90deg, rgba(180, 138, 62, 0), #b48a3e 22%, #b48a3e 78%, rgba(180, 138, 62, 0));
}

.cert-sheet__footrule::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: .72em;
    height: .72em;
    background: #fffdf7;
    border: 1px solid #b48a3e;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* Подвал: QR, печать, дата */
.cert-sheet__bottom {
    position: absolute;
    left: 10.5%;
    right: 10.5%;
    bottom: 20%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: .6em;
}

.cert-sheet__qr {
    justify-self: start;
    text-align: center;
}

.cert-sheet__qrbox {
    width: 6.4em;
    padding: .22em;
    box-sizing: border-box;
    border: 1px solid #e4dcc8;
    background: #fff;
}

.cert-sheet__qrbox svg {
    display: block;
    width: 100%;
    height: auto;
}

.cert-sheet__qrcap {
    display: block;
    margin-top: .4em;
    font-size: .52em;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #8a6a2f;
}

.cert-sheet__sealwrap {
    justify-self: center;
    width: 9em;
}

.cert-sheet__seal {
    display: block;
    width: 100%;
    height: auto;
}

.cert-sheet__date {
    justify-self: end;
    max-width: 15em;
    text-align: right;
}

.cert-sheet__date span {
    display: block;
    font-size: .53em;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #8a6a2f;
}

.cert-sheet__date strong {
    display: block;
    margin: .3em 0 .22em;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.12em;
    font-weight: 700;
    color: #14264f;
}

.cert-sheet__date small {
    display: block;
    font-size: .6em;
    letter-spacing: 0;
    color: #5a6478;
}

@media (max-width: 420px) {
    .cert-widget__preview {
        max-width: 340px;
    }
}

/* Форма покупки */
.cert-form {
    display: grid;
    gap: 14px;
}

/* Внутри выбранного способа оплаты форма не должна занимать весь виджет. */
.cert-paid-form .cert-form {
    max-width: none;
}

.form-field {
    display: grid;
    gap: 6px;
}

.form-field label {
    color: var(--ink-soft);
    font-size: .84rem;
    font-weight: 700;
}

.form-field input,
.form-field select {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1.5px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .14);
}

.form-field__hint {
    color: var(--muted-light);
    font-size: .74rem;
}

.form-error {
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: .84rem;
    font-weight: 600;
}

.form-error[hidden] {
    display: none;
}

.form-success {
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--success-soft);
    color: #065f46;
    font-size: .86rem;
    font-weight: 600;
}

.cert-form__note {
    margin: 0;
    color: var(--muted-light);
    font-size: .72rem;
    line-height: 1.5;
}

.cert-form__note a {
    color: var(--muted);
}

/* Оплаченный сертификат */
.cert-paid {
    display: grid;
    gap: 16px;
    margin-top: 26px;
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #f0fdfa, #fff);
}

.cert-paid__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 999px;
    background: #d1fae5;
    color: #065f46;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

/* Два равноправных способа получения сертификата */
.cert-choice-grid {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

@media (min-width: 1080px) {
    .cert-choice-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.cert-choice {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.cert-choice--paid {
    border-color: #c7d2fe;
    background: #f8faff;
}

.cert-choice--share {
    border-color: #ddd6fe;
    background: #faf5ff;
}

.cert-choice h3 {
    margin: 0;
    padding-right: 54px;
    font-size: 1rem;
}

.cert-choice p {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.5;
}

.cert-choice .btn {
    margin-top: auto;
    white-space: normal;
    line-height: 1.32;
    min-height: 56px;
    padding: 12px 16px;
    font-size: .86rem;
}

.cert-choice__badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #e0e7ff;
    color: #3730a3;
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.cert-choice__badge--free {
    background: #d1fae5;
    color: #065f46;
}

.cert-paid-form {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed var(--line-strong);
}

.cert-paid-form h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.btn--share-open {
    background: #fff;
    border-color: #8b5cf6;
    color: #6d28d9;
}

.btn--share-open:hover {
    background: #f5f3ff;
    color: #5b21b6;
}

/* Модалка бесплатной разблокировки */
body.is-modal-open {
    overflow: hidden;
}

.share-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.share-modal[hidden] {
    display: none !important;
}

.share-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(3px);
}

.share-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: clamp(18px, 3vw, 26px);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.share-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--surface-tint);
    color: var(--ink-soft);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.share-modal__head h2 {
    margin: .2em 0 .4em;
    font-size: 1.35rem;
    padding-right: 30px;
}

.share-modal__head p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.55;
}

.share-progress {
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid #ddd6fe;
    border-radius: var(--radius);
    background: #faf5ff;
}

.share-progress__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--ink-soft);
    font-size: .84rem;
    font-weight: 700;
}

.share-progress__top strong {
    color: #6d28d9;
    font-size: .95rem;
}

.share-progress__track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #ede9fe;
}

.share-progress__fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #8b5cf6, #6366f1);
    transition: width .35s var(--ease);
}

.share-progress__hint {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: .76rem;
}

.share-modal__name {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.share-modal__name label {
    color: var(--ink-soft);
    font-size: .82rem;
    font-weight: 700;
}

.share-modal__name input,
.share-referral input {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1.5px solid var(--line-strong);
    border-radius: 11px;
    background: #fff;
    font: inherit;
    font-size: .95rem;
    color: var(--ink);
}

.share-modal__name input:focus,
.share-referral input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .14);
}

.share-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.btn--share {
    color: #fff;
    text-decoration: none;
    border-color: transparent;
}

.btn--wa { background: #25d366; }
.btn--wa:hover { background: #1ebe5a; color: #fff; }
.btn--tg { background: #229ed9; }
.btn--tg:hover { background: #1b8dc4; color: #fff; }
.btn--vk { background: #0077ff; }
.btn--vk:hover { background: #0068dd; color: #fff; }

.share-links .btn {
    justify-content: center;
    padding-left: 8px;
    padding-right: 8px;
    font-size: .82rem;
}

.share-referral {
    display: grid;
    gap: 6px;
    margin-top: 14px;
}

.share-referral label {
    color: var(--ink-soft);
    font-size: .8rem;
    font-weight: 700;
}

.share-referral__row {
    display: flex;
    gap: 8px;
}

.share-referral__row input {
    flex: 1;
    min-width: 0;
    font-size: .8rem;
}

.share-referral__row .btn {
    flex: 0 0 auto;
    font-size: .78rem;
}

/* ------------------- Поделиться результатом (все тесты) ------------------ */
.result-share {
    margin: 22px 0 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.result-share__head h2 {
    margin: 6px 0 6px;
    font-size: 1.35rem;
}

.result-share__head p {
    margin: 0;
    color: var(--muted);
    font-size: .92rem;
}

.result-share__preview {
    margin: 16px 0;
    padding: 14px 16px;
    border-left: 3px solid var(--brand);
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
    color: var(--ink-soft);
    font-size: .94rem;
    font-weight: 600;
}

.result-share__links {
    max-width: 520px;
}

.result-share__copy {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.result-share__note {
    color: var(--success);
    font-size: .85rem;
    font-weight: 700;
}

@media (max-width: 560px) {
    .result-share {
        padding: 18px;
    }

    .result-share__links {
        grid-template-columns: 1fr;
    }
}

.share-wait,
.share-success {
    margin: 14px 0 0;
    padding: 11px 13px;
    border-radius: 11px;
    font-size: .84rem;
    font-weight: 600;
}

.share-wait {
    background: #fffbeb;
    color: #92400e;
}

.share-success {
    background: #ecfdf5;
    color: #047857;
}

.share-modal__foot {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    color: var(--muted-light);
    font-size: .72rem;
}

.share-modal__foot a {
    color: var(--muted);
}

/* ------------------------------ Проверка -------------------------------- */
.verify-hero {
    padding: clamp(34px, 6vw, 64px) 0;
    background:
        radial-gradient(600px 300px at 50% -30%, rgba(5, 150, 105, .12), transparent 60%),
        linear-gradient(180deg, #f7fdfb, #fff);
    min-height: 60vh;
}

.verify-card {
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(22px, 4vw, 36px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow);
}

.verify-badge {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 22px;
    padding: 16px 18px;
    border-radius: 14px;
    font-weight: 700;
}

.verify-badge--ok {
    background: var(--success-soft);
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.verify-badge--fail {
    background: var(--danger-soft);
    border: 1px solid #fecaca;
    color: #991b1b;
}

.verify-badge__icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    font-size: 1.05rem;
}

.verify-badge strong {
    display: block;
    font-size: 1rem;
}

.verify-badge span {
    display: block;
    margin-top: 2px;
    font-size: .84rem;
    font-weight: 500;
    opacity: .85;
}

.verify-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    overflow: hidden;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--line);
}

.verify-grid > div {
    padding: 14px 16px;
    background: #fff;
}

.verify-grid dt {
    margin: 0 0 3px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.verify-grid dd {
    margin: 0;
    color: var(--ink);
    font-size: .96rem;
    font-weight: 700;
}

.verify-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.verify-form input {
    flex: 1 1 220px;
    min-height: 50px;
    padding: 12px 14px;
    border: 1.5px solid var(--line-strong);
    border-radius: 12px;
    font: inherit;
    font-size: 1rem;
    text-transform: uppercase;
}

.verify-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

/* ------------------------------- Юридика -------------------------------- */
.legal-hero {
    padding: clamp(32px, 5vw, 56px) 0 10px;
    background: linear-gradient(180deg, #fbfcff, #fff);
}

/* Реквизиты исполнителя в шапке юридических документов */
.legal-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 820px;
    margin: 18px 0 0;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

@media (min-width: 640px) {
    .legal-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.legal-meta > div {
    display: grid;
    gap: 2px;
}

.legal-meta dt {
    color: var(--muted-light);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.legal-meta dd {
    margin: 0;
    color: var(--ink);
    font-size: .9rem;
    font-weight: 600;
}

.legal-meta dd a {
    color: var(--brand-strong);
    text-decoration: none;
}

.legal-meta dd a:hover {
    text-decoration: underline;
}

.prose {
    max-width: 820px;
    color: var(--ink-soft);
    font-size: .98rem;
}

.prose h2 {
    margin-top: 1.9em;
    font-size: 1.35rem;
}

.prose h3 {
    margin-top: 1.4em;
    font-size: 1.08rem;
}

.prose ul,
.prose ol {
    padding-left: 1.25em;
}

.prose li {
    margin-bottom: .4em;
}

/* -------------------------------- CTA ----------------------------------- */
.cta {
    position: relative;
    overflow: hidden;
    margin: clamp(30px, 5vw, 56px) 0;
    padding: clamp(28px, 5vw, 48px);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, #4338ca, #7c3aed 65%, #6366f1);
    color: #fff;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.cta::before,
.cta::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
}

.cta::before {
    width: 220px;
    height: 220px;
    top: -110px;
    right: -60px;
}

.cta::after {
    width: 160px;
    height: 160px;
    bottom: -100px;
    left: -40px;
}

.cta h2 {
    position: relative;
    color: #fff;
    margin-bottom: .3em;
}

.cta p {
    position: relative;
    max-width: 58ch;
    margin: 0 auto 1.4em;
    color: rgba(255, 255, 255, .82);
}

.cta .btn {
    position: relative;
}

/* ------------------------------- Футер ---------------------------------- */
.site-footer {
    margin-top: clamp(44px, 7vw, 80px);
    padding: clamp(36px, 5vw, 56px) 0 28px;
    background: #0b1120;
    color: #cbd5e1;
}

.site-footer .ad-slot {
    margin-bottom: 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
    padding-bottom: 26px;
    border-bottom: 1px solid rgba(148, 163, 184, .18);
}

@media (min-width: 860px) {
    .footer-grid {
        grid-template-columns: 1.3fr .7fr .7fr;
    }
}

.brand--footer {
    color: #fff;
}

.brand--footer:hover {
    color: #fff;
}

.brand--footer .brand-text small {
    color: #94a3b8;
}

.footer-tagline {
    max-width: 38ch;
    margin: 12px 0 0;
    color: #94a3b8;
    font-size: .88rem;
}

.footer-links {
    display: grid;
    gap: 8px;
    align-content: start;
}

.footer-links a {
    color: #cbd5e1;
    font-size: .88rem;
    text-decoration: none;
}

.footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-bottom {
    display: grid;
    gap: 6px;
    padding-top: 20px;
    color: #94a3b8;
    font-size: .78rem;
}

.footer-bottom p {
    margin: 0;
}

.footer-note {
    max-width: 80ch;
    color: #64748b;
    font-size: .72rem;
}

/* Реквизиты владельца-самозанятого (требование платёжных агрегаторов) */
.footer-owner {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, .18);
    color: #94a3b8;
    font-size: .78rem;
    line-height: 1.5;
}

.footer-owner p {
    margin: 0;
}

.footer-owner strong {
    color: #e2e8f0;
    font-weight: 700;
}

.footer-owner a {
    color: #cbd5e1;
    text-decoration: none;
}

.footer-owner a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-legal {
    display: grid;
    gap: 5px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, .14);
    color: #64748b;
    font-size: .73rem;
    line-height: 1.55;
}

.footer-legal p {
    margin: 0;
}

.footer-legal a {
    color: #94a3b8;
    text-decoration: none;
}

.footer-legal a:hover {
    color: #e2e8f0;
    text-decoration: underline;
}

/* ------------------------------- 404 ------------------------------------ */
.error-page {
    display: grid;
    place-items: center;
    min-height: 62vh;
    padding: 40px 0;
    text-align: center;
}

.error-code {
    margin: 0;
    font-size: clamp(4rem, 16vw, 8rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.06em;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ----------------------------- Анимации --------------------------------- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes digitIn {
    from { opacity: 0; transform: scale(.86); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0;
    transform: translateY(14px);
}

.reveal.is-visible,
.no-js .reveal {
    animation: fadeUp 520ms var(--ease) forwards;
}

/* ----------------------------- Адаптив ---------------------------------- */
@media (min-width: 560px) {
    .container {
        padding: 0 24px;
    }

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

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

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

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

    .quiz-actions .btn {
        flex: 0 0 auto;
    }

    .cert-widget {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (min-width: 860px) {
    .container {
        padding: 0 28px;
    }

    .test-hero {
        padding-top: 38px;
    }

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

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

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

    .cert-widget {
        grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
        align-items: start;
    }

    .footer-grid {
        grid-template-columns: 1.3fr .7fr .7fr;
    }

    .footer-bottom {
        grid-template-columns: auto 1fr;
        align-items: center;
        gap: 20px;
    }

    .footer-note {
        text-align: right;
    }

    .test-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .aside-card {
        padding: 18px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--surface-soft);
    }

    .aside-card h2 {
        font-size: .95rem;
        margin-bottom: .6em;
    }

    .aside-card ul {
        margin: 0;
        padding: 0;
        list-style: none;
        display: grid;
        gap: 7px;
    }

    .aside-card li {
        margin: 0;
        font-size: .84rem;
        color: var(--muted);
    }

    .aside-card li a {
        text-decoration: none;
    }
}

@media (min-width: 1024px) {
    .test-layout {
        grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
        gap: 30px;
        align-items: start;
    }

    .test-aside {
        display: block;
        position: sticky;
        top: calc(var(--header-h) + 16px);
    }
}

@media (min-width: 1060px) {
    .test-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .hero-inner {
        max-width: 840px;
    }

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

/* ========================================================================
   Визуальное обновление: иллюстрации, каталог, задача дня, радар
   ===================================================================== */

/* ------------------------- SVG-иллюстрации ------------------------------ */
.ti {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.ti .ti-spin-slow,
.ti .ti-spin-rev {
    transform-box: view-box;
    transform-origin: 100px 100px;
}

.ti .ti-spin-slow {
    animation: ti-spin 32s linear infinite;
}

.ti .ti-spin-rev {
    animation: ti-spin 44s linear infinite reverse;
}

.ti-pulse {
    transform-box: fill-box;
    transform-origin: center;
    animation: ti-pulse 2.8s ease-in-out infinite;
}

.ti-breathe {
    transform-box: fill-box;
    transform-origin: center;
    animation: ti-breathe 4.2s ease-in-out infinite;
}

.ti-dash {
    animation: ti-dash 5.5s linear infinite;
}

.ti-glow {
    animation: ti-glow 3.4s ease-in-out infinite;
}

.ti-float {
    animation: ti-float 4.8s ease-in-out infinite;
}

.ti-sweep {
    animation: ti-spin 4.2s linear infinite;
}

.ti-needle {
    animation: ti-needle 2.4s ease-in-out infinite alternate;
}

.ti-swing {
    animation: ti-swing 4.6s ease-in-out infinite alternate;
}

.ti-bar {
    animation: ti-bar 3.2s ease-in-out infinite alternate;
}

.ti-flash {
    animation: ti-flash 3.6s ease-in-out infinite;
}

.ti-flicker {
    animation: ti-flicker 1.8s ease-in-out infinite alternate;
}

.ti-eq {
    animation: ti-eq 1.4s ease-in-out infinite alternate;
}

.ti-rotate-slow {
    animation: ti-spin 70s linear infinite;
}

/* «Демоническая кнопка»: цикл «невинная → демон → снова невинная» */
.ti-horns {
    opacity: 0;
    animation: ti-horns 9s ease-in-out infinite;
}

.ti-eyes {
    opacity: 0;
    animation: ti-eyes 9s ease-in-out infinite;
}

.ti-grin {
    opacity: 0;
    animation: ti-grin 9s ease-in-out infinite;
}

.ti-demon-glow {
    opacity: .3;
    animation: ti-demon-glow 9s ease-in-out infinite;
}

.ti-brow {
    opacity: 0;
    animation: ti-brow 9s ease-in-out infinite;
}

.ti-cracks {
    opacity: .18;
    animation: ti-cracks 9s ease-in-out infinite;
}

.ti-shine {
    animation: ti-shine 4.8s ease-in-out infinite;
}

.ti-demon-spark {
    transform-box: fill-box;
    transform-origin: center bottom;
    animation: ti-spark 2.4s ease-in-out infinite;
}

@keyframes ti-horns {
    0%, 28%, 100% { transform: scale(.35, .03); opacity: 0; }
    40% { transform: scale(1.08, 1.06); opacity: 1; }
    45%, 80% { transform: scale(1, 1); opacity: 1; }
    90% { transform: scale(.4, .06); opacity: 0; }
}

@keyframes ti-eyes {
    0%, 32%, 88%, 100% { opacity: 0; transform: scale(.7); }
    40%, 82% { opacity: 1; transform: scale(1); }
}

@keyframes ti-grin {
    0%, 32%, 100% { opacity: 0; transform: scaleY(.08); }
    42%, 80% { opacity: 1; transform: scaleY(1); }
    90% { opacity: 0; transform: scaleY(.08); }
}

@keyframes ti-brow {
    0%, 30%, 100% { opacity: 0; transform: translateY(-5px) scaleX(.8); }
    40%, 82% { opacity: 1; transform: translateY(0) scaleX(1); }
    92% { opacity: 0; transform: translateY(-5px) scaleX(.8); }
}

@keyframes ti-cracks {
    0%, 26%, 100% { opacity: .18; }
    42%, 78% { opacity: .95; }
    90% { opacity: .3; }
}

@keyframes ti-demon-glow {
    0%, 30%, 100% { opacity: .22; }
    46%, 78% { opacity: .85; }
}

@keyframes ti-shine {
    0%, 52% { transform: translate(-34px, 0); opacity: 0; }
    60% { opacity: .42; }
    78% { transform: translate(62px, 0); opacity: 0; }
    100% { transform: translate(62px, 0); opacity: 0; }
}

@keyframes ti-spark {
    0%, 100% { transform: scale(.7) translateY(2px); opacity: .35; }
    50% { transform: scale(1.1) translateY(-2px); opacity: 1; }
}

.ti-ring {
    animation: ti-ring 3.2s ease-out infinite;
    transform-box: view-box;
    transform-origin: 100px 106px;
}

@keyframes ti-ring {
    0%   { transform: scale(.82); opacity: .05; }
    55%  { opacity: .5; }
    100% { transform: scale(1.16); opacity: 0; }
}

@keyframes ti-spin {
    to { transform: rotate(360deg); }
}

@keyframes ti-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.18); opacity: .72; }
}

@keyframes ti-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}

@keyframes ti-dash {
    to { stroke-dashoffset: -140; }
}

@keyframes ti-glow {
    0%, 100% { opacity: .45; }
    50% { opacity: 1; }
}

@keyframes ti-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

@keyframes ti-needle {
    from { transform: rotate(-24deg); }
    to { transform: rotate(26deg); }
}

@keyframes ti-swing {
    from { transform: rotate(-16deg); }
    to { transform: rotate(18deg); }
}

@keyframes ti-bar {
    from { transform: scaleY(.86); }
    to { transform: scaleY(1); }
}

@keyframes ti-flash {
    0%, 100% { opacity: .35; }
    45%, 60% { opacity: 1; }
}

@keyframes ti-flicker {
    from { transform: scale(.94) rotate(-2deg); opacity: .8; }
    to { transform: scale(1.05) rotate(2deg); opacity: 1; }
}

@keyframes ti-eq {
    from { transform: scaleY(.4); }
    to { transform: scaleY(1); }
}

/* ----------------------------- Hero с артом ----------------------------- */
.hero-inner {
    max-width: 1120px;
}

.hero-copy {
    max-width: 720px;
}

.hero-art {
    position: relative;
    width: min(286px, 74vw);
    margin: 18px auto 0;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}

.hero-art__halo {
    position: absolute;
    inset: 6%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 46%, rgba(99, 102, 241, .2), rgba(139, 92, 246, .12) 46%, transparent 70%);
    filter: blur(6px);
}

.hero-art .ti {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 22px 34px rgba(79, 70, 229, .22));
}

.hero-art__label {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 13px;
    border: 1px solid rgba(99, 102, 241, .24);
    border-radius: 999px;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(6px);
    color: #4338ca;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}

@media (min-width: 760px) {
    .hero-inner {
        display: grid;
        grid-template-columns: minmax(0, 1.4fr) minmax(220px, .6fr);
        gap: 24px;
        align-items: center;
    }

    .hero-art {
        width: 100%;
        max-width: 300px;
        margin: 0;
        justify-self: end;
    }
}

@media (max-width: 1023px) {
    .hero .lead {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 4;
    }

    .page-home #tests .section-head .lead {
        display: none;
    }
}

@media (max-width: 759px) {
    .hero-art {
        display: none;
    }

    .hero .lead {
        -webkit-line-clamp: 3;
    }

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

    .hero-actions .btn {
        width: 100%;
        padding-left: 10px;
        padding-right: 10px;
        font-size: .86rem;
    }

    .hero-note {
        display: none;
    }
}

@media (max-width: 560px) {
    .page-home #tests .section-head .lead {
        display: none;
    }
}

/* ------------------ Иллюстрация в стартовой карточке -------------------- */
.test-illustration--start {
    filter: drop-shadow(0 10px 18px rgba(79, 70, 229, .16));
}

@media (min-width: 720px) {
    .start-art {
        width: 112px;
        height: 112px;
    }

    .start-art .ti {
        width: 96px;
        height: 96px;
    }
}

/* ------------------------------ Каталог -------------------------------- */
.page-home .section {
    padding: clamp(28px, 4vw, 48px) 0;
}

.page-home .section-head {
    margin-bottom: clamp(18px, 2.4vw, 26px);
}

.page-home .section-head .lead {
    max-width: 660px;
    font-size: .94rem;
}

.page-home .fun-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1060px) {
    .page-home .fun-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .page-home .fun-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.catalog-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(8px);
}

.catalog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}

.catalog-filter {
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-soft);
    font-family: inherit;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.catalog-filter:hover {
    border-color: #c7d2fe;
    color: #4338ca;
    transform: translateY(-1px);
}

.catalog-filter.is-active {
    border-color: #4f46e5;
    background: #4f46e5;
    color: #fff;
    box-shadow: 0 8px 18px -10px rgba(79, 70, 229, .9);
}

.catalog-status {
    margin: 0;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 600;
}

.catalog-empty {
    margin: 18px 0 0;
    padding: 18px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
}

.test-card[hidden] {
    display: none !important;
}

.test-card--icon {
    padding-top: 20px;
}

.test-card--icon .test-card__icon {
    width: 76px;
    height: 76px;
    padding: 4px;
    border-radius: 20px;
    background:
        radial-gradient(circle at 30% 20%, #fff 0%, var(--card-accent-soft, var(--brand-soft)) 74%);
    border: 1px solid #e0e7ff;
    box-sizing: border-box;
}

.test-card--icon .test-card__icon .ti {
    width: 100%;
    height: 100%;
    transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}

.test-card--icon:hover .test-card__icon .ti {
    transform: scale(1.1) rotate(-3deg);
}

.test-card--icon:hover .ti-pulse,
.test-card--icon:hover .ti-spin-slow,
.test-card--icon:hover .ti-spin-rev {
    animation-duration: 4.5s;
}

.test-card--icon .test-card__icon {
    margin-bottom: 2px;
}

/* Компактные иконки в блоке «Похожие тесты» */
.related-tests .test-card__icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: radial-gradient(circle at 30% 20%, #fff 0%, var(--card-accent-soft, var(--brand-soft)) 74%);
}

.related-tests .test-card__icon .ti {
    width: 28px;
    height: 28px;
}

.test-card__question {
    margin: 0;
    color: var(--card-accent, var(--brand));
    font-size: .9rem;
    font-weight: 800;
    line-height: 1.34;
}

.test-card--icon .test-card__desc {
    -webkit-line-clamp: 2;
}

/* ----------------------------- Задача дня ------------------------------- */
.section--daily {
    padding-top: clamp(24px, 4vw, 40px);
}

.daily-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: clamp(20px, 3.5vw, 30px);
    border: 1px solid rgba(99, 102, 241, .2);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(520px 260px at 100% 0%, rgba(139, 92, 246, .12), transparent 62%),
        radial-gradient(420px 220px at 0% 100%, rgba(6, 182, 212, .1), transparent 64%),
        #fff;
    box-shadow: var(--shadow-sm);
}

.daily-card__head h2 {
    margin-bottom: .3em;
}

.daily-card__head p {
    margin-bottom: 0;
    color: var(--muted);
}

.daily-quiz {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.daily-quiz__question {
    margin: 0 0 14px;
    color: var(--ink);
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.4;
}

.daily-quiz__options {
    display: grid;
    gap: 8px;
}

.daily-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
    font-size: .92rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.daily-option:hover:not(:disabled) {
    border-color: #a5b4fc;
    transform: translateY(-1px);
    box-shadow: 0 8px 16px -12px rgba(79, 70, 229, .7);
}

.daily-option:disabled {
    cursor: default;
    opacity: 1;
}

.daily-option__mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #eef2ff;
    color: #4338ca;
    font-size: .72rem;
    font-weight: 800;
}

.daily-option.is-correct {
    border-color: #10b981;
    background: #ecfdf5;
}

.daily-option.is-correct .daily-option__mark {
    background: #10b981;
    color: #fff;
}

.daily-option.is-wrong {
    border-color: #fca5a5;
    background: #fef2f2;
}

.daily-option.is-wrong .daily-option__mark {
    background: #ef4444;
    color: #fff;
}

.daily-result {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #ecfdf5;
}

.daily-result__verdict {
    margin: 0 0 4px;
    color: #047857;
    font-weight: 800;
}

.daily-result__verdict.is-wrong {
    color: #b91c1c;
}

.daily-result__explain {
    margin: 0;
    color: #065f46;
    font-size: .9rem;
    line-height: 1.5;
}

.daily-quiz__link {
    display: inline-flex;
    gap: 6px;
    margin-top: 14px;
    color: #4338ca;
    font-size: .86rem;
    font-weight: 700;
    text-decoration: none;
}

.daily-quiz__link:hover {
    text-decoration: underline;
}

@media (min-width: 900px) {
    .daily-card {
        grid-template-columns: minmax(0, .95fr) minmax(340px, 1.05fr);
        align-items: center;
        gap: 30px;
    }
}

/* ---------------------- Анимация метрик и радар ------------------------- */
.metric__fill {
    display: block;
    height: 100%;
    width: var(--metric-width, 0%);
    border-radius: 999px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transform-origin: left center;
    animation: metric-grow 1.1s cubic-bezier(.2, .8, .2, 1) both;
}

.metric:nth-child(2) .metric__fill { animation-delay: .1s; }
.metric:nth-child(3) .metric__fill { animation-delay: .2s; }
.metric:nth-child(4) .metric__fill { animation-delay: .3s; }
.metric:nth-child(5) .metric__fill { animation-delay: .4s; }
.metric:nth-child(6) .metric__fill { animation-delay: .5s; }

@keyframes metric-grow {
    from { width: 0; }
    to { width: var(--metric-width, 0%); }
}

.result-radar {
    margin: 24px 0 0;
    padding: 18px 16px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(420px 260px at 50% 0%, rgba(99, 102, 241, .08), transparent 66%),
        #fff;
    text-align: center;
}

.result-radar__head h2 {
    margin-bottom: .2em;
    font-size: 1.12rem;
}

.result-radar__head p {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: .84rem;
}

.result-radar__svg {
    display: block;
    width: 100%;
    max-width: 430px;
    height: auto;
    margin: 0 auto;
    overflow: hidden;
}

.radar-poly {
    animation: radar-in 1.25s cubic-bezier(.2, .8, .2, 1) both .12s;
}

.radar-dot {
    transform-box: fill-box;
    transform-origin: center;
    animation: radar-dot 0.5s ease-out both;
}

.radar-label {
    animation: radar-label .55s ease-out both;
}

@keyframes radar-in {
    from { transform: scale(.15); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes radar-dot {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes radar-label {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --------------------------- Мобильная полировка ------------------------ */
@media (max-width: 560px) {
    .hero-art {
        width: min(220px, 70vw);
    }

    .hero-art__label {
        font-size: .64rem;
    }

    /* Бейджи и фильтры — одна прокручиваемая строка, чтобы каталог был выше. */
    .hero-meta,
    .catalog-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .hero-meta::-webkit-scrollbar,
    .catalog-filters::-webkit-scrollbar {
        display: none;
    }

    .hero-meta li,
    .catalog-filter {
        flex: 0 0 auto;
    }

    .catalog-toolbar {
        flex-wrap: nowrap;
        align-items: center;
        padding: 10px;
        overflow: hidden;
    }

    .catalog-filter {
        padding: 7px 10px;
        font-size: .76rem;
    }

    .catalog-status {
        display: none;
    }

    .test-card--icon .test-card__icon {
        width: 68px;
        height: 68px;
    }

    .result-card {
        padding: 20px 14px;
    }

    .result-radar {
        padding: 12px 4px 6px;
    }
}

/* --------------------------- Уважение настроек -------------------------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .ti *,
    .radar-poly,
    .radar-dot,
    .radar-label,
    .metric__fill {
        animation: none !important;
    }

    /* «Демоническая кнопка»: без движения показываем застывшего демона. */
    .ti-horns,
    .ti-brow,
    .ti-eyes,
    .ti-grin {
        opacity: 1;
        transform: none;
    }

    .ti-cracks {
        opacity: .9;
    }

    .ti-demon-glow {
        opacity: .6;
    }

    .ti-shine {
        opacity: 0;
    }

    .metric__fill {
        width: var(--metric-width, 0%);
    }
}

/* -------------------------------- Печать -------------------------------- */
@media print {
    .site-header,
    .site-footer,
    .ad-slot,
    .result-actions,
    .cert-widget,
    .nav-toggle {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .result-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
