html, body {
    margin: 0;
    padding: 0;
    background-color: #0B0B0D;
    color: #E6E1D3;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    /* Faint procedural noise overlay — kept low contrast for the dark forge feel. */
    background-image:
        radial-gradient(1200px 600px at 10% -10%, rgba(201, 162, 75, 0.08), transparent 60%),
        radial-gradient(900px 500px at 100% 0%, rgba(109, 143, 176, 0.05), transparent 70%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9 0 0 0 0 0.85 0 0 0 0 0.7 0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    background-attachment: fixed;
}

a { color: #C9A24B; text-decoration: none; }
a:hover { color: #E6C878; text-decoration: underline; text-decoration-thickness: 1px; }

/* Routes.razor uses <FocusOnNavigate Selector="h1"> to programmatically
   focus the first <h1> after every navigation so screen-reader users
   hear the page title. The element is set tabindex="-1" by Blazor so
   it's not in the keyboard tab order — suppressing the default focus
   ring kills no a11y but removes the white border that visually
   "selects" the hero headline for mouse / touch users. */
h1:focus { outline: none; }

.l2-tabular { font-variant-numeric: tabular-nums; }

/* Soft top-border accent for hero/section panels. */
.l2-gold-top {
    box-shadow: inset 0 1px 0 0 rgba(201, 162, 75, 0.45);
}

/* Item slot framing — 40x40 tile housing the 32x32 PNG icon. */
.l2-item-slot {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0F0F12;
    border: 1px solid #2A2A30;
    box-shadow: inset 0 0 0 1px rgba(201, 162, 75, 0.18);
    border-radius: 4px;
    flex-shrink: 0;
}
.l2-item-slot img { width: 32px; height: 32px; }
/* Pixelated rendering only at the native 32px Small slot — that's the
   authentic inventory-tile look. Medium/Large pull pre-upscaled @2x/@3x
   variants via srcset (see ItemSlot.razor + IconVariantMiddleware), so
   they should render with the browser's smoothing pipeline, not nearest-
   neighbor scaling. */
.l2-item-slot:not(.l2-item-slot--md):not(.l2-item-slot--lg) img {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Sized variants — Medium/Large rely on @2x / @3x srcset variants, not
   pixelated upscaling of the 32px source. */
.l2-item-slot--md { width: 56px; height: 56px; border-radius: 6px; }
.l2-item-slot--md img { width: 48px; height: 48px; }

.l2-item-slot--lg {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(201, 162, 75, 0.28), 0 4px 16px rgba(0, 0, 0, 0.55);
    position: relative;
}
.l2-item-slot--lg img { width: 64px; height: 64px; }

/* Decorative inventory-tile corners on the large slot — pure CSS, no assets. */
.l2-item-slot--lg::before,
.l2-item-slot--lg::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    border: 1px solid rgba(201, 162, 75, 0.55);
    pointer-events: none;
}
.l2-item-slot--lg::before { top: 3px; left: 3px; border-right: 0; border-bottom: 0; }
.l2-item-slot--lg::after { bottom: 3px; right: 3px; border-left: 0; border-top: 0; }

/* Grade-tinted frames. NG (no Grade param) keeps the neutral default frame.
   D=blue, C=green, B=red-brown, A=warm off-white, S=burnished gold. */
.l2-item-slot--grade-d { border-color: #4A86C9; box-shadow: inset 0 0 0 1px rgba(74, 134, 201, 0.35), 0 0 12px rgba(74, 134, 201, 0.20); }
.l2-item-slot--grade-c { border-color: #4FAE6A; box-shadow: inset 0 0 0 1px rgba(79, 174, 106, 0.35), 0 0 14px rgba(79, 174, 106, 0.22); }
.l2-item-slot--grade-b { border-color: #8E5A33; box-shadow: inset 0 0 0 1px rgba(142, 90, 51, 0.40), 0 0 14px rgba(142, 90, 51, 0.26); }
.l2-item-slot--grade-a { border-color: #D9D6CE; box-shadow: inset 0 0 0 1px rgba(217, 214, 206, 0.45), 0 0 16px rgba(217, 214, 206, 0.30); }
.l2-item-slot--grade-s { border-color: #C9A24B; box-shadow: inset 0 0 0 1px rgba(201, 162, 75, 0.55), 0 0 18px rgba(201, 162, 75, 0.35); }

/* Strengthen the large slot's grade glow further. */
.l2-item-slot--lg.l2-item-slot--grade-a { box-shadow: inset 0 0 0 1px rgba(217, 214, 206, 0.55), 0 0 22px rgba(217, 214, 206, 0.42), 0 4px 16px rgba(0, 0, 0, 0.55); }
.l2-item-slot--lg.l2-item-slot--grade-s { box-shadow: inset 0 0 0 1px rgba(201, 162, 75, 0.65), 0 0 26px rgba(201, 162, 75, 0.5), 0 4px 16px rgba(0, 0, 0, 0.55); }

/* Card hover affordance per design.md */
.l2-card-hover {
    transition: background-color 160ms ease-out, box-shadow 160ms ease-out, transform 160ms ease-out;
}
.l2-card-hover:hover {
    background-color: #1A1A20;
    box-shadow: inset 3px 0 0 0 #C9A24B, 0 0 0 1px #2A2A30;
}

/* Home market search — Option B "hero-cohesive panel".
   Outer panel mirrors the hero's radial-gold gradient + gold-tinted
   top border so the band reads as part of the same marketplace
   identity. Inside: the integrated pill (input + button flush) +
   a row of "Popular" canned-search chips (per ux-conversion — each
   chip is a one-click pivot into populated results, killing the
   blank-canvas friction of an empty home search). */
.l2-search-panel {
    max-width: 880px;
    padding: 20px 24px 22px;
    background:
        radial-gradient(560px 220px at 12% 0%, rgba(201, 162, 75, 0.10), transparent 70%),
        linear-gradient(180deg, #14110B 0%, #0F0F12 100%);
    border: 1px solid #2A2A30;
    border-radius: 10px;
    box-shadow: inset 0 1px 0 0 rgba(201, 162, 75, 0.45);
}

.l2-search-pill {
    display: flex;
    align-items: stretch;
    background-color: #14110B;
    border: 1px solid #2A2A30;
    border-radius: 8px;
    transition: box-shadow 160ms ease-out, border-color 160ms ease-out;
}
.l2-search-pill:focus-within {
    border-color: rgba(201, 162, 75, 0.6);
    box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.15);
}
/* Input fills the pill; flatten its right edge + hide its right border so
   it docks flush with the button. Strip the input's own outline so the
   pill itself owns the framing. */
.l2-search-pill__input {
    flex: 1 1 auto;
    margin: 0;
}
.l2-search-pill__input .mud-input-outlined .mud-input-outlined-border {
    border: 0;
}
.l2-search-pill__input .mud-input.mud-input-outlined {
    border-radius: 7px 0 0 7px;
}
.l2-search-pill__button {
    border-radius: 0 7px 7px 0 !important;
    min-width: 140px;
    height: auto;
    align-self: stretch;
}

/* Popular-search chip row — sits below the pill inside the panel. */
.l2-search-popular {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}
.l2-search-popular__label {
    color: #A8A395;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-right: 4px;
}
.l2-search-popular__chip {
    appearance: none;
    cursor: pointer;
    background-color: rgba(201, 162, 75, 0.06);
    color: #E6E1D3;
    border: 1px solid #2A2A30;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.78rem;
    line-height: 1.4;
    transition: background-color 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out;
}
.l2-search-popular__chip:hover {
    background-color: rgba(201, 162, 75, 0.16);
    border-color: rgba(201, 162, 75, 0.45);
    color: #F5EFD7;
}
.l2-search-popular__chip:focus-visible {
    outline: 2px solid rgba(201, 162, 75, 0.55);
    outline-offset: 2px;
}

/* Hero gradient surface */
.l2-hero {
    background:
        radial-gradient(800px 400px at 8% 0%, rgba(201, 162, 75, 0.20), transparent 65%),
        radial-gradient(900px 500px at 100% 100%, rgba(109, 143, 176, 0.10), transparent 70%),
        linear-gradient(180deg, #14110B 0%, #0F0F12 100%);
    border: 1px solid #2A2A30;
    box-shadow: inset 0 1px 0 0 rgba(201, 162, 75, 0.55);
    border-radius: 8px;
}

/* Hero with AI-generated background art layered behind the gradient.
   The bitmap is rendered as a <picture> element inside the hero (so the
   browser can pick AVIF/WebP and the right resolution, and so the
   <link rel="preload" as="image"> in App.razor can match the element
   exactly — Lighthouse's "LCP request discovery" requires that). The
   gradients live as overlays via ::before / ::after stacked above the
   <picture> but below the content. */
.l2-hero-image {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background-color: #0F0F12;
    /* Gold top accent. Was originally `box-shadow: inset 0 1px 0` but that
       paints with the parent background, which sits BELOW absolutely-
       positioned children in the stacking context — so the <picture> at
       z-index: -2 hid it. Border-top paints outside the padding box that
       `inset: 0` children are clipped to, so it stays visible. */
    border-top: 1px solid rgba(201, 162, 75, 0.55);
    box-shadow: none;
}

.l2-hero-image > picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.l2-hero-image .l2-hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center right;
    display: block;
}

.l2-hero-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(11, 11, 13, 0.92) 0%, rgba(11, 11, 13, 0.65) 45%, rgba(11, 11, 13, 0.35) 100%),
        linear-gradient(180deg, rgba(20, 17, 11, 0.55) 0%, rgba(15, 15, 18, 0.85) 100%);
    pointer-events: none;
    z-index: -1;
}

.l2-hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(600px 320px at 8% 0%, rgba(201, 162, 75, 0.18), transparent 65%);
    pointer-events: none;
    z-index: -1;
}

/* Trust band — heraldic emblem tiles above the footer. */
.l2-trust-emblem {
    width: 96px;
    height: 96px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(201, 162, 75, 0.35);
    box-shadow: inset 0 0 0 1px rgba(201, 162, 75, 0.18), 0 6px 20px rgba(0, 0, 0, 0.45);
    background: #0F0F12;
}

/* Empty-state illustration framing. */
.l2-empty-illustration {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 6px;
    border: 1px solid #2A2A30;
    box-shadow: inset 0 1px 0 0 rgba(201, 162, 75, 0.25);
    opacity: 0.85;
}

#blazor-error-ui {
    background: #B4413A;
    color: #fff;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.6);
    display: none;
    left: 0;
    padding: 0.6rem 1rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ── Reconnect modal (dark fantasy theme) ─────────────────────────────── */
dialog#components-reconnect-modal {
    margin: auto;
    padding: 0;
    border: 1px solid rgba(201, 162, 75, 0.45);
    border-radius: 8px;
    background: linear-gradient(180deg, #14110B 0%, #0F0F12 100%);
    color: #E6E1D3;
    box-shadow:
        inset 0 1px 0 0 rgba(201, 162, 75, 0.55),
        0 20px 60px rgba(0, 0, 0, 0.75);
    max-width: 420px;
    width: calc(100% - 32px);
    font-family: 'Inter', system-ui, sans-serif;
}
dialog#components-reconnect-modal::backdrop {
    background: rgba(5, 5, 8, 0.78);
    backdrop-filter: blur(2px);
}
dialog#components-reconnect-modal .components-reconnect-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 28px;
    text-align: center;
}
dialog#components-reconnect-modal p {
    margin: 0;
    font-size: 0.95rem;
    color: #E6E1D3;
    letter-spacing: 0.01em;
}
dialog#components-reconnect-modal p.components-reconnect-repeated-attempt-visible,
dialog#components-reconnect-modal p.components-reconnect-failed-visible,
dialog#components-reconnect-modal p.components-resume-failed-visible {
    color: #9A9386;
    font-size: 0.85rem;
}
dialog#components-reconnect-modal #components-seconds-to-next-attempt {
    color: #C9A24B;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
dialog#components-reconnect-modal button {
    margin-top: 8px;
    padding: 8px 20px;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: #0B0B0D;
    background: linear-gradient(180deg, #D6B25A 0%, #C9A24B 100%);
    border: 1px solid rgba(201, 162, 75, 0.7);
    border-radius: 4px;
    cursor: pointer;
    transition: filter 160ms ease-out, transform 160ms ease-out;
}
dialog#components-reconnect-modal button:hover { filter: brightness(1.1); }
dialog#components-reconnect-modal button:active { transform: translateY(1px); }

/* Spinner — gold ring on charcoal */
dialog#components-reconnect-modal .components-rejoining-animation {
    position: relative;
    width: 56px;
    height: 56px;
}
dialog#components-reconnect-modal .components-rejoining-animation div {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #C9A24B;
    border-right-color: rgba(201, 162, 75, 0.35);
    animation: l2-reconnect-spin 1.1s linear infinite;
}
dialog#components-reconnect-modal .components-rejoining-animation div:nth-child(2) {
    inset: 8px;
    border-top-color: rgba(230, 200, 120, 0.55);
    border-right-color: transparent;
    animation-duration: 1.6s;
    animation-direction: reverse;
}
@keyframes l2-reconnect-spin {
    to { transform: rotate(360deg); }
}


