/* ══════════════════════════════════════════════════════════════════
   PROFILE PREMIUM — dedicated profile experience (loaded LAST)
   Light + dark are both first-class, driven by CSS variables.
   The user banner lives ONLY in the left visual panel and stays
   visible in both themes.
   ══════════════════════════════════════════════════════════════════ */

/* ── Theme tokens ────────────────────────────────────────────────── */
body.theme-anime.portal-page[data-page="profile"] {
    /* Light (default) */
    --pf-stage:        #e9e5f0;
    --pf-panel:        #f4f1f9;
    --pf-module:       #ffffff;
    --pf-module-soft:  #faf8fd;
    --pf-border:       rgba(24,14,38,0.10);
    --pf-border-soft:  rgba(24,14,38,0.06);
    --pf-text:         #322a40;
    --pf-heading:      #1c1526;
    --pf-muted:        #857e94;
    --pf-accent:       #e11d48;
    --pf-accent-2:     #a30f37;
    --pf-accent-soft:  rgba(225,29,72,0.10);
    --pf-shadow:       0 10px 30px rgba(24,14,38,0.10);
    --pf-shadow-lg:    0 20px 50px rgba(24,14,38,0.16);

    /* Left visual stage */
    --pf-left-fallback: linear-gradient(150deg, #2a1230, #1a1030 52%, #241640);
    --pf-overlay:
        radial-gradient(125% 90% at 50% 40%, transparent 42%, rgba(0,0,0,0.34) 100%),
        linear-gradient(180deg, rgba(0,0,0,0.22) 0%, rgba(0,0,0,0.02) 34%, rgba(0,0,0,0.06) 60%, rgba(0,0,0,0.40) 100%);

    /* Identity card (frosted light artifact over the photo) */
    --pf-card-bg:      linear-gradient(158deg, rgba(255,255,255,0.90) 0%, rgba(248,244,253,0.94) 100%);
    --pf-card-border:  rgba(255,255,255,0.85);
    --pf-card-ring:    rgba(24,14,38,0.10);
    --pf-card-text:    #241d30;
    --pf-card-heading: #17101f;
    --pf-card-muted:   rgba(40,30,55,0.60);
    --pf-card-line:    rgba(24,14,38,0.12);
    --pf-card-plaque:  rgba(24,14,38,0.05);
    --pf-eyebrow:      #b31441;

    /* Lower card-banner + relic shelf */
    --pf-banner-fallback: linear-gradient(120deg, #f2d7e6 0%, #e6d8f6 46%, #d6e6f8 100%);
    --pf-shelf-shadow:    rgba(24,14,38,0.30);
    --pf-relic-slot:      rgba(24,14,38,0.06);
    --pf-relic-slot-line: rgba(24,14,38,0.22);

    /* Tabs */
    --pf-tabbar:       rgba(255,255,255,0.86);
    --pf-tab-idle:     #7c7589;
    --pf-tab-badge:    rgba(24,14,38,0.10);
    --pf-tab-badge-tx: #4a4358;
}

/* Dark overrides */
[data-theme="dark"] body.theme-anime.portal-page[data-page="profile"] {
    --pf-stage:        #0c0910;
    --pf-panel:        #13101b;
    --pf-module:       linear-gradient(160deg, #1c1628 0%, #16111f 100%);
    --pf-module-soft:  #191322;
    --pf-border:       rgba(255,255,255,0.08);
    --pf-border-soft:  rgba(255,255,255,0.05);
    --pf-text:         rgba(255,255,255,0.82);
    --pf-heading:      #f2ecf7;
    --pf-muted:        rgba(255,255,255,0.48);
    --pf-accent:       #ff3b64;
    --pf-accent-2:     #b01840;
    --pf-accent-soft:  rgba(255,59,100,0.14);
    --pf-shadow:       0 12px 34px rgba(0,0,0,0.45);
    --pf-shadow-lg:    0 26px 64px rgba(0,0,0,0.6);

    --pf-left-fallback: linear-gradient(150deg, #1a0a14, #2e1232 46%, #160e36);
    --pf-overlay:
        radial-gradient(125% 90% at 50% 40%, transparent 38%, rgba(0,0,0,0.58) 100%),
        linear-gradient(180deg, rgba(0,0,0,0.44) 0%, rgba(0,0,0,0.08) 34%, rgba(0,0,0,0.18) 60%, rgba(0,0,0,0.66) 100%);

    --pf-card-bg:      linear-gradient(158deg, rgba(40,27,55,0.95) 0%, rgba(22,15,34,0.97) 100%);
    --pf-card-border:  rgba(255,255,255,0.15);
    --pf-card-ring:    rgba(0,0,0,0.5);
    --pf-card-text:    rgba(255,255,255,0.90);
    --pf-card-heading: #ffffff;
    --pf-card-muted:   rgba(255,255,255,0.58);
    --pf-card-line:    rgba(255,255,255,0.14);
    --pf-card-plaque:  rgba(0,0,0,0.28);
    --pf-eyebrow:      #ff9db8;

    --pf-banner-fallback: linear-gradient(120deg, #3a1636 0%, #221145 50%, #16123a 100%);
    --pf-shelf-shadow:    rgba(0,0,0,0.62);
    --pf-relic-slot:      rgba(255,255,255,0.06);
    --pf-relic-slot-line: rgba(255,255,255,0.24);

    --pf-tabbar:       rgba(18,14,26,0.90);
    --pf-tab-idle:     rgba(255,255,255,0.52);
    --pf-tab-badge:    rgba(255,255,255,0.16);
    --pf-tab-badge-tx: rgba(255,255,255,0.85);
}

/* ── Structural breakout (must win against legacy ID/theme rules) ── */
body[data-page="profile"].theme-anime.portal-page {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    background: var(--pf-stage) !important;
    background-image: none !important;
}
body.theme-anime.portal-page[data-page="profile"] .portal-shell,
body.theme-anime.portal-page[data-page="profile"] .portal-shell.padder {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}
body[data-page="profile"].theme-anime.portal-page #container {
    width: 100% !important;
    max-width: none !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    box-shadow: none !important;
    background: transparent !important;
}
body[data-page="profile"].theme-anime.portal-page .portal-main {
    display: block !important;
    width: 100% !important;
    overflow: visible !important;
}
body[data-page="profile"].theme-anime.portal-page #content {
    float: none !important;
    width: 100% !important;
    border: none !important;
    overflow: visible !important;
    background: transparent !important;
}
body[data-page="profile"].theme-anime.portal-page #content > .padder {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    background: transparent !important;
}
body.theme-anime.portal-page[data-page="profile"] #sidebar { display: none !important; }
body.theme-anime.portal-page[data-page="profile"] .portal-footer-classic { display: none !important; }

/* ── Stage: full-viewport two-panel grid ─────────────────────────── */
body.theme-anime.portal-page[data-page="profile"] .pv2-stage {
    display: grid;
    grid-template-columns: minmax(340px, 43vw) minmax(440px, 1fr);
    width: 100vw;
    max-width: none;
    position: relative;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    min-height: calc(100vh - 168px);
    box-sizing: border-box;
    background: var(--pf-stage);
    isolation: isolate;
}

/* ════════════════ LEFT — cinematic visual stage ════════════════ */
body.theme-anime.portal-page[data-page="profile"] .pv2-panel-left {
    position: sticky;
    top: 0;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6vh 40px;
    background: var(--pf-left-fallback);
    z-index: 1;
}
/* Banner image — carried by inline style="background-image:…". NEVER
   override background-image here or the banner disappears. */
body.theme-anime.portal-page[data-page="profile"] .pv2-panel-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.08);
    transition: transform 9s ease;
    will-change: transform;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-panel-left:hover .pv2-panel-bg { transform: scale(1.13); }

body.theme-anime.portal-page[data-page="profile"] .pv2-panel-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: var(--pf-overlay);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-panel-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.045;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ════════════════ IDENTITY CARD — themed artifact ═══════════════ */
body.theme-anime.portal-page[data-page="profile"] .pv2-card-scene {
    position: relative;
    z-index: 2;
    perspective: 1400px;
    perspective-origin: 50% 38%;
    width: 100%;
    max-width: 452px;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card {
    position: relative;
    background: var(--pf-card-bg);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid var(--pf-card-border);
    border-radius: 20px;
    padding: 30px 26px 22px;
    transform-style: preserve-3d;
    transition: transform 0.3s cubic-bezier(0.23,1,0.32,1), box-shadow 0.3s ease;
    box-shadow: var(--pf-shadow-lg), 0 0 0 1px var(--pf-card-ring), 0 2px 0 rgba(255,255,255,0.25) inset;
    color: var(--pf-card-text);
    will-change: transform;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card::before {
    content: '';
    position: absolute;
    inset: 7px;
    border: 1px solid var(--pf-card-line);
    border-radius: 14px;
    pointer-events: none;
    z-index: 1;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--pf-accent), transparent);
    opacity: 0.65;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-glare {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    pointer-events: none;
    z-index: 10;
    mix-blend-mode: screen;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-inner {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 9px;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-eyebrow {
    font-size: 9px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--pf-eyebrow);
    font-weight: 700;
    margin-bottom: 2px;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-avatar-wrap { position: relative; margin-bottom: 2px; }
body.theme-anime.portal-page[data-page="profile"] .pv2-card-avatar {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    border: 3px solid var(--pf-card-border);
    object-fit: cover;
    box-shadow: 0 8px 26px rgba(0,0,0,0.30), 0 0 0 6px var(--pf-card-plaque);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card:hover .pv2-card-avatar {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 14px 38px rgba(0,0,0,0.38), 0 0 0 6px var(--pf-accent-soft);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-online-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 15px;
    height: 15px;
    background: #22c55e;
    border: 3px solid var(--pf-module-soft);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(34,197,94,0.8);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-name {
    font-size: 23px;
    font-weight: 800;
    color: var(--pf-card-heading);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-name a { color: inherit; text-decoration: none; }
body.theme-anime.portal-page[data-page="profile"] .pv2-card-name a:hover { color: var(--pf-accent); }
body.theme-anime.portal-page[data-page="profile"] .pv2-card-handle {
    font-size: 13px;
    color: var(--pf-card-muted);
    margin-top: -5px;
    letter-spacing: 0.04em;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: var(--pf-card-muted);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pf-card-muted);
    flex-shrink: 0;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-status-dot.is-online {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34,197,94,0.9);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--pf-card-line), transparent);
    margin: 3px 0;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-bio {
    font-size: 13px;
    line-height: 1.6;
    color: var(--pf-card-text);
    opacity: 0.9;
    margin: 0;
    width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    color: var(--pf-card-muted);
    align-items: center;
    width: 100%;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-meta a { color: var(--pf-accent); text-decoration: none; }
body.theme-anime.portal-page[data-page="profile"] .pv2-card-meta a:hover { text-decoration: underline; }

body.theme-anime.portal-page[data-page="profile"] .pv2-card-stats {
    display: flex;
    width: 100%;
    border: 1px solid var(--pf-card-line);
    border-radius: 12px;
    overflow: hidden;
    margin: 5px 0;
    background: var(--pf-card-plaque);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-stat {
    flex: 1;
    padding: 11px 6px;
    text-align: center;
    border-right: 1px solid var(--pf-card-line);
    text-decoration: none;
    transition: background 0.15s;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-stat:last-child { border-right: none; }
body.theme-anime.portal-page[data-page="profile"] .pv2-card-stat:hover { background: var(--pf-accent-soft); }
body.theme-anime.portal-page[data-page="profile"] .pv2-card-stat strong {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--pf-card-heading);
    line-height: 1.1;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-stat span {
    font-size: 9px;
    color: var(--pf-card-muted);
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

body.theme-anime.portal-page[data-page="profile"] .pv2-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-action-row { display: flex; gap: 8px; }
body.theme-anime.portal-page[data-page="profile"] .pv2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 16px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    width: 100%;
    text-decoration: none;
    transition: transform 0.12s, box-shadow 0.14s, background 0.14s;
    white-space: nowrap;
    line-height: 1;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-btn:hover { transform: translateY(-1px); }
body.theme-anime.portal-page[data-page="profile"] .pv2-btn-primary {
    background: linear-gradient(135deg, var(--pf-accent), var(--pf-accent-2));
    color: #fff;
    box-shadow: 0 6px 20px var(--pf-accent-soft);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-btn-primary:hover { box-shadow: 0 8px 26px var(--pf-accent-soft); }
body.theme-anime.portal-page[data-page="profile"] .pv2-btn-secondary {
    background: var(--pf-card-plaque);
    color: var(--pf-card-text);
    border: 1px solid var(--pf-card-line);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-btn-ghost {
    background: transparent;
    color: var(--pf-card-muted);
    border: 1px solid var(--pf-card-line);
    font-weight: 500;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-btn-ghost:hover { color: var(--pf-card-heading); border-color: var(--pf-accent); }
body.theme-anime.portal-page[data-page="profile"] .pv2-card-id-line {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 9.5px;
    color: var(--pf-card-muted);
    padding-top: 6px;
    margin-top: 3px;
    border-top: 1px solid var(--pf-card-line);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: ui-monospace, monospace;
}

/* ════════════════ RIGHT — content panel + modules ══════════════ */
body.theme-anime.portal-page[data-page="profile"] .pv2-panel-right {
    display: flex;
    flex-direction: column;
    background: var(--pf-panel);
    min-width: 0;
    min-height: calc(100vh - 168px);
    border-left: 1px solid var(--pf-border-soft);
}

/* Tabs — premium segmented bar */
body.theme-anime.portal-page[data-page="profile"] .pv2-tabs {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding: 14px 26px 0;
    scrollbar-width: none;
    background: var(--pf-tabbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--pf-border);
    position: sticky;
    top: 0;
    z-index: 5;
    flex-shrink: 0;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-tabs::-webkit-scrollbar { display: none; }
body.theme-anime.portal-page[data-page="profile"] .pv2-tab {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 16px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--pf-tab-idle);
    text-decoration: none;
    white-space: nowrap;
    border-radius: 10px;
    transition: color 0.15s, background 0.15s;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-tab:hover { color: var(--pf-heading); background: var(--pf-accent-soft); }
body.theme-anime.portal-page[data-page="profile"] .pv2-tab.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--pf-accent), var(--pf-accent-2));
    box-shadow: 0 4px 14px var(--pf-accent-soft);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--pf-tab-badge);
    color: var(--pf-tab-badge-tx);
    font-size: 10px;
    font-weight: 700;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-tab.is-active .pv2-tab-badge { background: rgba(255,255,255,0.28); color: #fff; }

/* Tab body */
body.theme-anime.portal-page[data-page="profile"] .pv2-tab-body {
    padding: 26px 32px 56px;
    flex: 1;
    max-width: 1120px;
    width: 100%;
    box-sizing: border-box;
    color: var(--pf-text);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-tab-body h1,
body.theme-anime.portal-page[data-page="profile"] .pv2-tab-body h2,
body.theme-anime.portal-page[data-page="profile"] .pv2-tab-body h3,
body.theme-anime.portal-page[data-page="profile"] .pv2-tab-body .section-title { color: var(--pf-heading); }
body.theme-anime.portal-page[data-page="profile"] .pv2-tab-body a { color: var(--pf-accent); }

/* ── Overview modules ─────────────────────────────────────────── */
body.theme-anime.portal-page[data-page="profile"] .pf-overview {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
body.theme-anime.portal-page[data-page="profile"] .pf-module {
    background: var(--pf-module);
    border: 1px solid var(--pf-border);
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: var(--pf-shadow);
}
body.theme-anime.portal-page[data-page="profile"] .pf-module-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
body.theme-anime.portal-page[data-page="profile"] .pf-module-head h2 {
    font-size: 15px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--pf-heading);
}
body.theme-anime.portal-page[data-page="profile"] .pf-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--pf-accent-soft);
    color: var(--pf-accent);
    font-size: 11px;
    font-weight: 700;
}
body.theme-anime.portal-page[data-page="profile"] .pf-see-all {
    font-size: 12px;
    font-weight: 600;
    color: var(--pf-accent);
    text-decoration: none;
}
body.theme-anime.portal-page[data-page="profile"] .pf-see-all:hover { text-decoration: underline; }

/* Bio module */
body.theme-anime.portal-page[data-page="profile"] .pf-bio-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--pf-text);
    white-space: pre-wrap;
    word-break: break-word;
}
body.theme-anime.portal-page[data-page="profile"] .pf-bio-empty { color: var(--pf-muted); font-style: italic; }
body.theme-anime.portal-page[data-page="profile"] .pf-bio-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
body.theme-anime.portal-page[data-page="profile"] .pf-fact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 9px;
    background: var(--pf-module-soft);
    border: 1px solid var(--pf-border-soft);
    font-size: 12px;
    color: var(--pf-muted);
}
body.theme-anime.portal-page[data-page="profile"] .pf-fact strong { color: var(--pf-heading); font-weight: 700; }
body.theme-anime.portal-page[data-page="profile"] .pf-fact a { color: var(--pf-accent); text-decoration: none; }
body.theme-anime.portal-page[data-page="profile"] .pf-fact a:hover { text-decoration: underline; }

/* Friends preview grid */
body.theme-anime.portal-page[data-page="profile"] .pf-friend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 12px;
}
body.theme-anime.portal-page[data-page="profile"] .pf-friend {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 12px 8px;
    border-radius: 13px;
    background: var(--pf-module-soft);
    border: 1px solid var(--pf-border-soft);
    text-decoration: none;
    transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}
body.theme-anime.portal-page[data-page="profile"] .pf-friend:hover {
    transform: translateY(-3px);
    border-color: var(--pf-accent);
    box-shadow: var(--pf-shadow);
}
body.theme-anime.portal-page[data-page="profile"] .pf-friend img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--pf-border);
}
body.theme-anime.portal-page[data-page="profile"] .pf-friend-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--pf-heading);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Groups preview */
body.theme-anime.portal-page[data-page="profile"] .pf-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}
body.theme-anime.portal-page[data-page="profile"] .pf-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 13px;
    background: var(--pf-module-soft);
    border: 1px solid var(--pf-border-soft);
    text-decoration: none;
    transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}
body.theme-anime.portal-page[data-page="profile"] .pf-group:hover {
    transform: translateY(-2px);
    border-color: var(--pf-accent);
    box-shadow: var(--pf-shadow);
}
body.theme-anime.portal-page[data-page="profile"] .pf-group-thumb {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    background-size: cover;
    background-position: center;
    background-color: var(--pf-accent-soft);
    flex-shrink: 0;
}
body.theme-anime.portal-page[data-page="profile"] .pf-group-info { min-width: 0; }
body.theme-anime.portal-page[data-page="profile"] .pf-group-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--pf-heading);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.theme-anime.portal-page[data-page="profile"] .pf-group-meta {
    font-size: 11px;
    color: var(--pf-muted);
    margin-top: 2px;
}
body.theme-anime.portal-page[data-page="profile"] .pf-module-empty {
    color: var(--pf-muted);
    font-size: 13px;
    padding: 6px 0;
}

