/* ============================================================
   COLLECTIO — Design System v2
   Modern fintech aesthetic — clean, dense, hyper-functional
   Mobile-first, desktop-perfect.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --bg: #fafaf9;
    --surface: #ffffff;
    --surface-alt: #f4f4f3;
    --surface-hover: #f0efed;

    --text: #0a0a0a;
    --text-secondary: #525252;
    --text-tertiary: #8a8a85;
    --text-inverse: #ffffff;

    --border: #e7e5e0;
    --border-strong: #d4d2cc;
    --border-focus: #0a0a0a;

    --brand: #1e1b4b;
    --brand-hover: #312e81;
    --brand-soft: #eef2ff;
    --brand-text: #1e1b4b;

    --accent: #b08642;
    --accent-soft: #fdf6e3;

    --success: #047857;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;

    --warning: #b45309;
    --warning-bg: #fffbeb;
    --warning-border: #fcd34d;

    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;

    --info: #1e40af;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
    --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
    --s-12: 48px; --s-16: 64px;

    --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 9999px;

    --shadow-xs: 0 1px 2px rgba(10,10,10,0.04);
    --shadow-sm: 0 1px 3px rgba(10,10,10,0.06), 0 1px 2px rgba(10,10,10,0.04);
    --shadow: 0 4px 6px -1px rgba(10,10,10,0.06), 0 2px 4px -2px rgba(10,10,10,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(10,10,10,0.08), 0 4px 6px -2px rgba(10,10,10,0.04);
    --shadow-focus: 0 0 0 3px rgba(30, 27, 75, 0.12);

    --t-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
    --t: 180ms cubic-bezier(0.4, 0, 0.2, 1);

    --max-width: 1280px;
    --header-h: 60px;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--s-3);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.015em;
    color: var(--text);
}
h1 { font-size: clamp(1.5rem, 2vw + 1rem, 2rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.25rem, 1.5vw + 0.75rem, 1.5rem); letter-spacing: -0.02em; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 var(--s-3); }
a { color: var(--brand); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand-hover); text-decoration: underline; text-underline-offset: 2px; }

.text-secondary, .muted { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.font-mono { font-family: var(--font-mono); }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--s-4); }
@media (min-width: 768px) { .container { padding: 0 var(--s-6); } }

.page { max-width: var(--max-width); margin: 0 auto; padding: var(--s-6) var(--s-4); }
@media (min-width: 768px) { .page { padding: var(--s-10) var(--s-6); } }
.page--narrow { max-width: 640px; }

.page-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: var(--s-4); flex-wrap: wrap;
    margin-bottom: var(--s-8); padding-bottom: var(--s-5);
    border-bottom: 1px solid var(--border);
}
.page-title { margin: 0; }
.page-subtitle { color: var(--text-secondary); margin: var(--s-2) 0 0; }
.section-title {
    font-size: 0.8125rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin: var(--s-8) 0 var(--s-4);
    padding-bottom: var(--s-2);
    border-bottom: 1px solid var(--border);
}

/* ===== HEADER ===== */
.app-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.app-header__inner {
    max-width: var(--max-width);
    height: var(--header-h);
    margin: 0 auto;
    padding: 0 var(--s-4);
    display: flex; align-items: center; gap: var(--s-4);
}
@media (min-width: 768px) { .app-header__inner { padding: 0 var(--s-6); gap: var(--s-6); } }

.brand {
    display: flex; align-items: center; gap: var(--s-2);
    font-weight: 700; font-size: 1.0625rem;
    color: var(--text); text-decoration: none;
    letter-spacing: -0.02em;
    transition: opacity var(--t-fast);
    flex-shrink: 0;
}
.brand:hover { opacity: 0.75; text-decoration: none; color: var(--text); }
.brand__mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    background: var(--brand); color: var(--text-inverse);
    border-radius: 6px; font-weight: 700; font-size: 14px;
    flex-shrink: 0;
}
/* hide "Collectio" text on very narrow screens so the brand mark still shows */
@media (max-width: 380px) { .brand > span:not(.brand__mark) { display: none; } }

.nav-main { display: none; gap: var(--s-1); flex: 1; min-width: 0; }
@media (min-width: 880px) { .nav-main { display: flex; } }
.nav-link {
    padding: 8px var(--s-3); border-radius: var(--r);
    color: var(--text-secondary); font-weight: 500; font-size: 14px;
    text-decoration: none; transition: all var(--t-fast);
    white-space: nowrap;
}
.nav-link:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.nav-link.is-active { color: var(--text); background: var(--surface-alt); }

.nav-right {
    display: flex; align-items: center; gap: var(--s-2);
    margin-left: auto;
    flex-shrink: 0;
}

/* Wallet chip — visible from 640px and up. Below that, hidden (info in drawer). */
.wallet-chip {
    display: none;
    align-items: center; gap: var(--s-2);
    height: 34px;
    padding: 0 var(--s-3);
    background: var(--surface-alt); border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: 13px; color: var(--text);
    text-decoration: none;
    font-variant-numeric: tabular-nums;
    transition: all var(--t-fast);
    white-space: nowrap;
}
@media (min-width: 640px) { .wallet-chip { display: inline-flex; } }
.wallet-chip:hover { background: var(--surface-hover); border-color: var(--border-strong); text-decoration: none; color: var(--text); }
.wallet-chip__amount { font-weight: 600; }
.wallet-chip__escrow {
    padding: 2px 6px;
    background: var(--warning-bg); color: var(--warning);
    border-radius: var(--r-sm);
    font-size: 11px; font-weight: 600;
}

/* Hide auth buttons on small screens (drawer covers it) */
.hide-mobile { display: none; }
@media (min-width: 640px) { .hide-mobile { display: inline-flex; } }

/* Avatar button — proper click target */
.avatar-btn {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--brand); color: var(--text-inverse);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 13px;
    cursor: pointer; border: none; text-decoration: none;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
    overflow: hidden;
    padding: 0;
    flex-shrink: 0;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-btn:hover { transform: scale(1.05); text-decoration: none; color: var(--text-inverse); }
.avatar-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.avatar-btn[aria-expanded="true"] { box-shadow: var(--shadow-focus); }

/* User dropdown — toggle via JS (aria-expanded on parent .user-menu) */
.user-menu {
    position: relative;
    display: none; /* hidden on mobile, drawer handles it */
}
@media (min-width: 640px) { .user-menu { display: inline-block; } }

.user-dropdown {
    position: absolute; top: calc(100% + 6px); right: 0;
    min-width: 240px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--s-2);
    opacity: 0; visibility: hidden;
    transform: translateY(-4px);
    transition: opacity var(--t-fast), transform var(--t-fast), visibility 0s linear var(--t);
    z-index: 60;
    pointer-events: none;
}
/* Bridge the gap so hover doesn't break on desktop */
.user-dropdown::before {
    content: "";
    position: absolute;
    top: -6px; left: 0; right: 0;
    height: 6px;
}
/* Open via JS (sets .is-open) — works on mobile and desktop. Hover is a desktop bonus. */
.user-menu.is-open .user-dropdown,
.user-menu:focus-within .user-dropdown {
    opacity: 1; visibility: visible; transform: translateY(0);
    pointer-events: auto;
    transition: opacity var(--t-fast), transform var(--t-fast), visibility 0s;
}
@media (hover: hover) and (pointer: fine) {
    .user-menu:hover .user-dropdown {
        opacity: 1; visibility: visible; transform: translateY(0);
        pointer-events: auto;
        transition: opacity var(--t-fast), transform var(--t-fast), visibility 0s;
    }
}

.user-dropdown a {
    display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-sm);
    color: var(--text); font-size: 14px;
    text-decoration: none;
    transition: background var(--t-fast);
}
.user-dropdown a:hover, .user-dropdown a:focus-visible {
    background: var(--surface-alt); text-decoration: none; outline: none;
}
.user-dropdown__email {
    padding: var(--s-2) var(--s-3) var(--s-3);
    font-size: 12px; color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--s-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-dropdown__email strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.user-dropdown__divider {
    height: 1px;
    background: var(--border);
    margin: var(--s-2) calc(-1 * var(--s-2));
}

/* Menu toggle — visible below 880px */
.menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border: 1px solid var(--border); background: var(--surface);
    border-radius: var(--r); cursor: pointer; color: var(--text);
    flex-shrink: 0;
    padding: 0;
    transition: all var(--t-fast);
}
.menu-toggle:hover { background: var(--surface-alt); }
.menu-toggle:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
@media (min-width: 880px) { .menu-toggle { display: none; } }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Mobile drawer backdrop */
.mobile-drawer-backdrop {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: rgba(10, 10, 10, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t), visibility 0s linear var(--t);
    z-index: 39;
}
.mobile-drawer-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--t), visibility 0s;
}

