@import url('shared-ui.css?v=20260824txnhint3');

/* Fonts loaded via <link> in HTML - do not @import here (breaks CSS on some CDN/CSP setups) */
/* ===== CSS Custom Properties ===== */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --bg-primary: #0a0a0f;
    --bg-surface: rgba(15, 15, 23, 0.8);
    --bg-secondary: #12121a;
    --bg-elevated: rgba(30, 30, 46, 0.8);
    --bg-hover: rgba(139, 92, 246, 0.08);
    --bg-active: rgba(139, 92, 246, 0.15);

    --border: rgba(139, 92, 246, 0.2);
    --border-hover: rgba(139, 92, 246, 0.4);
    --border-active: rgba(139, 92, 246, 0.6);

    --text-primary: #e4e4e7;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-faint: rgba(255, 255, 255, 0.25);

    --accent: #8b5cf6;
    --accent-hover: #a78bfa;
    --accent-muted: rgba(139, 92, 246, 0.15);
    --accent-cyan: #a78bfa;

    --violet-300: #c4b5fd;
    --violet-400: #a78bfa;
    --violet-500: #8b5cf6;
    --violet-600: #7c3aed;
    --violet-700: #6d28d9;
    /* legacy aliases - mapped to violet (no teal/cyan in UI) */
    --cyan-300: #c4b5fd;
    --cyan-400: #a78bfa;
    --cyan-500: #8b5cf6;
    --emerald-300: #6ee7b7;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --amber-300: #fcd34d;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --green-300: #86efac;
    --green-400: #4ade80;
    --green-500: #22c55e;
    --yellow-300: #fde047;
    --yellow-400: #facc15;
    --pink-300: #f9a8d4;
    --pink-400: #f472b6;
    --blue-300: #93c5fd;
    --blue-400: #60a5fa;
    --red-400: #f87171;
    --red-500: #ef4444;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;

    --sidebar-width: 260px;
    --sidebar-collapsed-width: 0px;
    --header-height: 60px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;

    --glass-blur: blur(20px);
    --glass-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(139, 92, 246, 0.1);

    /* Roblox163 pattern - one surface, one active state, accent = border + icon only */
    --surface: rgba(15, 15, 23, 0.85);
    --surface-solid: #12121a;
    --surface-hover: rgba(139, 92, 246, 0.06);
    --state-active-bg: rgba(139, 92, 246, 0.12);
    --state-active-border: var(--border-hover);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(139, 92, 246, 0.12);

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms ease;
}

/* ===== Reset / Normalize ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

input {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
}

ul, ol {
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 30, 46, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}

/* ===== Grid Overlay Background ===== */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    background-image: none;
    z-index: -1;
    pointer-events: none;
}

/* ===== Layout ===== */
body:not(.login-page) {
    display: flex;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    background: rgba(15, 15, 23, 0.85);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-slow), width var(--transition-slow);
    overflow: hidden;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-slow);
}

/* ===== Sidebar ===== */
.sidebar-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(139, 92, 246, 0.25);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: opacity var(--transition-fast), background var(--transition-fast);
}

.sidebar-logo:hover {
    opacity: 0.92;
}

.sidebar-logo:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.sidebar-logo .logo-icon {
    width: 44px;
    height: 44px;
}

.logo-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    white-space: nowrap;
    color: var(--text-primary);
}

/* Sidebar Search */
.sidebar-games-search {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

.sidebar-games-search .search-icon {
    position: static;
    color: var(--text-muted);
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.games-search-input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: inherit;
    width: 100%;
}

.games-search-input::placeholder {
    color: var(--text-faint);
}

/* Sidebar Games List */
.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.2) transparent;
}

.games-list-container {
    padding: 0 8px;
}

.game-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
    text-decoration: none;
    color: var(--text-secondary);
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(139, 92, 246, 0.12);
}

.game-item:hover {
    background: rgba(139, 92, 246, 0.08);
    color: var(--text-primary);
}

.game-item.active {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid var(--border-hover);
    color: var(--text-primary);
}

.game-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--violet-500, #8b5cf6);
    border-radius: 0 4px 4px 0;
}

.game-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.game-item-icon-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
}

.game-item-info {
    flex: 1;
    min-width: 0;
}

.game-item-name {
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.game-item-accounts {
    font-size: 0.65rem;
    color: var(--text-muted);
    display: block;
}

.game-item .favorite-btn {
    padding: 4px;
    border-radius: 6px;
    color: var(--text-faint);
    transition: all var(--transition-fast);
    opacity: 0;
    flex-shrink: 0;
}

.game-item:hover .favorite-btn {
    opacity: 0.6;
}

.game-item .favorite-btn:hover,
.game-item .favorite-btn.favorited {
    color: var(--red-400);
    opacity: 1;
}

.game-item .favorite-btn svg {
    width: 14px;
    height: 14px;
}

/* Sidebar Bottom - User Card */
.sidebar-bottom {
    border-top: 1px solid var(--border);
    position: relative;
    flex-shrink: 0;
}

.sidebar-bottom::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(139, 92, 246, 0.25);
}

.sidebar-user-card {
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 36px 1fr 32px;
    grid-template-rows: auto auto;
    gap: 8px 10px;
    align-items: center;
    transition: background var(--transition-fast);
}

.sb-user-avatar {
    grid-column: 1;
    grid-row: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid #8b5cf6;
    background: var(--bg-primary);
    background-image: none;
    cursor: pointer;
}

.sb-user-info {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sb-user-profile-hit {
    cursor: pointer;
}

.header-user-card.sidebar-user-card {
    position: relative;
}

.header-user-card.sidebar-user-card.is-menu-open {
    background: rgba(139, 92, 246, 0.08);
}

.header-user-card .sb-user-menu {
    grid-column: 1 / -1;
    grid-row: 1;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: auto;
    min-width: 100%;
    width: max-content;
    max-width: min(220px, 80vw);
    padding: 6px;
    margin: 0;
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.28);
    background: rgba(18, 18, 28, 0.96);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
}

.header-user-card .sb-user-menu[hidden] {
    display: none !important;
}

.header-user-card .sb-user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.75rem;
    border-radius: 7px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background 0.12s ease, color 0.12s ease;
}

.header-user-card .sb-user-menu-item > svg {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    overflow: visible;
    color: #a78bfa;
    transition: color 0.12s ease;
}

.header-user-card .sb-user-menu-label {
    flex: 1;
    min-width: 0;
}

.header-user-card .sb-user-menu-item:hover > svg,
.header-user-card .sb-user-menu-item:focus-visible > svg,
.header-user-card .sb-user-menu-item.active > svg,
.header-user-card .sb-user-menu-item[aria-current="page"] > svg {
    color: #c4b5fd;
}

.header-user-card .sb-user-menu-item--danger > svg {
    color: #f87171;
}

.header-user-card .sb-user-menu-item--danger:hover > svg,
.header-user-card .sb-user-menu-item--danger:focus-visible > svg {
    color: #fca5a5;
}

.header-user-card .sb-user-menu-item:hover,
.header-user-card .sb-user-menu-item:focus-visible {
    background: rgba(139, 92, 246, 0.18);
    color: #fff;
    outline: none;
}

.header-user-card .sb-user-menu-item.active,
.header-user-card .sb-user-menu-item[aria-current="page"] {
    background: rgba(139, 92, 246, 0.28);
    color: #fff;
}

.header-user-card .sb-user-menu-item--danger {
    margin-top: 4px;
    border: none;
    border-top: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 0 0 7px 7px;
    color: #fca5a5;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.header-user-card .sb-user-menu-item--danger:hover,
.header-user-card .sb-user-menu-item--danger:focus-visible {
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
}

.sb-logout-btn {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    justify-self: end;
}

.sb-user-controls {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user-card:hover .sb-user-profile-hit .sb-user-name,
.sidebar-user-card:hover .sb-user-avatar {
    color: var(--text-primary);
}

.sidebar-user-card:hover {
    background: rgba(139, 92, 246, 0.05);
}

.sb-user-avatar:hover {
    opacity: 0.92;
}

.sb-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-user-balance {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--success);
    font-family: var(--font-sans);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.currency-switch-compact { padding: 1px; gap: 1px; }
.currency-switch-compact .currency-btn { padding: 1px 5px; font-size: 0.65rem; }

.lang-switch-compact { padding: 1px; flex-shrink: 0; }
.lang-switch-compact .lang-switch-btn { padding: 1px 5px; font-size: 0.65rem; }

.sb-user-controls .currency-switch-compact,
.sb-user-controls .lang-switch-compact {
    flex: 1;
    justify-content: center;
}

/* Quick Links (always visible) */
.sidebar-quick-links {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex-shrink: 0;
}

.sb-link-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sb-link-group-title {
    padding: 0 4px 2px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sb-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(139, 92, 246, 0.12);
}

.sb-link-item:hover {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.sb-link-item.active {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid var(--border-hover);
    color: var(--violet-400);
}

.sb-link-item svg {
    flex-shrink: 0;
}

.sb-logout-btn {
    padding: 6px;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sb-logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red-400);
}

/* Language Switch */
.sidebar-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-switch {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.lang-switch-btn {
    padding: 3px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    letter-spacing: 0.04em;
    cursor: pointer;
    border: none;
    background: none;
}

.lang-switch-btn:hover {
    color: var(--text-primary);
}

.lang-switch-btn.active {
    background: rgba(139, 92, 246, 0.15);
    color: var(--text-primary);
}

.lang-switch-header {
    display: none;
}

/* Currency Switch (legacy) */
.currency-switch { display: flex; gap: 2px; background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 6px; padding: 2px; overflow: hidden; }
.currency-btn { padding: 3px 8px; border-radius: 4px; border: none; background: none; color: var(--text-muted); font-size: 0.7rem; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); letter-spacing: 0.04em; }
.currency-btn:hover { color: var(--text-primary); }
.currency-btn.active { background: rgba(139, 92, 246, 0.15); color: var(--text-primary); }

.header-right .ui-combobox-menu {
    z-index: 200;
}

/* ===== Header ===== */
.main-header {
    height: var(--header-height);
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 15, 23, 0.92);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    position: sticky;
    top: 0;
    z-index: 200;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.menu-toggle:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.menu-toggle svg {
    width: 20px;
    height: 20px;
}

.header-page-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-sans);
    letter-spacing: -0.02em;
    line-height: 1.35;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.header-actions-group {
    display: flex;
    align-items: center;
    gap: 2px;
    position: relative;
}

.header-balance-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 20px;
    color: var(--success);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-balance-pill:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
}

.header-balance-pill svg {
    color: var(--success);
    opacity: 0.7;
}

.header-community-user-stat,
.community-user-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.08);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.header-community-user-stat.ui-hint-tip,
.community-user-stat.ui-hint-tip {
    cursor: default;
}

.community-user-stat-trigger {
    display: inline-flex;
    align-items: center;
    gap: inherit;
}

.header-community-user-stat.ui-hint-tip .ui-hint-tip-bubble,
.community-user-stat.ui-hint-tip .ui-hint-tip-bubble {
    white-space: normal;
    min-width: 10rem;
    max-width: 16rem;
}

.community-user-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success, #22c55e);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.55);
    flex-shrink: 0;
}

.header-user-btn {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #8b5cf6;
    background: var(--bg-primary);
    background-image: none;
    transition: all var(--transition-fast);
}

.header-user-btn:hover .header-avatar {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.icon-btn {
    padding: 7px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.color-scheme-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.color-dot-cyan { background: var(--cyan-400); }
.color-dot-violet { background: var(--violet-400); }
.color-dot-emerald { background: var(--emerald-400); }
.color-dot-amber { background: var(--amber-400); }

.color-dot.active {
    border-color: var(--text-primary);
    transform: scale(1.2);
    box-shadow: 0 0 8px currentColor;
}

/* ===== Main Body ===== */
.main-body {
    flex: 1;
    padding: 24px;
}

/* ===== Dashboard ===== */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== Stats Section ===== */
.stats-section {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    flex: 1;
}

.stat-card {
    position: relative;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--surface-border, var(--border));
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card::before {
    display: none;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--state-active-border);
    box-shadow: var(--shadow-hover);
}

.stat-card-violet:hover,
.stat-card-cyan:hover,
.stat-card-emerald:hover,
.stat-card-amber:hover {
    box-shadow: var(--shadow-hover);
}

.stat-glow {
    position: absolute;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    filter: blur(36px);
    opacity: 0.08;
    pointer-events: none;
    top: -16px;
    right: -16px;
}

.stat-glow-cyan { background: var(--violet-400); }
.stat-glow-violet { background: var(--violet-400); }
.stat-glow-emerald { background: var(--emerald-400); }
.stat-glow-amber { background: var(--amber-400); }

.stat-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-icon {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.stat-card-cyan .stat-icon { color: var(--violet-400); }
.stat-card-violet .stat-icon { color: var(--violet-400); }
.stat-card-emerald .stat-icon { color: var(--emerald-400); }
.stat-card-amber .stat-icon { color: var(--amber-400); }

.stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-family: var(--font-sans);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.stat-separator {
    color: var(--text-muted);
    font-weight: 400;
    margin: 0 2px;
}

.stat-rate {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    font-family: var(--font-sans);
}

.stat-card-cyan .stat-rate { color: var(--text-muted); }
.stat-card-amber .stat-rate { color: var(--text-muted); }

.stat-action {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.stat-action:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.stat-action svg {
    width: 14px;
    height: 14px;
}

/* Activity Chart */
.activity-chart {
    min-width: 220px;
    max-width: 280px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(15, 15, 23, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    box-shadow: var(--glass-shadow);
}

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

.chart-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.chart-period {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
}

.chart-placeholder {
    width: 100%;
    height: 80px;
}

.mini-chart {
    width: 100%;
    height: 100%;
    color: var(--violet-300);
}

.mini-chart path[stroke] {
    stroke: var(--violet-300);
}

/* ===== Toolbar ===== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: rgba(15, 15, 23, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    box-shadow: var(--glass-shadow);
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-mode-switch { display: flex; gap: 2px; background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 6px; padding: 2px; flex-shrink: 0; }
.search-mode-btn { padding: 4px 10px; border-radius: 4px; border: none; background: none; color: var(--text-muted); font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); white-space: nowrap; }
.search-mode-btn:hover { color: var(--text-primary); }
.search-mode-btn.active { background: rgba(139, 92, 246, 0.15); color: var(--text-primary); }

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    width: 15px;
    height: 15px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    padding: 8px 12px 8px 32px;
    border-radius: var(--radius-md);
    background: rgba(30, 30, 46, 0.8);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.82rem;
    width: 200px;
    transition: all var(--transition-fast);
}

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

.search-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
}

/* Radio Buttons */
.filter-radios {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: var(--radius-md);
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid var(--border);
}

.radio-btn {
    display: flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
}

.radio-btn input {
    display: none;
}

.radio-btn:hover {
    color: var(--text-secondary);
}

.radio-btn.active {
    background: var(--bg-active);
    color: var(--accent);
}

/* Toolbar Buttons */
.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.toolbar-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.toolbar-btn svg {
    width: 14px;
    height: 14px;
}

.toolbar-btn.active {
    background: var(--accent-muted);
    color: var(--accent);
}

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}

.view-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border-radius: var(--radius-sm);
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid var(--border);
}

.view-btn {
    padding: 5px;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.view-btn:hover {
    color: var(--text-secondary);
}

.view-btn.active {
    background: var(--bg-active);
    color: var(--accent);
}

.view-btn svg {
    width: 15px;
    height: 15px;
}

/* ===== Data Table ===== */
.table-container {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    background: rgba(15, 15, 23, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.data-table thead {
    background: rgba(139, 92, 246, 0.1);
    border-bottom: 1px solid var(--border);
}

.data-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8b5cf6;
    white-space: nowrap;
    user-select: none;
}

.data-table th.sortable {
    cursor: pointer;
    transition: color var(--transition-fast);
}

.data-table th.sortable:hover {
    color: var(--accent-hover);
}

.data-table th.sortable::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--text-faint);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.data-table th.sortable:hover::after {
    opacity: 1;
}

.data-table th.sort-asc::after {
    opacity: 1;
    border-top: none;
    border-bottom: 4px solid #8b5cf6;
}

.data-table th.sort-desc::after {
    opacity: 1;
    border-top: 4px solid #8b5cf6;
}

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

.data-table tbody tr.account-row {
    cursor: pointer;
    user-select: none;
}

.data-table tbody tr.account-row.is-selected {
    background: rgba(139, 92, 246, 0.12);
}

.data-table tbody tr.account-row.is-selected:hover {
    background: rgba(139, 92, 246, 0.16);
}

.data-table tbody tr.account-row .td-checkbox,
.data-table tbody tr.account-row .badge-clickable,
.data-table tbody tr.account-row .account-delete-btn {
    cursor: pointer;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.th-checkbox,
.td-checkbox {
    width: 40px;
    text-align: center;
}

/* Compact mode */
.compact .data-table td {
    padding: 5px 12px;
}

.compact .stat-card {
    padding: 12px;
}

/* ===== Account Cell ===== */
.account-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.th-stt,
.td-stt {
    width: 44px;
    min-width: 44px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.account-delete-btn {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.account-row:hover .account-delete-btn,
.account-delete-btn:focus-visible {
    opacity: 1;
}

.account-delete-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.toolbar-btn-danger:not(:disabled) {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.35);
}

.toolbar-btn-danger:not(:disabled):hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.status-online {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.45);
}

.status-dot.status-offline {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.status-dot.status-kicked {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.55);
}

.account-meta-kicked {
    color: #f59e0b;
}

.inv-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.inv-synced {
    color: var(--text-muted, #94a3b8);
    font-size: 0.7rem;
    font-family: var(--font-sans);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.account-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.account-username {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-sans);
    letter-spacing: -0.01em;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-variant-numeric: tabular-nums;
    line-height: 1.45;
    letter-spacing: 0;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid;
}

.badge-green {
    color: var(--green-300);
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
}

.badge-yellow {
    color: var(--yellow-300);
    background: rgba(250, 204, 21, 0.12);
    border-color: rgba(250, 204, 21, 0.3);
}

.badge-pink {
    color: var(--pink-300);
    background: rgba(244, 114, 182, 0.12);
    border-color: rgba(244, 114, 182, 0.3);
}

.badge-violet {
    color: var(--violet-300);
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.3);
}

.badge-blue {
    color: var(--blue-300);
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.3);
}

.badge-amber {
    color: var(--amber-300);
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
}

.badge-clickable { cursor: pointer; transition: all var(--transition-fast); }
.badge-clickable:hover { filter: brightness(1.3); transform: scale(1.05); }

.badge-emerald {
    color: var(--emerald-300);
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}

.badge-slate {
    color: var(--slate-300);
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.25);
}

.badge-red {
    color: var(--red-400);
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}

.badge-cyan {
    color: var(--cyan-300);
    background: rgba(196, 181, 253, 0.12);
    border-color: rgba(196, 181, 253, 0.3);
}

/* ===== Checkbox ===== */
.checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.checkbox-wrapper input {
    display: none;
}

.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border-hover);
    border-radius: 4px;
    transition: all var(--transition-fast);
    position: relative;
    background: transparent;
}

.checkbox-custom::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid var(--bg-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform var(--transition-fast);
}

.checkbox-wrapper input:checked + .checkbox-custom {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.checkbox-wrapper input:checked + .checkbox-custom::after {
    transform: rotate(45deg) scale(1);
}

/* ===== Toggle card (reusable switch row) ===== */
.ui-toggle-card {
    position: relative;
    border-radius: var(--radius-md);
    background: rgba(30, 30, 46, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.28);
    /* visible so ? tip bubbles are not clipped above the card */
    overflow: visible;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.ui-toggle-card.is-on {
    border-color: rgba(139, 92, 246, 0.55);
    background: rgba(30, 30, 46, 0.92);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.08);
}

.ui-toggle-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.ui-toggle-card-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    flex: 1;
    min-width: 0;
}

.ui-toggle-card-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
}

.ui-toggle-card-tip {
    display: inline-flex;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Show tip on whole row hover/focus (not only the ? control). */
.ui-toggle-card-row[data-has-tip]:hover .ui-toggle-card-tip .ui-hint-tip-bubble,
.ui-toggle-card-row[data-has-tip]:focus-within .ui-toggle-card-tip .ui-hint-tip-bubble {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ui-toggle-card-label-meta {
    display: inline;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.ui-toggle-card-desc {
    display: block;
    flex: 1 0 100%;
    margin-top: 3px;
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.ui-toggle-card-hint,
.ui-toggle-card .ui-hint.ui-toggle-card-hint {
    margin: 0;
    padding: 10px 14px 12px;
    border-top: 1px solid rgba(139, 92, 246, 0.14);
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.ui-toggle-card.is-on .ui-toggle-card-hint,
.ui-toggle-card.is-on .ui-hint.ui-toggle-card-hint {
    color: var(--text-secondary);
}

.ui-toggle-switch {
    position: relative;
    flex-shrink: 0;
    width: 46px;
    height: 26px;
}

.ui-toggle-switch-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.ui-toggle-switch-track {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
}

.ui-toggle-switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.ui-toggle-switch-input:checked + .ui-toggle-switch-track {
    background: rgba(139, 92, 246, 0.35);
    border-color: rgba(139, 92, 246, 0.65);
    box-shadow: inset 0 0 12px rgba(139, 92, 246, 0.15);
}

.ui-toggle-switch-input:checked + .ui-toggle-switch-track::after {
    transform: translateX(20px);
    background: #ddd6fe;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.55);
}

.ui-toggle-switch-input:focus-visible + .ui-toggle-switch-track {
    outline: 2px solid rgba(139, 92, 246, 0.55);
    outline-offset: 2px;
}

.ui-toggle-switch-input:disabled + .ui-toggle-switch-track {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ===== Currency picker (form segmented control) ===== */
.ui-currency-picker {
    width: 100%;
}

.ui-currency-picker-track {
    display: flex;
    gap: 6px;
    width: 100%;
    padding: 5px;
    border-radius: var(--radius-md);
    background: rgba(30, 30, 46, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-sizing: border-box;
}

.ui-currency-picker-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: calc(var(--radius-md) - 3px);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.ui-currency-picker-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(139, 92, 246, 0.15);
}

.ui-currency-picker-btn.active {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.55);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.12), 0 4px 14px rgba(139, 92, 246, 0.12);
}

.ui-currency-picker-btn:focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.55);
    outline-offset: 2px;
}

.ui-currency-picker-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.ui-currency-picker-btn.active .ui-currency-picker-symbol {
    background: rgba(139, 92, 246, 0.35);
    color: #ede9fe;
}

.ui-currency-picker-label {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ui-currency-picker.ui-currency-picker-compact .ui-currency-picker-track {
    padding: 3px;
    gap: 3px;
}

.ui-currency-picker.ui-currency-picker-compact .ui-currency-picker-btn {
    min-height: 32px;
    padding: 4px 10px;
    gap: 6px;
    font-size: 0.72rem;
}

.ui-currency-picker.ui-currency-picker-compact .ui-currency-picker-symbol {
    width: 22px;
    height: 22px;
    font-size: 0.82rem;
    border-radius: 6px;
}

/* Combobox + locale modal -> shared-ui.css
   Layout overrides live here so cache-busted style.css wins over a stale shared-ui @import.
   Root conflict was .ui-combobox-option-prefix { width: 28px } (no overflow), which let
   long codes (VIETBANK/COOPBANK) paint over .ui-combobox-option-text. */
.ui-combobox-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ui-combobox-option-prefix {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 28px;
    width: max-content;
    max-width: 7.5rem;
    height: 28px;
    padding: 0 8px;
    margin: 0;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ui-combobox-option-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Table Footer / Pagination ===== */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.table-info {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--accent);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-btn svg {
    width: 16px;
    height: 16px;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 2px;
}

.page-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.page-number:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.page-number.active {
    background: var(--accent-muted);
    color: var(--accent);
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* ===== Login Page ===== */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.login-bg-gradient {
    position: absolute;
    inset: 0;
    background: rgba(139, 92, 246, 0.08);
}

.login-bg-grid {
    position: absolute;
    inset: 0;
    background-image: none;
}

.login-bg-radial {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.08);
}

.login-container {
    position: relative;
    z-index: 1;
}

.login-card {
    padding: 0;
    border-radius: var(--radius-xl);
    background: transparent;
}

.login-card-inner {
    padding: 40px;
    border-radius: var(--radius-xl);
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    min-width: 380px;
    box-shadow: var(--glass-shadow);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.login-logo .logo-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.login-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.login-body {
    margin-bottom: 24px;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: #fff;
    color: #181825;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.08);
}

.google-btn:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.15);
}

.google-icon {
    width: 20px;
    height: 20px;
}

.login-footer {
    text-align: center;
}

.login-footer p {
    font-size: 0.75rem;
    color: var(--text-faint);
}

.page-footer {
    position: fixed;
    bottom: 20px;
    text-align: center;
    z-index: 1;
}

/* ===== Landing Page ===== */
.landing-page {
    justify-content: flex-start;
    padding: 24px 20px 40px;
    background: #0a0a0f;
    overflow-x: hidden;
}

.landing-page::after {
    display: none;
}

.landing-page .grid-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: rgba(10, 8, 20, 0.35);
    background-image: none;
}

.landing-page #threejs-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.landing-page #threejs-bg canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.landing-wrap {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
}

.landing-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 48px;
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    border-radius: 10px;
    transition: opacity var(--transition-fast);
}

.landing-brand:hover {
    opacity: 0.92;
}

.landing-brand:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.landing-brand .logo-icon {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.landing-top-btn {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.landing-top-btn:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.55);
}

.landing-main {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.landing-hero {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}

.landing-eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.landing-headline {
    font-size: clamp(1.75rem, 4vw, 2.4rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    color: #e2e8f0;
    letter-spacing: -0.02em;
}

.landing-lead {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.landing-feature {
    padding: 20px;
    border-radius: var(--radius-lg);
    background: rgba(15, 15, 23, 0.75);
    border: 1px solid rgba(139, 92, 246, 0.15);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.landing-feature:hover {
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(20, 18, 32, 0.92);
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(139, 92, 246, 0.16);
}

.landing-feature:hover .landing-feature-icon {
    background: rgba(139, 92, 246, 0.22);
    border-color: rgba(139, 92, 246, 0.45);
}

.landing-feature-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: var(--accent);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.landing-feature-icon svg {
    width: 20px;
    height: 20px;
}

.landing-feature h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.landing-feature p {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.landing-footer {
    margin-top: 48px;
    text-align: center;
}

.landing-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-faint);
}

@media (max-width: 640px) {
    .landing-page {
        padding: 16px 16px 32px;
    }

    .landing-top {
        margin-bottom: 32px;
    }

    .landing-features {
        grid-template-columns: 1fr;
    }
}

.page-footer p {
    font-size: 0.72rem;
    color: var(--text-faint);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all var(--transition-fast);
    cursor: pointer;
    white-space: nowrap;
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--text-primary);
}

.btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-primary,
.btn.btn-primary,
.btn.btn-primary.btn-lg,
a.btn.btn-primary,
a.btn.btn-primary.btn-lg {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid var(--border-hover);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: none;
}

.btn-primary:hover,
.btn.btn-primary:hover,
.btn.btn-primary.btn-lg:hover,
a.btn.btn-primary:hover,
a.btn.btn-primary.btn-lg:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.btn-secondary {
    background: rgba(30, 30, 46, 0.6);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.btn-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--accent);
    border-color: transparent;
    transform: none;
    box-shadow: none;
}

.btn-danger {
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    font-weight: 600;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

.btn-warning {
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--amber-300);
    font-weight: 600;
}

.btn-warning:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
    transform: translateY(-2px);
}

.btn-lg,
.btn.btn-lg {
    padding: 12px 24px;
    font-size: 0.9rem;
}

.btn.btn-secondary.btn-lg {
    background: rgba(30, 30, 46, 0.6);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: none;
}

.btn.btn-secondary.btn-lg:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--border-hover);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.btn.btn-primary.btn-lg {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid var(--border-hover);
    box-shadow: none;
}

.btn.btn-primary.btn-lg:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.wallet-balance-actions .btn.btn-primary,
.wallet-balance-actions .btn.btn-primary.btn-lg {
    min-width: 120px;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 700;
    min-height: 44px;
}

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Modal / locale settings -> shared-ui.css */