/* Composer + feed inside modules */
body.theme-anime.portal-page[data-page="profile"] .profile-compose-bar {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    background: var(--pf-module-soft);
    border: 1px solid var(--pf-border-soft);
    border-radius: 13px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
body.theme-anime.portal-page[data-page="profile"] .profile-compose-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--pf-border);
}
body.theme-anime.portal-page[data-page="profile"] .profile-compose-input { flex: 1; min-width: 0; }
body.theme-anime.portal-page[data-page="profile"] #profileComposeEditor {
    min-height: 54px;
    padding: 8px 10px;
    border-radius: 9px;
    background: var(--pf-module);
    border: 1px solid var(--pf-border);
    color: var(--pf-text);
    outline: none;
}
body.theme-anime.portal-page[data-page="profile"] #profileComposeEditor:empty::before {
    content: attr(placeholder);
    color: var(--pf-muted);
}
body.theme-anime.portal-page[data-page="profile"] .profile-compose-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}
body.theme-anime.portal-page[data-page="profile"] .social-char-counter { font-size: 12px; color: var(--pf-muted); }

body.theme-anime.portal-page[data-page="profile"] .social-feed { display: flex; flex-direction: column; gap: 12px; }
body.theme-anime.portal-page[data-page="profile"] .social-post-card {
    background: var(--pf-module);
    border: 1px solid var(--pf-border);
    border-radius: 13px;
    padding: 15px 17px;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
    color: var(--pf-text);
}
body.theme-anime.portal-page[data-page="profile"] .social-post-card:hover {
    border-color: var(--pf-accent);
    box-shadow: var(--pf-shadow);
    transform: translateY(-2px);
}
body.theme-anime.portal-page[data-page="profile"] .social-post-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}
body.theme-anime.portal-page[data-page="profile"] .social-post-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
body.theme-anime.portal-page[data-page="profile"] .social-post-author-name { font-weight: 700; color: var(--pf-heading); }
body.theme-anime.portal-page[data-page="profile"] .social-post-author-handle,
body.theme-anime.portal-page[data-page="profile"] .social-post-time { color: var(--pf-muted); font-size: 12px; }
body.theme-anime.portal-page[data-page="profile"] .social-post-time { text-decoration: none; }
body.theme-anime.portal-page[data-page="profile"] .social-post-body { color: var(--pf-text); line-height: 1.55; }
body.theme-anime.portal-page[data-page="profile"] .social-post-body-link { text-decoration: none; color: inherit; display: block; }
body.theme-anime.portal-page[data-page="profile"] .social-post-actions {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--pf-border-soft);
}
body.theme-anime.portal-page[data-page="profile"] .social-action-btn {
    background: none;
    border: none;
    color: var(--pf-muted);
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
}
body.theme-anime.portal-page[data-page="profile"] .social-action-btn:hover { color: var(--pf-accent); }
body.theme-anime.portal-page[data-page="profile"] .social-empty,
body.theme-anime.portal-page[data-page="profile"] .portal-empty-state {
    color: var(--pf-muted);
    text-align: center;
    padding: 34px 20px;
    background: var(--pf-module-soft);
    border: 1px dashed var(--pf-border);
    border-radius: 12px;
}

