.public-author-profile {
    --profile-primary: #df6d72;
    --profile-primary-dark: #be5367;
    --profile-primary-soft: #fff0f2;
    --profile-purple: #a47bd7;
    --profile-text: #392f33;
    --profile-muted: #746a6f;
    --profile-panel: #fff;
    --profile-surface: #fffafb;
    --profile-border: #f0d7dc;
    --profile-shadow: 0 14px 38px rgba(164, 86, 107, .1);
    color: var(--profile-text);
    min-height: 70vh;
}

.public-author-profile .min-w-0 {
    min-width: 0;
}

.profile-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 28px 32px;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 26px;
    background: linear-gradient(118deg, #ffd6de 0%, #f7cadc 48%, #e8d6fb 100%);
    box-shadow: var(--profile-shadow);
}

.profile-hero::before,
.profile-hero::after {
    position: absolute;
    z-index: -1;
    border: 28px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    content: '';
    pointer-events: none;
}

.profile-hero::before {
    top: -82px;
    right: -56px;
    width: 210px;
    height: 210px;
}

.profile-hero::after {
    right: 130px;
    bottom: -92px;
    width: 150px;
    height: 150px;
    border-width: 20px;
}

.profile-hero-content {
    position: relative;
    z-index: 1;
}

.profile-avatar-wrap {
    position: relative;
    display: inline-grid;
    width: 126px;
    height: 126px;
    place-items: center;
}

.profile-avatar {
    width: 108px;
    height: 108px;
    border: 4px solid rgba(255, 255, 255, .94);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 9px 24px rgba(91, 52, 66, .18);
}

.profile-avatar-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.profile-main-info {
    max-width: 760px;
}

.profile-author-name {
    color: #30262a;
    font-size: clamp(1.55rem, 2.5vw, 2.15rem);
    font-weight: 750;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.profile-author-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(190, 83, 103, .18);
    border-radius: 999px;
    color: var(--profile-primary-dark);
    background: rgba(255, 255, 255, .72);
    font-size: .77rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(138, 75, 92, .07);
}

.profile-private-meta,
.profile-experience {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: #665b60;
    font-size: .86rem;
}

.profile-private-meta i,
.profile-experience i {
    width: 16px;
    color: var(--profile-primary-dark);
    text-align: center;
}

.profile-story-count {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, .62);
    border-radius: 999px;
    color: #4a3d42;
    background: rgba(255, 255, 255, .35);
    font-size: .94rem;
}

.profile-story-count i {
    color: #8b63dc;
}

.profile-followers-pill,
.profile-facebook-button,
.profile-follow-button {
    min-height: 42px;
    border-radius: 12px;
    font-size: .9rem;
    font-weight: 700;
}

.profile-followers-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, .7);
    color: #4a3e43;
    background: rgba(255, 255, 255, .62);
}

.profile-followers-pill i {
    color: var(--profile-primary);
}

.profile-facebook-button {
    position: relative;
    display: inline-grid;
    width: 42px;
    border: 1px solid rgba(46, 111, 212, .2);
    color: #2879d7;
    background: rgba(255, 255, 255, .7);
    place-items: center;
    text-decoration: none;
}

.profile-follow-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 17px;
    border: 1px solid transparent;
    color: #fff;
    background: linear-gradient(135deg, #e77c83, #d65d69);
    box-shadow: 0 7px 18px rgba(196, 83, 103, .22);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.profile-follow-button:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(196, 83, 103, .28);
}

.profile-follow-button.following {
    border-color: rgba(190, 83, 103, .28);
    color: var(--profile-primary-dark);
    background: rgba(255, 255, 255, .75);
    box-shadow: none;
}

.profile-follow-button:disabled {
    cursor: wait;
    opacity: .65;
}

.profile-introduction {
    padding: 21px 24px;
    border: 1px solid var(--profile-border);
    border-radius: 20px;
    background: var(--profile-panel);
    box-shadow: 0 8px 24px rgba(151, 91, 107, .06);
}

.profile-introduction h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #3c3035;
    font-size: 1.1rem;
    font-weight: 750;
}

.profile-introduction h2 i {
    color: var(--profile-primary);
}

.profile-introduction p {
    color: var(--profile-muted);
    line-height: 1.75;
    white-space: pre-line;
}

.profile-stories-section {
    padding: 26px;
    border: 1px solid var(--profile-border);
    border-radius: 24px;
    background: var(--profile-panel);
    box-shadow: var(--profile-shadow);
}

.profile-section-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--profile-primary);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.profile-stories-header h2 {
    color: #30262a;
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    font-weight: 750;
}

.profile-view-actions {
    align-self: center;
}

.profile-icon-button {
    position: relative;
    display: inline-grid;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--profile-border);
    border-radius: 50%;
    color: #6e6167;
    background: #fff;
    place-items: center;
    transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}

.profile-icon-button:hover,
.profile-icon-button.active {
    border-color: #ee9da8;
    color: var(--profile-primary-dark);
    background: var(--profile-primary-soft);
    transform: translateY(-1px);
}