.app-dialog-overlay {
    z-index: 10250;
}

.app-dialog {
    max-width: 440px;
}

.app-dialog-body {
    white-space: pre-wrap;
    word-break: break-word;
}

.app-dialog-body-mono {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    max-height: 240px;
    overflow-y: auto;
}

.app-dialog-input-wrap {
    margin-top: 14px;
}

.app-dialog-input {
    width: 100%;
}

.app-dialog-input-error {
    border-color: var(--red-400) !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.app-dialog--error .modal-title {
    color: #fca5a5;
}

.app-dialog--warning .modal-title {
    color: #fcd34d;
}

.app-dialog--success .modal-title {
    color: #6ee7b7;
}

/* (header balance moved to .header-balance-pill above) */

/* ===== Notification Bell ===== */
.header-notification-btn {
    position: relative;
}

.notification-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: var(--red-400);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 0 6px rgba(248, 113, 113, 0.5);
}

.notification-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(360px, calc(100vw - 24px));
    max-height: 420px;
    background: rgba(18, 18, 26, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: var(--radius-md);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(0, 0, 0, 0.35);
    z-index: 1200;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    isolation: isolate;
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.875rem;
    background: #12121a;
    flex-shrink: 0;
}

.notification-mark-all {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
}

.notification-mark-all:hover {
    text-decoration: underline;
}

.notification-list {
    overflow-y: auto;
    max-height: 360px;
    background: #12121a;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid rgba(139, 92, 246, 0.12);
    background: #12121a;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.notification-item > .msg-panel-unread-dot {
    margin-top: 5px;
}

.notification-item-content {
    flex: 1;
    min-width: 0;
}

.notification-item:hover {
    background: rgba(139, 92, 246, 0.12);
}

.notification-item.unread {
    background: rgba(139, 92, 246, 0.16);
}

.notification-item-title {
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 4px;
}

.notification-item-body {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.notification-item-time {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 6px;
    opacity: 0.8;
}

.notification-empty {
    padding: 24px 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ===== Message Panel (Header Dropdown) ===== */
.header-message-btn {
    position: relative;
}

.message-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(380px, calc(100vw - 24px));
    max-height: 460px;
    background: rgba(18, 18, 26, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: var(--radius-md);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(0, 0, 0, 0.35);
    z-index: 1200;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    isolation: isolate;
}

.message-panel-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.9375rem;
    background: #12121a;
    flex-shrink: 0;
}

.message-panel-list {
    overflow-y: auto;
    max-height: 400px;
    background: #12121a;
}

.msg-panel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08);
    background: #12121a;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.msg-panel-item:hover {
    background: rgba(139, 92, 246, 0.1);
}

.msg-panel-item.unread {
    background: rgba(139, 92, 246, 0.12);
}

.msg-panel-item.unread .msg-panel-name {
    font-weight: 700;
}

.msg-panel-item.unread .msg-panel-preview {
    color: var(--text-secondary);
    font-weight: 500;
}

.msg-panel-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.msg-panel-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
    display: block;
}

.msg-panel-presence-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #12121a;
    box-sizing: border-box;
}

.msg-panel-presence-dot.online {
    background: #22c55e;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.45);
}

.msg-panel-presence-dot.offline {
    background: #64748b;
}

.msg-panel-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.msg-panel-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.msg-panel-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-panel-time {
    font-size: 0.6875rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.msg-panel-status {
    font-size: 0.6875rem;
    line-height: 1.25;
    font-weight: 500;
}

.msg-panel-status.online {
    color: #22c55e;
}

.msg-panel-status.offline {
    color: var(--text-muted);
}

.msg-panel-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.msg-panel-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.5);
}

.msg-panel-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.message-panel-footer {
    flex-shrink: 0;
    padding: 10px 16px 12px;
    border-top: 1px solid var(--border);
    background: #12121a;
}

.msg-panel-see-all {
    display: block;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.msg-panel-see-all:hover {
    color: var(--violet-300, #c4b5fd);
    text-decoration: underline;
}

/* ===== Sidebar Close Button (mobile only) ===== */
.sidebar-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.sidebar-close-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.sidebar-close-btn svg {
    width: 20px;
    height: 20px;
}

/* ===== Sidebar Backdrop ===== */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 199;
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* ===== Nav Link Active State ===== */
.nav-link-active {
    background: rgba(139, 92, 246, 0.12) !important;
    border: 1px solid var(--border-hover);
    color: var(--violet-400) !important;
}

/* ===== Main Footer ===== */
.main-footer {
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    margin-top: auto;
    background: rgba(15, 15, 23, 0.5);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-copyright {
    font-size: 0.72rem;
    color: var(--text-faint);
}

.footer-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-link {
    font-size: 0.72rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--accent);
}

.footer-sep {
    color: var(--text-faint);
    font-size: 0.72rem;
}

.footer-version {
    font-size: 0.68rem;
    color: var(--text-faint);
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.15);
}

/* ===== Bottom Navigation Bar ===== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 23, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 0;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    transition: color var(--transition-fast);
    min-height: 44px;
    justify-content: center;
    text-decoration: none;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
}

.bottom-nav-item.active {
    color: #8b5cf6;
}

.bottom-nav-item:hover {
    color: var(--accent-hover);
}

button.bottom-nav-item {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.bottom-nav-sheet {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    z-index: 110;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(15, 15, 23, 0.98);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
}

.bottom-nav-sheet[hidden] {
    display: none !important;
}

.bottom-nav-sheet-item[hidden] {
    display: none !important;
}

.bottom-nav-sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    min-height: 48px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.bottom-nav-sheet-item:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-primary);
}

.bottom-nav-sheet-item svg {
    flex-shrink: 0;
    color: var(--accent);
}

/* ===== Wallet Page ===== */
.wallet-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.wallet-balance-card {
    position: relative;
    padding: 32px;
    border-radius: var(--radius-2xl);
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
}

.wallet-balance-card::before {
    display: none;
}

.wallet-balance-glow {
    display: none;
}

.wallet-balance-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.wallet-balance-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.wallet-balance-amount {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin: 8px 0;
}

.wallet-currency {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--violet-400);
    font-family: var(--font-sans);
}

.wallet-amount {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    font-family: var(--font-sans);
}

.wallet-balance-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.wallet-balance-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

/* ===== Transactions ===== */
.transactions-section {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
}

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

.transactions-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.transactions-tabs {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: var(--radius-md);
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid var(--border);
}

.tab-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    white-space: nowrap;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    background: var(--bg-active);
    color: var(--accent);
}

.transactions-list {
    padding: 16px 24px 24px;
}

.transactions-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 24px 20px;
}

/* Transaction Row */
.txn-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08);
    transition: background var(--transition-fast);
    gap: 12px;
}

.txn-row:last-child {
    border-bottom: none;
}

.txn-row:hover {
    background: rgba(139, 92, 246, 0.05);
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: var(--radius-sm);
}

.txn-row-compact {
    padding: 10px 0;
}

.txn-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.txn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.txn-icon-item {
    border-radius: 8px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: 0;
}

.txn-icon-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: radial-gradient(circle at 50% 40%, rgba(255,255,255,0.08), transparent 70%);
}

.txn-icon-item.txn-icon-fallback {
    background: rgba(139, 92, 246, 0.12);
}

.txn-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.txn-item-name {
    font-size: 0.82rem;
    color: rgba(226, 232, 240, 0.92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(52vw, 280px);
}

.txn-order-id {
    font-size: 0.7rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--text-muted, rgba(148, 163, 184, 0.9));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(72vw, 360px);
}

.txn-icon-deposit {
    background: rgba(16, 185, 129, 0.12);
    color: var(--emerald-400);
}

.txn-icon-withdrawal {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red-400);
}

.txn-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.txn-method {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.txn-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
}

.txn-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.txn-amount {
    font-size: 0.88rem;
    font-weight: 700;
    font-family: var(--font-sans);
}

.txn-amount-positive {
    color: var(--emerald-300);
}

.txn-amount-negative {
    color: var(--red-400);
}

.txn-status {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 10px;
}

.txn-status.status-completed {
    color: #10b981;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.txn-status.status-pending {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.3);
    animation: statusPulse 2s ease-in-out infinite;
}

.txn-status.status-processing {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    animation: statusPulse 2s ease-in-out infinite;
}

.txn-status.status-failed {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.txn-status.status-expired {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.txn-status.status-accept,
.txn-status.status-await_accept,
.txn-status.status-delivering {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.txn-status.status-refund,
.txn-status.status-refunded,
.txn-status.status-cancelled {
    color: #f87171;
    background: rgba(248, 113, 113, 0.16);
    border: 1px solid rgba(248, 113, 113, 0.28);
}

.txn-status-sub {
    display: inline-block;
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-muted, rgba(255, 255, 255, 0.55));
}

.txn-status-inline {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px 6px;
    max-width: 100%;
    vertical-align: middle;
    white-space: nowrap;
}

.txn-status-inline .ui-hint-tip,
.txn-status-inline .ui-hint-tip--txn-status {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    width: auto;
    max-width: none;
    vertical-align: middle;
    contain: layout;
}

.ui-hint-tip-bubble--txn-status,
.ui-hint-tip-bubble--txn-status.ui-hint-tip-bubble--pinned {
    position: fixed !important;
    pointer-events: none !important;
}

.txn-status-inline .ui-hint-tip-qa,
.txn-status-inline .ui-hint-tip--qa > .ui-hint-tip-icon {
    flex: 0 0 auto;
    align-self: center;
    width: 17px;
    height: 17px;
    min-width: 17px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, 0.42);
    background: rgba(139, 92, 246, 0.16);
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.06);
    color: var(--violet-400, #a78bfa);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    cursor: help;
}

.txn-status-inline .ui-hint-tip-icon.ui-hint-tip-qa:hover,
.txn-status-inline .ui-hint-tip:focus-within .ui-hint-tip-icon.ui-hint-tip-qa,
.txn-status-inline .ui-hint-tip--qa:hover > .ui-hint-tip-icon,
.txn-status-inline .ui-hint-tip--qa:focus-within > .ui-hint-tip-icon {
    color: var(--violet-300, #c4b5fd);
    background: rgba(139, 92, 246, 0.28);
    border-color: rgba(139, 92, 246, 0.62);
}

.ui-hint-tip-heading {
    display: block;
    margin: 0 0 4px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary, #e2e8f0);
}

.admin-table td > .txn-status-sub {
    display: none;
}

.txn-status-inline .txn-status {
    flex: 0 0 auto;
}

.txn-reverse-chip {
    display: inline-block;
    flex: 0 0 auto;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 8px;
    color: #fcd34d;
    background: rgba(251, 191, 36, 0.16);
    border: 1px solid rgba(251, 191, 36, 0.32);
    white-space: nowrap;
    line-height: 1.3;
}

.txn-report-reverse-actions--inline {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 0;
}

.txn-hold-cancel-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.txn-hold-cancel-actions .txn-hold-cancel-penalty {
    display: block;
    white-space: normal;
}

.txn-report-reverse-actions--inline .btn-small {
    padding: 2px 8px;
    font-size: 0.68rem;
    line-height: 1.3;
    white-space: nowrap;
}

.admin-table tr[data-has-trace],
.admin-table tr[data-tx-expand] {
    cursor: pointer;
}

.admin-table tr[data-has-trace].is-expanded,
.admin-table tr[data-tx-expand].is-expanded {
    background: rgba(255, 255, 255, 0.03);
}

.admin-tx-trace p {
    margin: 0.2rem 0;
    font-size: 0.8rem;
    line-height: 1.4;
}

.admin-tx-phases {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
}

.admin-tx-phase {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    opacity: 0.42;
    border: 1px solid transparent;
}

.admin-tx-phase.is-done {
    opacity: 0.72;
}

.admin-tx-phase.is-current {
    opacity: 1;
    box-shadow: 0 0 0 1px currentColor;
}

.admin-tx-trace-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.admin-tx-trace-raw {
    margin-top: 10px;
}

.admin-tx-trace-raw summary {
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-muted, rgba(255, 255, 255, 0.55));
}

.admin-tx-trace-raw pre {
    margin: 6px 0 0;
    max-height: 240px;
    overflow: auto;
    font-size: 0.7rem;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===== Empty & Loading States ===== */
.transactions-empty {
    text-align: center;
    padding: 48px 24px;
}

.transactions-empty svg {
    color: var(--text-faint);
    margin: 0 auto 16px;
}

.empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.empty-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.skeleton-row {
    height: 56px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.page-route-shell {
    width: 100%;
    min-height: 240px;
    padding: 4px 0 24px;
}

.skeleton-page {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.skeleton-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.skeleton-stat-card,
.skeleton-card {
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

.skeleton-profile-layout,
.skeleton-admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: 16px;
    margin-top: 12px;
}

@media (max-width: 768px) {
    .skeleton-profile-layout,
    .skeleton-admin-layout {
        grid-template-columns: 1fr;
    }
}

.skeleton-admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.skeleton-admin-body {
    min-height: 160px;
}

/* ===== Deposit Page ===== */
.deposit-page {
    max-width: 640px;
    margin: 0 auto;
}

.deposit-header {
    margin-bottom: 24px;
}

.deposit-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.deposit-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.deposit-methods,
.deposit-layout {
    margin-bottom: 32px;
}

.deposit-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.deposit-method-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.deposit-method-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.deposit-method-tab:hover {
    border-color: var(--state-active-border);
    color: var(--text-primary);
}

.deposit-method-tab.active {
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-primary);
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.15);
}

.deposit-method-tab .deposit-card-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.deposit-method-tab-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.deposit-method-tab-title {
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
}

.deposit-method-tab-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.2;
}

.deposit-method-tab.active .deposit-method-tab-sub {
    color: var(--text-secondary);
}

.deposit-method-panels {
    position: relative;
}

.deposit-method-panel {
    display: none;
}

.deposit-method-panel.active {
    display: block;
}

.deposit-method-panel .deposit-card-body {
    padding-top: 20px;
}

.deposit-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.deposit-card {
    position: relative;
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.deposit-card::before {
    display: none;
}

.deposit-card:hover {
    border-color: var(--state-active-border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.deposit-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 0;
}

.deposit-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.deposit-card-icon-bank {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

.deposit-card-icon-crypto {
    background: rgba(139, 92, 246, 0.12);
    color: var(--violet-400);
}

.deposit-card-icon-phone {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.deposit-card-icon-visa {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.deposit-card-title-wrap {
    flex: 1;
    min-width: 0;
}

.deposit-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.deposit-card-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.deposit-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.deposit-badge-green {
    color: var(--emerald-300);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.deposit-badge-blue {
    color: var(--blue-300);
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.deposit-badge-amber {
    color: var(--amber-300);
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.deposit-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.deposit-min-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.deposit-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ===== Self-custody crypto deposit address ===== */
.crypto-address-box {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-radius: var(--radius-md);
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.12);
    overflow: hidden;
}

.crypto-address-box > .market-loading,
.crypto-address-box > #crypto-address-error {
    padding: 16px;
}

.crypto-address-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    background: rgba(0, 0, 0, 0.12);
}

.crypto-address-label {
    margin: 0;
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.crypto-network-pill {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.crypto-network-pill--trc20 {
    color: #fca5a5;
    background: rgba(239, 0, 39, 0.12);
    border: 1px solid rgba(239, 0, 39, 0.25);
}

.crypto-network-pill--bep20 {
    color: #fde68a;
    background: rgba(243, 186, 47, 0.12);
    border: 1px solid rgba(243, 186, 47, 0.25);
}

.crypto-address-panel {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
    padding: 14px;
}

.crypto-qr-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 166px;
    flex-shrink: 0;
}

.crypto-detail-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.crypto-address-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.crypto-address {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono, monospace);
    font-size: 0.78rem;
    line-height: 1.45;
    word-break: break-all;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    user-select: all;
}

.btn-copy-address {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    align-self: flex-start;
}

.btn-copy-address .btn-copy-label {
    font-size: 0.72rem;
    font-weight: 600;
}

.btn-copy-address.copied {
    color: var(--emerald-400);
    border-color: var(--emerald-400);
}

.crypto-address-notes {
    margin: 0;
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--text-muted);
}

#crypto-intent-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 32px 20px;
    text-align: center;
}

#crypto-intent-panel .crypto-address-notes {
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: 460px;
    gap: 8px;
    font-size: 0.85rem;
    line-height: 1.55;
}

#crypto-intent-panel .crypto-address-notes li:first-child {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
}

#crypto-intent-btn {
    max-width: 320px;
    padding: 13px 24px;
    font-size: 0.95rem;
}

.crypto-intent-expired {
    margin: 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--amber-400);
    font-size: 0.8rem;
    line-height: 1.5;
    max-width: 460px;
}


.crypto-address-notes li:first-child {
    color: var(--amber-400);
}

/* Bank QR result reuses the crypto address panel; details list is neutral. */
.bank-qr-box {
    margin-top: 4px;
}

.bank-qr-box .bank-qr-details li,
.bank-qr-box .bank-qr-details li:first-child {
    color: var(--text-secondary);
}

.bank-qr-box .bank-qr-details strong {
    color: var(--text-primary);
    font-weight: 700;
}

.bank-qr-paid {
    color: var(--emerald-300) !important;
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.crypto-qr {
    background: #fff;
    padding: 10px;
    border-radius: 10px;
    line-height: 0;
    width: 150px;
    height: 150px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crypto-qr svg {
    width: 100%;
    height: 100%;
    display: block;
}

.crypto-qr:empty {
    display: none;
}

.crypto-qr-hint {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.3;
}

@media (max-width: 480px) {
    .crypto-address-panel {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .crypto-qr-col {
        width: 100%;
    }

    .crypto-detail-col {
        width: 100%;
    }

    .crypto-address-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-copy-address {
        justify-content: center;
        width: 100%;
    }
}

/* ===== Admin crypto treasury ===== */
.treasury-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.treasury-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.treasury-card .stat-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.treasury-addresses {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    word-break: break-all;
}

.treasury-addresses code {
    font-size: 0.76rem;
}

.treasury-addr-note {
    margin: 8px 0 2px;
    font-size: 0.74rem;
    color: var(--text-muted, var(--text-secondary));
    word-break: normal;
}

.deposit-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.deposit-input {
    width: 100%;
    box-sizing: border-box;
    display: block;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    background: rgba(30, 30, 46, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: var(--font-sans);
    transition: all var(--transition-fast);
    min-height: 44px;
}

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

.deposit-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
    outline: none;
}

/* Quick Amount Buttons */
.quick-amounts {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.quick-amount-btn {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-sans);
    transition: all var(--transition-fast);
    min-height: 36px;
    cursor: pointer;
}

.quick-amount-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.quick-amount-btn.active {
    background: var(--accent-muted);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}

/* Network / Provider / Denomination Selectors */
.network-selector,
.provider-selector,
.denomination-selector {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.network-btn,
.provider-btn,
.denomination-btn {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    min-height: 36px;
}

.network-btn:hover,
.provider-btn:hover,
.denomination-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.network-btn.active,
.provider-btn.active,
.denomination-btn.active {
    background: var(--accent-muted);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}

/* Recent Deposits */
.recent-deposits {
    background: rgba(15, 15, 23, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    box-shadow: var(--glass-shadow);
}

.recent-deposits-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* ── Visual Provider Selector (Thẻ Cào) ── */
.provider-selector-visual {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.625rem;
}

.provider-selector-visual .provider-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 0.5rem;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: rgba(30, 30, 46, 0.4);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s;
}

.provider-selector-visual .provider-btn:hover {
    border-color: var(--border-hover);
    background: rgba(139, 92, 246, 0.08);
    transform: translateY(-2px);
}

.provider-selector-visual .provider-btn.active {
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.1);
    box-shadow: 0 0 20px -6px rgba(139, 92, 246, 0.4);
    color: #fff;
}

.provider-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #fff;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.provider-btn.active .provider-logo { transform: scale(1.1); }
.provider-logo-viettel { background: #e60012; }
.provider-logo-mobifone { background: #0066b3; }
.provider-logo-vinaphone { background: #0057a8; }

.provider-name {
    font-size: 0.78rem;
    font-weight: 600;
}

/* ── Visual Network Selector ── */
.network-selector-visual {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.network-selector-visual .network-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: rgba(30, 30, 46, 0.4);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s;
    min-height: auto;
}

.network-selector-visual .network-btn:hover {
    border-color: var(--border-hover);
    background: rgba(139, 92, 246, 0.08);
    transform: translateY(-2px);
}

.network-selector-visual .network-btn.active {
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.12);
    box-shadow: 0 0 20px -6px rgba(139, 92, 246, 0.35);
    color: var(--text-primary);
}

.network-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s;
}

.network-btn.active .network-logo {
    transform: scale(1.1);
}

.network-label {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.network-chain {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.network-btn.active .network-chain {
    color: rgba(196, 181, 253, 0.85);
}

/* ── Payment Iframe ── */
.payment-iframe-wrap {
    margin-top: 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    background: rgba(15, 15, 23, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
}

.payment-iframe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(139, 92, 246, 0.05);
    border-bottom: 1px solid var(--border);
}

.payment-iframe-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.payment-iframe-info svg { color: #34d399; }

.payment-iframe-network {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--cyan-300);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.payment-iframe-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(30, 30, 46, 0.6);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent);
}

.payment-iframe {
    width: 100%;
    height: 700px;
    border: none;
    background: #f8f9fa;
    display: block;
    transition: opacity 0.3s;
}

.payment-iframe:not([src]),
.payment-iframe[src=""] {
    opacity: 0.4;
    background: rgba(0, 0, 0, 0.3) url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="18" fill="none" stroke="%238b5cf6" stroke-width="2.5" stroke-dasharray="28.27" stroke-dashoffset="28.27"><animateTransform attributeName="transform" type="rotate" from="0 50 50" to="360 50 50" dur="1s" repeatCount="indefinite"/><animate attributeName="stroke-dasharray" dur="1.5s" values="0 113.1;56.55 56.55;0 113.1" repeatCount="indefinite"/></circle></svg>') center no-repeat;
    background-size: 48px;
}

.payment-iframe-fallback {
    padding: 3rem 1.5rem;
    text-align: center;
}

.fallback-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.fallback-content svg { color: var(--text-faint); }

.fallback-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.fallback-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}

.fallback-content .btn { min-width: 180px; }

.payment-iframe-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(139, 92, 246, 0.03);
    border-top: 1px solid rgba(139, 92, 246, 0.1);
}

.spinner-small {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===== Escrow Page ===== */
.escrow-page {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.escrow-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.escrow-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.escrow-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.escrow-page-desc {
    margin: -8px 0 0;
    max-width: 720px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-muted);
}

/* Escrow Create Form */
.escrow-create-form {
    animation: glassFadeIn 0.3s ease-out;
}

.escrow-form-card {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    overflow: visible;
}

.escrow-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.escrow-form-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.escrow-form-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: visible;
}

.escrow-role-tabs {
    display: flex;
    gap: 8px;
}

.escrow-role-tabs .tab-btn {
    flex: 1;
    justify-content: center;
}

.escrow-role-hint {
    margin: -4px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.escrow-field-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.escrow-field-head .deposit-label {
    margin: 0;
}

.escrow-field-head .escrow-balance-hint {
    margin: 0;
    text-align: right;
}

.escrow-amount-group {
    gap: 8px;
}

.escrow-amount-bar {
    display: flex;
    align-items: stretch;
    min-height: 44px;
    border-radius: var(--radius-md);
    background: rgba(30, 30, 46, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.3);
    overflow: visible;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.escrow-amount-bar:focus-within {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.escrow-amount-bar-currency {
    flex-shrink: 0;
    border-right: 1px solid rgba(139, 92, 246, 0.22);
    position: relative;
    z-index: 1;
}

.escrow-amount-bar-currency .ui-combobox {
    width: auto;
    min-width: 5.25rem;
    height: 100%;
}

.escrow-amount-bar-currency .ui-combobox.is-open {
    z-index: 12;
}

.escrow-amount-bar-currency .ui-combobox-trigger {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    min-height: 44px;
    height: 100%;
    padding: 0 0.5rem 0 0.85rem;
}

.escrow-amount-bar-currency .ui-combobox.is-open .ui-combobox-trigger,
.escrow-amount-bar-currency .ui-combobox-trigger:focus-visible {
    border: none;
    box-shadow: none;
    outline: none;
}

.escrow-amount-bar-currency .ui-combobox-menu {
    min-width: 8.5rem;
    right: auto;
    left: 0;
}

.escrow-amount-bar-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: var(--font-sans);
    padding: 0.85rem 1.15rem;
    outline: none;
}

.escrow-amount-bar-input::placeholder {
    color: var(--text-muted);
}

.escrow-amount-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.escrow-amount-foot .ui-hint {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.escrow-hold-tip {
    flex-shrink: 0;
    margin-left: auto;
    cursor: default;
}

.escrow-hold-mini {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-size: 0.72rem;
    color: var(--text-muted);
    cursor: pointer;
}

.escrow-hold-mini-label,
.escrow-hold-mini-suffix {
    white-space: nowrap;
}

.escrow-hold-mini-input {
    width: 2.75rem;
    padding: 4px 6px;
    text-align: center;
    border-radius: var(--radius-sm);
    background: rgba(15, 15, 24, 0.55);
    border: 1px solid rgba(139, 92, 246, 0.22);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: var(--font-sans);
    transition: border-color var(--transition-fast);
}

.escrow-hold-mini-input:focus {
    border-color: #8b5cf6;
    outline: none;
}

.escrow-hold-mini-input::placeholder {
    color: var(--text-muted);
}

.escrow-balance-hint {
    font-size: 0.72rem;
    color: var(--emerald-300);
    margin-top: 2px;
    font-family: var(--font-sans);
}

.escrow-seller-field {
    position: relative;
}

.escrow-seller-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.escrow-seller-label-row .deposit-label {
    margin-bottom: 0;
}

.escrow-seller-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(30, 30, 46, 0.45);
}

.escrow-seller-preview[hidden] {
    display: none !important;
}

.escrow-seller-preview.is-loading {
    border-color: rgba(139, 92, 246, 0.2);
}

.escrow-seller-preview.is-found {
    border-color: rgba(52, 211, 153, 0.35);
    background: rgba(16, 185, 129, 0.06);
}

.escrow-seller-preview.is-error {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(239, 68, 68, 0.06);
}

.escrow-seller-preview-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.escrow-seller-preview-meta {
    flex: 1;
    min-width: 0;
}

.escrow-seller-preview-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.escrow-seller-preview-email {
    font-size: 0.72rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.escrow-seller-preview-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--emerald-300);
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.12);
    flex-shrink: 0;
}

.escrow-seller-preview-msg {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.escrow-recent-wrap {
    position: relative;
    flex-shrink: 0;
}

.escrow-recent-trades-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0;
    border: none;
    background: none;
    color: var(--violet-300);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.escrow-recent-trades-link:hover {
    color: var(--violet-200);
    text-decoration: underline;
}

.escrow-recent-trades-link.open svg {
    transform: rotate(180deg);
}

.escrow-recent-trades-link svg {
    transition: transform 0.2s;
    opacity: 0.75;
}

.escrow-recent-trades-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 280px;
    max-width: min(360px, 92vw);
    z-index: 40;
    border-radius: var(--radius-md);
    border: 1px solid rgba(139, 92, 246, 0.25);
    background: rgba(22, 22, 34, 0.98);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.escrow-recent-trades-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    -webkit-overflow-scrolling: touch;
}

.escrow-recent-trades-list::-webkit-scrollbar { width: 4px; }
.escrow-recent-trades-list::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.2); border-radius: 4px; }

.escrow-seller-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: rgba(20, 20, 32, 0.4);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
    font-family: var(--font-sans);
    touch-action: manipulation;
}

.escrow-seller-item:hover {
    border-color: rgba(139, 92, 246, 0.25);
    background: rgba(139, 92, 246, 0.08);
}

.escrow-seller-item.active {
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(139, 92, 246, 0.12);
}

