﻿/* Forums UI - Material + Glass Hybrid */
:root {
    --bg: #f5f7fb;
    --fg: #1f2937;
    --muted: #667085;
    --border: rgba(17, 25, 40, 0.12);
    --divider: rgba(17,25,40,.08);
    --card-glass: rgba(255,255,255,0.68);
    --card-solid: #ffffff;
    --primary: #3b82f6;
    --primary-accent: #2563eb;
    --accent: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius: 14px;
    --shadow-sm: 0 2px 4px rgba(15,23,42,.06), 0 0 0 1px rgba(15,23,42,.04);
    --shadow: 0 6px 18px -4px rgba(15,23,42,.15), 0 2px 4px rgba(15,23,42,.08);
    --shadow-lg: 0 18px 42px -8px rgba(15,23,42,.22), 0 4px 10px rgba(15,23,42,.10);
    --focus-ring: 0 0 0 3px rgba(59,130,246,.35);
    --grad-1: linear-gradient(115deg,#ffffff 0%,#f0f5ff 52%,#e8f3ff 100%);
    --glass-blur: 18px;
    --accent-gradient: linear-gradient(90deg,#ffb187,#8fd4ff,#c6b6ff);
    --accent-gradient-soft: linear-gradient(90deg,#ffb18733,#8fd4ff33,#c6b6ff33);
    --soft-blue: #d6e9ff;
    --soft-blue-ring: rgba(59,130,246,.25);
    --soft-orange: #fed7aa;
}

/* Added outline-blue variant (pale blue border) */
.btn.outline-blue {
    background: linear-gradient(#ffffff,#ffffff) padding-box, linear-gradient(#d6e9ff,#d6e9ff) border-box;
    border: 2px solid transparent;
    color: var(--fg);
    box-shadow: 0 2px 6px -2px rgba(0,0,0,.12);
}

    .btn.outline-blue:hover {
        background: linear-gradient(#ffffff,#f8fbff) padding-box, linear-gradient(#cfe2fb,#cfe2fb) border-box;
        box-shadow: 0 4px 12px -2px rgba(0,0,0,.16);
        transform: translateY(-2px);
    }

    .btn.outline-blue:active {
        transform: translateY(0) scale(.97);
    }

    .btn.outline-blue:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(255,255,255,.9),0 0 0 5px rgba(59,130,246,.25);
    }
/* Forums UI - rest of file unchanged below */
/* Header avatar ring: fallback (soft green) ONLY when no rk-lv* class present */
.auth .header-av:not(.rk-lv1):not(.rk-lv2):not(.rk-lv3):not(.rk-lv4) {
    background: #ffffff;
    border: 2px solid #cfeedd;
    box-shadow: 0 0 0 2px rgba(16,185,129,.15);
}
/* pale green */
.guest .header-av {
    background: #fff;
    border: 2px solid #e5e7eb;
}

.header-av {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
    background: #fff;
}

    .header-av img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* Unified rank ring mapping (colors only, no size changes) */
/* Lv1: pale blue */
.header-av.rk-lv1,
.slp-av-photo.rk-lv1,
.header-av[data-rank="1"],
.slp-av-photo[data-rank="1"] {
    border: 2px solid #bcdfff;
    box-shadow: 0 0 0 2px rgba(188,223,255,.35);
}

/* Lv2: silver */
.header-av.rk-lv2,
.slp-av-photo.rk-lv2,
.header-av[data-rank="2"],
.slp-av-photo[data-rank="2"] {
    border: 2px solid #cfd4d8;
    box-shadow: 0 0 0 2px rgba(207,212,216,.4);
}

/* Lv3: gold */
.header-av.rk-lv3,
.slp-av-photo.rk-lv3,
.header-av[data-rank="3"],
.slp-av-photo[data-rank="3"] {
    border: 2px solid #f6d365;
    box-shadow: 0 0 0 2px rgba(246,211,101,.35);
}

/* Lv4: rainbow animated border */
    .header-av.rk-lv4,
    .slp-av-photo.rk-lv4,
    .profile-pop .av-wrap.border-lv4,
    .header-av[data-rank="4"],
    .slp-av-photo[data-rank="4"] {
        position: relative;
        background: linear-gradient(#ffffff,#ffffff) padding-box, linear-gradient(60deg, #ff6ec4, #a855f7, #6366f1, #3b82f6, #22d3ee, #14b8a6, #4ade80, #a3e635, #facc15, #f59e0b, #fb7185, #ff6ec4) border-box;
        border: 2px solid transparent;
        background-size: 100% 100%, 600% 100%;
        animation: rk-rainbow-ring 7s linear infinite;
    }

    .slp-av-photo.gradient-ring img {
        position: relative;
        z-index: 1;
    }
/* NEW: gradient ring for avatar inside header dropdown profile card */
.user-dropdown .user-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 0;
    overflow: visible;
    box-shadow: 0 2px 6px -2px rgba(0,0,0,.12);
}

    .user-dropdown .user-card-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    /* If no rank class present, show subtle neutral border */
    .user-dropdown .user-card-avatar:not(:has(.rk-lv1,.rk-lv2,.rk-lv3,.rk-lv4)) {
        border: 2px solid #e5e7eb;
    }
    /* Optional: slightly enlarge inner avatar to better center when in container */
    .user-dropdown .user-card-avatar .slp-av-photo {
        width: 56px;
        height: 56px;
    }

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font: 16px/1.6 "Segoe UI", Roboto, "Noto Sans JP", "BIZ UDPGothic", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: var(--fg);
    background: radial-gradient(900px 600px at 8% 4%, rgba(59,130,246,.10), transparent 70%), radial-gradient(1100px 700px at 92% 8%, rgba(16,185,129,.12), transparent 70%), var(--grad-1);
    background-attachment: fixed;
}
/* Layout */
.container {
    width: min(1180px, 92%);
    margin: 0 auto;
}

.layout-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 40px;
    align-items: start;
}

    .layout-grid > main {
        order: 2;
    }

    .layout-grid > .slp-sidebar {
        order: 1;
    }

@media (max-width:1100px) {
    .layout-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

        .layout-grid > main, .layout-grid > .slp-sidebar {
            order: initial;
        }
}

@media (max-width:860px) {
    html, body {
        min-height: 100vh;
    }

    .layout-grid {
        min-height: 100vh;
    }

    main {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }
}

/* --- Forum Rank Rings (shared) --- */
.slp-av-photo {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    overflow: hidden;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
}

    .slp-av-photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* size utilities for tag helper (adjusted to match legacy topic list: 44px + 30px) */
    .slp-av-photo.av-xs {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .slp-av-photo.av-sm {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }

    .slp-av-photo.av-md {
        width: 44px;
        height: 44px;
        font-size: 14px;
    }

    .slp-av-photo.av-lg {
        width: 56px;
        height: 56px;
        font-size: 18px;
    }

    .slp-av-photo.av-xl {
        width: 72px;
        height: 72px;
        font-size: 26px;
    }

    .slp-av-photo.av-2xl {
        width: 120px;
        height: 120px;
        font-size: 32px;
    }

@keyframes rk-rainbow-ring {
    0% { background-position: 0 0, 0% 50%; }
    50% { background-position: 0 0, 100% 50%; }
    100% { background-position: 0 0, 0% 50%; }
}

/* Header */
header {
    position: sticky;
    top: 0;
    backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
    background: rgba(255,255,255,.78);
    border-bottom: 1px solid rgba(17,25,40,.05);
    z-index: 50;
}

    header::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 3px;
        background: linear-gradient(90deg,#b7e5ff 0%, #c7d9ff 45%, #d5ccff 80%, #ffc9e2 100%);
        opacity: .9;
        pointer-events: none;
    }

    header .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 0;
        gap: 24px;
    }

    header + .container {
        margin-top: 16px;
    }

.site-brand {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: .5px;
    color: var(--fg);
    text-decoration: none;
}

    .site-brand:hover {
        color: var(--primary-accent);
    }

nav.main-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

    nav.main-nav a {
        position: relative;
        padding: 8px 16px;
        font-size: 14px;
        color: var(--muted);
        text-decoration: none;
        border-radius: 999px;
        line-height: 1.2;
    }

        nav.main-nav a:hover {
            color: var(--fg);
            background: rgba(255,255,255,.9);
            box-shadow: var(--shadow-sm);
        }

        nav.main-nav a.active {
            background: linear-gradient(145deg,var(--primary),var(--primary-accent));
            color: #fff;
            box-shadow: 0 4px 14px -2px rgba(37,99,235,.40);
        }

/* Footer */
footer {
    margin-top: 64px;
    padding: 30px 0;
    border-top: 1px solid rgba(17,25,40,.08);
    font-size: 13px;
    color: var(--muted);
    background: rgba(255,255,255,.6);
    backdrop-filter: blur(12px);
}

    footer a {
        color: var(--primary);
        text-decoration: none;
    }

        footer a:hover {
            text-decoration: underline;
        }

/* Buttons */
button, input[type=submit] {
    appearance: none;
    border: 1px solid rgba(17,25,40,.14);
    background: linear-gradient(145deg,#ffffff,#f1f5f9);
    color: var(--fg);
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .3px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: background .18s, box-shadow .18s, transform .12s;
}

    button:hover, input[type=submit]:hover {
        box-shadow: var(--shadow);
        transform: translateY(-2px);
    }

    button:active, input[type=submit]:active {
        transform: translateY(0) scale(.97);
    }

    button:focus-visible, input[type=submit]:focus-visible {
        outline: none;
        box-shadow: var(--focus-ring);
    }

    button.btn-text {
        background: transparent;
        border: 0;
        box-shadow: none;
        padding: 6px 10px;
        color: var(--primary);
    }

        button.btn-text:hover {
            text-decoration: underline;
            transform: none;
            box-shadow: none;
        }

    button.btn-outline {
        background: #fff;
        border: 1px solid var(--primary);
        color: var(--primary);
    }

        button.btn-outline:hover {
            background: linear-gradient(145deg,#f0f7ff,#e6f1ff);
        }

    button.btn-ghost {
        background: transparent;
        border: 1px solid transparent;
        box-shadow: none;
        color: var(--muted);
    }

        button.btn-ghost:hover {
            background: rgba(59,130,246,.08);
            color: var(--primary);
        }

    button.sm, input[type=submit].sm {
        padding: 6px 14px;
        font-size: 12px;
    }

/* Primary action buttons */
.btn {
    --btn-bg: linear-gradient(145deg,var(--primary),var(--primary-accent));
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .3px;
    color: #fff;
    background: var(--btn-bg);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 999px;
    box-shadow: 0 4px 14px -2px rgba(37,99,235,.45);
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow .18s ease, transform .12s ease;
}

    .btn:hover {
        box-shadow: 0 6px 20px -2px rgba(37,99,235,.55);
        transform: translateY(-2px);
    }

    .btn:active {
        transform: translateY(0) scale(.97);
    }

    .btn.secondary {
        --btn-bg: linear-gradient(145deg,#ffffff,#f1f5f9);
        color: var(--fg);
        border: 1px solid rgba(17,25,40,.10);
        box-shadow: 0 3px 10px -2px rgba(17,25,40,.15);
    }

    .btn.danger {
        --btn-bg: linear-gradient(145deg,#ef4444,#dc2626);
        box-shadow: 0 4px 14px -2px rgba(220,38,38,.5);
    }

    .btn.sm {
        padding: 6px 14px;
        font-size: 12px;
    }

    /* Outline accent variant */
    .btn.outline-accent {
        background: linear-gradient(#ffffff,#ffffff) padding-box, var(--accent-gradient) border-box;
        border: 2px solid transparent;
        color: var(--fg);
        box-shadow: 0 2px 6px -2px rgba(0,0,0,.15);
    }

        .btn.outline-accent:hover {
            background: linear-gradient(#ffffff,#f8fafc) padding-box, var(--accent-gradient) border-box;
            box-shadow: 0 4px 12px -2px rgba(0,0,0,.18);
            transform: translateY(-2px);
        }

        .btn.outline-accent:active {
            transform: translateY(0) scale(.97);
        }

        .btn.outline-accent:focus-visible {
            outline: none;
            box-shadow: 0 0 0 3px rgba(255,255,255,.9),0 0 0 5px rgba(0,0,0,.15);
        }

/* Cards */
.card, .slp-card, .topic-detail, .comment-form {
    position: relative;
    background: var(--card-glass);
    backdrop-filter: blur(calc(var(--glass-blur)*0.75)) saturate(1.15);
    -webkit-backdrop-filter: blur(calc(var(--glass-blur)*0.75)) saturate(1.15);
    border: 1px solid rgba(255,255,255,.55);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 24px;
    overflow: hidden;
}

    .card:before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: linear-gradient(145deg,rgba(255,255,255,.55),rgba(255,255,255,.15));
        opacity: .7;
        mix-blend-mode: overlay;
    }

    .card + .card {
        margin-top: 28px;
    }

.stack > .card + .card {
    margin-top: 28px;
}

/* Headings */
main h1 {
    font-size: clamp(1.6rem,2.1vw,2.15rem);
    margin: 0 0 22px;
    letter-spacing: .6px;
    font-weight: 600;
}

main h2 {
    font-size: 1.32rem;
    margin: 0 0 16px;
    letter-spacing: .4px;
}

main h3 {
    font-size: 1.05rem;
    margin: 0 0 10px;
}

.comments {
    margin-top: 18px;
}

    .comments h3 {
        position: relative;
        padding-top: 22px;
        margin-top: 42px;
        margin-left: 6px;
        font-weight: 600;
    }

        .comments h3:first-child {
            margin-top: 0;
            padding-top: 0;
        }

        .comments h3::before {
            content: "";
            position: absolute;
            left: 0;
            bottom: 0;
            height: 4px;
            width: 140px;
            max-width: 55%;
            background: linear-gradient(90deg,rgba(59,130,246,.55),rgba(59,130,246,.35),rgba(59,130,246,0));
            border-radius: 3px;
            box-shadow: 0 2px 4px -1px rgba(59,130,246,.25);
        }

        .comments h3::after {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            height: 4px;
            background: linear-gradient(90deg,rgba(59,130,246,.20),rgba(59,130,246,0));
            opacity: .15;
            border-radius: 3px;
            pointer-events: none;
        }

/* Sidebar */
.slp-sidebar {
    display: grid;
    gap: 24px;
}

.slp-card h4 {
    margin: 0 0 10px;
    font-size: 14px;
    letter-spacing: .5px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--muted);
}

.slp-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .slp-list li {
        padding: 8px 0;
        border-bottom: 1px dashed var(--divider);
    }

        .slp-list li:last-child {
            border-bottom: none;
        }

.category-cards .sidebar-cats {
    display: grid;
    gap: 10px;
}

.category-cards .sidebar-cat {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(145deg,#ffffff,#f2f6fb);
    border: 1px solid rgba(17,25,40,.10);
    border-radius: 14px;
    text-decoration: none;
    color: var(--fg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .18s, transform .15s, background .25s, border-color .25s;
}

    .category-cards .sidebar-cat:hover {
        box-shadow: var(--shadow);
        transform: translateY(-3px);
        background: linear-gradient(145deg,#f8fbff,#e9f2ff);
        border-color: var(--soft-blue);
    }

    .category-cards .sidebar-cat:active {
        transform: translateY(-1px) scale(.98);
    }

    .category-cards .sidebar-cat .icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 10px;
        background: linear-gradient(135deg,#f5f8fa,#eef3f7);
        border: 1px solid rgba(17,25,40,.08);
        overflow: hidden; /* prevent child overflow on small screens */
    }

        .category-cards .sidebar-cat .icon svg {
            width: 26px;
            height: 26px;
            stroke: currentColor;
            stroke-width: 1.6;
            fill: none;
            display: block;
        }

        /* ensure uploaded image icons fit like SVGs */
        .category-cards .sidebar-cat .icon img {
            width: 26px;
            height: 26px;
            object-fit: contain;
            display: block;
        }

    .category-cards .sidebar-cat:hover .icon {
        background: linear-gradient(135deg,#e9f2ff,#dbe9f6);
    }

    .category-cards .sidebar-cat .cat-text {
        display: flex;
        flex-direction: column;
        line-height: 1.15;
    }

    .category-cards .sidebar-cat .cat-name {
        font-size: 14px;
        font-weight: 600;
        letter-spacing: .4px;
    }

    .category-cards .sidebar-cat .cat-slug {
        font-size: 11px;
        color: var(--muted);
    }

    .category-cards .sidebar-cat .chevron {
        margin-left: auto;
        font-size: 20px;
        color: var(--muted);
        opacity: .6;
        transition: transform .25s, opacity .25s;
    }

    .category-cards .sidebar-cat:hover .chevron {
        transform: translateX(4px);
        opacity: 1;
    }

@media (max-width:860px) {
    .category-cards .sidebar-cat {
        padding: 12px 14px;
    }
}

/* Topic list */
.topic-list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(17,25,40,.08);
    border-radius: var(--radius);
    background: var(--card-solid);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.topic-row {
    display: grid;
    grid-template-columns: 32px 1fr 180px;
    gap: 16px;
    align-items: start;
    padding: 14px 18px;
    position: relative;
    font-size: 14px;
}

@media (max-width:820px) {
    .topic-row {
        grid-template-columns: 1fr;
    }

        .topic-row .topic-meta {
            margin-top: 6px;
        }
}

.topic-row:not(:last-child) {
    border-bottom: 1px solid var(--divider);
}

.topic-row:hover {
    background: linear-gradient(90deg,rgba(59,130,246,.06),rgba(255,255,255,0));
}

.topic-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 50%;
    padding: 4px 6px;
    line-height: 1;
    height: fit-content;
}

.topic-pin-col .topic-pin {
    background: linear-gradient(#fef3c7,#fef3c7) padding-box, var(--rainbow) border-box;
}

.topic-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}

    .topic-title a {
        color: var(--fg);
        text-decoration: none;
        word-break: break-all
    }

        .topic-title a:hover {
            text-decoration: underline;
            text-underline-offset: 3px;
        }

.topic-tags {
    margin: 6px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

    .topic-tags .tag {
        font-size: 11px;
        padding: 4px 10px;
        background: #f1f5f9;
        border-color: rgba(17,25,40,.10);
    }

.topic-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
    color: var(--muted);
    justify-content: flex-start;
}

    .topic-meta .author a {
        color: var(--primary-accent);
        text-decoration: none;
    }

        .topic-meta .author a:hover {
            text-decoration: underline;
        }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 999px;
    letter-spacing: .3px;
    border: 1px solid rgba(17,25,40,.14);
    background: linear-gradient(145deg,#ffffff,#f1f5f9);
    color: #334155;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

    .badge.pinned {
        background: linear-gradient(145deg,#fde68a,#fcd34d);
        color: #7c5012;
        border-color: #fbbf24;
    }

    .badge.status-open {
        background: linear-gradient(145deg,#dcfce7,#bbf7d0);
        color: #166534;
        border-color: #6ee7b7;
    }

    .badge.closed {
        background: linear-gradient(145deg,#e9fdf0,#d4f9e2);
        color: #15803d;
        border-color: #86efac;
    }

    .badge.members {
        background: linear-gradient(145deg,#e0f2fe,#bae6fd);
        color: #075985;
        border-color: #7dd3fc;
    }

    .badge.private {
        background: linear-gradient(145deg,#fde68a,#fcd34d);
        color: #78350f;
        border-color: #fbbf24;
    }
/* Rank badges */
.frank-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    padding: 4px 10px;
    border-radius: 999px;
    line-height: 1.1;
    border: 1px solid rgba(17,25,40,.14);
    background: linear-gradient(145deg,#ffffff,#f1f5f9);
    color: #334155;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

    .frank-badge.member {
        background: linear-gradient(145deg,#dbeafe,#bfdbfe);
        color: #1e3a8a;
        border-color: #93c5fd;
    }

    .frank-badge.expert {
        background: linear-gradient(145deg,#dcfce7,#bbf7d0);
        color: #166534;
        border-color: #86efac;
    }

    .frank-badge.master {
        background: linear-gradient(145deg,#fde68a,#fcd34d);
        color: #7c5012;
        border-color: #fbbf24;
    }

    .frank-badge.newbie {
        background: linear-gradient(145deg,#f1f5f9,#e2e8f0);
        color: #475569;
        border-color: #cbd5e1;
    }
/* Overlay style (avatar corner) */
.avatar-badge-wrap {
    position: relative;
    display: inline-block;
}

    .avatar-badge-wrap .rank-avatar {
        display: block;
        border-radius: 16px;
        overflow: hidden;
    }

.frank-badge-overlay {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px -2px rgba(0,0,0,.35);
    padding: 0;
}

    .frank-badge-overlay .rank-dot {
        width: 14px;
        height: 14px;
        display: block;
        border-radius: 50%;
        background: linear-gradient(145deg,#f1f5f9,#e2e8f0);
        border: 1px solid #cbd5e1;
        box-shadow: inset 0 1px 2px rgba(0,0,0,.12);
    }

    .frank-badge-overlay.member .rank-dot {
        background: linear-gradient(145deg,#dbeafe,#93c5fd);
        border-color: #60a5fa;
    }

    .frank-badge-overlay.expert .rank-dot {
        background: linear-gradient(145deg,#bbf7d0,#6ee7b7);
        border-color: #34d399;
    }

    .frank-badge-overlay.master .rank-dot {
        background: linear-gradient(145deg,#fcd34d,#fb923c);
        border-color: #f59e0b;
    }

    .frank-badge-overlay.newbie .rank-dot {
        background: linear-gradient(145deg,#f1f5f9,#e2e8f0);
        border-color: #cbd5e1;
    }

    .frank-badge-overlay:hover {
        transform: scale(1.1);
        transition: transform .15s;
    }

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 2px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(145deg,#ffffff,#f5f8fb);
    border: 1px solid rgba(17,25,40,.12);
    font-size: 12px;
    color: var(--fg);
    text-decoration: none;
    line-height: 1.1;
}

    .tag:hover {
        background: #ffffff;
        box-shadow: var(--shadow-sm);
    }

    .tag .hash {
        color: var(--muted);
    }

/* Tag input / chips */
.tag-input-wrap {
    display: grid;
    gap: 6px;
}

.selected-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid rgba(17,25,40,.15);
    font-size: 12px;
}

    .tag-chip .hash {
        color: var(--muted);
    }

    .tag-chip .remove {
        cursor: pointer;
        background: transparent;
        border: none;
        font-size: 14px;
        color: var(--muted);
    }

        .tag-chip .remove:hover {
            color: #dc2626;
        }

/* Pager */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

    .pager a, .pager span {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        text-decoration: none;
        border-radius: 12px;
        border: 1px solid rgba(17,25,40,.12);
        background: #fff;
        color: var(--fg);
        box-shadow: var(--shadow-sm);
    }

    .pager span {
        background: linear-gradient(145deg,#eef2ff,#e0e7ff);
        border-color: #c7d2fe;
        font-weight: 600;
    }

    .pager a:hover {
        background: linear-gradient(145deg,#f8fafc,#eef2f7);
    }

/* Forms */
input[type=text], input[type=file], textarea, select {
    width: 100%;
    background: #fff;
    border: 1px solid rgba(17,25,40,.15);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--fg);
    box-shadow: var(--shadow-sm);
    transition: border-color .15s, box-shadow .15s;
}

    input[type=text]:focus, textarea:focus, select:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: var(--focus-ring);
    }

textarea {
    resize: vertical;
    min-height: 140px;
}

/* Topic detail */
.topic-detail {
    padding: 16px 18px;
}

.comment, .reply {
    margin-top: 18px;
}

    .comment.slp-card, .reply.slp-card {
        padding: 16px 18px;
    }

    .comment .meta, .reply .meta {
        color: var(--muted);
        font-size: 12px;
    }

.reply-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--divider);
}

.comment-form {
    margin-top: 26px;
}

.profile-header {
    margin-bottom: 20px;
}

.profile-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
}

    .profile-stats .stat {
        min-width: 95px;
    }

    .profile-stats .label {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .7px;
        color: var(--muted);
        margin-bottom: 4px;
    }

    .profile-stats .value {
        font-size: 24px;
        font-weight: 600;
        line-height: 1.15;
    }

.rank-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
}

    .rank-grid .field {
        min-width: 140px;
    }

        .rank-grid .field .label {
            font-size: 11px;
            letter-spacing: .6px;
            text-transform: uppercase;
            color: var(--muted);
            margin-bottom: 4px;
        }

.rank-empty {
    color: var(--muted);
}

.word-break {
    word-break: break-all;
}

.pb-3 {
    padding-bottom: 1rem;
}

.w-100 {
    width: 100%;
}

.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.gap-16 {
    gap: 16px;
}

.gap-24 {
    gap: 24px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-3 {
    margin-bottom: 12px;
}

.text-muted {
    color: var(--muted);
}

.text-sm {
    font-size: 12px;
}

.font-semibold {
    font-weight: 600;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid rgba(17,25,40,.12);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

th, td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--divider);
    text-align: left;
}

th {
    background: linear-gradient(145deg,#f1f5f9,#e2e8f0);
    font-size: 12px;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #475569;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .slp-card, .topic-detail, .topic-row {
    animation: fadeInUp .25s ease both;
}

@keyframes slideIn {
    from {
        transform: translateX(40px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(40px);
        opacity: 0;
    }
}

.mobile-sidebar-modal .modal-backdrop {
    opacity: 0;
    transition: opacity .25s ease;
}

.mobile-sidebar-modal.open .modal-backdrop {
    opacity: 1;
}

.mobile-sidebar-modal.open .modal-panel {
    animation: slideIn .28s ease;
}

.mobile-sidebar-modal.open.closing .modal-panel {
    animation: slideOut .22s ease forwards;
}

.mobile-sidebar-modal.open.closing .modal-backdrop {
    opacity: 0;
}

/* Attachments */
.attachment-img {
    max-width: min(100%, 340px);
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 8px 0;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

    .attachment-img.large {
        max-width: 100%;
    }

.attachment-gallery .attachment-img {
    max-width: 100%;
    cursor: pointer;
}

.attachment-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
    gap: 12px;
    margin-top: 12px;
}

    .attachment-gallery figure {
        margin: 0;
    }

    .attachment-gallery .attachment-caption {
        color: var(--muted);
        font-size: 12px;
        margin-top: 4px;
        text-align: center;
    }

/* Lightbox */
#slp-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

    #slp-lightbox.open {
        display: block;
    }

.slp-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17,25,40,.55);
    backdrop-filter: blur(6px);
}

.slp-lightbox-content {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}

    .slp-lightbox-content img {
        max-width: min(96vw,1280px);
        max-height: 86vh;
        border-radius: 16px;
        box-shadow: var(--shadow-lg);
        background: #fff;
    }

.slp-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 22px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0 !important;
}

@media (max-width:860px) {
    .slp-lightbox-content {
        padding: clamp(8px,4vw,18px);
    }

        .slp-lightbox-content img {
            width: 100%;
            max-width: 100%;
            height: auto;
            box-sizing: border-box;
        }

    .slp-lightbox-close {
        top: 10px;
        right: 12px;
    }
}

/* Tag suggest dropdown */
#tags-suggest {
    padding: 6px;
    max-height: 240px;
    overflow: auto;
}

    #tags-suggest .tag-suggest-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

        #tags-suggest .tag-suggest-list li {
            padding: 8px 10px;
            border-radius: 10px;
            cursor: pointer;
            font-size: 13px;
        }

            #tags-suggest .tag-suggest-list li:hover {
                background: #f1f5f9;
            }

            #tags-suggest .tag-suggest-list li.create {
                color: #14532d;
                background: rgba(16,185,129,.12);
                border: 1px dashed rgba(16,185,129,.4);
            }

                #tags-suggest .tag-suggest-list li.create:hover {
                    background: rgba(16,185,129,.20);
                }

    #tags-suggest .muted {
        color: var(--muted);
        font-size: 12px;
    }

/* Accessibility focus */
a:focus-visible, button:focus-visible, .btn:focus-visible, .tag:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Form inline */
.form-inline-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

    .form-inline-row input[type=text], .form-inline-row input[type=file] {
        flex: 1 1 auto;
        width: auto;
    }

    .form-inline-row button {
        flex: 0 0 auto;
        margin: 0;
    }

.inline-field-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

    .inline-field-row > * {
        flex: 1 1 auto;
    }

    .inline-field-row button, .inline-field-row .actions {
        flex: 0 0 auto;
    }

.form-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end, gap:8px;
}

.hide-mobile {
    display: flex;
}

@media (max-width: 860px) {
    .hide-mobile {
        display: none !important;
    }

    .layout-grid {
        grid-template-columns: 1fr;
    }

    #floating-menu-btn.floating-menu-btn,
    #back-to-top-btn.back-to-top-btn {
        display: flex !important;
    }

    .mobile-sidebar-modal {
        display: block;
    }

    .layout-grid > .slp-sidebar {
        display: none !important;
    }
}

/* Floating menu button (mobile menu) – switched to pale blue border */
.floating-menu-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid #d6e9ff;
    background: #ffffff;
    box-shadow: 0 6px 20px -4px rgba(15,23,42,.18);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    z-index: 120;
    transition: box-shadow .2s, transform .15s, opacity .25s;
}

    .floating-menu-btn:hover {
        box-shadow: 0 10px 26px -4px rgba(15,23,42,.28);
        transform: translateY(-3px);
    }

    .floating-menu-btn:active {
        transform: translateY(-1px) scale(.96);
    }

/* Back-to-top (pale blue border) */
.back-to-top-btn {
    bottom: 90px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    position: fixed;
    right: 18px;
    border: 2px solid #d6e9ff;
    background: #ffffff;
    box-shadow: 0 6px 20px -4px rgba(15,23,42,.18);
}

    .back-to-top-btn.show {
        opacity: 1;
        pointer-events: auto;
    }

@media (min-width:861px) {
    .back-to-top-btn {
        bottom: 90px;
    }
}

/* Mobile sidebar modal */
.mobile-sidebar-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 110;
}

    .mobile-sidebar-modal .modal-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(15,23,42,.45);
        backdrop-filter: blur(4px);
    }

    .mobile-sidebar-modal .modal-panel {
        position: absolute;
        top: 0;
        right: 0;
        width: min(92%,380px);
        height: 100%;
        background: rgba(255,255,255,.9);
        backdrop-filter: blur(18px) saturate(1.2);
        box-shadow: -6px 0 24px -4px rgba(15,23,42,.25);
        display: flex;
        flex-direction: column;
        animation: slideIn .28s ease;
    }

    .mobile-sidebar-modal .modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 18px;
        border-bottom: 1px solid rgba(17,25,40,.10);
    }

    .mobile-sidebar-modal .modal-title {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
    }

    .mobile-sidebar-modal .close-btn {
        background: transparent;
        border: 0;
        font-size: 24px;
        line-height: 1;
        cursor: pointer;
        padding: 4px 8px;
    }

    .mobile-sidebar-modal .modal-body {
        padding: 18px;
        overflow-y: auto;
    }

    .mobile-sidebar-modal.open {
        display: block;
    }

        .mobile-sidebar-modal.open .modal-backdrop {
            opacity: 1;
        }

        .mobile-sidebar-modal.open .modal-panel {
            animation: slideIn .28s ease;
        }

        .mobile-sidebar-modal.open.closing .modal-panel {
            animation: slideOut .22s ease forwards;
        }

        .mobile-sidebar-modal.open.closing .modal-backdrop {
            opacity: 0;
        }

.no-scroll {
    overflow: hidden;
}

@keyframes slideIn {
    from {
        transform: translateX(40px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(40px);
        opacity: 0;
    }
}

@media (min-width: 861px) {
    #back-to-top-btn.back-to-top-btn {
        display: flex;
        bottom: 32px;
    }
}

/* Empty state */
.empty-state {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 54px 38px;
    margin: 10px 0;
    background: rgba(255,255,255,.62);
    backdrop-filter: blur(14px) saturate(1.25);
    -webkit-backdrop-filter: blur(14px) saturate(1.25);
    border: 2px dashed rgba(17,25,40,.15);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px -6px rgba(15,23,42,.18),0 2px 4px rgba(15,23,42,.08);
    gap: 20px;
    animation: fadeInUp .35s ease both;
}

    .empty-state .icon {
        width: 84px;
        height: 84px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 34px;
        line-height: 1;
        background: linear-gradient(145deg,#f0f6ff,#ffffff);
        color: var(--primary);
        box-shadow: 0 6px 18px -4px rgba(37,99,235,.45),0 0 0 1px rgba(37,99,235,.18);
    }

    .empty-state h3 {
        margin: 0;
        font-size: 1.15rem;
        font-weight: 600;
        letter-spacing: .5px;
    }

    .empty-state p {
        margin: 0;
        max-width: 560px;
        color: var(--muted);
        line-height: 1.5;
        font-size: .95rem;
    }

    .empty-state .tips {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        margin-top: 6px;
    }

        .empty-state .tips span {
            background: linear-gradient(145deg,#ffffff,#f5f8fb);
            border: 1px solid rgba(17,25,40,.12);
            padding: 6px 12px;
            border-radius: 999px;
            font-size: 11px;
            letter-spacing: .4px;
            color: #475569;
        }

    .empty-state .actions {
        display: flex;
        gap: 12px;
        margin-top: 8px;
        flex-wrap: wrap;
    }

        .empty-state .actions a.btn {
            padding: 10px 18px;
        }

@media (max-width:600px) {
    .empty-state {
        padding: 42px 24px;
    }

        .empty-state .icon {
            width: 72px;
            height: 72px;
            font-size: 30px;
        }
}

/* Empty latest topic hint */
.empty-list-hint {
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
    background: linear-gradient(145deg,#ffffff,#f5f8fb);
    border: 1px dashed var(--divider);
    padding: 14px 16px;
    border-radius: 12px;
    text-align: center;
    animation: fadeInUp .3s ease;
}

    .empty-list-hint .link-new-first {
        display: inline-block;
        margin-top: 8px;
        font-size: 12px;
        color: var(--primary);
        font-weight: 600;
        text-decoration: none;
    }

        .empty-list-hint .link-new-first:hover {
            text-decoration: underline;
        }
/* Avatar */
.slp-avatar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit
}

.slp-avatar-photo {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #555;
    flex: 0 0 auto
}

    .slp-avatar-photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block
    }

.slp-avatar-lg .slp-avatar-photo {
    width: 40px;
    height: 40px;
    font-size: 16px
}

.slp-avatar-name {
    font-weight: 600;
    line-height: 1.2;
    font-size: 14px
}

.profile-pop {
    position: absolute;
    z-index =3000;
    min-width: 240px;
    max-width: 320px;
    background: #fff;
    border =1px solid #dfe3e8;
    border-radius =12px;
    box-shadow =0 6px 20px rgba(0,0,0,.15);
    padding =14px;
    display: none
}

    .profile-pop[data-show="true"] {
        display: block
    }

    .profile-pop h4 {
        margin: 0 0 6px 0;
        font-size =15px
    }

    .profile-pop .counts {
        display: flex;
        gap =12px;
        font-size =12px;
        margin-top =8px
    }

        .profile-pop .counts div {
            display: flex;
            flex-direction: column;
            align-items: flex-start
        }

        .profile-pop .counts span.value {
            font-weight =600;
            font-size =14px
        }

    .profile-pop .bio {
        margin-top =8px;
        font-size =12px;
        line-height =1.4;
        white-space: pre-wrap;
        word-break: break-word;
        max-height =120px;
        overflow: auto
    }

/* Markdown Help Modal */
body.md-help-open {
    overflow: hidden;
}

.md-help-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
}

    .md-help-modal[hidden] {
        display: none;
    }

.md-help-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,.55);
    backdrop-filter: blur(4px);
}

.md-help-dialog {
    position: relative;
    width: min(940px,100%);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 42px -8px rgba(15,23,42,.45),0 4px 14px rgba(15,23,42,.18);
    padding: 26px 28px 30px;
    max-height: calc(100vh - 80px);
    overflow: auto;
}

.md-help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

    .md-help-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
    }

.md-help-close {
    background: transparent;
    border: 0;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}

.md-help-content {
    font-size: 13px;
    line-height: 1.5;
}

.md-help-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
    margin-bottom: 14px;
}

    .md-help-grid pre {
        background: #1e293b;
        color: #f1f5f9;
        padding: 10px 12px;
        border-radius: 10px;
        font-size: 12px;
        overflow: auto;
        margin: 8px 0 14px;
    }

    .md-help-grid code, .md-help-note code {
        padding: 2px 4px;
        border-radius: 4px;
        font-size: .85em;
    }

.md-help-note {
    font-size: 12px;
    color: #475569;
    margin: 0;
}

.md-tab.md-help-btn {
    background: #fff;
    color: #334155;
    font-weight: 500;
}

    .md-tab.md-help-btn:hover {
        background: #f1f5f9;
    }

.md-help-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

    .md-help-btn:hover {
        background: #fff;
        border-color: #3b82f6;
        color: #1e3a8a;
    }
/* Markdown editor tabs & help button sizing */
.md-tabs .md-tab,
.md-tabs .md-help-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 13px;
    line-height: 1.2;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
}

    .md-tabs .md-tab.active {
        background: #fff;
        border-color: #3b82f6;
        color: #1e3a8a;
        box-shadow: 0 0 0 2px rgba(59,130,246,.25);
    }

    .md-tabs .md-tab:focus-visible,
    .md-tabs .md-help-btn:focus-visible {
        outline: none;
        box-shadow: 0 0 0 2px rgba(59,130,246,.25);
    }

.md-tabs .md-help-btn {
    color: #334155;
    font-weight: 500;
}

    .md-tabs .md-help-btn:hover {
        background: #fff;
    }

.md-tabs.sm .md-tab,
.md-tabs.sm .md-help-btn {
    padding: 3px 8px;
    font-size: 12px;
}

/* Code block language label */
pre .code-lang-label {
    position: absolute;
    top: 6px;
    right: 8px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 12px;
    letter-spacing: .5px;
    font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
    pointer-events: none;
}

/* NEW: avatar container in dropdown: force perfect circle */
.user-dropdown .user-card-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 0;
    overflow: visible;
    box-shadow: 0 2px 6px -2px rgba(0,0,0,.12);
}

    .user-dropdown .user-card-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    /* Inner avatar (TagHelper output) should fill container */
    .user-dropdown .user-card-avatar .slp-av-photo {
        width: 100% !important;
        height: 100% !important;
        font-size: 22px;
    }

