/* =============================================================================
   Backpanel dashboard shell — the authenticated workspace for buyers, sellers,
   QC inspectors, support and admins. Shares the storefront's warm plum/orange
   palette + Bricolage/Hanken type, arranged as a professional sidebar console.

   The whole panel lives under `.theme-panel`. Re-mapping the app design tokens
   (--aw-*) at that scope re-skins every existing component (surfaces, buttons,
   tables, page headers, forms) to the storefront look without touching them.
   ============================================================================= */

/* Storefront fonts (self-hosted) so the backpanel matches the website. */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/bricolage/bricolage-grotesque-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/bricolage/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/bricolage/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/hanken/hanken-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/hanken/hanken-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/hanken/hanken-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/hanken/hanken-grotesk-latin-700-normal.woff2") format("woff2"); }

.theme-panel,
.theme-shop {
    /* Storefront palette re-mapped onto the app tokens */
    --aw-primary: #7a2e52;
    --aw-primary-hover: #632442;
    --aw-primary-active: #4a1a31;
    --aw-primary-rgb: 122, 46, 82;
    --aw-primary-soft: #f7e9f0;
    --aw-primary-border: #ecd3df;
    --aw-accent: #f2603c;
    --aw-accent-soft: #fdeae3;
    --aw-ink: #241a20;
    --aw-text: #2b2126;
    --aw-muted: #6b5e64;
    --aw-bg: #faf7f4;
    --aw-surface: #ffffff;
    --aw-border: #eee4e8;
    --aw-border-strong: #e3d6dc;
    --aw-radius: 14px;
    --aw-radius-sm: 9px;
    --aw-shadow-sm: 0 1px 2px rgba(74,26,49,.06);
    --aw-shadow: 0 6px 20px rgba(74,26,49,.08);
    --aw-shadow-lg: 0 20px 48px rgba(74,26,49,.14);

    /* Feed the same values to Bootstrap component variables */
    --bs-primary: #7a2e52;
    --bs-primary-rgb: 122, 46, 82;
    --bs-link-color: #7a2e52;
    /* Bootstrap 5.3's `a` reads the -rgb form, not --bs-link-color. Missing here, links fell back
       to the teal frozen into :root by site.css — masked until now by the blanket rule above. */
    --bs-link-color-rgb: 122, 46, 82;
    --bs-link-hover-color: #632442;
    --bs-border-radius: 14px;

    /* Shell metrics */
    --dash-side-w: 264px;
    --dash-top-h: 64px;
    --dash-brand-1: #4a1a31;
    --dash-brand-2: #7a2e52;

    font-family: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--aw-bg);
    color: var(--aw-text);
    min-height: 100vh;
}

/* NOTE: the .theme-storefront --aw-* remap lives in storefront.css (which loads on
   every storefront page, including the marketing layout that doesn't pull in this
   file), so app-token components never fall back to the old teal. */

.theme-panel h1, .theme-panel h2, .theme-panel h3, .theme-panel h4, .theme-panel .page-title,
.theme-shop h1, .theme-shop h2, .theme-shop h3, .theme-shop h4, .theme-shop .page-title {
    font-family: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
    letter-spacing: -0.02em;
    color: var(--aw-ink);
}

/* ---------- Shell layout ---------------------------------------------------- */
.dash-shell { display: flex; min-height: 100vh; }
/* Never underline the sidebar/topbar chrome (logo, nav links, icon buttons). */
.dash-sidebar a, .dash-sidebar a:hover,
.dash-topbar a, .dash-topbar a:hover { text-decoration: none; }

.dash-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 1045;
    width: var(--dash-side-w);
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, var(--dash-brand-1) 0%, var(--dash-brand-2) 100%);
    color: #fff;
    border-right: 1px solid rgba(0,0,0,.15);
}

.dash-body {
    flex: 1; min-width: 0;
    margin-inline-start: var(--dash-side-w);
    display: flex; flex-direction: column; min-height: 100vh;
}