/* Buttons reused from legacy inside the panel */
body.theme-anime.portal-page[data-page="profile"] .green-btn {
    background: linear-gradient(135deg, var(--pf-accent), var(--pf-accent-2));
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.14s;
}
body.theme-anime.portal-page[data-page="profile"] .green-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px var(--pf-accent-soft); }
body.theme-anime.portal-page[data-page="profile"] .green-btn.tiny { padding: 6px 14px; font-size: 12px; }

/* Legacy tab shells: neutralize old boxed styling, keep spacing */
body.theme-anime.portal-page[data-page="profile"] .profile-tab-shell,
body.theme-anime.portal-page[data-page="profile"] .profile-activity-shell,
body.theme-anime.portal-page[data-page="profile"] .profile-discussion-shell {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}
body.theme-anime.portal-page[data-page="profile"] .pagination {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}
body.theme-anime.portal-page[data-page="profile"] .pag-count { font-size: 12px; color: var(--pf-muted); }

/* Members / groups / tables in dedicated tabs */
body.theme-anime.portal-page[data-page="profile"] .member-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
body.theme-anime.portal-page[data-page="profile"] .member-card,
body.theme-anime.portal-page[data-page="profile"] .group-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--pf-module);
    border: 1px solid var(--pf-border);
    border-radius: 13px;
    padding: 13px;
    transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}
