﻿/* ============================================================================
   VCAP Console — Components & Pages
   ----------------------------------------------------------------------------
   The application shell and component language for the authenticated app.
   Design tokens live in console-theme.css (loaded first); this file consumes
   them and defines no raw colour or spacing values. The public landing page
   is unaffected. BootstrapBlazor components inherit theme.css; this file owns
   the shell primitives and each page's styles.

   Layout
     1. Icons          2. Shell (nav, topbar)     3. Primitives
     4. Dashboard      5. Page sections (tok2-, nf-, rf-, nfc-, chat-, …)
   ========================================================================== */

html, body { background: var(--bg); }
body { font-family: var(--font); color: var(--ink); }

/* ---- Lucide icons (inline SVG): consistent default; contexts override ---- */
svg.lucide { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.ap-shell svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex: none; }
.ap-nav-item svg.lucide { width: 18px; height: 18px; }
.ap-iconbtn svg.lucide,
.ap-usermenu-btn svg.lucide { width: 19px; height: 19px; }
.ap-usermenu-btn .cx svg.lucide,
.ap-usermenu-btn svg.lucide.cx { width: 14px; height: 14px; }
.ap-search svg.lucide { width: 16px; height: 16px; }
.ap-dropdown svg.lucide { width: 16px; height: 16px; }
/* dashboard content icons */
.stat-ic svg.lucide { width: 16px; height: 16px; }
.feed-ic svg.lucide { width: 15px; height: 15px; }
.member-tier > svg.lucide { width: 18px; height: 18px; color: var(--green); }
.tlink svg.lucide { width: 13px; height: 13px; stroke-width: 2.25; }
.btn2 svg.lucide { width: 16px; height: 16px; }
.refer-copy button svg.lucide { width: 13px; height: 13px; }
.stat-delta svg.lucide { width: 13px; height: 13px; stroke-width: 2.5; }

/* thin, quiet scrollbars everywhere in the app */
.ap-content ::-webkit-scrollbar,
.ap-nav ::-webkit-scrollbar { width: 8px; height: 8px; }
.ap-content ::-webkit-scrollbar-thumb,
.ap-nav ::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }

/* =============================================================== 2. Shell */

.ap-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
}

/* ---- Sidebar (resizable: width comes from --ap-side-width, set by JS; no max cap) ---- */
.ap-side {
    --ap-side-width: 264px;
    --ap-resizer-y: 50%;
    flex: none;
    width: var(--ap-side-width);
    min-width: 200px;
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-soft);
    border-right: 1px solid var(--line);
    transition: width .22s ease;
}
.ap-side.is-resizing { transition: none; }
.ap-side-resizer {
    position: absolute;
    top: 0; right: -4px; bottom: 0;
    width: 8px;
    cursor: ew-resize;
    z-index: 5;
    touch-action: none;
}
/* Pulse line: a fill that starts at the cursor entry point (--ap-resizer-y)
   and expands up + down to cover the edge; opacity caps at 50% on hover,
   75% while dragging, fading out on leave. The fill is a ::before band
   anchored at the entry point whose height animates 0 → full; ::after is
   the full-edge line that fades in once the band arrives. */
.ap-side-resizer::before, .ap-side-resizer::after {
    content: "";
    position: absolute;
    left: 3px;
    width: 2px;
    border-radius: 2px;
    background: var(--green);
    pointer-events: none;
}
.ap-side-resizer::before {
    top: var(--ap-resizer-y);
    height: 0;
    opacity: .5;
    transform: translateY(-50%);
    transition: none;
}
.ap-side-resizer::after {
    top: 0; bottom: 0;
    opacity: 0;
    transition: opacity .25s ease;
}
.ap-side-resizer.is-hot::before {
    top: 0;
    height: 100%;
    transform: none;
    transition: top .45s ease, height .45s ease;
}
.ap-side-resizer.is-hot::after { opacity: .5; transition: opacity .25s ease .3s; }
.ap-side-resizer.active::before { opacity: .75; }
.ap-side-resizer.active::after { opacity: .75; }
.ap-side-resizer.is-leaving::before, .ap-side-resizer.is-leaving::after {
    opacity: 0; transition: opacity .35s ease;
}
@media (prefers-reduced-motion: reduce) {
    .ap-side { transition: none; }
    .ap-side-resizer::before { transition: opacity .15s ease; top: 0; height: 100%; transform: none; }
    .ap-side-resizer::after { transition: opacity .15s ease; }
}

.ap-side-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    height: 64px;
    padding: 0 1.15rem;
    border-bottom: 1px solid var(--line);
    flex: none;
}
.ap-logo {
    width: 30px; height: 30px; flex: none;
    border-radius: 8px;
    background: var(--primary);
    color: var(--primary-ink);
    display: grid; place-items: center;
}
.ap-logo svg { width: 17px; height: 17px; display: block; }
.ap-word {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: .04em;
    color: var(--ink);
}
/* Sidebar collapse toggle (lives in the header) */
.ap-collapse {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-2);
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}
.ap-collapse:hover { color: var(--ink); border-color: var(--line-2); background: var(--raised); }
.ap-collapse svg.lucide { width: 16px; height: 16px; }

.ap-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: .9rem .7rem;
}
.ap-nav-group {
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: .9rem .75rem .4rem;
}
.ap-nav-group:first-child { padding-top: .2rem; }

.ap-nav-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .75rem;
    margin: 1px 0;
    border-radius: 10px;
    color: var(--ink-2);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    position: relative;
    transition: background .15s, color .15s;
}
.ap-nav-item svg.lucide { color: var(--ink-3); transition: color .15s; }
.ap-nav-item:hover { background: var(--surface); color: var(--ink); }
.ap-nav-item:hover svg.lucide { color: var(--ink-2); }
/* Active: neutral pill with a green accent (icon + gutter bar). */
.ap-nav-item.active {
    background: var(--surface-2);
    color: var(--ink);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--line);
}
.ap-nav-item.active svg.lucide { color: var(--green); }
.ap-nav-item.active::before {
    content: "";
    position: absolute;
    left: -.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 18px;
    border-radius: 99px;
    background: var(--green);
    box-shadow: 0 0 8px var(--primary-glow);
}

/* ── Navbar tree (Social parent → child/grandchild nodes) ───────── */
.ap-nav-branch { display: flex; flex-direction: column; }
.ap-nav-row { display: flex; align-items: center; gap: .15rem; }
.ap-nav-row .ap-nav-item { flex: 1 1 auto; min-width: 0; }
.ap-nav-toggle {
    background: none; border: none; cursor: pointer;
    color: var(--ink-3); padding: .3rem; border-radius: 8px;
    display: inline-flex; align-items: center; flex: none;
    transition: background .15s, color .15s;
}
.ap-nav-toggle:hover { background: var(--surface); color: var(--ink); }
.ap-nav-toggle svg.lucide { width: 15px; height: 15px; }
.ap-nav-children {
    display: flex; flex-direction: column;
    margin: 0 0 .25rem .75rem; padding-left: .55rem;
    border-left: 1px solid var(--line);
}
.ap-nav-child { font-size: .83rem; padding: .42rem .6rem; }
.ap-nav-grandchild { font-size: .8rem; padding: .38rem .6rem; }
.ap-nav-dot {
    width: 20px; height: 20px; flex: none; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--line);
    font-size: .66rem; font-weight: 700; color: var(--ink-2);
}
.ap-nav-grandchild > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-nav-empty { display: block; padding: .35rem .6rem; font-size: .76rem; color: var(--ink-3); }

/* Sidebar footer: utility card (storage + refer) then identity. */
.ap-side-foot { flex: none; padding: .7rem; display: flex; flex-direction: column; gap: .55rem; border-top: 1px solid var(--line); }

/* Grouped utility card */
.ap-foot {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: .75rem;
    display: flex;
    flex-direction: column;
    gap: .7rem;
}

/* Refer a friend — soft CTA inside the utility card; arrow nudges on hover. */
.ap-refer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .55rem;
    border-radius: var(--r-sm);
    font-size: .76rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line);
    text-decoration: none;
    transition: background .15s, border-color .15s;
}
.ap-refer:hover { background: var(--raised); border-color: var(--line-2); }
.ap-refer svg.lucide { width: 15px; height: 15px; color: var(--green); }
.ap-refer svg.lucide.ap-refer-arw { width: 14px; height: 14px; color: var(--ink-3); transition: transform .15s; }
.ap-refer:hover svg.lucide.ap-refer-arw { transform: translateX(2px); }

/* Identity row — single-element avatar. */
.ap-user {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .3rem .25rem .1rem;
}
.ap-avatar {
    flex: none;
    width: 34px; height: 34px;
    border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--display); font-weight: 700; font-size: .85rem;
    color: var(--ink);
    background: var(--raised);
    border: none;
    object-fit: cover;
}
img.ap-avatar { background: transparent; }
.ap-user-name { font-size: .82rem; font-weight: 600; color: var(--ink); line-height: 1.15; }
.ap-user-plan { font-size: .68rem; color: var(--ink-3); }

/* ---- Main column ---- */
.ap-main { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

.ap-top {
    flex: none;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem 0 1rem;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 30;
}

.ap-iconbtn {
    flex: none;
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
    position: relative;
    transition: background .15s, color .15s, border-color .15s;
}
.ap-iconbtn:hover { background: var(--surface); color: var(--ink); border-color: var(--line); }
.ap-iconbtn .ap-dot {
    position: absolute; top: 8px; right: 9px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--green); box-shadow: 0 0 0 2px var(--bg);
}
.ap-iconbtn .ap-count {
    position: absolute; top: 3px; right: 3px;
    min-width: 16px; height: 16px; padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 99px; background: var(--down); color: #fff;
    font-family: var(--mono); font-size: .58rem; font-weight: 600;
    box-shadow: 0 0 0 2px var(--bg);
}

.ap-search {
    position: relative;
    display: flex; align-items: center;
    width: 100%; max-width: 400px;
}
.ap-search i { position: absolute; left: .85rem; color: var(--ink-3); font-size: .8rem; }
.ap-search input {
    width: 100%; height: 40px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 0 2.6rem 0 2.3rem;
    color: var(--ink); font-size: .85rem;
    transition: border-color .15s, background .15s;
}
.ap-search input::placeholder { color: var(--ink-3); }
.ap-search input:focus { outline: none; border-color: var(--green-line); background: var(--surface-2); }
.ap-search kbd {
    position: absolute; right: .55rem;
    font-family: var(--mono); font-size: .6rem; color: var(--ink-3);
    background: var(--raised); border: 1px solid var(--line);
    border-radius: 6px; padding: .12rem .38rem; pointer-events: none;
}

.ap-top-actions { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.ap-sep { width: 1px; height: 24px; background: var(--line); margin: 0 .4rem; }

/* topbar user menu — borderless control (matches the icon buttons); only the
   avatar is bordered. */
.ap-usermenu { position: relative; }
.ap-usermenu-btn {
    display: flex; align-items: center; gap: .5rem;
    height: 38px;
    padding: 0 .5rem 0 .34rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.ap-usermenu-btn:hover { background: var(--surface); border-color: var(--line); }
.ap-usermenu-btn .ap-avatar { width: 28px; height: 28px; border-radius: 8px; font-size: .74rem; border: none; background: var(--raised); }
.ap-usermenu-btn .cx { color: var(--ink-3); font-size: .7rem; }
.ap-um-name { font-size: .82rem; font-weight: 600; color: var(--ink); }

.ap-scrim { position: fixed; inset: 0; z-index: 40; }
.ap-dropdown {
    position: absolute; right: 0; top: calc(100% + .5rem);
    z-index: 50;
    width: 210px;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 12px;
    box-shadow: var(--shadow-pop);
    padding: .35rem;
}
.ap-dropdown a, .ap-dropdown button {
    display: flex; align-items: center; gap: .6rem; width: 100%;
    padding: .55rem .6rem; border-radius: 8px;
    color: var(--ink-2); font-size: .84rem; font-weight: 500;
    text-decoration: none; background: transparent; border: none; cursor: pointer; text-align: left;
    transition: background .12s, color .12s;
}
.ap-dropdown a:hover, .ap-dropdown button:hover { background: var(--surface-2); color: var(--ink); }
.ap-dropdown i { width: 1.1rem; text-align: center; color: var(--ink-3); }
.ap-dropdown .ap-dd-sep { height: 1px; background: var(--line); margin: .3rem 0; }
.ap-dropdown .danger:hover { color: var(--down); }

.ap-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1.75rem 2rem 3rem;
}

/* backdrop for mobile drawer */
.ap-backdrop { display: none; }

/* The sidebar owns its own collapse toggle, so the topbar burger is desktop-hidden;
   it stays on mobile as the only way to open the off-canvas drawer. */
.ap-burger { display: none; }

/* ---- Responsive shell ---- */
@media (max-width: 992px) {
    .ap-side {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 70;
        transform: translateX(-100%);
        transition: transform .24s ease;
        box-shadow: var(--shadow-pop);
    }
    .nav-active .ap-side { transform: translateX(0); }
    /* No resizing the off-canvas drawer; cap its width to the viewport. */
    .ap-side-resizer { display: none; }
    .ap-side { width: min(var(--ap-side-width), 85vw); min-width: 0; }
    .nav-active .ap-backdrop {
        display: block;
        position: fixed; inset: 0; z-index: 60;
        background: rgba(0,0,0,.5);
    }
    .ap-content { padding: 1.25rem 1.15rem 3rem; }
    .ap-search { max-width: none; }
    .ap-search kbd { display: none; }
    .ap-burger { display: inline-flex; }
    /* On mobile the drawer slides over content, so no in-header collapse control. */
    .ap-collapse { display: none; }
}
@media (min-width: 993px) {
    /* desktop collapse → slim icon rail (not fully hidden) */
    .nav-active .ap-side { width: 60px; min-width: 0; }
    /* Resizer only exists on the expanded sidebar. */
    .nav-active .ap-side-resizer { display: none; }
    /* Icon rail: no expand toggles, no child subtrees — except the Social
       flyout while open. The parent row centers exactly like its sibling
       nodes; the parent is always a <button> on the rail so its pill
       matches the other icons, selected or not. */
    .nav-active .ap-nav-toggle { display: none; }
    .nav-active .ap-nav-branch:not(.rail-open) .ap-nav-children { display: none; }
    .nav-active .ap-nav-row { justify-content: center; }
    .nav-active .ap-nav-row .ap-nav-item { flex: none; }
    .nav-active .ap-nav-parent { width: 100%; border: none; background: transparent; cursor: pointer; font: inherit; }
    /* Social flyout: icon column pinned under the rail, labels hidden —
       same selection width as the rail, children stacked beneath Social. */
    .nav-active .ap-nav-branch.rail-open { position: relative; }
    .nav-active .ap-nav-branch.rail-open > .ap-nav-children {
        position: absolute; left: 100%; top: 0; z-index: 80;
        margin: 0 0 0 .5rem; padding: .4rem;
        background: var(--surface);
        border: 1px solid var(--line-2);
        border-radius: 14px;
        box-shadow: var(--shadow-pop);
        min-width: 52px;
    }
    .nav-active .ap-nav-branch.rail-open > .ap-nav-children .ap-nav-communities { display: none; }
    .nav-active .ap-side-head { justify-content: center; padding: 0; gap: 0; }
    .nav-active .ap-logo,
    .nav-active .ap-word { display: none; }
    .nav-active .ap-collapse { margin: 0; }
    .nav-active .ap-nav { padding: .9rem .5rem; }
    .nav-active .ap-nav-group { height: 1px; padding: 0; margin: .7rem .5rem; background: var(--line); overflow: hidden; text-indent: -9999px; }
    .nav-active .ap-nav-item { justify-content: center; padding: .62rem 0; }
    .nav-active .ap-nav-item span { display: none; }
    .nav-active .ap-nav-item.active::before { left: -.25rem; }
    .nav-active .ap-side-foot { padding: .5rem; gap: .5rem; }
    .nav-active .ap-foot { background: none; border: none; padding: 0; }
    .nav-active .ap-refer span, .nav-active .ap-refer-arw { display: none; }
    .nav-active .ap-refer { padding: .55rem 0; }

    .nav-active .ap-user { justify-content: center; padding: .3rem 0 .1rem; }
    .nav-active .ap-user-txt { display: none; }
}
@media (max-width: 560px) {
    .ap-um-name, .ap-usermenu-btn .cx { display: none; }
    .ap-search { display: none; }
}

/* =========================================================== 3. Primitives */

.card2 {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    padding: var(--pad-panel);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; }
.panel-title { font-family: var(--display); font-size: 1rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink); margin: 0; }
.panel-sub { font-size: .78rem; color: var(--ink-3); margin: .2rem 0 0; }