.escrow-seller-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.escrow-seller-item-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.escrow-seller-name {
    font-size: 0.82rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.escrow-seller-email {
    font-size: 0.68rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.escrow-seller-tag {
    font-size: 0.62rem;
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    white-space: nowrap;
}

.escrow-seller-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 8px 4px;
    text-align: center;
}

/* Escrow Tabs */
.escrow-tabs {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: var(--radius-md);
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid var(--border);
    width: fit-content;
}

/* Escrow List */
.escrow-list {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    padding: 16px 24px 24px;
}

/* Escrow Ticket Card - dense single-row (desktop), stacked (mobile) */
.escrow-ticket-card {
    display: block;
    padding: 9px 12px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(30, 30, 46, 0.4);
    backdrop-filter: blur(10px);
    margin-bottom: 6px;
    transition: all var(--transition-base);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.escrow-ticket-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.16);
}

.escrow-ticket-card:last-child {
    margin-bottom: 0;
}

.escrow-ticket-main {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0 8px;
    min-width: 0;
}

.escrow-ticket-sep {
    color: var(--text-faint);
    font-size: 0.75rem;
    line-height: 1;
    user-select: none;
    flex-shrink: 0;
}

.escrow-ticket-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 0;
}

.escrow-ticket-badges {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

.escrow-hold-badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.28);
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.escrow-ticket-id {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    font-family: var(--font-sans);
    flex-shrink: 0;
    white-space: nowrap;
}

/* Escrow Status Badges - yellow: in progress, green: completed, red: cancelled */
.escrow-status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.escrow-status-active,
.escrow-status-delivered,
.escrow-status-pending {
    color: #facc15;
    background: rgba(250, 204, 21, 0.12);
    border: 1px solid rgba(250, 204, 21, 0.32);
}

.escrow-status-pending,
.escrow-status-delivered {
    animation: statusPulse 2s ease-in-out infinite;
}

.escrow-status-completed {
    color: var(--emerald-300);
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.32);
}

.escrow-status-cancelled,
.escrow-status-refunded {
    color: var(--red-400);
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.32);
}

.escrow-status-disputed {
    color: #fb923c;
    background: rgba(251, 146, 60, 0.12);
    border: 1px solid rgba(251, 146, 60, 0.32);
    animation: statusPulse 2s ease-in-out infinite;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--amber-400);
    color: var(--amber-300);
    background: rgba(245, 158, 11, 0.08);
}

/* ===== Binance P2P Order Layout ===== */
.p2p-order-page {
    max-width: 1200px;
    margin: 0 auto;
}

.p2p-order-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    align-items: start;
}

.p2p-order-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.p2p-status-banner {
    border-radius: var(--radius-xl);
    border: 1px solid rgba(252, 211, 77, 0.25);
    background: rgba(252, 211, 77, 0.1);
    overflow: hidden;
}

.p2p-status-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    flex-wrap: wrap;
}

.p2p-status-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--amber-300);
    display: block;
    margin-bottom: 6px;
}

.p2p-status-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.p2p-status-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 8px 0 0;
    line-height: 1.5;
    max-width: 520px;
}

.p2p-countdown {
    text-align: right;
    min-width: 120px;
}

.p2p-countdown-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.p2p-countdown-value {
    font-family: var(--font-sans);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--amber-300);
}

.p2p-countdown-value.p2p-countdown-urgent {
    color: var(--red-400);
    animation: statusPulse 1s ease-in-out infinite;
}

.p2p-banner-delivered {
    border-color: rgba(252, 211, 77, 0.4);
}

.p2p-banner-completed {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.1);
}

.p2p-banner-disputed {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.1);
}

.p2p-steps {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 16px 0 8px;
    overflow-x: auto;
}

.p2p-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 72px;
    flex-shrink: 0;
}

.p2p-step span {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 80px;
    line-height: 1.2;
}

.p2p-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid var(--border);
    color: var(--text-muted);
    background: rgba(15, 15, 23, 0.6);
}

.p2p-step.completed .p2p-step-num {
    border-color: var(--emerald-400);
    background: rgba(16, 185, 129, 0.2);
    color: var(--emerald-300);
}

.p2p-step.active .p2p-step-num {
    border-color: var(--amber-400);
    background: rgba(252, 211, 77, 0.2);
    color: var(--amber-300);
    box-shadow: 0 0 12px rgba(252, 211, 77, 0.3);
}

.p2p-step.active span,
.p2p-step.completed span {
    color: var(--text-secondary);
}

.p2p-step.disputed .p2p-step-num {
    border-color: var(--red-400);
    color: var(--red-400);
}

.p2p-step-line {
    flex: 1;
    min-width: 12px;
    height: 2px;
    background: var(--border);
    margin-bottom: 22px;
}

.p2p-steps-cancelled {
    opacity: 0.45;
}

.p2p-order-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.p2p-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    font-size: 0.85rem;
}

.p2p-detail-label {
    color: var(--text-muted);
    flex-shrink: 0;
}

.p2p-detail-value {
    color: var(--text-primary);
    text-align: right;
    word-break: break-word;
}

.p2p-detail-amount {
    font-weight: 700;
    color: var(--amber-300);
}

.p2p-detail-desc .p2p-detail-value {
    max-width: 60%;
}

.p2p-action-panel {
    margin-top: 0;
}

.p2p-action-card {
    background: rgba(15, 15, 23, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 20px;
}

.p2p-btn-binance {
    background: #f59e0b !important;
    border: none !important;
    color: #1a1a2e !important;
    font-weight: 700 !important;
}

.p2p-btn-binance:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.p2p-btn-main {
    flex: 2;
}

.p2p-wait-notice {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    background: rgba(252, 211, 77, 0.08);
    border: 1px solid rgba(252, 211, 77, 0.2);
    color: var(--amber-200);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.p2p-order-chat .escrow-chat-section {
    height: auto;
    min-height: 0;
}

@media (max-width: 960px) {
    .p2p-order-layout {
        grid-template-columns: 1fr;
    }

    .p2p-order-chat .escrow-chat-section {
        height: auto;
        min-height: 0;
    }
}

/* Escrow Parties - content-sized inline unit (no stretch / dead center) */
.escrow-ticket-parties {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
    max-width: min(100%, 320px);
    flex: 0 1 auto;
    margin: 0;
}

.escrow-party {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 0 1 auto;
    max-width: 132px;
}

.escrow-party-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}

.escrow-party-text {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    min-width: 0;
    flex: 1 1 auto;
}

.escrow-party-role {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    line-height: 1.15;
    white-space: nowrap;
}

.escrow-party-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    line-height: 1.2;
}

.escrow-arrow {
    color: var(--text-faint);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    line-height: 0;
}

.escrow-arrow svg {
    width: 14px;
    height: 14px;
}

.escrow-ticket-amount {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
}

.escrow-ticket-amount--in {
    color: var(--emerald-300);
}

.escrow-ticket-amount--out {
    color: var(--red-400);
}

.escrow-ticket-amount--muted {
    opacity: 0.72;
}

.escrow-ticket-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
}

.escrow-ticket-desc {
    margin: 0;
    padding: 0;
    border: none;
    min-width: 0;
    flex: 1 1 72px;
    max-width: 200px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.escrow-ticket-desc-sep {
    flex-shrink: 0;
}

.escrow-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.escrow-pagination-size {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.escrow-page-size-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    white-space: nowrap;
}

.escrow-page-size {
    min-width: 72px;
    width: 72px;
    flex: 0 0 auto;
}

.escrow-page-size .ui-combobox {
    width: 100%;
    min-width: 0;
    max-width: none;
}

.escrow-page-size .ui-combobox.is-open {
    z-index: 6;
}

.escrow-page-size .ui-combobox-trigger {
    min-height: 36px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.escrow-pagination-info {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
}

.escrow-pagination-pages {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-left: auto;
}

.escrow-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.escrow-page-btn:hover:not(:disabled):not(.active) {
    border-color: rgba(139, 92, 246, 0.45);
    color: #c4b5fd;
}

.escrow-page-btn.active {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.55);
    color: #e9d5ff;
}

.escrow-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ===== Escrow Detail Page ===== */
.escrow-detail-page {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.escrow-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    width: fit-content;
}

.escrow-back-btn:hover {
    color: var(--accent);
    transform: translateX(-3px);
}

.escrow-detail-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Escrow Info Card */
.escrow-info-card {
    background: rgba(15, 15, 23, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.escrow-info-card-compact {
    padding: 18px 20px;
    gap: 14px;
}

.escrow-info-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.escrow-info-id-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.escrow-parties-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
    font-size: 0.86rem;
    color: var(--text-secondary);
}

.escrow-party-inline-side {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-width: 0;
}

.escrow-party-inline-side .escrow-party-detail-name {
    text-align: left;
}

.escrow-parties-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.escrow-info-card-compact .escrow-info-title {
    font-size: 1rem;
}

.escrow-info-card-compact .escrow-info-amount {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.escrow-info-card-compact .escrow-info-amount--in,
.escrow-info-amount--in,
.escrow-info-amount--in > span {
    color: var(--emerald-300);
}

.escrow-info-card-compact .escrow-info-amount--out,
.escrow-info-amount--out,
.escrow-info-amount--out > span {
    color: var(--red-400);
}

.escrow-info-card-compact .escrow-flow-hint {
    padding: 12px 14px;
    gap: 10px;
}

.escrow-info-card-compact .escrow-flow-hint-text {
    font-size: 0.84rem;
    line-height: 1.45;
}

.escrow-info-card-compact .escrow-flow-timer {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
}

.escrow-info-card-compact .escrow-flow-timer-value {
    font-size: 1.15rem;
}

.escrow-info-card-compact .escrow-flow-timer-label {
    font-size: 0.72rem;
}

.escrow-flow-hint.is-overdue {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
}

.escrow-flow-timer-expired {
    color: #f87171;
}

.escrow-info-card-compact .escrow-actions {
    margin: 0;
    padding-top: 4px;
}

.escrow-info-card-compact .escrow-action-buttons {
    gap: 10px;
}

.escrow-info-card-compact .escrow-action-btn {
    min-height: 42px;
}

.escrow-info-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.escrow-info-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.escrow-info-title {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-sans);
}

.escrow-info-amount {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.escrow-info-amount .wallet-currency {
    font-size: 1.4rem;
}

.escrow-info-amount span:nth-child(2) {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-sans);
}

.escrow-currency-tag {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    align-self: flex-end;
    margin-bottom: 4px;
}

/* Escrow Progress Steps */
.escrow-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 8px 0;
}

.escrow-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.escrow-progress-step span {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.escrow-progress-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-hover);
    background: var(--bg-primary);
    transition: all var(--transition-base);
}

.escrow-progress-step.completed .escrow-progress-dot {
    background: #8b5cf6;
    border-color: #8b5cf6;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

.escrow-progress-step.completed span {
    color: var(--violet-300);
}

.escrow-progress-step.disputed .escrow-progress-dot {
    background: var(--red-400);
    border-color: var(--red-400);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.escrow-progress-step.disputed span {
    color: var(--red-400);
}

.escrow-progress-line {
    width: 60px;
    height: 2px;
    background: var(--border-hover);
    margin: 0 8px;
    margin-bottom: 24px;
}

.escrow-progress-cancelled .escrow-progress-dot {
    border-color: var(--text-faint) !important;
    background: var(--bg-primary) !important;
    box-shadow: none !important;
}

/* Escrow Parties Detail */
.escrow-parties-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.escrow-party-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    background: rgba(30, 30, 46, 0.5);
    border: 1px solid var(--border);
    min-width: 140px;
    flex: 1;
}

.escrow-party-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 20px;
}

.escrow-party-buyer {
    color: var(--cyan-300);
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.escrow-party-seller {
    color: var(--violet-300);
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.escrow-party-detail-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    word-break: break-all;
}

.escrow-arrow-detail {
    color: var(--text-faint);
    flex-shrink: 0;
}

/* Escrow Description (collapsible) */
.escrow-description-toggle {
    border-radius: var(--radius-md);
    background: rgba(30, 30, 46, 0.5);
    border: 1px solid var(--border);
    padding: 0;
}

.escrow-desc-summary {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    cursor: pointer;
    padding: 10px 16px;
    list-style: none;
    user-select: none;
}

.escrow-desc-summary::-webkit-details-marker { display: none; }

.escrow-desc-summary::after {
    content: '▸';
    float: right;
    transition: transform 0.15s ease;
}

.escrow-description-toggle[open] .escrow-desc-summary::after {
    transform: rotate(90deg);
}

.escrow-description-toggle .escrow-desc-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 0 16px 12px;
    margin: 0;
}

/* Escrow Actions */
.escrow-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.escrow-flow-notice {
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.escrow-flow-hint {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.18);
}

.escrow-flow-hint-text {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-secondary);
    flex: 1;
}

.escrow-flow-timer {
    flex-shrink: 0;
    text-align: right;
}

.escrow-flow-timer-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.escrow-flow-timer-value {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    color: var(--amber-300);
}

.escrow-flow-timer-value.escrow-flow-timer-urgent {
    color: var(--red-400);
}

/* Auto-release frozen by a dispute: no longer a live number, so it drops out
   of the amber "something is running" register. */
.escrow-flow-timer-value.escrow-flow-timer-paused {
    color: var(--text-muted);
}

.p2p-steps-compact {
    padding: 4px 0 0;
}

.p2p-steps-compact .p2p-step {
    min-width: 56px;
}

.p2p-steps-compact .p2p-step-num {
    width: 24px;
    height: 24px;
    font-size: 0.68rem;
}

.p2p-steps-compact .p2p-step span {
    font-size: 0.58rem;
    max-width: 64px;
}

.p2p-steps-compact .p2p-step-line {
    margin-bottom: 18px;
}

.escrow-action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.escrow-action-btn {
    flex: 1;
    min-width: 160px;
}

.escrow-action-confirm {
    font-weight: 600;
}

.escrow-action-accept {
    font-weight: 600;
}

.escrow-role-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.escrow-role-buyer {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

.escrow-role-seller {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

/* Escrow Notice */
.escrow-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 500;
    width: 100%;
}

.escrow-notice-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--emerald-300);
}

.escrow-notice-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--amber-300);
    animation: statusPulse 3s ease-in-out infinite;
}

.escrow-notice-muted {
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

/* ===== Escrow Chat ===== */
.escrow-chat-section {
    background: rgba(15, 15, 23, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
}

.escrow-chat-title {
    font-size: 0.95rem;
    font-weight: 700;
    padding: 20px 24px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ws-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    transition: background 0.3s;
}
.ws-status-dot.ws-online {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}
.ws-status-dot.ws-offline {
    background: var(--danger);
    box-shadow: 0 0 6px var(--danger);
}

.ws-online-count {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: auto;
}

.escrow-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    opacity: 0.6;
}
.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.escrow-chat-messages {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.escrow-chat-empty {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.escrow-chat-loading {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* Chat Messages */
.escrow-msg {
    display: flex;
    max-width: 80%;
    align-items: flex-end;
}

.escrow-avatar-slot {
    width: 32px;
    flex-shrink: 0;
    align-self: flex-end;
    margin-right: 8px;
}

.escrow-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.escrow-msg-mine {
    align-self: flex-end;
    margin-left: auto;
}

.escrow-msg-other {
    align-self: flex-start;
    margin-right: auto;
}

.escrow-msg-system {
    align-self: center;
    max-width: 90%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 16px;
}

.escrow-msg-system .escrow-msg-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.escrow-msg-system .escrow-msg-time {
    font-size: 0.62rem;
    color: var(--text-faint);
}

.escrow-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
    word-break: break-word;
}

.escrow-msg-mine .escrow-msg-bubble {
    background: rgba(139, 92, 246, 0.24);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-bottom-right-radius: 4px;
}

.escrow-msg-other .escrow-msg-bubble {
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.escrow-msg-name {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--violet-300);
}

.escrow-msg-text {
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.55;
}

.escrow-msg-time {
    font-size: 0.62rem;
    color: var(--text-faint);
    align-self: flex-end;
    font-family: var(--font-sans);
}

.escrow-msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.escrow-msg-mine .escrow-msg-meta {
    justify-content: flex-end;
}

.escrow-msg-status {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-weight: 500;
}

.escrow-msg-status.escrow-msg-seen {
    color: var(--accent);
}

/* Chat Input */
.escrow-chat-input {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: rgba(30, 30, 46, 0.3);
}

.escrow-msg-input {
    flex: 1;
    min-height: 44px;
    padding: 10px 14px;
    background: rgba(30, 30, 46, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.escrow-msg-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    outline: none;
}

.escrow-send-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

/* ===== Animations ===== */
@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

@keyframes glassFadeIn {
    0% { opacity: 0; transform: translateY(15px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.stat-card {
    animation: glassFadeIn 0.4s ease-out both;
}

.stat-card:nth-child(1) { animation-delay: 0ms; }
.stat-card:nth-child(2) { animation-delay: 50ms; }
.stat-card:nth-child(3) { animation-delay: 100ms; }
.stat-card:nth-child(4) { animation-delay: 150ms; }
.stat-card:nth-child(5) { animation-delay: 200ms; }
.stat-card:nth-child(6) { animation-delay: 250ms; }
.stat-card:nth-child(7) { animation-delay: 300ms; }

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .activity-chart {
        display: none;
    }
}

@media (max-width: 900px) {
    .toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

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

@media (max-width: 640px) {
    .main-body {
        padding: 12px;
        /* Extra bottom room for support FAB + home-indicator; no bottom-nav wired yet */
        padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .search-input {
        width: 100%;
    }

    .toolbar-btn span {
        display: none;
    }

    input,
    textarea,
    select,
    .admin-input,
    .ui-textarea,
    .search-input {
        font-size: 16px !important;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 800px;
    }

    .data-table .td-account {
        position: sticky;
        left: 0;
        background: rgba(15, 15, 23, 0.95);
        z-index: 2;
    }

    .main-header {
        padding: 0 10px 0 8px;
    }

    .header-left {
        gap: 6px;
        min-width: 0;
    }

    .header-page-title {
        font-size: 0.95rem;
        line-height: 1.3;
    }

    .header-actions-group .icon-btn {
        width: 40px;
        min-width: 40px;
        height: 40px;
        padding: 0;
    }

    .color-scheme-selector {
        display: none;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .main-footer {
        display: none;
    }

    .build-footer {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px 8px;
        padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
        text-align: center;
    }
}

/* ===== Mobile Responsive: Sidebar Overlay ===== */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        z-index: 250;
        width: min(var(--sidebar-width), 88vw);
        max-width: 300px;
        transform: translateX(-100%);
        padding-top: env(safe-area-inset-top, 0px);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
        opacity: 1;
        z-index: 240;
    }

    .sidebar-backdrop {
        z-index: 240;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .sidebar-close-btn {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    /* Games list capped so quick links + Admin stay reachable */
    .sidebar-nav {
        flex: 0 1 auto;
        min-height: 72px;
        max-height: min(34dvh, 240px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .sidebar-bottom {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: rgba(12, 12, 18, 0.98);
    }

    .sidebar-quick-links {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 6px 8px 16px;
        scrollbar-width: thin;
    }

    .sidebar-quick-links .sb-link-group:last-child .sb-link-item:last-child {
        scroll-margin-bottom: 12px;
    }

    .sb-link-item {
        padding: 10px 12px;
        min-height: 44px;
    }

    .game-item {
        min-height: 44px;
        padding: 10px 12px;
    }

    .game-item .favorite-btn {
        display: none;
    }

    .sidebar-user-card {
        flex-shrink: 0;
        position: relative;
        z-index: 2;
        border-top: 1px solid var(--border);
        padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
        background: rgba(12, 12, 18, 0.98);
        box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.35);
    }

    .admin-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 12px;
    }

    .admin-tabs::-webkit-scrollbar {
        display: none;
    }

    .admin-tab {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .account-card {
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: rgba(15, 15, 23, 0.9);
        padding: 12px;
    }

    .account-card.is-selected {
        border-color: var(--border-hover);
        background: var(--state-active-bg);
    }

    .account-card-head {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
    }

    .account-card-title {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .account-card-index {
        font-size: 0.68rem;
        color: var(--text-muted);
    }

    .account-card-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 10px;
    }

    .account-card-stat {
        padding: 8px 10px;
        border-radius: var(--radius-sm);
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .account-card-stat-label {
        display: block;
        font-size: 0.65rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-muted);
        margin-bottom: 4px;
    }

    .account-card-matches {
        margin-top: 10px;
    }

    .history-card {
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 14px;
        background: rgba(15, 15, 23, 0.85);
    }

    .history-card-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 8px;
    }

    .history-card-amount {
        font-size: 1.15rem;
        font-weight: 700;
        margin-bottom: 4px;
    }

    .history-card-date {
        font-size: 0.78rem;
        color: var(--text-muted);
    }

    .history-card-desc {
        margin-top: 8px;
        font-size: 0.82rem;
        color: var(--text-secondary);
        word-break: break-word;
    }

    .messages-page {
        height: calc(100vh - var(--header-height) - env(safe-area-inset-bottom, 0px) - 12px);
        max-height: unset;
    }

    .toolbar-left {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .search-mode-switch {
        width: 100%;
        justify-content: stretch;
    }

    .search-mode-btn {
        flex: 1;
        text-align: center;
        min-height: 36px;
    }

    .filter-radios {
        flex-wrap: wrap;
        width: 100%;
        gap: 6px;
    }

    .table-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }

    .deposit-methods,
    .deposit-method-tabs {
        grid-template-columns: 1fr;
    }

    .mod-mobile-lite .mod-desktop-hint {
        display: block;
        margin: 0 0 12px;
        padding: 10px 12px;
        border-radius: var(--radius-sm);
        background: rgba(139, 92, 246, 0.1);
        border: 1px solid var(--border);
        color: var(--text-secondary);
        font-size: 0.82rem;
        line-height: 1.45;
    }

    .mod-mobile-lite .admin-tabs .admin-tab:not([data-tab="delivery"]):not([data-tab="intake"]):not([data-tab="mail"]) {
        display: none;
    }

    .mod-mobile-lite .admin-tab-content:not([data-tab-content="delivery"]):not([data-tab-content="intake"]):not([data-tab-content="mail"]) {
        display: none !important;
    }

    .mod-mobile-lite .admin-delivery-test,
    .mod-mobile-lite #test-trade-form,
    .mod-mobile-lite .delivery-accounts,
    .mod-mobile-lite #delivery-log {
        display: none !important;
    }

    .mod-mobile-lite .mod-mobile-progress {
        display: block;
    }

    .mod-mobile-lite .pending-deliver-btn {
        min-height: 44px;
        min-width: 88px;
        font-size: 1rem;
        background: var(--green-500, #22c55e);
        color: #fff;
    }

    .mod-mobile-lite .admin-card {
        padding: 14px !important;
    }

    .zeusx-mobile-lite .zeusx-mobile-hint {
        display: block;
        margin: 0 0 12px;
        padding: 10px 12px;
        border-radius: var(--radius-sm);
        background: rgba(139, 92, 246, 0.1);
        border: 1px solid var(--border);
        color: var(--text-secondary);
        font-size: 0.82rem;
        line-height: 1.45;
    }

    .zeusx-mobile-lite .uzx-action-advanced {
        display: none !important;
    }

    .zeusx-mobile-lite .uzx-action-core {
        flex: 1 1 calc(50% - 4px);
        min-height: 44px;
        font-size: 0.95rem !important;
    }

    .delivery-progress-fab {
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        right: 12px;
        left: auto;
        max-width: min(280px, calc(100vw - 24px));
        padding: 10px 14px;
        font-size: 0.78rem;
        justify-content: flex-start;
    }

    body.sidebar-open .delivery-progress-fab {
        opacity: 0;
        pointer-events: none;
    }

    .item-intake-form-grid .item-intake-name-field,
    .item-intake-form-grid .item-intake-price-field,
    .item-intake-form-grid .item-intake-qty-field,
    .item-intake-form-grid .item-intake-total-field {
        flex: 1 1 100%;
        width: 100%;
    }

    .apikeys-create {
        flex-direction: column;
    }

    .apikeys-create .btn {
        width: 100%;
        min-height: 44px;
    }
}

@media (max-width: 640px) {
    .wallet-balance-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .wallet-balance-card {
        padding: 24px 20px;
    }

    .wallet-amount {
        font-size: 2.2rem;
    }

    .wallet-currency {
        font-size: 1.4rem;
    }

    .wallet-balance-actions {
        width: 100%;
    }

    .wallet-balance-actions .btn {
        flex: 1;
    }

    .transactions-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 16px 0;
    }

    .transactions-tabs {
        width: 100%;
    }

    .tab-btn {
        flex: 1;
        justify-content: center;
    }

    .transactions-list {
        padding: 12px 16px 16px;
    }

    .txn-row {
        padding: 10px 0;
    }

    .txn-icon {
        width: 32px;
        height: 32px;
    }

    .txn-method {
        font-size: 0.8rem;
    }

    .txn-amount {
        font-size: 0.82rem;
    }

    .deposit-methods,
    .deposit-method-tabs {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .deposit-card-body {
        padding: 16px;
    }

    .recent-deposits {
        padding: 16px;
    }

    .header-balance-pill {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .payment-iframe { height: 500px; }
    .payment-iframe-header { padding: 0.5rem 0.75rem; }
    .payment-iframe-info span:not(.payment-iframe-network) { display: none; }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .deposit-methods {
        grid-template-columns: 1fr;
    }

    .wallet-balance-card {
        padding: 28px;
    }

    .wallet-amount {
        font-size: 2.6rem;
    }

    .payment-iframe { height: 600px; }
}

/* ===== Escrow Responsive ===== */
@media (max-width: 640px) {
    .escrow-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .escrow-header .btn {
        width: 100%;
    }

    .escrow-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .escrow-tabs .tab-btn {
        flex: 1;
        justify-content: center;
    }

    .escrow-list {
        padding: 12px 16px 16px;
    }

    .escrow-ticket-card {
        padding: 10px 12px;
    }

    .escrow-ticket-main {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 8px;
        row-gap: 6px;
    }

    .escrow-ticket-sep {
        display: none;
    }

    .escrow-ticket-id {
        grid-column: 1;
        grid-row: 1;
    }

    .escrow-ticket-badges {
        grid-column: 2;
        grid-row: 1;
        margin-left: 0;
        justify-self: end;
    }

    .escrow-ticket-parties {
        grid-column: 1 / -1;
        grid-row: 2;
        max-width: 100%;
        width: 100%;
    }

    .escrow-party {
        max-width: calc(50% - 12px);
        flex: 1 1 auto;
    }

    .escrow-ticket-meta {
        grid-column: 1 / -1;
        grid-row: 3;
        justify-self: start;
    }

    .escrow-ticket-meta .escrow-ticket-sep {
        display: inline;
    }

    .escrow-ticket-desc-sep {
        display: none;
    }

    .escrow-ticket-desc {
        grid-column: 1 / -1;
        grid-row: 3;
        justify-self: end;
        align-self: center;
        max-width: min(42%, 140px);
        flex: none;
        text-align: right;
    }

    .escrow-ticket-amount {
        font-size: 0.88rem;
    }

    .escrow-pagination {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .escrow-pagination-size {
        justify-content: space-between;
        width: 100%;
    }

    .escrow-page-size {
        min-width: 88px;
        width: 88px;
    }

    .escrow-page-size .ui-combobox-trigger {
        min-height: 40px;
    }

    .escrow-pagination-info {
        text-align: center;
        width: 100%;
    }

    .escrow-pagination-pages {
        width: 100%;
        margin-left: 0;
        justify-content: center;
        gap: 6px;
    }

    .escrow-page-btn {
        min-width: 40px;
        height: 40px;
    }

    .escrow-info-card {
        padding: 20px;
    }

    .escrow-info-header {
        flex-direction: column;
    }

    .escrow-parties-detail {
        flex-direction: column;
        gap: 12px;
    }

    .escrow-arrow-detail {
        transform: rotate(90deg);
    }

    .escrow-party-card {
        width: 100%;
    }

    .escrow-progress-line {
        width: 30px;
    }

    .escrow-chat-messages {
        padding: 12px 16px;
        max-height: 300px;
    }

    .escrow-chat-input {
        padding: 12px 16px;
    }

    .escrow-msg {
        max-width: 90%;
    }

    .escrow-actions {
        flex-direction: column;
    }

    .escrow-action-btn {
        width: 100%;
    }

    .escrow-detail-page {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

    .escrow-detail-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .escrow-chat-section {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .escrow-chat-messages {
        max-height: min(52vh, 420px);
        min-height: 220px;
    }

    .escrow-actions {
        position: sticky;
        bottom: calc(68px + env(safe-area-inset-bottom, 0px));
        z-index: 40;
        margin: 0;
        padding: 10px 12px;
        border-radius: var(--radius-md);
        background: rgba(15, 15, 23, 0.96);
        border: 1px solid var(--border);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .escrow-chat-input {
        position: sticky;
        bottom: calc(68px + env(safe-area-inset-bottom, 0px));
        z-index: 39;
        background: rgba(15, 15, 23, 0.98);
        border-top: 1px solid var(--border);
    }

    .escrow-detail-page:has(#escrow-actions:not(:empty)) .escrow-chat-input {
        bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    }

    .escrow-msg-input {
        min-height: 44px;
        font-size: 16px !important;
    }

    .escrow-send-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .escrow-form-body {
        padding: 16px;
    }

    .escrow-amount-bar {
        min-width: 0;
    }

    .escrow-amount-bar-currency .ui-combobox {
        min-width: 4.5rem;
    }

    .escrow-amount-bar-input {
        min-width: 0;
        flex: 1 1 auto;
        font-size: 16px !important;
    }

    .escrow-create-form .btn,
    .escrow-form-card .btn-primary {
        min-height: 44px;
        width: 100%;
    }
}

/* ===== Market Page ===== */
.market-page { padding: 0; }
.market-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.market-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.market-layout {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.market-main { min-width: 0; }
.market-filters {
    position: sticky;
    top: 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}
.market-filters-keyword {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.market-search-input {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.market-search-input:focus-within {
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}
.market-search-input-icon {
    flex-shrink: 0;
    color: var(--text-muted);
}
.market-search-input-field {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
}
.market-search-input-field::placeholder { color: var(--text-faint); }
.market-search-input-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.market-search-input-clear:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}
.market-search-input-clear[hidden] { display: none !important; }
.market-filter-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.market-filter-check-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.market-filter-check-box {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    border-radius: 4px;
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.15);
    transition: border-color 0.15s, background 0.15s;
}
.market-filter-check-input:checked + .market-filter-check-box {
    border-color: #8b5cf6;
    background: #7c3aed;
    box-shadow: inset 0 0 0 2px rgba(15, 15, 23, 0.9);
}
.market-filter-check-label {
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-muted);
}
.market-filters-sections {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.market-filter-expand {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 8px;
}
.market-filter-expand:first-child {
    border-top: none;
    padding-top: 0;
}
.market-filter-expand-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 6px 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}
.market-filter-expand-icon {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.market-filter-expand.is-open .market-filter-expand-icon {
    transform: rotate(180deg);
}
.market-filter-expand-body {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0 8px;
}
.market-filter-expand.is-open .market-filter-expand-body {
    display: flex;
}
.market-filter-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.market-filter-radio:hover { background: rgba(255, 255, 255, 0.03); }
.market-filter-radio-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.market-filter-radio-mark {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    background: transparent;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.market-filter-radio-input:checked + .market-filter-radio-mark {
    border-color: #8b5cf6;
    box-shadow: inset 0 0 0 4px #7c3aed;
}
.market-filter-radio-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.3;
}
.market-filter-radio-input:checked ~ .market-filter-radio-label {
    color: var(--text-primary);
}
.market-filter-price-body { gap: 8px !important; }
.market-filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.market-filter-field-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
}
.market-filter-field-input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.market-filter-field-input:focus {
    border-color: rgba(139, 92, 246, 0.45);
}
.market-filter-field-input::placeholder { color: var(--text-faint); }
.market-filters-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.market-filters-clear {
    align-self: flex-start;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}
.market-filters-clear:hover { color: var(--text-primary); }
.market-sell-overlay { z-index: 1210; }
.market-sell-modal { width: min(480px, 96vw); }
.market-sell-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.market-sell-label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.market-sell-game-field .ui-combobox { width: 100%; }
.market-sell-modal .ui-combobox.is-open { z-index: 2; }
.market-sell-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
    font-size: 0.9rem;
}
.market-sell-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.market-sell-fee-hint { font-size: 0.78rem; color: var(--text-muted); margin: 4px 0 0; }
.market-sell-submit { margin-top: 6px; width: 100%; }
.market-sell-image-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 132px;
    padding: 14px 12px;
    border-radius: 10px;
    border: 1px dashed rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.06);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    outline: none;
}
.market-sell-image-zone:hover,
.market-sell-image-zone:focus-visible {
    border-color: rgba(167, 139, 250, 0.65);
    background: rgba(139, 92, 246, 0.1);
}
.market-sell-image-zone.is-dragover {
    border-color: #a78bfa;
    background: rgba(139, 92, 246, 0.16);
}
.market-sell-image-zone.is-uploading {
    pointer-events: none;
    opacity: 0.75;
}
.market-sell-image-zone.has-image {
    min-height: 148px;
    padding-top: 10px;
}
.market-sell-image-preview {
    display: block;
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    border-radius: 8px;
}
.market-sell-image-hint {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}
.market-sell-image-browse { pointer-events: auto; }
.market-sell-image-clear {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}
.market-sell-image-clear:hover { background: rgba(239, 68, 68, 0.85); }
.market-shop-modal { width: min(640px, 96vw); max-height: 92vh; overflow: hidden; display: flex; flex-direction: column; }
.market-shop-modal .market-sell-body { overflow-y: auto; flex: 1; min-height: 0; }
.market-shop-auto-reply { margin: 4px 0 8px; }
.market-shop-auto-reply-hint { margin: 0 0 8px; font-size: 0.76rem; color: var(--text-muted); line-height: 1.45; }
.market-shop-auto-reply .btn { margin-top: 8px; }
.market-delivery-reply-overlay { z-index: 1250; }
.market-delivery-reply-modal { width: min(520px, 94vw); }
.market-delivery-reply-body { padding: 0 20px 16px; }
.market-delivery-reply-lead { margin: 0 0 12px; font-size: 0.84rem; color: var(--text-muted); line-height: 1.45; }
.market-delivery-reply-text {
    margin: 0;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: min(50vh, 360px);
    overflow: auto;
}
.market-delivery-reply-footer { display: flex; justify-content: flex-end; gap: 8px; }
.market-shop-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.market-shop-section-title { margin: 14px 0 8px; font-size: 0.82rem; font-weight: 700; color: var(--text-muted); }
.market-shop-section-title:first-of-type { margin-top: 0; }
.market-shop-empty { margin: 0; font-size: 0.8rem; color: var(--text-muted); }
.market-shop-trades { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.market-shop-trade {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
    padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}
.market-shop-trade-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.market-shop-trade-info strong { font-size: 0.88rem; }
.market-shop-trade-info span { font-size: 0.76rem; color: var(--text-muted); }
.market-shop-trade-items { font-size: 0.74rem; color: #c4b5fd; word-break: break-word; }
.market-empty-inline { color: var(--text-muted); font-size: 0.85rem; margin: 0; }
.market-my-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.market-my-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
}
.market-my-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.market-my-item-info strong { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-my-item-info span { font-size: 0.76rem; color: var(--text-muted); }
.market-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin: 0;
}
.market-page .ui-combobox.is-open { z-index: 6; }
.market-grid {
    --market-card-min: clamp(150px, 10vw, 190px);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--market-card-min), 1fr));
    gap: 10px;
}

@media (min-width: 1100px) {
    .market-main .market-grid,
    .market-detail-similar-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
.market-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    height: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}
.market-card-hit {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.market-card-seller {
    padding: 0 11px 10px;
    margin-top: -2px;
    flex-shrink: 0;
}
.market-card-seller .market-seller-row {
    margin-top: 0;
}
.market-card:hover {
    border-color: rgba(139, 92, 246, 0.45);
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(139, 92, 246, 0.18), 0 4px 12px rgba(0, 0, 0, 0.35);
}
.market-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    box-sizing: border-box;
    flex-shrink: 0;
    background: rgba(17, 4, 42, 0.65);
    overflow: hidden;
}
.market-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.2s ease;
}
.market-card:hover .market-card-image img {
    transform: scale(1.04);
}
.market-stock-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 2px 7px;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 600;
    border-radius: 5px;
    z-index: 1;
}
.market-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 11px 11px;
    flex: 1;
    min-height: 0;
}
.market-card-category {
    margin: 0;
    font-size: 0.76rem;
    color: #c4b5fd;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.market-card-name {
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.32;
    word-break: break-word;
}
.market-card-prices { display: flex; align-items: baseline; margin-top: 1px; }
.market-price,
.market-price-usd {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fbbf24;
    font-family: var(--font-sans);
    letter-spacing: -0.02em;
}
.market-seller-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 4px;
    min-width: 0;
}
.market-seller-row-compact { margin-top: 2px; }
.market-seller-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(139, 92, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.market-seller-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.market-seller-avatar-shop {
    background: rgba(17, 4, 42, 0.85);
    border: 1px solid rgba(139, 92, 246, 0.25);
}
.market-seller-avatar-shop img {
    object-fit: contain;
    padding: 3px;
}
.market-seller-avatar-fallback {
    font-size: 0.68rem;
    font-weight: 700;
    color: #c4b5fd;
}
.market-seller-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.market-seller-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.market-seller-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.market-seller-active {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    font-size: 0.64rem;
    font-weight: 600;
    color: #4ade80;
    text-transform: lowercase;
}
.market-seller-active-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}
.market-seller-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #fbbf24;
}
.market-seller-rating-count { color: var(--text-muted); font-weight: 500; }
.market-seller-star { width: 11px; height: 11px; flex-shrink: 0; }
.market-seller-badge-super {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin-top: 2px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fde68a;
    background: rgba(251, 191, 36, 0.14);
    border: 1px solid rgba(251, 191, 36, 0.35);
}
.admin-role-locked {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fde68a;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.25);
}
.market-detail-sidebar-card .market-seller-row {
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.market-detail-sidebar-card .market-seller-avatar { width: 36px; height: 36px; }
.market-detail-sidebar-card .market-seller-name { font-size: 0.84rem; }
.market-detail-sidebar-card .market-seller-rating { font-size: 0.76rem; }
.market-price-vnd { display: none; }
.market-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.market-empty svg { margin-bottom: 12px; opacity: 0.4; }
.skeleton-loading.market-loading,
.skeleton-loading.history-loading,
.skeleton-loading.transactions-loading,
.skeleton-loading.msg-global-status,
.skeleton-loading.apikeys-loading {
    padding: 8px 0;
}

.market-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}
.market-footer {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 24px;
    padding-top: 12px;
}
.market-pagination {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
}
.market-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(167, 139, 250, 0.55);
    background: rgba(139, 92, 246, 0.22);
    color: #f5f3ff;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.18);
    transition: all var(--transition-fast);
}
.market-page-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.35);
    box-shadow: none;
}
.market-page-btn:hover:not(:disabled) {
    border-color: #c4b5fd;
    background: rgba(139, 92, 246, 0.38);
    color: #fff;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.28);
}
.market-page-btn.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
    color: #e9d5ff;
    font-weight: 700;
}

