:root {
    --profile-band-min: 800px;
    --profile-band-max: 1000px;
    --profile-content-width: 800px;
    --profile-side-padding: 24px;
    --profile-icon-size: 96px;
}

.profile-hero-shell {
    width: 100%;
}

.profile-cover-banner,
.top-profile {
    width: min(100%, var(--profile-band-max));
    min-width: var(--profile-band-min);
    margin: 0 auto;
}

.profile-cover-banner {
    position: relative;
    z-index: 1;
    aspect-ratio: 100 / 13;
    min-height: 104px;
    max-height: 130px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #b1b1b1;
}


.top-profile {
    position: relative;
    z-index: 2;
    overflow: visible;
    background: #ffffff;
    padding-bottom: 0;
}

.who-profile-hero {
    position: relative;
    width: var(--profile-content-width);
    max-width: var(--profile-content-width);
    margin: 0 auto;
    box-sizing: border-box;
    padding: 56px var(--profile-side-padding) 0;
    min-height: 130px;
}

/* アイコンは左上でヘッダーに半分かかる */
.profile-icon-slot {
    position: absolute;
    top: -48px;
    left: var(--profile-side-padding);
    width: var(--profile-icon-size);
    height: var(--profile-icon-size);
    z-index: 3;
}

.profile-icon-img {
    display: block;
    width: var(--profile-icon-size);
    height: var(--profile-icon-size);
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* 右上のフォローボタン */
.profile-follow {
    position: absolute;
    top: 12px;
    right: var(--profile-side-padding);
    z-index: 3;
    width: auto;
    margin: 0;
    text-align: right;
}

.follow-form {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 24px;
}

/* 下段: 左に名前、右に人数 */
.name-profile-hero {
    width: 100%;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    min-width: 0;
}

.name-profile-hero > div:first-child {
    flex: 1;
    min-width: 0;
}

.name-profile-hero h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

.name-profile-hero h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
}
.profile-hero-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    width: 100%;
}

.profile-hero-user {
    flex: 1;
    min-width: 0;
}

.user-name {
    margin-top:3px;
    margin-bottom: 6px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.user-kana {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
}
.user-tag {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.1;
    color:#808080;
}
.profile-stats {
    flex: 0 0 auto;
}
.follow-count-form {
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.follower-count {
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    color: #3d3d3d;
    white-space: nowrap;
}

.followingCount {
    font-weight: 700;
    font-size: 16px;
    margin-left: 5px;
}

.profile {
    max-width: 650px;
    margin: 0 auto;
}

.link-pro {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 9999px;
    color: #000000;
    border: 1px solid #000000;
    background: #ffffff;
    font-weight: 500;
    text-decoration: none;
}

.following-card__follow-button {
    flex: 0 0 auto;
    min-width: 122px;
    height: 40px;
    border-radius: 9999px;
    padding: 0 18px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.following-card__follow-label--hover {
    display: none;
}

.following-card__follow-button.is-following {
    border: 1px solid #cfd9de;
    background: #ffffff;
    color: #0f1419;
}

@media (hover: hover) and (pointer: fine) {
    .following-card__follow-button.is-following:hover {
        border-color: #f4212e;
        background: #fff1f2;
        color: #f4212e;
    }

    .following-card__follow-button.is-following:hover .following-card__follow-label--default {
        display: none;
    }

    .following-card__follow-button.is-following:hover .following-card__follow-label--hover {
        display: inline;
    }
}

.following-card__follow-button.is-not-following {
    border: 1px solid #0f1419;
    background: #0f1419;
    color: #ffffff;
}

.following-card__follow-button.is-not-following:hover {
    border-color: #272c30;
    background: #272c30;
    color: #ffffff;
}

.following-card__follow-button.is-loading {
    opacity: 0.6;
    cursor: wait;
}

.profile-nav {
    width: min(100%, var(--profile-band-max));
    min-width: var(--profile-band-min);
    margin: 0 auto 16px;
    background: #ffffff;
    border-bottom: 1px solid #d1d1d1;
}

.profile-nav__inner {
    width: var(--profile-content-width);
    max-width: var(--profile-content-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.profile-nav__inner::-webkit-scrollbar {
    display: none;
}

.profile-nav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 14px;
    color: #536471;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.profile-nav__link:hover {
    color: #0f1419;
    background: #f2f2f2;
}

.profile-nav__link::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 4px;
    border-radius: 9999px;
    background: #1d9bf0;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.15s ease;
}

.profile-nav__link.is-active {
    color: #0f1419;
}

.profile-nav__link.is-active::after {
    transform: scaleX(1);
}/* 共通の小アイコンボタン */
.x-btn,
.profile-copy-link {
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #000;
    border-radius: 9999px;
    background: #fff;
    color: #000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.x-btn i {
    font-size: 1rem;
    line-height: 1;
}

.svg-icon-link {
    width: 14px;
    height: 14px;
    display: block;
}

.x-btn:hover,
.profile-copy-link:hover {
    color: #ffffff;
    background: #212121;
    border-color: #000;
}

.x-btn:hover i {
    color: #ffffff;
}

.profile-copy-link:focus-visible,
.x-btn:focus-visible {
    outline: 2px solid #1d9bf0;
    outline-offset: 2px;
}

.profile-copy-link__tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    padding: 8px 10px;
    border-radius: 8px;
    background: #0f1419;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
    z-index: 20;
}

.profile-copy-link__tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #0f1419 transparent transparent transparent;
}

.profile-copy-link:hover .profile-copy-link__tooltip,
.profile-copy-link:focus-visible .profile-copy-link__tooltip,
.profile-copy-link.is-copied .profile-copy-link__tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-2px);
}
.following-card__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ececec;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
}
        .profile-stats-link {
            border-bottom: 1px solid #000000;
        }
        .profile-stats-link:hover {
            border-bottom: 3px solid #0984ff;
            color: #1c7ed6;
        }
