/* ── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --clr-bg:       #f4f6fb;
    --clr-surface:  #ffffff;
    --clr-primary:  #4f6ef7;
    --clr-primary-h:#3a58e0;
    --clr-secondary:#e8ecff;
    --clr-text:     #1a1c2e;
    --clr-muted:    #6b7280;
    --clr-border:   #e2e6f0;
    --clr-error:    #e53e3e;
    --clr-success:  #38a169;
    --radius:       14px;
    --shadow:       0 4px 24px rgba(79,110,247,.10);
    --transition:   .18s ease;
    /* Одинаковая «высота телефона» на всех шагах Глеба; лента внутри прокручивается */
    --gleb-card-height: clamp(360px, calc(100dvh - 100px), 640px);
}

html { font-size: 16px; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--clr-bg);
    color: var(--clr-text);
    min-height: 100vh;
    min-height: 100dvh; /* iOS Safari: учитывает скрытую адресную строку */
    line-height: 1.6;
    overflow-x: hidden; /* защита от горизонтального скролла */
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.survey-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* карточка прибита к верху — не прыгает при смене длины */
    padding: 48px 16px 32px;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--clr-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px 32px;
    width: 100%;
    max-width: 560px;
    animation: fadeUp .3s ease both;
    overflow-wrap: break-word; /* длинные слова не вылезают за край */
    word-break: break-word;
}

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

.card__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--clr-text);
}

.card__subtitle {
    color: var(--clr-muted);
    margin-bottom: 28px;
}

/* ── Progress row (bar + back button) ───────────────────────────────────── */
.progress-row {
    width: 100%;
    max-width: 560px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.back-form { flex-shrink: 0; }

.back-placeholder {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}

.btn-back {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--clr-secondary);
    color: var(--clr-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), transform var(--transition);
}
.btn-back:hover  { background: #d5dcfc; }
.btn-back:active { transform: scale(.9); }

/* ── Progress bar ────────────────────────────────────────────────────────── */
.progress-bar {
    flex: 1;          /* растягивается на всю оставшуюся ширину в .progress-row */
    width: 100%;
    max-width: 560px;
    height: 5px;
    background: var(--clr-border);
    border-radius: 99px;
    overflow: hidden;
    /* margin-bottom убран — теперь задаётся через .progress-row */
}
.progress-fill {
    height: 100%;
    background: var(--clr-primary);
    border-radius: 99px;
    transition: width .4s ease;
}

/* ── Avatar / Bot message ────────────────────────────────────────────────── */
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--clr-primary);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.message {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 24px;
    white-space: pre-wrap;
}

/* ── Gleb: интерфейс «как в чате» ─────────────────────────────────────────── */
.body--gleb-chat {
    background: linear-gradient(165deg, #b8c5d8 0%, #d4dce8 45%, #e8ecf4 100%);
    overflow: hidden;          /* страница не скроллится — только stream внутри карточки */
    height: var(--vh-real, 100svh);  /* JS fallback → точная высота viewport */
    position: fixed;           /* убирает bounce-scroll на iOS */
    width: 100%;
}
.survey-wrap--gleb-chat {
    padding: 20px 12px 24px;
    max-width: 100%;
    min-height: 0; /* сбрасываем min-height: 100vh базового .survey-wrap */
}
.progress-row--gleb-chat {
    max-width: 430px;
}

/* Прогресс под топбаром внутри карточки — граница с зоной сообщений */
.progress-row--gleb-inner {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 8px 14px;
    flex-shrink: 0;
    box-sizing: border-box;
    background: #fff;
    border-bottom: 1px solid rgba(26, 28, 46, 0.09);
}

.card--gleb .gleb-chat__topbar {
    border-bottom: none;
}

.card--gleb {
    padding: 0;
    max-width: 430px;
    height: var(--gleb-card-height);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #e4e9f0;
    border: 1px solid rgba(26, 28, 46, 0.08);
    box-shadow: 0 8px 32px rgba(26, 28, 46, 0.12);
}

.card--gleb > .gleb-chat {
    flex: 1;
    min-height: 0;
}

.gleb-chat {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.gleb-chat--panas-full {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Форма ШДЭС: как stream + composer — забирает место под топбаром, лента скроллится */
.gleb-panas-full {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 0;
    min-height: 0;
    overflow: hidden;
}

.panas-item--full {
    padding: 12px 0;
    border-bottom: 1px solid var(--clr-border);
}
.panas-item--full:last-of-type {
    border-bottom: none;
}

.gleb-chat__topbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid rgba(26, 28, 46, 0.09);
}
.gleb-chat__topbar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.gleb-chat__topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(26, 28, 46, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.9);
}
.gleb-chat__topbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gleb-chat__topbar-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.gleb-chat__topbar-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--clr-text);
    line-height: 1.25;
}
.gleb-chat__topbar-status {
    font-size: 0.78rem;
    color: var(--clr-muted);
    line-height: 1.2;
}