/* ══════════════════════════════════════════════════════════════════════
   Create Listing modal — upload dropzone, preview frame, provenance
   chips, review layout. All colors referenced here mirror tokens in
   L2MarketTheme (no inline hex in the Blazor files).
   ══════════════════════════════════════════════════════════════════════ */

/* Drop zone (Upload pane) */
.l2-dropzone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 260px;
    padding: 32px 20px;
    border: 1.5px dashed rgba(201, 162, 75, 0.55);
    background-color: #141418;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 160ms ease-out, background-color 160ms ease-out, transform 160ms ease-out;
    overflow: hidden;
    isolation: isolate;
}
.l2-dropzone:hover,
.l2-dropzone:focus-visible {
    border-color: rgba(201, 162, 75, 0.9);
    outline: none;
}
.l2-dropzone--over {
    border-style: solid;
    border-color: #C9A24B;
    background-color: rgba(201, 162, 75, 0.08);
    transform: scale(1.005);
}

.l2-dropzone__ghost {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 36px;
    z-index: 0;
    pointer-events: none;
    opacity: 0.06;
    filter: grayscale(0.3);
}
.l2-dropzone__ghost img {
    width: 88px;
    height: 88px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.l2-dropzone__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.l2-dropzone__divider {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 220px;
    margin: 16px 0 14px 0;
    color: #5A564E;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}
.l2-dropzone__divider span {
    flex: 1;
    height: 1px;
    background-color: #2A2A30;
}
.l2-dropzone__divider em {
    font-style: normal;
    color: #9A9488;
}

/* Preview frame (Analyzing + Review panes) — reuses the item-slot look
   at screenshot scale. */
.l2-upload-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: #0F0F12;
    border: 1px solid #2A2A30;
    border-radius: 8px;
    max-width: 100%;
}
.l2-upload-preview img {
    display: block;
    max-width: 100%;
    max-height: 360px;
    width: auto;
    height: auto;
    border-radius: 4px;
}

/* Review pane layout — flex column so the sticky footer docks at the
   bottom of the dialog body. */
.l2-review-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.l2-review-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 0 4px 0;
    margin-top: 18px;
    background-color: #141418;
    border-top: 1px solid #2A2A30;
    z-index: 2;
}