/* Mobile drawer */
.mobile-drawer {
    position: fixed;
    top: var(--header-h); right: 0; bottom: 0;
    width: min(360px, 90vw);
    background: var(--surface);
    padding: var(--s-4);
    transform: translateX(100%);
    transition: transform var(--t);
    z-index: 40;
    display: flex; flex-direction: column; gap: var(--s-1);
    overflow-y: auto;
    box-shadow: -8px 0 24px rgba(10,10,10,0.08);
}
.mobile-drawer.is-open { transform: translateX(0); }
.mobile-drawer a {
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r);
    color: var(--text); font-weight: 500;
    text-decoration: none;
    font-size: 15px;
    transition: background var(--t-fast);
}
.mobile-drawer a:hover, .mobile-drawer a:focus-visible {
    background: var(--surface-alt); text-decoration: none; outline: none;
}
.mobile-drawer__section {
    margin-top: var(--s-3);
    padding-top: var(--s-3);
    border-top: 1px solid var(--border);
    display: flex; flex-direction: column; gap: var(--s-1);
}

.mobile-drawer__user {
    display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-3) var(--s-2);
    margin-bottom: var(--s-2);
}
.mobile-drawer__avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--text-inverse);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600;
    font-size: 16px;
    overflow: hidden;
    flex-shrink: 0;
}
.mobile-drawer__avatar img { width: 100%; height: 100%; object-fit: cover; }
.mobile-drawer__user strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.mobile-drawer__user span {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
}

.mobile-drawer__wallet {
    display: flex !important;
    align-items: baseline;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-4) !important;
    background: var(--text);
    color: var(--text-inverse) !important;
    border-radius: var(--r) !important;
    margin-bottom: var(--s-3);
    flex-wrap: wrap;
}
.mobile-drawer__wallet:hover { background: var(--text) !important; opacity: 0.9; }
.mobile-drawer__wallet span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    font-weight: 600;
}
.mobile-drawer__wallet strong {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-inverse);
    font-variant-numeric: tabular-nums;
    flex: 1;
}
.mobile-drawer__wallet small {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
}

/* Lock body scroll when drawer open */
body.no-scroll { overflow: hidden; }


/* ===== BUTTONS ===== */
.btn {
    --btn-h: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    gap: var(--s-2);
    height: var(--btn-h); padding: 0 var(--s-4);
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--r);
    font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1;
    text-decoration: none; cursor: pointer; user-select: none;
    transition: all var(--t-fast);
    white-space: nowrap;
}
.btn:hover { background: var(--surface-alt); text-decoration: none; color: var(--text); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--brand); color: var(--text-inverse); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--text-inverse); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-alt); }
.btn-outline { background: transparent; border-color: var(--border-strong); }
.btn-danger { background: var(--danger); color: var(--text-inverse); border-color: var(--danger); }
.btn-danger:hover { background: #991b1b; border-color: #991b1b; color: var(--text-inverse); }
.btn-success { background: var(--success); color: var(--text-inverse); border-color: var(--success); }
.btn-success:hover { background: #065f46; border-color: #065f46; color: var(--text-inverse); }
.btn-gold { background: var(--accent); color: var(--text-inverse); border-color: var(--accent); }
.btn-gold:hover { background: #936a2e; border-color: #936a2e; color: var(--text-inverse); }
.btn-sm { --btn-h: 32px; padding: 0 var(--s-3); font-size: 13px; }
.btn-lg { --btn-h: 46px; padding: 0 var(--s-6); font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: var(--btn-h); }
.btn-light { background: var(--surface); color: var(--text); border-color: var(--surface); }
.btn-light:hover { background: var(--surface-alt); color: var(--text); border-color: var(--surface-alt); }
.btn-ghost-light { background: transparent; color: var(--text-inverse); border-color: rgba(255,255,255,0.2); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.08); color: var(--text-inverse); border-color: rgba(255,255,255,0.3); }

/* ===== FORMS ===== */
.form-group { margin-bottom: var(--s-4); }
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: var(--s-4);
    margin-bottom: var(--s-4);
}
.form-stack > * + * { margin-top: var(--s-4); }

label, .form-label {
    display: block; margin-bottom: var(--s-2);
    font-size: 13px; font-weight: 500; color: var(--text);
}
.form-label small, .label-hint {
    font-weight: 400; color: var(--text-tertiary);
    font-size: 12px; margin-left: var(--s-2);
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="search"],
input[type="url"], input[type="tel"], select, textarea, .form-input {
    width: 100%; height: 40px; padding: 0 12px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--r);
    font-family: inherit; font-size: 14px;
    transition: all var(--t-fast);
    -webkit-appearance: none; appearance: none;
}
textarea { height: auto; min-height: 100px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23525252' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
    padding-right: 36px; cursor: pointer;
}
input:hover, select:hover, textarea:hover, .form-input:hover { border-color: var(--text-tertiary); }
input:focus, select:focus, textarea:focus, .form-input:focus {
    outline: none; border-color: var(--border-focus);
    box-shadow: var(--shadow-focus);
}
input::placeholder, textarea::placeholder { color: var(--text-tertiary); }
input[type="file"] { height: auto; padding: 8px; line-height: 1.4; }

.form-input--lg { height: 52px; font-size: 17px; padding: 0 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.form-input--xs { max-width: 110px; }

.form-check { display: flex; align-items: flex-start; gap: var(--s-3); cursor: pointer; margin-bottom: 0; font-weight: 400; color: var(--text-secondary); }
.form-check input[type="checkbox"], .form-check input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); cursor: pointer; flex-shrink: 0; margin-top: 1px; }

.form-help, .form-hint { margin-top: var(--s-1); font-size: 12px; color: var(--text-tertiary); }

.form-fieldset {
    border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: var(--s-5); background: var(--surface);
}
.form-fieldset legend {
    padding: 0 var(--s-2);
    font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-tertiary);
}
.form-actions { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; padding-top: var(--s-2); }

.form-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: var(--s-6);
    box-shadow: var(--shadow-xs);
}
@media (min-width: 768px) { .form-card { padding: var(--s-8); } }

.chip {
    display: inline-flex; align-items: center; height: 32px;
    padding: 0 var(--s-3);
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--r-full);
    font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text);
    cursor: pointer; transition: all var(--t-fast);
}
.chip:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.quick-amounts { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* ===== CARDS ===== */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: all var(--t);
}
.card-section, .card-pad { padding: var(--s-5); }
.card-section + .card-section { border-top: 1px solid var(--border); }
.card-section h4 {
    margin: 0 0 var(--s-3);
    font-size: 13px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-tertiary);
}

/* ===== STATS ===== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-3);
    margin-bottom: var(--s-6);
}
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat {
    display: flex; flex-direction: column; gap: 4px;
    padding: var(--s-4) var(--s-5);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg);
}
.stat .lbl, .stat__label {
    font-size: 12px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-tertiary);
    order: 1;
}
.stat .num, .stat__value {
    font-size: clamp(1.375rem, 2vw + 0.5rem, 1.75rem);
    font-weight: 600; line-height: 1.1;
    color: var(--text); font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    order: 2;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: var(--s-3);
    margin-bottom: var(--s-6);
}
.kpi {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-5);
    display: flex; flex-direction: column; gap: var(--s-1);
}
.kpi-label { font-size: 12px; font-weight: 500; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-value { font-size: 1.5rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.1; margin-top: var(--s-1); }
.kpi-trend { font-size: 12px; color: var(--text-secondary); margin-top: var(--s-1); }
.kpi--warn .kpi-value { color: var(--warning); }
.kpi--alert { background: var(--danger-bg); border-color: var(--danger-border); }
.kpi--alert .kpi-value { color: var(--danger); }
.kpi--gold { background: var(--text); color: var(--text-inverse); border-color: var(--text); }
.kpi--gold .kpi-label, .kpi--gold .kpi-trend { color: rgba(255,255,255,0.7); }
.kpi--gold .kpi-value { color: var(--text-inverse); }

/* ===== ITEM CARDS ===== */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
    gap: var(--s-4);
}
@media (min-width: 768px) { .item-grid { gap: var(--s-5); } }

.item-card {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    text-decoration: none; color: inherit;
    transition: all var(--t);
    position: relative;
}
.item-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none; color: inherit;
}

.item-card__media, .item-card .item-card-image {
    width: 100%; aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--surface-alt);
    display: block;
}
.item-card__media { position: relative; overflow: hidden; }
.item-card__media img { width: 100%; height: 100%; object-fit: cover; }

.item-card-noimg, .item-card__placeholder {
    width: 100%; aspect-ratio: 4 / 3;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; color: var(--text-tertiary);
    background: var(--surface-alt);
}

.item-card__body, .item-card-body {
    padding: var(--s-4);
    display: flex; flex-direction: column; gap: var(--s-1);
    flex: 1;
}