.tlink { color: var(--ink-2); font-size: .8rem; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; transition: color .15s; white-space: nowrap; }
.tlink:hover { color: var(--ink); }
.tlink--btn { border: none; background: none; cursor: pointer; font-family: var(--font); }
.tlink i { font-size: .68rem; }

.btn2 {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    height: 38px; padding: 0 1.05rem;
    border-radius: 10px; font-size: .82rem; font-weight: 600;
    border: 1px solid transparent; cursor: pointer; text-decoration: none;
    transition: filter .15s, background .15s, border-color .15s, color .15s;
}
.btn2--primary { background: var(--primary); color: var(--primary-ink); }
.btn2--primary:hover { background: var(--primary-strong); }
.btn2--ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn2--ghost:hover { border-color: var(--line-2); background: var(--surface-2); }
.btn2--sm { height: 32px; padding: 0 .8rem; font-size: .76rem; }

.seg2 { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg2 button { border: none; background: transparent; color: var(--ink-2); font-size: .76rem; font-weight: 600; padding: .35rem .7rem; border-radius: 7px; cursor: pointer; transition: background .12s, color .12s; }
.seg2 button.active { background: var(--raised); color: var(--ink); }
.seg2--full { display: flex; width: 100%; }
.seg2--full button { flex: 1; }

.chip2 { display: inline-flex; align-items: center; gap: .3rem; font-size: .68rem; font-weight: 600; padding: .2rem .5rem; border-radius: 7px; letter-spacing: .02em; }
.chip2--green { color: var(--green); background: var(--green-soft); border: 1px solid var(--green-line); }
.chip2--neutral { color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); }
.chip2--mono  { font-family: var(--mono); }

/* =========================================================== 4. Dashboard */

.dsh { max-width: 1440px; margin: 0 auto; width: 100%; }

.dsh-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.dsh-hello { font-family: var(--display); font-size: 1.7rem; font-weight: 600; letter-spacing: -.02em; color: var(--ink); margin: 0; }
.dsh-sub { color: var(--ink-2); font-size: .9rem; margin: .35rem 0 0; }
.dsh-head-actions { display: flex; align-items: center; gap: .6rem; }

/* quick actions */
.dsh-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 1100px) { .dsh-actions { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .dsh-actions { grid-template-columns: 1fr; } }
.dsh-action {
    display: flex; align-items: center; gap: .8rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--shadow-1); padding: .95rem 1.05rem; text-decoration: none;
    transition: border-color .18s, transform .18s;
}
.dsh-action:hover { border-color: var(--line-2); transform: translateY(-2px); }
.dsh-action-ic { width: 38px; height: 38px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--raised); color: var(--ink-2); }
.dsh-action-ic svg.lucide { width: 18px; height: 18px; }
.dsh-action-tx { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.dsh-action-tx b { font-size: .86rem; font-weight: 600; color: var(--ink); }
.dsh-action-tx span { font-size: .74rem; color: var(--ink-3); }

/* stat cards */
.dsh-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 1100px) { .dsh-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .dsh-stats { grid-template-columns: 1fr; } }

.stat {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    padding: 1.15rem 1.2rem;
    overflow: hidden;
    transition: border-color .18s, transform .18s;
}
.stat:hover { border-color: var(--line-2); transform: translateY(-2px); }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.stat-label { font-size: .74rem; font-weight: 500; color: var(--ink-2); }
.stat-ic { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--raised); color: var(--ink-2); font-size: .8rem; }
.stat-value { font-family: var(--display); font-size: 1.85rem; font-weight: 600; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.stat-delta { display: inline-flex; align-items: center; gap: .35rem; margin-top: .65rem; font-size: .76rem; font-weight: 600; color: var(--ink-3); }
.stat-delta.up { color: var(--ink-2); }
.stat-delta.up svg.lucide { color: var(--green); }
.stat-delta i { font-size: .62rem; }

.stat--feature .stat-ic { background: var(--green-soft); color: var(--green); }
.stat--link { text-decoration: none; color: inherit; display: block; cursor: pointer; }

/* from-your-communities */
.dsh-communities { margin-bottom: 0; }
.dsh-comm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .9rem; }
.dsh-comm-list li { min-width: 0; }
.dsh-comm-card { flex-direction: row; gap: 1rem; align-items: stretch; }
.dsh-comm-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .55rem; }
.dsh-comm-name { font-size: .8rem; font-weight: 700; }
.dsh-comm-body {
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis;
}
.dsh-comm-media { flex: none; width: 168px; align-self: stretch; }
.dsh-comm-thumb { width: 100%; height: 100%; min-height: 118px; max-height: 190px; object-fit: cover; display: block; border-radius: 8px; }
.dsh-comm-slideshow { height: 100%; min-height: 118px; }
.dsh-comm-slideshow .dsh-comm-thumb { position: absolute; inset: 0; }
.dsh-comm-media .soc-media { border-radius: 8px; }
.dsh-comm-media .soc-media-video { height: 100%; }
.dsh-comm-media .soc-media-video video { height: 100%; object-fit: cover; }
.dsh-comm-card .soc-eng span { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink-3); font-size: .8rem; }
.dsh-comm-card .soc-eng span svg.lucide { width: 15px; height: 15px; }
.dsh-comm-card .soc-eng span.liked { color: var(--down); }
@media (max-width: 640px) {
    .dsh-comm-card { flex-direction: column; }
    .dsh-comm-media { width: 100%; }
    .dsh-comm-thumb { max-height: 220px; }
}

/* main grid */
.dsh-grid { display: grid; grid-template-columns: minmax(0,1fr) 336px; gap: 1.15rem; align-items: start; }
@media (max-width: 1180px) { .dsh-grid { grid-template-columns: 1fr; } }
.dsh-col { display: flex; flex-direction: column; gap: 1.15rem; min-width: 0; }
.dsh-rail { display: flex; flex-direction: column; gap: 1.15rem; }

/* chart */
.dsh-figure { display: flex; align-items: baseline; gap: .5rem; margin-bottom: 1.1rem; }
.dsh-figure b { font-family: var(--display); font-size: 1.55rem; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.dsh-figure span { font-size: .8rem; color: var(--ink-2); }
.bars { display: flex; align-items: flex-end; gap: .5rem; height: 168px; padding-top: .5rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .55rem; height: 100%; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar { width: 100%; max-width: 30px; border-radius: 7px 7px 3px 3px; min-height: 6px; background: linear-gradient(180deg, rgba(255,255,255,.15), rgba(255,255,255,.035)); transition: filter .15s, height .5s cubic-bezier(.2,.7,.2,1); }
.bar-col:hover .bar { filter: brightness(1.25); }
.bar.peak { background: linear-gradient(180deg, var(--green), var(--primary-line)); }
.bar-label { font-family: var(--mono); font-size: .64rem; color: var(--ink-3); letter-spacing: .04em; }

/* nft showcase */
.nft-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .85rem; }
@media (max-width: 620px) { .nft-grid { grid-template-columns: repeat(2, 1fr); } }
.nft { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); overflow: hidden; transition: border-color .18s, transform .18s; }
.nft:hover { border-color: var(--line-2); transform: translateY(-3px); }
.nft-art { aspect-ratio: 16 / 11; position: relative; display: flex; align-items: flex-start; justify-content: flex-end; padding: .5rem; }
.nft-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.16), transparent 45%); mix-blend-mode: overlay; }
.nft-badge { position: relative; z-index: 1; font-size: .58rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .18rem .42rem; border-radius: 6px; background: rgba(0,0,0,.5); color: #fff; backdrop-filter: blur(4px); }
.nft-body { padding: .65rem .7rem .75rem; }
.nft-title { font-size: .8rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nft-meta { display: flex; align-items: center; gap: .4rem; margin-top: .3rem; font-size: .7rem; color: var(--ink-3); }
.nft-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.nft-dot.on { background: var(--green); } .nft-dot.off { background: var(--ink-3); }

/* storage */
.stg-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--raised); margin-bottom: 1rem; }
.stg-seg { height: 100%; }
.stg-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.stg-legend li { display: flex; align-items: center; gap: .55rem; font-size: .82rem; color: var(--ink-2); }
.stg-legend .d { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.stg-legend .v { margin-left: auto; font-family: var(--mono); font-size: .78rem; color: var(--ink); }
.stg-free { margin-top: .85rem; padding-top: .8rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: .8rem; color: var(--ink-2); }
.stg-free b { font-family: var(--mono); color: var(--ink); font-weight: 500; }

/* membership card */
.member { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: var(--pad-panel); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); }
.member-tier { display: flex; align-items: center; gap: .5rem; font-family: var(--display); font-weight: 600; color: var(--ink); }
.member-tier > i { color: var(--green); }
.member-badge { margin-left: auto; font-family: var(--mono); font-size: .58rem; font-weight: 600; letter-spacing: .08em; color: var(--green); border: 1px solid var(--green-line); border-radius: 6px; padding: .16rem .4rem; }
.member-sub { font-size: .78rem; color: var(--ink-2); margin: .55rem 0 1rem; line-height: 1.5; }
.member-row { display: flex; justify-content: space-between; font-size: .78rem; color: var(--ink-2); padding: .3rem 0; }
.member-row b { color: var(--ink); font-weight: 600; }

/* referral link card — brand-accented so the link is the focus */
.refer-card { background: linear-gradient(160deg, var(--primary-tint), transparent 62%); border-color: var(--green-line); }
.refer-card .panel-title { display: inline-flex; align-items: center; gap: .45rem; }
.refer-card .panel-title svg.lucide { width: 16px; height: 16px; color: var(--green); }
.refer-count { font-family: var(--mono); font-size: .58rem; font-weight: 600; letter-spacing: .08em; color: var(--green); border: 1px solid var(--green-line); border-radius: 6px; padding: .16rem .4rem; }
.refer-lead { font-size: .8rem; color: var(--ink-2); line-height: 1.5; margin: 0 0 .2rem; }
.refer-copy { display: flex; align-items: center; gap: .5rem; margin-top: .8rem; background: var(--bg); border: 1px solid var(--green-line); border-radius: 10px; padding: .5rem .5rem .5rem .75rem; }
.refer-copy code { flex: 1; font-family: var(--mono); font-size: .78rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.refer-copy button { flex: none; cursor: pointer; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); font-size: .7rem; font-weight: 600; border-radius: 7px; padding: .34rem .55rem; transition: color .15s, border-color .15s, background .15s; }
.refer-copy button:hover { color: var(--ink); border-color: var(--line-2); background: var(--raised); }

/* ---- Blazor error UI: hidden until an actual circuit error occurs -------- */
#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1000;
    padding: .7rem 1.1rem;
    background: var(--danger-well);
    border-top: 1px solid var(--down);
    color: var(--ink);
    font-size: .82rem;
    box-shadow: 0 -10px 30px -12px rgba(0,0,0,.6);
}
#blazor-error-ui .reload { color: var(--green); margin-left: .4rem; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; color: var(--ink-2); }

/* activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: flex-start; gap: .7rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: none; padding-bottom: 0; }
.feed-ic { flex: none; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--raised); color: var(--ink-2); font-size: .76rem; }
.feed-msg { font-size: .82rem; color: var(--ink); line-height: 1.35; }
.feed-time { font-size: .68rem; color: var(--ink-3); margin-top: .12rem; font-family: var(--mono); }

/* =================================================== 8. Shell UX additions */

/* topbar search is a regular combobox: input with a results dropdown beneath it */
.ap-search-cmb { position: relative; display: flex; align-items: center; width: 100%; max-width: 400px; }
.ap-search-cmb-ic { position: absolute; left: .85rem; display: inline-flex; color: var(--ink-3); pointer-events: none; }
.ap-search-cmb-ic svg.lucide { width: 16px; height: 16px; }
.ap-search-cmb input {
    width: 100%; height: 40px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 0 2.6rem 0 2.3rem;
    color: var(--ink); font-size: .85rem; font-family: var(--font);
    transition: border-color .15s, background .15s;
}
.ap-search-cmb input::placeholder { color: var(--ink-3); }
.ap-search-cmb input:focus { outline: none; border-color: var(--green-line); background: var(--surface-2); }
.ap-search-cmb-go {
    position: absolute; right: .45rem;
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 8px;
    color: var(--ink-3); pointer-events: none;
}
.ap-search-cmb-go svg.lucide { width: 16px; height: 16px; }
.cmdk-drop {
    position: absolute; top: calc(100% + .5rem); left: 0; right: 0; z-index: 100;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 14px;
    box-shadow: var(--shadow-pop);
    padding: .4rem;
    max-height: 52vh; overflow-y: auto;
}
@media (max-width: 560px) { .ap-search-cmb { max-width: none; } }

/* topbar popovers (notifications / messages) */
.ap-pop { position: relative; }
.ap-panel {
    position: absolute; right: 0; top: calc(100% + .5rem);
    z-index: 50; width: 320px;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 14px;
    box-shadow: var(--shadow-pop);
    overflow: hidden;
}
.ap-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .8rem 1rem; border-bottom: 1px solid var(--line);
    font-family: var(--display); font-weight: 600; font-size: .88rem; color: var(--ink);
}
.ap-panel-act { border: none; background: transparent; color: var(--green); font-size: .74rem; font-weight: 600; cursor: pointer; padding: 0; }
.ap-panel-acts { display: inline-flex; align-items: center; gap: .7rem; }
.ap-panel-body { max-height: 340px; overflow-y: auto; padding: .3rem; }
.ap-panel-row { display: flex; gap: .65rem; padding: .6rem .65rem; border-radius: 10px; transition: background .12s; cursor: pointer; text-decoration: none; color: inherit; }
.ap-panel-row:hover { background: var(--surface-2); }
.ap-panel-ic { flex: none; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--raised); color: var(--ink-2); }
.ap-panel-ic svg.lucide { width: 15px; height: 15px; }
.ap-panel-txt { font-size: .82rem; color: var(--ink); line-height: 1.35; }
.ap-panel-time { font-size: .68rem; color: var(--ink-3); font-family: var(--mono); margin-top: .1rem; }
.ap-panel-empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 2rem 1rem; color: var(--ink-3); font-size: .82rem; }
.ap-panel-empty svg.lucide { width: 22px; height: 22px; color: var(--green); }
/* Notification rows that are about a person show that person instead of an icon. */
.ap-panel-av { overflow: hidden; object-fit: cover; background: var(--surface-2); color: var(--ink); font-family: var(--display); font-weight: 600; font-size: .78rem; }
.ap-panel-main { flex: 1; min-width: 0; }
.ap-panel-acts-row { display: flex; gap: .4rem; margin-top: .4rem; }
/* Row-local result line after Accept / Decline. Toasts are unavailable in the top bar
   (it renders outside BootstrapBlazorRoot), so the row carries its own feedback. */
.ap-panel-status { font-size: .74rem; color: var(--green); margin-top: .3rem; }
.ap-panel-foot { display: block; text-align: center; padding: .7rem; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .78rem; font-weight: 600; text-decoration: none; }
.ap-panel-foot:hover { color: var(--green); }
.ap-msg-av { flex: none; width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--raised); color: var(--ink); font-family: var(--display); font-weight: 600; font-size: .74rem; }
.ap-msg-top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.ap-msg-prev { font-size: .76rem; color: var(--ink-2); margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
@media (max-width: 560px) { .ap-panel { position: fixed; left: .75rem; right: .75rem; width: auto; top: 66px; } }

/* ---- Notifications page -------------------------------------------------- */
.notif-list { display: flex; flex-direction: column; gap: 1px; }
.notif-row {
    display: flex; align-items: flex-start; gap: .75rem;
    padding: .85rem 1rem; cursor: pointer;
    border-radius: 10px; transition: background .12s;
}
.notif-row:hover { background: var(--surface-2); }
.notif-row--unread { background: var(--surface-2); }
.notif-ic {
    flex: none; width: 34px; height: 34px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--raised); color: var(--ink-2);
}
.notif-ic svg.lucide { width: 16px; height: 16px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: .84rem; font-weight: 600; color: var(--ink); }
.notif-msg { font-size: .78rem; color: var(--ink-2); margin-top: .15rem; line-height: 1.4; }
.notif-time { font-size: .68rem; color: var(--ink-3); font-family: var(--mono); margin-top: .25rem; }
.notif-del {
    flex: none; width: 28px; height: 28px; border: none; background: transparent;
    color: var(--ink-3); border-radius: 7px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .12s, color .12s;
}
.notif-del:hover { background: var(--surface-2); color: var(--red, #e5484d); }
.notif-del svg.lucide { width: 14px; height: 14px; }

/* ---- Search results dropdown (CommandPalette combobox; item styles shared below) ---- */
.cmdk-group { font-size: .64rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding: .7rem .7rem .3rem; }
.cmdk-item {
    display: flex; align-items: center; gap: .7rem; width: 100%;
    padding: .6rem .7rem; border-radius: 10px;
    border: none; background: transparent; cursor: pointer; text-align: left;
    color: var(--ink-2);
}
.cmdk-item.is-sel { background: var(--green-soft); color: var(--green); }
.cmdk-ic { flex: none; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--raised); color: inherit; }
.cmdk-item.is-sel .cmdk-ic { background: var(--primary-tint); }
.cmdk-ic svg.lucide { width: 16px; height: 16px; }
.cmdk-label { flex: 1; font-size: .88rem; font-weight: 500; color: var(--ink); }
.cmdk-item.is-sel .cmdk-label { color: var(--green); }
.cmdk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.cmdk-sub { font-size: .72rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-empty { padding: 2.2rem 1rem; text-align: center; color: var(--ink-3); font-size: .85rem; }
.cmdk-loading { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: 1.1rem; color: var(--ink-3); font-size: .82rem; }
.cmdk-spinner { width: 15px; height: 15px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--green); animation: cmdk-spin .7s linear infinite; }
@keyframes cmdk-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cmdk-spinner { animation: none; } }