body.theme-anime.portal-page[data-page="profile"] .member-card:hover,
body.theme-anime.portal-page[data-page="profile"] .group-card:hover {
    transform: translateY(-2px);
    border-color: var(--pf-accent);
    box-shadow: var(--pf-shadow);
}
body.theme-anime.portal-page[data-page="profile"] .member-card h3 { margin: 0; font-size: 14px; }
body.theme-anime.portal-page[data-page="profile"] .member-card h3 a { color: var(--pf-heading); text-decoration: none; }
body.theme-anime.portal-page[data-page="profile"] .member-avatar img,
body.theme-anime.portal-page[data-page="profile"] .member-card img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
body.theme-anime.portal-page[data-page="profile"] .member-quote,
body.theme-anime.portal-page[data-page="profile"] .member-active,
body.theme-anime.portal-page[data-page="profile"] .table-subline,
body.theme-anime.portal-page[data-page="profile"] .group-meta { color: var(--pf-muted); font-size: 12px; }
body.theme-anime.portal-page[data-page="profile"] .member-preview-link {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--pf-accent);
    text-decoration: none;
}
body.theme-anime.portal-page[data-page="profile"] .group-list { display: flex; flex-direction: column; gap: 12px; }
body.theme-anime.portal-page[data-page="profile"] .group-thumb {
    width: 52px;
    height: 52px;
    border-radius: 11px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
body.theme-anime.portal-page[data-page="profile"] .topic-link { color: var(--pf-heading); font-weight: 600; text-decoration: none; }
body.theme-anime.portal-page[data-page="profile"] .topic-link:hover { color: var(--pf-accent); }

body.theme-anime.portal-page[data-page="profile"] .portal-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--pf-module);
    border: 1px solid var(--pf-border);
    border-radius: 13px;
    overflow: hidden;
}
body.theme-anime.portal-page[data-page="profile"] .portal-table th,
body.theme-anime.portal-page[data-page="profile"] .portal-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--pf-border-soft);
    font-size: 13px;
}
body.theme-anime.portal-page[data-page="profile"] .portal-table th { color: var(--pf-muted); font-weight: 700; background: var(--pf-module-soft); }
body.theme-anime.portal-page[data-page="profile"] .portal-table td { color: var(--pf-text); }

/* Activity list */
body.theme-anime.portal-page[data-page="profile"] .activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
body.theme-anime.portal-page[data-page="profile"] .activity-list > li {
    display: flex;
    gap: 12px;
    background: var(--pf-module);
    border: 1px solid var(--pf-border);
    border-radius: 13px;
    padding: 13px 15px;
}
body.theme-anime.portal-page[data-page="profile"] .activity-list img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
body.theme-anime.portal-page[data-page="profile"] .activity-content p { margin: 0; color: var(--pf-text); font-size: 13px; line-height: 1.5; }
body.theme-anime.portal-page[data-page="profile"] .activity-content a { color: var(--pf-heading); font-weight: 600; text-decoration: none; }
body.theme-anime.portal-page[data-page="profile"] .time-since, body.theme-anime.portal-page[data-page="profile"] .activity-time-since { color: var(--pf-muted); }

