/* Phone profile hero (templates/profile_includes/header.html, .profile-app-hero): the avatar shares its row with
   the one action that matters, name and «@ник · город» under it, social networks as icons, the counters between
   hairlines, the guide as one card, rank, level, reputation and the rarest award as one progress card.
   Loaded after profile.css, profile-app-parity.css, profile-social.css and guides.css. */

@media (max-width: 767px) {
    /* The default cover: a smaller logo, below the buttons on the cover. */
    .profile-page .profile-app-hero__cover-fallback img {
        width: 50%;
        max-width: 200px;
        margin-top: 26px;
    }

    .profile-page .profile-app-hero__identity {
        padding: 0 16px 18px;
    }

    /* Avatar on the left, the action on the right, both on the cover's lower edge. */
    .profile-page .profile-app-hero__avatar-row {
        display: flex;
        min-height: 0;
        align-items: flex-end;
        justify-content: space-between;
        gap: 12px;
    }

    .profile-page .profile-app-avatar {
        flex: none;
        width: 100px;
        height: 100px;
        margin-top: -50px;
    }

    .profile-page .profile-app-avatar__photo {
        width: 86px;
        height: 86px;
        border-width: 3px;
    }

    .profile-page .profile-app-hero__cta {
        display: flex;
        min-width: 0;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        padding-bottom: 4px;
    }

    .profile-page .profile-app-hero__cta-button,
    .profile-page .profile-app-hero__cta .profile-app-actions__primary--follow,
    .profile-page .profile-app-hero__cta .profile-app-actions__public {
        display: inline-flex;
        min-width: 0;
        min-height: 42px;
        flex: none;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding: 0 18px;
        border-radius: 999px;
        font-size: 14px;
        font-weight: 750;
        white-space: nowrap;
    }

    .profile-page .profile-app-hero__cta-button {
        border: 1px solid #e5e7eb;
        background: #fff;
        color: #111827;
    }

    .profile-page .profile-app-hero__cta-button svg {
        width: 16px;
        height: 16px;
    }

    .profile-page .profile-app-hero__cta .profile-app-actions__public {
        width: auto;
        font-size: 13px;
    }

    .profile-page .profile-app-hero__cta-icon {
        display: inline-flex;
        width: 42px;
        height: 42px;
        flex: none;
        align-items: center;
        justify-content: center;
        border: 1px solid #e5e7eb;
        border-radius: 50%;
        background: #fff;
        color: #111827;
    }

    .profile-page .profile-app-hero__cta-icon svg {
        width: 20px;
        height: 20px;
    }

    .profile-page .profile-app-hero__name-block {
        margin-top: 12px;
        padding-top: 0;
    }

    .profile-page .profile-app-hero__name-block h1 {
        font-size: clamp(24px, 6.6vw, 28px);
        letter-spacing: -.4px;
    }

    .profile-page .profile-app-hero__name-block p {
        margin-top: 2px;
        font-size: 14px;
    }

    /* The city is part of the «@ник · город» line now. */
    .profile-page .profile-app-hero__location {
        display: inline;
        min-height: 0;
        margin: 0;
        color: inherit;
        font-size: inherit;
    }

    .profile-page .profile-app-hero__bio {
        margin-top: 10px;
    }

    /* Social networks: round icons; the name stays for screen readers and in the tooltip. */
    .profile-page .profile-social-links--app {
        flex-wrap: wrap;
        gap: 8px;
        margin: 12px 0 0;
        padding: 0;
        overflow: visible;
    }

    .profile-page .profile-social-links--app .profile-social-links__item {
        position: relative;
        width: 40px;
        height: 40px;
        justify-content: center;
        padding: 0;
        border-radius: 50%;
    }

    .profile-page .profile-social-links--app .profile-social-links__item img {
        width: 24px;
        height: 24px;
    }

    .profile-page .profile-social-links--app .profile-social-links__item span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    /* The counters between two hairlines. */
    .profile-page .profile-app-metrics {
        margin-top: 16px;
        padding: 6px 0;
        border-top: 1px solid #eef0f3;
        border-bottom: 1px solid #eef0f3;
    }

    .profile-page .profile-app-hero .profile-app-actions {
        margin-top: 14px;
    }

    /* The guide: one card with the badges in one swipeable row. */
    .profile-page .gd-hero-guide--app {
        gap: 8px;
        margin: 14px 0 0;
        padding: 14px;
        border: 1px solid #fde3cf;
        border-radius: 18px;
        background: #fffaf6;
    }

    .profile-page .gd-hero-guide--app .gd-hero-guide__headline {
        font-size: 15px;
        line-height: 1.35;
    }

    .profile-page .gd-hero-guide--app .gd-hero-guide__trust {
        font-size: 13px;
    }

    .profile-page .gd-hero-guide--app .gd-badges--hero {
        flex-wrap: nowrap;
        margin: 2px -14px 0;
        padding: 0 14px 2px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .profile-page .gd-hero-guide--app .gd-badges--hero::-webkit-scrollbar {
        display: none;
    }

    .profile-page .gd-hero-guide--app .gd-badges--hero > li {
        flex: none;
    }

    /* Progress: rank, level and reputation on one line, the rarest award under them. */
    .profile-page .profile-app-progress {
        display: grid;
        width: 100%;
        gap: 12px;
        margin-top: 14px;
        padding: 14px;
        border: 1px solid #e8ecef;
        border-radius: 18px;
        background: #fff;
        color: #111827;
        text-align: left;
        box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
    }

    .profile-page .profile-app-progress__head {
        display: flex;
        min-width: 0;
        align-items: center;
        gap: 12px;
    }

    .profile-page .profile-app-progress__level {
        display: grid;
        width: 44px;
        height: 44px;
        flex: none;
        place-items: center;
        border-radius: 14px;
        background: linear-gradient(145deg, #ff8a3d, #f15a12);
        box-shadow: 0 6px 14px rgba(241, 90, 18, .28);
        color: #fff;
        font-size: 18px;
        font-weight: 800;
        font-variant-numeric: tabular-nums;
    }

    .profile-page .profile-app-progress__rank {
        display: grid;
        min-width: 0;
        flex: 1;
        gap: 1px;
    }

    .profile-page .profile-app-progress__rank strong {
        overflow: hidden;
        font-size: 15px;
        font-weight: 750;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .profile-page .profile-app-progress__rank small {
        color: #7b8491;
        font-size: 12px;
        font-weight: 600;
    }

    /* Reputation sits inside the card: no box of its own. */
    .profile-page .profile-app-progress .profile-app-reputation {
        display: block;
        width: 116px;
        min-height: 0;
        flex: 0 0 116px;
        margin: 0;
        padding: 0;
        border: 0;
        background: none;
    }

    .profile-page .profile-app-progress__award {
        display: flex;
        min-width: 0;
        align-items: center;
        gap: 12px;
        padding-top: 12px;
        border-top: 1px solid #f0f2f5;
    }

    .profile-page .profile-app-progress__award-art {
        display: grid;
        width: 44px;
        height: 44px;
        flex: none;
        place-items: center;
        border-radius: 12px;
        background: #fff4ec;
        color: #f97316;
    }

    .profile-page .profile-app-progress__award-art img {
        width: 40px;
        height: 40px;
        object-fit: contain;
    }

    .profile-page .profile-app-progress__award-art svg {
        width: 24px;
        height: 24px;
    }

    .profile-page .profile-app-progress__award-copy {
        display: grid;
        min-width: 0;
        flex: 1;
        gap: 2px;
    }

    .profile-page .profile-app-progress__award-copy small {
        color: #c2410c;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .3px;
        text-transform: uppercase;
    }

    .profile-page .profile-app-progress__award-copy strong {
        overflow: hidden;
        font-size: 14px;
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .profile-page .profile-app-progress__chevron {
        width: 18px;
        height: 18px;
        flex: none;
        color: #9aa3ae;
    }

    /* Report and block: quiet links at the end. */
    .profile-page .profile-app-hero__safety {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px 20px;
        margin-top: 10px;
    }

    .profile-page .profile-app-hero__safety button {
        padding: 6px;
        border: 0;
        background: none;
        color: #6b7280;
        font: inherit;
        font-size: 13px;
        font-weight: 600;
        white-space: nowrap;
    }
}

/* The narrowest phones: the action keeps its one line beside a smaller avatar. */
@media (max-width: 359px) {
    .profile-page .profile-app-avatar {
        width: 88px;
        height: 88px;
        margin-top: -44px;
    }

    .profile-page .profile-app-avatar__photo {
        width: 76px;
        height: 76px;
    }

    .profile-page .profile-app-hero__cta-button,
    .profile-page .profile-app-hero__cta .profile-app-actions__primary--follow {
        padding: 0 14px;
        font-size: 13px;
    }

    .profile-page .profile-app-progress .profile-app-reputation {
        width: 100px;
        flex-basis: 100px;
    }
}

html[data-theme="dark"]:not(#tt-dk) .profile-page .profile-app-hero__cta-button,
html[data-theme="dark"]:not(#tt-dk) .profile-page .profile-app-hero__cta-icon,
html[data-theme="dark"]:not(#tt-dk) .profile-page .profile-app-progress {
    border-color: var(--tt-dk-line);
    background: var(--tt-dk-muted-surface);
    color: var(--tt-dk-text);
    box-shadow: none;
}

html[data-theme="dark"]:not(#tt-dk) .profile-page .profile-app-metrics,
html[data-theme="dark"]:not(#tt-dk) .profile-page .profile-app-progress__award {
    border-color: var(--tt-dk-line);
}

html[data-theme="dark"]:not(#tt-dk) .profile-page .profile-app-progress__rank small,
html[data-theme="dark"]:not(#tt-dk) .profile-page .profile-app-reputation small,
html[data-theme="dark"]:not(#tt-dk) .profile-page .profile-app-reputation em,
html[data-theme="dark"]:not(#tt-dk) .profile-page .profile-app-reputation b,
html[data-theme="dark"]:not(#tt-dk) .profile-page .profile-app-hero__safety button {
    color: var(--tt-dk-muted);
}

html[data-theme="dark"]:not(#tt-dk) .profile-page .profile-app-reputation strong {
    color: var(--tt-dk-text);
}

html[data-theme="dark"]:not(#tt-dk) .profile-page .profile-app-reputation i {
    background: var(--tt-dk-line);
}

html[data-theme="dark"]:not(#tt-dk) .profile-page .profile-app-progress__award-art {
    background: rgba(249, 115, 22, .14);
}

html[data-theme="dark"]:not(#tt-dk) .profile-page .profile-app-progress__award-copy small {
    color: var(--tt-dk-orange-text);
}

html[data-theme="dark"]:not(#tt-dk) .profile-page .gd-hero-guide--app {
    border-color: rgba(249, 115, 22, .3);
    background: rgba(249, 115, 22, .07);
}