/* ---- Skeleton loaders --------------------------------------------------- */
.skl { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; }
.skl::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); animation: skl 1.35s ease infinite; }
@keyframes skl { 100% { transform: translateX(100%); } }
.skl-line { height: 12px; border-radius: 6px; }
.skl-sm { height: 10px; width: 40%; }
.skl-lg { height: 26px; width: 55%; }
@media (prefers-reduced-motion: reduce) { .skl::after { animation: none; } }

/* ---- Empty states ------------------------------------------------------- */
.empty { text-align: center; padding: var(--space-7) var(--space-5); }
.empty--tight { padding: var(--space-6) var(--space-4); }
.empty-ic { width: 46px; height: 46px; margin: 0 auto .85rem; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.empty-ic svg.lucide { width: 22px; height: 22px; }
.empty-title { font-family: var(--display); font-weight: 600; color: var(--ink); font-size: .95rem; }
.empty-sub { font-size: .82rem; color: var(--ink-2); margin: .3rem 0 1rem; }

/* =============================================== 9. Generic page primitives */

/* Page sections stack with a consistent vertical rhythm; the flex gap owns
   spacing rather than per-block margins. */
.pg { max-width: 1440px; display: flex; flex-direction: column; gap: 1.15rem; margin: 0 auto; padding: 0 1.25rem; width: 100%; }
.ap-content:has(.pg-grid) { display: flex; flex-direction: column; overflow-y: auto; padding: 0; }
.ap-content:has(.pg-grid) > .pg { flex: 1; min-height: 0; overflow: hidden; }
.ap-content:has(> .pg):not(:has(.pg-grid)) { padding: 0; }
html:has(.pg-grid) { overflow: hidden; }
.pg-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; flex: none; padding: 1.75rem 0 1.75rem; }
/* Inside the flex page the gap owns spacing, so reset block margins. */
.pg > .pg-head, .pg > .dsh-stats { margin-bottom: 0; }
.pg-title { font-family: var(--display); font-size: 1.55rem; font-weight: 600; letter-spacing: -.02em; color: var(--ink); margin: 0; }
/* branded page title (Social): VCAP wordmark + green-gradient accent */
.sc-title span { background: linear-gradient(92deg, var(--green), #7bffa6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.pg-sub { color: var(--ink-2); font-size: .9rem; margin: .3rem 0 0; }
.pg-head-actions { display: flex; align-items: center; gap: .6rem; }
.pg-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 1.15rem; flex: 1 1 auto; min-height: 0; overflow: hidden; }
/* Column scrolling is load-bearing, not decorative: html/.ap-content/.pg all
   go overflow:hidden above this, so without a scroll container in the chain,
   overflow just gets clipped and flex children compress to force-fit,
   squashing the gap between stacked panels (e.g. Settings: Profile +
   Appearance + Security) down to nothing. */
.pg-col { display: flex; flex-direction: column; gap: 1.15rem; min-width: 0; flex: 1; min-height: 0; }
/* Independent scrolling for content columns without inner .soc-feed-scroll:
   the feed page scrolls its inner .soc-feed-scroll; other pages scroll the
   column itself, so only one scrollbar ever appears. */
.pg-col:not(:has(.soc-feed-scroll)) { overflow-y: auto; min-height: 0; padding-bottom: 1.5rem; scrollbar-width: none; -ms-overflow-style: none; }
.pg-col:not(:has(.soc-feed-scroll))::-webkit-scrollbar { display: none; }
.pg-rail { display: flex; flex-direction: column; gap: 1.15rem; overflow-y: auto; min-height: 0; scrollbar-width: none; -ms-overflow-style: none; margin-top: 25px; }
/* Direct-child buttons keep their height: as flex items they would otherwise
   shrink once the rail content exceeds the viewport instead of scrolling. */
.pg-rail > .btn2 { flex: none; }
.pg-rail::-webkit-scrollbar { display: none; }
.soc-mobile-toggle { display: inline-flex; }
.soc-mobile-rail { display: flex; flex-direction: column; gap: 1.15rem; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.soc-mobile-rail::-webkit-scrollbar { display: none; }
@media (min-width: 1181px) {
    .soc-mobile-toggle { display: none; }
    .soc-mobile-rail { display: none; }
}
@media (max-width: 1180px) {
    .pg-grid { grid-template-columns: 1fr; }
    .pg-rail { display: none; }
    .soc-mobile-rail > .pg-rail { display: flex; }
}

.subhead { font-size: .78rem; font-weight: 600; color: var(--ink-2); margin: 0 0 .75rem; }
.subhead.mt { margin-top: 1.4rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.divider { height: 1px; background: var(--line); border: none; margin: 1.1rem 0; }

/* forms */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field-label { font-size: .76rem; font-weight: 500; color: var(--ink-2); }
.input, .textarea, .select:not(.dropdown) {
    width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
    padding: .6rem .75rem; color: var(--ink); font-size: .86rem; font-family: var(--font);
    transition: border-color .15s, background .15s;
}
.input:focus, .textarea:focus, .select:focus:not(.dropdown) { outline: none; border-color: var(--green-line); background: var(--surface); }
/* Native selects get a consistent custom chevron with room to breathe.
   :not(.dropdown) excludes BootstrapBlazor's <Select> component, which also
   renders its wrapper div with class "select" (its own dropdown widget, not
   a native <select>) — without the guard this rule stacks a second chevron
   and box on top of the component's own. */
.select:not(.dropdown) {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    padding-right: 2.1rem; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235e6776' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .7rem center;
    background-size: 15px;
}
.select:not(.dropdown):hover { border-color: var(--line-2); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.textarea { resize: vertical; min-height: 66px; }

/* BootstrapBlazor <Select> dropdown (e.g. Language under Appearance) — a
   compact box, not full-width, since it sits under a single subhead rather
   than spanning a form row. Same collision as the AI panels' model
   selects: the component renders <div class="select dropdown lang-select">
   with an inner <input class="form-select ... lang-select">, so the plain
   .select:not(.dropdown) rule above only reaches the inner input. */
.lang-select { width: 220px; max-width: 100%; position: relative; }
.lang-select .dropdown-toggle { position: relative; display: block; width: 100%; }
.lang-select input.form-select {
    width: 100%; box-sizing: border-box; background: var(--bg); border: 1px solid var(--line);
    border-radius: 10px; padding: .6rem 2.1rem .6rem .75rem; color: var(--ink); font-size: .86rem;
    cursor: pointer;
}
.lang-select input.form-select:focus { outline: none; border-color: var(--green-line); background: var(--surface); }
.lang-select:hover input.form-select { border-color: var(--line-2); }
.lang-select .form-select-append {
    position: absolute; right: .7rem; top: 50%; transform: translateY(-50%);
    pointer-events: none; color: var(--ink-3); display: inline-flex; align-items: center;
}
.lang-select .form-select-append i { font-size: .65rem; }
.lang-select .dropdown-menu {
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: var(--shadow-1); padding: .35rem; min-width: 100%;
}
.lang-select .dropdown-menu-body { display: flex; flex-direction: column; gap: .1rem; }
.lang-select .dropdown-item {
    border-radius: 7px; padding: .45rem .65rem; font-size: .84rem; line-height: 1.2;
    color: var(--ink-2); background: transparent; transition: background .12s, color .12s;
}
.lang-select .dropdown-item:hover { background: var(--raised); color: var(--ink) !important; }
.lang-select .dropdown-item.active { background: var(--green-soft); color: var(--ink) !important; font-weight: 600; }
.lang-select .dropdown-menu-arrow { display: none; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .field-grid { grid-template-columns: 1fr; } }

/* toggle switch */
.sw { position: relative; width: 40px; height: 22px; border-radius: 99px; background: var(--raised); border: 1px solid var(--line-2); cursor: pointer; transition: background .18s, border-color .18s; flex: none; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-2); transition: transform .18s, background .18s; }
.sw.on { background: var(--green-soft); border-color: var(--green-line); }
.sw.on::after { transform: translateX(18px); background: var(--green); }

/* buttons: danger variant + icon-only */
.btn2--danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.btn2--danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn2--full { width: 100%; }
.btn2:disabled, .btn2[disabled] { opacity: .45; cursor: not-allowed; }
.btn2:disabled:hover, .btn2[disabled]:hover { filter: none; }

/* summary rows (right-rail key/value) */
.summary-row { display: flex; align-items: center; justify-content: space-between; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .84rem; }
.summary-row:last-child { border-bottom: none; }
.summary-row .k { color: var(--ink-2); }
.summary-v { color: var(--ink); }
.chip-row { display: flex; gap: var(--space-2); }

/* big avatar */
.avatar-lg { width: 60px; height: 60px; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 1.4rem; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); flex: none; object-fit: cover; }
img.avatar-lg { background: transparent; }
.profile-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.35rem; }
.profile-name { font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--ink); }

/* theme picker */
.theme-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .7rem; }
@media (max-width: 620px) { .theme-grid { grid-template-columns: 1fr 1fr; } }
.theme-card { position: relative; display: flex; flex-direction: column; gap: .6rem; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; text-align: left; transition: border-color .15s; }
.theme-card:hover { border-color: var(--line-2); }
.theme-card.sel { border-color: var(--green); }
.theme-sw { display: flex; gap: 5px; }
.theme-sw span { width: 16px; height: 16px; border-radius: 5px; }
.theme-name { font-size: .8rem; color: var(--ink); font-weight: 500; }
.theme-card .chk { position: absolute; top: .55rem; right: .6rem; color: var(--green); }
.theme-card .chk svg.lucide { width: 15px; height: 15px; }

/* preference rows */
.pref-row { display: flex; align-items: center; gap: .85rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.pref-row:last-child { border-bottom: none; }
.pref-ic { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--raised); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; }
.pref-ic svg.lucide { width: 16px; height: 16px; }
.pref-main { flex: 1; }
.pref-label { font-size: .86rem; color: var(--ink); font-weight: 500; }
.pref-desc { font-size: .76rem; color: var(--ink-3); margin-top: .1rem; }

/* security cards */
.sec-card { display: flex; align-items: center; gap: .85rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.sec-ic { flex: none; width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--raised); color: var(--ink-2); }
.sec-ic svg.lucide { width: 17px; height: 17px; }
.sec-ic.red { background: rgba(255,92,122,.12); color: var(--down); }
.sec-ic.green { background: var(--raised); color: var(--ink-2); }
.sec-ic.amber { background: rgba(255,207,92,.12); color: var(--amber); }
.sec-main { flex: 1; }
.sec-title { font-size: .88rem; color: var(--ink); font-weight: 600; }
.sec-desc { font-size: .78rem; color: var(--ink-2); margin-top: .1rem; }
.sec-status { font-size: .72rem; color: var(--ink-3); font-family: var(--mono); margin-top: .25rem; }

/* session rows */
.session-row { display: flex; align-items: center; gap: .75rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.session-row:last-child { border-bottom: none; }
.session-ic { flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--raised); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; }
.session-ic svg.lucide { width: 15px; height: 15px; }
.session-main { flex: 1; }
.session-device { font-size: .84rem; color: var(--ink); font-weight: 500; display: flex; align-items: center; gap: .5rem; }
.session-meta { font-size: .72rem; color: var(--ink-3); margin-top: .12rem; font-family: var(--mono); }