/* Profile wall / comments */
body.theme-anime.portal-page[data-page="profile"] .profile-discussion-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
body.theme-anime.portal-page[data-page="profile"] .profile-discussion-head h2 { margin: 0; }
body.theme-anime.portal-page[data-page="profile"] .profile-discussion-head p { margin: 2px 0 0; color: var(--pf-muted); font-size: 12px; }
body.theme-anime.portal-page[data-page="profile"] .profile-comment-count { font-size: 12px; color: var(--pf-muted); }
body.theme-anime.portal-page[data-page="profile"] .profile-comment-form.composer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--pf-module);
    border: 1px solid var(--pf-border);
    border-radius: 13px;
    padding: 15px 16px;
    margin-bottom: 16px;
}
body.theme-anime.portal-page[data-page="profile"] .panel-label { font-size: 12px; color: var(--pf-muted); font-weight: 600; }
body.theme-anime.portal-page[data-page="profile"] .text-input,
body.theme-anime.portal-page[data-page="profile"] .textarea-input {
    background: var(--pf-module-soft);
    border: 1px solid var(--pf-border);
    border-radius: 9px;
    padding: 10px 12px;
    color: var(--pf-text);
    font-size: 13px;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}
body.theme-anime.portal-page[data-page="profile"] .text-input:focus,
body.theme-anime.portal-page[data-page="profile"] .textarea-input:focus { border-color: var(--pf-accent); }