.item-card__title, .item-card-title {
    font-size: 14px; font-weight: 600; line-height: 1.35;
    color: var(--text); margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2; line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-card__meta, .item-card-meta {
    font-size: 12px; color: var(--text-tertiary);
    margin-top: 2px;
}

.item-card__price, .item-card-price {
    margin-top: var(--s-2); padding-top: var(--s-2);
    border-top: 1px solid var(--border);
    font-size: 15px; font-weight: 600; color: var(--text);
    font-variant-numeric: tabular-nums;
    display: flex; align-items: baseline; gap: var(--s-2); flex-wrap: wrap;
}
.item-card-price small {
    font-size: 11px; font-weight: 400; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 0.04em;
}

.item-badge {
    position: absolute; top: var(--s-3); left: var(--s-3);
    display: inline-flex; align-items: center; height: 22px;
    padding: 0 var(--s-2);
    border-radius: var(--r-sm);
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border);
    z-index: 2;
}
.item-badge.auction, .item-badge--auction {
    background: var(--text); color: var(--text-inverse); border-color: var(--text);
}
.item-badge.sold {
    background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border);
}

/* ===== BADGES ===== */
.badge, .tag {
    display: inline-flex; align-items: center; height: 22px;
    padding: 0 var(--s-2);
    border-radius: var(--r-sm);
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    background: var(--surface-alt); color: var(--text-secondary);
    border: 1px solid var(--border);
}
.badge--success, .badge--released, .badge--sale_release, .badge-released, .badge--deposit { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge--pending, .badge-pending, .badge--warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.badge--danger, .badge--disputed, .badge-disputed { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge--info, .badge-held, .badge--held, .badge--escrow_hold { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.badge--refunded, .badge--refund, .badge-refunded, .badge--withdrawal, .badge--withdraw, .badge--purchase, .badge--fee, .badge--bid_hold, .badge--bid_release { background: var(--surface-alt); color: var(--text-secondary); border-color: var(--border); }

/* ===== ALERTS ===== */
.alert, .flash {
    display: flex; align-items: flex-start; gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r);
    border: 1px solid;
    font-size: 14px;
    margin-bottom: var(--s-4);
    animation: slideIn 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.alert-success, .flash-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.alert-error, .flash-error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.notice {
    padding: var(--s-3) var(--s-4); border-radius: var(--r);
    border: 1px solid var(--border); background: var(--surface-alt);
    margin-bottom: var(--s-4); font-size: 13px;
}
.notice--info { background: var(--info-bg); border-color: var(--info-border); color: var(--info); }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.empty-state {
    text-align: center; padding: var(--s-12) var(--s-4);
    background: var(--surface); border: 1px dashed var(--border-strong);
    border-radius: var(--r-lg); color: var(--text-secondary);
}
.empty-state p { margin: 0 0 var(--s-3); }

/* ===== HERO ===== */
.hero {
    text-align: center; padding: var(--s-12) var(--s-4) var(--s-10);
    max-width: 800px; margin: 0 auto;
}
@media (min-width: 768px) { .hero { padding: 6rem var(--s-6) var(--s-12); } }
.hero h1 {
    font-size: clamp(2rem, 5vw + 1rem, 3.75rem);
    line-height: 1.05; letter-spacing: -0.03em;
    margin: 0 0 var(--s-5); font-weight: 700;
}
.hero h1 em { color: var(--accent); font-style: italic; font-weight: 600; }
.hero-tagline {
    font-size: clamp(1rem, 1vw + 0.75rem, 1.25rem);
    color: var(--text-secondary);
    margin: 0 0 var(--s-8); line-height: 1.5;
}
.hero-cta { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }
.hero-ornament {
    width: 60px; height: 18px;
    color: var(--accent); margin: 0 auto var(--s-5);
    display: block; opacity: 0.6;
}

.features {
    display: grid; grid-template-columns: 1fr; gap: var(--s-4);
    padding: var(--s-8) var(--s-4);
    max-width: var(--max-width); margin: 0 auto;
}
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature {
    padding: var(--s-6);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg);
    transition: all var(--t);
}
.feature:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.feature-icon {
    font-size: 24px; margin-bottom: var(--s-3);
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    background: var(--brand-soft); border-radius: var(--r);
}
.feature h3 { margin: 0 0 var(--s-2); font-size: 1rem; font-weight: 600; }
.feature p { margin: 0; font-size: 14px; color: var(--text-secondary); line-height: 1.55; }

.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: var(--s-3); margin: var(--s-10) 0 var(--s-5); flex-wrap: wrap;
}
.section-head h2 { margin: 0; }

/* ===== ITEM DETAIL ===== */
.item-detail {
    display: grid; grid-template-columns: 1fr; gap: var(--s-6);
    margin: var(--s-6) 0;
}
@media (min-width: 880px) {
    .item-detail { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s-10); }
}
.item-gallery .main-img, .item-gallery .main-noimg {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
    border-radius: var(--r-lg);
    background: var(--surface-alt); border: 1px solid var(--border);
}
.item-gallery .main-noimg {
    display: flex; align-items: center; justify-content: center;
    font-size: 4rem; color: var(--text-tertiary);
}
.item-gallery .thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: var(--s-2); margin-top: var(--s-3);
}
.item-gallery .thumbs img {
    width: 100%; aspect-ratio: 1; object-fit: cover;
    border-radius: var(--r);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--t-fast);
    background: var(--surface-alt);
}
.item-gallery .thumbs img:hover { border-color: var(--border-strong); }
.item-gallery .thumbs img.active { border-color: var(--brand); }

.item-info h1 { font-size: clamp(1.5rem, 2vw + 0.75rem, 2rem); margin-bottom: var(--s-3); }

.item-attr-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--s-3);
    margin: var(--s-5) 0; padding: var(--s-4);
    background: var(--surface-alt); border-radius: var(--r-lg);
}
.item-attr { display: flex; flex-direction: column; gap: 2px; }
.item-attr .label {
    font-size: 11px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-tertiary);
}
.item-attr .value { font-size: 14px; font-weight: 500; color: var(--text); }

.price-block {
    margin: var(--s-6) 0; padding: var(--s-5);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg);
}
.price-label {
    font-size: 12px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-tertiary); margin-bottom: var(--s-1);
}
.price {
    font-size: 2.25rem; font-weight: 600; color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em; line-height: 1;
    margin-bottom: var(--s-2);
}

.quotation-hint {
    margin-top: var(--s-4); padding: var(--s-3) var(--s-4);
    background: var(--brand-soft); border-radius: var(--r);
    font-size: 13px; color: var(--brand-text); line-height: 1.5;
}
.quotation-hint strong { font-weight: 600; }

.auction-block {
    margin: var(--s-6) 0; padding: var(--s-6);
    background: var(--text); color: var(--text-inverse);
    border-radius: var(--r-lg);
}
.auction-block h3 {
    color: var(--accent);
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    margin: 0 0 var(--s-3);
}
.auction-block strong {
    font-size: 2.25rem !important; font-weight: 600 !important;
    color: var(--accent) !important;
    font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.auction-block .countdown {
    display: flex; gap: var(--s-2); margin: var(--s-4) 0;
    font-variant-numeric: tabular-nums;
}
.countdown-unit {
    flex: 1; text-align: center; padding: var(--s-3);
    background: rgba(255,255,255,0.08); border-radius: var(--r);
}
.countdown-unit .num {
    display: block; font-size: 1.75rem; font-weight: 600;
    color: var(--accent); letter-spacing: -0.02em; line-height: 1;
}
.countdown-unit .lbl {
    display: block; font-size: 10px;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: rgba(255,255,255,0.5); margin-top: 4px;
}

.bid-form {
    margin-top: var(--s-4); padding-top: var(--s-4);
    border-top: 1px solid rgba(255,255,255,0.1);
}
.bid-row { display: flex; gap: var(--s-2); }
.bid-row input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
    color: var(--text-inverse);
}
.bid-row input::placeholder { color: rgba(255,255,255,0.4); }
.bid-row input:focus {
    border-color: var(--accent);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 3px rgba(176, 134, 66, 0.2);
}

