/* listing pages (2026-11 redesign). Loaded site-wide after shell.css.
   Scope: .lp (listing detail), .lp-narrow (cancel / report / contact pages)
   and .chat-thread (public Q&A). Tokens only; breakpoints 600 / 840 / 1200. */

/* =============================================================================
   Listing detail layout
   ============================================================================= */
.lp { max-width: 1200px; margin: 0 auto; }

.lp-crumbs { margin: 0 0 1.25rem; font-size: var(--fs-small); color: var(--text-2); }
.lp-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; list-style: none; margin: 0; padding: 0; }
.lp-crumbs li { max-width: none; min-width: 0; }
.lp-crumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--text-3); }
.lp-crumbs li[aria-current] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.lp-crumbs a { display: inline-flex; align-items: center; min-height: 24px; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.lp-crumbs a:hover { color: var(--text); }
@media (pointer: coarse) { .lp-crumbs a { min-height: var(--tap); } }

.lp-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "media" "buy" "body";
    gap: 1.5rem;
}
.lp-media { grid-area: media; min-width: 0; }
.lp-buy   { grid-area: buy; min-width: 0; }
.lp-body  { grid-area: body; min-width: 0; }

@media (min-width: 840px) {
    .lp-grid {
        grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
        grid-template-areas: "media buy" "body buy";
        grid-template-rows: auto 1fr;
        column-gap: 2.5rem;
        row-gap: 2rem;
        align-items: start;
    }
}
@media (min-width: 1200px) {
    .lp-grid { column-gap: 3.5rem; }
}
/* Sticky buy box on desktop only, and only when the viewport is tall enough
   for it to fit; phones and the app shells scroll it with the page. */
@media (min-width: 840px) and (min-height: 760px) {
    html:not(.compact-chrome) .lp-buy {
        position: sticky;
        top: calc(var(--header-h) + 16px);
    }
}

/* ---------- Media ---------- */
.lp .gallery {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: none;
    gap: 0.5rem;
    margin: 0;
}
.lp .gallery > a {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--surface-hi);
    border: 1px solid var(--border);
}
.lp .gallery > a:first-child {
    grid-column: 1 / -1;
    grid-row: auto;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
}
.lp .gallery img {
    width: 100%; height: 100%; display: block;
    object-fit: cover;
    filter: brightness(var(--photo-dim));
    transition: none;
    cursor: zoom-in;
}
/* The main photo keeps its own aspect ratio inside the neutral frame. */
.lp .gallery > a:first-child img { object-fit: contain; }
.lp .gallery a:hover img { transform: none; }
.lp .gallery > a:hover { border-color: var(--field-border); }
@media (max-width: 599.98px) {
    .lp .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.lp-processing, .lp-noimg {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
    aspect-ratio: 4 / 3;
    padding: 1.5rem;
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--surface-hi); color: var(--text-2); text-align: center;
}
.lp-processing p, .lp-noimg p { margin: 0; max-width: 40ch; }
.lp-note {
    display: flex; align-items: center; gap: 0.5rem;
    margin: 0.75rem 0 0; color: var(--text-2); font-size: var(--fs-small);
}

/* Lightbox: tokens + Lucide icons (glyph text removed). */
.img-lightbox [hidden] { display: none; }
.img-lightbox-close, .img-lightbox-nav {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}
.img-lightbox-close:hover, .img-lightbox-nav:hover { background: var(--surface-hi); }
.img-lightbox-close:hover { transform: none; }
.img-lightbox-nav:hover { transform: translateY(-50%); }
.img-lightbox-close:focus-visible, .img-lightbox-nav:focus-visible { outline: 3px solid var(--focus); }
.img-lightbox-close { width: var(--tap-primary); height: var(--tap-primary); }
.img-lightbox-nav { width: var(--tap-primary); height: var(--tap-primary); }
.img-lightbox::backdrop { background: var(--scrim); backdrop-filter: none; -webkit-backdrop-filter: none; }
.img-lightbox-img { box-shadow: none; }
.img-lightbox-counter {
    background: var(--surface); color: var(--text);
    font-size: var(--fs-small); letter-spacing: normal;
    font-variant-numeric: tabular-nums;
}
@media (max-width: 599.98px) {
    .img-lightbox-close, .img-lightbox-nav { width: var(--tap); height: var(--tap); }
}