/* Form field wrapper with inline header (label + provenance chip).
   Fixed min-height + nowrap keeps every field row's input baseline
   aligned regardless of label length or chip presence. */
.l2-field {
    display: block;
    min-width: 0;
}
.l2-field__header {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 4px;
    min-height: 24px;
}
.l2-field__header label {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9A9488;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.l2-price-hint {
    font-size: 0.78rem;
    color: #C9A24B;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* Tappable variant of the price hint — used by PriceGuidanceChip. Inherits
   the base hint styling and adds button affordances (reset, focus ring,
   inline gap, pointer). Color shifts subtly on hover to telegraph that
   the whole element is a click target — the range and median stay in
   the primary gold; only the "Tap to use" action brightens. */
.l2-price-hint--tappable {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
    border-radius: 4px;
}
.l2-price-hint--tappable:hover {
    background-color: rgba(201, 162, 75, 0.08);
}
.l2-price-hint--tappable:focus-visible {
    outline: 2px solid #C9A24B;
    outline-offset: 2px;
}
.l2-price-hint__label {
    color: #9A9488;
    text-transform: uppercase;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
}
.l2-price-hint__sep {
    color: #555049;
}
.l2-price-hint__action {
    color: #9A9488;
    text-decoration: underline;
    text-decoration-color: rgba(154, 148, 136, 0.4);
    text-underline-offset: 2px;
}
.l2-price-hint--tappable:hover .l2-price-hint__action {
    color: #C9A24B;
    text-decoration-color: #C9A24B;
}

/* Provenance chips — "Auto" / "Check" / "Edited". Text label included
   alongside color so color is never the only signal (a11y). */
.l2-provenance-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1.4;
    border: 1px solid transparent;
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
    margin-left: auto;
}
.l2-provenance-chip--auto {
    background-color: rgba(140, 110, 46, 0.28);
    color: #E6C878;
    border-color: rgba(201, 162, 75, 0.35);
}
.l2-provenance-chip--check {
    background-color: rgba(217, 154, 58, 0.08);
    color: #D99A3A;
    border-color: rgba(217, 154, 58, 0.55);
    animation: l2-check-pulse 2.2s ease-in-out infinite;
}
.l2-provenance-chip--edited {
    background-color: transparent;
    color: #9A9488;
    border-color: #2A2A30;
}
@keyframes l2-check-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217, 154, 58, 0.0); }
    50%      { box-shadow: 0 0 0 4px rgba(217, 154, 58, 0.18); }
}