@media (max-width: 480px) {
    .profile-nav {
        width: 100%;
        min-width: 0;
    }

    .profile-nav__inner {
        width: 100%;
        max-width: 100%;
        padding: 0 8px;
        box-sizing: border-box;
        gap: 0;
    }

    .profile-nav__link {
        min-height: 46px;
        padding: 0 12px;
        font-size: 14px;
    }

    .profile-nav__link::after {
        left: 12px;
        right: 12px;
        height: 3px;
    }
}

/* 800〜1000の間で少しだけ詰める */
@media (max-width: 900px) and (min-width: 481px) {
    :root {
        --profile-side-padding: 20px;
    }

    .name-profile-hero h1 {
        font-size: 17px;
    }

    .name-profile-hero h2,
    .follower-count,
    .followingCount {
        font-size: 15px;
    }

    .follow-count-form {
        gap: 14px;
    }
}

/* スマホ: Xのモバイルっぽく、左にアイコン、右上にボタン、下に名前と数 */
@media (max-width: 480px) {
    :root {
        --profile-icon-size: 72px;
    }

    .profile-cover-banner,
    .top-profile {
        width: 100%;
        min-width: 0;
    }

    .profile-cover-banner {
        min-height: 96px;
        max-height: none;
    }

    .top-profile {
        padding-bottom: 16px;
    }

    .who-profile-hero {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 46px 16px 0;
        min-height: 0;
    }

    .profile-icon-slot {
        top: -36px;
        left: 16px;
    }

    .profile-follow {
        top: 10px;
        right: 16px;
    }

    .following-card__follow-button,
    .link-pro {
        min-width: 96px;
        height: 34px;
        padding: 0 14px;
        font-size: 13px;
    }

    .name-profile-hero {
        display: block;
        width: 100%;
    }

    .name-profile-hero > div:first-child {
        margin-bottom: 10px;
    }

    .name-profile-hero h1 {
        font-size: 16px;
        font-weight: 600;
    }

    .name-profile-hero h2 {
        font-size: 14px;
        font-weight: 400;
    }
    .follow-form {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 12px;
    }
    .follow-count-form {
        justify-content: flex-start;
        gap: 14px;
    }

    .follower-count,
    .followingCount {
        font-size: 14px;
    }

    .profile-stats {
        display: block;
    }

    .follow-count-form {
        justify-content: flex-start;
        gap: 14px;
    }
    .x-btn,
    .profile-copy-link {
        width: 34px;
        height: 34px;
    }

    .svg-icon-link {
        width: 16px;
        height: 16px;
    }

    .profile-copy-link__tooltip {
        font-size: 11px;
        padding: 6px 8px;
    }
}
