/* User profile — match site shell (cream/rose, 3:4 portrait, readable type). */

.user-profile-page .user-profile {
    display: grid;
    gap: 16px;
    padding: 4px 0 12px;
}

.user-profile-card {
    background: var(--shell-card);
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-radius);
    box-shadow: var(--shell-shadow);
    overflow: hidden;
}

.user-profile-hero {
    padding: 14px;
}

.user-profile-identity {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.user-profile-avatar-wrap,
.user-profile-avatar-wrap .avatar-frame-wrap {
    display: block;
    width: 100%;
    max-width: 100px;
}

.user-profile-avatar-wrap .avatar-frame-wrap {
    padding: 3px;
}

.user-profile-avatar-wrap .avatar-frame-ring {
    border-radius: 14px;
}

.user-profile-avatar {
    width: 100%;
    aspect-ratio: 3 / 4;
    height: auto;
    object-fit: cover;
    object-position: center top;
    border-radius: 12px;
    display: block;
    background: var(--shell-rose-100);
}

.user-profile-heading {
    min-width: 0;
}

.user-profile-name {
    margin: 0;
    color: var(--shell-ink);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
    word-break: break-word;
}

.user-profile-name.is-rose { color: #be123c; }
.user-profile-name.is-pink { color: #be185d; }
.user-profile-name.is-red { color: #b91c1c; }
.user-profile-name.is-amber { color: #b45309; }
.user-profile-name.is-yellow { color: #a16207; }
.user-profile-name.is-green { color: #15803d; }
.user-profile-name.is-emerald { color: #047857; }
.user-profile-name.is-teal { color: #0f766e; }
.user-profile-name.is-cyan { color: #0e7490; }
.user-profile-name.is-blue { color: #1d4ed8; }
.user-profile-name.is-indigo { color: #4338ca; }
.user-profile-name.is-violet { color: #6d28d9; }
.user-profile-name.is-purple { color: #7e22ce; }
.user-profile-name.is-gray,
.user-profile-name.is-slate { color: var(--shell-ink); }

.user-profile-online {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-left: 6px;
    vertical-align: middle;
    border-radius: 999px;
    background: #16a34a;
    box-shadow: 0 0 0 2px var(--shell-card);
}

.user-profile-cultivation {
    margin: 6px 0 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.user-profile-cultivation-meta {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 650;
    opacity: .88;
}

.user-profile-progress {
    margin-top: 14px;
}

.user-profile-progress-track {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--shell-rose-100);
}

.user-profile-progress-fill {
    height: 100%;
    border-radius: inherit;
    transition: width .6s ease;
}

.user-profile-progress-next {
    margin: 8px 0 0;
    color: var(--shell-muted);
    font-size: 13px;
    line-height: 1.45;
}

.user-profile-stats {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.user-profile-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: var(--shell-card-soft);
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-radius-sm);
}

.user-profile-stat-label,
.user-profile-stat-value {
    font-size: 14px;
    line-height: 1.3;
}

.user-profile-stat-label {
    color: var(--shell-muted);
    font-weight: 650;
}

.user-profile-stat-value {
    color: var(--shell-ink);
    font-weight: 750;
}

.user-profile-admin {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--shell-border);
}

.user-profile-admin-toggle,
.user-profile-admin-submit,
.user-profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
}

.user-profile-admin-toggle {
    background: var(--shell-accent-soft);
    color: var(--shell-rose-900);
    border-color: var(--shell-border);
}

.user-profile-admin-panel {
    margin-top: 10px;
}

.user-profile-admin-panel form {
    display: grid;
    gap: 8px;
}

.user-profile-admin-panel input,
.user-profile-admin-panel select {
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--shell-border);
    border-radius: 10px;
    background: var(--shell-lavender-100);
    color: var(--shell-ink);
    font-size: 14px;
}

.user-profile-admin-submit {
    background: var(--shell-gold);
    color: #3b2a14;
}

.user-profile-meta {
    padding: 4px 0;
}

.user-profile-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    color: var(--shell-ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    border-bottom: 1px solid var(--shell-border);
}

.user-profile-meta-row:last-child {
    border-bottom: 0;
}

.user-profile-meta-row svg {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    color: var(--shell-accent);
}

.user-profile-actions {
    display: grid;
    gap: 8px;
}

.user-profile-btn-primary {
    background: var(--shell-accent);
    color: #fff;
}

.user-profile-btn-primary:hover {
    background: var(--shell-accent-hover);
    color: #fff;
}

.user-profile-btn-ghost {
    background: var(--shell-card);
    color: var(--shell-ink);
    border-color: var(--shell-border);
}

.user-profile-btn-ghost:hover {
    background: var(--shell-card-soft);
    color: var(--shell-ink);
}

.user-profile-main {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.user-profile-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--shell-border);
}

.user-profile-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--shell-ink);
    font-size: 15px;
    font-weight: 750;
    letter-spacing: .02em;
}

.user-profile-section-title::before {
    content: "";
    width: 3px;
    height: 14px;
    border-radius: 99px;
    background: var(--shell-accent);
}

.user-profile-section-meta {
    color: var(--shell-muted);
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}

.user-profile-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--shell-accent);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.user-profile-edit:hover {
    color: var(--shell-accent-hover);
}

.user-profile-status {
    padding: 16px 18px;
    max-height: 320px;
    overflow-y: auto;
    color: var(--shell-ink);
    font-size: 16px;
    line-height: 1.7;
}

.user-profile-status p {
    margin: 0 0 .8em;
}

.user-profile-status p:last-child {
    margin-bottom: 0;
}

.user-profile-empty {
    margin: 0;
    color: var(--shell-muted);
    font-style: italic;
}

.user-profile-stories {
    padding: 6px 14px 4px;
}

.user-profile-stories .site-related-row {
    padding: 10px 0;
}

.user-profile-empty-block {
    padding: 36px 16px;
    color: var(--shell-muted);
    font-size: 15px;
    text-align: center;
}

.user-profile-pager {
    padding: 12px 14px 14px;
    border-top: 1px solid var(--shell-border);
}

.user-profile-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(42, 34, 36, .42);
    backdrop-filter: blur(4px);
}

.user-profile-modal-panel {
    position: relative;
    width: min(720px, 100%);
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 20px;
    background: var(--shell-card);
    border: 1px solid var(--shell-border);
    border-radius: 16px;
    box-shadow: var(--shell-shadow-hover);
}

.user-profile-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: var(--shell-ink);
    font-size: 18px;
    font-weight: 800;
}

.user-profile-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--shell-border);
}

.user-profile-modal-cancel {
    min-height: 42px;
    padding: 8px 14px;
    border: 0;
    background: none;
    color: var(--shell-muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.user-profile-modal-submit {
    min-height: 42px;
    padding: 8px 18px;
    border: 0;
    border-radius: 10px;
    background: var(--shell-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.user-profile-status::-webkit-scrollbar,
.user-profile-stories-scroll::-webkit-scrollbar {
    width: 5px;
}

.user-profile-status::-webkit-scrollbar-thumb,
.user-profile-stories-scroll::-webkit-scrollbar-thumb {
    background: var(--shell-rose-200);
    border-radius: 99px;
}

.user-profile-stories-scroll {
    max-height: 640px;
    overflow-y: auto;
}

@media (min-width: 1024px) {
    .user-profile {
        grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
        gap: 22px;
        align-items: start;
        padding-top: 8px;
    }

    .user-profile-identity {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .user-profile-avatar-wrap,
    .user-profile-avatar-wrap .avatar-frame-wrap {
        max-width: 220px;
        margin: 0 auto;
    }

    .user-profile-name {
        font-size: 22px;
    }

    .user-profile-progress-next {
        text-align: center;
    }
}

@media (max-width: 1023px) {
    .user-profile-page .container {
        padding-top: 10px;
        padding-bottom: 16px;
    }

    .user-profile-section-head {
        flex-wrap: wrap;
        padding: 12px 14px;
    }

    .user-profile-section-meta {
        white-space: normal;
    }

    .user-profile-status {
        font-size: 16px;
        padding: 14px;
    }
}

body.dark .user-profile-name.is-rose,
body.dark .user-profile-name.is-pink { color: #fda4af; }
body.dark .user-profile-name.is-red { color: #fca5a5; }
body.dark .user-profile-name.is-amber,
body.dark .user-profile-name.is-yellow { color: #fcd34d; }
body.dark .user-profile-name.is-green,
body.dark .user-profile-name.is-emerald { color: #6ee7b7; }
body.dark .user-profile-name.is-blue,
body.dark .user-profile-name.is-indigo { color: #a5b4fc; }
body.dark .user-profile-name.is-violet,
body.dark .user-profile-name.is-purple { color: #d8b4fe; }
body.dark .user-profile-name.is-gray,
body.dark .user-profile-name.is-slate { color: var(--shell-ink); }

body.dark .user-profile-admin-toggle {
    color: #f0c4cc;
}

body.dark .user-profile-admin-submit {
    color: #2a1c0c;
}

body.dark .user-profile-btn-primary {
    color: #1a1214;
}