/* ---------- Sidebar brand + nav -------------------------------------------- */
.dash-brand {
    display: flex; align-items: center; gap: .6rem;
    padding: 1.05rem 1.15rem; text-decoration: none; color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.10);
    flex: 0 0 auto;
}
.dash-brand:hover { color: #fff; }
.dash-brand .bp-logo { font-size: 1.05rem; }
.dash-brand .bp-mark { width: 1.5em; height: 1.5em; }

.dash-nav { flex: 1 1 auto; overflow-y: auto; padding: .75rem .7rem 1.5rem; }
.dash-nav::-webkit-scrollbar { width: 8px; }
.dash-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 8px; }

.dash-nav-label {
    padding: .9rem .7rem .35rem;
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .10em;
    color: rgba(255,255,255,.62);
}
.dash-nav-label:first-child { padding-top: .3rem; }

.dash-link {
    display: flex; align-items: center; gap: .7rem;
    padding: .58rem .7rem; margin-bottom: 2px;
    border-radius: 10px; text-decoration: none;
    color: rgba(255,255,255,.82); font-weight: 600; font-size: .9rem;
    position: relative; transition: background .15s ease, color .15s ease;
}
.dash-link:hover { background: rgba(255,255,255,.10); color: #fff; }
.dash-link.active { background: rgba(255,255,255,.14); color: #fff; }
.dash-link.active::before {
    content: ""; position: absolute; inset-inline-start: -.7rem; top: 50%; transform: translateY(-50%);
    width: 4px; height: 62%; border-radius: 0 4px 4px 0; background: var(--aw-accent);
}
.dash-link svg { width: 19px; height: 19px; flex: 0 0 auto; opacity: .92; }
.dash-link .dash-link-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-link .dash-badge {
    flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 .35rem; border-radius: 999px;
    background: var(--aw-accent); color: #fff; font-size: .7rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
}

.dash-side-foot {
    flex: 0 0 auto; padding: .85rem 1rem; border-top: 1px solid rgba(255,255,255,.10);
    display: flex; align-items: center; gap: .6rem;
}
.dash-side-foot .avatar {
    width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
    display: grid; place-items: center; font-weight: 800; font-size: .85rem;
    background: rgba(255,255,255,.16); color: #fff;
}
.dash-side-foot img.avatar { object-fit: cover; }
.dash-side-foot .who { min-width: 0; line-height: 1.15; }
.dash-side-foot .who .name { font-size: .82rem; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-side-foot .who .role { font-size: .7rem; color: rgba(255,255,255,.6); }

/* ---------- Topbar ---------------------------------------------------------- */
.dash-topbar {
    position: sticky; top: 0; z-index: 1030;
    height: var(--dash-top-h); flex: 0 0 auto;
    display: flex; align-items: center; gap: .5rem;
    padding: 0 1.1rem;
    background: rgba(255,255,255,.88); backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--aw-border);
}
.dash-topbar .topbar-title { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 1.08rem; color: var(--aw-ink); margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-topbar .spacer { flex: 1 1 auto; }

.dash-burger {
    display: none; width: 40px; height: 40px; border: 1px solid var(--aw-border); background: #fff;
    border-radius: 10px; color: var(--aw-ink); align-items: center; justify-content: center; cursor: pointer;
}
.dash-burger svg { width: 20px; height: 20px; }

/* Circular icon actions in the topbar (messages, notifications, cart, wishlist) */
.dash-topbar .icon-action {
    position: relative; width: 40px; height: 40px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--aw-muted); text-decoration: none; border: 1px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.dash-topbar .icon-action:hover { background: var(--aw-primary-soft); color: var(--aw-primary); border-color: var(--aw-primary-border); }
.dash-topbar .icon-action svg { width: 21px; height: 21px; }
.dash-topbar .icon-action .count-badge {
    position: absolute; top: 3px; inset-inline-end: 3px; min-width: 17px; height: 17px; padding: 0 4px;
    background: var(--aw-accent); color: #fff; border-radius: 999px; font-size: .66rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff;
}

.dash-topbar .btn-signout {
    background: transparent; border: 1px solid var(--aw-border-strong); color: var(--aw-text);
    border-radius: 9px; padding: .4rem .8rem; font-weight: 600; font-size: .85rem; cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.dash-topbar .btn-signout:hover { border-color: var(--aw-primary); color: var(--aw-primary); background: var(--aw-primary-soft); }

/* ---------- Content --------------------------------------------------------- */
.dash-content { flex: 1 1 auto; padding: 1.6rem clamp(1rem, 2.5vw, 2rem); width: 100%; max-width: 1320px; margin-inline: auto; }
.dash-foot { flex: 0 0 auto; padding: 1rem 1.5rem; border-top: 1px solid var(--aw-border); color: var(--aw-muted); font-size: .82rem;
    display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; }
.dash-foot a { color: var(--aw-muted); }
.dash-foot a:hover { color: var(--aw-primary); }

/* Mobile overlay for the off-canvas sidebar */
.dash-overlay { display: none; position: fixed; inset: 0; z-index: 1040; background: rgba(36,26,32,.5); }

/* ---------- Dashboard building blocks -------------------------------------- */
/* Greeting banner */
.dash-hero {
    position: relative; overflow: hidden;
    background: linear-gradient(120deg, var(--dash-brand-1) 0%, var(--dash-brand-2) 60%, #93436a 100%);
    color: #fff; border-radius: var(--aw-radius); padding: 1.5rem 1.6rem; margin-bottom: 1.4rem;
    box-shadow: var(--aw-shadow);
}
.dash-hero::after {
    content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(242,96,60,.5), transparent 70%);
}
.dash-hero .hi { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 1.5rem; margin: 0 0 .15rem; color:#fff; letter-spacing:-.02em; }
.dash-hero .sub { color: rgba(255,255,255,.82); margin: 0; font-size: .95rem; position: relative; }
.dash-hero .role-chip {
    display: inline-flex; align-items: center; gap: .35rem; margin-top: .7rem;
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22);
    color: #fff; border-radius: 999px; padding: .25rem .7rem; font-size: .78rem; font-weight: 700;
}

/* Stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stat-tile {
    background: var(--aw-surface); border: 1px solid var(--aw-border); border-radius: var(--aw-radius);
    padding: 1.1rem 1.15rem; box-shadow: var(--aw-shadow-sm); display: flex; flex-direction: column; gap: .3rem;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; text-decoration: none; color: inherit;
}
a.stat-tile:hover { transform: translateY(-3px); box-shadow: var(--aw-shadow); border-color: var(--aw-primary-border); color: inherit; text-decoration: none; }
.stat-tile .st-icon {
    width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; margin-bottom: .35rem;
    background: var(--aw-primary-soft); color: var(--aw-primary);
}
.stat-tile .st-icon.accent { background: var(--aw-accent-soft, #fdeae3); color: var(--aw-accent, #f2603c); }
.stat-tile .st-icon svg { width: 20px; height: 20px; }
.stat-tile .st-num { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 1.7rem; line-height: 1; color: var(--aw-ink); }
.stat-tile .st-label { color: var(--aw-muted); font-size: .82rem; font-weight: 600; }

/* Quick-action cards */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.quick-card {
    display: flex; align-items: flex-start; gap: .85rem; padding: 1.05rem 1.1rem;
    background: var(--aw-surface); border: 1px solid var(--aw-border); border-radius: var(--aw-radius);
    box-shadow: var(--aw-shadow-sm); text-decoration: none; color: inherit;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--aw-shadow); border-color: var(--aw-primary-border); color: inherit; text-decoration: none; }
.quick-card .qc-icon { width: 42px; height: 42px; border-radius: 11px; flex: 0 0 auto; display: grid; place-items: center; background: var(--aw-primary-soft); color: var(--aw-primary); }
.quick-card .qc-icon svg { width: 22px; height: 22px; }
.quick-card > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.quick-card .qc-title { display: block; font-weight: 700; color: var(--aw-ink); margin: 0 0 .12rem; font-size: .98rem; }
.quick-card .qc-desc { display: block; color: var(--aw-muted); font-size: .84rem; margin: 0; line-height: 1.35; }
.dash-section-title { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 1.05rem; color: var(--aw-ink); margin: 1.6rem 0 .8rem; }

/* ---------- Component polish inside the panel ------------------------------- */
.theme-panel .surface, .theme-panel .card,
.theme-shop .surface, .theme-shop .card { border-radius: var(--aw-radius); border-color: var(--aw-border); box-shadow: var(--aw-shadow-sm); }
.theme-panel .btn-primary, .theme-shop .btn-primary { --bs-btn-bg: var(--aw-primary); --bs-btn-border-color: var(--aw-primary);
    --bs-btn-hover-bg: var(--aw-primary-hover); --bs-btn-hover-border-color: var(--aw-primary-hover);
    --bs-btn-active-bg: var(--aw-primary-active); --bs-btn-active-border-color: var(--aw-primary-active); font-weight: 700; }
.theme-panel .text-primary, .theme-shop .text-primary { color: var(--aw-primary) !important; }
/* Content links (never the sidebar/topbar, which set their own colours).
   Wrapped in :where() so the whole selector weighs (0,0,1) — the same as a bare `a`, which it
   still beats on load order, so prose links are brand-coloured as intended. Written the obvious
   way this was (0,5,1) and quietly outranked every anchor-shaped COMPONENT's own colour: a
   selected .aw-chip kept its near-black fill but took this maroon for its text (1.9:1, unreadable),
   the chip hover states never fired at all, and a chat attachment chip on your own bubble came out
   at 1.6:1. A blanket rule must never be able to win against a component that names itself. */
:where(.theme-panel .dash-content, .theme-shop main) a:where(:not(.btn, .dash-link, .icon-action, .nav-link)) { color: var(--aw-primary); }

/* Warm the shared app header on shop/storefront pages so it matches the brand
   (the base .app-navbar is a hardcoded cool slate). */
.theme-shop .app-navbar { background-color: rgba(58, 20, 40, .94); border-bottom-color: rgba(255,255,255,.10); }

/* ---------- Responsive ------------------------------------------------------ */
@media (max-width: 991.98px) {
    .dash-body { margin-inline-start: 0; }
    .dash-sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--aw-shadow-lg); }
    html[dir="rtl"] .dash-sidebar { transform: translateX(100%); }
    .dash-shell.nav-open .dash-sidebar { transform: translateX(0); }
    .dash-shell.nav-open .dash-overlay { display: block; }
    .dash-burger { display: inline-flex; }
}

@media (max-width: 575.98px) {
    .dash-content { padding: 1.1rem .9rem; }
    .dash-topbar { padding: 0 .6rem; gap: .3rem; }
    .dash-topbar .topbar-title { font-size: .98rem; }
    /* Hide anything flagged xs-only (e.g. the redundant "Visit store" icon — it's in the profile menu). */
    .dash-topbar .hide-xs { display: none; }
}

/* ==========================================================================
   Create-listing wizard (Listings/Create)
   Four steps live on one page and only the active .lw-step is shown, so media
   uploads started on step 2 keep running while the seller fills in steps 3–4.
   ========================================================================== */
.lw { max-width: 780px; margin: 0 auto; padding-bottom: 5rem; }

.lw-head { display: flex; align-items: center; gap: .85rem; padding: .5rem 0 1.1rem; border-bottom: 1px solid var(--bs-border-color); margin-bottom: 1.5rem; }
.lw-close { font-size: 1.25rem; line-height: 1; color: var(--bs-body-color); text-decoration: none; padding: .2rem .35rem; }
.lw-close:hover { opacity: .7; }
.lw-title { font-weight: 600; }
.lw-dots { display: flex; align-items: center; list-style: none; margin: 0 0 0 auto; padding: 0; }
.lw-dots li { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--bs-border-color); position: relative; }
.lw-dots li + li { margin-inline-start: 30px; }
.lw-dots li + li::before { content: ""; position: absolute; inset-inline-end: 100%; top: 50%; width: 30px; height: 2px; background: var(--bs-border-color); transform: translateY(-50%); }
.lw-dots li.is-active { background: var(--aw-primary); border-color: var(--aw-primary); }