.gleb-chat__stream {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 14px 12px;
    -webkit-overflow-scrolling: touch;
}

.gleb-chat__row--bot {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 100%;
}

.gleb-chat__avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(26, 28, 46, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.9);
}
.gleb-chat__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gleb-chat__bubble--bot {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 50px);
    background: #fff;
    border-radius: 4px 18px 18px 18px;
    padding: 12px 14px 13px;
    box-shadow: 0 1px 2px rgba(26, 28, 46, 0.06), 0 4px 12px rgba(26, 28, 46, 0.04);
}

.gleb-chat__text {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--clr-text);
    white-space: pre-wrap;
    word-break: break-word;
}

.gleb-chat__composer {
    flex-shrink: 0;
    padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid rgba(26, 28, 46, 0.08);
    backdrop-filter: blur(8px);
}

.gleb-chat__form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gleb-chat__link {
    width: 100%;
    margin-bottom: 0;
}

.choices--chat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.btn--chat-option {
    width: auto;
    max-width: 92%;
    min-width: 100px;
    align-self: flex-end;
    margin-bottom: 0;
    padding: 11px 18px;
    border-radius: 18px 18px 4px 18px;
    background: var(--clr-primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(79, 110, 247, 0.25);
}
.btn--chat-option:hover {
    background: var(--clr-primary-h);
    filter: none;
}
.btn--chat-option.btn--choice--prev {
    outline: 2px solid #fff;
    outline-offset: -2px;
    box-shadow: 0 0 0 2px var(--clr-primary), 0 2px 8px rgba(79, 110, 247, 0.35);
}

.form--chat-reply {
    gap: 0;
    align-items: stretch;
    width: 100%;
}

.gleb-chat__composer--input {
    padding: 10px 12px 12px;
}

.gleb-chat__user-bubble {
    flex: 1;
    min-width: 0;
    background: #fff;
    border: 1px solid rgba(26, 28, 46, 0.12);
    border-radius: 22px;
    padding: 0;
    box-shadow: 0 1px 2px rgba(26, 28, 46, 0.05);
}

/* Поле + самолётик внутри одного «окна» сообщения */
.gleb-chat__user-bubble--compose {
    position: relative;
    display: block;
}

.form__textarea--chat {
    display: block;
    width: 100%;
    min-height: 44px;
    max-height: 180px;
    box-sizing: border-box;
    padding: 11px 48px 12px 16px;
    font-size: 1rem;
    line-height: 1.45;
    font-family: inherit;
    color: var(--clr-text);
    resize: none;
    overflow-y: auto;
    border: none;
    background: transparent;
    border-radius: 22px;
    vertical-align: middle;
}
.form__textarea--chat::placeholder {
    color: var(--clr-muted);
}
.form__textarea--chat:focus {
    outline: none;
    background: transparent;
}

@supports (field-sizing: content) {
    .form__textarea--chat {
        field-sizing: content;
    }
}

.gleb-chat__send-plane {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--clr-primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(79, 110, 247, 0.35);
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.gleb-chat__send-plane:hover {
    background: var(--clr-primary-h);
    box-shadow: 0 3px 12px rgba(79, 110, 247, 0.45);
}
.gleb-chat__send-plane:active {
    transform: scale(0.94);
}
.gleb-chat__send-plane:focus-visible {
    outline: 2px solid var(--clr-primary);
    outline-offset: 2px;
}
.gleb-chat__send-plane:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.btn--chat-send {
    width: 100%;
    border-radius: 12px;
    padding: 12px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 22px;
    transition: background var(--transition), transform var(--transition);
    text-decoration: none;
    touch-action: manipulation; /* убирает 300мс задержку на мобильных */
    -webkit-tap-highlight-color: transparent; /* убирает синюю вспышку на Android */
}
.btn:active { transform: scale(.97); }

.btn--primary {
    background: var(--clr-primary);
    color: #fff;
    width: 100%;
    padding: 13px;
    font-size: 1rem;
}
.btn--primary:hover { background: var(--clr-primary-h); }

.btn--secondary {
    background: var(--clr-secondary);
    color: var(--clr-primary);
}
.btn--secondary:hover { background: #d5dcfc; }

.btn--ghost {
    background: transparent;
    color: var(--clr-muted);
    border: 1.5px solid var(--clr-border);
}
.btn--ghost:hover { background: var(--clr-bg); }

.btn--sm { padding: 6px 14px; font-size: .85rem; }

.btn--choice {
    width: 100%;
    background: var(--clr-secondary);
    color: var(--clr-primary);
    margin-bottom: 10px;
    padding: 12px;
    font-size: 1rem;
    border-radius: 8px;
}
.btn--choice:hover { background: #d5dcfc; }
.btn--choice--prev {
    background: var(--clr-secondary);
    outline: 2px solid var(--clr-primary);
    outline-offset: -2px;
}

.choices { display: flex; flex-direction: column; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 18px; }

.form__label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .9rem;
    font-weight: 500;
    color: var(--clr-muted);
}

.form__input {
    padding: 10px 14px;
    border: 1.5px solid var(--clr-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition);
    background: var(--clr-bg);
    color: var(--clr-text);
}
.form__input:focus { outline: none; border-color: var(--clr-primary); background: #fff; }

.form__textarea {
    padding: 12px 14px;
    border: 1.5px solid var(--clr-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    min-height: 110px;
    resize: vertical;
    transition: border-color var(--transition);
    background: var(--clr-bg);
    color: var(--clr-text);
}
.form__textarea:focus { outline: none; border-color: var(--clr-primary); background: #fff; }

.radio-group { display: flex; gap: 16px; margin-top: 4px; }
.radio-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--clr-text);
    cursor: pointer;
}
.radio-btn input { accent-color: var(--clr-primary); width: 18px; height: 18px; }

.req { color: var(--clr-error); }

/* ── Yandex form link ────────────────────────────────────────────────────── */
.yandex-link {
    background: #ffcc00;
    color: #1a1c2e;
    margin-bottom: 0;
}
.yandex-link:hover { background: #f0be00; }

/* ── Error message ───────────────────────────────────────────────────────── */
.error-msg {
    color: var(--clr-error);
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 16px;
    font-size: .9rem;
}

/* ── Landing page ────────────────────────────────────────────────────────── */
.landing-wrap { gap: 32px; }

.landing-hero { text-align: center; }
.landing-title { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.landing-sub   { color: var(--clr-muted); font-size: 1.1rem; }

.test-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 640px;
}

.test-card {
    background: var(--clr-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.test-card__icon { font-size: 2.2rem; }
.test-card__title { font-size: 1.15rem; font-weight: 700; }
.test-card__desc { color: var(--clr-muted); font-size: .9rem; flex: 1; }

/* ── Result page ─────────────────────────────────────────────────────────── */
.result-card { text-align: center; }

.result-score { margin: 0 auto 24px; }
.result-score__emoji { font-size: 3rem; margin-bottom: 8px; }
.result-score__value {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--clr-primary);
    line-height: 1;
    margin-bottom: 12px;
}
.result-score__bar {
    height: 10px;
    background: var(--clr-border);
    border-radius: 99px;
    overflow: hidden;
    max-width: 320px;
    margin: 0 auto;
}
.result-score__fill {
    height: 100%;
    background: var(--clr-primary);
    border-radius: 99px;
    transition: width 1s ease;
}

.result-feedback {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--clr-muted);
    margin-bottom: 28px;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

.result-harry-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 16px;
    text-align: center;
    color: var(--clr-text);
}
.result-harry-bar-wrap {
    max-width: 320px;
    margin: 0 auto 20px;
}
.result-harry-bar-wrap .result-score__value--inline {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--clr-primary);
    line-height: 1;
    margin-bottom: 10px;
    text-align: center;
}
.result-harry-summary,
.result-harry-detail {
    text-align: left;
    max-width: 40rem;
    margin: 0 auto 1.25rem;
    line-height: 1.6;
    font-size: 0.95rem;
    color: var(--clr-text);
}
.result-harry-detail {
    margin-bottom: 28px;
    color: var(--clr-muted);
}

.result-thanks { margin-bottom: 28px; }
.result-thanks__icon { font-size: 3rem; margin-bottom: 12px; }
.result-thanks h2 { font-size: 1.5rem; margin-bottom: 8px; }
.result-thanks p { color: var(--clr-muted); }

.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Admin panel ─────────────────────────────────────────────────────────── */
.admin-wrap { justify-content: flex-start; padding-top: 48px; }

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.admin-section {
    padding: 20px 0;
    border-top: 1.5px solid var(--clr-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.admin-section h3 { font-size: 1.05rem; font-weight: 600; }
.admin-section p { color: var(--clr-muted); font-size: .9rem; }

/* ── Chat bubble (user message in gleb-chat stream) ────────────────────── */
.gleb-chat__row--user {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
    animation: fadeUp .25s ease both;
}

.gleb-chat__bubble--user {
    max-width: 85%;
    background: var(--clr-primary);
    color: #fff;
    padding: 10px 14px;
    border-radius: 18px 18px 4px 18px;
    font-size: .95rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(79,110,247,.25);
}

/* ── PANAS questionnaire ────────────────────────────────────────────────── */
.panas-form { display: flex; flex-direction: column; gap: 0; }

.panas-item {
    border: none;
    margin: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--clr-border);
}
.panas-item:last-of-type { border-bottom: none; }

.panas-item__label {
    display: block;
    font-size: .92rem;
    font-weight: 600;
    margin-bottom: 4px;
    padding: 0;
}

.panas-item__options {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.panas-item__radio {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition);
}
.panas-item__radio:hover { background: var(--clr-bg); }

.panas-item__radio input[type="radio"] {
    accent-color: var(--clr-primary);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin: 0;
}

.panas-item__radio-text {
    font-size: .82rem;
    color: var(--clr-text);
    line-height: 1.3;
}

.panas-item__radio:has(input:checked) {
    background: var(--clr-secondary);
}

.panas-item__radio:has(input:checked) .panas-item__radio-text {
    font-weight: 600;
    color: var(--clr-primary);
}

/* ── Debate images (harrybot) ────────────────────────────────────────────── */
.debate-img {
    display: block;
    width: 100%;
    border-radius: 8px;
    margin-bottom: 16px;
    object-fit: contain;
    max-height: 400px;
}

.debate-choices {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
}

.debate-choices .btn--choice {
    width: auto;
    flex: 1;
    min-width: 56px;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 14px 10px;
}

/* ── Hero (home page) ───────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px 32px;
    background: linear-gradient(160deg, var(--clr-bg) 0%, var(--clr-secondary) 100%);
    position: relative;
}

.hero__content {
    max-width: 600px;
    text-align: center;
    animation: fadeUp .5s ease both;
}

.hero__photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    border: 4px solid var(--clr-surface);
}

.hero__greeting {
    font-size: 1.1rem;
    color: var(--clr-muted);
    margin-bottom: 4px;
    letter-spacing: .02em;
}

.hero__name {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 8px;
    color: var(--clr-text);
}

.hero__role {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--clr-primary);
    margin-bottom: 20px;
}

.hero__desc {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--clr-muted);
    margin-bottom: 32px;
}

.hero__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn--lg { padding: 15px 32px; font-size: 1.05rem; border-radius: 10px; }

/* ── Scroll hint ────────────────────────────────────────────────────────── */
.scroll-hint {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    animation: hintBounce 2s ease-in-out infinite;
}

.scroll-hint__arrow {
    width: 28px;
    height: 28px;
    border-right: 2.5px solid var(--clr-primary);
    border-bottom: 2.5px solid var(--clr-primary);
    transform: rotate(45deg);
    opacity: .5;
    transition: opacity var(--transition);
}
.scroll-hint:hover .scroll-hint__arrow { opacity: 1; }

@keyframes hintBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(8px); }
}

/* ── Sections (home page) ───────────────────────────────────────────────── */
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
}

.about {
    padding: 64px 24px;
    background: var(--clr-surface);
}

.about__inner {
    max-width: 800px;
    margin: 0 auto;
}

.about__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.about__card {
    background: var(--clr-bg);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
}

.about__card-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.about__card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.about__card p {
    font-size: .9rem;
    color: var(--clr-muted);
    line-height: 1.6;
}

/* ── Timeline (education) ───────────────────────────────────────────────── */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--clr-border);
}