/* ==================================================== 10. Modal primitives */
.mdl-overlay { position: fixed; inset: 0; z-index: 150; background: var(--modal-scrim); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 1rem; overflow-y: auto; }
.mdl { width: 100%; max-width: 440px; max-height: calc(100vh - 2rem); display: flex; flex-direction: column; margin: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-modal); overflow: hidden; }
.mdl--wide { max-width: 560px; }
.mdl-head, .mdl-foot { flex: none; }
.mdl-body { overflow-y: auto; min-height: 0; }
.mdl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: var(--modal-pad); border-bottom: 1px solid var(--line); }
.mdl-title { font-family: var(--display); font-weight: 600; font-size: 1.02rem; color: var(--ink); margin: 0; }
.mdl-sub { font-size: .78rem; color: var(--ink-3); margin: .25rem 0 0; }
.mdl-x { flex: none; border: none; background: transparent; color: var(--ink-2); cursor: pointer; width: 32px; height: 32px; margin: -.2rem -.3rem 0 0; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.mdl-x:hover { background: var(--surface-2); color: var(--ink); }
.mdl-x svg.lucide { width: 18px; height: 18px; }
.mdl-body { padding: var(--modal-pad); display: flex; flex-direction: column; gap: 1rem; }
.mdl-foot { display: flex; gap: .6rem; padding: var(--modal-pad); border-top: 1px solid var(--line); }
/* Footer buttons fill the width: one spans, two split evenly — matches the dialogs. */
.mdl-foot .btn2 { flex: 1; }

/* ==================================== 11. Option buttons + range (reusable) */
.opt { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: .5rem .6rem; color: var(--ink-2); font-size: .8rem; font-weight: 600; cursor: pointer; text-align: center; font-family: var(--font); transition: border-color .15s, color .15s, background .15s; }
.opt:hover { border-color: var(--line-2); color: var(--ink); }
.opt.on { border-color: var(--green-line); color: var(--green); background: var(--green-soft); }
.opt.mono { font-family: var(--mono); }
.range { width: 100%; accent-color: var(--green); cursor: pointer; height: 4px; }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--green); animation: spin .8s linear infinite; display: inline-block; }
.spinner.sm { width: 15px; height: 15px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Brand loader ---------------------------------------------------------
   The VCAP mark as an indeterminate loading indicator: the glyph sits at a dim
   tint of the accent and a brighter band sweeps across it, left to right, on a
   1.5s loop.

   Built as a CSS mask over a flat tint, with the bright band a single absolutely
   positioned ::after moved by transform — so the whole animation runs on the
   compositor and never repaints. The mask clips the pseudo-element along with
   the rest of the subtree, which is what keeps the band inside the glyph.
   Colour comes from --green, so the loader follows whichever accent theme the
   user is on rather than pinning the one brand green.

   Sizes: sm (inline, beside text), md (default), lg (page / full-panel waits).
   -------------------------------------------------------------------------- */
.vcap-loader { display: inline-flex; flex-direction: column; align-items: center; gap: .85rem; --vl-size: 40px; }
.vcap-loader--sm { --vl-size: 17px; gap: .5rem; }
.vcap-loader--lg { --vl-size: 62px; gap: 1rem; }

/* Row form: mark and label side by side, for inline "loading more" strips. */
.vcap-loader--row { flex-direction: row; }

.vcap-loader__mark {
    position: relative;
    overflow: hidden;
    width: var(--vl-size);
    height: var(--vl-size);
    flex: none;
    background: color-mix(in srgb, var(--green) 34%, transparent);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='46 46 134 134'%3E%3Cpath d='M158.88 47.0076C160.427 47.1591 164.328 47.0547 166.023 47.0545L179.658 47.0563C175.824 55.1142 170.759 64.2057 166.592 72.2379C163.101 79.4826 158.967 86.534 155.449 93.7901C150.666 103.658 145.688 113.403 140.76 123.198L119.149 166.104C116.933 170.485 115.147 174.551 112.811 179C106.642 165.842 99.3561 152.094 92.8075 139.051C84.0654 121.218 75.1726 103.459 66.13 85.7761L53.9982 62.726C51.5075 58.065 48.0121 51.8562 46 47.0951C52.9557 46.9942 60.0359 47.2001 66.9715 47.0277C70.5327 55.023 75.4187 64.2297 79.3438 72.1668L104.595 123.69C107.207 129.148 110.453 135.239 112.812 140.72C113.643 138.854 114.705 136.999 115.521 135.154C119.685 125.744 124.544 116.64 129.05 107.397C135.259 94.694 141.544 82.0277 147.903 69.3987C151.579 61.974 155.102 54.3949 158.88 47.0076Z' fill='%23fff'/%3E%3Cpath d='M82.1089 47.1283C86.7898 46.89 92.9991 47.0582 97.7751 47.0504C105.594 62.8471 114.323 78.6514 121.635 94.6418C121.159 96.176 117.525 103.111 116.511 105.372C115.793 107.007 114.929 108.742 114.159 110.366C112.37 106.587 110.139 102.457 108.233 98.6724L90.1595 63.4638C89.0959 61.3981 82.13 48.6079 82.1089 47.1283Z' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='46 46 134 134'%3E%3Cpath d='M158.88 47.0076C160.427 47.1591 164.328 47.0547 166.023 47.0545L179.658 47.0563C175.824 55.1142 170.759 64.2057 166.592 72.2379C163.101 79.4826 158.967 86.534 155.449 93.7901C150.666 103.658 145.688 113.403 140.76 123.198L119.149 166.104C116.933 170.485 115.147 174.551 112.811 179C106.642 165.842 99.3561 152.094 92.8075 139.051C84.0654 121.218 75.1726 103.459 66.13 85.7761L53.9982 62.726C51.5075 58.065 48.0121 51.8562 46 47.0951C52.9557 46.9942 60.0359 47.2001 66.9715 47.0277C70.5327 55.023 75.4187 64.2297 79.3438 72.1668L104.595 123.69C107.207 129.148 110.453 135.239 112.812 140.72C113.643 138.854 114.705 136.999 115.521 135.154C119.685 125.744 124.544 116.64 129.05 107.397C135.259 94.694 141.544 82.0277 147.903 69.3987C151.579 61.974 155.102 54.3949 158.88 47.0076Z' fill='%23fff'/%3E%3Cpath d='M82.1089 47.1283C86.7898 46.89 92.9991 47.0582 97.7751 47.0504C105.594 62.8471 114.323 78.6514 121.635 94.6418C121.159 96.176 117.525 103.111 116.511 105.372C115.793 107.007 114.929 108.742 114.159 110.366C112.37 106.587 110.139 102.457 108.233 98.6724L90.1595 63.4638C89.0959 61.3981 82.13 48.6079 82.1089 47.1283Z' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat;
}

.vcap-loader__mark::after {
    content: "";
    position: absolute;
    top: -25%;
    bottom: -25%;
    left: 0;
    width: 180%;
    background: linear-gradient(102deg,
        transparent 0 18%,
        var(--green) 42% 58%,
        transparent 82% 100%);
    will-change: transform;
    animation: vcap-sweep 1.5s linear infinite;
}

@keyframes vcap-sweep {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

/* Reduced motion: hold the glyph at full accent instead of sweeping. */
@media (prefers-reduced-motion: reduce) {
    .vcap-loader__mark { background: var(--green); }
    .vcap-loader__mark::after { display: none; }
}

.vcap-loader__label { color: var(--ink-2); font-size: .82rem; letter-spacing: .01em; margin: 0; }
.vcap-loader--sm .vcap-loader__label { font-size: .78rem; }

/* Fills whatever panel or drop zone it is dropped into. */
.vcap-loader-block { display: flex; align-items: center; justify-content: center; padding: 3.25rem 1rem; }

/* Boot splash — covers the blank window between first byte and first render
   (interactive components run with prerender off). Torn down by
   js/boot-splash.js; the fade duration here and FADE_MS there must agree. */
#vcap-boot {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg, #08090c);
    transition: opacity .4s ease;
}
#vcap-boot.is-done { opacity: 0; pointer-events: none; }

/* ===================================================== 12. AI Image Gen */
.ig2-grid { display: grid; grid-template-columns: 344px minmax(0,1fr); gap: 1.15rem; align-items: start; }
@media (max-width: 1100px) { .ig2-grid { grid-template-columns: 1fr; } }
.ig2-field { display: flex; flex-direction: column; gap: .45rem; margin-bottom: 1.15rem; }
.ig2-field:last-child { margin-bottom: 0; }
.ig2-field-label { display: flex; justify-content: space-between; align-items: center; font-size: .74rem; color: var(--ink-2); font-weight: 500; }
.ig2-field-label .v { font-family: var(--mono); color: var(--ink); }
.ig2-presets { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.ig2-ratios { display: grid; grid-template-columns: repeat(4,1fr); gap: .45rem; }
.ig2-seed { display: flex; gap: .45rem; }
.ig2-seed .input { font-family: var(--mono); }
.ig2-genbar { display: flex; align-items: center; justify-content: space-between; font-size: .74rem; color: var(--ink-3); font-family: var(--mono); margin-top: .7rem; }
/* Enhance-prompt: an AI-accent chip (sparkles in green). */
.ig2-enhance {
    display: inline-flex; align-items: center; gap: .4rem;
    height: 32px; padding: 0 .8rem;
    border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface-2); color: var(--ink-2);
    font-family: var(--font); font-size: .78rem; font-weight: 600;
    cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.ig2-enhance:hover { color: var(--ink); border-color: var(--primary-line); background: var(--raised); }
.ig2-enhance svg.lucide { width: 14px; height: 14px; color: var(--primary); }
.ig2-batch { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.ig2-tile { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); cursor: pointer; padding: 0; transition: border-color .15s, transform .15s; }
.ig2-tile:hover { transform: translateY(-2px); border-color: var(--line-2); }
.ig2-tile.sel { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.ig2-art { aspect-ratio: 1/1; position: relative; display: block; }
.ig2-art .lbl { position: absolute; left: .5rem; bottom: .5rem; font-family: var(--mono); font-size: .62rem; color: #fff; background: rgba(0,0,0,.5); padding: .12rem .4rem; border-radius: 6px; backdrop-filter: blur(4px); }
.ig2-load { aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.ig2-detail { display: grid; grid-template-columns: 200px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 700px) { .ig2-detail { grid-template-columns: 1fr; } .ig2-detail-art { max-width: 240px; } }
.ig2-detail-art { aspect-ratio: 1/1; border-radius: 12px; border: 1px solid var(--line); }
.ig2-detail-title { font-family: var(--display); font-weight: 600; font-size: .95rem; color: var(--ink); }
.ig2-detail-desc { font-size: .82rem; color: var(--ink-2); line-height: 1.55; margin: .4rem 0 1rem; }
.ig2-hist { display: flex; gap: .55rem; overflow-x: auto; padding-bottom: .35rem; }
.ig2-hist button { flex: none; width: 62px; height: 62px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; overflow: hidden; padding: 0; transition: border-color .15s; }
.ig2-hist button:hover { border-color: var(--green-line); }

/* ===================================================== 13. My Tokens */
.mono { font-family: var(--mono); }
.tok2-value { font-family: var(--display); font-size: 2.4rem; font-weight: 600; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.tok2-change { display: flex; align-items: center; gap: .7rem; margin-top: .7rem; }
.tok2-change .chip2 svg.lucide { width: 13px; height: 13px; }
.tok2-actions { display: grid; grid-template-columns: repeat(4,1fr); gap: .6rem; margin-top: 1.2rem; }
@media (max-width: 620px) { .tok2-actions { grid-template-columns: 1fr 1fr; } }
.tok2-head { display: grid; grid-template-columns: 1.6fr 1fr 1fr .8fr; gap: 1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.tok2-head .num, .tok2-row .num { text-align: right; }
.tok2-row { display: grid; grid-template-columns: 1.6fr 1fr 1fr .8fr; gap: 1rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.tok2-row:last-child { border-bottom: none; }
.tok2-token { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.tok2-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; }
.tok2-sym { display: block; font-size: .86rem; font-weight: 600; color: var(--ink); }
.tok2-name { display: block; font-size: .74rem; color: var(--ink-3); }
.tok2-row .pos { color: var(--up); } .tok2-row .neg { color: var(--down); }
.tok2-tx { display: flex; align-items: center; gap: .8rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.tok2-tx:last-child { border-bottom: none; }
.tok2-tx-ic { flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; }
.tok2-tx-main { flex: 1; min-width: 0; }
.tok2-time { font-size: .72rem; color: var(--ink-3); font-family: var(--mono); white-space: nowrap; }
.tok2-swap { display: flex; gap: .5rem; }
.alloc-row { margin-bottom: .85rem; }
.alloc-row:last-child { margin-bottom: 0; }
.alloc-top { display: flex; justify-content: space-between; font-size: .8rem; color: var(--ink-2); margin-bottom: .35rem; }
.alloc-top .mono { color: var(--ink); }
.alloc-bar { height: 7px; border-radius: 99px; background: var(--raised); overflow: hidden; }
.alloc-bar i { display: block; height: 100%; border-radius: 99px; }

/* --- Staking panel --- */
.tok2-value .tok2-ic { margin-right: .55rem; vertical-align: middle; }
.stk-rewards { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; margin-bottom: 1rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.stk-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }

/* ===================================================== 14. My NFTs */
.nf-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.15rem; }
.nf-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.nf-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: .8rem; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.nf-chip:hover { border-color: var(--line-2); color: var(--ink); }
.nf-chip.on { border-color: var(--line-2); background: var(--raised); color: var(--ink); }
.nf-chip .c { font-family: var(--mono); font-size: .72rem; opacity: .75; }
.nf-sort { display: flex; align-items: center; gap: .5rem; }
.nf-sort span { font-size: .74rem; color: var(--ink-3); }
.nf-sort .select { width: auto; padding: .45rem 2rem .45rem .7rem; }
.nf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem; }
.nf-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-2); cursor: pointer; padding: 0; text-align: left; transition: border-color .15s, transform .15s; }
.nf-card:hover { transform: translateY(-3px); border-color: var(--line-2); }
.nf-card.sel { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.nf-art { aspect-ratio: 1/1; position: relative; }
.nf-badge { position: absolute; top: .5rem; left: .5rem; font-size: .58rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .18rem .45rem; border-radius: 6px; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.nf-body { padding: .7rem .75rem .8rem; }
.nf-title { font-size: .84rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-coll { font-size: .72rem; color: var(--ink-3); margin-top: .1rem; }
.nf-price { font-family: var(--mono); font-size: .8rem; color: var(--ink); margin-top: .45rem; }
.nf-detail-art { aspect-ratio: 1/1; border-radius: 12px; border: 1px solid var(--line); position: relative; }
.nf-meta { list-style: none; margin: 1rem 0; padding: 0; }
.nf-meta li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .8rem; }
.nf-meta li:last-child { border-bottom: none; }
.nf-meta .k { color: var(--ink-3); }
.nf-meta .v { color: var(--ink); font-weight: 500; text-align: right; }
.nf-actions { display: flex; flex-direction: column; gap: .5rem; }
.nf-actions .btn2 { width: 100%; justify-content: flex-start; }

/* Social engagement buttons */
.social-eng { background: none; border: none; cursor: pointer; padding: 0; color: inherit; font: inherit; display: inline-flex; align-items: center; gap: .15rem; transition: color .15s; }
.social-eng:hover { color: var(--ink); }
.social-eng.is-liked, .social-eng.is-liked i { color: var(--down); }

/* ============================================================================
   15. Shared .vcap-* primitives
   ----------------------------------------------------------------------------
   The NFC, Social, Drive, AI Chatbot and My Page views consume these shared
   classes, mapping them onto the design tokens (fonts, surfaces, radius,
   buttons, badges) in one place.
   ========================================================================== */
.vcap-page-title { font-family: var(--display) !important; font-size: 1.55rem !important; font-weight: 600 !important; letter-spacing: -.02em !important; color: var(--ink) !important; text-transform: none !important; }
.vcap-page-subtitle { color: var(--ink-2) !important; font-size: .9rem !important; }

.vcap-section { background: var(--surface) !important; border: 1px solid var(--line) !important; border-radius: var(--r-lg) !important; box-shadow: var(--shadow-1); padding: 1.3rem 1.35rem !important; margin-bottom: 1.15rem !important; }
.vcap-section-header { margin-bottom: 1rem !important; }
.vcap-section-title { font-family: var(--display) !important; font-size: .92rem !important; font-weight: 600 !important; letter-spacing: .01em !important; text-transform: none !important; color: var(--ink) !important; }
.vcap-section-action { color: var(--ink-2) !important; font-weight: 600 !important; }
.vcap-section-action:hover { color: var(--green) !important; }

.vcap-card { background: var(--surface-2) !important; border: 1px solid var(--line) !important; border-radius: var(--r-md) !important; }
.vcap-card:hover { border-color: var(--line-2) !important; }
.vcap-card.is-selected { border-color: var(--green) !important; box-shadow: 0 0 0 1px var(--green) !important; }

.vcap-btn { border-radius: 10px !important; font-weight: 600 !important; text-transform: none !important; letter-spacing: 0 !important; font-size: .82rem !important; }
.vcap-btn--primary { background: var(--green) !important; color: var(--green-ink) !important; border-color: transparent !important; }
.vcap-btn--outline { border-color: var(--line-2) !important; color: var(--ink) !important; background: var(--surface) !important; }
.vcap-btn--outline:hover { border-color: var(--green-line) !important; color: var(--ink) !important; }
.vcap-btn--ghost { border-color: var(--line) !important; color: var(--ink) !important; background: var(--surface) !important; }
.vcap-btn--ghost:hover { border-color: var(--line-2) !important; }

.vcap-badge { border-radius: 7px !important; text-transform: none !important; letter-spacing: .01em !important; font-weight: 600 !important; }
.vcap-badge--green { background: var(--green-soft) !important; color: var(--green) !important; border-color: var(--green-line) !important; }
.vcap-badge--gray { background: var(--surface-2) !important; color: var(--ink-2) !important; border-color: var(--line) !important; }
.vcap-badge--yellow { background: rgba(255,207,92,.12) !important; color: var(--amber) !important; border-color: rgba(255,207,92,.3) !important; }
.vcap-badge--outline { color: var(--ink-2) !important; border-color: var(--line-2) !important; }

.vcap-avatar { background: var(--surface-2) !important; color: var(--ink) !important; border: 1px solid var(--line-2) !important; font-family: var(--display) !important; }
.vcap-mono { font-family: var(--mono) !important; }
.vcap-muted { color: var(--ink-2) !important; }
.vcap-accent { color: var(--green) !important; }
.vcap-list-row { border-color: var(--line) !important; }
.vcap-divider { background: var(--line) !important; }

.vcap-seg { background: var(--surface) !important; border-color: var(--line) !important; border-radius: 10px !important; }
.vcap-seg button { text-transform: none !important; letter-spacing: 0 !important; border-radius: 7px !important; }
.vcap-seg button.active { background: var(--raised) !important; color: var(--ink) !important; }

.vcap-thumb { border-radius: var(--r-md) !important; border: 1px solid var(--line) !important; background: var(--surface-2) !important; }
.vcap-progress { background: var(--raised) !important; }
.vcap-progress-bar { background: var(--green) !important; }
.vcap-icon-btn { border-radius: 9px !important; color: var(--ink-2) !important; }
.vcap-icon-btn:hover { background: var(--surface-2) !important; color: var(--ink) !important; }

/* form controls inside .vcap-* pages */
.form-control, .form-select { background: var(--bg) !important; border-color: var(--line) !important; color: var(--ink) !important; border-radius: 10px !important; }
.form-control:focus, .form-select:focus { border-color: var(--green-line) !important; box-shadow: none !important; }

/* ===================================================== 16. Social */
.soc-av { flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 600; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); }
.soc-av.sm { width: 34px; height: 34px; font-size: .78rem; }
.soc-av.md { width: 40px; height: 40px; font-size: .85rem; }

/* Composer — the card is the writing surface: a seamless textarea up top,
   then a hairline-divided action row (attach left, Post right). */
.soc-composer { padding: 0; overflow: hidden; margin-bottom: 1rem; flex: none; }
.soc-composer:focus-within { border-color: var(--line-2); }
.soc-composer-top { display: flex; gap: .8rem; align-items: flex-start; padding: var(--space-5) var(--space-5) var(--space-3); }
.soc-composer-input {
    flex: 1; min-width: 0;
    background: none; border: none; outline: none;
    color: var(--ink); font-size: .92rem; font-family: var(--font); line-height: 1.5;
    resize: none; min-height: 44px; max-height: 300px; overflow-y: hidden; padding: .35rem 0;
}
.soc-composer-input::placeholder { color: var(--ink-3); }
.soc-composer-foot { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-5); border-top: 1px solid var(--line); }
.soc-attach { display: flex; gap: .15rem; align-items: center; }
.soc-attach button, .soc-attach label { background: none; border: none; color: var(--ink-3); cursor: pointer; padding: .4rem; border-radius: 8px; display: inline-flex; align-items: center; transition: color .15s, background .15s; }
.soc-attach button:hover, .soc-attach label:hover { color: var(--ink); background: var(--surface-2); }
.soc-attach svg.lucide { width: 17px; height: 17px; }

.soc-scope-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 1.15rem; }
.soc-scope { margin-bottom: 0; }
.soc-mobile-hidden { display: none !important; }

.soc-feed-sticky { flex: none; padding-bottom: 0.75rem; }
.soc-feed-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 1.15rem; scrollbar-width: none; -ms-overflow-style: none; }
.soc-feed-scroll::-webkit-scrollbar { display: none; }

.soc-post { display: flex; flex-direction: column; gap: .7rem; }
.soc-post--clickable { cursor: pointer; }
.soc-post-attachments { display: flex; flex-direction: column; gap: .5rem; }
.soc-post-attachments img { width: 100%; height: auto; border-radius: 8px; display: block; }

/* -- Feed media: reddit-style slideshow + fullscreen lightbox -- */
.soc-media { position: relative; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.soc-media-img { width: 100%; height: auto; max-height: 540px; object-fit: contain; display: block; cursor: pointer; background: #000; }
.soc-media-video { position: relative; display: block; cursor: pointer; }
.soc-media-video video { width: 100%; height: auto; max-height: 540px; display: block; background: #000; pointer-events: none; }
.soc-media-play { position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.soc-carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; }
.soc-carousel-arrow:hover { background: rgba(0,0,0,.8); }
.soc-carousel-prev { left: .6rem; }
.soc-carousel-next { right: .6rem; }
.soc-carousel-counter { position: absolute; bottom: .6rem; right: .6rem; background: rgba(0,0,0,.65); color: #fff; font-size: .72rem; font-family: var(--mono); padding: .15rem .5rem; border-radius: 6px; }
.soc-lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; outline: none; }
.soc-lightbox-media { max-width: 92vw; max-height: 92vh; display: flex; align-items: center; justify-content: center; }
.soc-lightbox-media img, .soc-lightbox-media video { max-width: 92vw; max-height: 92vh; object-fit: contain; border-radius: 4px; }
.soc-lightbox-x { position: absolute; top: 1rem; right: 1rem; width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255,255,255,.12); color: #fff; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 3; }
.soc-lightbox-x:hover { background: rgba(255,255,255,.25); }
.soc-lightbox-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255,255,255,.12); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; z-index: 3; }
.soc-lightbox-arrow:hover { background: rgba(255,255,255,.25); }
.soc-lightbox-prev { left: 1rem; }
.soc-lightbox-next { right: 1rem; }
.soc-lightbox-counter { position: absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%); color: #fff; font-size: .8rem; font-family: var(--mono); background: rgba(255,255,255,.12); padding: .2rem .7rem; border-radius: 8px; }

/* -- Reddit-style comments: pill composer, per-comment actions -- */
.soc-comment-pill { border: 1px solid var(--line-2); border-radius: 999px; padding: .55rem 1rem; color: var(--ink-3); font-size: .85rem; cursor: text; background: var(--surface); }
.soc-comment-pill:hover { border-color: var(--line-3); color: var(--ink-2); }
.soc-comment-box { border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); padding: .6rem; display: flex; flex-direction: column; gap: .5rem; }
.soc-comment-box textarea { min-height: 72px; }
.soc-comment-previews { display: flex; gap: .5rem; flex-wrap: wrap; }
.soc-comment-preview { position: relative; width: 80px; height: 80px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.soc-comment-preview img, .soc-comment-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.soc-comment-preview-x { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; line-height: 1; cursor: pointer; }
.soc-comment-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.soc-comment-tools { display: flex; gap: .15rem; }
.soc-comment-tool { display: inline-flex; align-items: center; justify-content: center; padding: .4rem; border-radius: 8px; color: var(--ink-3); cursor: pointer; }
.soc-comment-tool:hover { color: var(--ink); background: var(--surface-2); }
.soc-comment-tool svg.lucide { width: 17px; height: 17px; }
.soc-comment-gif { font-size: .72rem; font-weight: 700; padding: .4rem .5rem; }
.soc-comment-actions { display: flex; gap: .5rem; margin-left: auto; }
.soc-reply-main { flex: 1; min-width: 0; }
.soc-reply-actions { display: flex; gap: .9rem; margin-top: .25rem; }
.soc-reply-action-btn { background: none; border: none; padding: 0; cursor: pointer; color: var(--ink-3); font-size: .76rem; font-weight: 600; display: inline-flex; align-items: center; }
.soc-reply-action-btn:hover { color: var(--ink); }
.soc-reply-delete:hover { color: var(--down); }
.soc-reply-attachments { display: flex; flex-direction: column; gap: .4rem; margin-top: .4rem; }
.soc-reply-attachments img { max-width: 100%; max-height: 320px; border-radius: 8px; display: block; object-fit: contain; background: #000; }
.soc-reply-attachments video { max-width: 100%; max-height: 320px; border-radius: 8px; display: block; background: #000; }
.soc-reply-nested { margin-top: .5rem; }
.soc-reply-to { font-size: .75rem; color: var(--ink-3); margin-bottom: .25rem; }
.soc-post-head { display: flex; align-items: center; gap: .6rem; }
.soc-post-author { font-weight: 600; font-size: .88rem; color: var(--ink); }
.soc-post-time { font-size: .74rem; color: var(--ink-3); }
.soc-post-tag { margin-left: auto; }
.soc-post-join { flex: none; margin-left: auto; }
.soc-post-tag:has(+ .soc-post-join) { margin-left: 0; }
.soc-post-community { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; font-weight: 700; font-size: .88rem; color: var(--ink); cursor: pointer; }
.soc-post-community:hover .soc-post-community-name { text-decoration: underline; }
.soc-post-community-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-post-id-top { display: flex; align-items: baseline; gap: .45rem; min-width: 0; flex: 1; flex-wrap: wrap; }
.soc-post-sub-author { font-weight: 400; font-size: .8rem; color: var(--ink-2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-post-sub-author:hover { color: var(--ink); }
.soc-post-body { font-size: .9rem; line-height: 1.55; color: var(--ink); margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--font); }
.soc-post-title { font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; color: var(--ink); margin: 0; word-break: break-word; }
.soc-composer-title { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--ink); font-size: 1rem; font-weight: 700; letter-spacing: -.01em; font-family: var(--font); padding: .35rem 0; }
.soc-composer-title::placeholder { color: var(--ink-3); font-weight: 600; }
.soc-composer-title-row { display: flex; gap: .8rem; align-items: center; padding: var(--space-3) var(--space-5) 0; }
.soc-composer-count { font-size: .68rem; color: var(--ink-3); font-family: var(--mono); white-space: nowrap; }
.soc-post-nft { aspect-ratio: 16 / 8; border-radius: 12px; position: relative; display: flex; align-items: flex-end; padding: .6rem; }
.soc-post-nft span { position: relative; z-index: 1; font-size: .68rem; font-weight: 600; color: #fff; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); padding: .18rem .5rem; border-radius: 6px; }
.soc-eng { display: flex; gap: 1.3rem; padding-top: .1rem; }
.soc-eng button { display: inline-flex; align-items: center; gap: .35rem; background: none; border: none; cursor: pointer; color: var(--ink-3); font-size: .8rem; font-family: var(--font); transition: color .15s; }
.soc-eng button:hover { color: var(--ink); }
.soc-eng button.liked { color: var(--down); }
.soc-eng .mono { font-family: var(--mono); }

/* ── Feed toolbar (replaces the old page title) ─────────────────── */
.soc-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: .6rem; flex-wrap: wrap; flex: none;
    padding: .55rem .1rem; margin-top: 25px; margin-bottom: .75rem;
    border-bottom: 1px solid var(--line);
}
.soc-toolbar-left { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.soc-toolbar-view { font-size: .95rem; font-weight: 700; color: var(--ink); }
.soc-toolbar-actions { display: flex !important; flex-direction: row !important; align-items: center; gap: .4rem; flex-wrap: nowrap; min-width: 0; }
/* The action row never wraps internally: the selects absorb shrinkage while the
   Create-post button keeps its size, so it can't drop to its own row. On narrow
   screens the whole row drops below the label via .soc-toolbar's own wrap. */
.soc-toolbar-actions .soc-toolbar-select { flex: 1 1 auto; }
.soc-toolbar-actions .btn2 { flex: none; white-space: nowrap; }
/* Narrow screens can't fit the row even shrunk, so let it wrap deliberately
   instead of clipping: selects share rows, nothing squishes below usable size. */
@media (max-width: 640px) {
    .soc-toolbar-actions { flex-wrap: wrap; flex: 1 1 100%; }
    .soc-toolbar-actions .soc-toolbar-select { flex: 1 1 8rem; }
}
.soc-toolbar-select {
    /* width:auto sizes a select to its WIDEST option (here: 247 countries incl.
       "South Georgia and the South Sandwich Islands" ≈ 312px). The list loads
       async after first paint, so the row fits on arrival then wraps once the
       options land. Cap + min-width:0 lets the flex item shrink with ellipsis. */
    width: auto; min-width: 0; max-width: 12rem;
    text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
    padding: .3rem 1.6rem .3rem .55rem; font-size: .78rem;
    border-radius: 8px; background: var(--surface-2); color: var(--ink-2);
    border: 1px solid var(--line); appearance: none; cursor: pointer;
}
.soc-friend-panel { margin-bottom: .9rem; }
.soc-feed-error { color: var(--ink-2); font-size: .85rem; }

/* ── Post layout with the vote column ───────────────────────── */
.soc-post-layout { display: flex; gap: .65rem; align-items: flex-start; }
.soc-post-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .7rem; }
.soc-vote {
    flex: none; width: 34px; display: flex; flex-direction: column;
    align-items: center; gap: .1rem; padding-top: .1rem;
}
.soc-vote-btn {
    background: none; border: none; cursor: pointer; padding: .12rem;
    border-radius: 7px; color: var(--ink-3); display: inline-flex;
    transition: color .15s, background .15s;
}
.soc-vote-btn:hover { background: var(--surface-2); color: var(--ink); }
.soc-vote-btn svg.lucide { width: 19px; height: 19px; }
.soc-vote-btn.is-up { color: var(--green); }
.soc-vote-btn.is-down { color: var(--down); }
.soc-vote-score { font-family: var(--mono); font-size: .78rem; font-weight: 700; color: var(--ink-2); }
.soc-reply-action {
    background: none; border: none; cursor: pointer; padding: 0 .15rem;
    color: var(--ink-3); vertical-align: middle; display: inline-flex;
}
.soc-reply-action:hover { color: var(--ink); }

/* ── Right rail: Recent Posts ───────────────────────────────── */
.soc-recent-post { align-items: flex-start; }
.soc-recent-score { margin-left: .35rem; font-family: var(--mono); font-size: 10px; }

/* ── Explore page ───────────────────────────────────────────── */
.soc-explore-filters { padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: .6rem; }
.soc-explore-search { display: flex; align-items: center; gap: .45rem; }
.soc-explore-search svg.lucide { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.soc-explore-search .input { flex: 1 1 auto; min-width: 0; }
.soc-explore-controls { display: flex; gap: .4rem; flex-wrap: wrap; }
.soc-tagrow { display: flex; flex-wrap: wrap; gap: .3rem; }
.soc-tagrow--compact { margin-top: .35rem; }
.soc-tag { cursor: pointer; border: none; font-size: .72rem; }
.soc-tag .mono { font-family: var(--mono); opacity: .7; margin-left: .2rem; }
.soc-tag:disabled { opacity: .4; cursor: not-allowed; }
/* Tag input box: selected topics live inside the input as chips, with a
   suggestion menu for the official vocabulary. */
.soc-tagbox-wrap { position: relative; }
.soc-tagbox { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .4rem .5rem; cursor: text; transition: border-color .15s, background .15s; }
.soc-tagbox:focus-within { outline: none; border-color: var(--green-line); background: var(--surface); }
.soc-tagbox-input { flex: 1 1 120px; min-width: 80px; border: none; background: transparent; outline: none; color: var(--ink); font-size: .86rem; font-family: var(--font); padding: .2rem; }
.soc-tagbox-input::placeholder { color: var(--ink-3); }
.soc-tagbox-chip { border: none; cursor: pointer; }
.soc-tagbox-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-modal); overflow: hidden; padding: .25rem; }
.soc-tagbox-item { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .5rem .6rem; border: none; border-radius: 7px; background: transparent; color: var(--ink-2); font-size: .82rem; font-weight: 500; cursor: pointer; text-align: left; }
.soc-tagbox-item:hover { background: var(--surface-2); color: var(--ink); }
.soc-tagbox-item svg.lucide { width: 14px; height: 14px; }
/* Radio/checkbox rows in the community dialogs: the control sits against the title, the
   explanation underneath, so the choice and its consequence read as one unit. */
.field > label.soc-comm-type, label.soc-comm-type { display: flex; flex-direction: row; align-items: flex-start; gap: .6rem; padding: .5rem .6rem; margin: 0 0 .35rem; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; font-size: inherit; font-weight: inherit; color: inherit; }
.field > label.soc-comm-type:last-child, label.soc-comm-type:last-child { margin-bottom: 0; }
.soc-comm-type:hover { border-color: var(--line-3); }
.soc-comm-type--on { border-color: var(--green); background: color-mix(in srgb, var(--green) 7%, transparent); }
.soc-comm-type input { margin-top: .2rem; flex: none; accent-color: var(--green); width: 16px; height: 16px; }
.soc-comm-type-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.soc-comm-type-title { display: block; font-size: .82rem; font-weight: 600; color: var(--ink); }
.soc-comm-type-help { display: block; font-size: .74rem; color: var(--ink-3); line-height: 1.4; }
.soc-comm-pending-banner { border-left: 3px solid var(--yellow); }
/* Recommendation groups: one block per rule, three items per row.
   Vertical space between cards is row-gap, not per-card margin — a margin on a grid item
   would stack with its neighbour's and double up between rows. */
.soc-explore-group { margin: 1.75rem 0; }
.soc-explore-group-title { font-family: var(--display); font-size: .92rem; font-weight: 600; color: var(--ink); margin: 0 0 .7rem; }
.soc-explore-rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: .9rem; row-gap: 1.5rem; }
.soc-rec { padding: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; display: flex; flex-direction: column; gap: 0; min-width: 0; }
.soc-rec--clickable { cursor: pointer; transition: border-color .15s; }
.soc-rec--clickable:hover { border-color: var(--line-3); }
.soc-rec--clickable:focus-visible { outline: 2px solid var(--green-line); outline-offset: 2px; }
.soc-rec--selected { border-color: var(--green); }
.soc-rec-cover { display: block; width: 100%; height: 110px; object-fit: cover; background: var(--surface-2); flex: none; }
.soc-rec-cover--fallback { background: linear-gradient(120deg, var(--surface-2), var(--raised)); }
.soc-rec-body { padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: .3rem; min-width: 0; flex: 1; }
.soc-rec-head { display: flex; align-items: center; gap: .5rem; }
.soc-rec-title { flex: 1 1 auto; min-width: 0; font-size: .86rem; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-rec-visitors { font-size: .72rem; color: var(--ink-3); font-family: var(--mono); }
.soc-rec-desc { font-size: .8rem; line-height: 1.5; color: var(--ink-2); margin: .15rem 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.soc-rec-foot { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .72rem; color: var(--ink-3); font-family: var(--mono); margin-top: auto; padding-top: .35rem; }
.soc-rec-foot svg.lucide { width: 13px; height: 13px; }
.soc-comm-flag { font-size: .95rem; line-height: 1; }
/* Explore rail (community detail, explore page only): cover + logo + stats + mods + rules. */
.soc-explore-rail { overflow: hidden; flex: none; padding: 0 0 .9rem; }
.soc-explore-rail-cover { display: block; width: 100%; height: 110px; object-fit: cover; background: var(--surface-2); }
.soc-explore-rail-cover--fallback { background: linear-gradient(120deg, var(--surface-2), var(--raised)); }
.soc-explore-rail-head { display: flex; padding: .8rem .9rem 0; margin-top: -28px; }
.soc-explore-rail-logo { width: 52px; height: 52px; flex: none; border-radius: 12px; object-fit: cover; border: 2px solid var(--surface); background: var(--surface-2); }
.soc-explore-rail-logo--fallback { font-size: 1.4rem; }
.soc-explore-rail-title { padding: .6rem .9rem 0; overflow-wrap: anywhere; }
.soc-explore-rail-tags { padding: .45rem .9rem 0; }
.soc-explore-rail-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem .5rem; padding: .7rem .9rem 0; }
.soc-explore-rail-facts { display: flex; flex-direction: column; margin: .6rem .9rem 0; padding: .1rem 0; border-top: 1px solid var(--line); }
.soc-explore-rail-fact { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.soc-explore-rail-fact:last-child { border-bottom: none; }
.soc-explore-rail-fact dt { display: inline-flex; align-items: center; gap: .45rem; font-size: .74rem; color: var(--ink-3); margin: 0; }
.soc-explore-rail-fact dt svg.lucide { width: 15px; height: 15px; }
.soc-explore-rail-fact dd { margin: 0; font-size: .78rem; font-weight: 600; color: var(--ink); text-align: right; }
.soc-explore-rail-stat { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.soc-explore-rail-stat svg.lucide { width: 20px; height: 20px; color: var(--ink-2); flex: none; }
.soc-explore-rail-stat-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.soc-explore-rail-stat-count { font-size: .85rem; font-weight: 700; color: var(--ink); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-explore-rail-stat-label { font-size: .7rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-explore-rail .soc-post-body { padding: .4rem .9rem 0; }
.soc-explore-rail-dot { opacity: .5; }
.soc-explore-rail-sect { font-size: .74rem; font-weight: 600; color: var(--ink-2); padding: .7rem .9rem 0; }
.soc-explore-rail-mods { display: flex; flex-wrap: wrap; gap: .35rem; padding: .4rem .9rem 0; }
.soc-explore-rail-mod { background: none; border: none; padding: 0; cursor: pointer; border-radius: 8px; }
.soc-explore-rail-mod:hover { outline: 2px solid var(--green-line); }
.soc-explore-rail-mod:focus-visible { outline: 2px solid var(--green-line); outline-offset: 2px; }
.soc-explore-rail-rules { margin: .3rem .9rem 0; padding-left: 1.1rem; font-size: .78rem; color: var(--ink-2); line-height: 1.5; }
.soc-explore-rail-actions { display: flex; flex-direction: column; gap: .5rem; padding: .8rem .9rem .9rem; }
.soc-explore-rail-row { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.soc-explore-rail-row .btn2 { width: 100%; justify-content: center; }

/* The viewer's own pending creation requests, which no public listing shows. */
.soc-comm-pending { margin-top: 1.15rem; }
.soc-comm-pending-title { font-size: .78rem; font-weight: 600; color: var(--ink-2); margin-bottom: .4rem; }
.soc-comm-pending-row { display: flex; align-items: center; gap: .55rem; padding: .3rem 0; }
.soc-comm-pending-row .soc-comm-name { flex: 1 1 auto; min-width: 0; text-decoration: none; }

@media (max-width: 1100px) { .soc-explore-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .soc-explore-rows { grid-template-columns: minmax(0, 1fr); } }
.soc-composer--page { margin-bottom: 1.15rem; }
.soc-composer--page .soc-composer-top { padding: var(--space-4) var(--space-5); }

/* ── My communities page ──────────────────────────────────── */
.soc-comm-list { padding: 0 var(--space-5); }
.soc-comm-list .soc-comm-row { padding: .65rem 0; }

.soc-rail-seg { margin-bottom: var(--space-4); }
.soc-comm-create { margin-top: var(--space-4); }
.soc-comm-row { display: flex; align-items: center; gap: .65rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.soc-comm-row:last-child { border-bottom: none; }
.soc-comm-main { flex: 1; min-width: 0; cursor: pointer; }
.soc-comm-name { font-size: .84rem; color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-comm-members { font-size: .72rem; color: var(--ink-3); }

/* ── Community page hero: cover art + logo + title ──────── */
.soc-comm-cover { display: block; width: 100%; height: 180px; object-fit: cover; background: var(--surface-2); }
.soc-comm-cover--fallback { height: 120px; background: linear-gradient(120deg, var(--surface-2), var(--raised)); }
.soc-comm-hero-row { display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem 1rem; margin-top: -40px; }
.soc-comm-logo { width: 72px; height: 72px; flex: none; border-radius: 14px; object-fit: cover; border: 2px solid var(--surface); background: var(--surface-2); }
.soc-comm-logo--fallback { font-size: 2rem; border-radius: 14px; }
/* Community hero title: larger than the page default, with a shadow so it
   reads over the cover art behind it. */
.soc-comm-title { font-size: 2rem; text-shadow: 0 2px 12px rgba(0,0,0,.55), 0 1px 3px rgba(0,0,0,.6); }
.soc-post--highlight { border-left: 3px solid var(--green); }

.soc-dm-search { position: relative; display: flex; align-items: center; margin-bottom: .5rem; }
.soc-dm-search svg.lucide { position: absolute; left: 1.25rem; width: 15px; height: 15px; color: var(--ink-3); }
.soc-dm-search input { width: 100%; height: 36px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 0 .7rem 0 2rem; color: var(--ink); font-size: .82rem; }
.soc-dm-search input:focus { outline: none; border-color: var(--green-line); }
.soc-dm-row { display: flex; align-items: center; gap: .6rem; padding: .5rem .4rem; border-radius: 10px; cursor: pointer; }
.soc-dm-row:hover { background: var(--surface-2); }
.soc-dm-main { flex: 1; min-width: 0; }
.soc-dm-name { font-size: .82rem; color: var(--ink); font-weight: 500; display: flex; align-items: center; gap: .4rem; }
.soc-dm-prev { font-size: .72rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-dm-time { font-size: .68rem; color: var(--ink-3); font-family: var(--mono); }
.soc-unread { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }

.social-feed-sentinel { display: flex; justify-content: center; padding: 1.25rem 0; }
.social-feed-more-btn { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; background: transparent; }
.soc-loader, .soc-end { display: inline-flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--ink-3); }

/* Social floating messages widget */
.dm-widget { position: fixed; bottom: 1.1rem; right: 1.25rem; width: auto; max-width: calc(100vw - 2rem); z-index: 90; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-pop); overflow: hidden; }
.dm-widget.is-open { width: 580px; }
.dm-head { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .7rem .9rem; background: var(--surface-2); border: none; border-bottom: 1px solid var(--line); color: var(--ink); cursor: pointer; font-family: var(--font); }
.dm-widget:not(.is-open) .dm-head { border-bottom: none; }
.dm-head-title { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--display); font-weight: 600; font-size: .88rem; }
.dm-head-title svg.lucide { color: var(--green); width: 16px; height: 16px; }
.dm-chev { margin-left: auto; color: var(--ink-3); }
.dm-widget.is-open .dm-head .dm-chev { margin-left: auto; }
.dm-body { display: flex; height: 420px; }
.dm-sidebar { width: 200px; min-width: 160px; border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.dm-sidebar .soc-dm-search { padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.dm-sidebar .dm-list { flex: 1; overflow-y: auto; }
.dm-sidebar .soc-dm-row { display: flex; gap: .4rem; align-items: center; padding: .5rem .6rem; cursor: pointer; transition: background .12s; }
.dm-sidebar .soc-dm-row:hover { background: var(--surface-2); }
.dm-sidebar .soc-dm-row.is-active { background: var(--surface-2); border-left: 2px solid var(--green); }
.dm-sidebar .soc-dm-name { font-size: .78rem; font-weight: 600; color: var(--ink); }
.dm-sidebar .soc-dm-prev { font-size: .7rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.dm-sidebar .soc-dm-time { font-size: .6rem; color: var(--ink-3); font-family: var(--mono); margin-left: auto; flex: none; }
.dm-convo { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.dm-empty-convo { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dm-list { overflow-y: auto; }

/* Avatar extra-small */
.soc-av.xs { width: 24px; height: 24px; font-size: .65rem; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 600; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); flex: none; }

/* Reply threads */
.soc-replies { padding: .6rem 0 0; border-top: 1px solid var(--line); margin-top: .5rem; }
.soc-reply { display: flex; gap: .5rem; padding: .4rem 0; align-items: flex-start; }
.soc-reply-author { font-weight: 600; font-size: .8rem; color: var(--ink); }
.soc-reply-body { font-size: .82rem; color: var(--ink); margin: .15rem 0 0; line-height: 1.45; white-space: pre-wrap; }
.soc-reply-compose { display: flex; gap: .5rem; align-items: flex-end; margin-top: .5rem; }
.soc-reply-compose textarea { flex: 1; min-height: 36px; resize: none; font-size: .82rem; }
.soc-comm-empty { font-size: .8rem; color: var(--ink-3); padding: .5rem 0; text-align: center; }
.soc-dm-empty { font-size: .8rem; color: var(--ink-3); padding: 1rem 0; text-align: center; }

/* Messenger conversation view */
.dm-chat-head { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; border-bottom: 1px solid var(--line); flex: none; }
.dm-chat-title { font-weight: 600; font-size: .88rem; color: var(--ink); }
.dm-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; padding: .5rem .8rem; }
.dm-msg { display: flex; gap: .5rem; align-items: flex-start; }
.dm-msg--self { flex-direction: row-reverse; }
.dm-msg-body { display: flex; flex-direction: column; gap: .1rem; max-width: 80%; }
.dm-msg--self .dm-msg-body { align-items: flex-end; }
.dm-msg-sender { font-size: .7rem; font-weight: 600; color: var(--ink-3); }
.dm-msg-text { font-size: .84rem; color: var(--ink); background: var(--surface-2); border-radius: 12px; padding: .4rem .7rem; line-height: 1.4; word-break: break-word; white-space: pre-wrap; }
.dm-msg--self .dm-msg-text { background: var(--green); color: var(--bg); }
.dm-msg-time { font-size: .65rem; color: var(--ink-3); font-family: var(--mono); }
.dm-compose { flex: none; margin: 0; border-top: 1px solid var(--line); padding: .5rem .8rem; position: relative; }
.dm-compose-row { display: flex; gap: .4rem; align-items: center; }
.dm-compose-input { flex: 1; height: 36px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 0 .7rem; color: var(--ink); font-size: .82rem; }
.dm-compose-input:focus { outline: none; border-color: var(--green-line); }
.dm-emoji-btn { background: none; border: none; cursor: pointer; color: var(--ink-3); padding: .3rem; display: inline-flex; }
.dm-emoji-btn:hover { color: var(--ink); }
.dm-emoji-picker { display: flex; flex-direction: column; gap: 4px; padding: .5rem; max-height: 220px; overflow: hidden; border-top: 1px solid var(--line); }
.dm-emoji-item { background: none; border: none; cursor: pointer; font-size: 1.2rem; padding: .25rem; border-radius: 6px; transition: background .15s; }
.dm-emoji-item:hover { background: var(--surface-2); }

@media (max-width: 640px) { .dm-widget { right: .5rem; left: .5rem; width: auto; } .dm-body { height: 360px; } .dm-sidebar { width: 140px; min-width: 120px; } }

/* Social Messages Layout — side-by-side contacts + conversation */
.soc-msg-layout { display: flex; gap: 0; height: calc(100vh - 180px); min-height: 400px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.soc-msg-sidebar { width: 320px; min-width: 260px; border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.soc-msg-search { display: flex; align-items: center; gap: .5rem; padding: .75rem; border-bottom: 1px solid var(--line); }
.soc-msg-search svg.lucide { color: var(--ink-3); width: 16px; height: 16px; flex: none; }
.soc-msg-search input { flex: 1; border: none; background: none; color: var(--ink); font-size: .82rem; outline: none; }
.soc-msg-threads { flex: 1; overflow-y: auto; }
.soc-msg-thread { display: flex; align-items: center; gap: .6rem; padding: .7rem .75rem; cursor: pointer; border-bottom: 1px solid var(--line); transition: background .15s; }
.soc-msg-thread:hover { background: var(--surface-2); }
.soc-msg-thread.active { background: var(--surface-2); border-left: 3px solid var(--green); }
.soc-msg-thread-info { flex: 1; min-width: 0; }
.soc-msg-thread-name { font-size: .84rem; font-weight: 600; color: var(--ink); display: flex; align-items: center; }
.soc-msg-thread-preview { font-size: .75rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-msg-thread-time { font-size: .65rem; color: var(--ink-3); font-family: var(--mono); flex: none; }
.soc-msg-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.soc-msg-header { display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.soc-msg-header-name { font-weight: 600; font-size: .9rem; color: var(--ink); }
.soc-msg-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.soc-msg-compose { display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--line); background: var(--surface); position: relative; }
.soc-msg-compose .dm-compose-input { flex: 1; }
.soc-msg-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; color: var(--ink-3); font-size: .88rem; }
@media (max-width: 768px) { .soc-msg-layout { flex-direction: column; height: auto; } .soc-msg-sidebar { width: 100%; max-height: 40vh; border-right: none; border-bottom: 1px solid var(--line); } }

/* ============================================================================
   My Referrals (rf-*) — share hero, tiered network, leaderboard podium
   ========================================================================== */

/* neutral avatar used across the page */
.av { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-2); font-family: var(--display); font-weight: 700; flex: none; }
.av--sm { width: 30px; height: 30px; font-size: .78rem; }
.av--md { width: 44px; height: 44px; font-size: 1rem; }
.av--lg { width: 56px; height: 56px; font-size: 1.25rem; }

.stat-delta.warn { color: var(--amber); }

/* --- Share hero --- */
.rf-hero { display: flex; flex-direction: column; gap: 1rem; }
.rf-hero-top .refer-copy { margin-top: .6rem; }
.rf-hero-bottom {
    display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
    padding-top: 1rem; border-top: 1px solid var(--line); flex-wrap: wrap;
}
.rf-hero-code { display: flex; align-items: center; gap: .6rem; }
.rf-code { font-size: 1rem; font-weight: 700; color: var(--ink); letter-spacing: .06em; }
.rf-code-copy { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); border-radius: 8px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.rf-code-copy:hover { color: var(--ink); border-color: var(--line-2); }
.rf-code-copy svg.lucide { width: 14px; height: 14px; }
.rf-funnel { display: flex; gap: 1.75rem; }
.rf-funnel-step { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.rf-funnel-val { font-family: var(--display); font-size: 1.15rem; font-weight: 600; color: var(--ink); letter-spacing: -.02em; line-height: 1; text-align: center; }
.rf-funnel-label { font-size: .72rem; color: var(--ink-3); text-align: center; white-space: nowrap; }
@media (max-width: 640px) { .rf-hero-bottom { flex-direction: column; align-items: flex-start; } }

/* --- Network: zoomable downline tree --- */
.rf-tier-dot { width: .55rem; height: .55rem; border-radius: 50%; flex: none; display: inline-block; }

.rf-tree-toolbar { margin-bottom: .65rem; }
.rf-network-head { margin-bottom: .2rem; }
.rf-network-toolbar { margin-bottom: 1.15rem; }

.pg-col > .dsh-stats { margin-bottom: 0; }
.rf-rail { margin-top: 0; }

/* The two main-column panels sit slightly above the rail's supporting-info
   cards, instead of everything using the same flat shadow-1. */
.rf-page .pg-col > .panel { box-shadow: var(--shadow-2); }
.rf-page .dsh-stats .stat:hover { transform: none; border-color: var(--line); }

/* Sticks to the top of the scrolling column once the KPI row above has
   scrolled out of the way — bleeds over the panel's own padding so it reads
   as one continuous card, not a floating strip. */
.rf-network-sticky {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface);
    margin: calc(-1 * var(--pad-panel)) calc(-1 * var(--pad-panel)) 0;
    padding: var(--pad-panel) var(--pad-panel) 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.rf-tree-stage { position: relative; }
.rf-treewrap {
    position: relative; height: 600px; overflow: auto; user-select: none;
    background-color: var(--surface-2);
    background-image: radial-gradient(circle, var(--line) 1px, transparent 1px);
    background-size: 22px 22px;
    border: 1px solid var(--line); border-radius: 14px;
}
.rf-tree-zoom-bar {
    position: absolute; top: 0; right: 0; z-index: 5;
    display: flex; justify-content: flex-end; width: 100%; box-sizing: border-box; padding: .7rem;
    pointer-events: none;
}
.rf-tree-zoom {
    pointer-events: auto;
    display: flex; align-items: center; gap: .3rem; width: fit-content;
    padding: .3rem; background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-pop);
    backdrop-filter: blur(8px);
}
.rf-tree-zoom button { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; background: transparent; color: var(--ink-2); border: none; border-radius: 7px; cursor: pointer; transition: color .12s, background .12s; }
.rf-tree-zoom button:hover:not(:disabled) { color: var(--ink); background: var(--surface-2); }
.rf-tree-zoom button:disabled { opacity: .35; cursor: default; }
.rf-tree-zoom button svg.lucide { width: 13px; height: 13px; }
.rf-tree-zoom span.mono { font-size: .7rem; color: var(--ink-3); min-width: 2.6em; text-align: center; }
.rf-tree-zoom-sep { width: 1px; height: 16px; background: var(--line); flex: none; }

.rf-treescale { position: relative; }
.rf-treecanvas { position: relative; transform-origin: top left; }
.rf-tree-edges { position: absolute; top: 0; left: 0; pointer-events: none; overflow: visible; }
.rf-edge { fill: none; stroke: var(--line-2); stroke-width: 1.75; stroke-linecap: round; stroke-opacity: calc(1 - var(--depth, 1) * .1); transition: opacity .15s; }
.rf-edge.is-dim { opacity: .2; }
.rf-edge-dot { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.75; transition: opacity .15s; }
.rf-edge-dot.is-dim { opacity: .2; }

.rf-tnode { position: absolute; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .45rem; width: 100px; transition: opacity .15s; }
.rf-tnode.is-dim { opacity: .3; }
.rf-tnode-avwrap { position: relative; }
.rf-tnode-av {
    width: 52px; height: 52px; font-size: .95rem;
    background: var(--surface); box-shadow: var(--shadow-1);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.rf-tnode:hover .rf-tnode-av { transform: translateY(-2px); box-shadow: var(--shadow-pop); border-color: var(--line-2); }
.rf-tnode.is-root .rf-tnode-av svg.lucide { width: 18px; height: 18px; }
.rf-tnode-label { display: flex; flex-direction: column; align-items: center; gap: .05rem; text-align: center; }
.rf-tnode-name { font-size: .76rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96px; }
.rf-tnode-earn { font-size: .68rem; color: var(--ink-3); }
.rf-tnode-tier {
    position: absolute; bottom: -.1rem; right: -.1rem; font-size: .56rem; font-weight: 700; letter-spacing: .03em;
    color: var(--ink-2); background: var(--surface); padding: .1rem .35rem; border-radius: 99px;
    border: 1px solid var(--line-2); line-height: 1.3;
}
.rf-tnode-tier--you { color: var(--green); border-color: var(--green-line); background: var(--green-soft); }
.rf-tnode-more {
    display: inline-flex; align-items: center; gap: .2rem; font-size: .66rem; font-weight: 600; color: var(--ink-2);
    background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: .16rem .55rem;
    cursor: pointer; box-shadow: var(--shadow-1); transition: color .12s, border-color .12s, transform .12s;
}
.rf-tnode-more:hover { color: var(--ink); border-color: var(--line-2); transform: translateY(-1px); }
.rf-tnode-more.is-locked { color: var(--amber); background: var(--amber-soft, var(--surface)); border-style: dashed; border-color: var(--amber-line, var(--line)); }
.rf-tnode-more svg.lucide { width: 11px; height: 11px; }
.rf-tnode-more svg.rf-chev-up { transform: rotate(180deg); }

/* --- Recent activity --- */
.rf-activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rf-activity-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.rf-activity-row:last-child { border-bottom: none; }
.rf-activity-ic { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--raised); color: var(--ink-2); flex: none; }
.rf-activity-ic svg.lucide { width: 15px; height: 15px; }
.rf-activity-ic.is-pos { background: var(--green-soft); color: var(--green); }
.rf-activity-desc { flex: 1; font-size: .82rem; color: var(--ink); }
.rf-activity-time { font-size: .72rem; color: var(--ink-3); }

/* --- Leaderboard podium --- */
.rf-podium { display: grid; grid-template-columns: 1fr 1.2fr 1fr; align-items: end; gap: .5rem; padding: .5rem 0 1rem; }
.rf-pod-col { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem; min-width: 0; }
.rf-pod-col.is-first { transform: translateY(-.5rem); }
.rf-pod-crown { color: var(--green); width: 18px; height: 18px; margin-bottom: -.1rem; }
.rf-pod-rank { width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; font-family: var(--mono); }
.rf-pod-rank.is-first { background: var(--green); color: var(--green-ink); border-color: var(--green); }
.rf-pod-name { font-size: .76rem; font-weight: 600; color: var(--ink); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-pod-earn { font-size: .72rem; color: var(--ink-2); }

.rf-rank { list-style: none; margin: 0; padding: .5rem 0 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.rf-rank-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.rf-rank-row:last-child { border-bottom: none; }
.rf-rank-num { width: 1.2rem; text-align: center; font-size: .78rem; font-weight: 700; color: var(--ink-3); }
.rf-rank-name { flex: 1; font-size: .82rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-rank-vip { font-family: var(--mono); font-size: .58rem; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); border: 1px solid var(--line); border-radius: 5px; padding: .1rem .3rem; }
.rf-rank-earn { font-size: .78rem; color: var(--ink-2); }

/* --- Share modal --- */
.rf-share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.rf-share-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-size: .82rem; font-weight: 500; cursor: pointer; transition: border-color .12s, background .12s; }
.rf-share-btn:hover { border-color: var(--line-2); background: var(--raised); }
.rf-share-btn svg.lucide { width: 16px; height: 16px; color: var(--ink-2); }

/* ============================================================================
   NFC Card (nfc-*) — physical card mockup, thumbnails, pipeline, order modal
   ========================================================================== */

/* --- Physical card mockup --- */
.nfc-card-stage { display: flex; justify-content: center; padding: 1rem 0 .35rem; perspective: 1600px; }
.nfc-flip-inner { position: relative; width: 100%; max-width: 440px; aspect-ratio: 1.586 / 1; transition: transform .5s cubic-bezier(.4,.2,.2,1); transform-style: preserve-3d; }
.nfc-flip-inner.is-flipped { transform: rotateY(180deg); }
.nfc-flip-inner .nfc-face-front, .nfc-flip-inner .nfc-face-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.nfc-flip-inner .nfc-face-back { transform: rotateY(180deg); }
.nfc-flip-inner .nfc-face-front > .nfc-card-mockup, .nfc-flip-inner .nfc-face-back > .nfc-card-mockup { box-sizing: border-box; width: 100%; height: 100%; max-width: none; aspect-ratio: auto; }
.nfc-back-wave { position: absolute; top: 50%; right: -1.1rem; transform: translateY(-50%) rotate(-12deg); width: 8.5rem; height: 8.5rem; color: rgba(255,255,255,.06); z-index: 0; pointer-events: none; }
.nfc-back-top { position: relative; z-index: 1; display: flex; }
.nfc-back-chip {
    width: 34px; height: 26px; border-radius: 5px; flex: none;
    background: linear-gradient(150deg, #e8d9a8, #b8975a 55%, #8a6b34);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
    position: relative; overflow: hidden;
}
.nfc-back-chip::before, .nfc-back-chip::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(0,0,0,.22); border-radius: 2px; }
.nfc-back-chip::after { inset: 4px 50% 4px 4px; border-right: 1px solid rgba(0,0,0,.22); border-radius: 2px 0 0 2px; }
.nfc-back-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: .5rem; position: relative; z-index: 1; }
.nfc-back-serial { font-size: .82rem; letter-spacing: .12em; color: rgba(255,255,255,.82); }
.nfc-back-note { max-width: 78%; font-size: .64rem; line-height: 1.4; letter-spacing: .01em; color: rgba(255,255,255,.42); }
.nfc-back-footer { position: relative; z-index: 1; }
.nfc-card-mockup { position: relative; background: var(--bg); border: 1px solid var(--line-2); border-radius: 16px; padding: 1.25rem 1.4rem; aspect-ratio: 1.586 / 1; width: 100%; max-width: 440px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow-2); overflow: hidden; }
.nfc-card-mockup.is-pending-card { border-style: dashed; border-color: var(--amber); }
.nfc-card-mockup::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--primary-sheen), transparent); z-index: 2; }
.nfc-card-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.62)); z-index: 0; pointer-events: none; border-radius: inherit; }
.nfc-card-mockup.has-bg > .nfc-card-top, .nfc-card-mockup.has-bg > .nfc-card-center, .nfc-card-mockup.has-bg > .nfc-card-bottom { position: relative; z-index: 1; }
.nfc-card-pending-ribbon { position: absolute; top: .9rem; right: -2.4rem; transform: rotate(35deg); background: var(--amber); color: #0A0A0A; font-family: var(--display); font-weight: 800; font-size: .56rem; letter-spacing: .14em; padding: .25rem 2.6rem; z-index: 3; display: inline-flex; align-items: center; gap: .3rem; }
.nfc-card-pending-ribbon svg.lucide { width: 11px; height: 11px; }
.nfc-card-top { display: flex; align-items: center; justify-content: space-between; }
.nfc-logo-lockup { display: flex; align-items: center; gap: .45rem; }
.nfc-v-mark { width: 26px; height: 26px; background: var(--green); color: var(--green-ink); font-family: var(--display); font-weight: 800; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; line-height: 1; }
.nfc-logo-text { font-family: var(--display); font-weight: 700; color: #fff; letter-spacing: .14em; font-size: .95rem; }
.nfc-tap-badge { display: inline-flex; align-items: center; gap: .35rem; background: var(--green); color: var(--green-ink); font-family: var(--display); font-weight: 700; font-size: .64rem; padding: .28rem .6rem; border-radius: 999px; letter-spacing: .12em; }
.nfc-tap-badge svg.lucide { width: 12px; height: 12px; }
.nfc-card-center { display: flex; flex-direction: column; gap: .25rem; }
.nfc-cardholder { color: #fff; font-family: var(--display); font-weight: 700; font-size: 1.35rem; letter-spacing: .06em; line-height: 1.1; }
.nfc-card-meta { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.nfc-card-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.nfc-qr { width: 52px; height: 52px; background: #fff; padding: 4px; border-radius: 6px; display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(5, 1fr); gap: 2px; flex: none; }
.nfc-qr-cell { background: #fff; }
.nfc-qr-cell.is-on { background: #000; }
.nfc-tap-prompt { display: flex; align-items: center; gap: .4rem; color: rgba(255,255,255,.65); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.nfc-tap-prompt svg.lucide { color: var(--green); width: 16px; height: 16px; }
.nfc-card-caption { margin-top: 1rem; font-size: .82rem; color: var(--ink-2); line-height: 1.5; text-align: center; }
.nfc-url { color: var(--green); }

/* --- Card switcher thumbnails --- */
.nfc-thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .9rem; }
.nfc-thumb-card { position: relative; display: flex; flex-direction: column; gap: .55rem; padding: .55rem; background: var(--surface-2); border: 2px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; text-align: left; }
.nfc-thumb-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.nfc-thumb-card.is-selected { border-color: var(--green); background: color-mix(in srgb, var(--green) 8%, var(--surface-2)); }
.nfc-thumb-card.is-selected:hover { transform: translateY(-2px); }
.nfc-thumb-card.is-pending .nfc-thumb-mockup { opacity: .55; filter: saturate(.6); }
.nfc-thumb-card.is-pending .nfc-thumb-name { opacity: .6; }
.nfc-thumb-mockup { position: relative; aspect-ratio: 1.586 / 1; border-radius: 9px; border: 1px solid var(--line-2); overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: .5rem; }
.nfc-thumb-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.3), rgba(0,0,0,.6)); z-index: 0; }
.nfc-thumb-top, .nfc-thumb-name { position: relative; z-index: 1; }
.nfc-thumb-top { display: flex; align-items: center; justify-content: space-between; }
.nfc-thumb-v { width: 15px; height: 15px; background: var(--green); color: var(--green-ink); font-family: var(--display); font-weight: 800; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: .55rem; }
.nfc-thumb-wave { color: var(--green); display: inline-flex; }
.nfc-thumb-wave svg.lucide { width: 12px; height: 12px; }
.nfc-thumb-name { color: #fff; font-family: var(--display); font-weight: 600; font-size: .68rem; letter-spacing: .05em; text-shadow: 0 1px 3px rgba(0,0,0,.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nfc-thumb-meta { display: inline-flex; align-items: center; gap: .35rem; align-self: flex-start; background: var(--surface); border: 1px solid var(--line); padding: .2rem .5rem .2rem .4rem; border-radius: 99px; }
.nfc-thumb-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.nfc-thumb-status { font-size: .62rem; font-weight: 600; letter-spacing: .02em; }
.nfc-thumb-check {
    position: absolute; top: -8px; right: -8px; z-index: 2;
    width: 1.35rem; height: 1.35rem; border-radius: 50%;
    background: var(--green); color: var(--green-ink);
    border: 2px solid var(--surface); box-shadow: 0 2px 6px rgba(0,0,0,.4);
    display: inline-flex; align-items: center; justify-content: center;
}
.nfc-thumb-check svg.lucide { width: 11px; height: 11px; stroke-width: 3; }
.nfc-tone-green { color: var(--green); }   .nfc-dot-green { background: var(--green); }
.nfc-tone-amber { color: var(--amber); }   .nfc-dot-amber { background: var(--amber); }
.nfc-tone-blue  { color: var(--blue); }    .nfc-dot-blue  { background: var(--blue); }
.nfc-tone-neutral { color: var(--ink-3); } .nfc-dot-neutral { background: var(--ink-3); }

/* --- Status checklist --- */
.nfc-steps2 { position: relative; list-style: none; padding: 0 0 1.15rem; margin: 0 0 1.15rem; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.nfc-steps2::before { content: ""; position: absolute; left: .85rem; top: 1.3rem; bottom: 1.3rem; width: 1px; background: var(--line-2); }
.nfc-steps2-row { position: relative; z-index: 1; display: flex; align-items: center; gap: .7rem; padding: .5rem 0; }
.nfc-steps2-ic { position: relative; z-index: 1; flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); }
.nfc-steps2-ic svg.lucide { width: 13px; height: 13px; }
.nfc-steps2-row.is-reached .nfc-steps2-ic { border-color: var(--ink-2); color: var(--ink); }
.nfc-steps2-row.is-current .nfc-steps2-ic { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.nfc-steps2-cur-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-ink); }
.nfc-steps2-label { font-size: .82rem; font-weight: 500; color: var(--ink-3); }
.nfc-steps2-row.is-reached .nfc-steps2-label { color: var(--ink-2); }
.nfc-steps2-row.is-current .nfc-steps2-label { color: var(--ink); font-weight: 700; }
.nfc-steps2-tag { margin-left: auto; font-size: .6rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--green); background: var(--green-soft); padding: .18rem .55rem; border-radius: 99px; }

/* --- Active stats / pending meta --- */
.nfc-stat-block { padding-top: .2rem; }
.nfc-stat-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.nfc-stat-big { font-family: var(--display); font-size: 2.1rem; font-weight: 600; color: var(--ink); line-height: 1; letter-spacing: -.02em; }
.nfc-stat-caption { display: block; font-size: .78rem; color: var(--ink-3); margin-top: .5rem; }
.nfc-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.nfc-meta li { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .82rem; color: var(--ink-2); }
.nfc-meta li:last-child { border-bottom: none; }
.nfc-meta li svg.lucide { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.nfc-meta li .mono { margin-left: auto; color: var(--ink); }

/* --- How it works --- */
.nfc-steps { list-style: none; margin: 0 0 1.1rem; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.nfc-step { display: flex; align-items: flex-start; gap: .7rem; }
.nfc-step-num { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: .74rem; font-weight: 700; }
.nfc-step-desc { line-height: 1.5; font-size: .84rem; color: var(--ink-2); padding-top: .12rem; }

/* --- Order modal --- */
.mdl--wide { max-width: 620px; }
.mdl--wide .mdl-body { max-height: 72vh; overflow-y: auto; }
.nfc-order-seg { width: 100%; display: flex; margin-bottom: 1rem; }
.nfc-order-seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.nfc-order-seg button svg.lucide { width: 14px; height: 14px; }
.nfc-dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; padding: 1.5rem 1rem; border: 1.5px dashed var(--line-2); border-radius: 12px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; text-align: center; }
.nfc-dropzone:hover { border-color: var(--green-line); background: var(--raised); }
.nfc-dropzone > svg.lucide { width: 26px; height: 26px; color: var(--green); margin-bottom: .2rem; }
.nfc-drop-text { font-size: .85rem; font-weight: 600; color: var(--ink); }
.nfc-upload-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.nfc-upload-preview { position: relative; margin-top: .75rem; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.nfc-upload-preview img { display: block; width: 100%; max-height: 160px; object-fit: cover; }
.nfc-upload-clear { position: absolute; top: .5rem; right: .5rem; width: 26px; height: 26px; border-radius: 8px; border: none; background: rgba(0,0,0,.6); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.nfc-upload-clear svg.lucide { width: 14px; height: 14px; }
.nfc-nft-grid { display: flex; gap: .5rem; overflow-x: auto; padding: .1rem 0 .5rem; }
.nfc-nft-grid::-webkit-scrollbar { height: 6px; }
.nfc-nft-grid::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.nfc-nft-thumb { position: relative; flex: none; width: 88px; height: 88px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: .35rem; transition: border-color .15s, transform .15s; }
.nfc-nft-thumb:hover { transform: translateY(-2px); }
.nfc-nft-thumb.is-selected { border-color: var(--green); box-shadow: 0 0 0 1px var(--green-line); }
.nfc-nft-thumb-title { position: relative; font-size: .58rem; font-weight: 700; color: #fff; line-height: 1.2; text-shadow: 0 1px 3px rgba(0,0,0,.8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nfc-nft-thumb-check { position: absolute; top: .3rem; right: .3rem; color: var(--green); display: inline-flex; }
.nfc-nft-thumb-check svg.lucide { width: 15px; height: 15px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.8)); }
.nfc-order-preview-label { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 1.25rem 0 .75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.nfc-order-preview-row { display: grid; grid-template-columns: repeat(2, 260px); justify-content: center; gap: 1.25rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem; }
@media (max-width: 560px) { .nfc-order-preview-row { grid-template-columns: 1fr; justify-items: center; } }
.nfc-order-preview-frame { position: relative; width: 260px; height: 164px; overflow: hidden; border-radius: 16px; flex: none; }
.nfc-order-preview-frame .nfc-order-preview-mockup { position: absolute; top: 0; left: 0; width: 440px; max-width: none; transform: scale(.591); transform-origin: top left; }
.nfc-order-preview-col { display: flex; flex-direction: column; align-items: center; gap: .55rem; }
.nfc-order-preview-caption { font-size: .78rem; color: var(--ink-3); display: inline-flex; align-items: center; gap: .4rem; }
.nfc-order-preview-col.is-active .nfc-order-preview-caption { color: var(--ink); font-weight: 600; }
.nfc-order-preview-col.is-active .nfc-order-preview-caption::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; }
.nfc-order-summary { display: flex; flex-direction: column; gap: .7rem; }
.nfc-summary-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; font-size: .84rem; }
.nfc-summary-row b { color: var(--ink); font-weight: 600; }

/* --- Order steps + shipping form --- */
.nfc-order-steps { list-style: none; display: flex; gap: 1rem; margin: 0 0 1.1rem; padding: 0 0 .9rem; border-bottom: 1px solid var(--line); font-size: .78rem; font-weight: 600; color: var(--ink-3); }
.nfc-order-steps li.is-current { color: var(--green); }
.nfc-order-steps li.is-done { color: var(--ink-2); }
.nfc-ship-form { display: flex; flex-direction: column; gap: .9rem; }
.nfc-ship-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 480px) { .nfc-ship-row { grid-template-columns: 1fr; } }

/* ============================================================================
   AI Chatbot (chat-*) — full-height two-pane chat
   ========================================================================== */
.chat-pg { display: flex; flex-direction: column; }
.chat-shell { display: grid; grid-template-columns: 300px 1fr; gap: 1.15rem; align-items: stretch; height: calc(100vh - 7.5rem); min-height: 540px; transition: grid-template-columns .25s ease, gap .25s ease; }
.chat-shell.is-collapsed { grid-template-columns: 0 1fr; gap: 0; }

/* icon button */
.chat-ic { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); cursor: pointer; flex: none; transition: color .12s, border-color .12s, background .12s; }
.chat-ic:hover:not(:disabled) { color: var(--ink); border-color: var(--line-2); }
.chat-ic:disabled { opacity: .4; cursor: not-allowed; }
.chat-ic svg.lucide { width: 15px; height: 15px; }

.chat-count { font-family: var(--mono); font-size: .62rem; background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 .4rem; min-width: 1.15rem; height: 1.15rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* --- Left panel --- */
.chat-side { display: flex; flex-direction: column; gap: .85rem; min-width: 0; overflow: hidden; padding: 1.1rem; }
.chat-shell.is-collapsed .chat-side { opacity: 0; padding: 0; border-color: transparent; pointer-events: none; }
.chat-side-head { display: flex; align-items: center; justify-content: space-between; }
.chat-side-title { display: flex; align-items: center; gap: .5rem; }
.chat-search { display: flex; align-items: center; gap: .5rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; }
.chat-search svg.lucide { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.chat-search input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--ink); font-family: var(--font); font-size: .82rem; }
.chat-search input::placeholder { color: var(--ink-3); }

.chat-hist-toggle { display: flex; align-items: center; gap: .45rem; width: 100%; background: transparent; border: none; padding: .3rem .15rem; cursor: pointer; border-radius: 7px; color: var(--ink-3); font-family: var(--font); font-size: .68rem; letter-spacing: .08em; }
.chat-hist-toggle:hover { color: var(--ink-2); }
.chat-hist-toggle svg.lucide { width: 13px; height: 13px; flex: none; }
.chat-hist-toggle > span:first-of-type { flex: 1; text-align: left; }

.chat-threads { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .15rem; padding-right: .2rem; margin: 0 -.15rem; }
.chat-threads::-webkit-scrollbar { width: 6px; }
.chat-threads::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.chat-threads-empty { padding: .75rem .25rem; font-size: .8rem; color: var(--ink-3); }
.chat-thread { display: flex; align-items: center; gap: .5rem; width: 100%; cursor: pointer; border: none; border-left: 2px solid transparent; background: transparent; padding: .45rem .55rem; border-radius: 8px; text-align: left; font-family: var(--font); transition: background .12s, border-color .12s; }
.chat-thread:hover { background: var(--surface-2); }
.chat-thread.is-active { border-left-color: var(--green); background: var(--surface-2); }
.chat-thread-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-thread-title { font-size: .84rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-thread-time { font-size: .7rem; color: var(--ink-3); }
.chat-thread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }

.chat-model { border-top: 1px solid var(--line); padding-top: .85rem; }
.chat-model-label { display: block; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .45rem; }
.chat-model .select { width: 100%; }
.chat-model-details { font-size: .72rem; color: var(--ink-3); margin: .5rem 0 0; line-height: 1.4; }

/* --- Center panel --- */
.chat-main { display: flex; flex-direction: column; min-width: 0; padding: 1.1rem 1.25rem; }
.chat-topbar { display: flex; align-items: center; gap: .5rem; padding-bottom: .85rem; margin-bottom: .5rem; border-bottom: 1px solid var(--line); }
.chat-topbar-title { display: flex; align-items: baseline; gap: .6rem; flex: 1; min-width: 0; overflow: hidden; }
.chat-title { font-family: var(--display); font-size: 1.05rem; font-weight: 600; color: var(--ink); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-model-name { font-size: .76rem; color: var(--ink-3); white-space: nowrap; flex: none; }
.chat-rename { font-family: var(--display); font-size: 1rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--green-line); border-radius: 8px; color: var(--ink); padding: .25rem .55rem; min-width: 12rem; outline: none; }
.chat-actions { display: flex; align-items: center; gap: .3rem; position: relative; }
.chat-more { position: relative; }
.chat-more-menu { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 20; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: .35rem; min-width: 13.5rem; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: .1rem; }
.chat-more-item { display: flex; align-items: center; gap: .55rem; width: 100%; background: transparent; border: none; border-radius: 8px; cursor: pointer; padding: .5rem .6rem; font-size: .8rem; color: var(--ink); text-align: left; font-family: var(--font); }
.chat-more-item:hover:not(:disabled) { background: var(--surface-2); }
.chat-more-item svg.lucide { width: 15px; height: 15px; color: var(--ink-3); }
.chat-more-item.is-danger { color: var(--down); }
.chat-more-item.is-danger svg.lucide { color: var(--down); }
.chat-more-item:disabled { opacity: .45; cursor: not-allowed; }

.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1.15rem; padding: .85rem .35rem .5rem 0; }
.chat-messages::-webkit-scrollbar { width: 7px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }

.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .2rem; }
.chat-empty-ic { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); margin-bottom: .7rem; }
.chat-empty-ic svg.lucide { width: 23px; height: 23px; }
.chat-empty-title { font-family: var(--display); font-weight: 600; color: var(--ink); font-size: .95rem; margin: 0; }
.chat-empty-sub { font-size: .82rem; color: var(--ink-3); margin: .25rem 0 0; }

.chat-msg { display: flex; flex-direction: column; }
.chat-msg-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.chat-av { font-size: .7rem !important; }
.chat-av--user { background: var(--surface-2); color: var(--ink); border-color: var(--line-2); }
.chat-av--ai { background: var(--green); color: var(--green-ink); border-color: var(--green); }
.chat-msg-who { font-size: .8rem; font-weight: 600; color: var(--ink); }
.chat-msg-time { font-size: .7rem; color: var(--ink-3); }

.chat-bubble { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; color: var(--ink-2); font-size: .88rem; line-height: 1.6; max-width: 90%; align-self: flex-start; }
.chat-bubble.is-user { background: var(--raised); color: var(--ink); align-self: flex-end; }
.chat-bubble p { margin: 0 0 .5rem; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-list { margin: .35rem 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .25rem; }
.chat-code-wrap { position: relative; margin: .55rem 0; }
.chat-code-lang { position: absolute; top: .4rem; right: .55rem; font-family: var(--mono); font-size: .64rem; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line); padding: .1rem .4rem; border-radius: 6px; text-transform: lowercase; }
.chat-code { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; padding-right: 4.5rem; font-family: var(--mono); font-size: .8rem; color: var(--ink); white-space: pre-wrap; word-break: break-word; margin: 0; overflow-x: auto; }

.chat-msg-actions { display: flex; gap: .3rem; margin-top: .45rem; }
.chat-msg-action { display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; border-radius: 8px; background: transparent; border: 1px solid var(--line); color: var(--ink-3); cursor: pointer; transition: color .12s, border-color .12s, background .12s; }
.chat-msg-action:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-2); }
.chat-msg-action svg.lucide { width: 13px; height: 13px; }

/* streaming affordances */
.chat-typing { display: inline-flex; gap: .3rem; align-items: center; height: 1rem; }
.chat-typing span { width: .42rem; height: .42rem; border-radius: 50%; background: var(--green); opacity: .5; animation: chat-bounce 1.2s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chat-bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .35; } 40% { transform: scale(1); opacity: 1; } }
.chat-cursor { display: inline-block; width: .5rem; height: 1rem; margin-left: .12rem; background: var(--green); vertical-align: text-bottom; animation: chat-blink 1s step-end infinite; }
@keyframes chat-blink { 50% { opacity: 0; } }

/* quick prompts */
.chat-quick { display: flex; flex-wrap: wrap; gap: .45rem; padding: .75rem 0 .6rem; }
.chat-quick-btn { display: inline-flex; align-items: center; gap: .35rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; color: var(--ink-2); font-family: var(--font); font-size: .74rem; font-weight: 500; padding: .35rem .65rem; cursor: pointer; transition: color .12s, border-color .12s; }
.chat-quick-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--line-2); }
.chat-quick-btn:disabled { opacity: .5; cursor: not-allowed; }
.chat-quick-btn svg.lucide { width: 13px; height: 13px; color: var(--ink-3); }

/* composer */
.chat-composer { display: flex; gap: .6rem; align-items: flex-end; border-top: 1px solid var(--line); padding-top: .85rem; }
.chat-composer-input { flex: 1; min-width: 0; resize: none; max-height: 40vh; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .95rem; color: var(--ink); font-family: var(--font); font-size: .88rem; line-height: 1.5; }
.chat-composer-input::placeholder { color: var(--ink-3); }
.chat-composer-input:focus { outline: none; border-color: var(--green-line); box-shadow: 0 0 0 3px var(--primary-ring-soft); }
.chat-send { padding: 0; width: 44px; height: 44px; flex: none; justify-content: center; }
.chat-send svg.lucide { width: 17px; height: 17px; }

@media (max-width: 900px) {
    .chat-shell { grid-template-columns: 1fr; height: auto; }
    .chat-shell .chat-side { height: auto; }
    .chat-main { height: calc(100vh - 9rem); min-height: 480px; }
}

/* ============================================================================
   BootstrapBlazor Swal dialogs — themed to the console palette.
   Scoped to .swal so app/landing buttons elsewhere are unaffected.
   ========================================================================== */
/* Same chrome + backdrop as the custom .mdl modals. */
.modal-backdrop { --bs-backdrop-bg: #040609; --bs-backdrop-opacity: .62; backdrop-filter: blur(3px); }
.modal.swal .modal-dialog { max-width: 420px; }
.modal.swal .modal-content { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-modal); overflow: hidden; }
/* Equal padding on all four sides — same token as the custom .mdl modals. */
.modal.swal .modal-body { padding: var(--modal-pad); }
.modal.swal .swal2-icon { margin: 0 auto 1.1rem; }
.modal.swal .swal2-header { margin-bottom: var(--space-2); padding: 0; }
.modal.swal .swal2-title { font-family: var(--display); font-weight: 600; color: var(--ink); font-size: 1.2rem; }
.modal.swal .swal2-content { color: var(--ink-2); font-size: var(--text-base); line-height: 1.55; justify-content: center; text-align: center; }
.modal.swal .swal2-actions { display: flex; gap: var(--space-3); margin: 1.5rem 0 0; }

/* No draw-in animation on the status icon — it fades in with the dialog. */
.modal.swal .swal2-icon,
.modal.swal .swal2-icon [class^="swal2-"] { animation: none !important; }

/* Buttons fill the width: a single button spans, two buttons split evenly. */
.modal.swal .btn { flex: 1; justify-content: center; border-radius: 10px; font-weight: 600; font-size: var(--text-sm); padding: .65rem 1.1rem; border: 1px solid transparent; display: inline-flex; align-items: center; gap: var(--space-2); transition: background .15s, border-color .15s, color .15s; }
.modal.swal .btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.modal.swal .btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.modal.swal .btn-secondary { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.modal.swal .btn-secondary:hover { background: var(--raised); border-color: var(--line-2); }
.modal.swal .btn-danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.modal.swal .btn-danger:hover { border-color: var(--danger); }

/* Status icons tinted to the matching semantic role. */
.modal.swal .swal2-icon.swal2-error { border-color: var(--danger-line); }
.modal.swal .swal2-icon.swal2-error .swal2-x-mark-line-left,
.modal.swal .swal2-icon.swal2-error .swal2-x-mark-line-right { background-color: var(--danger); }
.modal.swal .swal2-icon.swal2-warning { border-color: var(--warning-line); color: var(--warning); }
.modal.swal .swal2-icon.swal2-question { border-color: var(--info-line); color: var(--info); }
.modal.swal .swal2-icon.swal2-success { border-color: var(--primary-line); color: var(--primary); }
.modal.swal .swal2-icon.swal2-success .swal2-success-line-tip,
.modal.swal .swal2-icon.swal2-success .swal2-success-line-long { background-color: var(--primary); }

/* ============================================================================
   BootstrapBlazor toasts — themed to the console palette (scoped to .toast).
   ========================================================================== */
.toast { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow-pop); color: var(--ink); }
.toast-header { background: transparent; border-bottom: 1px solid var(--line); }
.toast-header strong { color: var(--ink); font-family: var(--display); font-weight: 600; }
.toast-body { color: var(--ink-2); font-size: var(--text-sm); line-height: 1.5; }
.toast .btn-close { filter: invert(1) grayscale(1); opacity: .45; }
.toast .btn-close:hover { opacity: .85; }

/* Category accent maps onto the matching semantic role. */
.toast .text-success { color: var(--primary) !important; }
.toast .text-danger  { color: var(--danger)  !important; }
.toast .text-warning { color: var(--warning) !important; }
.toast .text-info    { color: var(--info)     !important; }
.toast-progress.bg-success { background: var(--primary) !important; }
.toast-progress.bg-danger  { background: var(--danger)  !important; }
.toast-progress.bg-warning { background: var(--warning) !important; }
.toast-progress.bg-info    { background: var(--info)     !important; }