/* Mobile FAB anchor — position-fixed so it floats above content. */
.l2-fab-anchor {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1200;
}

/* Dialog body scroll container. MudDialog already handles basic overflow
   but we want the review pane's sticky footer to feel anchored. */
.l2-dialog-body {
    display: flex;
    flex-direction: column;
    min-height: 360px;
}

/* Respect reduced motion preferences for the low-confidence pulse and
   the dropzone scale affordance. */
@media (prefers-reduced-motion: reduce) {
    .l2-provenance-chip--check { animation: none; }
    .l2-dropzone,
    .l2-dropzone--over { transition: none; transform: none; }
}


/* ══════════════════════════════════════════════════════════════════════
   Sign-in stage — pure CSS dark-fantasy backdrop. No raster image so
   the composition stays crisp at any resolution. Layers (back → front):
     1. Base: deep charcoal radial.
     2. Warm gold "sconce" glow — top-center, simulating forge-light
        catching the sign-in card from above.
     3. Cool steel wash — bottom corners, for depth.
     4. Edge vignette — darkens corners so the centered card is the
        brightest thing on screen.
     5. Faint gold top-accent line echoing the hero banner.
   ══════════════════════════════════════════════════════════════════════ */

.l2-signin-stage {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: calc(100vh - 128px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 16px;
    background-color: #0B0B0D;
    box-shadow: inset 0 1px 0 0 rgba(201, 162, 75, 0.35);
}

/* Painted cathedral backdrop — isolated on its own layer so we can
   apply a very light softening filter without touching the crisp
   gradient stack above. Source is 1536×896 native (no upscaling at
   2K), so blur is intentionally minimal — just enough to integrate
   the image with the vignette and overlays. */
.l2-signin-stage::before {
    content: "";
    position: absolute;
    inset: -2%;
    background-image: url("images/hero/signin-bg.jpg");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    filter: blur(1.2px) saturate(1.02) brightness(0.88);
    transform: scale(1.02);
    transform-origin: center center;
    pointer-events: none;
    z-index: 0;
}

/* Crisp gradient + vignette stack painted on top of the image layer.
   Gold "sconce" glow up top, cool steel tint at the bottom corners,
   legibility-darkening linear wash, and an edge vignette that pulls
   the eye to the centered card. */
.l2-signin-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(900px 520px at 50% -5%,
            rgba(201, 162, 75, 0.28) 0%,
            rgba(201, 162, 75, 0.10) 35%,
            transparent 70%),
        radial-gradient(1100px 560px at 8% 108%,
            rgba(109, 143, 176, 0.12) 0%,
            transparent 60%),
        radial-gradient(1100px 560px at 92% 108%,
            rgba(109, 143, 176, 0.12) 0%,
            transparent 60%),
        radial-gradient(closest-side at 50% 50%,
            transparent 40%,
            rgba(8, 8, 10, 0.55) 88%,
            rgba(5, 5, 7, 0.85) 100%),
        linear-gradient(180deg,
            rgba(11, 11, 13, 0.55) 0%,
            rgba(11, 11, 13, 0.25) 45%,
            rgba(11, 11, 13, 0.72) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Halo wrapper — soft gold radial glow seated directly behind the card,
   giving the composition a focal point without any raster asset. */
.l2-signin-halo {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    width: 100%;
}
.l2-signin-halo::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(720px, 92vw);
    height: min(720px, 92vw);
    transform: translate(-50%, -50%);
    background: radial-gradient(closest-side,
        rgba(201, 162, 75, 0.18) 0%,
        rgba(201, 162, 75, 0.08) 35%,
        transparent 70%);
    filter: blur(4px);
    pointer-events: none;
    z-index: -1;
}

/* Ornamental corner flourishes — thin gold hairlines in the outer
   corners of the stage. Pure CSS, entirely decorative. */
.l2-signin-stage > .l2-signin-corner {
    position: absolute;
    width: 56px;
    height: 56px;
    border: 1px solid rgba(201, 162, 75, 0.32);
    pointer-events: none;
    z-index: 2;
}
.l2-signin-stage > .l2-signin-corner--tl { top: 20px; left: 20px; border-right: 0; border-bottom: 0; }
.l2-signin-stage > .l2-signin-corner--tr { top: 20px; right: 20px; border-left: 0; border-bottom: 0; }
.l2-signin-stage > .l2-signin-corner--bl { bottom: 20px; left: 20px; border-right: 0; border-top: 0; }
.l2-signin-stage > .l2-signin-corner--br { bottom: 20px; right: 20px; border-left: 0; border-top: 0; }

@media (max-width: 600px) {
    /* On mobile the card is the hero, not the backdrop. Let the stage
       wrap the card with comfortable padding instead of filling the
       whole viewport — otherwise the landscape cathedral image gets
       cropped tall and overpowers the form. */
    .l2-signin-stage {
        min-height: auto;
        padding: 28px 12px 40px;
    }
    /* Push the image into atmospheric-texture territory: darker,
       lower opacity, slightly more blur. Reads as a mood, not a
       scene. */
    .l2-signin-stage::before {
        filter: blur(2px) saturate(0.9) brightness(0.55);
        opacity: 0.7;
    }
    /* Firm the legibility wash so the card still pops against the
       tall-cropped section of the image. */
    .l2-signin-stage::after {
        background-image:
            radial-gradient(600px 420px at 50% 0%,
                rgba(201, 162, 75, 0.22) 0%,
                rgba(201, 162, 75, 0.08) 40%,
                transparent 75%),
            radial-gradient(closest-side at 50% 50%,
                transparent 35%,
                rgba(8, 8, 10, 0.65) 85%,
                rgba(5, 5, 7, 0.90) 100%),
            linear-gradient(180deg,
                rgba(11, 11, 13, 0.70) 0%,
                rgba(11, 11, 13, 0.40) 45%,
                rgba(11, 11, 13, 0.85) 100%);
    }
    .l2-signin-stage > .l2-signin-corner { display: none; }
}


/* ─── Create Listing — polish pass overrides ─────────────────────────── */

/* MudFileUpload host wrapper — strip the default MudInputControl chrome
   so our dashed dropzone activator IS the upload UI. The <input> is
   overlaid absolutely on top of the dropzone with opacity 0 so clicks
   and drops route into MudFileUpload while users see our themed visual. */
.l2-upload-host {
    position: relative;
}
.l2-upload-host .mud-input-control {
    margin: 0;
    padding: 0;
}
.l2-upload-host .mud-input-control-input-container {
    padding: 0;
}
.l2-upload-host .mud-file-upload-files {
    display: none;
}
.l2-upload-host .mud-file-upload-custom-content {
    width: 100%;
}
.l2-upload-host__input {
    position: absolute !important;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: pointer;
    opacity: 0;
}

/* "What we read" OCR trace panel — bigger, more readable, scrollable. */
.l2-ocr-trace {
    background-color: #0B0B0D;
    border: 1px solid #2A2A30;
    border-radius: 8px;
    padding: 18px 20px;
    box-shadow: inset 0 0 0 1px rgba(201, 162, 75, 0.06);
}
.l2-ocr-trace__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #9A9488;
    font-family: 'Inter', sans-serif;
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}
.l2-ocr-trace__body {
    margin: 0;
    padding: 0;
    color: #E8E3D6;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 1rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #C9A24B #0B0B0D;
}
.l2-ocr-trace__body::-webkit-scrollbar {
    width: 6px;
}
.l2-ocr-trace__body::-webkit-scrollbar-track {
    background: #0B0B0D;
}
.l2-ocr-trace__body::-webkit-scrollbar-thumb {
    background-color: rgba(201, 162, 75, 0.45);
    border-radius: 3px;
}
.l2-ocr-trace__body::-webkit-scrollbar-thumb:hover {
    background-color: #C9A24B;
}