[data-profile-tooltip] {
    position: relative;
}

@media (hover: hover) and (pointer: fine) {
    [data-profile-tooltip]::before,
    [data-profile-tooltip]::after {
        position: absolute;
        z-index: 30;
        left: 50%;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
    }

    [data-profile-tooltip]::before {
        bottom: calc(100% + 10px);
        width: max-content;
        max-width: 230px;
        padding: 7px 10px;
        border: 1px solid rgba(255, 255, 255, .18);
        border-radius: 8px;
        color: #fff;
        background: #724c70;
        box-shadow: 0 7px 18px rgba(71, 40, 68, .22);
        content: attr(data-profile-tooltip);
        font-size: .75rem;
        font-weight: 700;
        line-height: 1.3;
        text-align: center;
        transform: translate(-50%, 4px);
    }

    [data-profile-tooltip]::after {
        bottom: calc(100% + 5px);
        width: 10px;
        height: 10px;
        background: #724c70;
        content: '';
        transform: translateX(-50%) rotate(45deg);
    }

    [data-profile-tooltip]:hover::before,
    [data-profile-tooltip]:hover::after,
    [data-profile-tooltip]:focus-visible::before,
    [data-profile-tooltip]:focus-visible::after {
        visibility: visible;
        opacity: 1;
    }

    [data-profile-tooltip]:hover::before,
    [data-profile-tooltip]:focus-visible::before {
        transform: translate(-50%, 0);
    }
}

.profile-story-filters {
    padding: 12px 14px;
    border: 1px solid #f0e1e4;
    border-radius: 16px;
    background: #fcf9fa;
}

.profile-filter-pill {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    padding: 7px 14px;
    border: 1px solid #ead2d7;
    border-radius: 999px;
    color: #61545a;
    background: #fff;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    transition: color .18s ease, background .18s ease, border-color .18s ease;
}

.profile-filter-pill:hover,
.profile-filter-pill.active {
    border-color: var(--profile-primary);
    color: #fff;
    background: var(--profile-primary);
}

.profile-story-search {
    position: relative;
    width: min(100%, 330px);
}

.profile-story-search i {
    position: absolute;
    top: 50%;
    left: 14px;
    color: #aa98a0;
    transform: translateY(-50%);
    pointer-events: none;
}

.profile-story-search input {
    width: 100%;
    height: 40px;
    padding: 8px 14px 8px 40px;
    border: 1px solid #e8dadd;
    border-radius: 999px;
    outline: none;
    color: var(--profile-text);
    background: #fff;
    font-size: .88rem;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.profile-story-search input:focus {
    border-color: #e69aa5;
    box-shadow: 0 0 0 3px rgba(223, 109, 114, .1);
}

.profile-story-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}

.profile-story-card {
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--profile-border);
    border-radius: 18px;
    background: #fff;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.profile-story-card:hover {
    border-color: #eaa5af;
    transform: translateY(-3px);
    box-shadow: 0 12px 27px rgba(136, 77, 93, .12);
}

.profile-grid-cover {
    overflow: hidden;
    aspect-ratio: 3 / 4;
    border-radius: 13px;
    background: var(--profile-primary-soft);
}

.profile-grid-cover img,
.profile-list-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .24s ease;
}

.profile-story-card:hover .profile-grid-cover img {
    transform: scale(1.025);
}

.profile-story-title {
    overflow: hidden;
    color: #403439;
    font-size: .93rem;
    font-weight: 700;
    line-height: 1.42;
    text-overflow: ellipsis;
}

.profile-story-card .profile-story-title {
    display: -webkit-box;
    min-height: 2.65em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.profile-story-card:hover .profile-story-title,
.profile-story-list-item:hover .profile-story-title {
    color: var(--profile-primary-dark);
}

.profile-story-meta {
    color: #887980;
    font-size: .77rem;
}

.profile-story-meta i {
    color: var(--profile-primary);
}

.profile-full-badge,
.profile-age-badge,
.profile-status-badge,
.profile-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 700;
    line-height: 1;
}

.profile-full-badge {
    position: absolute;
    top: 9px;
    left: 9px;
    padding: 6px 9px;
    color: #fff;
    background: #08b979;
    font-size: .68rem;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(8, 185, 121, .2);
}

.profile-age-badge {
    padding: 6px 8px;
    color: #db365c;
    background: #fff0f3;
    font-size: .68rem;
}

.profile-age-on-cover {
    position: absolute;
    top: 9px;
    right: 9px;
}

.profile-full-badge + .profile-age-on-cover {
    right: 9px;
}

.profile-story-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.profile-story-list-item {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--profile-border);
    border-radius: 17px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.profile-story-list-item:hover {
    border-color: #eaa5af;
    box-shadow: 0 9px 22px rgba(137, 79, 94, .09);
}

.profile-list-cover {
    display: block;
    overflow: hidden;
    width: 92px;
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    background: var(--profile-primary-soft);
}

.profile-story-list-item .profile-story-title {
    display: block;
    white-space: nowrap;
}