.bid-history { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid rgba(255,255,255,0.1); }
.bid-history h4 {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: rgba(255,255,255,0.5); margin: 0 0 var(--s-2);
}
.bid-history ul { list-style: none; padding: 0; margin: 0; }
.bid-history li {
    display: flex; justify-content: space-between;
    padding: var(--s-2) 0; font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.bid-history li:last-child { border-bottom: 0; }
.bid-history small { color: rgba(255,255,255,0.4); margin-left: var(--s-2); }

/* ===== COLLECTION HEADER ===== */
.collection-header {
    background: var(--text); color: var(--text-inverse);
    border-radius: var(--r-lg);
    padding: var(--s-8) var(--s-6);
    margin-bottom: var(--s-6);
}
@media (min-width: 768px) { .collection-header { padding: var(--s-10) var(--s-8); } }
.collection-header h1 {
    color: var(--text-inverse); margin: var(--s-2) 0;
    font-size: clamp(1.75rem, 3vw + 0.5rem, 2.5rem);
}
.collection-header .small {
    color: var(--accent) !important; font-size: 12px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.collection-header p { color: rgba(255,255,255,0.7); }

/* ===== DASHBOARD ===== */
.dashboard-grid {
    display: grid; grid-template-columns: 1fr; gap: var(--s-6);
    margin-top: var(--s-6);
}
@media (min-width: 960px) {
    .dashboard-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-8); }
}
.dashboard-grid > div:first-child { min-width: 0; }
.dashboard-grid aside { display: flex; flex-direction: column; gap: var(--s-4); }

/* ===== AUTH ===== */
.auth-wrap {
    max-width: 420px; margin: var(--s-12) auto;
    padding: var(--s-8);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}
.auth-wrap h1 { margin: 0 0 var(--s-1); font-size: 1.5rem; }
.auth-wrap .subtitle { color: var(--text-secondary); margin-bottom: var(--s-6); font-size: 14px; }
.auth-alt {
    margin-top: var(--s-5); padding-top: var(--s-4);
    border-top: 1px solid var(--border);
    text-align: center; font-size: 14px; color: var(--text-secondary);
}

/* ===== WALLET ===== */
.wallet-grid {
    display: grid; grid-template-columns: 1fr; gap: var(--s-4);
    margin: var(--s-6) 0 var(--s-8);
}
@media (min-width: 768px) { .wallet-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }

.wallet-card { padding: var(--s-6); border-radius: var(--r-lg); position: relative; overflow: hidden; }
.wallet-card--main { background: var(--text); color: var(--text-inverse); }
.wallet-card--main .wallet-label { color: var(--accent); }
.wallet-card--main .wallet-amount { color: var(--text-inverse); }
.wallet-card--escrow { background: var(--surface); border: 1px solid var(--border); }
.wallet-label {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: var(--s-3); display: block;
}
.wallet-amount {
    font-size: 2.5rem; font-weight: 600;
    letter-spacing: -0.02em; line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--text); display: block;
}
.wallet-note { font-size: 12px; color: var(--text-tertiary); margin: var(--s-3) 0 0; }
.wallet-actions { display: flex; gap: var(--s-2); margin-top: var(--s-5); }

.tx-list { display: flex; flex-direction: column; gap: var(--s-2); }
.tx-row {
    padding: var(--s-4);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "main meta" "actions actions";
    gap: var(--s-3);
    transition: all var(--t-fast);
}
.tx-row:hover { border-color: var(--border-strong); }
.tx-main { grid-area: main; display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.tx-meta { grid-area: meta; display: flex; gap: var(--s-3); align-items: center; }
.tx-actions {
    grid-area: actions;
    display: flex; gap: var(--s-2); flex-wrap: wrap;
    padding-top: var(--s-3); border-top: 1px solid var(--border);
}
.tx-role { padding: 2px var(--s-2); border-radius: var(--r-sm); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.tx-role--buy { background: var(--info-bg); color: var(--info); }
.tx-role--sell { background: var(--success-bg); color: var(--success); }
.tx-title { font-weight: 600; color: var(--text); font-size: 14px; }
.tx-title:hover { color: var(--brand); }
.tx-amount { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tx-row--alert { border-color: var(--danger-border); background: var(--danger-bg); }
.inline-form { display: inline; }

/* ===== TABLES ===== */
.table-wrap {
    overflow-x: auto;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg);
    margin-bottom: var(--s-6);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
    padding: var(--s-3) var(--s-4);
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-tertiary);
    background: var(--surface-alt);
    white-space: nowrap;
}
.data-table tbody tr { transition: background var(--t-fast); }
.data-table tbody tr:hover { background: var(--surface-alt); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td { vertical-align: middle; }
.text-positive { color: var(--success); font-weight: 600; }
.text-negative { color: var(--danger); font-weight: 600; }

table { width: 100%; border-collapse: collapse; font-size: 14px; margin: var(--s-4) 0; }
table th, table td { padding: var(--s-2) var(--s-3); text-align: left; border-bottom: 1px solid var(--border); }
table th { font-weight: 600; color: var(--text-secondary); font-size: 13px; }

/* ===== FILTER BAR ===== */
.filter-bar {
    display: grid; grid-template-columns: 1fr;
    gap: var(--s-2); padding: var(--s-3);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); margin-bottom: var(--s-5);
}
@media (min-width: 640px) {
    .filter-bar {
        grid-template-columns: minmax(180px, 2fr) repeat(3, 1fr) 100px 100px 1fr auto;
        align-items: center;
    }
}
.filter-bar input, .filter-bar select { height: 36px; font-size: 13px; }
.result-count { margin: 0 0 var(--s-3); font-size: 13px; color: var(--text-tertiary); }

.status-tabs {
    display: flex; gap: var(--s-1);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--s-5);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1px;
}
.status-tabs a {
    padding: var(--s-2) var(--s-4);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px; font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: all var(--t-fast);
}
.status-tabs a:hover { color: var(--text); text-decoration: none; }
.status-tabs a.is-active { color: var(--text); border-bottom-color: var(--brand); }

/* ===== PROFILE ===== */
.profile-header {
    display: flex; flex-direction: column; gap: var(--s-5);
    padding: var(--s-6);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg);
    margin-bottom: var(--s-6);
}
@media (min-width: 640px) { .profile-header { flex-direction: row; align-items: flex-start; } }
.profile-avatar {
    width: 80px; height: 80px;
    background: var(--brand); color: var(--text-inverse);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.75rem; font-weight: 600;
    flex-shrink: 0;
}
.profile-bio { font-style: italic; max-width: 600px; color: var(--text-secondary); margin: var(--s-3) 0; }
.profile-stats { display: flex; gap: var(--s-6); margin: var(--s-3) 0; flex-wrap: wrap; }
.profile-stats span { font-size: 13px; color: var(--text-tertiary); }
.profile-stats strong { display: block; font-size: 20px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: var(--s-4);
}
.collection-card {
    padding: var(--s-5);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg);
    text-decoration: none; color: inherit;
    transition: all var(--t);
}
.collection-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px); box-shadow: var(--shadow);
    text-decoration: none; color: inherit;
}
.collection-card__title { font-size: 1.0625rem; font-weight: 600; margin: 0 0 var(--s-1); }
.collection-card__meta { font-size: 12px; color: var(--text-tertiary); margin: 0 0 var(--s-3); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
.collection-card__desc { font-size: 13px; color: var(--text-secondary); margin: 0; }

/* ===== MESSENGER ===== */
.messenger {
    display: grid; grid-template-columns: 1fr; gap: var(--s-4);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden; min-height: 540px;
}
@media (min-width: 768px) { .messenger { grid-template-columns: 280px minmax(0, 1fr); } }
.messenger-list { background: var(--surface-alt); border-right: 1px solid var(--border); padding: var(--s-4); }
.h-xs { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); margin: 0 0 var(--s-3); }
.h-sm { font-size: 1rem; font-weight: 600; margin: 0; }
.thread-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.thread-item {
    display: flex; flex-direction: column; gap: 2px;
    padding: var(--s-3);
    border-radius: var(--r);
    text-decoration: none; color: var(--text);
    transition: background var(--t-fast);
}
.thread-item:hover { background: var(--surface); text-decoration: none; color: var(--text); }
.thread-item.is-active { background: var(--surface); border-left: 3px solid var(--brand); padding-left: calc(var(--s-3) - 3px); }
.thread-item strong { font-size: 14px; }
.thread-item .muted { font-size: 12px; }
.thread-item time { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.messenger-thread { padding: var(--s-5); display: flex; flex-direction: column; min-width: 0; }
.thread-header { padding-bottom: var(--s-4); border-bottom: 1px solid var(--border); margin-bottom: var(--s-4); }
.message-stream { flex: 1; display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-2) 0; max-height: 480px; overflow-y: auto; }
.message-bubble {
    background: var(--surface-alt);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-lg);
    border-bottom-left-radius: var(--s-1);
    max-width: 80%;
    align-self: flex-start;
    font-size: 14px;
}
.message-bubble.is-mine {
    background: var(--brand); color: var(--text-inverse);
    align-self: flex-end;
    border-bottom-left-radius: var(--r-lg);
    border-bottom-right-radius: var(--s-1);
}
.message-bubble.is-mine time { color: rgba(255,255,255,0.6) !important; }
.message-bubble p { margin: 0 0 var(--s-1); }
.message-bubble time { font-size: 11px; color: var(--text-tertiary); }
.message-compose { display: flex; flex-direction: column; gap: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--border); margin-top: var(--s-3); }
.message-compose textarea { min-height: 70px; }
.message-compose button { align-self: flex-end; }

