/* DevStack marketplace: listing page, selling, browsing filters and the inbox. Loaded after style.css. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.btn-block { width: 100%; justify-content: center; }
.btn svg { flex-shrink: 0; }
.btn { gap: 7px; }
.danger-text { color: var(--danger) !important; }
.box-h { font-size: 0.86rem; margin: 0 0 6px; }

/* ---------- Gallery ---------- */
.gallery { display: flex; flex-direction: column; gap: 8px; }
.listing-hero { background: linear-gradient(135deg, hsl(var(--h, 220) 60% 35%), hsl(calc(var(--h, 220) + 50) 60% 22%)); margin: 0; }
.hero-open { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.hero-open img { width: 100%; height: 100%; object-fit: cover; display: block; animation: fade 0.3s ease both; }
.hero-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 999px; border: 0; display: grid; place-items: center; background: rgba(9,9,11,.62); color: #fff; cursor: pointer; opacity: 0; transition: opacity 0.2s, background-color 0.2s; }
.hero-nav.prev { left: 10px; }
.hero-nav.next { right: 10px; }
.listing-hero:hover .hero-nav, .hero-nav:focus-visible { opacity: 1; }
.hero-nav:hover { background: rgba(9,9,11,.85); }
@media (hover: none) { .hero-nav { opacity: 1; } }
.hero-count { position: absolute; right: 10px; bottom: 10px; font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(9,9,11,.62); color: #fff; font-variant-numeric: tabular-nums; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.thumbs button { flex: 0 0 92px; aspect-ratio: 16 / 10; padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-hover); cursor: pointer; opacity: 0.65; transition: opacity 0.18s, border-color 0.18s; }
.thumbs button:hover { opacity: 1; }
.thumbs button.on { border-color: var(--accent); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.listing-titlebar { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; margin-top: 18px; }
.listing-titlebar h1 { margin: 0 0 4px; font-size: clamp(1.4rem, 3vw, 1.9rem); overflow-wrap: anywhere; }
.listing-acts { display: flex; gap: 6px; flex-shrink: 0; }
.save-btn.on { color: #f43f5e; border-color: color-mix(in srgb, #f43f5e 45%, transparent); }
.save-btn.on svg { fill: currentColor; }
@media (max-width: 560px) {
  .listing-titlebar { flex-direction: column; gap: 10px; }
}
.payback { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid var(--border); font-size: 0.86rem; color: var(--text-dim); }
.payback strong { color: var(--text); }

/* ---------- Price box ---------- */
.verified-banner, .warn-banner { align-items: flex-start; line-height: 1.4; }
.verified-banner svg { color: #60a5fa; margin-top: 1px; }
.warn-banner svg { color: var(--warn); margin-top: 1px; }
.buy-acts { display: grid; gap: 8px; margin-top: 14px; }
.my-offer { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid var(--border); font-size: 0.86rem; line-height: 1.4; }
.my-offer.ok { border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.my-offer.ok svg { color: var(--success); }
.btn-pair { display: flex; gap: 8px; margin-top: 8px; }
.btn-pair .btn { flex: 1; justify-content: center; }
.contact-more { margin-top: 12px; font-size: 0.85rem; }
.contact-more summary { cursor: pointer; color: var(--text-dim); }
.contact-more .contact-box { margin-top: 8px; }
#ownerTools:not(:empty) { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.owner-note { margin: 0 0 8px; }
.tool-row-btns { display: flex; flex-wrap: wrap; gap: 6px; }
#offersWrap { margin-top: 16px; }
.offer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.offer-list li { padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); }
.offer-top { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; }
.offer-top .amt { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.offer-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- Seller trust ---------- */
.seller-name { font-weight: 600; color: var(--text); }
.seller-rating { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 0.85rem; }
.tbadges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tbadge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; font-weight: 500; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-dim); }
.tbadge.good { color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, transparent); background: color-mix(in srgb, var(--success) 8%, transparent); }
.tbadge.new { color: #60a5fa; border-color: color-mix(in srgb, #60a5fa 40%, transparent); }
.tbadge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.trust-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0 10px; }
.trust-facts div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: var(--radius-sm); background: var(--bg-input); text-align: center; }
.trust-facts b { font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.trust-facts span { font-size: 0.7rem; color: var(--text-dim); }
.trust-age { margin-bottom: 10px; font-size: 0.8rem; }

/* ---------- Reviews ---------- */
.review-list { list-style: none; margin: 0; padding: 0; }
.review { padding: 12px 0; border-top: 1px solid var(--border); }
.review:first-child { border-top: 0; padding-top: 4px; }
.review-top { display: flex; gap: 10px; align-items: center; }
.review-top a { color: var(--text); font-weight: 600; }
.review-top .hint a { font-weight: 400; color: var(--text-dim); }
.review-body { margin: 8px 0 0 38px; font-size: 0.9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-form { display: grid; gap: 10px; padding: 14px; margin-bottom: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-input); scroll-margin-top: 90px; }
.review-form .btn { justify-self: start; }
.star-pick { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-pick input { position: absolute; opacity: 0; pointer-events: none; }
.star-pick label { cursor: pointer; color: var(--border-strong); margin: 0; transition: color 0.12s, transform 0.12s; }
.star-pick label:hover { transform: scale(1.1); }
.star-pick label:has(input:checked), .star-pick label:has(input:checked) ~ label, .star-pick label:hover, .star-pick label:hover ~ label { color: #eab308; }
.star-pick label:has(input:focus-visible) { outline: 2px solid var(--accent); border-radius: 6px; }

/* ---------- Dialogs ---------- */
.ds-dialog.dlg-wide { width: min(1000px, calc(100vw - 32px)); }
.dlg-form { display: grid; gap: 8px; }
.dlg-form label { margin: 4px 0 0; }
.dlg-form .hint { margin: 0; font-size: 0.82rem; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.offer-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.offer-quick .chip { border-radius: 999px; }
.pick-list { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.pick { display: flex !important; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-weight: 400; margin: 0 !important; }
.pick:has(input:checked) { border-color: var(--accent); background: var(--bg-hover); }
.pick input { margin: 0; }
.pick-none { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px dashed var(--border-strong); color: var(--text-dim); flex-shrink: 0; }
.lightbox img { width: 100%; max-height: 72vh; object-fit: contain; display: block; border-radius: var(--radius-sm); background: #000; }
.lb-bar { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; }

/* ---------- Sell page photos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 8px; }
.photo { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: var(--bg-hover); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.off img { opacity: 0.3; filter: grayscale(1); }
.photo-acts { position: absolute; inset: auto 6px 6px 6px; display: flex; gap: 4px; justify-content: flex-end; }
.photo-acts button { width: 28px; height: 28px; border-radius: 999px; border: 0; display: grid; place-items: center; background: rgba(9,9,11,.72); color: #fff; cursor: pointer; font-size: 0.8rem; }
.photo-acts button:hover { background: rgba(9,9,11,.92); }
.photo-tag { position: absolute; top: 6px; left: 6px; font-size: 0.68rem; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.92); color: #18181b; }
.photo.busy::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent); animation: shimmer 1s linear infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.photo-add { display: grid; place-items: center; gap: 4px; aspect-ratio: 16 / 10; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); color: var(--text-dim); cursor: pointer; font-size: 0.82rem; text-align: center; padding: 8px; margin: 0; font-weight: 400; }
.photo-add:hover, .photo-add.drag { border-color: var(--accent); color: var(--text); background: var(--bg-hover); }
.photo-add input { display: none; }
.switch-row { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; margin: 4px 0 14px !important; cursor: pointer; }
.switch-row input { margin-top: 3px; }
.edit-note { padding: 10px 12px; margin-bottom: 16px; border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid var(--border); font-size: 0.86rem; color: var(--text-dim); }

/* ---------- Browse filters ---------- */
.price-range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.price-range input { min-width: 0; height: 34px; padding: 6px 9px; font-size: 0.85rem; }
.price-range span { color: var(--text-faint); font-size: 0.8rem; }
.rail-checks { display: grid; gap: 6px; }
.rail-checks label { display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: 0.86rem; color: var(--text-dim); margin: 0; cursor: pointer; }
.rail-checks label:hover { color: var(--text); }
.rail-checks input { margin: 0; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.filter-bar:empty { display: none; }
.fchip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--text); font: inherit; font-size: 0.8rem; cursor: pointer; }
.fchip svg { width: 13px; height: 13px; color: var(--text-dim); }
.fchip:hover { border-color: var(--accent); }
.filter-bar .clear { background: none; border: 0; color: var(--text-dim); font: inherit; font-size: 0.8rem; cursor: pointer; padding: 4px 6px; }
.filter-bar .clear:hover { color: var(--text); }
.filter-bar .btn { margin-left: auto; }

/* ---------- Inbox ---------- */
.inbox-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; padding: 26px 0 16px; }
.inbox-head h1 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin: 0; }
.tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 0.68rem; font-weight: 700; }
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-elev); height: min(720px, calc(100vh - 210px)); min-height: 460px; }
.conv-list { border-right: 1px solid var(--border); overflow-y: auto; }
.conv { display: flex; gap: 10px; align-items: center; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.conv:hover { background: var(--bg-hover); }
.conv.active { background: var(--bg-hover); box-shadow: inset 3px 0 0 var(--accent); }
.conv-img { width: 46px; height: 46px; border-radius: var(--radius-sm); flex-shrink: 0; overflow: hidden; position: relative; background: linear-gradient(135deg, hsl(var(--h, 220) 60% 35%), hsl(calc(var(--h, 220) + 50) 60% 22%)); }
.conv-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.conv-img .avatar { position: absolute; right: -2px; bottom: -2px; border: 2px solid var(--bg-elev); }
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.conv-main strong, .conv-main .conv-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-main strong { font-size: 0.88rem; }
.conv-who { font-size: 0.76rem; color: var(--text-dim); }
.conv-last { font-size: 0.8rem; color: var(--text-dim); }
.conv.unread .conv-last { color: var(--text); font-weight: 500; }
.conv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 0.72rem; color: var(--text-faint); flex-shrink: 0; }
.unread-dot { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 0.68rem; font-weight: 700; display: grid; place-items: center; }

.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-empty { display: grid; place-items: center; height: 100%; color: var(--text-dim); text-align: center; padding: 24px; }
.thread-head { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.thread-head .conv-img { width: 40px; height: 40px; }
.thread-head .grow { flex: 1; min-width: 0; }
.thread-head strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-back { display: none; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: min(78%, 520px); padding: 8px 12px; border-radius: 16px; font-size: 0.9rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; align-self: flex-start; background: var(--bg-hover); animation: row-in 0.25s var(--ease) both; }
.msg.me { align-self: flex-end; background: var(--primary-bg); color: var(--primary-text); border-bottom-right-radius: 6px; }
.msg:not(.me) { border-bottom-left-radius: 6px; }
.msg-time { font-size: 0.68rem; color: var(--text-faint); align-self: flex-start; margin: 0 4px 6px; }
.msg-time.me { align-self: flex-end; }
.msg-day { align-self: center; font-size: 0.72rem; color: var(--text-faint); margin: 10px 0 4px; }
.msg-sys { align-self: center; max-width: 90%; text-align: center; font-size: 0.8rem; color: var(--text-dim); padding: 6px 12px; border-radius: 999px; background: var(--bg-input); border: 1px solid var(--border); margin: 4px 0; }
.offer-card { align-self: flex-start; width: min(320px, 90%); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 12px; background: var(--bg); margin: 4px 0; }
.offer-card.me { align-self: flex-end; }
.offer-card .oc-label { font-size: 0.76rem; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.offer-card .oc-amt { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.offer-card .oc-note { font-size: 0.86rem; margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.offer-card .oc-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.oc-status { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg-hover); color: var(--text-dim); margin-top: 6px; }
.oc-status.accepted { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.oc-status.pending { color: #60a5fa; background: color-mix(in srgb, #60a5fa 12%, transparent); }
.composer-row { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--border); }
.composer-row textarea { flex: 1; resize: none; min-height: 40px; max-height: 160px; border-radius: 20px; padding: 9px 14px; }
.composer-row .btn { border-radius: 999px; height: 40px; }
.thread-tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }

.notif-list, .alert-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-elev); }
.notif-list li, .alert-list li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--border); }
.notif-list li:first-child, .alert-list li:first-child { border-top: 0; }
.notif-list a { color: var(--text); flex: 1; min-width: 0; }
.notif-list li.unread { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.notif-list li.unread .n-ico { color: var(--text); }
.n-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-hover); color: var(--text-dim); flex-shrink: 0; }
.notif-list .hint { font-size: 0.76rem; }
.alert-list .grow { flex: 1; min-width: 0; }
.empty-note { padding: 40px 20px; text-align: center; color: var(--text-dim); border: 1px dashed var(--border-strong); border-radius: var(--radius); }

@media (max-width: 760px) {
  .inbox { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 190px); min-height: 420px; }
  .inbox .conv-list { border-right: 0; }
  .inbox.show-thread .conv-list { display: none; }
  .inbox:not(.show-thread) .thread { display: none; }
  .thread-back { display: grid; }
  .msg { max-width: 86%; }
}

/* The price box grew; let the whole column scroll together instead of one sticky card covering the others */
.listing-layout .price-box { position: static; }

/* ---------- Profile reviews ---------- */
.pf-count { margin-left: 6px; font-size: 0.75rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.pf-reviews { padding: 16px; }
.pf-review-stats { margin-bottom: 6px; }
.pf-review-stats .trust-facts { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); margin-top: 10px; }
.pf-review-stats .trust-facts b { display: inline-flex; align-items: center; gap: 4px; }
.pf-review-stats .trust-facts b svg { color: #fbbf24; }
.pf-reviews .feed-empty { padding: 24px 0 8px; }
.feed-tabs#tabs { scroll-margin-top: 80px; }