/* ══════════════════════════════════════════════════════════════════════
   Tier 1 motion polish — see instructions/design.md "Motion vocabulary".
   All keyframes here are one-shot; no Tier 1 effect loops. The reduced-
   motion opt-out at the bottom of this section collapses every effect
   to its final visual state.
   ══════════════════════════════════════════════════════════════════════ */

/* T1.1 — Card grid stagger reveal. Apply .l2-grid-stagger to the
   MudGrid container; each child sets Style="--l2-stagger-delay:{N}ms"
   where N is pre-computed in Razor (Math.Min(i, 7) * 40). Pre-computing
   avoids fragile `calc(number * time)` CSS math which is inconsistently
   supported across browsers. */
.l2-grid-stagger > * {
    animation: l2-grid-in 240ms ease-out both;
    animation-delay: var(--l2-stagger-delay, 0ms);
}
@keyframes l2-grid-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Promote .mud-button-label only — `> *` traps MudBlazor's ripple-effect into normal flow on click. */
.l2-cta-shimmer {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.l2-cta-shimmer .mud-button-label {
    position: relative;
    z-index: 1;
}
.l2-cta-shimmer::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(120deg,
        transparent 30%,
        rgba(230, 200, 120, 0.32) 50%,
        transparent 70%);
    transform: translateX(-120%);
    animation: l2-cta-shimmer 1400ms ease-out 350ms 1 forwards;
    pointer-events: none;
    z-index: 0;
}
@keyframes l2-cta-shimmer {
    from { transform: translateX(-120%); }
    to   { transform: translateX(120%); }
}