/* ===== Market Detail Page ===== */
.market-detail-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 4px 36px;
}
.market-detail-page-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}
.market-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #c4b5fd;
    text-decoration: none;
    transition: color 0.15s;
}
.market-detail-back:hover { color: #e9d5ff; }
.market-detail-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
}
.market-detail-page-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.market-detail-page-gallery {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.market-detail-page-hero {
    flex: 1;
    min-width: 0;
    max-width: 400px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    background: rgba(16, 14, 28, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    cursor: zoom-in;
    overflow: hidden;
}
.market-detail-page-hero .market-detail-main {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.45));
}
.market-detail-page-thumbs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.market-detail-page-thumbs .market-detail-thumb {
    width: 64px;
    height: 64px;
}
.market-detail-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.market-detail-page-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 76px;
}
.market-detail-page .market-detail-desc-card {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}
.market-detail-page .market-detail-desc-scroll {
    max-height: none;
    padding: 0 18px 20px;
}
.market-detail-page-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 48px 16px;
    text-align: center;
    color: var(--text-muted);
}
@media (max-width: 900px) {
    .market-detail-page-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .market-detail-page-sidebar {
        position: static;
    }
    .market-detail-page-hero {
        max-width: 100%;
    }
}
@media (max-width: 560px) {
    .market-detail-page-gallery {
        flex-direction: column;
    }
    .market-detail-page-thumbs {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .market-detail-page-title {
        font-size: 1.1rem;
    }
}

.market-detail-overlay { z-index: 1200; }
.market-detail-modal.market-detail-zeusx {
    width: min(1180px, 96vw);
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 0;
    background: #131220;
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 16px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}
.market-detail-close-floating {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(6px);
}
.market-detail-close-floating:hover { background: rgba(139, 92, 246, 0.55); }
.market-detail-zeusx-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.market-detail-left {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: 22px 28px 28px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.market-detail-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.market-detail-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.market-detail-breadcrumb a:hover { color: #c4b5fd; }
.market-detail-breadcrumb-sep { opacity: 0.45; }
.market-detail-gallery-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
}
.market-detail-gallery-row.market-detail-gallery-single {
    grid-template-columns: 1fr;
}
.market-detail-main-wrap {
    min-width: 0;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    max-height: 300px;
    border-radius: 12px;
    background: rgba(16, 14, 28, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
    padding: 16px;
    cursor: zoom-in;
}
.market-detail-main {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.45));
}
.market-detail-thumbs-col {
    display: grid;
    grid-template-columns: repeat(2, 68px);
    grid-auto-rows: 68px;
    gap: 8px;
    flex-shrink: 0;
    align-self: start;
}
.market-detail-thumb {
    width: 68px;
    height: 68px;
    padding: 0;
    border-radius: 8px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s, transform 0.15s;
}
.market-detail-thumb:hover { transform: scale(1.03); }
.market-detail-thumb.active { border-color: #8b5cf6; box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.4); }
.market-detail-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.market-detail-thumb-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}
.market-detail-full-title {
    margin: 16px 0 14px;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.market-detail-desc-card {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}
.market-detail-desc-heading {
    margin: 0;
    padding: 14px 20px;
    font-size: 0.94rem;
    font-weight: 700;
    color: #fbbf24;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 8px;
}
.market-detail-desc-heading svg { flex-shrink: 0; stroke: #fbbf24; width: 18px; height: 18px; }
.market-detail-desc-scroll {
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px 20px 22px;
}
.market-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px 20px 24px;
    background: rgba(0, 0, 0, 0.15);
    min-height: 0;
    overflow-y: auto;
    align-self: stretch;
}
.market-detail-sidebar-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border-radius: 14px;
    background: rgba(24, 22, 40, 0.92);
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.market-detail-sidebar-recap {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.market-detail-sidebar-price {
    font-size: 2.15rem;
    font-weight: 800;
    color: #fbbf24;
    letter-spacing: -0.03em;
    line-height: 1;
}
.market-detail-seller-pill,
.market-detail-shop-pill {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
}
.market-detail-seller-pill {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.15);
}
.market-detail-shop-pill {
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.18);
}
.market-detail-purchase {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 4px;
}
.market-detail-order-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.market-detail-order-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.market-detail-order-row .market-checkout-label {
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.market-detail-order-row strong {
    font-size: 1.05rem;
    color: #e9d5ff;
    font-weight: 700;
}
.market-detail-order-balance span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

.market-detail-similar {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid rgba(139, 92, 246, 0.15);
}
.market-detail-similar[hidden] {
    display: none !important;
}
.market-detail-similar-title {
    margin: 0 0 16px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.market-detail-similar-grid {
    margin-top: 0;
}

.market-detail-delivery-field { display: flex; flex-direction: column; gap: 6px; }
.market-detail-username-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.25);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.market-detail-username-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.market-detail-username-input::placeholder { color: rgba(255, 255, 255, 0.35); }
@media (max-width: 900px) {
    .market-detail-zeusx-body {
        grid-template-columns: 1fr;
        overflow: auto;
    }
    .market-detail-left {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding: 18px 16px 20px;
    }
    .market-detail-sidebar {
        padding: 16px;
        overflow: visible;
    }
    .market-detail-gallery-row {
        grid-template-columns: 1fr;
    }
    .market-detail-thumbs-col {
        grid-template-columns: repeat(4, 56px);
        grid-auto-rows: 56px;
        width: 100%;
        overflow-x: auto;
    }
    .market-detail-thumb,
    .market-detail-thumb-more { width: 56px; height: 56px; }
    .market-detail-main-wrap {
        aspect-ratio: 4 / 3;
        max-height: min(42vh, 320px);
    }
    .market-detail-full-title { font-size: 1.15rem; }
}
/* Market image fullscreen viewer */
.market-image-lightbox {
    z-index: 1200;
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.market-image-lightbox-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}
.market-image-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.market-image-lightbox-close:hover { background: rgba(139, 92, 246, 0.55); }
.market-image-lightbox-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 52px 88px 8px;
}
.market-image-lightbox-img {
    max-width: min(96vw, 100%);
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
    user-select: none;
}
.market-image-lightbox-fullsize {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #93c5fd;
    text-decoration: none;
}
.market-image-lightbox-fullsize:hover { text-decoration: underline; color: #bfdbfe; }
.market-image-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.market-image-lightbox-nav:hover { background: rgba(255, 255, 255, 0.28); }
.market-image-lightbox-nav.prev { left: 20px; }
.market-image-lightbox-nav.next { right: 20px; }
.market-image-lightbox-thumbs {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 10px 16px 18px;
    overflow-x: auto;
    flex-shrink: 0;
}
.market-image-lightbox-thumb {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    padding: 0;
    border-radius: 8px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    overflow: hidden;
}
.market-image-lightbox-thumb.active { border-color: #fff; }
.market-image-lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
@media (max-width: 768px) {
    .market-image-lightbox-stage { padding: 48px 16px 8px; }
    .market-image-lightbox-nav { width: 40px; height: 40px; font-size: 1.5rem; }
    .market-image-lightbox-nav.prev { left: 8px; }
    .market-image-lightbox-nav.next { right: 8px; }
    .market-image-lightbox-img {
        max-height: calc(100vh - 130px);
        max-height: calc(100dvh - 130px);
    }
    .market-image-lightbox-thumb { width: 52px; height: 52px; }
}
/* legacy detail classes kept for compatibility */
.market-detail-modal {
    width: min(1280px, 98vw);
    max-height: 94vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.market-detail-header { display: none; }
.market-detail-body { display: none; }
.market-detail-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.market-detail-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.15);
}
.market-detail-stock-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
}
.market-detail-details {
    margin-top: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}
.market-detail-details-summary {
    padding: 10px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.market-detail-details-summary::-webkit-details-marker { display: none; }
.market-detail-details-summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.15s ease;
}
.market-detail-details[open] .market-detail-details-summary::before {
    transform: rotate(90deg);
}
.market-detail-details[open] .market-detail-details-summary {
    color: #c4b5fd;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.market-detail-details-body {
    max-height: min(28vh, 220px);
    overflow: auto;
    padding: 10px 12px 12px;
}
.market-detail-desc-wrap { display: none; }
.market-detail-prices { display: none; }
.market-detail-stock { display: none; }
.market-detail-bundle {
    margin: 0;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.18);
}
.market-detail-bundle-title {
    margin: 0 0 10px;
    font-size: 0.84rem;
    font-weight: 700;
    color: #c4b5fd;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.market-detail-bundle-list {
    margin: 0;
    padding-left: 20px;
    font-size: 0.94rem;
    color: var(--text-primary);
    line-height: 1.55;
}
.market-detail-desc {
    font-size: 0.94rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.82);
    word-break: break-word;
}
.market-detail-desc p { margin: 0 0 10px; }
.market-detail-desc p:last-child { margin-bottom: 0; }
.market-detail-desc ul { margin: 10px 0; padding-left: 20px; }
.market-detail-desc strong { color: var(--text-primary); }
.market-detail-checkout {
    flex-shrink: 0;
    margin-top: 0;
    padding: 14px;
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.25);
}
.market-checkout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
@media (max-width: 520px) {
    .market-checkout-grid { grid-template-columns: 1fr; }
}
.market-checkout-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.market-qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}
.market-qty-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s;
}
.market-qty-btn:hover { background: rgba(139, 92, 246, 0.15); }
.market-detail-qty {
    width: 52px;
    text-align: center;
    padding: 8px 4px;
    border: none;
    border-left: 1px solid rgba(139, 92, 246, 0.2);
    border-right: 1px solid rgba(139, 92, 246, 0.2);
    background: transparent;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    -moz-appearance: textfield;
}
.market-detail-qty::-webkit-outer-spin-button,
.market-detail-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.market-checkout-totals { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.market-checkout-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.market-checkout-line strong {
    font-size: 1.15rem;
    font-weight: 700;
    color: #c4b5fd;
}
.market-checkout-balance span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}
.market-detail-buy-btn {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}
.market-detail-purchase .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.market-detail-soldout {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    font-size: 0.85rem;
    text-align: center;
}

/* ===== Admin Page ===== */
.admin-page { padding: 0; }
.admin-header { margin-bottom: 20px; }
.admin-title {
    font-size: 1.4rem;
    font-weight: 700;
}
.admin-tabs {
    display: flex;
    gap: 4px;
    padding: 0 0 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.admin-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.admin-toolbar-hint {
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-toolbar-hint .admin-meta {
    flex: 1 1 220px;
    min-width: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}
.admin-list { display: flex; flex-direction: column; gap: 6px; }

.mail-body {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px solid var(--border);
    max-height: 320px;
    overflow: auto;
}
.mail-body-text {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--font-sans);
}
.mail-body-link {
    color: var(--violet-300);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.mail-body-link:hover {
    color: #c4b5fd;
}
.mail-action-btn {
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid rgba(139, 92, 246, 0.25);
    background: rgba(139, 92, 246, 0.1);
    color: var(--violet-300);
    transition: background 0.15s, border-color 0.15s;
}
.mail-action-btn:hover {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.4);
}
.mail-copy-otp {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.06em;
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid rgba(74, 222, 128, 0.45);
    background: rgba(22, 163, 74, 0.9);
    color: #fff;
    transition: background 0.15s, border-color 0.15s, filter 0.15s;
}
.mail-copy-otp:hover {
    background: rgba(34, 197, 94, 1);
    border-color: rgba(134, 239, 172, 0.6);
    filter: brightness(1.05);
}
.mail-copy-otp--copied {
    background: rgba(21, 128, 61, 1);
    border-color: #bbf7d0;
}
.mail-body::-webkit-scrollbar { width: 5px; }
.mail-body::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.2); border-radius: 4px; }

.admin-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color var(--transition-fast);
}
.admin-item:hover { border-color: rgba(139, 92, 246, 0.3); }
.admin-item-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.admin-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.admin-item-icon-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-weight: 700;
    flex-shrink: 0;
}
.admin-item-info { display: flex; flex-direction: column; min-width: 0; }
.admin-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-item-slug {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.admin-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn-sm { padding: 5px 12px; font-size: 0.75rem; border-radius: 6px; }

.admin-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.admin-modal-content {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}
.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.admin-modal-header h3 { font-size: 1rem; font-weight: 600; }
.admin-modal-body { padding: 20px; }
.admin-escrow-detail-modal {
    max-width: 640px;
}
.admin-escrow-dispute {
    margin: 0;
    padding: 10px 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 8px;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-primary);
    font-size: 0.9rem;
}
.admin-escrow-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.admin-escrow-transcript {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-secondary, rgba(0, 0, 0, 0.15));
}
.admin-escrow-msg {
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
}
.admin-escrow-msg-system {
    opacity: 0.85;
    font-style: italic;
}
.admin-escrow-msg-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.admin-escrow-msg-name { font-weight: 600; color: var(--text-secondary); }
.admin-escrow-msg-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.88rem;
    color: var(--text-primary);
}
.admin-escrow-reason-cell {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-escrow-overdue {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    color: #fff;
    background: var(--danger, #d64545);
}
.admin-icon-preview { margin-top: 8px; }
.admin-field { margin-bottom: 14px; }
.admin-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}
.admin-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-fast);
}
.admin-input:focus { border-color: var(--accent); }
.admin-upload-row { display: flex; gap: 8px; align-items: center; }
.admin-upload-row .admin-input { flex: 1; }
.btn-upload {
    cursor: pointer;
    white-space: nowrap;
    padding: 10px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
    flex-shrink: 0;
}
.admin-input::placeholder { color: var(--text-faint); }
select.admin-input { cursor: pointer; }
select.admin-input option { background: var(--bg-primary); }
.admin-vnd-preview {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--success);
    font-family: var(--font-sans);
}

@media (max-width: 900px) {
    .market-layout {
        grid-template-columns: 1fr;
    }
    .market-filters {
        position: static;
    }
    .market-grid {
        --market-card-min: clamp(140px, 38vw, 180px);
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .market-grid {
        --market-card-min: clamp(130px, 42vw, 165px);
        gap: 8px;
    }
    .market-header-actions { width: 100%; }
    .market-header-actions .btn {
        flex: 1;
        justify-content: center;
        min-height: 44px;
    }
    .market-filters {
        padding: 12px;
    }
    .market-filters-actions .btn,
    .market-filters-clear {
        min-height: 40px;
    }
    .market-page-btn {
        min-width: 40px;
        min-height: 40px;
    }
    .admin-item { flex-direction: column; align-items: flex-start; gap: 8px; }
    .admin-item-actions { width: 100%; justify-content: flex-end; }
}

/* ===== Admin Tabs (new multi-tab) ===== */
.admin-tab {
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.admin-tab:hover {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}
.admin-tab.active {
    background: rgba(139, 92, 246, 0.12);
    border-color: var(--border-hover);
    color: var(--violet-400);
}
.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }
.yp-headers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    grid-column: 1 / -1;
}
.yp-headers-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem;
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    cursor: pointer;
    min-width: 0;
}
.yp-headers-card.is-active {
    border-color: var(--violet-400, #a78bfa);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.1);
}
.yp-headers-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.yp-headers-card-title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
}
.yp-headers-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.yp-headers-card textarea.yp-headers-paste {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    min-height: 16rem;
    width: 100%;
    resize: vertical;
    cursor: text;
}
.yp-headers-toggle-btn[aria-pressed="true"] {
    background: rgba(139, 92, 246, 0.28);
    border-color: var(--violet-400, #a78bfa);
    color: #fff;
}
@media (max-width: 800px) {
    .yp-headers-grid { grid-template-columns: 1fr; }
}
.admin-data-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.admin-data-table th { text-align: left; padding: 8px 12px; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border); }
.admin-data-table td { padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--text-secondary); }
.admin-data-table tr:hover td { background: rgba(255,255,255,0.02); }
.admin-section-title { margin: 0 0 10px; font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.admin-cred-cell { max-width: 320px; }
.admin-cred-text { display: block; white-space: pre-wrap; word-break: break-all; font-size: 0.75rem; color: var(--text-primary); }
.admin-accounts-table .admin-cred-cell { max-width: 420px; }
.admin-login-accounts-table .admin-login-row { cursor: pointer; }
.admin-login-accounts-table .admin-login-row.selected td { background: rgba(139, 92, 246, 0.12); }
.admin-login-accounts-table .admin-login-row:hover td { background: rgba(255,255,255,0.04); }
.admin-accounts-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-accounts-detail-head .admin-section-title { margin: 0; }
.admin-accounts-table .admin-actions-cell { white-space: nowrap; }
.admin-accounts-table .admin-actions-cell .btn {
    margin: 0 6px 6px 0;
    min-height: 34px;
    min-width: 76px;
    padding: 6px 14px;
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 8px;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.08s ease, background 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease, border-color 0.12s ease;
}
@media (hover: hover) {
    .admin-accounts-table .admin-actions-cell .btn:hover:not(:disabled):not(.is-busy) {
        transform: translateY(-1px);
        box-shadow: 0 3px 10px rgba(139, 92, 246, 0.35);
    }
}
.admin-accounts-table .admin-actions-cell .btn:active:not(:disabled):not(.is-busy),
.admin-accounts-table .admin-actions-cell .btn.is-pressed:not(:disabled):not(.is-busy) {
    transform: translateY(1px) scale(0.97);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.28);
    background: rgba(139, 92, 246, 0.28);
    border-color: #8b5cf6;
}
.admin-accounts-table .admin-actions-cell .btn.btn-primary:active:not(:disabled):not(.is-busy),
.admin-accounts-table .admin-actions-cell .btn.btn-primary.is-pressed:not(:disabled):not(.is-busy) {
    background: rgba(139, 92, 246, 0.42);
}
.admin-accounts-table .admin-actions-cell .btn.is-busy {
    opacity: 0.82;
    cursor: wait;
    pointer-events: none;
    transform: scale(0.98);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.2);
}
.admin-accounts-table .admin-actions-cell .btn.is-busy::after {
    content: '';
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-left: 6px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: admin-action-btn-spin 0.55s linear infinite;
}
@keyframes admin-action-btn-spin {
    to { transform: rotate(360deg); }
}