.lw-step { display: none; }
.lw-step.is-active { display: block; animation: lw-fade .18s ease-out; }
@keyframes lw-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lw-step.is-active { animation: none; } }

/* Unrolled variant (Listings/Edit).
   Editing is not a walkthrough — the seller came to change one thing and needs to find it, so
   every section is on screen at once, separated by a rule instead of hidden behind Next. */
.lw--all .lw-step { display: block; }
.lw--all .lw-step + .lw-step { margin-top: 2.2rem; padding-top: 2.2rem; border-top: 1px solid var(--bs-border-color); }
.lw--all .lw-h1 { font-size: 1.25rem; }

.lw-h1 { font-size: 1.6rem; font-weight: 700; margin: 0 0 .35rem; }
.lw-sub { color: var(--bs-secondary-color); margin-bottom: 1.4rem; }
.lw-field { margin-bottom: 1rem; }
.lw-input { min-height: 56px; border-radius: 10px; }
textarea.lw-input { min-height: 120px; }
.lw-hint { color: var(--bs-secondary-color); font-size: .82rem; margin-top: .45rem; }

/* Choice cards: listing type, gender, grade */
.lw-typegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.lw-typecard { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; text-align: start;
    padding: 1.4rem; border: 1.5px solid var(--bs-border-color); border-radius: 12px; background: var(--bs-body-bg); cursor: pointer; }