/* ===== CHECKOUT ===== */
.checkout-grid {
    display: grid; grid-template-columns: 1fr; gap: var(--s-5);
    margin-top: var(--s-5);
}
@media (min-width: 880px) { .checkout-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.checkout-item {
    display: flex; gap: var(--s-4); padding: var(--s-5);
    align-items: flex-start;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg);
}
.checkout-thumb {
    width: 120px; height: 120px;
    object-fit: cover; border-radius: var(--r);
    flex-shrink: 0;
}
.checkout-summary { padding: var(--s-5); }
.summary-list {
    display: grid; grid-template-columns: 1fr auto;
    gap: var(--s-2) var(--s-4);
    margin: var(--s-4) 0; padding-bottom: var(--s-4);
    border-bottom: 1px solid var(--border);
}
.summary-list dt { color: var(--text-secondary); font-size: 13px; }
.summary-list dd { margin: 0; font-weight: 600; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
.escrow-notice {
    background: var(--info-bg); border: 1px solid var(--info-border);
    color: var(--info);
    padding: var(--s-3) var(--s-4); border-radius: var(--r);
    margin: var(--s-4) 0;
    font-size: 13px; line-height: 1.5;
}
.escrow-notice strong { display: block; font-size: 14px; margin-bottom: var(--s-1); }
.escrow-notice p { margin: 0; }
.link-back {
    display: inline-flex; align-items: center; gap: var(--s-1);
    margin-top: var(--s-4);
    color: var(--text-secondary); font-size: 13px;
}

/* ===== UPLOADER ===== */
.image-uploader {
    border: 2px dashed var(--border-strong);
    background: var(--surface-alt);
    padding: var(--s-8);
    border-radius: var(--r-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--t-fast);
}
.image-uploader:hover, .image-uploader.is-drag {
    border-color: var(--brand);
    background: var(--brand-soft);
}
.image-uploader p { margin: 0 0 var(--s-1); color: var(--text); font-size: 14px; }
.image-uploader .small { color: var(--text-tertiary); font-size: 12px; }
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--s-2);
    margin-top: var(--s-3);
}
.preview-grid img {
    width: 100%; aspect-ratio: 1; object-fit: cover;
    border-radius: var(--r);
    border: 1px solid var(--border);
}

.existing-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--s-2);
}
.existing-image {
    position: relative; aspect-ratio: 1;
    border-radius: var(--r); overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-alt);
}
.existing-image img { width: 100%; height: 100%; object-fit: cover; }
.img-tag {
    position: absolute; top: 6px; left: 6px;
    background: var(--brand); color: var(--text-inverse);
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
    padding: 3px 6px; border-radius: var(--r-sm); font-weight: 600;
}
.img-delete { position: absolute; top: 4px; right: 4px; margin: 0; }
.btn-img-delete {
    background: rgba(0,0,0,0.6); color: white;
    border: none;
    width: 24px; height: 24px;
    border-radius: 50%;
    font-size: 16px; cursor: pointer; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.btn-img-delete:hover { background: var(--danger); }

/* ===== ADMIN ===== */
.admin-shell {
    display: grid; grid-template-columns: 1fr; gap: var(--s-5);
}
@media (min-width: 880px) {
    .admin-shell { grid-template-columns: 220px minmax(0, 1fr); gap: var(--s-6); }
}
.admin-nav {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-3);
    display: flex; flex-direction: column; gap: 2px;
    align-self: flex-start;
}
@media (min-width: 880px) { .admin-nav { position: sticky; top: calc(var(--header-h) + var(--s-4)); } }
.admin-nav-title {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-tertiary);
    padding: var(--s-2) var(--s-3); margin: 0;
}
.admin-nav a {
    padding: var(--s-2) var(--s-3);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px; font-weight: 500;
    border-radius: var(--r);
    transition: all var(--t-fast);
}
.admin-nav a:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.admin-nav a.is-active { background: var(--brand-soft); color: var(--brand); }
.admin-nav-back {
    margin-top: var(--s-3); padding-top: var(--s-3);
    border-top: 1px solid var(--border);
    color: var(--text-tertiary) !important;
    font-size: 13px !important;
}
.admin-link { color: var(--brand) !important; font-weight: 600; }
.admin-header { margin-bottom: var(--s-6); }
.admin-main { min-width: 0; }
.admin-detail-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: var(--s-6);
}
.detail-head {
    display: flex; gap: var(--s-4);
    align-items: flex-start;
    padding-bottom: var(--s-4); margin-bottom: var(--s-4);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.admin-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }

.role-tag {
    display: inline-block; padding: 2px var(--s-2);
    border-radius: var(--r-sm);
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    margin-left: var(--s-2); vertical-align: middle;
}
.role-admin { background: var(--brand); color: var(--text-inverse); }
.role-verified { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }

.divider { border: 0; border-top: 1px solid var(--border); margin: var(--s-6) 0; }

.mt-1 { margin-top: var(--s-2); } .mt-2 { margin-top: var(--s-4); } .mt-md { margin-top: var(--s-4); }
.mb-1 { margin-bottom: var(--s-2); } .mb-2 { margin-bottom: var(--s-4); } .mb-md { margin-bottom: var(--s-4); }
.mt-lg { margin-top: var(--s-6); } .mb-lg { margin-bottom: var(--s-6); }
.text-center { text-align: center; }
.small { font-size: 12px; color: var(--text-secondary); }