/* T1.3 — Item-icon hover lift inside any .l2-card-hover container.
   Pure cascade — applies free wherever .l2-card-hover wraps an
   .l2-item-slot (every existing listing card). */
.l2-card-hover .l2-item-slot {
    transition: transform 160ms ease-out, filter 160ms ease-out;
}
.l2-card-hover:hover .l2-item-slot {
    transform: scale(1.04);
    filter: brightness(1.12);
}

/* T1.4 — Sparkline stroke draw-in. Uses SVG pathLength="1" on the line
   polyline so the draw duration is consistent regardless of actual
   polyline length (would otherwise resolve in ~10% of the duration on
   a small sparkline if we used a large dasharray). The area fill fades
   in once the line nears completion. */
.l2-spark-line {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: l2-spark-draw 600ms ease-out 1 forwards;
}
.l2-spark-area {
    opacity: 0;
    animation: l2-spark-area 400ms ease-out 400ms 1 forwards;
}
@keyframes l2-spark-draw { to { stroke-dashoffset: 0; } }
@keyframes l2-spark-area { to { opacity: 1; } }

/* T1.5 — EmptyState fade-in + 8px icon settle. Class applied on the
   EmptyState root; the inner illustration/icon picks up its own delay. */
.l2-empty-state {
    animation: l2-empty-fade 240ms ease-out both;
}
.l2-empty-state .l2-empty-illustration,
.l2-empty-state > .mud-icon-root {
    animation: l2-empty-settle 280ms ease-out both;
}
@keyframes l2-empty-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes l2-empty-settle {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Reduced-motion opt-out for ALL Tier 1 effects. Final state matches
   the post-animation state so users see the resolved visual without
   the kinetic affordance. */
@media (prefers-reduced-motion: reduce) {
    .l2-grid-stagger > *,
    .l2-empty-state,
    .l2-empty-state .l2-empty-illustration,
    .l2-empty-state > .mud-icon-root {
        animation: none;
    }
    .l2-cta-shimmer::after { display: none; }
    .l2-card-hover .l2-item-slot { transition: none; }
    .l2-card-hover:hover .l2-item-slot { transform: none; filter: none; }
    .l2-spark-line { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
    .l2-spark-area { opacity: 1; animation: none; }
}