/* ---------- Buy box: the page's one bold element ---------- */
.lp-buy {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex; flex-direction: column; gap: 1rem;
}
.lp-buy > * { margin: 0; }
@media (max-width: 599.98px) {
    .lp-buy { padding: 1.25rem 1rem; }
}

.lp-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.lp-tags:empty { display: none; }
/* Shared partials restyled as plain status tags inside the listing page. */
.lp .spotlight-chip {
    display: inline-flex; align-items: center; gap: 0.3em;
    padding: 0.125rem 0.5rem; border-radius: 999px;
    font-family: var(--font-sans); font-size: var(--fs-caption); font-weight: 600; line-height: 1.5;
    text-transform: none; letter-spacing: normal;
    background: var(--amber-soft); color: var(--amber-text); border: 1px solid transparent;
    box-shadow: none;
}
.lp .badge-partner, .lp .level-chip-public {
    display: inline-flex; align-items: center;
    padding: 0.125rem 0.5rem; border-radius: 999px;
    font-family: var(--font-sans); font-size: var(--fs-caption); font-weight: 600; line-height: 1.5;
    text-transform: none; letter-spacing: normal;
    border: 1px solid transparent;
}
.lp .badge-partner { background: var(--surface-hi); color: var(--text); }
.lp .level-chip-public { background: var(--accent-soft); color: var(--accent-deep); text-decoration: none; }
[data-theme="dark"] .lp .level-chip-public { color: var(--accent-2); }

.lp-title {
    margin: 0;
    font-size: 2rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
}
@media (max-width: 599.98px) { .lp-title { font-size: 1.75rem; } }
.lp-latin { color: var(--text-2); font-style: italic; font-size: var(--fs-body); }
.lp-buy .lp-title + .lp-latin { margin-top: -0.75rem; }

.lp-price-block p { margin: 0; }
.lp-price-label { color: var(--text-2); font-size: var(--fs-small); font-weight: 500; }
.lp-price {
    font-size: clamp(2rem, 4vw, var(--fs-h1));
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}
.lp-price-sub { margin-top: 0.25rem; color: var(--text-2); font-size: var(--fs-small); }

.lp-reserve { display: flex; flex-direction: column; align-items: flex-start; gap: 0.375rem; }
.lp-reserve p { margin: 0; }
.lp-hint { margin: 0; color: var(--text-2); font-size: var(--fs-small); line-height: 1.5; }

/* Time left: neutral by default, amber text + clock under 24h. The colour
   classes are toggled every second by static/js/countdown.js. */