.profile-pop {
    position: absolute;
    z-index: 9999;
    min-width: 240px;
    max-width: 300px;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    font-size: 13px;
    line-height: 1.4;
    display: none;
    font-family: system-ui,-apple-system,Segoe UI,Roboto,'Noto Sans JP',sans-serif;
}

    .profile-pop[data-show='true'] {
        display: block;
    }

    .profile-pop .pop-name {
        font-size: 15px;
        font-weight: 600;
        margin: 0 0 8px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .profile-pop .avatar-rank-row {
        display: flex;
        align-items: center;
        gap: 14px;
        margin: 0 0 10px;
    }

    .profile-pop .av-wrap {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 2px;
        border-radius: 50%;
    }

        .profile-pop .av-wrap.no-img {
            width: 56px;
            height: 56px;
            background: transparent;
        }

            .profile-pop .av-wrap.no-img .av-initial {
                width: 100%;
                height: 100%;
                display: flex;
                align-items: center;
                justify-content: center;
                border-radius: 50%;
                background: #f3f5f7;
                color: #555;
                font-weight: 600;
                font-size: 26px;
                letter-spacing: .5px;
                line-height: 1;
            }

        .profile-pop .av-wrap.border-none {
            background: #ffffff;
        }
        /* light blue */
        .profile-pop .av-wrap.border-lv1 {
            background: linear-gradient(135deg,#e0f2fe,#bfdbfe);
        }
        /* silver */
        .profile-pop .av-wrap.border-lv2 {
            background: linear-gradient(135deg,#e5e7eb,#cfd2d6,#f5f5f5);
        }
        /* gold */
        .profile-pop .av-wrap.border-lv3 {
            background: linear-gradient(135deg,#fcd34d,#fbbf24,#f59e0b);
        }

.profile-pop .avatar-rank-row img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #f3f5f7;
}

.profile-pop .rank-cell {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 40px;
}

.profile-pop .frank-badge {
    margin: 0;
}

    .profile-pop .frank-badge.sm {
        font-size: 11px;
        padding: 5px 12px;
    }

.profile-pop .counts {
    display: flex;
    gap: 14px;
    margin: 0 0 10px;
}

    .profile-pop .counts > div {
        display: flex;
        flex-direction: column;
        min-width: 52px;
    }

    .profile-pop .counts .label {
        color: #666;
        font-size: 11px;
        letter-spacing: .2px;
    }

    .profile-pop .counts .value {
        font-weight: 600;
        font-size: 14px;
    }

.profile-pop .act {
    margin-top: 4px;
}

.profile-pop .btn.sm.secondary {
    font-size: 11px;
    padding: 6px 12px;
}