/* In-panel footer replacing the removed legacy strip */
body.theme-anime.portal-page[data-page="profile"] .pv2-panel-footer {
    margin-top: auto;
    padding: 22px 32px 30px;
    font-size: 11px;
    color: var(--pf-muted);
    border-top: 1px solid var(--pf-border-soft);
    letter-spacing: 0.02em;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-panel-footer a { color: var(--pf-muted); text-decoration: none; }
body.theme-anime.portal-page[data-page="profile"] .pv2-panel-footer a:hover { color: var(--pf-accent); }

body.theme-anime.portal-page[data-page="profile"] .pv2-not-found {
    padding: 80px 32px;
    text-align: center;
    color: var(--pf-muted);
    font-size: 15px;
}

/* ════════════════ LOWER CARD-BANNER (certificate strip) ═══════ */
body.theme-anime.portal-page[data-page="profile"] .pv2-card-banner {
    position: relative;
    z-index: 3;
    margin-top: 18px;
    height: 104px;
    border-radius: 14px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--pf-card-plaque);
    isolation: isolate;
    box-shadow:
        0 14px 26px -10px var(--pf-shelf-shadow),
        inset 0 0 0 1px var(--pf-card-line),
        inset 0 1px 0 rgba(255,255,255,0.30);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-banner.is-empty {
    background-image: var(--pf-banner-fallback);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.10) 44%, rgba(0,0,0,0.64) 100%);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-banner-sheen {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 52%;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.34), rgba(255,255,255,0));
    mix-blend-mode: screen;
}
/* Certificate frame — inset gold/line border for the "object" feel */
body.theme-anime.portal-page[data-page="profile"] .pv2-card-banner-frame {
    position: absolute;
    inset: 6px;
    z-index: 3;
    border-radius: 9px;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.30);
    box-shadow:
        inset 0 0 0 1px rgba(0,0,0,0.28),
        inset 0 0 18px rgba(0,0,0,0.30);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-banner-caption {
    position: absolute;
    left: 16px; right: 16px; bottom: 11px;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-align: left;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-banner-tag {
    font-size: 8px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(255,255,255,0.82);
    text-shadow: 0 1px 3px rgba(0,0,0,0.65);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-card-banner-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 5px rgba(0,0,0,0.72);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ════════════════ RELIC SHELF / SHOWCASE ═════════════════════ */
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 528px;
    margin: clamp(46px, 12vh, 128px) auto 0;
    padding: 0 2px;
}
/* Ambient pool of light so the shelf reads as installed into the stage. */
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-wrap::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6%;
    width: 96%;
    height: 60%;
    transform: translateX(-50%);
    z-index: -1;
    background: radial-gradient(ellipse at 50% 60%, rgba(255,244,220,0.12), transparent 70%);
    pointer-events: none;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 6px 9px;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-title {
    font-size: 10px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(255,255,255,0.90);
    text-shadow: 0 1px 5px rgba(0,0,0,0.6);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-title::before {
    content: '✦ ';
    color: var(--pf-accent);
    opacity: 0.9;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-edit {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    color: #fff;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.30);
    border-radius: 20px;
    padding: 3px 13px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-edit:hover,
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-edit.is-active {
    background: var(--pf-accent);
    border-color: transparent;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf {
    position: relative;
    width: 100%;
    aspect-ratio: 2130 / 470;
    background: url("../../images/website assets/relic-shelf.png") center / 100% 100% no-repeat;
    filter: drop-shadow(0 20px 26px var(--pf-shelf-shadow));
}
/* Row of relics resting inside the cubby, on the lower ledge. */
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-relics {
    position: absolute;
    left: 8.5%;
    right: 8.5%;
    top: 15%;
    bottom: 19%;
    display: flex;
    align-items: flex-end;
    justify-content: space-evenly;
    gap: 1.5%;
    min-height: 0;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic {
    position: relative;
    flex: 0 1 auto;
    width: 15%;
    max-width: 64px;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    background: none;
    border: none;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.4));
    transition: transform 0.25s cubic-bezier(0.23,1,0.32,1), filter 0.25s;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic.is-filled::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 82%;
    height: 7px;
    z-index: -1;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.38), transparent 72%);
    pointer-events: none;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic.is-filled:hover .pv2-relic-img {
    transform: translateY(-5px) scale(1.07);
    filter: drop-shadow(0 10px 8px rgba(0,0,0,0.42));
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-name {
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 3px 9px;
    border-radius: 7px;
    background: var(--pf-card-heading);
    color: var(--pf-module-soft);
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.02em;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s, transform 0.18s;
    box-shadow: var(--pf-shadow);
    z-index: 6;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic.is-filled:hover .pv2-relic-name {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
/* Empty add slot (owner) — hidden until the shelf is in edit mode, and sized
   to the ledge so it never spills outside the cubby. */
body.theme-anime.portal-page[data-page="profile"] .pv2-relic.is-empty {
    display: none;
    width: 15%;
    max-width: 58px;
    min-width: 0;
    height: 74%;
    align-items: center;
    justify-content: center;
    border: 1.5px dashed var(--pf-relic-slot-line);
    border-radius: 9px;
    background: var(--pf-relic-slot);
    color: rgba(255,255,255,0.72);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-wrap.is-editing .pv2-relic.is-empty {
    display: flex;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic.is-empty:hover {
    border-color: var(--pf-accent);
    color: #fff;
    background: var(--pf-accent-soft);
    transform: translateY(-2px);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-plus {
    font-size: 19px;
    line-height: 1;
    opacity: 0.85;
}
/* Delete control (owner) */
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-del {
    position: absolute;
    top: -9px;
    right: -7px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    background: var(--pf-accent);
    color: #fff;
    font-size: 9px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.15s, transform 0.15s;
    z-index: 7;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic.is-filled:hover .pv2-relic-del,
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-wrap.is-editing .pv2-relic-del {
    opacity: 1;
    transform: scale(1);
}
/* Hint only while editing; empty-state only for an idle empty shelf. */
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-hint,
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-empty {
    display: none;
    margin: 11px 4px 0;
    text-align: center;
    font-size: 10.5px;
    line-height: 1.5;
    color: rgba(255,255,255,0.70);
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-empty strong { color: #fff; }
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-wrap.is-editing .pv2-shelf-hint {
    display: block;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-wrap.is-owner.is-vacant .pv2-shelf-empty {
    display: block;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-wrap.is-editing .pv2-shelf-empty {
    display: none;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-wrap.is-busy {
    opacity: 0.6;
    pointer-events: none;
}

/* ── Relic links (portals) + owner edit affordance ─────────────── */
body.theme-anime.portal-page[data-page="profile"] a.pv2-relic {
    text-decoration: none;
    color: inherit;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic.has-link { cursor: pointer; }
/* A faint spark marks relics that carry a link. */
body.theme-anime.portal-page[data-page="profile"] .pv2-relic.has-link::before {
    content: '';
    position: absolute;
    top: 1px;
    right: 5%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--pf-accent);
    box-shadow: 0 0 6px var(--pf-accent);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 5;
    pointer-events: none;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic.has-link:hover::before { opacity: 0.95; }
body.theme-anime.portal-page[data-page="profile"] .pv2-relic.has-link:hover .pv2-relic-img {
    filter: drop-shadow(0 10px 9px rgba(0,0,0,0.42)) drop-shadow(0 0 9px var(--pf-accent-soft));
}
/* Edit pip (owner) — twin of the delete control, shown while editing. */
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-edit {
    position: absolute;
    top: -9px;
    right: -7px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    background: var(--pf-accent);
    color: #fff;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.15s, transform 0.15s;
    z-index: 7;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-wrap.is-editing .pv2-relic-edit {
    opacity: 1;
    transform: scale(1);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-wrap.is-editing .pv2-relic.is-filled { cursor: pointer; }

/* ── Relic editor overlay (owner) ──────────────────────────────── */
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8,6,14,0.58);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor[hidden] { display: none; }
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor.is-busy { opacity: 0.65; pointer-events: none; }
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor-card {
    width: min(340px, 92%);
    background: var(--pf-panel);
    border: 1px solid var(--pf-card-line);
    border-radius: 16px;
    padding: 18px 18px 16px;
    box-shadow: 0 30px 70px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor-preview {
    width: 72px;
    height: 72px;
    margin: 0 auto 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pf-relic-slot, rgba(255,255,255,0.06));
    border-radius: 12px;
    overflow: hidden;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor-label {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--pf-muted);
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor-hint {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    opacity: 0.7;
    margin-left: 4px;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    border-radius: 9px;
    border: 1px solid var(--pf-border);
    background: var(--pf-input-bg, rgba(0,0,0,0.16));
    color: var(--pf-text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor input[type="text"]:focus { border-color: var(--pf-accent); }
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 6px;
    flex-wrap: wrap;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor-spacer { flex: 1 1 auto; }
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor button {
    font-size: 12px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--pf-border);
    background: var(--pf-accent-soft);
    color: var(--pf-heading);
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor button:hover { transform: translateY(-1px); }
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor-save {
    background: linear-gradient(135deg, var(--pf-accent), var(--pf-accent-2)) !important;
    color: #fff !important;
    border-color: transparent !important;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor-remove {
    background: transparent !important;
    color: #e2585f !important;
    border-color: rgba(226,88,95,0.5) !important;
}
body.theme-anime.portal-page[data-page="profile"] .pv2-relic-editor-replace { background: transparent !important; }

/* ---- TICKER (profile shell) ------------------------------------
   The profile page has its own premium identity layout and no longer
   needs the legacy portal ticker rail. Hiding it keeps the stage clean
   and removes the half-dark / half-light band that used to sit under
   the nav. The global theme + music controls now live in the SYSTEM
   header capsule (remilia-theme.css), not on this bar. */
body[data-page="profile"] .rem-ticker-bar { display: none !important; }

/* The theme + music controls are relocated into the global SYSTEM header
   capsule (see remilia-theme.css / dark-mode.css). No profile-specific
   floating/utility styling is needed here anymore. */

/* ════════════════ DESKTOP — FIXED-VIEWPORT LOCK ══════════════════
   On desktop the profile becomes a single non-scrolling viewport: the
   shell fills 100dvh, the left stage is visually fixed, and only the
   right content panel scrolls. The card + relic shelf are absolutely
   placed so they never add page height. */
@media (min-width: 981px) {
    body.theme-anime.portal-page[data-page="profile"] {
        overflow: hidden;
        height: 100vh;
        height: 100dvh;
    }

    /* Flex-column shell: header keeps its natural height, main fills rest. */
    body[data-page="profile"].theme-anime.portal-page #container {
        display: flex !important;
        flex-direction: column !important;
        height: 100vh;
        height: 100dvh;
        overflow: hidden !important;
    }
    body[data-page="profile"].theme-anime.portal-page .portal-main {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }
    body[data-page="profile"].theme-anime.portal-page #content {
        display: flex !important;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden !important;
    }
    body[data-page="profile"].theme-anime.portal-page #content > .padder {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden !important;
    }

    /* Header keeps its full natural height (logo row + nav). Without this the
       flex column shrinks the header to its min-height and the nav overflows
       downward, overlapping the profile tabs / stage. */
    body[data-page="profile"].theme-anime.portal-page > #container > .portal-header,
    body[data-page="profile"].theme-anime.portal-page .portal-shell > #container > .portal-header {
        flex: 0 0 auto !important;
    }

    /* Stage fills remaining height; single row stretches both panels. */
    body.theme-anime.portal-page[data-page="profile"] .pv2-stage {
        flex: 1 1 auto;
        grid-template-rows: minmax(0, 1fr);
        min-height: 0;
        overflow: hidden;
    }

    /* LEFT: fixed visual stage + positioning context for card/shelf. */
    body.theme-anime.portal-page[data-page="profile"] .pv2-panel-left {
        position: relative;
        display: block;
        height: 100%;
        min-height: 0;
        padding: 0;
        overflow: hidden;
    }
    /* Card anchored to the upper stage. */
    body.theme-anime.portal-page[data-page="profile"] .pv2-card-scene {
        position: absolute;
        left: 50%;
        top: clamp(30px, 6vh, 86px);
        transform: translateX(-50%);
        transform-origin: top center;
        width: min(452px, 82%);
        max-width: 452px;
        margin: 0;
        z-index: 3;
    }
    /* Shelf installed into the lower stage; absolute so it adds no height. */
    body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-wrap {
        position: absolute;
        left: 50%;
        bottom: clamp(22px, 4.5vh, 54px);
        transform: translateX(-50%);
        transform-origin: bottom center;
        width: min(560px, 88%);
        max-width: 560px;
        margin: 0;
        z-index: 2;
    }

    /* RIGHT: the only scroll container on the page. */
    body.theme-anime.portal-page[data-page="profile"] .pv2-panel-right {
        height: 100%;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}

/* Short desktop viewports — scale the card from its top anchor so it never
   collides with the shelf, keeping the whole composition inside the stage. */
@media (min-width: 981px) and (max-height: 900px) {
    body.theme-anime.portal-page[data-page="profile"] .pv2-card-scene {
        top: clamp(20px, 3.5vh, 60px);
        transform: translateX(-50%) scale(0.9);
    }
    body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-wrap {
        width: min(520px, 86%);
        bottom: clamp(18px, 3.5vh, 44px);
    }
}
@media (min-width: 981px) and (max-height: 800px) {
    body.theme-anime.portal-page[data-page="profile"] .pv2-card-scene {
        top: 18px;
        transform: translateX(-50%) scale(0.82);
    }
    body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-wrap {
        width: min(480px, 84%);
        bottom: 16px;
    }
}
@media (min-width: 981px) and (max-height: 700px) {
    body.theme-anime.portal-page[data-page="profile"] .pv2-card-scene {
        top: 12px;
        transform: translateX(-50%) scale(0.72);
    }
    body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-wrap {
        width: min(440px, 82%);
        bottom: 12px;
    }
}

/* ════════════════ RESPONSIVE ══════════════════════════════════ */
@media (max-width: 980px) {
    body.theme-anime.portal-page[data-page="profile"] .pv2-stage {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    body.theme-anime.portal-page[data-page="profile"] .pv2-panel-left {
        position: static;
        height: auto;
        min-height: 460px;
        padding: 44px 20px 56px;
    }
    body.theme-anime.portal-page[data-page="profile"] .pv2-card-scene { max-width: 360px; margin: 0 auto; }
    body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-wrap { max-width: 430px; margin: 30px auto 0; }
    body.theme-anime.portal-page[data-page="profile"] .pv2-panel-right { min-height: auto; border-left: none; }
    body.theme-anime.portal-page[data-page="profile"] .pv2-tab-body { padding: 20px 18px 44px; }
}
@media (max-width: 540px) {
    body.theme-anime.portal-page[data-page="profile"] .pv2-panel-left { min-height: 380px; padding: 32px 12px 44px; }
    body.theme-anime.portal-page[data-page="profile"] .pv2-card { padding: 24px 18px 18px; }
    body.theme-anime.portal-page[data-page="profile"] .pv2-card-banner { height: 82px; }
    body.theme-anime.portal-page[data-page="profile"] .pv2-shelf-wrap { max-width: 340px; }
    body.theme-anime.portal-page[data-page="profile"] .pv2-card-avatar { width: 92px; height: 92px; }
    body.theme-anime.portal-page[data-page="profile"] .pv2-card-name { font-size: 20px; }
    body.theme-anime.portal-page[data-page="profile"] .pv2-tab { padding: 10px 12px; font-size: 12px; }
    body.theme-anime.portal-page[data-page="profile"] .pv2-tab-body { padding: 16px 14px 32px; }
    body.theme-anime.portal-page[data-page="profile"] .pf-friend-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    body.theme-anime.portal-page[data-page="profile"] .pv2-panel-bg,
    body.theme-anime.portal-page[data-page="profile"] .pv2-card,
    body.theme-anime.portal-page[data-page="profile"] .pv2-card-avatar { transition: none !important; }
}

/* ----------------------------------------------------------------------
   Profile v5.2 � Section labels, Codex/blog, premium polish
   ---------------------------------------------------------------------- */

/* Decorative section head (Codex tab, framed modules) */
body.theme-anime.portal-page[data-page="profile"] .pf-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--pf-border);
}
body.theme-anime.portal-page[data-page="profile"] .pf-section-titles { display: flex; flex-direction: column; gap: 4px; }
body.theme-anime.portal-page[data-page="profile"] .pf-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--pf-accent);
    opacity: 0.9;
}
body.theme-anime.portal-page[data-page="profile"] .pf-section-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--pf-heading);
    display: flex;
    align-items: center;
    gap: 10px;
}
body.theme-anime.portal-page[data-page="profile"] .pf-section-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--pf-accent);
    background: var(--pf-accent-soft);
    border-radius: 10px;
    padding: 2px 8px;
}

/* -- Codex tab ------------------------------------------------------- */
body.theme-anime.portal-page[data-page="profile"] .pf-codex { padding: 4px 2px 20px; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-new { white-space: nowrap; }

/* Editor */
body.theme-anime.portal-page[data-page="profile"] .pf-codex-editor {
    background: var(--pf-module-soft);
    border: 1px solid var(--pf-border);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--pf-shadow);
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-input,
body.theme-anime.portal-page[data-page="profile"] .pf-codex-textarea {
    width: 100%;
    background: var(--pf-module);
    border: 1px solid var(--pf-border);
    border-radius: 10px;
    padding: 11px 13px;
    color: var(--pf-text);
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-input:focus,
body.theme-anime.portal-page[data-page="profile"] .pf-codex-textarea:focus {
    outline: none;
    border-color: var(--pf-accent);
    box-shadow: 0 0 0 3px var(--pf-accent-soft);
}
body.theme-anime.portal-page[data-page="profile"] #codexTitle { font-size: 17px; font-weight: 700; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-textarea { resize: vertical; min-height: 150px; line-height: 1.6; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-select { cursor: pointer; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-editor-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-editor-actions .pf-codex-select { flex: 1 1 auto; min-width: 160px; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-status { font-size: 12px; color: var(--pf-muted); margin-left: auto; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-cancel {
    background: transparent;
    border: 1px solid var(--pf-border);
    border-radius: 999px;
    padding: 7px 16px;
    color: var(--pf-muted);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-cancel:hover { color: var(--pf-text); border-color: var(--pf-accent); }

/* Entry list */
body.theme-anime.portal-page[data-page="profile"] .pf-codex-list { display: flex; flex-direction: column; gap: 20px; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-entry {
    background: var(--pf-module);
    border: 1px solid var(--pf-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--pf-shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-entry:hover {
    transform: translateY(-3px);
    box-shadow: var(--pf-shadow-lg);
    border-color: var(--pf-accent);
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-cover {
    width: 100%;
    background: var(--pf-module-soft);
    text-align: center;
    line-height: 0;
    cursor: zoom-in;
}
/* Detail view shows the FULL cover (no crop): contain at natural height,
   capped so very tall images don't dominate. Click opens the lightbox. */
body.theme-anime.portal-page[data-page="profile"] .pf-codex-cover img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 78vh;
    object-fit: contain;
    margin: 0 auto;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-entry-main { padding: 20px 22px 18px; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-entry-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-entry-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--pf-heading);
    line-height: 1.25;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-vis {
    font-size: 11px;
    font-weight: 700;
    color: var(--pf-muted);
    white-space: nowrap;
    background: var(--pf-accent-soft);
    border-radius: 8px;
    padding: 3px 8px;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--pf-muted);
    margin: 6px 0 14px;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-meta-kicker {
    font-family: var(--rem-font-mono, 'Courier New', monospace);
    letter-spacing: 0.18em;
    font-weight: 700;
    color: var(--pf-accent);
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-meta-sep { opacity: 0.5; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-meta-author {
    text-transform: none;
    letter-spacing: 0.01em;
    font-weight: 700;
    color: var(--pf-text);
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-meta-vis--private { color: var(--pf-accent); }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-entry-body {
    font-size: 15px;
    line-height: 1.72;
    color: var(--pf-text);
    word-break: break-word;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-entry-body p { margin: 0 0 12px; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-entry-body :last-child { margin-bottom: 0; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-entry-body img { max-width: 100%; height: auto; border-radius: 10px; cursor: zoom-in; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-entry-body a { color: var(--pf-accent); }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-entry-body h1,
body.theme-anime.portal-page[data-page="profile"] .pf-codex-entry-body h2,
body.theme-anime.portal-page[data-page="profile"] .pf-codex-entry-body h3 { color: var(--pf-heading); margin: 16px 0 8px; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-entry-body blockquote {
    margin: 12px 0;
    padding: 6px 16px;
    border-left: 3px solid var(--pf-accent);
    color: var(--pf-muted);
    font-style: italic;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-entry-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--pf-border-soft);
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-edit,
body.theme-anime.portal-page[data-page="profile"] .pf-codex-delete {
    background: transparent;
    border: 1px solid var(--pf-border);
    border-radius: 999px;
    padding: 6px 15px;
    font-size: 12px;
    font-weight: 700;
    color: var(--pf-muted);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-edit:hover { color: var(--pf-accent); border-color: var(--pf-accent); }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-delete:hover { color: #fff; background: var(--pf-accent); border-color: var(--pf-accent); }

/* Codex image lightbox — click a cover or inline image to view it full-size. */
.pf-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vmin;
    background: rgba(8, 6, 14, 0.88);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    cursor: zoom-out;
    animation: pf-lightbox-in 0.16s ease-out;
}
.pf-lightbox[hidden] { display: none; }
.pf-lightbox img {
    max-width: 96vw;
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}
@keyframes pf-lightbox-in { from { opacity: 0; } to { opacity: 1; } }
body.pf-lightbox-open { overflow: hidden; }

/* Empty state (beautiful) */
body.theme-anime.portal-page[data-page="profile"] .pf-codex-empty {
    text-align: center;
    padding: 54px 24px;
    border: 1px dashed var(--pf-border);
    border-radius: 18px;
    background: var(--pf-module-soft);
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-empty-mark {
    font-size: 34px;
    color: var(--pf-accent);
    opacity: 0.55;
    margin-bottom: 10px;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-empty-title { font-size: 16px; font-weight: 800; color: var(--pf-heading); margin: 0 0 6px; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-empty-sub { font-size: 13px; color: var(--pf-muted); margin: 0; }

/* -- Codex overview mini-module (Profile tab) ------------------------ */
body.theme-anime.portal-page[data-page="profile"] .pf-codex-mini-list { display: flex; flex-direction: column; gap: 10px; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-mini {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--pf-border-soft);
    background: var(--pf-module-soft);
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-mini:hover {
    transform: translateX(3px);
    border-color: var(--pf-accent);
    box-shadow: var(--pf-shadow);
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-mini-cover {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    background-color: var(--pf-accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-mini-cover--blank { color: var(--pf-accent); font-size: 20px; opacity: 0.6; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-mini-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-mini-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--pf-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-mini-lock { font-size: 11px; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-mini-excerpt {
    font-size: 12.5px;
    color: var(--pf-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-mini-date { font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--pf-muted); opacity: 0.8; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-mini-empty {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    text-align: center;
    border: 1px dashed var(--pf-border);
    border-radius: 12px;
    color: var(--pf-muted);
    font-size: 13px;
}
body.theme-anime.portal-page[data-page="profile"] .pf-codex-mini-empty a { color: var(--pf-accent); font-weight: 700; text-decoration: none; }
body.theme-anime.portal-page[data-page="profile"] .pf-codex-mini-empty a:hover { text-decoration: underline; }

/* -- Premium hover polish (friends / groups) ------------------------- */
body.theme-anime.portal-page[data-page="profile"] .pf-friend { transition: transform 0.15s ease, box-shadow 0.15s ease; }
body.theme-anime.portal-page[data-page="profile"] .pf-friend:hover { transform: translateY(-3px); }
body.theme-anime.portal-page[data-page="profile"] .pf-friend:hover img { box-shadow: 0 6px 18px var(--pf-accent-soft); border-color: var(--pf-accent); }
body.theme-anime.portal-page[data-page="profile"] .pf-group { transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
body.theme-anime.portal-page[data-page="profile"] .pf-group:hover { transform: translateY(-2px); border-color: var(--pf-accent); box-shadow: var(--pf-shadow); }