.admin-db-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
    min-height: 420px;
}
.admin-db-sidebar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    max-height: 70vh;
    overflow: auto;
}
.admin-db-table-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-align: left;
    cursor: pointer;
}
.admin-db-table-btn:hover,
.admin-db-table-btn.active {
    background: var(--state-active-bg);
    border-color: var(--state-active-border);
    color: var(--text-primary);
}
.admin-db-table-name { font-family: var(--font-sans); }
.admin-db-table-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
}
.admin-db-main { min-width: 0; }
.admin-db-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.admin-db-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-db-auto {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.admin-db-table-wrap { overflow: auto; max-height: 65vh; }
.admin-db-data-table { white-space: nowrap; }
.admin-db-data-table td { max-width: 280px; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-sans); font-size: 0.72rem; }
.admin-db-null { color: var(--text-faint); }

@media (max-width: 900px) {
    .admin-db-layout { grid-template-columns: 1fr; }
    .admin-db-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        max-height: none;
    }
    .admin-db-table-btn { width: auto; flex: 1 1 calc(50% - 4px); }
}

.admin-monitor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}
.admin-monitor-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    min-width: 0;
}
.admin-monitor-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}
.admin-monitor-toolbar {
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    align-items: center;
}
.admin-monitor-hint { margin: 0 0 12px; }

/* Admin Logs — Roblox163-style monospace viewer */
.admin-logs-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.admin-logs-hint {
    margin: 0 0 10px;
}
.admin-log-panel {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
    font-size: 12px;
    background: var(--surface-1, var(--surface));
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    max-height: calc(100vh - 260px);
    overflow-y: auto;
    line-height: 1.6;
}
.log-minute-divider {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 10px 0 4px;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    user-select: none;
}
.log-minute-divider:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}
.log-entry-row {
    display: flex;
    gap: 8px;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    align-items: baseline;
}
.log-entry-time {
    color: var(--text-muted);
    min-width: 88px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.log-entry-level {
    font-weight: 600;
    min-width: 40px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.log-entry-source {
    min-width: 100px;
    flex-shrink: 0;
    color: #a78bfa;
}
.log-entry-msg {
    color: var(--text-primary);
    word-break: break-word;
}
.admin-monitor-table-wrap { max-height: 58vh; overflow: auto; }
.admin-query-log-table .query-log-sql {
    max-width: 420px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-sans);
    font-size: 0.72rem;
}
tr.query-log-slow td { background: rgba(245, 158, 11, 0.08); }
.query-log-err { color: #f87171; font-size: 0.72rem; }

@media (max-width: 1100px) {
    .admin-monitor-grid { grid-template-columns: 1fr; }
}
/* Status badges - match history/escrow palette (amber pending, emerald done, red failed) */
.admin-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
    color: var(--text-secondary);
    background: rgba(148, 163, 184, 0.12);
}
.admin-status-badge.pending,
.admin-status-badge.PENDING,
.admin-status-badge.processing,
.admin-status-badge.PROCESSING {
    background: rgba(250, 204, 21, 0.12);
    color: var(--yellow-400, #facc15);
    border-color: rgba(250, 204, 21, 0.32);
}
.admin-status-badge.completed,
.admin-status-badge.COMPLETED {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-300);
    border-color: rgba(16, 185, 129, 0.32);
}
.admin-status-badge.rejected,
.admin-status-badge.REJECTED,
.admin-status-badge.failed,
.admin-status-badge.FAILED,
.admin-status-badge.disputed,
.admin-status-badge.DISPUTED {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red-400);
    border-color: rgba(239, 68, 68, 0.32);
}
.admin-status-badge.active,
.admin-status-badge.ACTIVE {
    background: rgba(96, 165, 250, 0.12);
    color: var(--blue-400);
    border-color: rgba(96, 165, 250, 0.32);
}
.admin-status-badge.cancelled,
.admin-status-badge.CANCELLED {
    background: rgba(148, 163, 184, 0.12);
    color: var(--slate-400);
    border-color: rgba(148, 163, 184, 0.28);
}
.admin-action-btn { padding: 4px 10px; border-radius: 4px; border: none; font-size: 0.72rem; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); }
.admin-action-btn.approve { background: rgba(16, 185, 129, 0.15); color: var(--emerald-300); }
.admin-action-btn.reject { background: rgba(239, 68, 68, 0.12); color: var(--red-400); }
.admin-action-btn.revoke { background: rgba(239, 68, 68, 0.12); color: var(--red-400); }
.admin-action-btn:hover { opacity: 0.8; }
.admin-action-btn.active { background: rgba(96, 165, 250, 0.18); color: var(--blue-400); }
.admin-filter-chip {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}
.admin-filter-chip.active {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(96, 165, 250, 0.12);
    color: var(--blue-300);
}
.admin-txn-filters {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}
.admin-txn-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.admin-txn-filter-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 2px;
}
.admin-txn-filter-preset {
    margin-left: 4px;
}
.admin-table tr.admin-txn-detail-row {
    display: table-row;
}
.admin-txn-detail-row td {
    background: var(--surface-hover);
    padding: 8px 12px 10px 16px;
    border-top: none;
    border-left: 3px solid var(--border-active);
}
.admin-withdraw-pay {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px 16px;
    width: fit-content;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-sizing: border-box;
}
.admin-withdraw-pay-meta {
    display: grid;
    gap: 5px;
    width: min(100%, 380px);
    flex: 0 1 380px;
    min-width: 0;
}
.admin-withdraw-pay-row {
    display: grid;
    grid-template-columns: minmax(96px, 118px) minmax(0, 1fr);
    gap: 4px 10px;
    align-items: baseline;
}
.admin-withdraw-pay-row.is-secondary {
    opacity: 0.72;
}
.admin-withdraw-pay-row.is-secondary .admin-withdraw-pay-label,
.admin-withdraw-pay-row.is-secondary .admin-withdraw-pay-value {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
}
.admin-withdraw-pay-row.is-net .admin-withdraw-pay-value {
    font-size: 0.95rem;
}
.admin-withdraw-pay-row.is-net .admin-withdraw-net {
    color: var(--emerald-300);
    font-variant-numeric: tabular-nums;
}
.admin-withdraw-pay-row.is-content {
    margin-top: 2px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}
.admin-withdraw-pay-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}
.admin-withdraw-pay-value {
    font-size: 0.84rem;
    color: var(--text-primary);
    min-width: 0;
    word-break: break-word;
}
.admin-withdraw-pay-value strong {
    font-weight: 600;
    color: var(--text-primary);
}
.admin-withdraw-pay-value code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1px 6px;
}
.admin-withdraw-pay-value code.admin-withdraw-content {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}
.admin-withdraw-pay-meta .admin-copy-btn {
    margin-left: 4px;
    vertical-align: middle;
    padding: 2px 7px;
    font-size: 0.68rem;
    background: var(--state-active-bg);
    color: var(--text-secondary);
    border-color: var(--border);
}
.admin-withdraw-qr {
    flex: 0 0 auto;
    text-align: center;
    padding: 0;
    border: none;
    background: transparent;
}
.admin-withdraw-qr-caption {
    margin: 0 0 6px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}
.admin-withdraw-qr-frame {
    display: inline-flex;
    padding: 8px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.admin-withdraw-qr-frame img {
    display: block;
    width: 200px;
    height: 200px;
    max-width: min(200px, 42vw);
    max-height: min(200px, 42vw);
    object-fit: contain;
}
.admin-withdraw-qr-missing {
    max-width: 220px;
    margin: 0;
    font-size: 0.75rem;
}
.admin-withdraw-pay.is-settled {
    padding: 8px 10px;
}
.admin-withdraw-pay.is-settled .admin-withdraw-pay-meta {
    width: min(100%, 360px);
    flex-basis: 360px;
}
@media (max-width: 720px) {
    .admin-txn-detail-row td {
        padding: 8px 10px;
        border-left-width: 2px;
    }
    .admin-withdraw-pay {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 420px;
        gap: 12px;
    }
    .admin-withdraw-pay-meta {
        width: 100%;
        flex: 1 1 auto;
    }
    .admin-withdraw-qr {
        align-self: flex-start;
    }
}
.admin-apikey-form { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-apikey-form .admin-input { flex: 1; min-width: 150px; }

/* Touch-friendly targets */
@media (pointer: coarse) {
    .nav-link,
    .nav-link-single,
    .nav-group-toggle,
    .toolbar-btn,
    .tab-btn,
    .quick-amount-btn,
    .network-btn,
    .provider-btn,
    .denomination-btn {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .page-btn,
    .page-number {
        min-width: 44px;
        min-height: 44px;
    }

    .checkbox-custom {
        width: 20px;
        height: 20px;
    }
}

/* Inventory Modal */
.inv-modal-backdrop {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.inv-modal {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; width: 100%; max-width: 520px; max-height: 80vh;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.inv-modal-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.inv-modal-header h3 { flex: 1; margin: 0; font-size: 0.95rem; color: var(--text-primary); }
.inv-modal-total { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-sans); }
.inv-modal-close {
    background: none; border: none; color: var(--text-muted); font-size: 1.5rem;
    cursor: pointer; line-height: 1; padding: 0 4px;
}
.inv-modal-close:hover { color: var(--text-primary); }
.inv-modal-search { padding: 10px 20px; border-bottom: 1px solid var(--border); }
.inv-search-input {
    width: 100%; padding: 8px 12px; border-radius: 6px;
    border: 1px solid var(--border); background: rgba(255,255,255,0.04);
    color: var(--text-primary); font-size: 0.82rem; font-family: inherit; outline: none;
}
.inv-search-input:focus { border-color: var(--accent); }
.inv-modal-body { overflow-y: auto; flex: 1; }
.inv-table { width: 100%; border-collapse: collapse; }
.inv-table th {
    position: sticky; top: 0; background: var(--surface);
    padding: 8px 20px; text-align: left; font-size: 0.75rem;
    color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border);
}
.inv-table td { padding: 6px 20px; font-size: 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.03); }
.inv-item-name { color: var(--text-secondary); }
.inv-item-qty {
    color: var(--cyan-300); font-family: var(--font-sans);
    font-weight: 600; text-align: right; width: 60px;
}
.inv-table tr:hover td { background: rgba(255,255,255,0.03); }
.inv-empty { text-align: center; color: var(--text-muted); padding: 24px; }

.script-modal { max-width: 720px; width: min(92vw, 720px); }
.script-modal-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.script-modal-hint { margin: 0; font-size: 0.82rem; color: var(--text-muted); line-height: 1.45; }
.script-modal-note { margin: 0; font-size: 0.8rem; color: var(--cyan-300); }
.script-modal-actions { display: flex; justify-content: flex-end; }
.toolbar-btn-script span { font-size: 0.78rem; font-weight: 600; }
.toolbar-btn-script { gap: 6px; padding: 0 12px; width: auto; }

/* API Keys Page */
.apikeys-page { max-width: 800px; }
.apikeys-header h2 { font-size: 1.3rem; margin: 0 0 4px; }
.apikeys-subtitle { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 20px; }
.apikeys-create { display: flex; gap: 8px; margin-bottom: 16px; }
.apikeys-name-input {
    flex: 1; padding: 10px 14px; border-radius: 8px;
    border: 1px solid var(--border); background: rgba(255,255,255,0.04);
    color: var(--text-primary); font-size: 0.85rem; font-family: inherit; outline: none;
}
.apikeys-name-input:focus { border-color: var(--accent); }
.apikey-result {
    background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.2);
    border-radius: 8px; padding: 12px 16px; margin-bottom: 16px;
}
.apikey-result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.apikey-result-label { font-size: 0.8rem; color: var(--success); font-weight: 600; }
.apikey-copy-btn {
    padding: 4px 12px; border-radius: 4px; border: 1px solid var(--success);
    background: none; color: var(--success); font-size: 0.75rem; font-weight: 600; cursor: pointer;
}
.apikey-result-value {
    display: block; padding: 8px 12px; background: rgba(0,0,0,0.3); border-radius: 6px;
    font-family: var(--font-sans); font-size: 0.82rem; color: var(--text-primary);
    word-break: break-all; user-select: all;
}
.apikeys-table { width: 100%; border-collapse: collapse; }
.apikeys-table th {
    text-align: left; padding: 10px 12px; font-size: 0.75rem; color: var(--text-muted);
    font-weight: 600; border-bottom: 1px solid var(--border);
}
.apikeys-table td { padding: 10px 12px; font-size: 0.82rem; color: var(--text-secondary); border-bottom: 1px solid rgba(255,255,255,0.04); }
.apikeys-table tr:hover td { background: rgba(255,255,255,0.02); }
.apikey-masked { font-family: var(--font-sans); font-size: 0.78rem; color: var(--text-muted); }
.apikey-status { padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 600; }
.apikey-active { background: rgba(34,197,94,0.15); color: #22c55e; }
.apikey-revoked { background: rgba(239,68,68,0.15); color: #ef4444; }
.apikeys-empty, .apikeys-loading { color: var(--text-muted); font-size: 0.85rem; padding: 20px 0; }
.apikeys-cards { display: none; }
.apikeys-mobile-cards .apikeys-cards { display: flex; flex-direction: column; gap: 10px; }
.apikeys-mobile-cards .apikeys-table-wrap { display: none; }
.apikey-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    background: rgba(15, 15, 23, 0.9);
}
.apikey-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.apikey-card-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
}
.apikey-card-meta {
    margin: 8px 0 10px;
    font-size: 0.78rem;
    line-height: 1.4;
}
.apikey-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.apikey-card-actions .btn-sm {
    min-height: 40px;
    padding: 8px 14px;
}
.apikey-card .apikey-masked {
    display: block;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.25);
    word-break: break-all;
    font-size: 0.72rem;
}
.btn-sm { padding: 4px 10px; border-radius: 4px; border: none; font-size: 0.72rem; font-weight: 600; cursor: pointer; }
.btn-warn { background: rgba(245,158,11,0.15); color: #f59e0b; margin-right: 4px; }
.btn-warn:hover { background: rgba(245,158,11,0.25); }
.btn-danger { background: rgba(239,68,68,0.15); color: #ef4444; }
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.apikeys-docs-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
    padding: 18px 20px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--state-active-border);
    background: var(--state-active-bg);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
    color: inherit;
    transition: border-color var(--transition-base), background var(--transition-base), transform var(--transition-base);
    cursor: pointer;
}
.apikeys-docs-banner:hover {
    background: rgba(139, 92, 246, 0.18);
    border-color: #8b5cf6;
    transform: translateY(-2px);
}
.apikeys-docs-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}
.apikeys-docs-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.apikeys-docs-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.apikeys-docs-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}
.apikeys-docs-cta {
    flex-shrink: 0;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid var(--border-hover);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}
.apikeys-docs-banner:hover .apikeys-docs-cta {
    background: rgba(139, 92, 246, 0.35);
    border-color: #8b5cf6;
}

@media (max-width: 640px) {
    .apikeys-docs-banner {
        flex-wrap: wrap;
    }
    .apikeys-docs-cta {
        width: 100%;
        text-align: center;
    }
}
.apikey-actions { white-space: nowrap; }

.profile-avatar-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}
.profile-avatar-fields {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.profile-avatar-file {
    width: 100%;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    padding: 4px 0;
}

/* ===== Profile Page (compact, tabbed) ===== */
.profile-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}
.profile-page > .transactions-tabs {
    margin-bottom: 4px;
}
.profile-card {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.profile-card-identity {
    display: flex;
    align-items: center;
    gap: 14px;
}
.profile-avatar-picker {
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 50%;
    line-height: 0;
}
.profile-avatar-picker:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
.profile-avatar-picker-badge {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: 2px solid var(--surface, #1e1e2e);
    pointer-events: none;
}
.profile-identity-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.profile-avatar-file {
    display: none;
}
.profile-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 16px;
}
.profile-reviews-card {
    max-width: none;
}

@media (max-width: 720px) {
    .profile-fields-grid { grid-template-columns: 1fr; }
    .profile-card-identity { align-items: flex-start; }
}
.admin-settings-card {
    max-width: 420px;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--surface-raised, rgba(255,255,255,0.02));
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.admin-settings-card h3 {
    margin: 0;
    font-size: 1rem;
}
.admin-settings-card .ui-hint,
.admin-settings-card .form-hint {
    margin: 0;
    line-height: 1.5;
}

.admin-restore-hint {
    margin-top: 6px;
}
.admin-settings-card .admin-meta {
    margin: 0;
    line-height: 1.45;
}
.admin-settings-card .admin-field {
    margin: 0;
}
.admin-check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.45;
}
.admin-check-label input {
    margin-top: 3px;
    flex-shrink: 0;
}
.admin-field-check .ui-hint,
.admin-field-check .form-hint {
    margin-top: 6px;
}
.admin-settings-card > .btn {
    margin: 0;
    align-self: flex-start;
}
.admin-code-block {
    margin: 0;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.25);
    font-size: 11px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 120px;
    overflow: auto;
}
.smoke-results {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 320px;
    overflow: auto;
    margin-top: 8px;
}
.smoke-case {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: start;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}
.smoke-case-pass { border-color: rgba(34, 197, 94, 0.35); }
.smoke-case-fail { border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.06); }
.smoke-case-icon { font-weight: 700; }
.smoke-case-pass .smoke-case-icon { color: #22c55e; }
.smoke-case-fail .smoke-case-icon { color: #ef4444; }
.smoke-case-msg {
    grid-column: 2 / -1;
    color: var(--text-muted, #888);
    word-break: break-word;
}
.smoke-summary-ok { color: #22c55e; }
.smoke-summary-fail { color: #ef4444; }
.db-op-progress {
    width: 100%;
    margin-top: 4px;
}
.db-op-progress-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.db-op-progress-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.db-op-progress-bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: #8b5cf6;
    transition: width 0.15s ease;
}
.db-op-progress.is-indeterminate .db-op-progress-bar {
    width: 35% !important;
    animation: db-op-progress-slide 1.2s ease-in-out infinite;
}
@keyframes db-op-progress-slide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}
.db-op-progress-meta {
    margin-top: 6px;
}
.server-info-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.18);
    margin-bottom: 12px;
}
.server-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.server-info-line {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 8px 12px;
    align-items: baseline;
    font-size: 0.875rem;
    line-height: 1.45;
}
.server-info-k {
    color: var(--text-muted);
    font-weight: 500;
}
.server-info-v {
    color: var(--text-primary);
    word-break: break-word;
}
.profile-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color, #2a2a3a);
    background: #1a1a24;
    flex-shrink: 0;
}
.wallet-panel-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.wallet-panel-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 16px;
    padding: 0;
    border: none;
    background: none;
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}
.wallet-panel-back:hover {
    text-decoration: underline;
}
.wallet-panel-back[hidden] {
    display: none !important;
}
.wallet-panel {
    display: none;
}
.wallet-panel.active {
    display: block;
}
.wallet-deposit-root .deposit-layout,
.wallet-deposit-root .deposit-methods {
    margin-top: 0;
}
.wallet-withdraw-root .withdraw-form-wrap {
    margin-top: 0;
}
.wallet-withdraw-root .withdraw-balance-pill {
    margin-top: 0;
}
.wallet-history-root .history-page {
    max-width: none;
    margin: 0;
    padding: 0;
}
.profile-following-root .friends-page,
.profile-apikeys-root .apikeys-page {
    max-width: none;
    margin: 0;
}
#profile-wallet-root .wallet-page {
    max-width: none;
    margin: 0;
    padding: 0;
}
.withdraw-form-wrap .ui-combobox,
.wallet-withdraw-root .ui-combobox {
    width: 100%;
}
.deposit-balance-hint {
    text-align: center;
    margin-bottom: 16px;
    color: var(--text-muted, #94a3b8);
    font-size: 14px;
}

/* Withdraw page */
.withdraw-page {
    max-width: 480px;
    margin: 0 auto;
}

.withdraw-balance-pill {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 16px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
    color: var(--emerald-300);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    font-family: var(--font-sans);
}

.withdraw-tabs {
    display: flex;
    margin: 0 auto 20px;
    width: 100%;
    max-width: 100%;
}

.withdraw-tabs .tab-btn {
    flex: 1;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.withdraw-tabs .withdraw-tab-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.withdraw-form-wrap {
    width: 100%;
}

.withdraw-card {
    margin: 0;
}

.withdraw-card:hover {
    transform: none;
}

.withdraw-card .deposit-card-body {
    gap: 16px;
}

.withdraw-saved-block {
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.withdraw-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-hint {
    margin: 0;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.withdraw-amount-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.withdraw-amount-header .deposit-label {
    margin: 0;
}

.withdraw-all-btn {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--cyan-300);
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.withdraw-all-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.55);
}

.withdraw-save-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    margin: 4px 0 8px;
    cursor: pointer;
    user-select: none;
}

.withdraw-save-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.withdraw-submit-btn {
    margin-top: 4px;
}

.withdraw-bank-eta-notice {
    margin: 0 0 4px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.35);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.45;
}

.withdraw-paypass-hint .ui-hint-link,
.profile-paypass-forgot-wrap .ui-hint-link,
.paypass-resend-btn,
.paypass-resend-row .ui-hint-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
}

.withdraw-paypass-hint .ui-hint-link:hover,
.profile-paypass-forgot-wrap .ui-hint-link:hover,
.paypass-resend-btn:hover,
.paypass-resend-row .ui-hint-link:hover {
    text-decoration: none;
}

.withdraw-paypass-hint {
    margin-top: 6px;
}

.profile-paypass-forgot-wrap {
    margin: 4px 0 0;
}

.paypass-modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Hints in pay-password dialogs: match .modal-body (0.88rem), not microcopy .ui-hint (0.72rem) */
.paypass-modal .ui-hint,
.paypass-modal .ui-hint-text,
.paypass-modal .paypass-modal-error,
.paypass-modal #paypass-modal-error {
    font-size: 0.88rem;
    line-height: 1.5;
}

.paypass-modal .ui-hint-body {
    gap: 8px;
}

.paypass-modal .ui-hint-icon {
    width: 16px;
    height: 16px;
    margin-top: 2px;
}

.paypass-modal .paypass-resend-btn,
.paypass-modal .paypass-resend-row .ui-hint-link {
    font-size: 0.88rem;
    line-height: 1.5;
}

.paypass-modal-error {
    color: #fca5a5;
}

.paypass-password-row {
    position: relative;
}

.paypass-password-row .deposit-input {
    padding-right: 2.75rem;
}

.paypass-password-row .deposit-input:focus {
    transform: none;
}

.paypass-eye-btn {
    position: absolute;
    top: 50%;
    right: 0.65rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.paypass-eye-btn:hover,
.paypass-eye-btn[aria-pressed="true"] {
    color: var(--text-primary);
}

.paypass-eye-btn:focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.55);
    outline-offset: 1px;
}

.paypass-resend-row {
    margin-top: 2px;
}

/* Item search results (dashboard) */
.item-search-results {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.08);
}
.item-search-summary-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.item-search-summary-title {
    font-size: 0.875rem;
    color: var(--text-primary);
}
.item-search-summary-title strong {
    color: #c4b5fd;
}
.item-search-summary-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.item-search-summary-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}
.item-search-account-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.item-search-account-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #c4b5fd;
    min-width: 88px;
}
.item-match-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}
.item-match-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    line-height: 1.3;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #a7f3d0;
}
.item-match-chip em {
    font-style: normal;
    opacity: 0.85;
    font-size: 0.68rem;
}
.item-match-chip-compact {
    font-size: 0.68rem;
    padding: 2px 7px;
}
.account-item-matches {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.build-footer {
    font-size: 0.65rem;
    color: #64748b;
    text-align: center;
    padding: 4px 8px 10px;
    font-family: var(--font-sans);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.build-footer-link {
    color: #a78bfa;
    text-decoration: none;
}
.build-footer-link:hover {
    color: #c4b5fd;
    text-decoration: underline;
}
.build-footer-sep { opacity: 0.5; }
.build-footer-stale {
    color: #f87171;
    font-weight: 700;
}
.build-footer-stale .build-footer-link { color: #fca5a5; }

.build-footer-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
}
.footer-contact-wrap {
    position: relative;
    display: inline-flex;
}
.footer-contact-panel {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    padding: 12px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border-hover);
    box-shadow: var(--shadow-hover);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}
.footer-contact-panel[hidden] { display: none; }
.footer-contact-title {
    margin: 0 0 4px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.footer-contact-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(139, 92, 246, 0.08);
    text-decoration: none;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}
.footer-contact-item:hover {
    border-color: var(--state-active-border);
    background: var(--state-active-bg);
}
.footer-contact-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.footer-contact-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: #a78bfa;
    font-family: var(--font-sans);
}
.landing-footer-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    font-size: inherit;
    color: inherit;
}

/* Hide logged-in chrome until checkAuth completes (app.js removes auth-pending). */
body.auth-pending .sidebar,
body.auth-pending .sidebar-backdrop,
body.auth-pending .main-header,
body.auth-pending .build-footer {
    display: none !important;
}
body.auth-pending .main-content {
    margin-left: 0 !important;
}

body.guest-docs .sidebar,
body.guest-docs .sidebar-backdrop,
body.guest-docs .bottom-nav,
body.guest-docs .menu-toggle,
body.guest-docs .header-balance-pill,
body.guest-docs .header-community-user-stat,
body.guest-docs .header-notification-btn,
body.guest-docs .header-user-btn {
    display: none !important;
}
body.guest-docs .main-content {
    margin-left: 0;
}
body.guest-docs .guest-login-btn {
    margin-right: 4px;
}
body.guest-docs #build-footer-text,
body.guest-docs #build-footer-text + .build-footer-sep {
    display: none !important;
}

body.guest-public .market-header-actions {
    display: none !important;
}

.midman-intro-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 28px 20px 48px;
}
.midman-intro-brand {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-hover);
}
.midman-intro-title {
    margin: 0 0 12px;
    font-size: clamp(1.45rem, 2.4vw, 1.85rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
}
.midman-intro-lead {
    margin: 0 0 28px;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text-secondary);
}
.midman-intro-steps {
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.midman-intro-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}
.midman-intro-step-num {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--violet-300);
    background: var(--accent-muted);
    border: 1px solid var(--border);
}
.midman-intro-step h3 {
    margin: 0 0 4px;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-primary);
}
.midman-intro-step p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-muted);
}
.midman-intro-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.midman-intro-footnote {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-muted);
}
@media (max-width: 640px) {
    .midman-intro-page {
        padding: 16px 12px 40px;
    }
    .midman-intro-title {
        font-size: clamp(1.28rem, 6.2vw, 1.6rem);
    }
    .midman-intro-lead {
        font-size: 0.92rem;
        margin-bottom: 20px;
    }
    .midman-intro-step {
        padding: 12px;
        gap: 12px;
    }
    .midman-intro-cta {
        flex-direction: column;
    }
    .midman-intro-cta .btn {
        flex: 1 1 auto;
        width: 100%;
        min-height: 44px;
        text-align: center;
    }
}

