/* ── Support button ─────────────────────────────────────── */
.hdr-support-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 34px;
    padding: 0 0.85rem;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.13s, background 0.13s, color 0.13s;
}

.hdr-support-btn:hover {
    background: #faf5ff;
    border-color: #c4b5fd;
    color: #4C1D95;
}

.hdr-support-btn i {
    font-size: 0.85rem;
}

/* ── Support modal ──────────────────────────────────────── */
.support-modal-content {
    border-radius: 16px;
    border: none;
    overflow: hidden;
}

.support-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    background: linear-gradient(135deg, #4C1D95 0%, #7C3AED 100%);
}

.support-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.support-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.support-modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.support-modal-sub {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.65);
    margin-top: 1px;
}

.support-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: background 0.15s;
    flex-shrink: 0;
}

.support-close-btn:hover {
    background: rgba(255,255,255,0.25);
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.modal-close-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.support-contacts {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.875rem 1.5rem 0;
}

.support-guide-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 36px;
    padding: 0 0.95rem;
    border: 1px solid #ddd6fe;
    border-radius: 10px;
    background: #f8f5ff;
    color: #5b21b6;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s, border-color 0.15s;
}

.support-guide-btn:hover {
    background: #f3ecff;
    border-color: #c4b5fd;
    transform: translateY(-1px);
}

.support-contact-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #475569;
}

.support-contact-item i {
    color: #7C3AED;
    font-size: 0.9rem;
}

.support-contact-item a {
    color: #7C3AED;
    font-weight: 600;
    text-decoration: none;
}

.support-contact-item a:hover {
    text-decoration: underline;
}

.support-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.support-divider::before,
.support-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.support-quiz {
    padding: 0 1.5rem 1.5rem;
}

.support-step-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.75rem;
}

.support-topic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.support-topic-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.875rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    background: white;
}

.support-topic-card:hover {
    border-color: #c4b5fd;
    background: #faf5ff;
}

.support-topic-card.selected {
    border-color: #7C3AED;
    background: #f5f3ff;
}

.support-topic-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.support-topic-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.support-subtopic-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.support-subtopic-item {
    padding: 0.6rem 0.875rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s;
    background: white;
}

.support-subtopic-item:hover {
    border-color: #c4b5fd;
    background: #faf5ff;
    color: #6D28D9;
}

.support-subtopic-item.selected {
    border-color: #7C3AED;
    background: #f5f3ff;
    color: #6D28D9;
}

.support-breadcrumb {
    font-size: 0.75rem;
    color: #7C3AED;
    font-weight: 600;
    background: #f5f3ff;
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    margin-bottom: 0.75rem;
}

.support-textarea {
    width: 100%;
    min-height: 100px;
    max-height: 180px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: #1e293b;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    margin-bottom: 0.75rem;
}

.support-textarea:focus {
    border-color: #7C3AED;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

.support-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.support-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    transition: color 0.15s;
}

.support-back-btn:hover {
    color: #475569;
}

.support-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 36px;
    padding: 0 1.25rem;
    background: linear-gradient(145deg, #4C1D95, #7C3AED);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}

.support-submit-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.support-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.support-done {
    text-align: center;
    padding: 0.5rem 0 0.25rem;
}

.support-done-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.support-done-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.4rem;
}

.support-done-desc {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.55;
}

/* ── Попап профиля ── */
.profile-popup {
    position: fixed;
    top: 58px;
    right: 12px;
    width: 280px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 2000;
    overflow: hidden;
    animation: ppFadeIn 0.15s ease;
}

@keyframes ppFadeIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-popup-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 14px;
}

.profile-popup-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-popup-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
    overflow: hidden;
}

.profile-popup-avatar.has-image {
    background: #e2e8f0;
    color: transparent;
}

.profile-popup-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pp-avatar-action {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 22px;
    height: 22px;
    border: 1px solid #fff;
    border-radius: 50%;
    background: #1e293b;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
    transition: transform 0.13s ease, background 0.13s ease;
}

.pp-avatar-action:hover {
    background: #0f172a;
    transform: scale(1.05);
}

.profile-popup-meta {
    min-width: 0;
}

.profile-popup-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-popup-sub {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pp-link-btn {
    padding: 0;
    margin-top: 6px;
    border: none;
    background: transparent;
    color: #4f46e5;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

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

.pp-link-btn:hover {
    color: #4338ca;
}

.pp-link-btn-danger {
    color: #dc2626;
}

.pp-link-btn-danger:hover {
    color: #b91c1c;
}

.pp-avatar-hint {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 0.68rem;
    line-height: 1.35;
}

.profile-popup-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 0;
}

.profile-popup-body {
    padding: 14px 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pp-field-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pp-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pp-input {
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.875rem;
    color: #1e293b;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    width: 100%;
}

.pp-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.profile-popup-footer {
    display: flex;
    gap: 8px;
    padding: 10px 16px 14px;
}

.pp-btn-primary {
    flex: 1;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background 0.13s;
    font-family: inherit;
}

.pp-btn-primary:hover {
    background: #4f46e5;
}

.pp-btn-ghost {
    background: transparent;
    color: #64748b;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.13s, border-color 0.13s;
    font-family: inherit;
}

.pp-btn-ghost:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.avatar-crop-modal-content {
    border: none;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

.avatar-crop-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 12px;
    border-bottom: 1px solid #eef2f7;
}

.avatar-crop-modal-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}

.avatar-crop-modal-sub {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #64748b;
}

.avatar-crop-modal-body {
    padding: 18px 20px 12px;
}

.avatar-crop-stage {
    position: relative;
    width: min(100%, 360px);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    border-radius: 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.18), transparent 38%),
        linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.24);
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.avatar-crop-stage.is-dragging {
    cursor: grabbing;
}

.avatar-crop-stage.is-pinching {
    cursor: zoom-in;
}

.avatar-crop-image {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: none;
    transform-origin: center center;
    will-change: transform;
    pointer-events: none;
}

.avatar-crop-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 78%;
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.48);
    pointer-events: none;
}

.avatar-crop-controls {
    margin-top: 16px;
}

.avatar-crop-control-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
}

#avatar-crop-zoom {
    width: 100%;
    accent-color: #4f46e5;
}

.avatar-crop-help {
    margin-top: 12px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #64748b;
}

.avatar-crop-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px 18px;
    border-top: 1px solid #eef2f7;
}

/* ── Футер ── */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 1.5rem;
    font-size: 0.72rem;
    color: #94a3b8;
    border-top: 1px solid #f0f2f5;
    background: #fff;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    text-align: center;
}

.app-footer strong {
    color: #6366f1;
    font-weight: 600;
}

.app-footer-sep {
    color: #cbd5e1;
    font-size: 0.8rem;
}

@media (max-width: 1023.98px) {
    .support-guide-btn {
        display: none;
    }

    .avatar-crop-modal-body {
        padding: 16px;
    }

    .avatar-crop-modal-header,
    .avatar-crop-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .avatar-crop-stage {
        width: min(100%, 320px);
        border-radius: 24px;
    }
}