.timeline__item {
    position: relative;
    padding: 0 0 28px;
}
.timeline__item:last-child { padding-bottom: 0; }

.timeline__item::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 7px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--clr-primary);
    border: 2.5px solid var(--clr-surface);
    box-shadow: 0 0 0 2px var(--clr-primary);
}

.timeline__year {
    display: inline-block;
    font-size: .8rem;
    font-weight: 700;
    color: var(--clr-primary);
    margin-bottom: 4px;
    letter-spacing: .02em;
}

.timeline__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline__desc {
    font-size: .9rem;
    color: var(--clr-muted);
    line-height: 1.6;
}

/* ── Publications ───────────────────────────────────────────────────────── */
.publications {
    padding: 64px 24px;
    background: var(--clr-surface);
}

.publications__inner {
    max-width: 680px;
    margin: 0 auto;
}

.pub-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pub-item {
    padding: 20px 24px;
    background: var(--clr-bg);
    border-radius: var(--radius);
    border-left: 3px solid var(--clr-primary);
}

.pub-item__year {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    color: var(--clr-primary);
    background: var(--clr-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.pub-item__title {
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 6px;
}

.pub-item__authors {
    font-size: .85rem;
    color: var(--clr-muted);
    margin-bottom: 2px;
}

.pub-item__journal {
    font-size: .8rem;
    color: var(--clr-muted);
    font-style: italic;
}

.pub-item__doi {
    font-size: .8rem;
    margin-top: 8px;
}

.pub-item__doi a {
    color: var(--clr-primary);
    text-decoration: none;
    font-style: normal;
}

.pub-item__doi a:hover {
    text-decoration: underline;
}

/* ── Research section ───────────────────────────────────────────────────── */
.research {
    padding: 64px 24px;
    background: var(--clr-bg);
}

.research__inner {
    max-width: 680px;
    margin: 0 auto;
}

.research__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.research-item {
    display: block;
    position: relative;
    background: var(--clr-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 24px;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition), box-shadow var(--transition);
}
.research-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(79,110,247,.15);
}

.research-item__badge {
    display: inline-block;
    background: #e6ffed;
    color: var(--clr-success);
    font-size: .75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.research-item__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.research-item__desc {
    font-size: .95rem;
    color: var(--clr-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.research-item__meta {
    font-size: .8rem;
    color: var(--clr-primary);
    font-weight: 600;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
    padding: 24px;
    text-align: center;
    color: var(--clr-muted);
    font-size: .85rem;
    background: var(--clr-surface);
    border-top: 1px solid var(--clr-border);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    :root {
        /* --vh-real устанавливается JS через visualViewport; svh — fallback */
        --gleb-card-height: var(--vh-real, 100svh);
    }

    .survey-wrap { padding: 24px 12px 24px; }
    .survey-wrap--gleb-chat {
        padding: 0;
        min-height: 0;
        height: var(--vh-real, 100svh);
        overflow: hidden;
    }

    .card { padding: 24px 18px; }
    .card--gleb {
        padding: 0;
        max-width: 100%;
        height: var(--vh-real, 100svh);  /* явно на мобилке — вся высота */
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    .gleb-chat__topbar { padding: 8px 12px; }
    .form__textarea--chat {
        padding: 10px 44px 11px 14px;
        font-size: 16px; /* снимает зум iOS при фокусе */
    }
    .gleb-chat__send-plane {
        width: 34px;
        height: 34px;
        right: 5px;
        bottom: 5px;
    }
    .gleb-chat__send-plane svg {
        width: 18px;
        height: 18px;
    }

    .progress-row:not(.progress-row--gleb-inner) { margin-bottom: 12px; }

    /* Чуть крупнее кнопки-варианты — удобнее попадать пальцем */
    .btn--choice { padding: 14px 12px; }

    .debate-img { max-height: 280px; } /* дебатные изображения не занимают весь экран */

    .landing-title { font-size: 1.5rem; }
    .landing-sub   { font-size: 1rem; }

    .result-score__value { font-size: 2.8rem; }

    /* Стек кнопок результата на узком экране */
    .result-actions { flex-direction: column; align-items: stretch; }
    .result-actions .btn { text-align: center; }

    .hero {
        padding: 32px 16px 24px;
        justify-content: flex-start;  /* контент от верха — кнопка не обрезается */
        min-height: 100svh;
    }
    .hero__photo { width: 110px; height: 110px; margin-bottom: 14px; }
    .hero__name { font-size: 2rem; margin-bottom: 4px; }
    .hero__role { font-size: 1.05rem; margin-bottom: 14px; }
    .hero__desc { margin-bottom: 24px; font-size: 1rem; }
    .scroll-hint { bottom: 12px; }

    .about, .research, .publications { padding: 48px 16px; }
    .pub-item { padding: 16px 18px; }
    .section-title { font-size: 1.3rem; }

    .research-item { padding: 20px 18px; }

    .panas-item { padding: 8px 0; }
    .panas-item__radio { padding: 3px 6px; }
}