.market-detail-guest-hint {
    margin: 10px 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.market-detail-signin-buy {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.landing-footer-link {
    color: #a78bfa;
    text-decoration: none;
}
.landing-footer-link:hover {
    color: #c4b5fd;
    text-decoration: underline;
}

/* API Docs */
.apidocs-header {
    margin-bottom: 24px;
    overflow: visible;
    position: relative;
    z-index: 5;
}
.apidocs-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    overflow: visible;
    position: relative;
    z-index: 5;
}
.apidocs-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.apidocs-copy-hint { margin: 8px 0 0; }

.apidocs-page { max-width: 1100px; margin: 0 auto; }
.apidocs-lead { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; max-width: 720px; }
.apidocs-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.apidocs-nav {
    position: sticky;
    top: calc(var(--header-height) + 12px);
    max-height: calc(100vh - var(--header-height) - 24px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}
.apidocs-nav-chips {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.apidocs-nav-drawer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.apidocs-nav-menu-toggle {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
}
.apidocs-nav-menu-toggle:hover,
.apidocs-nav-menu-toggle:focus-visible,
.apidocs-nav-menu-toggle.is-open,
.apidocs-nav-menu-toggle.has-active {
    background: var(--state-active-bg);
    border-color: var(--state-active-border);
    color: var(--text-primary);
    outline: none;
}
.apidocs-nav-menu-toggle-icon {
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    flex-shrink: 0;
}
.apidocs-nav-menu-toggle.is-open .apidocs-nav-menu-toggle-icon {
    transform: rotate(-135deg);
}
.apidocs-nav-btn {
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}
.apidocs-nav-btn:hover,
.apidocs-nav-btn.active {
    background: var(--state-active-bg);
    border-color: var(--state-active-border);
    color: var(--text-primary);
}
/* Section-focused docs: one card visible; nav/hash/pager pick the active section. */
.apidocs-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}
.apidocs-card {
    padding: 20px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--glass-shadow);
    scroll-margin-top: calc(var(--header-height) + 20px);
}
.apidocs-card:not(.is-active),
.apidocs-card[hidden] {
    display: none;
}
.apidocs-pager {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
}
.apidocs-pager-btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.apidocs-pager-btn-next {
    justify-content: flex-end;
    text-align: right;
    margin-left: auto;
}
.apidocs-pager-btn:hover:not(:disabled) {
    border-color: var(--state-active-border);
    color: var(--text-primary);
    background: var(--state-active-bg);
}
.apidocs-pager-btn:disabled,
.apidocs-pager-btn[hidden] {
    display: none;
}
.apidocs-pager-dir {
    flex-shrink: 0;
    color: var(--text-muted);
}
.apidocs-pager-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.apidocs-card h3 { margin: 0 0 12px; font-size: 1.05rem; }
.apidocs-h3 { margin: 20px 0 8px; font-size: 0.95rem; }
.apidocs-h4 { margin: 16px 0 8px; font-size: 0.85rem; color: var(--text-muted); }
.apidocs-text { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.6; margin: 0 0 10px; }
.apidocs-text a { color: #a78bfa; }
.apidocs-list { margin: 0 0 12px; padding-left: 1.2rem; color: var(--text-secondary); font-size: 0.88rem; }
.apidocs-example {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 10px 0;
    border-radius: var(--radius-md);
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid var(--border);
    overflow-x: auto;
}
.apidocs-method {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.apidocs-method-get { color: #34d399; }
.apidocs-method-post { color: #60a5fa; }
.apidocs-method-put { color: #fbbf24; }
.apidocs-method-delete { color: #f87171; }
.apidocs-endpoint {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.apidocs-endpoint:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.apidocs-endpoint-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.apidocs-endpoint-badge {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(139, 92, 246, 0.06);
}
.apidocs-path {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--text-primary);
}
.apidocs-endpoint-name {
    color: var(--text-muted);
    font-size: 0.82rem;
}
.apidocs-example-curl code { white-space: pre-wrap; word-break: break-all; }
.apidocs-example code,
.apidocs-code {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--text-primary);
}
.apidocs-code {
    margin: 8px 0 0;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid var(--border);
    overflow-x: auto;
    white-space: pre;
}
.apidocs-lang-snippets { margin: 10px 0 12px; }
.apidocs-lang-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}
.apidocs-lang-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 4px;
}
.apidocs-lang-tab {
    appearance: none;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1.3;
}
.apidocs-lang-tab:hover {
    color: var(--text-primary);
    border-color: rgba(167, 139, 250, 0.45);
}
.apidocs-lang-tab.is-active {
    color: var(--text-primary);
    border-color: rgba(167, 139, 250, 0.65);
    background: rgba(167, 139, 250, 0.12);
}
.apidocs-lang-copy {
    margin-left: auto;
    font-size: 0.78rem;
    padding: 4px 12px;
}
.apidocs-lang-panel { margin-top: 6px; }
.apidocs-error-table { margin-top: 8px; }

.apidocs-try-panel {
    margin: 16px 0;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
}
.apidocs-try-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}
.apidocs-try-input {
    width: 100%;
    max-width: 520px;
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
}
.apidocs-test-row {
    margin: 8px 0 4px;
}
.apidocs-test-btn {
    font-size: 0.82rem;
    padding: 6px 14px;
}
.apidocs-test-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 8px;
    word-break: break-all;
}
.apidocs-test-meta code {
    font-size: 0.78rem;
}
.apidocs-test-ok strong { color: #34d399; }
.apidocs-test-fail strong { color: #f87171; }
.apidocs-test-error {
    color: #f87171;
    font-size: 0.85rem;
    margin: 0;
}
.apidocs-test-body {
    max-height: 320px;
    overflow: auto;
    margin: 0;
}
.apidocs-test-loading {
    color: var(--text-muted);
    margin: 0;
}
.profile-paypass-block {
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.profile-paypass-summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.profile-paypass-summary::-webkit-details-marker { display: none; }
.profile-paypass-summary::before {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(-45deg);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}
.profile-paypass-block[open] .profile-paypass-summary::before {
    transform: rotate(45deg);
}
.profile-paypass-block > .ui-hint,
.profile-paypass-block > .form-hint {
    margin: 0;
}
.profile-paypass-block .deposit-input-group {
    margin: 0;
}

/* ── Toast notifications ─────────────────────────────────────── */
#app-toast-container {
    position: fixed;
    z-index: 190;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.app-toast {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: var(--surface-1);
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,.35);
    opacity: 0;
    transition: opacity .25s, transform .25s;
    pointer-events: auto;
    word-break: break-word;
}

.app-toast.show {
    opacity: 1;
}

.app-toast-success,
.app-toast-info { background: #166534; border-color: #22c55e; }
.app-toast-error { background: #7f1d1d; border-color: #ef4444; }
.app-toast-warning { background: #713f12; border-color: #f59e0b; }
.app-toast-processing {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0f3d4c;
    border-color: #2dd4bf;
}
.app-toast-busy {
    display: flex;
    align-items: center;
    gap: 10px;
}
.app-toast-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-top-color: #fff;
    border-radius: 50%;
    flex-shrink: 0;
    animation: app-toast-spin 0.7s linear infinite;
}
@keyframes app-toast-spin {
    to { transform: rotate(360deg); }
}
.app-toast-clickable {
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.app-toast-clickable:hover {
    filter: brightness(1.12);
}
.app-toast-clickable::after {
    content: ' →';
    opacity: 0.75;
}

@media (min-width: 1025px) {
    #app-toast-container {
        top: calc(var(--header-height) + 12px);
        right: 20px;
        left: auto;
        bottom: auto;
        max-width: 360px;
    }

    .app-toast {
        transform: translateX(40px);
    }

    .app-toast.show {
        transform: translateX(0);
    }
}

@media (max-width: 1024px) {
    #app-toast-container {
        top: calc(var(--header-height) + 10px + env(safe-area-inset-top, 0px));
        left: 12px;
        right: 12px;
        bottom: auto;
        max-width: none;
        align-items: stretch;
    }

    .app-toast {
        padding: 8px 12px;
        font-size: 0.75rem;
        line-height: 1.35;
        border-radius: 10px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
        transform: translateY(-8px);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .app-toast.show {
        transform: translateY(0);
    }
}
.delivery-notify-settings-card {
    background: var(--surface-1, rgba(30,30,46,0.6));
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
}
.delivery-notify-settings-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}
.delivery-notify-settings-row {
    margin-bottom: 8px;
}
.delivery-notify-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}
.item-intake-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.item-intake-summary-card {
    flex: 1;
    min-width: 160px;
    padding: 14px 16px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.item-intake-debt-card {
    border-color: rgba(129, 140, 248, 0.45);
    background: rgba(139, 92, 246, 0.08);
}
.item-intake-debt-card .item-intake-summary-value {
    color: var(--accent, #818cf8);
}
.item-intake-summary-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.item-intake-summary-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}
.item-intake-summary-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}
.item-intake-selection-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    margin-bottom: 10px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    background: rgba(245, 158, 11, 0.08);
}
.item-intake-selection-bar[hidden] {
    display: none !important;
}
.item-intake-selection-total {
    font-weight: 700;
    font-size: 1rem;
    color: #fbbf24;
}
.item-intake-select-cell {
    width: 36px;
    text-align: center;
    vertical-align: middle;
}
.item-intake-row-selected,
.item-intake-card.item-intake-row-selected {
    background: rgba(245, 158, 11, 0.07);
    outline: 1px solid rgba(245, 158, 11, 0.25);
}
.item-intake-card-check {
    flex-shrink: 0;
    margin-top: 2px;
}
.item-intake-selection-hint {
    font-size: 11px;
}
.item-intake-by-cell-clickable {
    cursor: pointer;
}
.item-intake-by-cell-clickable:hover:not(.item-intake-by-highlight) {
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
}
.item-intake-by-cell.item-intake-by-highlight {
    background: rgba(99, 102, 241, 0.24);
    color: #c7d2fe;
    font-weight: 600;
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.5);
}
.item-intake-table td.item-intake-by-cell {
    white-space: nowrap;
}
.item-intake-table { width: 100%; margin-top: 8px; }
.item-intake-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.item-intake-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    background: rgba(15, 15, 23, 0.9);
}
.item-intake-card-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.item-intake-card-title {
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.35;
}
.item-intake-card-title-wrap {
    flex: 1;
    min-width: 0;
}
.item-intake-card-total {
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}
.item-intake-card-foot {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.item-intake-period-divider-card {
    text-align: center;
    padding: 8px 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}
.item-intake-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.item-intake-row-actions .btn {
    min-height: 40px;
}
.item-intake-form-card {
    padding: 14px 16px;
    margin-bottom: 16px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.item-intake-form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: flex-end;
}
.item-intake-form-grid .admin-field {
    margin-bottom: 0;
    min-width: 0;
}
.item-intake-form-grid .admin-field label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-intake-name-field {
    flex: 1 1 200px;
    min-width: 160px;
}
.item-intake-price-field {
    flex: 0 1 110px;
    width: 110px;
}
.item-intake-qty-field {
    flex: 0 0 72px;
    width: 72px;
}
.item-intake-total-field {
    flex: 0 1 130px;
    width: 130px;
}
.item-intake-total-value {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 12px;
    min-height: 40px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 520px) {
    .item-intake-name-field,
    .item-intake-price-field,
    .item-intake-total-field {
        flex: 1 1 100%;
        width: 100%;
    }
    .item-intake-qty-field {
        flex: 1 1 calc(50% - 6px);
        width: auto;
    }
    .item-intake-total-field {
        flex: 1 1 calc(50% - 6px);
        width: auto;
    }
}
.item-intake-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.item-intake-image-zone {
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 12px;
    background: var(--surface-2);
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.item-intake-image-zone:hover {
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(139, 92, 246, 0.06);
}
.item-intake-image-zone:focus {
    border-color: var(--accent, #6366f1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.item-intake-image-placeholder {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}
.item-intake-image-preview {
    display: block;
    max-width: 100%;
    max-height: 320px;
    margin: 0 auto 8px;
    border-radius: 6px;
    object-fit: contain;
}
.item-intake-image-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
.item-intake-img-cell { width: 52px; text-align: center; overflow: visible; }
.item-intake-thumb-btn {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    cursor: zoom-in;
    display: inline-block;
    line-height: 0;
    border-radius: 6px;
}
.item-intake-thumb-btn:hover .item-intake-thumb,
.item-intake-thumb-btn:focus-visible .item-intake-thumb {
    border-color: var(--accent, #6366f1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}
.item-intake-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    vertical-align: middle;
    transition: border-color 0.15s, box-shadow 0.15s;
    pointer-events: none;
}
.item-intake-hover-preview {
    position: fixed;
    z-index: 950;
    pointer-events: none;
    padding: 4px;
    background: rgba(15, 15, 23, 0.96);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.item-intake-hover-preview img {
    display: block;
    max-width: min(720px, 94vw);
    max-height: min(720px, 88vh);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
}
.item-intake-lightbox {
    cursor: zoom-out;
    padding: 12px;
}
.item-intake-lightbox-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: min(98vw, 1400px);
    max-height: 96vh;
    background: rgba(15, 15, 23, 0.97);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
}
.item-intake-lightbox-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.item-intake-lightbox-zoom-level {
    min-width: 52px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}
.item-intake-lightbox-close { margin-left: auto; }
.item-intake-lightbox-stage {
    overflow: auto;
    flex: 1;
    min-height: 200px;
    max-height: calc(96vh - 110px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    padding: 8px;
}
.item-intake-lightbox-stage img {
    max-width: min(96vw, 1360px);
    max-height: calc(96vh - 130px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
    cursor: crosshair;
    user-select: none;
}
.item-intake-magnifier-lens {
    position: fixed;
    z-index: 1100;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    border: 3px solid rgba(129, 140, 248, 0.85);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    background-repeat: no-repeat;
    background-color: #0f0f17;
    pointer-events: none;
    overflow: hidden;
}
.item-intake-lightbox-caption {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}
.item-intake-image-preview.item-intake-preview-zoomable {
    cursor: zoom-in;
}
.item-intake-image-preview.item-intake-preview-zoomable:hover {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
}
.item-intake-table { overflow: visible; }
.item-intake-table td { overflow: visible; }
.item-intake-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 12px 0 8px;
}
.item-intake-filters label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
}
.item-intake-filter-select {
    min-width: 200px;
    max-width: 320px;
    font-size: 13px;
    padding: 8px 10px;
}
.item-intake-status {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.item-intake-status-open {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.35);
}
.item-intake-status-settled {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}
.item-intake-status-deleted {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.28);
    white-space: nowrap;
}
.item-intake-status-payment {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}
.item-intake-row-payment .item-intake-card-total,
.item-intake-row-payment td:nth-child(6) {
    color: #60a5fa;
}
.item-intake-row-deleted {
    opacity: 0.55;
    background: rgba(239, 68, 68, 0.04);
}
.item-intake-row-deleted td {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: rgba(248, 113, 113, 0.45);
}
.item-intake-row-deleted .item-intake-status-cell,
.item-intake-row-deleted .item-intake-actions-cell {
    text-decoration: none;
}
.item-intake-row-settled {
    opacity: 0.72;
    background: rgba(255, 255, 255, 0.02);
}
.item-intake-row-settled td { color: var(--text-muted); }
.item-intake-row-open .item-intake-status-cell { font-weight: 600; }
.item-intake-period-divider td {
    text-align: center;
    padding: 10px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--accent, #818cf8);
    background: rgba(99, 102, 241, 0.08);
    border-top: 1px solid rgba(99, 102, 241, 0.25);
    border-bottom: 1px solid rgba(99, 102, 241, 0.25);
}
.item-intake-actions-cell { white-space: nowrap; }
.item-intake-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.item-intake-row-actions .ii-delete {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}
.item-intake-row-actions .ii-delete:hover {
    background: rgba(239, 68, 68, 0.22);
}
.item-intake-note-cell { max-width: 180px; }
.item-intake-note-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 2px 6px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.item-intake-note-btn.has-note {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.08);
}
.item-intake-note-btn:hover {
    background: rgba(99, 102, 241, 0.14);
}
.item-intake-no-img { color: var(--text-muted); }
.item-intake-time-cell { white-space: nowrap; line-height: 1.35; }
.item-intake-edited {
    font-size: 10px;
    color: var(--accent, #818cf8);
    margin-top: 2px;
}
.item-intake-name-cell { max-width: 220px; }
.item-intake-name-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.item-intake-row-clickable {
    cursor: pointer;
}
.item-intake-row-clickable:hover td,
.item-intake-row-clickable:hover .item-intake-name-text {
    color: var(--accent, #818cf8);
}
.item-intake-card.item-intake-row-clickable {
    cursor: pointer;
}
.item-intake-card.item-intake-row-clickable:hover {
    border-color: rgba(99, 102, 241, 0.35);
}
.item-intake-name-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.item-intake-name-toggle:hover .item-intake-name-text {
    color: var(--accent, #818cf8);
}
.item-intake-expand-icon {
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
    opacity: 0.65;
}
.item-intake-expand-icon.is-open {
    transform: rotate(45deg);
}
.item-intake-name-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.item-intake-breakdown-badge {
    flex: 0 0 auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.18);
    color: var(--accent, #818cf8);
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
.item-intake-row-expanded td {
    border-bottom-color: transparent;
}
.item-intake-detail-row td {
    padding: 0 12px 12px 36px;
    background: rgba(99, 102, 241, 0.05);
    border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}
.item-intake-breakdown-panel {
    padding: 10px 0 4px;
}
.item-intake-breakdown-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.item-intake-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.item-intake-breakdown-table th,
.item-intake-breakdown-table td {
    padding: 4px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}
.item-intake-breakdown-table tbody tr {
    transition: background 0.15s ease;
}
.item-intake-breakdown-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.06);
}
.item-intake-breakdown-thumb-btn:hover .item-intake-thumb,
.item-intake-breakdown-thumb-btn:focus-visible .item-intake-thumb {
    border-color: var(--accent, #6366f1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}
.item-intake-breakdown-table th {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}
.item-intake-breakdown-sum td {
    font-weight: 600;
    border-bottom: none;
}
.item-intake-breakdown-empty {
    margin: 0 0 8px;
}
.item-intake-breakdown-mismatch {
    margin: 6px 0 8px;
    color: #fbbf24;
}
.item-intake-card-breakdown {
    padding: 0 12px 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.item-intake-card-expanded {
    border-color: rgba(99, 102, 241, 0.35);
}
.item-intake-breakdown-form-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 8px;
    margin: 0 -8px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: background 0.15s ease;
}
.item-intake-breakdown-form-row.is-bd-active {
    background: rgba(139, 92, 246, 0.08);
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.4);
}
.item-intake-breakdown-form-row.is-bd-active .item-intake-breakdown-row-marker {
    display: block;
}
.item-intake-breakdown-row-marker {
    display: none;
    font-size: 10px;
    font-weight: 600;
    color: var(--violet-400, #a78bfa);
    letter-spacing: 0.02em;
    margin-bottom: 2px;
}
.item-intake-breakdown-form-row.is-bd-paste-flash {
    animation: item-intake-bd-paste-flash 0.65s ease;
}
@keyframes item-intake-bd-paste-flash {
    0%, 100% { box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.4); }
    50% { box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.95); background: rgba(99, 102, 241, 0.14); }
}
.item-intake-breakdown-lock-hint {
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-muted);
}
.item-intake-breakdown-form-row:hover {
    background: rgba(139, 92, 246, 0.05);
}
.item-intake-breakdown-form-row:last-child {
    border-bottom: none;
}
.item-intake-breakdown-fields {
    display: grid;
    grid-template-columns: 56px 1fr 72px 120px 32px;
    gap: 8px;
    align-items: end;
}
.item-intake-bd-image-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
}
.item-intake-bd-image-slot-wrap {
    position: relative;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
}
.item-intake-bd-image-slot {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    padding: 0;
    margin: 0;
    cursor: pointer;
    line-height: 0;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.item-intake-bd-image-slot:not(.has-image):hover,
.item-intake-bd-image-slot:not(.has-image):focus-visible {
    border-color: var(--accent, #6366f1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}
.item-intake-bd-image-slot.has-image {
    cursor: zoom-in;
    border: none;
    background: transparent;
}
.item-intake-bd-image-slot .ii-bd-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 14px;
    color: var(--text-muted);
    border: none;
    border-radius: 0;
    background: transparent;
}
.item-intake-bd-image-slot .ii-bd-image-placeholder[hidden],
.item-intake-bd-image-slot .item-intake-bd-image-preview[hidden] {
    display: none !important;
}
.item-intake-bd-image-slot .item-intake-bd-image-preview,
.item-intake-bd-image-slot .item-intake-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}
.item-intake-bd-image-view,
.item-intake-bd-image-empty {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    border-radius: 6px;
}
.item-intake-bd-image-view {
    cursor: zoom-in;
    line-height: 0;
}
.item-intake-bd-image-empty {
    cursor: pointer;
}
.item-intake-bd-image-empty:hover {
    transform: scale(1.04);
}
.item-intake-bd-image-empty .item-intake-no-img {
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.item-intake-bd-image-empty:hover .item-intake-no-img,
.item-intake-bd-image-empty:focus-visible .item-intake-no-img {
    border-color: var(--accent, #6366f1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}
.item-intake-bd-image-view:hover .item-intake-thumb,
.item-intake-bd-image-view:focus-visible .item-intake-thumb {
    border-color: var(--accent, #6366f1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}
.item-intake-breakdown-delete-row {
    align-self: end;
    min-width: 32px;
    padding: 6px 0;
    opacity: 0.7;
    font-size: 16px;
    line-height: 1;
    transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.item-intake-breakdown-form-row:hover .item-intake-breakdown-delete-row {
    opacity: 1;
}
.item-intake-breakdown-delete-row:hover {
    color: var(--red-400, #f87171);
    background: rgba(248, 113, 113, 0.12);
}
.item-intake-bd-image-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
}
.item-intake-breakdown-modal {
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
.item-intake-breakdown-sheet {
    padding: 0;
    overflow: hidden;
}
.item-intake-breakdown-sheet > .ii-bd-sheet-header,
.item-intake-breakdown-sheet > .ii-bd-sheet-tab-wrap,
.item-intake-breakdown-sheet > .ii-bd-sheet-hint,
.item-intake-breakdown-sheet > .ii-bd-sheet-toolbar,
.item-intake-breakdown-sheet > .ii-bd-sheet-footer,
.item-intake-breakdown-sheet > .item-intake-breakdown-mismatch {
    padding-left: 16px;
    padding-right: 16px;
}
.ii-bd-sheet-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}
.ii-bd-sheet-thumb .item-intake-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
}
.ii-bd-sheet-meta {
    flex: 1;
    min-width: 0;
}
.ii-bd-sheet-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.ii-bd-sheet-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.ii-bd-sheet-sub {
    margin: 0 0 2px;
    font-size: 12px;
}
.ii-bd-sheet-close {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.ii-bd-sheet-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}
.ii-bd-sheet-tab-wrap {
    padding-top: 12px;
    padding-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ii-bd-sheet-tab {
    display: inline-block;
    margin-bottom: -1px;
    padding: 8px 14px;
    border-radius: 8px 8px 0 0;
    background: rgba(99, 102, 241, 0.22);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-bottom-color: transparent;
    color: var(--accent, #a5b4fc);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.ii-bd-sheet-hint {
    margin: 10px 0 0 !important;
    font-size: 11px;
}
.ii-bd-list {
    margin-top: 0;
}
.ii-bd-list-head,
.ii-bd-list-row {
    display: grid;
    grid-template-columns: 56px minmax(140px, 1.5fr) minmax(108px, 0.95fr) 64px 88px minmax(112px, 0.9fr) 40px;
    column-gap: 20px;
    row-gap: 8px;
    align-items: center;
}
.ii-bd-list-col-time {
    font-size: 12px;
    line-height: 1.35;
    white-space: normal;
    padding-left: 12px;
}
.ii-bd-time-pending {
    opacity: 0.72;
}
.item-intake-bd-edited {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}
.ii-bd-list-head {
    padding: 10px 16px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ii-bd-list-body {
    max-height: min(52vh, 420px);
    overflow-y: auto;
}
.ii-bd-list-row {
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}
.ii-bd-list-row-readonly:hover {
    background: rgba(139, 92, 246, 0.06);
}
.ii-bd-list-text {
    font-size: 13px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ii-bd-list-total {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.ii-bd-list-col-item {
    min-width: 0;
    padding-right: 6px;
}
.ii-bd-list-col-qty,
.ii-bd-list-col-unit {
    min-width: 0;
}
.ii-bd-list-col-qty {
    text-align: center;
    padding-inline: 2px;
}
.ii-bd-list-col-unit {
    text-align: right;
    padding-inline: 2px;
}
.ii-bd-list-col-unit .ii-bd-list-input {
    text-align: right;
}
.ii-bd-list-col-total {
    text-align: right;
}
.ii-bd-total-preview {
    display: block;
    width: 100%;
    padding: 6px 4px;
    font-size: 13px;
    color: var(--text-primary);
}
.ii-bd-list-col-actions {
    display: flex;
    justify-content: flex-end;
}
.ii-bd-list-input {
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 13px;
}
.ii-bd-list-col-qty .ii-bd-list-input {
    text-align: center;
}
.ii-bd-list-col-total .ii-bd-list-input {
    text-align: right;
}
.ii-bd-list-row.ii-bd-list-sum {
    font-weight: 600;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: none;
}
.ii-bd-list-empty {
    padding: 16px;
    margin: 0;
    text-align: center;
}
.ii-bd-sheet-toolbar {
    padding-top: 10px;
    padding-bottom: 4px;
}
.ii-bd-sheet-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.12);
}
.item-intake-breakdown-sheet .item-intake-breakdown-mismatch {
    padding-bottom: 8px;
}
.item-intake-breakdown-form-row.ii-bd-list-row {
    flex-direction: row;
    gap: 0;
    margin: 0;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
}
.item-intake-breakdown-form-row.ii-bd-list-row .item-intake-bd-image-cell {
    width: auto;
    padding: 0;
}
.item-intake-breakdown-form-row.ii-bd-list-row .ii-bd-remove {
    align-self: center;
    min-width: 28px;
    height: 28px;
    padding: 0;
    line-height: 1;
}
.item-intake-breakdown-form-row.ii-bd-list-row.is-bd-active {
    background: rgba(139, 92, 246, 0.08);
    box-shadow: inset 3px 0 0 var(--accent, #6366f1);
}
.item-intake-breakdown-form-row.ii-bd-list-row:hover {
    background: rgba(139, 92, 246, 0.05);
}
.item-intake-breakdown-form-row.ii-bd-list-row:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.item-intake-breakdown-modal-hint {
    margin-bottom: 4px !important;
}
.item-intake-breakdown-image-hint {
    margin: 0 0 12px;
    font-size: 11px;
    text-align: center;
    padding: 8px 10px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}
.item-intake-breakdown-img-cell {
    width: 44px;
    text-align: center;
}
.item-intake-breakdown-form-row .ii-bd-remove {
    align-self: end;
    min-width: 32px;
    padding: 6px 0;
}
.item-intake-breakdown-form-row .admin-input:hover {
    border-color: rgba(139, 92, 246, 0.35);
}
.item-intake-breakdown-form-row .admin-input:focus {
    border-color: var(--accent, #6366f1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
@media (max-width: 560px) {
    .ii-bd-list-head,
    .ii-bd-list-row {
        grid-template-columns: 48px minmax(0, 1fr) minmax(96px, 0.95fr) 56px 76px minmax(92px, 0.85fr) 32px;
        column-gap: 12px;
        row-gap: 6px;
    }
    .ii-bd-list-col-time {
        padding-left: 10px;
    }
    .ii-bd-sheet-header {
        padding: 12px;
    }
    .item-intake-breakdown-sheet > .ii-bd-sheet-header,
    .item-intake-breakdown-sheet > .ii-bd-sheet-tab-wrap,
    .item-intake-breakdown-sheet > .ii-bd-sheet-hint,
    .item-intake-breakdown-sheet > .ii-bd-sheet-toolbar,
    .item-intake-breakdown-sheet > .ii-bd-sheet-footer,
    .item-intake-breakdown-sheet > .item-intake-breakdown-mismatch {
        padding-left: 10px;
        padding-right: 10px;
    }
    .ii-bd-list-head,
    .item-intake-breakdown-form-row.ii-bd-list-row,
    .ii-bd-list-row {
        padding-left: 10px;
        padding-right: 10px;
    }
    .item-intake-breakdown-fields {
        grid-template-columns: 56px 1fr 1fr;
    }
    .item-intake-breakdown-fields .item-intake-breakdown-label-field {
        grid-column: 2 / -1;
    }
    .item-intake-breakdown-fields .item-intake-breakdown-amount-field {
        grid-column: 2;
    }
    .item-intake-breakdown-fields .ii-bd-remove {
        grid-column: 3;
        justify-self: end;
    }
}

.delivery-sound-custom-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.delivery-sound-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    font-size: 12px;
}

@media (max-width: 768px) {
    .apidocs-layout { grid-template-columns: 1fr; gap: 12px; }
    .apidocs-nav {
        position: sticky;
        top: var(--header-height);
        z-index: 50;
        max-height: none;
        overflow: visible;
        gap: 0;
        padding: 8px;
        background: rgba(15, 15, 23, 0.96);
        backdrop-filter: var(--glass-blur);
        -webkit-backdrop-filter: var(--glass-blur);
    }
    .apidocs-nav-chips {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        padding-bottom: 2px;
    }
    .apidocs-nav-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        min-height: 44px;
        padding: 10px 16px;
        font-size: 0.875rem;
        scroll-snap-align: start;
        touch-action: manipulation;
    }
    .apidocs-nav-menu-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        white-space: nowrap;
        min-height: 44px;
        scroll-snap-align: start;
    }
    .apidocs-nav-drawer {
        display: none;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid var(--border);
        max-height: min(55vh, 420px);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .apidocs-nav.is-menu-open .apidocs-nav-drawer {
        display: flex;
    }
    .apidocs-nav-group {
        margin-top: 6px;
        padding-top: 6px;
    }
    .apidocs-nav-group:first-child {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }
    .apidocs-nav-method {
        min-height: 40px;
        display: flex;
        align-items: center;
        padding: 8px 12px;
        font-size: 0.8125rem;
    }
    /* Header + sticky chip bar overlap the focused section on mobile. */
    .apidocs-card {
        scroll-margin-top: calc(var(--header-height) + 72px);
        padding: 16px;
    }
    .apidocs-endpoint-head {
        flex-wrap: wrap;
        gap: 6px;
    }
    .apidocs-path {
        word-break: break-all;
    }
    .apidocs-pager {
        flex-direction: column;
    }
    .apidocs-pager-btn,
    .apidocs-pager-btn-next {
        justify-content: flex-start;
        text-align: left;
        margin-left: 0;
        min-height: 44px;
    }
}

/* ── Friends Page ─────────────────────────────────────────────── */
.friends-page { max-width: 800px; margin: 0 auto; }
.friends-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.friends-header-compact.friends-header { align-items: center; }
.friends-header-compact .friends-tabs { margin-bottom: 0; }
.friends-title { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); margin: 0; }

.friends-search-bar {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 10px 14px; margin-bottom: 16px; transition: border-color var(--transition-fast);
}
.friends-search-bar:focus-within { border-color: var(--border-active); }
.friends-search-icon { color: var(--text-muted); flex-shrink: 0; }
.friends-search-input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text-primary); font-size: 0.9rem; font-family: var(--font-sans);
}
.friends-search-input::placeholder { color: var(--text-muted); }

.friends-search-results {
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 8px; margin-bottom: 16px; max-height: 300px; overflow-y: auto;
}

.friends-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.friends-tabs .tab-btn { position: relative; }
.follow-counts { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.follow-counts strong { color: var(--text-primary); }
.follow-count-sep { color: var(--border); }
.friends-pending-badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--accent); color: #fff; font-size: 0.65rem; font-weight: 700;
    padding: 1px 5px; border-radius: 10px; min-width: 16px; text-align: center;
}

.friends-content { display: flex; flex-direction: column; gap: 8px; }
.friends-empty { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.friends-empty svg { color: var(--text-muted); margin-bottom: 12px; }
.friends-empty-mini { padding: 16px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

.friend-card {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 12px 14px; transition: border-color var(--transition-fast);
}
.friend-card:hover { border-color: var(--border-hover); }

.friend-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.friend-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.friend-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-username { font-size: 0.75rem; color: var(--text-muted); }
.friend-status-dot { font-size: 0.72rem; color: var(--text-muted); }
.friend-status-dot.online { color: #22c55e; }
.friend-request-time { font-size: 0.72rem; color: var(--text-muted); }
.friend-online-indicator { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--text-muted); }
.friend-online-indicator.online { background: #22c55e; }
.friend-actions { display: flex; gap: 6px; flex-shrink: 0; }
.friend-status-label { font-size: 0.75rem; padding: 3px 8px; border-radius: 4px; font-weight: 500; }
.friend-status-label.status-accepted { background: rgba(34,197,94,0.15); color: #22c55e; }
.friend-status-label.status-pending { background: rgba(245,158,11,0.15); color: #f59e0b; }
.friend-status-label.status-blocked { background: rgba(239,68,68,0.15); color: #ef4444; }

.sb-badge {
    position: absolute; top: 4px; right: 8px;
    background: var(--accent); color: #fff; font-size: 0.6rem; font-weight: 700;
    padding: 1px 4px; border-radius: 8px; min-width: 14px; text-align: center; line-height: 1.3;
}
.sb-link-item { position: relative; }

/* ── Messages Page ────────────────────────────────────────────── */
.messages-page {
    height: calc(100vh - var(--header-height) - 32px);
    max-height: 920px;
    display: flex;
    flex-direction: column;
}

.messages-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    height: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--bg-secondary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(139, 92, 246, 0.08);
}

/* ── Sidebar (conversation list) ── */
.messages-sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    overflow: hidden;
    background: rgba(10, 10, 15, 0.6);
}

.messages-sidebar-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.messages-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.messages-search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
    flex-shrink: 0;
}

.messages-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: 10px;
    padding: 11px 14px 11px 38px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.messages-search-input:focus {
    border-color: var(--violet-500);
    background: rgba(255, 255, 255, 0.07);
}

.messages-search-input::placeholder {
    color: var(--text-muted);
}

.msg-global-add {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
}
.msg-global-add-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.msg-global-add-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.msg-global-search-wrap {
    margin-bottom: 8px;
}
.msg-global-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}
.msg-global-search-input:focus {
    border-color: var(--violet-500);
    background: rgba(255, 255, 255, 0.07);
}
.msg-global-search-input::placeholder {
    color: var(--text-muted);
}
.msg-global-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 4px;
    min-height: 36px;
    -webkit-overflow-scrolling: touch;
}
.msg-global-list::-webkit-scrollbar { width: 4px; }
.msg-global-list::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.2); border-radius: 4px; }
.msg-global-hint,
.msg-global-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 6px 2px;
    line-height: 1.4;
}
.msg-global-error {
    color: #f87171;
}
.msg-global-result {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast), opacity var(--transition-fast);
    font-family: var(--font-sans);
    text-align: left;
    touch-action: manipulation;
}
.msg-global-result:hover:not(.loading) {
    border-color: var(--border-hover);
    background: rgba(139, 92, 246, 0.08);
}
.msg-global-result.loading {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}
.msg-global-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.msg-global-result-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}
.msg-global-result-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.msg-global-result-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.messages-conv-list {
    flex: 1;
    overflow-y: auto;
}

.messages-conv-list::-webkit-scrollbar { width: 4px; }
.messages-conv-list::-webkit-scrollbar-track { background: transparent; }
.messages-conv-list::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.15); border-radius: 10px; }
.messages-conv-list::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.3); }

.messages-empty-list {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.conv-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.conv-item:hover {
    background: rgba(139, 92, 246, 0.06);
}

.conv-item.active {
    background: rgba(139, 92, 246, 0.12);
    border-left: 3px solid var(--accent);
    padding-left: 13px;
}

.conv-item.unread .conv-name {
    font-weight: 700;
    color: #fff;
}

.conv-item.unread .conv-last-msg {
    color: var(--text-primary);
    font-weight: 500;
}

.conv-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.conv-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
}

.conv-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.4);
}