.profile-status-badge,
.profile-category {
    padding: 6px 9px;
    font-size: .68rem;
}

.profile-status-badge.ongoing {
    color: #1683ac;
    background: #e9f8ff;
}

.profile-status-badge.completed {
    color: #087950;
    background: #e7faf2;
}

.profile-category {
    color: #b04f67;
    background: #fff1f3;
}

.profile-list-arrow {
    color: #c2afb5;
}

.profile-empty-state {
    padding: 46px 20px;
    border: 1px dashed #e8ccd2;
    border-radius: 17px;
    color: #8a7b81;
    background: #fffafb;
    text-align: center;
}

.profile-load-more {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border: 1px solid #e9a0aa;
    border-radius: 999px;
    color: var(--profile-primary-dark);
    background: #fff;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
}

.profile-load-more:hover {
    color: #fff;
    background: var(--profile-primary);
}

[data-profile-stories-root] {
    position: relative;
    transition: opacity .18s ease;
}

[data-profile-stories-root].profile-loading {
    opacity: .5;
    pointer-events: none;
}

body.dark-mode .public-author-profile {
    --profile-text: #f2e8eb;
    --profile-muted: #bcaeb4;
    --profile-panel: #181418;
    --profile-surface: #211a1f;
    --profile-border: #45353e;
    --profile-primary-soft: #322129;
    --profile-shadow: 0 16px 38px rgba(0, 0, 0, .22);
}

body.dark-mode .profile-hero {
    border-color: #513d49;
    background: linear-gradient(120deg, #502d3c 0%, #4a2b3b 48%, #3c3156 100%);
}

body.dark-mode .profile-author-name,
body.dark-mode .profile-stories-header h2,
body.dark-mode .profile-introduction h2,
body.dark-mode .profile-story-title {
    color: #fff5f7;
}

body.dark-mode .profile-private-meta,
body.dark-mode .profile-experience,
body.dark-mode .profile-introduction p,
body.dark-mode .profile-story-meta {
    color: var(--profile-muted);
}

body.dark-mode .profile-author-badge,
body.dark-mode .profile-story-count,
body.dark-mode .profile-followers-pill,
body.dark-mode .profile-facebook-button,
body.dark-mode .profile-follow-button.following {
    border-color: rgba(255, 255, 255, .13);
    color: #f4c8d3;
    background: rgba(22, 17, 21, .56);
}

body.dark-mode .profile-introduction,
body.dark-mode .profile-stories-section,
body.dark-mode .profile-story-card,
body.dark-mode .profile-story-list-item,
body.dark-mode .profile-icon-button,
body.dark-mode .profile-story-search input,
body.dark-mode .profile-filter-pill {
    color: var(--profile-text);
    background: var(--profile-panel);
}

body.dark-mode .profile-story-filters,
body.dark-mode .profile-empty-state {
    border-color: var(--profile-border);
    color: var(--profile-muted);
    background: var(--profile-surface);
}

body.dark-mode .profile-filter-pill:hover,
body.dark-mode .profile-filter-pill.active,
body.dark-mode .profile-icon-button.active {
    color: #fff;
    background: var(--profile-primary-dark);
}

body.dark-mode .profile-load-more {
    color: #f4bec9;
    background: #21191e;
}

@media (max-width: 1199.98px) {
    .profile-story-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .profile-story-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .profile-story-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .public-author-profile {
        padding-top: 18px !important;
    }

    .profile-hero {
        padding: 23px 18px;
        border-radius: 22px;
    }

    .profile-avatar-wrap {
        width: 110px;
        height: 110px;
    }

    .profile-avatar {
        width: 94px;
        height: 94px;
    }

    .profile-private-meta,
    .profile-experience {
        justify-content: center;
    }

    .profile-introduction {
        padding: 18px;
    }

    .profile-stories-section {
        padding: 19px 15px;
        border-radius: 21px;
    }

    .profile-story-filters {
        padding: 11px;
    }

    .profile-story-search {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .profile-hero::after {
        display: none;
    }

    .profile-author-name {
        font-size: 1.5rem;
    }

    .profile-follow-actions {
        width: 100%;
    }

    .profile-followers-pill,
    .profile-follow-button {
        flex: 1 1 auto;
    }

    .profile-stories-header {
        align-items: flex-end !important;
    }

    .profile-section-eyebrow {
        font-size: .68rem;
    }

    .profile-icon-button {
        width: 38px;
        height: 38px;
    }

    .profile-story-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .profile-story-card {
        padding: 7px;
        border-radius: 15px;
    }

    .profile-grid-cover {
        border-radius: 11px;
    }

    .profile-story-card .profile-story-title {
        font-size: .84rem;
    }

    .profile-story-meta {
        font-size: .7rem;
    }

    .profile-filter-pill {
        min-height: 34px;
        padding: 6px 11px;
        font-size: .79rem;
    }

    .profile-list-cover {
        width: 76px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .public-author-profile *,
    .public-author-profile *::before,
    .public-author-profile *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