/* ===== FOOTER ===== */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: var(--s-10) var(--s-4) var(--s-6);
    margin-top: var(--s-16);
}
.site-footer__inner {
    max-width: var(--max-width); margin: 0 auto;
    display: grid; grid-template-columns: 1fr; gap: var(--s-6);
}
@media (min-width: 640px) {
    .site-footer__inner { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.site-footer__brand { font-weight: 700; font-size: 1rem; color: var(--text); margin-bottom: var(--s-2); }
.site-footer__tagline { font-size: 13px; color: var(--text-tertiary); max-width: 280px; }
.site-footer h5 {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin: 0 0 var(--s-3);
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.site-footer a { color: var(--text-secondary); text-decoration: none; font-size: 13px; transition: color var(--t-fast); }
.site-footer a:hover { color: var(--text); text-decoration: none; }
.site-footer__bottom {
    max-width: var(--max-width); margin: var(--s-8) auto 0;
    padding-top: var(--s-5); border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-tertiary); font-size: 12px;
}

/* ===== AUCTION CARD (special dark) ===== */
.auction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: var(--s-4);
}
.auction-card {
    background: var(--text); color: var(--text-inverse);
    border-radius: var(--r-lg);
    overflow: hidden; text-decoration: none;
    display: flex; flex-direction: column;
    transition: all var(--t);
    border: 1px solid var(--text);
}
.auction-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
    text-decoration: none; color: var(--text-inverse);
}
.auction-card__media { aspect-ratio: 4/3; background: #1c1c1c; overflow: hidden; }
.auction-card__media img { width: 100%; height: 100%; object-fit: cover; }
.auction-card__body { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.auction-card__cat { font-size: 10px; letter-spacing: 0.08em; color: var(--accent); text-transform: uppercase; font-weight: 600; }
.auction-card__title { font-size: 1rem; font-weight: 600; margin: 0; color: var(--text-inverse); line-height: 1.3; }
.auction-card__bid { display: flex; gap: var(--s-2); align-items: baseline; flex-wrap: wrap; font-size: 12px; color: rgba(255,255,255,0.6); }
.auction-card__bid strong { font-size: 1.25rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.auction-card__bid .muted { color: rgba(255,255,255,0.5); }
.auction-card__countdown { margin-top: auto; padding-top: var(--s-2); border-top: 1px dashed rgba(255,255,255,0.1); }
.countdown-mini { font-family: var(--font-mono); font-size: 13px; color: var(--accent); letter-spacing: 0.05em; }

/* ===== RESPONSIVE / TOUCH ===== */
@media (max-width: 640px) {
    body { font-size: 14px; }
    .checkout-item { flex-direction: column; }
    .checkout-thumb { width: 100%; height: 200px; }
    .tx-row { grid-template-columns: 1fr; grid-template-areas: "main" "meta" "actions"; }
    .tx-meta { justify-content: space-between; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: var(--s-2) var(--s-3); }
}
@media (pointer: coarse) {
    .btn, .nav-link, .chip { min-height: 44px; }
    .btn-sm { min-height: 38px; }
    input, select, textarea { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
/* ============================================================
   COLLECTIO — Responsive consolidation v2.3
   Audit complet : touch targets, viewport, scroll, formulaires.
   ============================================================
   Ces règles SURCHARGENT les valeurs précédentes pour solidifier
   le rendu sur tous les devices : mobile à 320px → 4K.
   À placer EN BAS du fichier style.css. Tout ce qui suit "fait loi".
   ============================================================ */

/* ====================================================
   1. FONDATIONS — empêcher le zoom auto iOS Safari
   ==================================================== */
/* iOS Safari zoome automatiquement sur les inputs < 16px lors du focus.
   On force 16px sur mobile, et on peut redescendre à 14px sur desktop. */
input, select, textarea, .form-input {
    font-size: 16px;
}
@media (min-width: 768px) {
    input, select, textarea, .form-input {
        font-size: 14px;
    }
}

/* ====================================================
   2. TYPOGRAPHIE LISIBLE sur tous formats
   ==================================================== */
html {
    /* Tailles de base fluides */
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    /* 15px lisible mobile, 15px desktop : équilibré */
    font-size: 15px;
    line-height: 1.55;
}
/* Plus petit ne devrait jamais descendre sous 12px lisible */
.small, .form-help, .form-hint, .item-card-meta, .muted.small {
    font-size: 12.5px;
    line-height: 1.45;
}

/* ====================================================
   3. TOUCH TARGETS — niveau "Apple HIG" (44×44 min)
   ==================================================== */
/* La règle pointer:coarse existante restait minimaliste.
   Ici on passe à 48px partout (Material 3) pour le pouce moyen. */
@media (pointer: coarse), (max-width: 640px) {
    .btn { min-height: 48px; padding-left: var(--s-5); padding-right: var(--s-5); }
    .btn-sm { min-height: 40px; }
    .btn-lg { min-height: 52px; }
    .btn-icon { width: 48px; }

    input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="date"], input[type="search"],
    input[type="url"], input[type="tel"], select, .form-input {
        height: 48px;
        padding: 0 14px;
    }
    select { padding-right: 40px; }

    .nav-link { min-height: 44px; display: inline-flex; align-items: center; }
    .chip { min-height: 40px; padding: 0 16px; }

    /* Liens dans listes ou tabs */
    .status-tabs a { padding-top: var(--s-3); padding-bottom: var(--s-3); }
    .user-dropdown a { padding: var(--s-3) var(--s-4); }

    /* Checkbox/radio : agrandir la zone cliquable */
    .form-check { padding: var(--s-2) 0; }
    .form-check input[type="checkbox"], .form-check input[type="radio"] {
        width: 22px;
        height: 22px;
    }
}

/* ====================================================
   4. HEADER — hide on scroll down, show on scroll up
   ==================================================== */
.app-header {
    transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
.app-header.is-hidden {
    transform: translateY(-100%);
}
/* Pour que les ancres internes ne soient pas masquées sous le header */
:target {
    scroll-margin-top: calc(var(--header-h) + var(--s-4));
}

/* ====================================================
   5. SAFE AREA — iPhones X+ (encoche + barre home)
   ==================================================== */
.app-header__inner {
    padding-left: max(var(--s-4), env(safe-area-inset-left));
    padding-right: max(var(--s-4), env(safe-area-inset-right));
}
.site-footer {
    padding-bottom: max(var(--s-6), env(safe-area-inset-bottom));
}
.container, .page {
    padding-left: max(var(--s-4), env(safe-area-inset-left));
    padding-right: max(var(--s-4), env(safe-area-inset-right));
}
.mobile-drawer {
    padding-bottom: max(var(--s-4), env(safe-area-inset-bottom));
}

/* ====================================================
   6. FORMULAIRES MOBILES — réellement utilisables
   ==================================================== */
@media (max-width: 640px) {
    /* Form-row se transforme en stack vertical proprement */
    .form-row {
        grid-template-columns: 1fr;
        gap: var(--s-4);
    }
    /* Labels en haut, plus respirés */
    label, .form-label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    /* Fieldsets moins denses */
    .form-fieldset {
        padding: var(--s-5) var(--s-4);
    }
    .form-fieldset legend {
        padding: 0 var(--s-2);
    }
    /* Textareas plus généreuses */
    textarea {
        min-height: 120px;
        font-size: 16px; /* pas de zoom iOS */
    }
    /* Form-actions : boutons pleine largeur en mobile pour le pouce */
    .form-actions {
        flex-direction: column;
        align-items: stretch;
        gap: var(--s-2);
    }
    .form-actions .btn { width: 100%; }
}

/* Filter-bar marketplace : 2 colonnes mobile (pas 1, pour densité) */
@media (max-width: 639px) {
    .filter-bar {
        grid-template-columns: 1fr 1fr;
        gap: var(--s-2);
    }
    .filter-bar input[type="search"],
    .filter-bar > button {
        grid-column: 1 / -1; /* search et bouton sur toute la largeur */
    }
    .form-input--xs { max-width: none; }
}

/* Collectors-filterbar : pareil */
@media (max-width: 639px) {
    .collectors-filterbar {
        grid-template-columns: 1fr;
    }
}

/* ====================================================
   7. TABLEAUX — scroll horizontal avec indicateur visuel
   ==================================================== */
.table-wrap {
    position: relative;
    /* Indicateur de scroll sur les bords */
    background:
        linear-gradient(to right, var(--surface) 30%, rgba(255,255,255,0)),
        linear-gradient(to right, rgba(255,255,255,0), var(--surface) 70%) 100% 0,
        radial-gradient(farthest-side at 0% 50%, rgba(10,10,10,0.10), rgba(10,10,10,0)),
        radial-gradient(farthest-side at 100% 50%, rgba(10,10,10,0.10), rgba(10,10,10,0)) 100% 0;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 640px) {
    .data-table { min-width: 480px; } /* force scroll horizontal au lieu de tasser */
}

/* ====================================================
   8. STATUS-TABS — fade aux bords si scroll horizontal
   ==================================================== */
.status-tabs {
    position: relative;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;
}
.status-tabs::-webkit-scrollbar { display: none; }
/* Indicateur visuel fade-out à droite si overflow */
.status-tabs {
    -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
    mask-image: linear-gradient(to right, black 90%, transparent 100%);
}
@media (min-width: 640px) {
    .status-tabs {
        -webkit-mask-image: none;
        mask-image: none;
    }
}

/* ====================================================
   9. ITEM-GRID — densité optimale par taille d'écran
   ==================================================== */
.item-grid {
    /* Sur mobile très petit : 2 colonnes à 150px min, pour ne pas avoir un seul item géant */
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 480px) {
    .item-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (min-width: 768px) {
    .item-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (min-width: 1100px) {
    .item-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* Item-card content sur très petit écran */
@media (max-width: 479px) {
    .item-card__body, .item-card-body { padding: var(--s-3); gap: 2px; }
    .item-card__title, .item-card-title { font-size: 13px; }
    .item-card__meta, .item-card-meta { font-size: 11px; }
    .item-card__price, .item-card-price { font-size: 14px; padding-top: var(--s-2); margin-top: var(--s-1); }
    .item-card-price small { display: block; margin-top: 2px; }
    .item-badge { top: var(--s-2); left: var(--s-2); height: 20px; padding: 0 6px; font-size: 10px; }
}

/* Auction-grid pareil */
.auction-grid { grid-template-columns: 1fr; }
@media (min-width: 480px) {
    .auction-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* Collector-grid */
@media (max-width: 479px) {
    .collector-grid { grid-template-columns: 1fr; }
}

/* ====================================================
   10. ITEM DETAIL — gallery mobile-first
   ==================================================== */
@media (max-width: 879px) {
    .item-detail { gap: var(--s-5); }
    .item-gallery .main-img, .item-gallery .main-noimg {
        aspect-ratio: 1; /* carré sur mobile, optimal pour pinch-zoom */
    }
    .item-attr-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: var(--s-3);
        gap: var(--s-2);
    }
    .item-attr .value { font-size: 13px; }
    .price { font-size: clamp(1.625rem, 6vw, 2rem); }
}

/* Auction-block countdown plus compact sur mobile */
@media (max-width: 480px) {
    .auction-block { padding: var(--s-5) var(--s-4); }
    .auction-block strong { font-size: 1.75rem !important; }
    .countdown-unit { padding: var(--s-2); }
    .countdown-unit .num { font-size: 1.375rem; }
}

/* ====================================================
   11. WALLET — adaptations mobile
   ==================================================== */
@media (max-width: 480px) {
    .wallet-amount { font-size: 2rem; }
    .wallet-card { padding: var(--s-5) var(--s-4); }
}

/* ====================================================
   12. TX-ROW — déjà en 1 colonne mobile, mais on raffine
   ==================================================== */
@media (max-width: 640px) {
    .tx-row { padding: var(--s-3); }
    .tx-main { gap: var(--s-2); }
    .tx-title { font-size: 13px; }
    .tx-amount { font-size: 15px; }
    .tx-actions .btn { width: auto; flex: 1; min-width: 0; }
}

/* ====================================================
   13. HOVER STATES — désactiver sur écrans tactiles
   ==================================================== */
/* Évite que les hover restent collés après un tap sur mobile */
@media (hover: none) {
    .btn:hover { background: inherit; }
    .btn-primary:hover { background: var(--brand); }
    .btn-danger:hover { background: var(--danger); }
    .btn-gold:hover { background: var(--accent); }
    .item-card:hover {
        transform: none;
        box-shadow: none;
        border-color: var(--border);
    }
    .feature:hover {
        transform: none;
        box-shadow: none;
        border-color: var(--border);
    }
    .crosslink-card:hover {
        transform: none;
        box-shadow: none;
    }
    .auction-card:hover {
        transform: none;
        box-shadow: none;
        border-color: var(--text);
    }
    .collector-card:hover {
        transform: none;
        box-shadow: none;
        border-color: var(--border);
    }
    /* On garde une légère feedback sur :active à la place */
    .btn:active, .item-card:active, .feature:active, .auction-card:active, .collector-card:active {
        opacity: 0.85;
    }
}

/* ====================================================
   14. MESSAGERIE — vraie expérience mobile
   ==================================================== */
@media (max-width: 767px) {
    .messenger {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .messenger-list {
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 220px;
        overflow-y: auto;
    }
    .messenger-thread { padding: var(--s-4); }
    .message-stream { max-height: 60vh; }
    .message-bubble { max-width: 90%; }
}

/* ====================================================
   15. HERO — éviter qu'il soit trop écrasé sur petit écran
   ==================================================== */
@media (max-width: 480px) {
    .hero { padding: var(--s-8) var(--s-4) var(--s-6); }
    .hero h1 { font-size: clamp(1.625rem, 8vw, 2rem); line-height: 1.15; }
    .hero-tagline { font-size: 15px; }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .hero-cta .btn { width: 100%; }
}

/* ====================================================
   16. FEATURES — adaptation densité
   ==================================================== */
@media (max-width: 480px) {
    .features { gap: var(--s-3); padding: var(--s-6) var(--s-4); }
    .feature { padding: var(--s-4); }
    .feature h3 { font-size: 15px; }
    .feature p { font-size: 13px; line-height: 1.5; }
}

/* ====================================================
   17. DASHBOARD — sidebar sous le contenu sur mobile
   ==================================================== */
@media (max-width: 959px) {
    .dashboard-grid { gap: var(--s-5); }
    .dashboard-grid aside {
        flex-direction: column;
        margin-top: var(--s-3);
    }
    /* Stats-grid : 2 cols mobile, plus aéré */
    .stat-grid { gap: var(--s-2); }
    .stat { padding: var(--s-3) var(--s-4); }
    .stat .num, .stat__value { font-size: 1.5rem; }
}

/* ====================================================
   18. AUTH — login/register pleine hauteur mobile
   ==================================================== */
@media (max-width: 480px) {
    .auth-wrap {
        margin: var(--s-4) var(--s-2);
        padding: var(--s-6) var(--s-4);
        box-shadow: none;
        border: 1px solid var(--border);
    }
}

/* ====================================================
   19. ADMIN — sidebar empilée sur mobile
   ==================================================== */
@media (max-width: 879px) {
    .admin-shell { gap: var(--s-4); }
    .admin-nav {
        position: static !important;
        flex-direction: row;
        flex-wrap: wrap;
        overflow-x: auto;
        gap: var(--s-1);
    }
    .admin-nav a { white-space: nowrap; padding: 8px 14px; }
    .admin-nav-title { width: 100%; }
}

/* ====================================================
   20. SCROLL momentum + scrollbar discrète
   ==================================================== */
* {
    -webkit-overflow-scrolling: touch;
}
/* Scrollbar custom sur desktop seulement (jamais sur mobile) */
@media (hover: hover) and (pointer: fine) {
    ::-webkit-scrollbar { width: 10px; height: 10px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb {
        background: var(--border-strong);
        border-radius: var(--r-full);
        border: 2px solid var(--bg);
    }
    ::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
}

/* ====================================================
   21. IMAGES — anti-débordement universel
   ==================================================== */
img, video, svg {
    max-width: 100%;
    height: auto;
}
img[width][height] { height: auto; } /* respect ratio */

/* ====================================================
   22. PRINT — base propre pour impression
   ==================================================== */
@media print {
    .app-header, .site-footer, .mobile-drawer, .mobile-drawer-backdrop,
    .menu-toggle, .user-menu, .nav-right, .btn { display: none !important; }
    body { background: white; color: black; font-size: 11pt; }
    .page { max-width: none; padding: 0; }
    a { color: black; text-decoration: underline; }
    .item-card, .card { break-inside: avoid; border-color: #999 !important; }
}

/* ====================================================
   23. LARGE DESKTOPS (≥1400px)
   ==================================================== */
@media (min-width: 1400px) {
    :root { --max-width: 1400px; }
    .hero h1 { font-size: 4rem; }
    .item-grid { gap: var(--s-6); }
}

/* ====================================================
   24. EXTRA-SMALL (≤360px) — Galaxy Fold, vieux iPhones
   ==================================================== */
@media (max-width: 360px) {
    :root { --s-4: 12px; --s-5: 16px; --s-6: 20px; }
    body { font-size: 14px; }
    .hero h1 { font-size: 1.5rem; }
    .page-title { font-size: 1.25rem; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .item-grid { gap: var(--s-3); }
}

/* ====================================================
   25. LANDSCAPE PHONES — éviter le hero qui prend tout l'écran
   ==================================================== */
@media (max-height: 480px) and (orientation: landscape) {
    .hero { padding: var(--s-5) var(--s-4); min-height: auto; }
    .hero h1 { font-size: 1.5rem; margin-bottom: var(--s-3); }
    .hero-tagline { font-size: 14px; margin-bottom: var(--s-4); }
    .auction-block .countdown { gap: var(--s-1); }
    .countdown-unit { padding: var(--s-2); }
}

/* ====================================================
   26. FOCUS — visible et beau pour clavier
   ==================================================== */
*:focus { outline: none; } /* On gère nous-même */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 27, 75, 0.25);
    border-color: var(--brand);
    border-radius: var(--r);
}

/* ====================================================
   27. MOBILE-DRAWER — animation smooth + width adaptée
   ==================================================== */
@media (max-width: 480px) {
    .mobile-drawer { width: 100%; max-width: none; }
}

/* ====================================================
   28. FORM CHECKBOX/RADIO — alignement clean
   ==================================================== */
.form-check {
    align-items: center;
    line-height: 1.4;
}
.form-check span strong { display: block; }
@media (max-width: 640px) {
    .form-check { padding: var(--s-3) 0; }
}

/* ====================================================
   29. CROSSLINK-CARD — adaptation mobile
   ==================================================== */
@media (max-width: 480px) {
    .crosslink-card {
        padding: var(--s-5) !important;
        gap: var(--s-3) !important;
    }
    .crosslink-card__visual {
        width: 56px !important;
        height: 56px !important;
    }
    .crosslink-card__visual svg {
        width: 28px !important;
        height: 28px !important;
    }
    .crosslink-card__title {
        font-size: 1.125rem !important;
    }
}

/* ====================================================
   30. ALERT — sticky mobile pour ne pas rater
   ==================================================== */
@media (max-width: 640px) {
    .alert, .flash {
        font-size: 14px;
        padding: var(--s-3);
    }
}
/* ===== AD CARDS ===== */
.ad-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all var(--t);
    position: relative;
}
.ad-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
}
.ad-card--house {
    background: linear-gradient(135deg, var(--brand-soft) 0%, var(--accent-soft) 100%);
    border-color: var(--accent);
}
.ad-card--pro {
    border-style: dashed;
}
.ad-card__media {
    aspect-ratio: 16/9;
    background: var(--surface-alt);
    overflow: hidden;
}
.ad-card__media img { width: 100%; height: 100%; object-fit: cover; }
.ad-card__body { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.ad-card__tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    width: max-content;
}
.ad-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
    line-height: 1.3;
}
.ad-card__subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}
.ad-card__body-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}
.ad-card__cta {
    color: var(--brand);
    font-size: 13px;
    font-weight: 600;
    margin-top: auto;
}
 
/* Bande d'encarts intercalée dans une grille */
.ads-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-4);
    margin: var(--s-6) 0;
}
@media (min-width: 640px) { .ads-strip { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .ads-strip { grid-template-columns: repeat(3, 1fr); } }
 
/* ===== SERVICES ===== */
.service-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-5);
    transition: all var(--t);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    height: 100%;
}
.service-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}
.service-card__head {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}
.service-card__icon {
    width: 44px; height: 44px;
    background: var(--brand-soft);
    color: var(--brand);
    border-radius: var(--r);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.service-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
    line-height: 1.3;
}
.service-card__type {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}
.service-card__desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
    flex: 1;
}
.service-card__meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-2);
    padding-top: var(--s-3);
    border-top: 1px solid var(--border);
}
.service-meta__lbl { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.service-meta__val { font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.service-card__warranty {
    font-size: 12px;
    color: var(--success);
    background: var(--success-bg);
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-sm);
    margin: 0;
}
.service-card__actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
 
/* Grille de services */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-4);
}
@media (min-width: 640px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .services-grid { grid-template-columns: repeat(3, 1fr); } }
 
