/* ═══════════════════════════════════════════════════════════════════════════
   Special Listings (migrations 084 + 086)
     .spx-*  listing page and buy box  (pages/special.php, assets/js/special-page.js)
     .sod-*  order detail              (assets/js/special-order.js - buyer & seller)
     .sov-*  order page                (assets/js/special-order.js)
     .spw-*  seller setup wizard       (assets/js/special-seller.js)
   Colours come from the site tokens in main.css; the buyer page adds its own
   light/dark set, scoped to .spx-root, and the store's accent (--spx-accent).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Buyer page: theme tokens ─────────────────────────────────────────────── */
.spx-root {
    --spx-bg: #F8FAFC; --spx-surface: #FFFFFF; --spx-text: #0F172A; --spx-muted: #64748B;
    --spx-border: #E2E8F0; --spx-field: #FFFFFF; --spx-soft: #F1F5F9;
    --spx-accent: #2563EB; --spx-overlap: 32px;
    --spx-accent-ink: color-mix(in srgb, var(--spx-accent) 82%, #000);
    background: var(--spx-bg); color: var(--spx-text);
}
.spx-root.spx-dark {
    --spx-bg: #0B0F17; --spx-surface: #111827; --spx-text: #F1F5F9; --spx-muted: #94A3B8;
    --spx-border: #1F2937; --spx-field: #0F172A; --spx-soft: #1E293B;
    --spx-accent-ink: color-mix(in srgb, var(--spx-accent) 70%, #fff);
}
body.spx-dark { background: #0B0F17; }
body.spx-dark .site-main { background: #0B0F17; }

.spx-preview-bar {
    background: #FEF3C7; color: #78350F; font-size: .85rem; padding: 10px 20px; text-align: center; line-height: 1.5;
}
.spx-preview-bar a { color: #78350F; font-weight: 700; margin-left: 6px; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.spx-layout {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr);
    min-height: calc(100vh - var(--header-height, 64px));
}
.spx-gallery {
    position: sticky; top: var(--header-height, 64px); height: calc(100vh - var(--header-height, 64px));
    overflow: hidden; background: #05060c;
}
.spx-gallery-empty { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 70% at 50% 0%, color-mix(in srgb, var(--spx-accent) 45%, #111), #05060c); }
.spx-gallery-scrim { position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,0) 26%),
                linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0) 46%); }

/* Over the photos, top: store on the left, price on the right. The right inset
   clears the part of the gallery that sits under the panel's rounded edge. */
.spx-gallery-top {
    position: absolute; z-index: 5; top: 22px; left: 24px; right: calc(var(--spx-overlap) + 22px);
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.spx-brand, .spx-pricetag, .spx-review {
    background: rgba(10, 13, 22, .5); border: 1px solid rgba(255,255,255,.16); color: #fff;
    -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
    box-shadow: 0 10px 30px rgba(0,0,0,.28);
}
.spx-brand {
    display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none;
    padding: 8px 18px 8px 8px; border-radius: 20px; transition: background .15s, border-color .15s;
}
.spx-brand:hover { color: #fff; background: rgba(10, 13, 22, .66); border-color: rgba(255,255,255,.3); }
.spx-brand:not(:has(img)) { padding-left: 18px; }
.spx-brand img { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; background: #fff; flex-shrink: 0; }
.spx-brand > span { min-width: 0; }
.spx-brand strong { display: block; font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spx-brand small { display: block; font-size: .8rem; opacity: .88; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spx-brand small b { color: #FBBF24; font-weight: 800; }
.spx-verified { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--spx-accent); font-size: .65rem; vertical-align: 2px; }
.spx-pricetag { flex-shrink: 0; padding: 9px 18px 10px; border-radius: 20px; text-align: right; }
.spx-pricetag small { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .78; }
.spx-pricetag strong { display: block; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }

/* Over the photos, bottom: up to three review cards. They share the row when
   there is room and scroll sideways when there is not. */
.spx-reviews {
    position: absolute; z-index: 5; left: 24px; right: calc(var(--spx-overlap) + 22px); bottom: 54px;
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
}
.spx-reviews::-webkit-scrollbar { display: none; }
.spx-review { flex: 1 0 210px; max-width: 340px; margin: 0; padding: 14px 16px; border-radius: 18px; scroll-snap-align: start;
    display: flex; flex-direction: column; gap: 8px; }
.spx-stars { font-size: .82rem; letter-spacing: 2px; color: rgba(255,255,255,.28); line-height: 1; }
.spx-stars span { color: #FBBF24; }
.spx-review blockquote { margin: 0; font-size: .86rem; line-height: 1.5; color: rgba(255,255,255,.94);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.spx-review figcaption { display: flex; align-items: center; gap: 9px; margin-top: auto; padding-top: 2px; min-width: 0; }
.spx-review figcaption img, .spx-review figcaption i { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.spx-review figcaption i { display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: .78rem; font-weight: 800;
    background: color-mix(in srgb, var(--spx-accent) 80%, #fff); color: #fff; }
.spx-review figcaption span { min-width: 0; }
.spx-review figcaption strong, .spx-review figcaption small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spx-review figcaption strong { font-size: .8rem; font-weight: 700; }
.spx-review figcaption small { font-size: .7rem; opacity: .7; }

.spx-gallery .cin-dots { bottom: 24px; left: calc(50% - var(--spx-overlap) / 2); }
.spx-gallery .cin-caption { bottom: 52px; right: calc(var(--spx-overlap) + 20px); }
.spx-gallery.spx-has-reviews .cin-caption { display: none; }

/* The panel is a sheet laid over the photos: its rounded edge and shadow are
   what separates the two halves (no hairline). */
.spx-panel { position: relative; z-index: 6; min-width: 0; margin-left: calc(var(--spx-overlap) * -1);
    padding: 40px clamp(20px, 3.5vw, 48px) 120px clamp(24px, 3.5vw, 52px); background: var(--spx-surface);
    border-radius: var(--spx-overlap) 0 0 var(--spx-overlap);
    box-shadow: -1px 0 0 rgba(255,255,255,.08), -28px 0 60px -12px rgba(2, 6, 23, .45); }
.spx-head { margin-bottom: 26px; }
.spx-kicker { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: var(--spx-accent-ink); background: color-mix(in srgb, var(--spx-accent) 12%, transparent); padding: 4px 10px; border-radius: 999px; }
.spx-title { overflow-wrap: anywhere; font-size: clamp(1.5rem, 2.4vw, 2.1rem); font-weight: 800; letter-spacing: -.025em; margin: 12px 0 6px; line-height: 1.15; color: var(--spx-text); }
.spx-price { font-size: 1.35rem; font-weight: 800; color: var(--spx-text); }
.spx-price small { font-size: .8rem; font-weight: 500; color: var(--spx-muted); margin-left: 4px; }
.spx-desc { margin-top: 14px; font-size: .95rem; line-height: 1.7; color: var(--spx-muted); overflow-wrap: anywhere; }
.spx-pay-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; border-radius: 12px;
    background: var(--spx-soft); font-size: .85rem; line-height: 1.55; color: var(--spx-text); }
.spx-pay-note svg { flex-shrink: 0; margin-top: 2px; color: var(--spx-accent-ink); }

.spx-local-note { font-size: .78rem; color: var(--spx-muted); line-height: 1.55; margin-top: 18px; }

/* Steps */
.spx-step { border: 1px solid var(--spx-border); border-radius: 16px; padding: 20px; margin-bottom: 16px; background: var(--spx-surface); }
.spx-step-h { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1rem; font-weight: 800; color: var(--spx-text); }
.spx-step-n { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--spx-accent); color: #fff; font-size: .8rem; font-weight: 800; flex-shrink: 0; }
.spx-step-n.done { background: #16A34A; }
.spx-step-sub { font-size: .82rem; color: var(--spx-muted); margin: -8px 0 14px 36px; }

/* Sign-in card: split panel, accent side on the left */
.spx-auth { display: grid; grid-template-columns: 0.9fr 1.1fr; border-radius: 18px; overflow: hidden; border: 1px solid var(--spx-border); margin-bottom: 16px; }
.spx-auth-side { background: linear-gradient(150deg, var(--spx-accent), color-mix(in srgb, var(--spx-accent) 55%, #000)); color: #fff; padding: 26px 22px;
    display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.spx-auth-side h3 { margin: 0; font-size: 1.2rem; font-weight: 800; }
.spx-auth-side p { margin: 0; font-size: .85rem; opacity: .9; line-height: 1.5; }
.spx-auth-main { background: var(--spx-surface); padding: 24px 22px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.spx-auth-main h3 { margin: 0; font-size: 1.05rem; color: var(--spx-text); }
.spx-auth-main p { margin: 0; font-size: .84rem; color: var(--spx-muted); line-height: 1.5; }
.spx-oauth { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px; border-radius: 12px; font-weight: 700; font-size: .92rem;
    text-decoration: none; background: #5865F2; color: #fff; }
.spx-oauth:hover { background: #4752C4; color: #fff; }
.spx-oauth.roblox { background: var(--spx-soft); color: var(--spx-muted); pointer-events: none; }

/* Buy box */
.spx-cat { display: inline-block; margin-left: 6px; font-size: .72rem; font-weight: 700; color: var(--spx-muted); text-decoration: none;
    border: 1px solid var(--spx-border); padding: 3px 10px; border-radius: 999px; }
a.spx-cat:hover { color: var(--spx-text); border-color: var(--spx-muted); }
.spx-facts { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.spx-facts li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--spx-soft); }
.spx-facts svg { flex-shrink: 0; margin-top: 2px; color: var(--spx-accent-ink); }
.spx-facts strong { display: block; font-size: .9rem; color: var(--spx-text); line-height: 1.35; }
.spx-facts small { display: block; font-size: .78rem; color: var(--spx-muted); line-height: 1.45; margin-top: 1px; }
.spx-buy { margin-bottom: 16px; }
.spx-buy .spx-step { border-color: color-mix(in srgb, var(--spx-accent) 45%, var(--spx-border)); margin-bottom: 0; }
.spx-sum { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; margin: 0 0 16px; font-size: .9rem; }
.spx-sum dt { color: var(--spx-muted); }
.spx-sum dd { margin: 0; color: var(--spx-text); text-align: right; }
.spx-sum dd strong { font-size: 1.1rem; }
.spx-field { display: grid; gap: 6px; margin-bottom: 14px; }
.spx-field label { font-weight: 700; font-size: .88rem; color: var(--spx-text); }
.spx-opt { font-weight: 500; font-size: .75rem; color: var(--spx-muted); margin-left: 6px; }
.spx-input { width: 100%; box-sizing: border-box; border: 1.5px solid var(--spx-border); border-radius: 10px; padding: 10px 12px;
    font: inherit; font-size: .92rem; background: var(--spx-field); color: var(--spx-text); outline: none; transition: border-color .15s, box-shadow .15s; }
.spx-input:focus { border-color: var(--spx-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--spx-accent) 18%, transparent); }
.spx-terms { display: flex; gap: 10px; align-items: flex-start; font-size: .84rem; line-height: 1.5; color: var(--spx-text); margin-bottom: 14px; cursor: pointer; }
.spx-terms input { margin-top: 3px; width: 17px; height: 17px; flex-shrink: 0; accent-color: var(--spx-accent); }
.spx-pp { min-height: 46px; }
.spx-note { font-size: .8rem; color: var(--spx-muted); line-height: 1.5; margin: 10px 0 0; }
.spx-about .spx-desc { margin-top: 0; }
.spx-desc ul { margin: 8px 0; padding-left: 20px; }
.spx-desc a { color: var(--spx-accent-ink); }
.spx-how-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: .88rem; line-height: 1.55; color: var(--spx-muted); }
.spx-how-list strong { color: var(--spx-text); }
.spx-done { text-align: center; padding: 30px 20px; }
.spx-done-icon { width: 58px; height: 58px; border-radius: 50%; background: #DCFCE7; color: #16A34A; display: inline-flex; align-items: center; justify-content: center; font-size: 1.7rem; margin-bottom: 12px; }
.spx-done h2 { margin: 0 0 8px; color: var(--spx-text); }
.spx-done p { color: var(--spx-muted); font-size: .92rem; line-height: 1.6; margin: 0 0 18px; }

.spx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--spx-border); background: var(--spx-surface);
    color: var(--spx-text); border-radius: 12px; padding: 11px 18px; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; text-decoration: none; }
.spx-btn:disabled { opacity: .5; cursor: not-allowed; }
.spx-btn-primary { background: var(--spx-accent); border-color: var(--spx-accent); color: #fff; }
.spx-btn-primary:hover:not(:disabled) { filter: brightness(1.07); color: #fff; }
.spx-btn-block { width: 100%; }
.spx-next { margin-top: 4px; }
.spx-err { color: #DC2626; font-size: .83rem; margin-top: 8px; }

/* Mobile bar */
.spx-mbar { display: none; }

@media (max-width: 900px) {
    .spx-root { --spx-overlap: 0px; }
    .spx-layout { grid-template-columns: minmax(0, 1fr); }
    .spx-gallery { position: relative; top: 0; height: 46vh; min-height: 280px; }
    .spx-gallery.spx-has-reviews { height: 62vh; min-height: 430px; }
    .spx-gallery-top { top: 14px; left: 14px; right: 14px; gap: 8px; }
    .spx-brand { padding: 6px 14px 6px 6px; border-radius: 16px; gap: 10px; }
    .spx-brand img { width: 40px; height: 40px; border-radius: 11px; }
    .spx-brand strong { font-size: .95rem; }
    .spx-pricetag { padding: 7px 14px 8px; border-radius: 16px; }
    .spx-pricetag strong { font-size: 1.1rem; }
    .spx-reviews { left: 0; right: 0; bottom: 62px; padding: 0 14px; scroll-padding-left: 14px; scroll-snap-type: x mandatory; }
    .spx-review { flex: 0 0 min(78vw, 300px); padding: 12px 14px; }
    .spx-gallery .cin-dots { bottom: 40px; }
    .spx-gallery .cin-caption { bottom: 62px; }
    .spx-panel { margin-left: 0; border-radius: 26px 26px 0 0; margin-top: -26px; padding: 28px 16px 130px;
        box-shadow: 0 -1px 0 rgba(255,255,255,.08), 0 -22px 44px -10px rgba(2, 6, 23, .5); }
    .spx-auth { grid-template-columns: 1fr; }
    .spx-mbar { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--spx-surface);
        border-top: 1px solid var(--spx-border); padding: 8px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(0,0,0,.08); }
    .spx-mbar-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; font-size: .82rem; color: var(--spx-muted); }
}

/* ── Order detail (buyer + seller) ─────────────────────────────────────────── */
.sod { display: grid; gap: 18px; }
.sod-top { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.sod-top img { width: 72px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--grey-100); }
.sod-top h2 { margin: 0 0 4px; font-size: 1.15rem; }
.sod-meta { font-size: .8rem; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; }
.sod-status { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--blue-50); color: var(--blue-700); }
.sod-status[data-s="order_received"], .sod-status[data-s="awaiting_final_payment"] { background: #FEF3C7; color: #92400E; }
.sod-status[data-s="payment_confirmed"], .sod-status[data-s="deposit_paid"] { background: #E0E7FF; color: #3730A3; }
.sod-status[data-s="delivered"], .sod-status[data-s="completed"] { background: #DCFCE7; color: #166534; }
.sod-status[data-s="cancelled"], .sod-status[data-s="refunded"], .sod-status[data-s="closed"] { background: #F3F4F6; color: #4B5563; }
.sod-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.sod-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; background: var(--white); }
.sod-card h3 { margin: 0 0 12px; font-size: .95rem; }
.sod-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .86rem; }
.sod-kv dt { color: var(--text-muted); }
.sod-kv dd { margin: 0; font-weight: 600; }
.sod-answers { display: grid; gap: 12px; font-size: .88rem; }
.sod-answers .q { font-weight: 700; margin-bottom: 2px; }
.sod-answers .a { white-space: pre-wrap; word-break: break-word; color: var(--text-secondary); }
.sod-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 6px; }
.sod-file { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--grey-100); border: 1px solid var(--border); }
.sod-file img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sod-file.doc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; text-decoration: none;
    font-size: .7rem; color: var(--text-secondary); text-align: center; word-break: break-all; aspect-ratio: auto; min-height: 90px; }
.sod-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.sod-timeline li { position: relative; padding-left: 20px; font-size: .86rem; }
.sod-timeline li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue-600); }
.sod-timeline li::after { content: ''; position: absolute; left: 7px; top: 18px; bottom: -14px; width: 2px; background: var(--border); }
.sod-timeline li:last-child::after { display: none; }
.sod-timeline .t { font-size: .74rem; color: var(--text-muted); }
.sod-timeline .b { white-space: pre-wrap; color: var(--text-secondary); margin-top: 2px; }
.sod-actions { display: grid; gap: 10px; }
.sod-actions textarea, .sod-actions input, .sod-actions select { width: 100%; box-sizing: border-box; border: 1.5px solid var(--border); border-radius: 10px;
    padding: 9px 11px; font: inherit; font-size: .88rem; background: var(--white); color: var(--text-primary); }
.sod-actions textarea { min-height: 80px; resize: vertical; }
.sod-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sod-note { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }
.sod-warn { font-size: .82rem; background: #FEF3C7; color: #78350F; border-radius: 10px; padding: 10px 12px; line-height: 1.5; }
.sod-pay-box { border: 1.5px solid var(--blue-200, #BFDBFE); background: var(--blue-50); border-radius: 14px; padding: 16px; display: grid; gap: 10px; }
.sod-pay-box .amt { font-size: 1.5rem; font-weight: 800; }
.sod-terms { display: flex; gap: 10px; align-items: flex-start; font-size: .84rem; line-height: 1.5; }
.sod-terms input { margin-top: 3px; width: 17px; height: 17px; flex-shrink: 0; }

/* Thread */
.sod-thread { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 10px; background: var(--grey-50); border-radius: 12px; }
.sod-msg { max-width: 80%; padding: 9px 12px; border-radius: 14px; font-size: .88rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
    background: var(--white); border: 1px solid var(--border); align-self: flex-start; }
.sod-msg.mine { align-self: flex-end; background: var(--blue-600); color: #fff; border-color: var(--blue-600); }
.sod-msg .when { display: block; font-size: .68rem; opacity: .7; margin-top: 3px; }
.sod-msg img { max-width: 180px; border-radius: 8px; display: block; margin-top: 6px; }
.sod-composer { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.sod-composer textarea { flex: 1; min-height: 44px; max-height: 160px; border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: .88rem; resize: vertical; }

/* ── Confirm modal (SpecialKit.confirm) ───────────────────────────────────── */
.spm-back { position: fixed; inset: 0; z-index: 1000; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center;
    padding: 16px; opacity: 0; transition: opacity .16s ease; }
.spm-back.open { opacity: 1; }
.spm { position: relative; width: 100%; max-width: 420px; background: var(--white, #fff); border-radius: 16px; padding: 22px 22px 18px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25); transform: translateY(8px) scale(.98); transition: transform .16s ease; }
.spm-back.open .spm { transform: none; }
.spm h3 { margin: 0 34px 8px 0; font-size: 1.05rem; font-weight: 800; color: var(--text-primary); }
.spm p { margin: 0; font-size: .9rem; line-height: 1.55; color: var(--text-secondary); }
.spm-x { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border: none; border-radius: 8px; background: none;
    font-size: 1.3rem; line-height: 1; color: var(--text-muted); cursor: pointer; }
.spm-x:hover { background: var(--grey-100, #F3F4F6); }
.spm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.spm-danger { background: #DC2626; border-color: #DC2626; color: #fff; }
.spm-danger:hover { background: #B91C1C; color: #fff; }
@media (prefers-reduced-motion: reduce) { .spm-back, .spm { transition: none; } }

/* Messages that are still sending, or failed */
.sov-post.pending .sov-post-head span::after { content: ' · Sending…'; }
.sov-post.failed .sov-text { opacity: .7; }
.sov-failed { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: .8rem; color: #DC2626; }
.sov-failed button { border: none; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--blue-700, #1D4ED8); cursor: pointer; }
.sov-failed button[data-drop] { color: var(--text-muted); }

/* Files ready to download, then the rating */
.sov-ready { border: 1.5px solid #86EFAC; background: #F0FDF4; border-radius: 16px; padding: 16px 20px; display: grid; gap: 12px; }
.sov-ready.all { border-color: var(--border); background: var(--white); }
.sov-ready-h { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.sov-ready-h strong { display: block; font-size: 1rem; }
.sov-ready-h span { font-size: .85rem; color: var(--text-secondary); }
.sov-ready-files { display: grid; gap: 8px; }
.sov-ready-file { display: flex; align-items: center; gap: 12px; background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.sov-ready-file .nm { flex: 1; min-width: 0; font-weight: 600; font-size: .88rem; overflow-wrap: anywhere; }
.sov-ready-file .nm small { display: block; font-weight: 500; font-size: .74rem; color: var(--text-muted); }
.sov-done-tag { font-size: .78rem; font-weight: 700; color: #166534; white-space: nowrap; }
.sov-rate { display: grid; gap: 10px; }
.sov-stars { display: flex; gap: 4px; }
.sov-stars button { border: none; background: none; padding: 2px; font-size: 1.7rem; line-height: 1; cursor: pointer; color: #D1D5DB; }
.sov-stars button.on { color: #F59E0B; }
.sov-stars button:focus-visible { outline: 2px solid var(--blue-600); border-radius: 6px; }
.sov-rate textarea { width: 100%; box-sizing: border-box; min-height: 70px; border: 1.5px solid var(--border); border-radius: 10px; padding: 9px 11px; font: inherit; font-size: .88rem; resize: vertical; }
.sov-rated { font-size: .88rem; color: var(--text-secondary); }
.spm .sov-rate textarea { min-height: 64px; }
.sov-stage-pop .sov-stage-dot { animation: sov-pop .5s ease-out; }
@keyframes sov-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .sov-stage-pop .sov-stage-dot { animation: none; } }
.sov-rated b { color: #F59E0B; letter-spacing: 1px; }

/* ── Order page: status header + progress, conversation, sidebar ──────────── */
.sov { display: grid; gap: 12px; }
.sov-status { border: 1px solid var(--border); border-radius: 16px; background: var(--white); padding: 14px 20px 10px; }
.sov-status-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
/* Seller dashboard: an open order folds the section intro away to give it the screen */
.sps-order-open .sps-intro { display: none !important; }   /* beats its inline display:flex */
.sps-order-open .spw-tabs { margin-bottom: 10px; }
.sps-order-open .sod-back { margin-bottom: 8px; }
.sov-status-label { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.sov-status-title { margin: 1px 0 1px; font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.sov-status-next { font-size: .86rem; color: var(--text-secondary); }
.sov-status.ended .sov-status-title { color: #6B7280; }
.sov-status-listing { display: flex; gap: 10px; align-items: center; max-width: 340px; }
.sov-status-listing img { width: 64px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--grey-100); flex-shrink: 0; }
.sov-status-listing strong { display: block; font-size: .86rem; line-height: 1.3; }
.sov-status-listing span { font-size: .75rem; color: var(--text-muted); }

.sov-track { --sov-stages: 8; position: relative; display: grid; grid-template-columns: repeat(var(--sov-stages), minmax(84px, 1fr)); overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
/* The line runs from the centre of the first dot to the centre of the last. */
.sov-track-line { position: absolute; left: calc(50% / var(--sov-stages)); right: calc(50% / var(--sov-stages)); top: 11px; height: 3px;
    background: var(--grey-200, #E5E7EB); border-radius: 3px; z-index: 0; min-width: calc((var(--sov-stages) - 1) * 84px); }
.sov-track-line span { display: block; height: 100%; background: var(--success, #16A34A); border-radius: 3px; transition: width .4s ease; }
.sov-status.ended .sov-track-line span { background: #9CA3AF; }
.sov-stage { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.sov-stage-dot { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 800;
    background: var(--white); border: 2px solid var(--grey-200, #E5E7EB); color: var(--text-muted); }
.sov-stage-label { font-size: .7rem; font-weight: 600; color: var(--text-muted); line-height: 1.25; max-width: 96px; }
.sov-stage.done .sov-stage-dot { background: var(--success, #16A34A); border-color: var(--success, #16A34A); color: #fff; }
.sov-stage.done .sov-stage-label { color: var(--text-secondary); }
.sov-stage.now .sov-stage-dot { border-color: var(--blue-600); color: var(--blue-700); box-shadow: 0 0 0 4px rgba(37,99,235,.15); }
.sov-stage.now .sov-stage-label { color: var(--blue-700); font-weight: 800; }
.sov-status.ended .sov-stage.done .sov-stage-dot { background: #9CA3AF; border-color: #9CA3AF; }

.sov-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; border: 1px solid var(--border); border-radius: 16px; background: var(--white); overflow: hidden; }
/* Chat and sidebar share one height, --sov-h, set by special-order.js so the
   whole order fits the screen (fallback below). The feed and the sidebar each
   scroll inside it; a long conversation never stretches the page. */
.sov-grid { --sov-h: max(520px, min(78vh, 820px)); }
.sov-chat { display: flex; flex-direction: column; min-width: 0; height: var(--sov-h); border-right: 1px solid var(--border); }
.sov-chat-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: grid; gap: 4px; }
.sov-chat-name { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sov-chat-name a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.sov-chat-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .76rem; color: var(--text-muted); }
.sov-sep { color: var(--border); }
.sov-tag { background: var(--grey-100); border-radius: 6px; padding: 1px 7px; font-weight: 600; }
.sov-dot { width: 10px; height: 10px; border-radius: 50%; background: #9CA3AF; flex-shrink: 0; display: inline-block; }
.sov-dot.on { background: var(--success, #16A34A); }

.sov-feed { flex: 1 1 0; height: 0; min-height: 200px; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 18px; }
.sov-post { display: flex; gap: 12px; align-items: flex-start; }
.sov-av { border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--grey-100); }
.sov-av-i { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; background: #94A3B8; }
.sov-post-body { flex: 1; min-width: 0; max-width: 620px; }
.sov-post-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 3px; }
.sov-post-head strong { font-size: .88rem; }
.sov-post-head span { font-size: .72rem; color: var(--text-muted); }
.sov-text { font-size: .9rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; color: var(--text-secondary); }
.sov-italic { font-size: .86rem; font-style: italic; color: var(--text-secondary); margin-bottom: 8px; }
.sov-muted { font-size: .78rem; color: var(--text-muted); }
.sov-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.sov-imgs a { display: block; width: 120px; height: 90px; border-radius: 10px; overflow: hidden; background: var(--grey-100); border: 1px solid var(--border); }
.sov-imgs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sov-doc, .sov-imgs a.sov-doc { display: inline-flex; align-items: center; gap: 8px; width: auto; height: auto; max-width: 100%; padding: 8px 12px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--white); font-size: .82rem; font-weight: 600; color: var(--text-primary); text-decoration: none; }
.sov-doc span { min-width: 0; overflow-wrap: anywhere; }
.sov-doc small { display: block; font-weight: 500; font-size: .72rem; color: var(--text-muted); }
a.sov-doc:hover { border-color: var(--blue-600); }
.sov-doc-locked { background: var(--grey-50, #F9FAFB); color: var(--text-muted); border-style: dashed; }
.sov-dl { display: grid; gap: 8px; }
.sov-dl .sov-doc { display: flex; }
.sov-delivery .sov-post-body { border-left: 3px solid var(--success, #16A34A); padding-left: 12px; }

/* Request and offer cards - the order's terms, inside the conversation */
.sov-offer { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--white); max-width: 560px; }
.sov-offer-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 18px; background: var(--grey-50, #F9FAFB); border-bottom: 1px solid var(--border); }
.sov-offer-head strong { font-size: .95rem; }
.sov-offer-head span { font-size: 1.05rem; font-weight: 800; white-space: nowrap; }
.sov-offer-body { padding: 14px 18px; display: grid; gap: 12px; }
.sov-qa .sov-q { font-size: .78rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.sov-includes-h { font-weight: 700; font-size: .9rem; border-top: 1px solid var(--border); padding-top: 12px; }
.sov-includes { display: flex; gap: 16px; flex-wrap: wrap; font-size: .86rem; color: var(--text-secondary); }
.sov-offer-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--text-muted); }

/* Status changes and payments: a quiet line across the feed */
.sov-sys { align-self: center; font-size: .75rem; color: var(--text-muted); background: var(--grey-50, #F9FAFB); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; text-align: center; }
.sov-sys span { font-weight: 700; color: var(--text-secondary); }
.sov-sys-pay { background: #F0FDF4; border-color: #BBF7D0; }
.sov-sys-pay span { color: #166534; }
.sov-sys-warn { background: #FEF2F2; border-color: #FECACA; }
.sov-sys-warn span { color: #991B1B; }

/* Seller action panel above the composer */
.sov-panel { margin: 0 20px; border: 1px solid var(--border); border-bottom: none; border-radius: 12px 12px 0 0; padding: 12px 14px; display: grid; gap: 8px; background: var(--grey-50, #F9FAFB); }
.sov-panel-h { display: flex; justify-content: space-between; align-items: center; }
.sov-panel select, .sov-panel textarea { width: 100%; box-sizing: border-box; border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: .86rem; background: var(--white); }
.sov-panel textarea { min-height: 70px; resize: vertical; }
.sov-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sov-x { border: none; background: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--text-muted); }

.sov-composer { padding: 0 20px 14px; }
.sov-input { position: relative; border: 1px solid var(--border); border-radius: 10px; }
.sov-input textarea { width: 100%; box-sizing: border-box; border: none; outline: none; resize: none; min-height: 70px; max-height: 180px; padding: 12px 14px 24px; font: inherit; font-size: .9rem; border-radius: 10px; background: var(--white); }
.sov-input:focus-within { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.sov-count { position: absolute; right: 12px; bottom: 6px; font-size: .72rem; color: var(--text-muted); }
.sov-tools { display: flex; align-items: center; gap: 10px; padding-top: 10px; flex-wrap: wrap; }
.sov-tool { cursor: pointer; font-size: 1.15rem; color: var(--text-secondary); padding: 2px 4px; }
.sov-tool.disabled { opacity: .4; cursor: not-allowed; }
.sov-attached { font-size: .75rem; color: var(--text-muted); }
.sov-divider { width: 1px; height: 26px; background: var(--border); }
.sov-tools .btn.on { background: var(--blue-50); border-color: var(--blue-600); color: var(--blue-700); }
.sov-send { margin-left: auto; border: none; background: none; color: var(--success, #16A34A); font: inherit; font-weight: 800; font-size: .92rem; cursor: pointer; display: inline-flex; align-items: center; }
.sov-send:disabled { opacity: .45; cursor: not-allowed; }

.sov-side { padding: 16px; display: grid; gap: 14px; align-content: start; background: var(--white);
    max-height: var(--sov-h); overflow-y: auto; scrollbar-width: thin; scrollbar-gutter: stable; }
.sov-card { border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.sov-card:last-child { border-bottom: none; }
.sov-card h3 { margin: 0 0 10px; font-size: .92rem; }
.sov-card-hl { border: 1.5px solid var(--blue-200, #BFDBFE); background: var(--blue-50); border-radius: 12px; padding: 14px; }
.sov-party { display: grid; justify-items: center; text-align: center; gap: 4px; }
.sov-party-name { font-weight: 800; font-size: 1rem; margin-top: 6px; }
.sov-party-name a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.sov-party-sub { font-size: .76rem; color: var(--text-muted); }
.sov-online { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--text-secondary); margin-top: 4px; }
.sov-side .sod-kv { font-size: .82rem; }
.sov-side .sod-kv dd { text-align: right; }
.sov-side .sod-kv dd a { color: inherit; }

@media (max-width: 960px) {
    .sov-grid { grid-template-columns: 1fr; }
    .sov-chat { border-right: none; border-bottom: 1px solid var(--border); }
    .sov-side { max-height: none; overflow: visible; }
}
@media (max-width: 600px) {
    .sov-status { padding: 14px; }
    .sov-feed, .sov-chat-head { padding-left: 12px; padding-right: 12px; }
    .sov-composer { padding: 0 12px 12px; }
    .sov-panel { margin: 0 12px; }
    .sov-imgs a { width: 96px; height: 72px; }
}

/* Lists */
.sol { display: grid; gap: 10px; }
.sol-item { display: flex; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--white);
    cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.sol-item:hover { border-color: var(--blue-300, #93C5FD); }
.sol-item img { width: 56px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--grey-100); flex-shrink: 0; }
.sol-main { flex: 1; min-width: 0; }
.sol-title { font-weight: 700; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sol-sub { font-size: .78rem; color: var(--text-muted); }
.sol-right { text-align: right; font-size: .8rem; display: grid; gap: 4px; justify-items: end; }
.sol-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-600); display: inline-block; }
.sol-empty { text-align: center; padding: 36px 16px; color: var(--text-muted); border: 1px dashed var(--border); border-radius: 14px; font-size: .9rem; }
.sod-back { background: none; border: none; color: var(--blue-600); font: inherit; font-weight: 600; cursor: pointer; padding: 0; margin-bottom: 12px; }
/* Seller's Special Listings rows: on a narrow screen the buttons drop onto
   their own line under the title instead of pushing the page sideways. */
@media (max-width: 760px) {
    .sol-item { flex-wrap: wrap; }
    .sol-item > .sod-row { flex: 1 1 100%; }
}

@media (max-width: 860px) {
    .sod-grid { grid-template-columns: 1fr; }
    .sol-right { display: none; }
}

/* ── Seller setup wizard ──────────────────────────────────────────────────── */
.spw { display: grid; grid-template-columns: 210px minmax(0, 1fr) minmax(300px, 380px); gap: 22px; align-items: start; }
.spw-steps { position: sticky; top: calc(var(--header-height, 64px) + 16px); display: grid; gap: 4px; }
.spw-step { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; border: none; background: none; font: inherit;
    font-size: .86rem; color: var(--text-secondary); cursor: pointer; text-align: left; }
.spw-step:hover { background: var(--grey-100); }
.spw-step.on { background: var(--blue-50); color: var(--blue-700); font-weight: 700; }
.spw-step .n { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: inline-flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 800; flex-shrink: 0; }
.spw-step.on .n { border-color: var(--blue-600); color: var(--blue-700); }
.spw-step.done .n { background: var(--success, #16A34A); border-color: var(--success, #16A34A); color: #fff; }
.spw-main { border: 1px solid var(--border); border-radius: 16px; padding: 24px; background: var(--white); min-width: 0; }
.spw-main h2 { margin: 0 0 4px; font-size: 1.25rem; }

/* Sent for review: full width, the explanation beside the listing that was sent. */
.spw-locked { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 32px; align-items: start; padding: 28px; }
.spw-locked-info h2 { margin-top: 12px; font-size: 1.4rem; letter-spacing: -.01em; }
.spw-locked-info .spw-lead { max-width: 62ch; }
.spw-locked-steps { list-style: none; margin: 20px 0 22px; padding: 0; display: grid; gap: 14px; }
.spw-locked-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: .86rem; color: var(--text-muted); line-height: 1.5; }
.spw-locked-steps strong { display: block; color: var(--text-primary, #0F172A); font-size: .9rem; }
.spw-locked-steps i { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-style: normal; font-size: .78rem; font-weight: 800; background: var(--grey-100, #F1F5F9); color: var(--text-muted); border: 1.5px solid var(--border); }
.spw-locked-steps li.done i { background: #16A34A; border-color: #16A34A; color: #fff; }
.spw-locked-steps li.now i { background: #FEF3C7; border-color: #F59E0B; color: #92400E; box-shadow: 0 0 0 4px rgba(245, 158, 11, .15); }
.spw-locked-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--grey-50, #F8FAFC); }
.spw-locked-cover { aspect-ratio: 16 / 10; background: #0B0F17; display: flex; align-items: center; justify-content: center; color: #94A3B8; font-size: .82rem; }
.spw-locked-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spw-locked-meta { padding: 16px 18px 18px; display: grid; gap: 4px; }
.spw-locked-meta > small { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.spw-locked-meta > strong { font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
.spw-locked-meta ul { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.spw-locked-meta li { display: flex; justify-content: space-between; gap: 12px; font-size: .84rem; }
.spw-locked-meta li span { color: var(--text-muted); }
.spw-locked-meta li strong { text-align: right; }
.spw-locked-meta li small { display: block; font-weight: 500; color: var(--text-muted); font-size: .75rem; }
@media (max-width: 900px) {
    .spw-locked { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 18px; }
    .spw-locked-card { order: -1; }
    .spw-locked-cover { aspect-ratio: 16 / 7; }
}
.spw-lead { color: var(--text-muted); font-size: .88rem; margin: 0 0 20px; line-height: 1.55; }
.spw-field { display: grid; gap: 6px; margin-bottom: 18px; }
.spw-field > label, .spw-label { font-weight: 700; font-size: .88rem; display: flex; align-items: center; gap: 8px; }
.spw-tag { font-size: .66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.spw-tag.req { background: #FEE2E2; color: #991B1B; }
.spw-tag.opt { background: var(--grey-100); color: var(--text-muted); }
.spw-hint { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }
.spw-input, .spw-textarea, .spw-select { width: 100%; box-sizing: border-box; border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 12px;
    font: inherit; font-size: .9rem; background: var(--white); color: var(--text-primary); }
.spw-textarea { min-height: 110px; resize: vertical; }
.spw-input:focus, .spw-textarea:focus, .spw-select:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.spw-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.spw-card { border: 1.5px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; background: var(--white); text-align: left; font: inherit; display: grid; gap: 4px; }
.spw-card strong { font-size: .9rem; }
.spw-card span { font-size: .78rem; color: var(--text-muted); line-height: 1.45; }
.spw-card.on { border-color: var(--blue-600); background: var(--blue-50); }
.spw-switch { display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.spw-switch input { width: 18px; height: 18px; margin-top: 2px; }
.spw-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spw-row > * { flex: 1 1 140px; }
.spw-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.spw-saved { font-size: .75rem; color: var(--text-muted); align-self: center; display: inline-flex; align-items: center; gap: 6px; }
/* Saving spinner, used in the status line and inside the clicked button */
.spw-spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
    animation: spw-spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; flex-shrink: 0; }
@keyframes spw-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spw-spin { animation-duration: 2s; } }
.spw-main button:disabled, .spw-step:disabled { opacity: .6; cursor: not-allowed; }
.spw-slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.spw-slide { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--white); display: grid; }
.spw-slide-img { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--grey-100); cursor: grab; }
.spw-slide-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spw-slide-btns { display: flex; justify-content: space-between; padding: 4px; gap: 2px; }
.spw-slide-btns button { border: none; background: none; cursor: pointer; padding: 4px 6px; border-radius: 6px; font-size: .78rem; color: var(--text-secondary); }
.spw-slide-btns button:hover { background: var(--grey-100); }
.spw-slide input { border: none; border-top: 1px solid var(--border); padding: 6px 8px; font: inherit; font-size: .75rem; }
.spw-slide.dragging { opacity: .4; }
.spw-slide-main { position: absolute; left: 6px; top: 6px; background: rgba(17,24,39,.82); color: #fff; font-size: .62rem; font-weight: 800;
    letter-spacing: .05em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; }
.spw-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.spw-thumb { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--grey-100); padding: 0; }
.spw-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spw-q { border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: grid; gap: 10px; background: var(--grey-50); }
.spw-q-head { display: flex; gap: 8px; align-items: center; }
.spw-q-head .spw-select { width: auto; flex: 0 0 auto; }
/* app.js swaps each <select> for a .tds-select button + list; size the wrapper. */
.spw-field .tds-select, .sov-panel .tds-select, .srq-act .tds-select { display: block; width: 100%; min-width: 0; }
.spw-field .tds-select-btn { min-height: 44px; border-radius: 10px; }
.spw-q-head .spw-input { flex: 1; }
.spw-icon-btn { border: 1px solid var(--border); background: var(--white); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; flex-shrink: 0; color: var(--text-secondary); }
.spw-icon-btn:hover { border-color: var(--blue-400); color: var(--blue-700); }
.spw-preview { position: sticky; top: calc(var(--header-height, 64px) + 16px); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--white); }
.spw-preview-label { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.spw-preview-body { max-height: calc(100vh - 160px); overflow-y: auto; }
.spw-preview .spx-root { min-height: 0; }
.spw-pv-hero { position: relative; aspect-ratio: 16/10; background: #05060c; overflow: hidden; }
.spw-pv-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spw-pv-body { padding: 16px; display: grid; gap: 12px; }
.spw-checklist { display: grid; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.spw-checklist li { display: flex; gap: 10px; align-items: center; font-size: .88rem; }
.spw-checklist .ok { color: var(--success, #16A34A); font-weight: 800; }
.spw-checklist .no { color: #DC2626; font-weight: 800; }
.spw-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.spw-tab { border: none; background: none; padding: 10px 14px; font: inherit; font-weight: 600; font-size: .9rem; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.spw-tab.on { color: var(--blue-700); border-bottom-color: var(--blue-600); }
.spw-tab .badge { background: var(--blue-600); color: #fff; font-size: .66rem; border-radius: 999px; padding: 1px 6px; margin-left: 4px; }

/* Crop editor */
.spw-crop-back { position: fixed; inset: 0; background: rgba(15,23,42,.6); z-index: 10000; display: none; align-items: center; justify-content: center; padding: 16px; }
.spw-crop-back.open { display: flex; }
.spw-crop { background: var(--white); border-radius: 16px; width: min(860px, 100%); max-height: 92vh; overflow: auto; padding: 20px; display: grid; gap: 14px; }
.spw-crop-stage { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }
.spw-crop-frame { position: relative; overflow: hidden; border-radius: 12px; background: #05060c; cursor: grab; touch-action: none; user-select: none; }
.spw-crop-frame img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.spw-crop-frame.desk { aspect-ratio: 4/3; }
.spw-crop-frame.mob { aspect-ratio: 9/14; }
.spw-crop-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.4); pointer-events: none; }
.spw-crop-cap { font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }

@media (max-width: 1180px) {
    .spw { grid-template-columns: minmax(0, 1fr); }
    .spw-steps { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
    .spw-step { flex: 0 0 auto; }
    .spw-preview { position: static; }
}
@media (max-width: 640px) {
    .spw-main { padding: 16px; }
    .spw-crop-stage { grid-template-columns: 1fr; }
}