.conv-info {
    flex: 1;
    min-width: 0;
}

.conv-info-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.conv-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-time {
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
}

.conv-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}

.conv-last-msg {
    font-size: 0.88rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-unread-badge {
    background: var(--accent);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

/* ── Chat Panel ── */
.messages-chat {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    background: var(--bg-primary);
}

/* ── Chat Header ── */
.messages-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    min-height: 60px;
    background: rgba(15, 15, 23, 0.9);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.btn-back-conv {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    padding: 0;
}

.btn-back-conv:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

.messages-chat-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.btn-chat-escrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--violet-300);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
    touch-action: manipulation;
}
.btn-chat-escrow:hover {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.4);
}
.btn-chat-escrow svg {
    flex-shrink: 0;
}

.msg-escrow-modal {
    max-width: 440px;
    overflow: visible;
}
.msg-escrow-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: visible;
}
.msg-escrow-seller-preview {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.12);
}
.msg-escrow-seller-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}
.msg-escrow-seller-email {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.chat-header-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-header-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--text-muted);
    border: 2px solid rgba(15, 15, 23, 0.9);
    transition: background var(--transition-fast);
}

.chat-header-online-dot.online {
    background: #22c55e;
    box-shadow: 0 0 5px rgba(34, 197, 94, 0.45);
}

.chat-header-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.chat-header-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.chat-header-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.2;
    transition: color var(--transition-fast);
}

.chat-header-status.online {
    color: #22c55e;
}

/* ── Chat Body ── */
.messages-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-primary);
    scroll-behavior: smooth;
}

.messages-chat-body::-webkit-scrollbar { width: 4px; }
.messages-chat-body::-webkit-scrollbar-track { background: transparent; }
.messages-chat-body::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.15); border-radius: 10px; }
.messages-chat-body::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.3); }

.messages-empty-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--text-muted);
    text-align: center;
    gap: 12px;
    padding: 40px 20px;
}

.messages-empty-chat svg {
    opacity: 0.3;
    color: var(--accent);
}

.messages-empty-chat p {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 260px;
    line-height: 1.5;
}

/* ── Date Divider ── */
.msg-date-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0 8px;
}

.msg-date-divider span {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 3px 12px;
    border-radius: 10px;
    letter-spacing: 0.02em;
}

/* ── Message Bubbles (matches escrow chat design) ── */
.msg-bubble {
    display: flex;
    gap: 8px;
    width: 100%;
    animation: msgFadeIn 0.15s ease-out;
}

@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.msg-bubble.msg-mine {
    justify-content: flex-end;
}

.msg-bubble.msg-other {
    justify-content: flex-start;
}

.msg-bubble + .msg-bubble { margin-top: 2px; }

.msg-bubble.msg-mine + .msg-bubble.msg-other,
.msg-bubble.msg-other + .msg-bubble.msg-mine {
    margin-top: 8px;
}

.msg-avatar-slot {
    width: 36px;
    flex-shrink: 0;
    align-self: flex-end;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.msg-content {
    padding: 12px 16px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 70%;
    word-break: break-word;
}

.msg-mine .msg-content {
    background: rgba(139, 92, 246, 0.24);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-bottom-right-radius: 4px;
}

.msg-other .msg-content {
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.msg-text {
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.55;
}

.msg-mine .msg-text {
    color: #fff;
}

.msg-text a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.35);
    text-underline-offset: 2px;
}

.msg-text a:hover {
    text-decoration-color: currentColor;
}

.msg-time {
    font-size: 0.72rem;
    color: var(--text-faint);
    align-self: flex-end;
    font-family: var(--font-sans);
}

.msg-mine .msg-time {
    text-align: right;
}

.msg-status {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-weight: 500;
    text-align: right;
    margin-top: 2px;
}

.msg-status.msg-seen {
    color: var(--accent);
}

.msg-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    opacity: 0.6;
    align-self: flex-start;
}

/* ── Input Bar ── */
.messages-chat-input {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 20px 14px;
    border-top: 1px solid var(--border);
    background: #0c0c12;
    flex-shrink: 0;
}

.messages-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    outline: none;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.messages-input:focus {
    border-color: var(--violet-500);
    background: rgba(255, 255, 255, 0.07);
}

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

.btn-send-msg {
    -webkit-appearance: none;
    appearance: none;
    width: 42px;
    height: 42px;
    min-width: 42px;
    max-width: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    flex-grow: 0;
    background: var(--violet-600);
    color: #fff;
    border: none;
    outline: none;
    box-shadow: none;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    z-index: 1;
    isolation: isolate;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-send-msg:hover {
    background: var(--violet-500);
    transform: scale(1.05);
}

.btn-send-msg:active {
    transform: scale(0.95);
}

.btn-send-msg:focus,
.btn-send-msg:focus-visible {
    outline: none;
    box-shadow: none;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .messages-layout {
        grid-template-columns: 1fr;
    }

    .messages-sidebar.hide-mobile { display: none; }
    .messages-chat.hide-mobile { display: none; }

    .btn-back-conv {
        display: flex;
    }

    .msg-content {
        max-width: 85%;
    }

    .messages-chat-header {
        padding: 10px 14px;
        min-height: 52px;
    }

    .messages-chat-body {
        padding: 14px 12px 8px;
    }

    .messages-chat-input {
        padding: 10px 12px;
    }

    .msg-global-list {
        max-height: 140px;
    }

    .btn-chat-escrow span {
        display: none;
    }

    .btn-chat-escrow {
        padding: 8px 10px;
        min-height: 40px;
    }

    .escrow-recent-trades-list {
        max-height: 220px;
    }

    .escrow-seller-item {
        min-height: 44px;
    }
}

@media (min-width: 769px) {
    .btn-back-conv {
        display: none;
    }
}

/* ========== Review Section ========== */
.review-section-wrap { margin-top: 16px; }
.review-section-title {
    font-size: 1rem; font-weight: 600; color: var(--text-primary);
    margin: 0 0 12px; padding: 0;
}
.review-form-card {
    background: rgba(255,255,255,0.04); border: 1px solid var(--border);
    border-radius: 12px; padding: 16px; margin-bottom: 16px;
}
.review-form-label { font-size: 0.85rem; color: var(--text-secondary); margin: 0 0 10px; }

.star-picker {
    display: flex; gap: 4px; margin-bottom: 12px; cursor: pointer; user-select: none;
}
.star-pick {
    font-size: 1.8rem; color: rgba(255,255,255,0.15); transition: color 0.15s, transform 0.15s;
    line-height: 1;
}
.star-pick.star-active, .star-pick.star-hover { color: #facc15; }
.star-pick:hover { transform: scale(1.15); }

.review-comment {
    width: 100%; resize: vertical; min-height: 48px; max-height: 120px;
    margin-bottom: 10px; font-family: var(--font-sans);
}
.review-submit-btn { width: 100%; }

.review-list,
#review-list-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.review-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.review-item-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 6px;
    align-items: center;
}
.review-item-name,
.review-author {
    grid-column: 1;
    grid-row: 1;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.review-item-stars,
.review-stars {
    grid-column: 1 / -1;
    grid-row: 2;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
}
.review-item-date,
.review-date {
    grid-column: 2;
    grid-row: 1;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0;
    white-space: nowrap;
}
.review-item-comment,
.review-comment-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--text-secondary);
    word-break: break-word;
}
.review-star-icon {
    display: block;
    flex-shrink: 0;
}
.review-empty { font-size: 0.82rem; color: var(--text-muted); text-align: center; padding: 16px 0; }

/* Profile rating display */
.profile-rating-section { margin-bottom: 12px; text-align: center; }
.profile-rating-display {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 0; flex-wrap: wrap;
}
.profile-rating-stars { font-size: 1.4rem; color: #facc15; letter-spacing: 2px; }
.profile-rating-stars.profile-no-rating { font-size: 0.85rem; color: var(--text-muted); letter-spacing: 0; }
.profile-rating-avg { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.profile-rating-count { font-size: 0.8rem; color: var(--text-muted); }

/* ========== History Page ========== */
.history-page {
    max-width: 960px; margin: 0 auto; padding: 20px 16px;
}
.history-header { margin-bottom: 20px; }
.history-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.history-title {
    font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 0;
}
.history-page .history-section-head .transactions-tabs {
    margin-bottom: 0;
    flex-shrink: 0;
}

.history-stats-row {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px;
}
.history-stat-card {
    background: rgba(139, 92, 246, 0.06); border: 1px solid var(--border);
    border-radius: 12px; padding: 16px; text-align: center;
    display: flex; flex-direction: column; gap: 6px;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}
.history-stat-card:hover {
    border-color: var(--border-hover);
    background: rgba(139, 92, 246, 0.1);
}
.history-stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.history-stat-value { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }
.history-stat-deposit .history-stat-value { color: var(--violet-400); }
.history-stat-withdraw .history-stat-value { color: var(--red-400); }
.history-stat-escrow .history-stat-value { color: var(--accent); }

.history-page .transactions-tabs {
    margin-bottom: 16px;
}

.history-table-wrap {
    overflow-x: auto; border: 1px solid var(--border); border-radius: 12px;
    background: rgba(139, 92, 246, 0.02);
}
.history-table {
    width: 100%; border-collapse: collapse; font-size: 0.82rem;
}
.history-table thead th {
    padding: 12px 14px; text-align: left; font-weight: 600; color: var(--text-muted);
    border-bottom: 1px solid var(--border); font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 0.5px; white-space: nowrap;
}
.history-table tbody td {
    padding: 12px 14px; border-bottom: 1px solid rgba(139, 92, 246, 0.06);
    color: var(--text-primary); vertical-align: middle;
}
.history-table tbody tr:last-child td { border-bottom: none; }
.history-table tbody tr:hover { background: rgba(139, 92, 246, 0.06); }
.history-cell-date { white-space: nowrap; font-size: 0.78rem; color: var(--text-secondary); }
.history-cell-desc { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: 0.78rem; }

.history-amount-in { color: var(--violet-300); font-weight: 600; }
.history-amount-out { color: var(--red-400); font-weight: 600; }

.history-type-badge {
    display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 0.72rem;
    font-weight: 600; white-space: nowrap;
}
.history-type-deposit { background: rgba(139, 92, 246, 0.15); color: var(--violet-300); }
.history-type-withdraw { background: rgba(239, 68, 68, 0.12); color: var(--red-400); }
.history-type-escrow-in { background: rgba(139, 92, 246, 0.12); color: var(--violet-400); }
.history-type-escrow-out { background: rgba(167, 139, 250, 0.12); color: var(--violet-300); }
.history-type-other { background: rgba(139, 92, 246, 0.08); color: var(--text-secondary); }

.history-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
}
.history-status-completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-300);
    border-color: rgba(16, 185, 129, 0.32);
}
.history-status-pending {
    background: rgba(250, 204, 21, 0.12);
    color: #facc15;
    border-color: rgba(250, 204, 21, 0.32);
}
.history-status-failed,
.history-status-cancelled {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red-400);
    border-color: rgba(239, 68, 68, 0.32);
}

.history-loading, .history-empty {
    text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 0.85rem;
}

.history-pagination {
    display: flex; justify-content: center; gap: 4px; margin-top: 16px;
}
.history-page-btn {
    padding: 6px 12px; border: 1px solid var(--border); background: rgba(139, 92, 246, 0.04);
    color: var(--text-secondary); border-radius: 8px; cursor: pointer; font-size: 0.82rem;
    font-family: var(--font-sans); transition: all var(--transition-fast);
}
.history-page-btn:hover { border-color: var(--accent); color: var(--text-primary); background: rgba(139, 92, 246, 0.1); }
.history-page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3); }

.history-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px; margin-bottom: 20px;
}
.history-cell-amount { font-weight: 600; white-space: nowrap; }
.amount-positive { color: var(--violet-300); }
.amount-negative { color: var(--red-400); }
.history-cell-notes {
    max-width: 200px; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; font-size: 0.8125rem; color: var(--text-secondary);
}
.history-row:hover td { background: rgba(139, 92, 246, 0.04); }
.history-badge-deposit { background: rgba(139, 92, 246, 0.12); color: var(--violet-300); }
.history-badge-withdraw { background: rgba(239, 68, 68, 0.12); color: var(--red-400); }
.history-badge-escrow { background: rgba(139, 92, 246, 0.15); color: var(--violet-400); }
.history-badge-other { background: rgba(139, 92, 246, 0.08); color: var(--text-secondary); }

@media (max-width: 1024px) {
    .history-stats-row { grid-template-columns: 1fr; }
    .history-stats { grid-template-columns: repeat(2, 1fr); }

    .history-section-head {
        flex-direction: column;
        align-items: stretch;
    }
    .history-page .history-section-head .transactions-tabs,
    .history-page .transactions-tabs { width: 100%; }
    .history-page .transactions-tabs .tab-btn { flex: 1; justify-content: center; }

    .history-table { font-size: 0.78rem; }
    .history-table thead th, .history-table tbody td, .history-table th, .history-table td { padding: 10px 10px; }
    .history-cell-desc, .history-cell-notes { max-width: 120px; }
}

/* ──── Review Section ──── */
.escrow-review-section {
    background: var(--card-bg, #1e293b);
    border-radius: 12px;
    padding: 20px;
    margin-top: 12px;
}
.escrow-review-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--text-primary, #f1f5f9);
}
.escrow-review-desc {
    margin: 0 0 16px;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-muted, #64748b);
}
.review-list-block {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border, rgba(148, 163, 184, 0.15));
}
.review-list-heading {
    margin: 0 0 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.review-waiting-hint,
.review-submitted-hint {
    margin: 10px 0 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-muted, #64748b);
}
.escrow-party-rating {
    display: inline-flex;
    vertical-align: middle;
}
.escrow-party-rating-btn {
    margin-left: 6px;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning, #f59e0b);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.escrow-party-rating-btn:hover {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.35);
}
.user-reviews-modal {
    width: min(520px, calc(100vw - 32px));
    max-height: min(80vh, 640px);
}
.user-reviews-modal-list {
    max-height: 50vh;
    overflow-y: auto;
}
.user-reviews-summary {
    margin: 0 0 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}
.profile-reviews-received .review-list {
    margin-top: 4px;
}
.review-form {
    margin-bottom: 16px;
}
.review-form-label {
    font-size: 0.875rem;
    color: var(--text-secondary, #94a3b8);
    margin: 0 0 8px;
}
.review-stars-picker {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}
.review-star-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: var(--text-muted, #64748b);
    transition: transform 0.15s;
}
.review-star-btn:hover { transform: scale(1.15); }
.review-star-btn.active { color: var(--warning, #f59e0b); }
.review-comment-input {
    margin-bottom: 8px;
}
.review-submit-btn {
    min-width: 140px;
}
.review-submitted {
    padding: 12px 0;
}
.review-submitted-label {
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.review-stars-display {
    display: flex;
    gap: 2px;
    margin-bottom: 6px;
}
.review-comment-text {
    margin: 4px 0 0;
    font-size: 0.875rem;
    color: var(--text-primary, #f1f5f9);
}
.review-star-icon { vertical-align: middle; }

/* Profile rating */
.profile-rating-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border, rgba(148,163,184,0.1));
}
.profile-rating-display {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.profile-rating-stars { display: flex; gap: 2px; }
.profile-rating-avg {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--warning, #f59e0b);
}
.profile-rating-count {
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
}

/* Delivery Progress Slide Panel */
.delivery-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.delivery-panel-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}
.delivery-panel {
    position: fixed;
    top: 0;
    right: -540px;
    width: 520px;
    max-width: min(520px, 92vw);
    height: 100vh;
    height: 100dvh;
    background: var(--bg-secondary, #12121a);
    border-left: 1px solid var(--border);
    z-index: 10101;
    display: flex;
    flex-direction: column;
    transition: right 0.25s ease;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    isolation: isolate;
    pointer-events: auto;
}
.delivery-panel.open {
    right: 0;
}
.delivery-panel-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 10px;
    min-width: 0;
    background: var(--surface-solid, #12121a);
}
.delivery-panel-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    width: 100%;
}
.delivery-panel-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 0;
}
.delivery-panel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    min-height: 36px;
    min-width: 36px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--border);
    background: rgba(30, 30, 46, 0.6);
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}
.delivery-panel-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}
.delivery-panel-clear-all {
    color: var(--red-400, #f87171);
    border-color: rgba(239, 68, 68, 0.25);
}
.delivery-panel-clear-all:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
}
.delivery-panel-btn-short {
    display: none;
}
.delivery-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 0;
    flex: 1;
}
.delivery-panel-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 6px 10px;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-sm, 8px);
    flex-shrink: 0;
}
.delivery-panel-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}
.delivery-panel-body {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
}
.delivery-task {
    background: var(--surface-solid, rgba(30, 30, 46, 0.6));
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 12px);
    padding: 12px 14px;
    min-width: 0;
    overflow: hidden;
}
.delivery-task-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    min-width: 0;
}
.delivery-task-info {
    flex: 1;
    min-width: 0;
}
.delivery-task-title-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
    min-width: 0;
}
.delivery-task-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.delivery-task-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    min-width: 36px;
    min-height: 36px;
    border-radius: var(--radius-sm, 8px);
    flex-shrink: 0;
}
.delivery-task-clear:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red-400, #f87171);
}
.delivery-task-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.delivery-task-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}
.delivery-task-status.running {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue-400, #60a5fa);
    animation: delivery-status-pulse 1.4s ease-in-out infinite;
}
.delivery-task-status.done {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green-400, #4ade80);
}
.delivery-task-status.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red-400, #f87171);
}
.delivery-task-status.pending {
    background: rgba(250, 204, 21, 0.15);
    color: var(--amber-400, #fbbf24);
    animation: delivery-status-pulse 1.4s ease-in-out infinite;
}
@keyframes delivery-status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}
.delivery-progress-fab {
    position: fixed;
    /* Stacks above the support chat bubble, which owns the bottom-right corner. */
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    right: 24px;
    z-index: 180;
    pointer-events: auto;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-solid, rgba(30, 30, 46, 0.95));
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.delivery-progress-fab:hover {
    background: var(--bg-elevated, rgba(40, 40, 58, 0.98));
    border-color: var(--border-hover);
}
.delivery-progress-fab.blink {
    border-color: rgba(96, 165, 250, 0.55);
    animation: delivery-fab-pulse 2s ease-in-out infinite;
}
@keyframes delivery-fab-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.72; }
}
.delivery-progress-fab::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}
.delivery-progress-fab.blink::before {
    background: var(--blue-400, #60a5fa);
    animation: delivery-fab-dot 2s ease-in-out infinite;
}
@keyframes delivery-fab-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}
.delivery-task-log-wrap {
    margin-top: 10px;
    min-width: 0;
}
.delivery-task-log-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 0 4px;
    list-style: none;
    user-select: none;
    min-height: 36px;
}
.delivery-task-log-toggle::-webkit-details-marker {
    display: none;
}
.delivery-task-log-toggle::before {
    content: '▸';
    font-size: 10px;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}
.delivery-task-log-wrap[open] > .delivery-task-log-toggle::before {
    transform: rotate(90deg);
}
.delivery-task-log {
    margin-top: 4px;
    padding: 10px 12px;
    font-size: 11px;
    line-height: 1.5;
    font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
    color: var(--text-secondary, #94a3b8);
    background: rgba(10, 10, 15, 0.45);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 8px);
    max-height: 200px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.delivery-task-log-line {
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08);
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
}
.delivery-task-log-line:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.delivery-task-empty {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 24px 12px;
}

@media (max-width: 640px) {
    .delivery-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: min(72dvh, calc(100dvh - var(--header-height, 56px) - env(safe-area-inset-bottom, 0px) - 64px));
        border-left: none;
        border-top: 1px solid var(--border);
        border-radius: var(--radius-xl, 16px) var(--radius-xl, 16px) 0 0;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
        transform: translateY(110%);
        transition: transform 0.28s ease;
    }
    .delivery-panel.open {
        right: 0;
        transform: translateY(0);
    }
    .delivery-panel-header {
        padding: 12px 14px 10px;
        gap: 8px;
    }
    .delivery-panel-header-row {
        flex: 0 0 auto;
    }
    .delivery-panel-title {
        flex: 1;
        font-size: 13px;
    }
    .delivery-panel-actions {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
    .delivery-panel-btn-long {
        display: none;
    }
    .delivery-panel-btn-short {
        display: inline;
    }
    .delivery-panel-body {
        padding: 12px 14px;
        gap: 10px;
        flex: 1 1 auto;
        min-height: 120px;
    }
    .delivery-task {
        padding: 10px 12px;
    }
    .delivery-task-log {
        max-height: 140px;
    }
    .delivery-progress-fab {
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        right: 12px;
        left: auto;
        max-width: min(280px, calc(100vw - 24px));
    }
}