.lw-typecard:hover { border-color: var(--aw-primary, #0d6efd); }
.lw-typecard.is-selected { border-color: var(--aw-primary, #0d6efd); border-width: 2px; box-shadow: 0 0 0 3px rgba(var(--aw-primary-rgb), .12); }
.lw-typecard-icon svg { width: 26px; height: 26px; }
.lw-typecard-name { font-weight: 700; font-size: 1.05rem; }
.lw-typecard-desc { color: var(--bs-secondary-color); font-size: .86rem; }

.lw-gendergrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin-bottom: 1rem; }
.lw-gendercard { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1rem .5rem;
    border: 1.5px solid var(--bs-border-color); border-radius: 10px; background: var(--bs-body-bg); cursor: pointer; }
.lw-gendercard:hover { border-color: var(--aw-primary, #0d6efd); }
.lw-gendercard.is-selected { border-color: var(--aw-primary, #0d6efd); border-width: 2px; }
.lw-gendercard-icon { font-size: 1.6rem; line-height: 1; }
.lw-gendercard-name { font-size: .9rem; font-weight: 600; }
@media (max-width: 520px) { .lw-gendergrid { grid-template-columns: repeat(2, 1fr); } }

.lw-box { border: 1px solid var(--bs-border-color); border-radius: 12px; padding: 1.1rem; margin-bottom: 1rem; }
.lw-box-title { font-weight: 600; margin-bottom: .8rem; }
.lw-gradegrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.lw-gradecard { display: flex; align-items: center; gap: .5rem; padding: .8rem 1rem;
    border: 1px solid var(--bs-border-color); border-radius: 10px; background: var(--bs-body-bg); cursor: pointer; }
.lw-gradecard:hover { border-color: var(--aw-primary, #0d6efd); }
.lw-gradecard.is-selected { border-color: var(--aw-primary, #0d6efd); border-width: 2px; }
.lw-gradecard-name { font-weight: 600; font-size: .93rem; }
.lw-stars { color: var(--aw-accent, #f2603c); letter-spacing: -1px; }
.lw-stars-off { color: var(--bs-border-color); }
@media (max-width: 520px) { .lw-gradegrid { grid-template-columns: 1fr; } }

/* Media step */
.lw-drop { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 2.2rem 1rem;
    border: 2px dashed var(--bs-border-color); border-radius: 12px; cursor: pointer; text-align: center; }
.lw-drop:hover, .lw-drop.is-over { border-color: var(--aw-primary, #0d6efd); background: rgba(var(--aw-primary-rgb), .04); }
.lw-drop-icon { font-size: 1.8rem; line-height: 1; color: var(--bs-secondary-color); }
.lw-drop-main { font-weight: 600; }
.lw-drop-sub { color: var(--bs-secondary-color); font-size: .82rem; }

.lw-videoflag { margin: .9rem 0; }
.lw-videoflag-pill { display: inline-block; padding: .25rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 700;
    background: rgba(220,53,69,.12); color: #b02a37; }
.lw-videoflag-pill.is-ok { background: rgba(25,135,84,.13); color: #157347; }

.lw-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .7rem; margin-top: .5rem; }
.lw-tile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--bs-border-color); background: var(--bs-tertiary-bg); }
.lw-tile-media { width: 100%; height: 100%; object-fit: cover; display: block; }
.lw-tile-badge { position: absolute; inset-inline-start: 0; inset-block-end: 0; max-width: 100%; padding: .15rem .4rem;
    background: rgba(0,0,0,.65); color: #fff; font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lw-tile-x { position: absolute; top: 4px; inset-inline-end: 4px; width: 24px; height: 24px; border: 0; border-radius: 50%;
    background: rgba(0,0,0,.6); color: #fff; font-size: .75rem; line-height: 1; cursor: pointer; }
.lw-tile-x:hover { background: rgba(0,0,0,.85); }

/* Upload progress ring — --pct carries the live percentage from the uploader. */
.lw-tile.is-uploading { display: flex; align-items: center; justify-content: center; }
.lw-tile-progress { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .4rem; width: 100%; }
.lw-ring { --pct: 0; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(var(--aw-primary, #0d6efd) calc(var(--pct) * 1%), var(--bs-border-color) 0); }
.lw-ring span { width: 42px; height: 42px; border-radius: 50%; background: var(--bs-body-bg);
    display: grid; place-items: center; font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.lw-tile-name { font-size: .68rem; color: var(--bs-secondary-color); max-width: 100%; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lw-tile-fail { font-size: .68rem; color: #b02a37; font-weight: 600; }

/* Inventory / pricing rows */
.lw-inline { display: flex; align-items: stretch; }
.lw-inline .lw-input { border-start-end-radius: 0; border-end-end-radius: 0; }
.lw-suffix { display: flex; align-items: center; padding: 0 1rem; border: 1px solid var(--bs-border-color); border-inline-start: 0;
    border-start-end-radius: 10px; border-end-end-radius: 10px; background: var(--bs-tertiary-bg); font-weight: 600; white-space: nowrap; }

/* Sticky footer nav */
.lw-foot { position: sticky; bottom: 0; display: flex; gap: .8rem; padding: 1rem 0; margin-top: 1.8rem;
    background: var(--bs-body-bg); border-top: 1px solid var(--bs-border-color); }
.lw-back { width: 74px; min-height: 56px; border: 1.5px solid var(--bs-body-color); border-radius: 10px;
    background: transparent; color: var(--bs-body-color); font-size: 1.1rem; cursor: pointer; }
.lw-back:disabled { opacity: .35; cursor: default; }
.lw-next { flex: 1; min-height: 56px; border: 0; border-radius: 10px; background: var(--aw-primary, #0d6efd); color: #fff;
    font-weight: 700; cursor: pointer; }
.lw-next:hover { filter: brightness(.94); }
/* Edit's Cancel: an anchor, so it needs the button's box drawn by hand. */
.lw-back-link { display: inline-flex; align-items: center; justify-content: center; padding: 0 1.6rem; min-height: 56px;
    border: 1.5px solid var(--bs-border-color); border-radius: 10px; font-weight: 600; text-decoration: none; }

/* Cover marker + hover action on a media tile (shared by the wizard and the media page) */
.lw-tile.is-cover { outline: 2px solid var(--aw-primary, #0d6efd); outline-offset: -2px; }
.lw-tile-cover { position: absolute; top: 4px; inset-inline-start: 4px; padding: .1rem .4rem; border-radius: 5px;
    background: var(--aw-primary, #0d6efd); color: #fff; font-size: .65rem; font-weight: 700; }
.lw-tile-setcover { position: absolute; inset-inline: 4px; bottom: 4px; padding: .25rem; border: 0; border-radius: 6px;
    background: rgba(0,0,0,.72); color: #fff; font-size: .68rem; font-weight: 600; cursor: pointer; opacity: 0; transition: opacity .12s; }
.lw-tile:hover .lw-tile-setcover, .lw-tile-setcover:focus-visible { opacity: 1; }
.lw-tile.is-failed { outline: 2px solid #dc3545; outline-offset: -2px; }

/* ==========================================================================
   Listing media screen (Listings/Media) — add photos + the required video
   ========================================================================== */
.lm { max-width: 1100px; margin: 0 auto; }
.lm-head { display: flex; align-items: center; gap: 1rem; padding-bottom: 1rem; margin-bottom: 1.4rem; border-bottom: 1px solid var(--bs-border-color); }
.lm-close { font-size: 1.2rem; line-height: 1; text-decoration: none; color: var(--bs-body-color); padding: .2rem .4rem; }
.lm-close:hover { opacity: .7; }
.lm-headtext { margin-inline-end: auto; }
.lm-title { font-size: 1.35rem; font-weight: 700; margin: 0; }
.lm-sub { color: var(--bs-secondary-color); margin: 0; font-size: .9rem; }

.lm-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .lm-grid { grid-template-columns: 1fr; } }

.lm-card { border: 1px solid var(--bs-border-color); border-radius: 12px; padding: 1.1rem; margin-bottom: 1rem; background: var(--bs-body-bg); }
.lm-card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.lm-card-title { font-size: 1rem; font-weight: 700; margin: 0; }
.lm-card-hint { color: var(--bs-secondary-color); font-size: .84rem; margin: .3rem 0 .9rem; }
.lm-count { font-size: .8rem; font-weight: 700; color: var(--bs-secondary-color); font-variant-numeric: tabular-nums; }
.lm-req { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #b02a37;
    background: rgba(220,53,69,.12); padding: .1rem .4rem; border-radius: 4px; vertical-align: middle; }
.lm-opt { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color); }

.lm-drop { display: flex; flex-direction: column; align-items: center; gap: .25rem; width: 100%; padding: 1.8rem 1rem;
    border: 2px dashed var(--bs-border-color); border-radius: 10px; cursor: pointer; text-align: center; }
.lm-drop:hover, .lm-drop.is-over { border-color: var(--aw-primary, #0d6efd); background: rgba(var(--aw-primary-rgb), .04); }
.lm-drop--video:hover, .lm-drop--video.is-over { border-color: #d24e2a; background: rgba(210,78,42,.05); }
.lm-drop-icon { font-size: 1.7rem; line-height: 1; }
.lm-drop-main { font-weight: 600; }
.lm-drop-sub { color: var(--bs-secondary-color); font-size: .8rem; }
.lm-error { font-size: .85rem; margin: .5rem 0; }

.lm-side .lm-card { position: sticky; top: 1rem; }
.lm-side .lm-tips { position: static; }
.lm-checks { list-style: none; margin: 0; padding: 0; }
.lm-checks li { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; font-size: .88rem; color: var(--bs-secondary-color); }
/* Empty ring until the item is done, then a filled circle with a real tick inside. */
.lm-check-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--bs-border-color);
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; }
.lm-check-dot svg { width: 11px; height: 11px; stroke: #fff; stroke-width: 3.5; display: none; }
.lm-checks li.is-done { color: var(--bs-body-color); font-weight: 600; }
.lm-checks li.is-done .lm-check-dot { background: #157347; border-color: #157347; }
.lm-checks li.is-done .lm-check-dot svg { display: block; }
.lm-progressnote { display: flex; align-items: center; gap: .5rem; margin-top: .8rem; font-size: .82rem; color: var(--bs-secondary-color); }
.lm-tips ul { padding-inline-start: 1.1rem; font-size: .84rem; color: var(--bs-secondary-color); }
.lm-tips li + li { margin-top: .3rem; }

/* Category glyph in admin tables and inline labels. Sized to the text it sits beside and
   inheriting its colour, so it reads as part of the label rather than as a separate control. */
.cat-glyph-inline,
.dash-content td > .cat-glyph {
    width: 1.05em; height: 1.05em; vertical-align: -.18em;
    margin-inline-end: .4rem; opacity: .75; flex: none;
}