/* Pricing mode badges */
.pricing-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--surface-alt);
    border-radius: var(--r-sm);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}
 
/* Service modalities chips */
.modality-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--brand-soft);
    color: var(--brand);
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 500;
}
 
/* ===== CGU ===== */
.cgu-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}
.cgu-content h2 {
    margin-top: var(--s-8);
    padding-top: var(--s-4);
    border-top: 1px solid var(--border);
    font-size: 1.25rem;
}
.cgu-content h2:first-of-type { border-top: none; padding-top: 0; }
.cgu-content h3 { margin-top: var(--s-5); font-size: 1rem; color: var(--brand); }
.cgu-content p, .cgu-content li { font-size: 14px; color: var(--text-secondary); line-height: 1.65; }
.cgu-content strong { color: var(--text); font-weight: 600; }
.cgu-content ul { padding-left: var(--s-5); }
.cgu-content li { margin-bottom: var(--s-2); }
.cgu-content blockquote {
    border-left: 3px solid var(--accent);
    padding: var(--s-3) var(--s-4);
    background: var(--accent-soft);
    margin: var(--s-4) 0;
    font-size: 14px;
    color: var(--text);
    border-radius: 0 var(--r) var(--r) 0;
}
 
.cgu-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.5);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s-4);
}
.cgu-modal__panel {
    background: var(--surface);
    border-radius: var(--r-lg);
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.cgu-modal__header {
    padding: var(--s-5) var(--s-6);
    border-bottom: 1px solid var(--border);
}
.cgu-modal__body {
    padding: var(--s-5) var(--s-6);
    overflow-y: auto;
    flex: 1;
}
.cgu-modal__footer {
    padding: var(--s-4) var(--s-6);
    border-top: 1px solid var(--border);
    display: flex;
    gap: var(--s-3);
    align-items: center;
    flex-wrap: wrap;
    background: var(--surface-alt);
}

/* ============================================================
   COLLECTIO v2.7 — Pièces détachées
   À AJOUTER À LA FIN de assets/css/style.css
   ============================================================ */

/* Badge "type" sur les item-cards */
.item-kind-badge {
    position: absolute;
    top: var(--s-2);
    right: var(--s-2);
    background: rgba(30, 27, 75, 0.92);
    color: #fafaf9;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border-radius: var(--r-sm);
    backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}
.item-kind-badge--part   { background: rgba(99, 153, 34, 0.92); }
.item-kind-badge--tool   { background: rgba(176, 134, 66, 0.92); }
.item-kind-badge--supply { background: rgba(72, 88, 130, 0.92); }

/* Indication de stock */
.stock-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.stock-indicator__num {
    font-weight: 600;
    color: var(--text);
}
.stock-indicator__num--low  { color: var(--warning); }
.stock-indicator__num--zero { color: var(--danger); }

/* Bloc spécifications pièce */
.part-specs {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-2);
    padding: var(--s-3);
    background: var(--surface-alt);
    border-radius: var(--r);
    margin: var(--s-3) 0;
    font-size: 13px;
}
@media (min-width: 480px) {
    .part-specs { grid-template-columns: repeat(2, 1fr); }
}
.part-spec__lbl {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.part-spec__val {
    font-size: 13px;
    color: var(--text);
    font-family: var(--font-mono);
    word-break: break-word;
}

/* Selector kind sur le formulaire (radio cards) */
.kind-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-2);
    margin-bottom: var(--s-4);
}
@media (min-width: 640px) { .kind-selector { grid-template-columns: repeat(4, 1fr); } }
.kind-card {
    cursor: pointer;
    padding: var(--s-3);
    background: var(--surface);
    border: 2px solid var(--border-strong);
    border-radius: var(--r);
    text-align: center;
    transition: all var(--t-fast);
}
.kind-card:hover { border-color: var(--brand); }
.kind-card input { position: absolute; opacity: 0; pointer-events: none; }
.kind-card.is-checked {
    border-color: var(--brand);
    background: var(--brand-soft);
}
.kind-card__icon { font-size: 24px; display: block; margin-bottom: var(--s-1); }
.kind-card__label { font-size: 13px; font-weight: 600; color: var(--text); }
.kind-card__hint { font-size: 10px; color: var(--text-tertiary); margin-top: 2px; display: block; }