@media (max-width: 400px) {
    .delivery-panel-btn {
        padding: 6px 8px;
        font-size: 10px;
    }
    .delivery-task-title {
        font-size: 12px;
    }
}

/* Delivery Account Status */
.delivery-accounts,
.game-account-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.delivery-accounts:empty,
.game-account-status:empty {
    display: none;
}
.delivery-accounts .account-cell,
.game-account-status .account-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-1, rgba(30,30,46,0.6));
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    min-width: 160px;
}
.delivery-accounts .status-dot,
.game-account-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.delivery-accounts .status-dot.status-online,
.game-account-status .status-dot.status-online {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}
.delivery-accounts .status-dot.status-offline,
.game-account-status .status-dot.status-offline {
    background: #6b7280;
}
.delivery-accounts .account-info,
.game-account-status .account-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.delivery-accounts .account-username,
.game-account-status .account-username {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.delivery-accounts .account-meta,
.game-account-status .account-meta {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Game Account Status header */
.game-status-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.game-status-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.game-status-count {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.06);
    padding: 1px 8px;
    border-radius: 10px;
}

/* Extensions / Downloads page */
.extensions-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 8px 0 32px;
}
.extensions-header {
    margin-bottom: 28px;
}
.extensions-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
}
.extensions-subtitle {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
}
.extensions-group {
    margin-bottom: 32px;
}
.extensions-group-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.extensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.extensions-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.extensions-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.extensions-card-icon {
    color: var(--accent);
    opacity: 0.9;
}
.extensions-card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}
.extensions-card-desc {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.45;
}
.extensions-card-meta {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.extensions-card-btn {
    margin-top: auto;
    align-self: flex-start;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-tab-content .images-page {
    max-width: none;
    padding: 0;
}
.admin-tab-content .images-page .images-header {
    margin-bottom: 16px;
}

.images-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.images-subtab {
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.images-subtab.is-active {
    border-color: rgba(96, 165, 250, 0.65);
    color: #93c5fd;
    background: rgba(96, 165, 250, 0.12);
}
.images-paste-rules-card {
    max-width: 640px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
}
.images-paste-rules-head,
.images-paste-rule-row {
    display: grid;
    grid-template-columns: 72px 1fr minmax(140px, 1.2fr) 36px;
    gap: 8px;
    align-items: center;
}
.images-paste-rules-head {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}
.images-paste-rule-row + .images-paste-rule-row {
    margin-top: 8px;
}
.images-paste-rule-count {
    font-weight: 700;
    font-size: 13px;
}
.images-paste-rule-preview {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.35;
}
.images-paste-rule-add {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.images-paste-rule-add .admin-input {
    width: 88px;
    margin: 0;
}

.images-page {
    max-width: 980px;
    margin: 0 auto;
    padding: 8px 0 32px;
}
.images-header {
    margin-bottom: 24px;
}
.images-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
}
.images-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}
.images-layout {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 340px);
    gap: 20px;
    align-items: start;
}
@media (max-width: 768px) {
    .images-layout {
        grid-template-columns: 1fr;
    }
}
.images-panel,
.images-preview-wrap {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
}
.images-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.images-panel .admin-input {
    width: 100%;
    margin-bottom: 12px;
}
.images-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.images-status {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--text-muted);
    min-height: 18px;
}
.images-preview {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: block;
}
.images-preview-stage {
    position: relative;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.images-preview-wrap.is-ready .images-preview-empty {
    display: none !important;
}
.images-preview-wrap:not(.is-ready) .images-preview {
    display: none !important;
}
.images-preview-wrap.is-ready .images-preview {
    cursor: zoom-in;
}
.images-preview-wrap.is-ready .images-preview:hover {
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.35);
}
.images-preview-empty {
    width: 100%;
    max-width: 300px;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
}
.images-upload-details {
    margin-top: 28px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
}
.images-upload-details summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.images-upload-form {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    max-width: 420px;
}
.images-zone-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 4px;
}
.images-zone-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--bg-surface);
}
.images-zone-chip.is-filled {
    border-color: rgba(60, 200, 120, 0.5);
    color: #5fd68a;
}
.images-zone-chip.is-next {
    border-color: rgba(96, 165, 250, 0.8);
    color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
}
.images-paste-hint {
    margin: 8px 0 0;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}
.images-paste-target {
    outline: none;
}
.images-paste-target:focus:not(.is-ready) .images-preview-empty {
    border-color: rgba(96, 165, 250, 0.55);
}
.images-paste-sub {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.85;
}
.images-zone-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.images-zone-hint {
    margin: 8px 0 12px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}
.images-zone-wrap {
    display: grid;
    gap: 16px;
    max-width: 560px;
}
@media (min-width: 720px) {
    .images-zone-wrap {
        grid-template-columns: 1fr 220px;
        align-items: start;
    }
}
.images-zone-canvas {
    width: 100%;
    max-width: 520px;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: crosshair;
    display: block;
    background: #111;
}
.images-zone-fields .admin-input {
    width: 100%;
    margin-bottom: 8px;
}
.images-zone-pct-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}
.images-zone-pct-grid label {
    font-size: 11px;
    color: var(--text-muted);
}
.images-zone-pct-grid .admin-input {
    margin-top: 4px;
}
.images-zone-empty {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}
.images-zone-save-status {
    margin: 10px 0 0;
    min-height: 16px;
    font-size: 11px;
    color: var(--text-muted);
}

/* ZeusX extension connect panel */
.zx-extension-panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 14px;
}
.zx-extension-title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.zx-extension-desc {
    margin: 0 0 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.zx-extension-steps {
    margin: 0 0 16px;
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.65;
}
.zx-extension-steps li + li {
    margin-top: 6px;
}
.zx-extension-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.zx-extension-wait {
    margin: 0;
    font-size: 0.8rem;
    color: var(--violet-400);
}

.zx-results-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--surface-1);
    border: 1px solid var(--border);
}
.zx-results-search {
    flex: 1;
    min-width: 160px;
    max-width: 280px;
}
.zx-results-filter {
    max-width: 180px;
}
.zx-results-summary {
    flex: 1;
    min-width: 140px;
}
.zx-results-list {
    max-height: min(70vh, 720px);
    overflow-y: auto;
    padding-right: 2px;
}

/* ZeusX operation result cards */
.zx-op-card {
    margin-bottom: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}
.zx-op-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.zx-op-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.zx-op-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    text-transform: lowercase;
}
.zx-op-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px 12px;
}
.zx-op-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.zx-op-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.zx-op-value {
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-word;
}
.zx-op-error, .zx-op-skip {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}
.zx-op-error { color: #f87171; }

.extensions-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
}

/* Admin downloads tab */
.downloads-admin-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
}
.downloads-admin-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
    flex: 1;
}
.downloads-admin-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.downloads-admin-upload {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.badge-muted {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-weight: 500;
    vertical-align: middle;
}

/* Dashboard mobile cards (desktop hidden) */
.accounts-cards {
    display: none;
}

.dashboard-mobile-cards .accounts-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-mobile-cards .table-container {
    display: none;
}

/* Mod mobile lite */
.mod-desktop-hint {
    display: none;
}

.mod-delivery-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.mod-delivery-toolbar .btn {
    min-height: 44px;
}

.btn-deliver-all {
    background: var(--green-500, #22c55e);
    color: #fff;
}

.mod-mobile-progress {
    display: none;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(15, 15, 23, 0.85);
    padding: 10px 12px;
    max-height: min(36vh, 280px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.delivery-panel-open .mod-mobile-progress {
    display: none !important;
}

.mod-mobile-progress-head {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.mod-mobile-progress-item + .mod-mobile-progress-item {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mod-mobile-progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.mod-mobile-progress-title {
    font-size: 0.82rem;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mod-mobile-progress-msg {
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .bottom-nav-item {
        font-size: 0.58rem;
        padding: 6px 2px;
        min-width: 0;
        flex: 1;
    }

    .bottom-nav-item svg {
        width: 20px;
        height: 20px;
    }

    .admin-mobile-block {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: calc(100vh - var(--header-height) - 90px);
        padding: 16px;
    }

    .admin-mobile-block-card {
        max-width: 420px;
        width: 100%;
        text-align: center;
        padding: 28px 20px;
        border-radius: var(--radius-lg);
        border: 1px solid var(--border);
        background: rgba(15, 15, 23, 0.9);
    }

    .admin-mobile-block-card svg {
        color: var(--accent);
        margin-bottom: 16px;
    }

    .admin-mobile-block-text {
        color: var(--text-secondary);
        font-size: 0.9rem;
        line-height: 1.55;
        margin: 12px 0 20px;
    }

    .admin-mobile-block-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .admin-mobile-block-actions .btn-block {
        width: 100%;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.zeusx-mobile-hint {
    display: none;
}

.history-cards {
    display: none;
}

.history-mobile-cards .history-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-mobile-cards .history-table-wrap {
    display: none;
}

/* ===== Mobile polish (compact screens) ===== */
@media (max-width: 640px) {
    .header-page-title {
        font-size: 0.92rem;
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-right {
        gap: 4px;
        flex-wrap: nowrap;
        min-width: 0;
    }

    .header-community-user-stat {
        display: none;
    }

    .header-actions-group {
        gap: 0;
    }

    /* Keep locale reachable on phones (was hidden; only available on desktop header). */
    .header-actions-group .locale-settings-btn {
        display: inline-flex;
        width: 40px;
        min-width: 40px;
        height: 40px;
        padding: 0;
    }

    .header-balance-pill {
        max-width: 28vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-balance-pill svg {
        display: none;
    }

    .login-card-inner {
        min-width: 0;
        width: 100%;
        padding: 28px 20px;
    }

    .guest-login-btn {
        padding: 8px 14px;
        font-size: 0.82rem;
        min-height: 40px;
    }

    .apidocs-header-top {
        flex-direction: column;
        align-items: stretch;
    }

    .apidocs-copy-btn {
        width: 100%;
        min-height: 44px;
    }

    .apidocs-card {
        padding: 14px;
    }

    .friends-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .apikeys-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .apikey-masked,
    .apikey-result-value {
        word-break: break-all;
        font-size: 0.72rem;
    }

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

    .friend-actions {
        flex-wrap: wrap;
        width: 100%;
        justify-content: flex-end;
    }

    .friend-actions .btn {
        min-height: 40px;
    }

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

    .extensions-card {
        min-height: 44px;
    }

    .profile-rating-summary {
        margin-bottom: 12px;
        padding: 10px 12px;
        border-radius: var(--radius-sm);
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border);
    }

    .payment-iframe {
        height: min(70vh, 520px);
    }
}

/* ── Seller profile page ── */
.seller-profile-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4px 32px;
}
.seller-profile-back {
    display: inline-block;
    margin-bottom: 16px;
    font-size: 0.88rem;
    color: var(--text-muted);
    text-decoration: none;
}
.seller-profile-back:hover { color: var(--text-primary); }
.seller-profile-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}
.seller-profile-avatar-ring {
    padding: 3px;
    border-radius: 50%;
    background: #8b5cf6;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.25);
    flex-shrink: 0;
    position: relative;
}
.seller-profile-active-dot {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}
.seller-profile-username .market-seller-active {
    font-size: 0.78rem;
    margin-left: 4px;
    vertical-align: middle;
}
.seller-profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(139, 92, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--bg-primary);
}
.seller-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.seller-profile-avatar-shop {
    background: rgba(17, 4, 42, 0.85);
}
.seller-profile-avatar-shop img {
    object-fit: contain;
    padding: 10px;
}
.seller-profile-avatar-fallback {
    font-size: 2rem;
    font-weight: 700;
    color: #c4b5fd;
}
.seller-profile-name {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
}
.seller-profile-username {
    margin: 2px 0 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.seller-profile-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fbbf24;
}
.seller-profile-rating-empty {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}
.seller-profile-rating-count {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.82rem;
}
.seller-profile-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.seller-profile-stat {
    flex: 1;
    min-width: 140px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    text-align: center;
}
.seller-profile-stat-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
}
.seller-profile-stat-label {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.seller-profile-meta-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.88rem;
}
.seller-profile-meta-label { color: var(--text-muted); }
.seller-profile-meta-value { color: var(--text-primary); font-weight: 600; }
.seller-profile-description {
    margin: 0 0 20px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.5;
}
.seller-profile-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 16px;
}
.seller-profile-search {
    flex: 1;
    min-width: 200px;
}
.seller-profile-filter {
    min-width: 160px;
}
.seller-profile-grid {
    margin-top: 4px;
    --market-card-min: clamp(160px, 32vw, 220px);
    gap: 12px;
}
@media (min-width: 640px) {
    .seller-profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (min-width: 900px) {
    .seller-profile-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }
}
.seller-profile-grid .market-card-category {
    font-size: 0.8rem;
}
.seller-profile-grid .market-card-name {
    font-size: 1.02rem;
    -webkit-line-clamp: 4;
    line-clamp: 4;
}
.seller-profile-grid .market-price {
    font-size: 1.15rem;
}
.seller-profile-grid .market-card-body {
    padding: 11px 12px 10px;
    gap: 5px;
}
.seller-profile-grid .market-card-seller {
    padding: 0 12px 11px;
}
.seller-profile-grid .market-seller-avatar {
    width: 24px;
    height: 24px;
}
.seller-profile-grid .market-seller-name {
    font-size: 0.82rem;
}
.seller-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 20px;
}
.seller-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}
.seller-page-btn:hover:not(.active) {
    border-color: rgba(139, 92, 246, 0.45);
    color: #c4b5fd;
}
.seller-page-btn.active {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.55);
    color: #e9d5ff;
}
.seller-pagination-info {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 8px 0 0;
}
.seller-profile-error {
    text-align: center;
    padding: 48px 16px;
}
.market-seller-row-link {
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s ease;
    position: relative;
    z-index: 2;
}
.market-seller-row-link:hover {
    background: rgba(139, 92, 246, 0.08);
}
.market-seller-row-link:focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.55);
    outline-offset: 2px;
}
.market-detail-sidebar-card .market-seller-row-link {
    margin: -4px -6px;
    padding: 4px 6px;
}
@media (max-width: 640px) {
    .seller-profile-hero {
        flex-direction: column;
        text-align: center;
    }
    .seller-profile-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .seller-profile-filter { min-width: 0; }
}

/* ===== Live Support Chat Widget ===== */
.support-chat {
    position: fixed;
    right: 20px;
    /* Must stay below .admin-modal (500) and every other overlay so the bubble never covers a dialog. */
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 450;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.support-chat-fab {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    /* Match site surface FABs / btn-primary: surface + accent border, not solid indigo fill */
    border: 1px solid var(--border-hover);
    background: var(--surface-solid, #12121a);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast),
        background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.support-chat-fab:hover {
    transform: translateY(-2px);
    background: var(--bg-elevated, rgba(30, 30, 46, 0.98));
    border-color: var(--accent);
    color: var(--accent-hover);
    box-shadow: var(--shadow-hover);
}

.support-chat-fab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.support-chat-fab:active {
    transform: translateY(0);
}

.support-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #0a0a0f;
}

.support-chat-panel {
    width: min(360px, calc(100vw - 32px));
    height: min(480px, calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(20, 20, 32, 0.97);
    backdrop-filter: blur(16px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: msgFadeIn 0.15s ease-out;
}

/* Author `display:flex` beats the UA [hidden] rule - force closed until FAB click. */
.support-chat-panel[hidden],
.support-chat-threads[hidden],
.support-chat-msgs[hidden],
.support-chat-inputrow[hidden],
.support-chat-back[hidden],
.support-chat-badge[hidden] {
    display: none !important;
}

.support-chat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--state-active-bg, rgba(139, 92, 246, 0.12));
}

.support-chat-title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.support-chat-title.support-chat-title-user {
    cursor: pointer;
}

.support-chat-title.support-chat-title-user:hover {
    color: var(--accent);
}

.support-chat-back,
.support-chat-report,
.support-chat-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    display: flex;
    align-items: center;
}

.support-chat-back:hover,
.support-chat-report:hover,
.support-chat-close:hover {
    color: var(--text-primary, #fff);
    background: rgba(139, 92, 246, 0.12);
}

.support-chat-msgs {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px;
}

.support-chat-msgs .msg-content {
    max-width: 85%;
}

.support-chat-empty {
    margin: auto;
    text-align: center;
    color: var(--text-muted);
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.support-chat-empty svg {
    width: 36px;
    height: 36px;
    opacity: 0.5;
}

.support-chat-empty p {
    font-size: 0.82rem;
    line-height: 1.5;
}

.support-chat-loading {
    margin: auto;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
    padding: 20px;
}

.support-chat-senderr {
    flex-shrink: 0;
    padding: 6px 10px;
    color: var(--danger, #ef4444);
    font-size: 0.75rem;
    text-align: center;
}

.support-chat-inputrow {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
}

.support-chat-inputrow textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(30, 30, 46, 0.6);
    color: inherit;
    font: inherit;
    font-size: 0.85rem;
    line-height: 1.35;
    padding: 8px 12px;
    max-height: 120px;
    outline: none;
    /* Hide phantom single-line scrollbar (padding/line-height overflow ~34px).
       setupChatInput toggles overflowY to auto only when content exceeds max height. */
    overflow-x: hidden;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.45) transparent;
}

.support-chat-inputrow textarea::-webkit-scrollbar {
    width: 6px;
}

.support-chat-inputrow textarea::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.45);
    border-radius: 3px;
}

.support-chat-inputrow textarea:focus {
    border-color: var(--border-hover);
}

.support-chat-send {
    /* Match .btn-send-msg (messages page) - solid violet, not indigo gradient */
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: var(--violet-600);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.support-chat-send:hover:not(:disabled) {
    background: var(--violet-500);
    transform: scale(1.05);
    color: #fff;
}

.support-chat-send:active:not(:disabled) {
    transform: scale(0.95);
}

.support-chat-send:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.support-chat-send:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Ops thread list */
.support-chat-threads {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.support-thread {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.support-thread:hover {
    background: rgba(139, 92, 246, 0.08);
}

.support-thread-user {
    cursor: pointer;
}

span.support-thread-user:not(.support-thread-name) {
    display: flex;
    flex-shrink: 0;
}

.support-thread-user:hover .support-thread-avatar {
    opacity: 0.9;
}

.support-thread-name.support-thread-user:hover {
    color: var(--accent);
}

.support-thread-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.support-chat-msgs .support-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(139, 92, 246, 0.12);
}

.support-chat-msgs .msg-avatar-slot {
    width: 32px;
}

.support-msg-avatar-clickable,
.support-msg-avatar-brand {
    cursor: pointer;
}

.support-msg-avatar-clickable:hover,
.support-msg-avatar-brand:hover {
    opacity: 0.9;
}

.support-user-info-modal {
    max-width: 360px;
}

.support-user-info-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.support-user-info-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent, #a78bfa);
}

.support-user-info-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.support-user-info-meta {
    margin: 0;
    width: 100%;
    text-align: left;
}

.support-user-info-meta > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(30, 30, 46, 0.5);
    border: 1px solid var(--border);
}

.support-user-info-meta dt {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.support-user-info-meta dd {
    margin: 0;
    font-size: 0.82rem;
    word-break: break-all;
}

.support-admin-userhit {
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    padding: 0;
    cursor: pointer;
    text-align: left;
    min-width: 0;
}

.support-admin-userhit:hover .support-thread-name {
    color: var(--accent);
}

.support-thread-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent, #a78bfa);
    font-weight: 700;
    font-size: 0.85rem;
}

.support-thread-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.support-thread-name {
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.support-thread-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.support-thread-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

/* Marks a thread that arrived by email, so a mod knows the reply also leaves the site. */
.support-thread-tag {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 999px;
    color: var(--accent);
    background: rgba(139, 92, 246, 0.14);
    border: 1px solid rgba(139, 92, 246, 0.32);
    white-space: nowrap;
}

.support-thread-time {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.support-thread-badge {
    position: static;
    box-shadow: none;
}

@media (max-width: 640px) {
    .support-chat {
        right: max(12px, env(safe-area-inset-right, 0px));
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }
    .support-chat-fab {
        width: 48px;
        height: 48px;
    }
    .support-chat-panel {
        width: min(100vw - 24px, 360px);
        height: min(70dvh, calc(100dvh - var(--header-height, 56px) - 96px));
        max-height: calc(100dvh - 88px - env(safe-area-inset-bottom, 0px));
    }
    .support-chat-back,
    .support-chat-report,
    .support-chat-close {
        min-width: 40px;
        min-height: 40px;
        justify-content: center;
    }
    .support-chat-send {
        min-width: 44px;
        min-height: 44px;
    }
    .support-chat-inputrow textarea {
        font-size: 16px;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .support-chat {
        right: max(10px, env(safe-area-inset-right, 0px));
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
    .support-chat-panel {
        width: calc(100vw - 20px);
        height: min(72dvh, calc(100dvh - 80px - env(safe-area-inset-bottom, 0px)));
    }
}

/* Admin panel Support tab - two-pane inbox */
.support-admin {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: min(600px, calc(100vh - 220px));
    min-height: 380px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(20, 20, 32, 0.6);
    overflow: hidden;
}

.support-admin-threads {
    overflow-y: auto;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.support-admin-threads .support-thread.active {
    background: rgba(139, 92, 246, 0.14);
}

.support-admin-chat {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.support-admin-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-hover, rgba(139, 92, 246, 0.06));
    min-height: 54px;
}

.support-admin-chat-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.support-admin-msgs {
    flex: 1;
}

@media (max-width: 720px) {
    .support-admin {
        grid-template-columns: 1fr;
        grid-template-rows: 180px 1fr;
    }
    .support-admin-threads {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

/* ── Script Hub (community shared scripts) ─────────────────────────────── */

.scripthub-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 8px 0 40px;
}

.scripthub-header {
    margin-bottom: 18px;
}

.scripthub-title {
    font-size: 1.4rem;
    margin: 0 0 6px;
}

.scripthub-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.scripthub-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.scripthub-game-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.scripthub-game-select {
    max-width: 320px;
}

.scripthub-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: var(--card-bg, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border);
    border-radius: 10px;
}

.scripthub-card-main {
    flex: 1 1 320px;
    min-width: 0;
}

.scripthub-card-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.scripthub-card-title {
    margin: 0;
    font-size: 1.02rem;
    font-family: monospace;
}

.scripthub-card-author {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.scripthub-card-desc {
    margin: 6px 0 0;
    font-size: 0.86rem;
    color: var(--text-secondary, var(--text-muted));
    overflow-wrap: anywhere;
}

.scripthub-card-meta {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.scripthub-card-actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.scripthub-config-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.scripthub-config-select {
    min-width: 140px;
}

.scripthub-code {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.78rem;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
    margin: 0;
}

.scripthub-loader-box {
    margin-top: 4px;
}

.scripthub-key-note {
    width: 100%;
    font-size: 0.78rem;
    color: var(--warning, #eab308);
    margin-top: 4px;
}

.scripthub-contribute {
    margin-top: 28px;
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: 10px;
}

.scripthub-contribute h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.scripthub-contribute p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 10px;
}

.scripthub-active-banner {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary, #6366f1);
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.06);
}

.scripthub-active-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.88rem;
}

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

.scripthub-active-cfg {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.scripthub-active-none {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.scripthub-active-note {
    margin: 6px 0 0;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.scripthub-clear-btn {
    margin-left: auto;
    padding: 4px 12px;
    font-size: 0.78rem;
}

.scripthub-card-active {
    border-color: var(--primary, #6366f1);
}

.scripthub-active-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--primary, #6366f1);
    color: #fff;
}

/* ===== Email/password auth pages (deposit-inspired, Roblox163 tokens) ===== */
body.guest-auth .sidebar,
body.guest-auth .sidebar-backdrop,
body.guest-auth .main-header,
body.guest-auth .bottom-nav,
body.guest-auth .menu-toggle,
body.guest-auth .build-footer {
    display: none !important;
}
body.guest-auth .main-content {
    margin-left: 0 !important;
    min-height: 100vh;
    padding: 0 !important;
}
body.guest-auth #app {
    min-height: 100vh;
}

/* Auth modal (popup over current page) */
.auth-modal-overlay {
    z-index: 10300;
    backdrop-filter: blur(2px);
    background: rgba(30, 30, 46, 0.65);
}
.auth-modal-overlay .auth-modal {
    max-width: 440px;
    width: min(440px, calc(100vw - 2rem));
    max-height: min(92vh, 900px);
    overflow: auto;
    padding: 0;
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}
.auth-modal-close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 2;
}
.auth-modal-body,
.auth-modal-panel {
    padding: 2.25rem 1.5rem 1.75rem;
    box-sizing: border-box;
}
@media (max-width: 560px) {
    .auth-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .auth-modal-overlay .auth-modal {
        width: 100%;
        max-width: none;
        max-height: min(92dvh, calc(100dvh - env(safe-area-inset-top, 0px)));
        margin: 0;
        border-radius: 16px 16px 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .auth-modal-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 40px;
        height: 40px;
        min-width: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .auth-modal-body,
    .auth-modal-panel {
        padding: 1.75rem 1.1rem 1.35rem;
    }
    .auth-mode-tab {
        min-height: 44px;
    }
}
.auth-route-backdrop {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}
.auth-route-backdrop-text {
    margin: 0;
    font-size: 0.95rem;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2.5rem 1.25rem 3rem;
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--glass-blur);
}

.auth-card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-mode-tabs {
    display: flex;
    gap: 4px;
    width: 100%;
    margin: 0 0 1.25rem;
    padding: 4px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-sizing: border-box;
}

.auth-mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.55rem 0.75rem;
    border: 1px solid transparent;
    border-radius: calc(var(--radius-md) - 2px);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-mode-tab:hover:not(.is-active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.auth-mode-tab.is-active {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 1px 0 rgba(139, 92, 246, 0.12);
    cursor: default;
}

.auth-mode-tab:focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.55);
    outline-offset: 1px;
}

.auth-title {
    margin: 0 0 0.4rem;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.auth-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-signup-hint {
    margin: -0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
    text-align: left;
}

.auth-google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: #fff;
    color: #181825;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.95rem 1.25rem;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.08);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.auth-google-btn:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
    transform: translateY(-1px);
    color: #181825;
}

.auth-google-btn img {
    width: 22px;
    height: 22px;
}

.auth-divider {
    margin: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 1.5rem);
    height: 1px;
    background: var(--border);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-input {
    width: 100%;
    padding: 1rem 1.15rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    min-height: 52px;
    line-height: 1.4;
    box-sizing: border-box;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.auth-password-field {
    position: relative;
}

.auth-password-field .auth-input {
    padding-right: 3.25rem;
}

.auth-eye-btn {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(139, 92, 246, 0.75);
    cursor: pointer;
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

/* Author styles can beat UA [hidden] on SVG - only one eye icon at a time. */
.auth-eye-btn .eye-open[hidden],
.auth-eye-btn .eye-closed[hidden],
.paypass-eye-btn .eye-open[hidden],
.paypass-eye-btn .eye-closed[hidden] {
    display: none !important;
}

.auth-eye-btn:hover,
.auth-eye-btn[aria-pressed="true"] {
    color: var(--accent);
    background: rgba(139, 92, 246, 0.12);
}

.auth-eye-btn:focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.55);
    outline-offset: 1px;
}

.auth-submit {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.95rem 1.25rem;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
    text-transform: none;
    letter-spacing: normal;
}

.auth-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: -0.25rem;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-remember:hover {
    color: var(--text-primary);
}

.auth-remember .checkbox-wrapper {
    flex-shrink: 0;
}

.auth-remember-label {
    line-height: 1.2;
}

.auth-form + .auth-divider {
    margin-top: 1.25rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.auth-alert {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.45;
}

.auth-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red-500);
}

.auth-alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--green-500);
}

.auth-verify-lead {
    margin: 0 0 0.25rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-resend-btn {
    width: 100%;
    margin-top: 0.75rem;
}

@media (max-width: 560px) {
    .auth-card {
        padding: 1.75rem 1.25rem;
    }
    .auth-title {
        font-size: 1.45rem;
    }
}