.lp-time { display: flex; align-items: flex-start; gap: 0.625rem; color: var(--text); }
.lp-time > svg { flex: 0 0 auto; margin-top: 0.2rem; }
.lp-time p { margin: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.lp-time-label { color: var(--text-2); font-size: var(--fs-small); font-weight: 500; }
.lp .countdown, .lp-countdown {
    font-family: var(--font-sans);
    font-size: var(--fs-large);
    font-weight: 600;
    letter-spacing: normal;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}
.lp .countdown-green { color: var(--text); }
.lp .countdown-yellow, .lp .countdown-orange, .lp .countdown-red { color: var(--amber-text); font-weight: 700; }
.lp .countdown-red { animation: none; }
.lp .countdown-ended { color: var(--text-2); }
.lp-time:has(.countdown-yellow, .countdown-orange, .countdown-red) > svg { color: var(--amber-text); }
.lp-time-end { color: var(--text-2); font-size: var(--fs-small); }

.lp-activity { display: flex; flex-wrap: wrap; gap: 0.375rem; }

/* Costs before the commit button. */
.lp-costs {
    display: grid; gap: 0.5rem;
    margin: 0; padding: 0.875rem 0 0;
    border-top: 1px solid var(--border);
    font-size: var(--fs-small);
}
.lp-costs > div { display: grid; grid-template-columns: minmax(7.5rem, max-content) 1fr; gap: 0.75rem; align-items: baseline; }
.lp-costs dt { color: var(--text-2); font-weight: 500; display: inline-flex; align-items: center; gap: 0.375rem; }
.lp-costs dd { margin: 0; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.lp-costs-warn dt, .lp-costs-warn dd { color: var(--amber-text); }
.lp-methods { display: flex; flex-wrap: wrap; gap: 0.25rem; }
@media (max-width: 359.98px) {
    .lp-costs > div { grid-template-columns: 1fr; gap: 0.125rem; }
}

/* ---------- Bid form ---------- */
.lp-bidform { display: flex; flex-direction: column; gap: 0.625rem; margin: 0; border-radius: var(--radius-md); }
.lp-bidform > * { margin: 0; }
.lp-label { display: block; margin: 0; font-weight: 600; color: var(--text); font-size: var(--fs-body); }
.lp-bidform .field-hint { margin-top: -0.375rem; }
.lp-money { position: relative; }
.lp-money-prefix {
    position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%);
    color: var(--text-2); font-size: 1.125rem; font-weight: 600; pointer-events: none;
}
.lp-money input {
    width: 100%; box-sizing: border-box;
    min-height: var(--tap-primary);
    padding: 0 0.875rem 0 1.875rem;
    font-size: 1.125rem; font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.lp-fine, .lp-info { font-size: var(--fs-small); color: var(--text-2); line-height: 1.5; }
.lp-fine strong { color: var(--text); }
.lp-info {
    padding: 0.625rem 0.75rem;
    background: var(--accent-soft); border-radius: var(--radius-md); color: var(--text);
}

.lp-ship-line {
    padding: 0.625rem 0.75rem;
    background: var(--surface-hi); border-radius: var(--radius-md);
    font-size: var(--fs-small); color: var(--text-2);
}
.lp-ship-line strong { color: var(--text); }
.lp-ship-line--error {
    display: flex; align-items: flex-start; gap: 0.5rem;
    background: var(--red-soft); color: var(--danger);
}
.lp-tiers {
    margin: 0; padding: 0.5rem 0.875rem 0.75rem;
    border: 1px solid var(--field-border); border-radius: var(--radius-md);
}
.lp-tiers legend { padding: 0 0.375rem; font-weight: 600; font-size: var(--fs-body); color: var(--text); }
.lp-tiers-carrier { margin: 0.625rem 0 0.125rem; font-size: var(--fs-small); font-weight: 600; color: var(--text-2); }
.lp-radio, .lp-check {
    display: flex; align-items: center; gap: 0.625rem;
    min-height: var(--tap); margin: 0;
    font-weight: 400; font-size: var(--fs-body); color: var(--text); cursor: pointer;
}
.lp-radio input, .lp-check input { flex: 0 0 auto; margin: 0; }
.lp-radio--rich { align-items: flex-start; padding: 0.5rem 0; }
.lp-radio--rich input { margin-top: 0.15rem; }
.lp-radio--rich > span { display: flex; flex-direction: column; gap: 0.125rem; }
.lp-radio--rich .field-hint { margin: 0; }

.lp-details { font-size: var(--fs-small); }
.lp-details summary {
    display: inline-flex; align-items: center; min-height: var(--tap);
    color: var(--text-2); font-weight: 500; cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px;
}
.lp-details summary:hover { color: var(--text); }
.lp-details > p { margin: 0.25rem 0 0; color: var(--text-2); line-height: 1.55; }
.lp-retract summary { color: var(--danger); }
.lp-retract-form {
    display: flex; flex-direction: column; gap: 0.5rem;
    margin: 0.25rem 0 0; padding: 0.875rem;
    border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-hi);
}
.lp-retract-form p { margin: 0; color: var(--text-2); }
.lp-retract-form select, .lp-retract-form input[type="text"] { width: 100%; box-sizing: border-box; padding: 0 0.75rem; }
.lp-retract-form .lp-label { font-size: var(--fs-small); }
.lp-retract-form .btn { align-self: flex-start; }

.lp-bin-alt { display: flex; flex-direction: column; gap: 0.625rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.lp-subhead { margin: 0; font-size: var(--fs-body); font-weight: 600; }

/* ---------- Actions ---------- */
.lp-actions { display: grid; gap: 0.5rem; }
.lp-actions form, .lp-cartform, .lp-secondary form { margin: 0; }
.lp-cartform { display: flex; flex-direction: column; gap: 0.5rem; }
.lp-qty { width: 100%; max-width: 8rem; padding: 0 0.75rem; }
.lp-buy .btn { justify-content: center; }
.lp-buy .btn svg { flex: 0 0 auto; }
.lp-quiet { color: var(--text-2); font-size: var(--fs-small); }

.lp-secondary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.lp-secondary .lp-ask { grid-column: 1 / -1; }
.lp-secondary .btn { min-height: var(--tap-primary); font-size: var(--fs-small); }
.lp-watch.is-on svg { fill: currentColor; color: var(--danger); }

/* Seller-only and blocking notes: quiet panels, never alarms. */
.lp-owner-note, .lp-block {
    display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface-hi); color: var(--text);
}
.lp-owner-note p, .lp-block p { margin: 0; font-size: var(--fs-small); color: var(--text-2); line-height: 1.5; }
.lp-owner-note .lp-owner-note-title, .lp-block .lp-block-title {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: var(--fs-body); font-weight: 600; color: var(--text);
}
.lp-owner-note[hidden] { display: none; }
.lp .bid-prereq-cta, .lp-block--warn { background: var(--amber-soft); border-color: transparent; }
.lp .bid-prereq-cta .lp-block-title { color: var(--amber-text); }
.lp-block--warn p { color: var(--text); }
.lp-block--warn svg { color: var(--amber-text); vertical-align: -0.15em; }

/* =============================================================================
   Body: seller, description, details
   ============================================================================= */
.lp-body { display: flex; flex-direction: column; gap: 2rem; }
.lp-body > * { margin: 0; }

.lp-seller {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.lp-seller-main { display: flex; align-items: center; gap: 0.875rem; min-width: 0; }
.lp-seller-main .acct-avatar { width: 48px; height: 48px; border-radius: 24px; font-size: var(--fs-large); flex: 0 0 auto; }
.lp-seller-text { min-width: 0; }
.lp-seller-text p { margin: 0; }
.lp-seller-name { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.5rem; font-weight: 600; font-size: var(--fs-body); }
.lp-seller-name > a:first-child { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.lp-seller-stats { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.25rem; color: var(--text-2); font-size: var(--fs-small); }
.lp-seller-stats span { display: inline-flex; align-items: center; gap: 0.3rem; }
.lp-seller-stats svg { color: var(--amber-text); }
.lp-follow { margin: 0; }
.lp-follow .btn[aria-pressed="true"] { background: var(--surface-hi); }

.lp-section .section-title { margin-bottom: 0.75rem; }
.lp-prose { max-width: var(--measure); color: var(--text); line-height: 1.65; overflow-wrap: anywhere; }
.lp-prose p { margin: 0 0 1em; }
.lp-prose p:last-child { margin-bottom: 0; }

.lp-dl { display: grid; gap: 0; margin: 0; max-width: var(--measure); }
.lp-dl > div {
    display: grid; grid-template-columns: minmax(8rem, 1fr) 2fr; gap: 1rem;
    padding: 0.625rem 0; border-bottom: 1px solid var(--border);
}
.lp-dl > div:first-child { border-top: 1px solid var(--border); }
.lp-dl dt { color: var(--text-2); font-weight: 500; }
.lp-dl dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
@media (max-width: 359.98px) {
    .lp-dl > div { grid-template-columns: 1fr; gap: 0.125rem; }
}
.lp-ref { font-family: var(--font-mono); background: transparent; color: inherit; padding: 0; }
.lp-staff-link { margin-left: 0.5rem; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }

.lp-panel { display: flex; flex-direction: column; gap: 0.75rem; }
.lp-panel > * { margin: 0; }
.lp-panel-title { font-size: var(--fs-body); font-weight: 600; margin: 0; color: var(--text); }
.lp-owner { background: var(--surface-hi); }
.lp-owner .lp-dl > div { border-color: var(--field-border); }

.lp-report { color: var(--text-2); font-size: var(--fs-small); }
.lp-report a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.lp-report a:hover { color: var(--text); }

/* =============================================================================
   Narrow pages: grace cancel, report, ask the seller
   ============================================================================= */
.lp-narrow { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.25rem; }
.lp-narrow > * { margin: 0; }
.lp-narrow .page-head { margin: 0; }
.lp-back { font-size: var(--fs-small); }
.lp-back a {
    display: inline-flex; align-items: center; gap: 0.25rem; min-height: 24px;
    color: var(--text-2); text-decoration: underline; text-underline-offset: 3px;
}
.lp-back a:hover { color: var(--text); }
@media (pointer: coarse) { .lp-back a { min-height: var(--tap); } }
.lp-narrow .panel + .panel { margin-top: 0; }
.lp-narrow .lp-block p { font-size: var(--fs-body); color: var(--text); }
.lp-grace-count { font-size: var(--fs-h2); font-weight: 700; color: var(--text); }
.lp-warn-text { display: flex; align-items: flex-start; gap: 0.5rem; color: var(--amber-text); font-size: var(--fs-small); }
.lp-warn-text[hidden] { display: none; }

.lp-form { display: flex; flex-direction: column; gap: 1.25rem; margin: 0; max-width: none; }
.lp-form > * { margin: 0; }
.lp-field { display: flex; flex-direction: column; gap: 0.375rem; }
.lp-field .field-hint { margin: 0; }
.lp-field input[type="text"], .lp-field textarea { width: 100%; box-sizing: border-box; padding: 0.625rem 0.875rem; }
.lp-field textarea { resize: vertical; background-image: none; }
.lp-field code { font-size: 0.95em; color: var(--text); background: var(--surface-hi); padding: 0 0.25rem; border-radius: var(--radius-md); }
.lp-fieldset { margin: 0; padding: 0; border: 0; }
.lp-fieldset legend { padding: 0; margin-bottom: 0.25rem; }
.lp-form-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
@media (max-width: 599.98px) {
    .lp-form-actions .btn { flex: 1 1 100%; justify-content: center; }
}

/* =============================================================================
   Public discussion (listing_chat) — overrides the legacy style.css block
   ============================================================================= */
.chat-thread {
    max-width: 840px;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.chat-thread h2 { margin: 0 0 0.25rem; font-size: var(--fs-large); }
.chat-lede { margin: 0 0 1.25rem; color: var(--text-2); font-size: var(--fs-small); }
.chat-closed, .chat-empty, .chat-signin { color: var(--text-2); font-size: var(--fs-small); }
.chat-signin a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.chat-avatar {
    width: 32px; height: 32px; font-size: var(--fs-caption);
    background: var(--surface-hi); color: var(--text);
}
.chat-who { font-size: var(--fs-small); }
.chat-when { color: var(--text-2); font-size: var(--fs-caption); }
.chat-badge-seller {
    font-size: var(--fs-caption); font-weight: 600;
    letter-spacing: normal; text-transform: none;
    padding: 0.0625rem 0.5rem;
    background: var(--accent-soft); color: var(--accent-deep);
}
[data-theme="dark"] .chat-badge-seller { color: var(--accent-2); }
.chat-body { font-size: var(--fs-body); line-height: 1.5; max-width: var(--measure); overflow-wrap: anywhere; }
.chat-stub { color: var(--text-2); }
.chat-actions { gap: 1rem; }
.chat-actions .btn-link, .chat-inline-form .btn-link {
    min-height: 24px; padding: 0;
    color: var(--text-2); font-size: var(--fs-caption); font-weight: 500;
    background: none; border: 0;
}
.chat-actions .btn-link:hover, .chat-inline-form .btn-link:hover { color: var(--text); text-decoration: underline; }
.chat-actions .chat-remove:hover, .chat-inline-form .chat-remove:hover { color: var(--danger); }
@media (pointer: coarse) {
    .chat-actions .btn-link, .chat-inline-form .btn-link { min-height: var(--tap); }
}
.thread-item.has-replies::before { background: var(--border); transition: none; }
.thread-item.has-replies:hover::before { background: var(--field-border); }
.reply::before { border-color: var(--border); transition: none; }
.thread-item.has-replies:hover .reply::before { border-color: var(--field-border); }

.chat-composer {
    border-color: var(--field-border);
    border-radius: var(--radius-lg);
    transition: none;
}
.chat-composer:focus-within { border-color: var(--focus); box-shadow: none; outline: 3px solid var(--focus); outline-offset: 2px; }
.chat-composer textarea { min-height: 3rem; border: 0; background: transparent; font-size: max(16px, 1rem); }
.chat-composer textarea:focus-visible { outline: none; }
.chat-composer-row { flex-wrap: wrap; gap: 0.5rem 1rem; }
.chat-hint, .chat-charcount { color: var(--text-2); font-size: var(--fs-caption); }
.chat-mention-dropdown { border-color: var(--border); }
.chat-mention-dropdown button { min-height: 40px; font-size: var(--fs-small); }
.chat-mention-dropdown button:hover, .chat-mention-dropdown button:focus-visible { background: var(--surface-hi); }
@media (max-width: 599.98px) {
    .chat-composer-row .btn { flex: 1 1 100%; justify-content: center; }
}