/* Quantity selector (pour acheter plusieurs unités) */
.qty-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-strong);
    border-radius: var(--r);
    overflow: hidden;
}
.qty-selector button {
    width: 40px; height: 40px;
    background: var(--surface);
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text);
    transition: background var(--t-fast);
}
.qty-selector button:hover { background: var(--surface-alt); }
.qty-selector button:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-selector input {
    width: 56px;
    height: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    background: var(--surface);
}
/* ============================================================
   NOTIFICATIONS (v2.10)
   ============================================================ */
.notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text);
    text-decoration: none;
    transition: background var(--t-fast);
}
.notif-bell:hover { background: var(--surface-alt); }
.notif-bell.has-unread { color: var(--accent); }
.notif-bell__badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger, #b94343);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.notif-list {
    list-style: none;
    padding: 0;
    margin: var(--s-4) 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}
.notif-item {
    display: flex;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    align-items: flex-start;
    justify-content: space-between;
}
.notif-item.is-unread {
    border-left: 3px solid var(--accent);
    background: var(--surface-alt);
}
.notif-item__body { flex: 1; min-width: 0; }
.notif-item__title { margin: 0 0 var(--s-1); font-size: 15px; }
.notif-item__title a { color: inherit; text-decoration: none; }
.notif-item__title a:hover { color: var(--accent); }
.notif-item__text { margin: 0 0 var(--s-2); color: var(--text-muted); font-size: 14px; }
.notif-item__meta { font-size: 12px; color: var(--text-muted); }
.notif-item__actions { display: flex; flex-direction: column; gap: var(--s-1); flex-shrink: 0; }
.notif-item .badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

/* ============================================================
   PAYMENT METHODS (checkout v2.12)
   ============================================================ */
.payment-methods {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--s-3);
    margin: var(--s-4) 0;
}
.payment-methods legend {
    padding: 0 var(--s-2);
    font-weight: 600;
    font-size: 14px;
}
.payment-option {
    display: flex;
    gap: var(--s-3);
    align-items: flex-start;
    padding: var(--s-3);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    margin-bottom: var(--s-2);
    cursor: pointer;
    transition: border-color var(--t-fast), background var(--t-fast);
}
.payment-option:hover:not(.is-disabled) { border-color: var(--accent); }
.payment-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--surface-alt);
}
.payment-option.is-disabled { opacity: 0.55; cursor: not-allowed; }
.payment-option input[type="radio"] { margin-top: 4px; }
.payment-option span { flex: 1; line-height: 1.4; }

/* ============================================================
   NOTIFICATION PREFERENCES (v2.12)
   ============================================================ */
.prefs-form { display: flex; flex-direction: column; gap: var(--s-4); }
.prefs-group {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--s-3) var(--s-4);
    background: var(--surface);
}
.prefs-group legend {
    padding: 0 var(--s-2);
    font-weight: 600;
    font-size: 15px;
    color: var(--accent);
}
.prefs-table { width: 100%; border-collapse: collapse; }
.prefs-table th, .prefs-table td {
    padding: var(--s-3) var(--s-2);
    text-align: left;
    border-bottom: 1px solid var(--border-subtle, var(--border));
    vertical-align: middle;
}
.prefs-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.prefs-table tr:last-child td { border-bottom: none; }
.prefs-table .col-toggle { width: 80px; text-align: center; }
.prefs-desc { font-size: 13px; margin-top: 2px; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 12px;
    transition: background var(--t-fast);
}
.switch .slider::before {
    content: '';
    position: absolute;
    height: 18px; width: 18px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--t-fast);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus + .slider { box-shadow: 0 0 0 3px rgba(176,134,66,0.25); }

.prefs-actions { display: flex; gap: var(--s-3); justify-content: flex-start; }

@media (max-width: 640px) {
    .prefs-table .col-toggle { width: 64px; }
    .prefs-desc { display: none; }
}
