/* UC Marketplace items app. Mobile first, one token set for light and dark.
   Loaded by items.html and (for the item cards) marketplace.html. */

:root {
  --uc-bg: #f6f7f9;
  --uc-surface: #ffffff;
  --uc-raised: #ffffff;
  --uc-line: #e4e7ec;
  --uc-line-strong: #cfd4dc;
  --uc-text: #111827;
  --uc-muted: #5b6474;
  --uc-brand: #182b49;
  --uc-brand-hover: #0f1e36;
  --uc-on-brand: #ffffff;
  --uc-accent: #0a7d92;
  --uc-good: #0f7a4f;
  --uc-good-bg: #e7f6ee;
  --uc-warn: #8a5a0b;
  --uc-warn-bg: #fdf3e0;
  --uc-bad: #b4233f;
  --uc-bad-bg: #fbe8ed;
  --uc-soft: #eef1f5;
  --uc-focus: rgba(10, 125, 146, .45);
  --uc-radius: 12px;
  --uc-shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --uc-shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
}
html[data-theme="dark"] {
  --uc-bg: #0b111c;
  --uc-surface: #121a28;
  --uc-raised: #182233;
  --uc-line: #243045;
  --uc-line-strong: #33415a;
  --uc-text: #e9eef6;
  --uc-muted: #9aa7bb;
  --uc-brand: #e9eef6;
  --uc-brand-hover: #ffffff;
  --uc-on-brand: #0b111c;
  --uc-accent: #5cc8db;
  --uc-good: #5fd39b;
  --uc-good-bg: #11301f;
  --uc-warn: #f2c06b;
  --uc-warn-bg: #33270f;
  --uc-bad: #ff8fa5;
  --uc-bad-bg: #3a1620;
  --uc-soft: #1b2638;
  --uc-focus: rgba(92, 200, 219, .5);
  --uc-shadow: none;
  --uc-shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
}

body.uc-app {
  background: var(--uc-bg); color: var(--uc-text); margin: 0;
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
.uc-app button, .uc-app input, .uc-app select, .uc-app textarea { font-family: inherit; }
/* Components below set display:flex/grid; the hidden attribute must still win. */
.uc-app [hidden], .mp-wrap [hidden] { display: none !important; }
body.uc-in-chat .uc-toast { bottom: calc(150px + env(safe-area-inset-bottom)); }
html, body { max-width: 100%; overflow-x: hidden; }
body.uc-noscroll { overflow: hidden; }
.uc-app *, .uc-app *::before, .uc-app *::after { box-sizing: border-box; }
:where(.uc-app) a { color: inherit; }
.uc-app :focus-visible { outline: 3px solid var(--uc-focus); outline-offset: 2px; border-radius: 6px; }
.uc-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { .uc-app * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- Shell ---------- */
.uc-wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px 108px; }
.uc-topbar {
  position: sticky; top: 0; z-index: 80; display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; margin: 0 -16px 12px; background: var(--uc-surface); border-bottom: 1px solid var(--uc-line);
}
.uc-brand { font-weight: 800; font-size: 18px; letter-spacing: -.01em; color: var(--uc-text); text-decoration: none; white-space: nowrap; }
.uc-brand span { color: var(--uc-accent); }
.uc-spacer { flex: 1; }
.uc-top-link {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--uc-text); text-decoration: none;
}
.uc-top-link:hover { background: var(--uc-soft); }
.uc-top-link.uc-primary { background: var(--uc-brand); color: var(--uc-on-brand); }
.uc-top-link.uc-primary:hover { background: var(--uc-brand-hover); }
.uc-top-links { display: none; gap: 2px; }
@media (min-width: 900px) { .uc-top-links { display: flex; } }
@media (max-width: 899px) { .uc-topbar .uc-top-link:not(.uc-keep) { display: none; } }

[data-badge] {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--uc-bad);
  color: #fff; font-size: 11px; font-weight: 800; font-style: normal; line-height: 18px; text-align: center;
}
.uc-nav [data-badge] { position: absolute; top: 2px; left: 50%; margin-left: 6px; }
.uc-top-link [data-badge] { margin-left: 2px; }
.uc-menu [data-badge] { margin-left: auto; }

/* Bottom navigation (phones and tablets) */
.uc-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: flex;
  background: var(--uc-surface); border-top: 1px solid var(--uc-line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.uc-nav a {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 48px; padding: 4px 2px; font-size: 11px; font-weight: 700; color: var(--uc-muted); text-decoration: none;
}
.uc-nav a[aria-current="page"] { color: var(--uc-text); }
.uc-nav svg { width: 22px; height: 22px; }
.uc-nav .uc-nav-sell { color: var(--uc-text); }
.uc-nav .uc-nav-sell .uc-nav-plus {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 32px; border-radius: 10px;
  background: var(--uc-brand); color: var(--uc-on-brand);
}
.uc-nav .uc-nav-sell svg { width: 20px; height: 20px; }
@media (min-width: 900px) { .uc-nav { display: none; } .uc-wrap { padding-bottom: 64px; } }

/* ---------- Type helpers ---------- */
.uc-h2 { font-size: 18px; font-weight: 800; margin: 22px 0 10px; letter-spacing: -.01em; }
#uc-cats-h { margin-top: 6px; }
.uc-h3 { font-size: 15px; font-weight: 800; margin: 0 0 6px; }
.uc-fine { font-size: 13px; color: var(--uc-muted); line-height: 1.5; margin: 6px 0; }
.uc-fine a, .uc-link { color: var(--uc-accent); font-weight: 700; }
.uc-link { background: none; border: 0; padding: 6px 0; font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; }
.uc-link:hover { text-decoration: underline; }
.uc-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.uc-page-head h1 { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.uc-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.uc-section-head a { font-size: 14px; font-weight: 700; color: var(--uc-accent); text-decoration: none; }

/* ---------- Buttons ---------- */
.uc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border: 1px solid var(--uc-brand); border-radius: var(--uc-radius); background: var(--uc-brand); color: var(--uc-on-brand);
  font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.uc-btn:hover { background: var(--uc-brand-hover); }
.uc-btn[disabled] { opacity: .55; cursor: not-allowed; }
.uc-btn-ghost { background: var(--uc-surface); color: var(--uc-text); border-color: var(--uc-line-strong); }
.uc-btn-ghost:hover { background: var(--uc-soft); }
.uc-btn-danger { background: var(--uc-bad); border-color: var(--uc-bad); color: #fff; }
.uc-btn-danger:hover { filter: brightness(.95); background: var(--uc-bad); }
.uc-btn-block { width: 100%; }
.uc-btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.uc-actions { display: flex; gap: 10px; margin-top: 16px; }
.uc-actions .uc-btn { flex: 1; }

/* ---------- Search and filters ---------- */
.uc-searchbar {
  display: flex; align-items: center; gap: 6px; min-height: 50px; padding: 4px 4px 4px 12px; margin: 4px 0 12px;
  background: var(--uc-surface); border: 1px solid var(--uc-line-strong); border-radius: 14px; box-shadow: var(--uc-shadow);
}
.uc-searchbar:focus-within { border-color: var(--uc-accent); box-shadow: 0 0 0 3px var(--uc-focus); }
.uc-searchbar-icon { color: var(--uc-muted); display: flex; }
.uc-searchbar input {
  flex: 1; min-width: 0; min-height: 40px; border: 0; background: transparent; color: var(--uc-text);
  font: inherit; font-size: 16px; outline: none;
}
.uc-searchbar input::-webkit-search-cancel-button { cursor: pointer; }
.uc-place {
  display: inline-flex; align-items: center; gap: 4px; max-width: 42%; min-height: 40px; padding: 0 10px;
  border: 0; border-left: 1px solid var(--uc-line); background: transparent; color: var(--uc-text);
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.uc-place span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-toolbar { margin-bottom: 4px; }
.uc-filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.uc-filters::-webkit-scrollbar { display: none; }
.uc-chip {
  flex: 0 0 auto; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--uc-line-strong);
  background: var(--uc-surface); color: var(--uc-text); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.uc-chip:hover { border-color: var(--uc-text); }
.uc-chip[aria-pressed="true"] { background: var(--uc-brand); border-color: var(--uc-brand); color: var(--uc-on-brand); }
.uc-chip-sm { min-height: 32px; font-size: 12.5px; padding: 0 12px; }
.uc-filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.uc-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--uc-line-strong); background: var(--uc-surface); color: var(--uc-text);
  font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.uc-pill b { background: var(--uc-brand); color: var(--uc-on-brand); border-radius: 999px; padding: 0 6px; font-size: 11px; }
.uc-pill-ghost { border-color: transparent; color: var(--uc-accent); }
.uc-results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 6px 0 10px; }
.uc-results-head h1 { font-size: 18px; font-weight: 800; margin: 0; }
.uc-results-head span { font-size: 13px; color: var(--uc-muted); white-space: nowrap; }
.uc-more { display: flex; justify-content: center; margin: 18px 0 4px; }
.uc-more .uc-btn { min-width: 200px; }

/* ---------- Home ---------- */
/* Phones: two swipeable rows so listings stay in the first screen.
   Wider screens: a plain grid. */
.uc-cat-grid {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 78px; gap: 8px;
  overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; scroll-snap-type: x proximity;
}
.uc-cat-grid::-webkit-scrollbar { display: none; }
.uc-cat-grid .uc-cat { scroll-snap-align: start; }
@media (min-width: 700px) {
  .uc-cat-grid { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; }
}
@media (min-width: 1000px) { .uc-cat-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); } }
.uc-cat {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; min-height: 80px;
  border-radius: var(--uc-radius); background: var(--uc-surface); border: 1px solid var(--uc-line);
  text-decoration: none; text-align: center; font-size: 11.5px; font-weight: 700; line-height: 1.25; color: var(--uc-text);
}
.uc-cat svg { color: var(--uc-accent); }
.uc-cat:hover { border-color: var(--uc-line-strong); }
.uc-cat span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.uc-sell-band {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 28px 0 0; padding: 20px;
  border-radius: 16px; background: var(--uc-brand); color: var(--uc-on-brand);
}
.uc-sell-band > div { flex: 1 1 260px; }
.uc-sell-band h2 { margin: 0 0 4px; font-size: 18px; }
.uc-sell-band p { margin: 0; font-size: 14px; opacity: .85; line-height: 1.5; }
.uc-sell-band .uc-btn { background: var(--uc-on-brand); color: var(--uc-brand); border-color: var(--uc-on-brand); }
.uc-promise { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 16px 0 0; }
@media (min-width: 700px) { .uc-promise { grid-template-columns: repeat(3, 1fr); } }
.uc-promise > div {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; padding: 14px;
  background: var(--uc-surface); border: 1px solid var(--uc-line); border-radius: var(--uc-radius); font-size: 13px;
}
.uc-promise svg { grid-row: span 2; color: var(--uc-accent); }
.uc-promise b { font-size: 14px; }
.uc-promise span { color: var(--uc-muted); }

/* ---------- Item grid and cards ---------- */
.uc-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .uc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 960px) { .uc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1160px) { .uc-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.uc-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--uc-surface); border: 1px solid var(--uc-line); border-radius: var(--uc-radius);
  text-decoration: none; color: inherit; transition: box-shadow .15s;
}
.uc-card:hover { box-shadow: var(--uc-shadow-lg); border-color: var(--uc-line-strong); }
/* The whole card is one link; the save heart sits on top as its own button. */
.uc-card-link { display: flex; flex-direction: column; flex: 1; min-width: 0; color: inherit; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.uc-card-link:focus-visible { outline: none; }
.uc-card:has(.uc-card-link:focus-visible) { outline: 3px solid var(--uc-focus); outline-offset: 2px; }
.uc-card:has(.uc-card-link:active) { transform: scale(.985); }
.uc-card { transition: box-shadow .15s, border-color .15s, transform .1s; }
.uc-card-action { display: inline-flex; align-items: center; gap: 3px; margin-top: 8px; font-size: 13px; font-weight: 800; color: var(--uc-accent); }
.uc-card-action svg { transition: transform .15s; }
.uc-card:hover .uc-card-action { text-decoration: underline; text-underline-offset: 3px; }
.uc-card:hover .uc-card-action svg { transform: translateX(3px); }
h3.uc-card-title { margin: 0; font-weight: 600; }
.uc-card-meta > span { overflow: hidden; text-overflow: ellipsis; }
.uc-card-preview { pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .uc-card, .uc-card-action svg { transition: none; } .uc-card:has(.uc-card-link:active) { transform: none; } }
.uc-card-img { position: relative; aspect-ratio: 1 / 1; background: var(--uc-soft); overflow: hidden; }
.uc-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.uc-noimg { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; color: var(--uc-muted); font-size: 13px; }
.uc-card-badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; }
.uc-badge { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, .95); color: #111827; }
.uc-b-sold { background: #111827; color: #fff; }
.uc-b-reserved { background: #fdf3e0; color: #8a5a0b; }
.uc-b-paused { background: #eef1f5; color: #5b6474; }
.uc-save {
  position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: rgba(255, 255, 255, .95); color: #111827; box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.uc-save[aria-pressed="true"] svg { fill: #e11d48; stroke: #e11d48; }
.uc-card-body { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px 11px; min-width: 0; }
.uc-card-price { font-size: 15.5px; font-weight: 800; letter-spacing: -.01em; }
.uc-card-title { font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.uc-card-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--uc-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-top: 2px; }
.uc-chiplet { display: inline-flex; align-items: center; gap: 3px; color: var(--uc-good); font-weight: 700; flex: 0 0 auto; }
.uc-skel { aspect-ratio: 3 / 4; border-radius: var(--uc-radius); background: var(--uc-soft); animation: uc-pulse 1.2s ease-in-out infinite; }
@keyframes uc-pulse { 50% { opacity: .5; } }
.uc-empty {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 36px 16px; color: var(--uc-muted); font-size: 14px; line-height: 1.5;
  background: var(--uc-surface); border: 1px dashed var(--uc-line-strong); border-radius: 16px;
}
.uc-empty b { color: var(--uc-text); font-size: 16px; }
.uc-empty .uc-btn { margin-top: 6px; }

/* ---------- Detail ---------- */
.uc-crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--uc-muted); margin: 4px 0 10px; }
.uc-crumbs a { color: var(--uc-muted); text-decoration: none; }
.uc-crumbs a:hover { color: var(--uc-text); }
.uc-detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 900px) { .uc-detail { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: start; } .uc-gallery { position: sticky; top: 76px; } }
.uc-gallery { position: relative; margin: 0 -16px; }
@media (min-width: 640px) { .uc-gallery { margin: 0; } }
.uc-gallery-main {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  aspect-ratio: 1 / 1; background: var(--uc-soft); position: relative;
}
@media (min-width: 640px) { .uc-gallery-main { border-radius: 16px; } }
.uc-gallery-main::-webkit-scrollbar { display: none; }
.uc-gallery-main img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.uc-gal-count { position: absolute; right: 12px; top: 12px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.uc-thumbs { display: none; gap: 8px; margin-top: 10px; overflow-x: auto; }
@media (min-width: 640px) { .uc-thumbs { display: flex; } }
.uc-thumb { flex: 0 0 64px; width: 64px; height: 64px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--uc-soft); cursor: pointer; }
.uc-thumb[aria-selected="true"] { border-color: var(--uc-text); }
.uc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.uc-detail-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.uc-detail-title { font-size: 21px; font-weight: 800; line-height: 1.25; margin: 0; letter-spacing: -.01em; overflow-wrap: anywhere; }
.uc-detail-price { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.uc-tag { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--uc-good-bg); color: var(--uc-good); letter-spacing: 0; }
.uc-tag-muted { background: var(--uc-soft); color: var(--uc-muted); }
.uc-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 13.5px; color: var(--uc-muted); }
.uc-facts > div { display: flex; align-items: center; gap: 6px; min-width: 0; }
.uc-facts span { overflow: hidden; text-overflow: ellipsis; }
.uc-facts > div:last-child { grid-column: 1 / -1; }
.uc-cta { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 480px) { .uc-cta { flex-direction: row; flex-wrap: wrap; } .uc-cta .uc-btn { flex: 1 1 160px; } }
.uc-quick { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.uc-quick::-webkit-scrollbar { display: none; }
.uc-quick-btn {
  flex: 0 0 auto; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--uc-line-strong);
  background: var(--uc-surface); color: var(--uc-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.uc-quick-btn:hover { border-color: var(--uc-text); }
.uc-icon-row { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--uc-line); border-bottom: 1px solid var(--uc-line); padding: 6px 0; }
.uc-icon-btn {
  flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 8px;
  border: 0; border-radius: 10px; background: transparent; color: var(--uc-text); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.uc-icon-btn:hover { background: var(--uc-soft); }
.uc-icon-btn[aria-pressed="true"] svg { fill: #e11d48; stroke: #e11d48; }
.uc-banner { padding: 10px 12px; border-radius: 10px; background: var(--uc-soft); font-size: 13.5px; font-weight: 600; }
.uc-banner-sold { background: #111827; color: #fff; }
.uc-banner-res { background: var(--uc-warn-bg); color: var(--uc-warn); }
.uc-card-box { padding: 14px; border-radius: var(--uc-radius); border: 1px solid var(--uc-line); background: var(--uc-surface); }
.uc-seller {
  display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--uc-line); border-radius: var(--uc-radius);
  background: var(--uc-surface); text-decoration: none; color: inherit;
}
.uc-seller:hover { border-color: var(--uc-line-strong); }
.uc-avatar {
  flex: 0 0 46px; width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--uc-brand); color: var(--uc-on-brand); font-weight: 800; font-size: 18px;
}
.uc-avatar-lg { flex-basis: 64px; width: 64px; height: 64px; font-size: 26px; }
.uc-seller-info { flex: 1; min-width: 0; }
.uc-seller-name { font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.uc-seller-sub { font-size: 13px; color: var(--uc-muted); margin-top: 2px; }
.uc-verified { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--uc-good-bg); color: var(--uc-good); }
.uc-verified-lg { font-size: 12.5px; margin-top: 6px; padding: 4px 10px; }
.uc-verified-lg .uc-link { font-size: 12px; margin-left: 6px; padding: 0; }
.uc-trustline { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12.5px; color: var(--uc-muted); }
.uc-trustline span { display: inline-flex; align-items: center; gap: 3px; }
.uc-chev { color: var(--uc-muted); }
.uc-desc { white-space: pre-wrap; line-height: 1.6; font-size: 15px; margin: 0; overflow-wrap: anywhere; }
.uc-safety { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--uc-radius); background: var(--uc-soft); font-size: 13px; line-height: 1.5; }
.uc-safety svg { flex: 0 0 auto; color: var(--uc-accent); margin-top: 1px; }
.uc-safety a { color: var(--uc-accent); font-weight: 700; }

/* ---------- Dialogs ---------- */
.uc-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 15, 25, .55); animation: uc-fade .15s ease; }
@keyframes uc-fade { from { opacity: 0; } }
.uc-dialog {
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; background: var(--uc-surface); color: var(--uc-text);
  border-radius: 18px 18px 0 0; padding: 4px 18px calc(18px + env(safe-area-inset-bottom)); animation: uc-up .2s ease;
}
@keyframes uc-up { from { transform: translateY(30px); opacity: .6; } }
.uc-dialog-wide { max-width: 640px; }
@media (min-width: 640px) { .uc-overlay { align-items: center; padding: 20px; } .uc-dialog { border-radius: 18px; padding-bottom: 20px; } }
.uc-dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 10px; background: var(--uc-surface); }
.uc-dialog-head h3 { margin: 0; font-size: 18px; font-weight: 800; }
.uc-close { flex: 0 0 36px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--uc-soft); color: var(--uc-text); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.uc-list { display: flex; flex-direction: column; margin-top: 8px; max-height: 60vh; overflow-y: auto; }
.uc-list-item {
  display: block; width: 100%; text-align: left; min-height: 48px; padding: 12px 6px; border: 0; border-bottom: 1px solid var(--uc-line);
  background: transparent; color: var(--uc-text); font: inherit; font-size: 15px; cursor: pointer; text-decoration: none;
}
.uc-list-item:hover { background: var(--uc-soft); }
.uc-list-item[aria-current="true"] { font-weight: 800; }
.uc-danger { color: var(--uc-bad); }
.uc-share-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.uc-copy { display: flex; gap: 8px; }
.uc-copy input { flex: 1; min-width: 0; }

/* ---------- Forms ---------- */
.uc-form-plain label, .uc-form-plain legend { display: block; font-size: 13.5px; font-weight: 700; margin: 14px 0 6px; color: var(--uc-text); }
.uc-form-plain input:not([type=radio]):not([type=checkbox]), .uc-form-plain select, .uc-form-plain textarea, .uc-input, .uc-copy input {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--uc-line-strong); border-radius: 10px;
  background: var(--uc-surface); color: var(--uc-text); font: inherit; font-size: 16px;
}
.uc-form-plain textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.uc-form-plain input:focus, .uc-form-plain select:focus, .uc-form-plain textarea:focus, .uc-input:focus { outline: none; border-color: var(--uc-accent); box-shadow: 0 0 0 3px var(--uc-focus); }
.uc-form-plain select:disabled { opacity: .6; }
.uc-form-plain .uc-btn { margin-top: 16px; }
.uc-form-plain .uc-actions .uc-btn { margin-top: 0; }
.uc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .uc-row { grid-template-columns: 1fr; } }
.uc-radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.uc-radio-col { display: flex; flex-direction: column; gap: 8px; }
.uc-form-plain .uc-radio, .uc-form-plain .uc-check { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
.uc-radio {
  min-height: 44px; padding: 0 14px; border: 1px solid var(--uc-line-strong); border-radius: 10px; background: var(--uc-surface);
  cursor: pointer; font-size: 14px;
}
.uc-radio:has(input:checked) { border-color: var(--uc-text); box-shadow: inset 0 0 0 1px var(--uc-text); }
.uc-radio-block { display: flex !important; width: 100%; }
.uc-radio input, .uc-check input { width: 18px; height: 18px; accent-color: var(--uc-brand); margin: 0; }
.uc-form-plain .uc-check { margin-top: 14px; min-height: 44px; }
.uc-fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.uc-err { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--uc-bad-bg); color: var(--uc-bad); font-size: 13.5px; font-weight: 700; }
.uc-field-err { color: var(--uc-bad); font-size: 13px; font-weight: 700; margin-top: 6px; }
.uc-field-err:empty { display: none; }
.uc-seg { display: flex; gap: 4px; padding: 4px; margin: 4px 0 8px; border-radius: 12px; background: var(--uc-soft); }
.uc-seg-btn { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--uc-muted); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.uc-seg-btn[aria-selected="true"] { background: var(--uc-surface); color: var(--uc-text); box-shadow: var(--uc-shadow); }
.uc-stars-input { border: 0; padding: 0; margin: 0; display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.uc-stars-input legend { width: 100%; }
.uc-stars-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.uc-stars-input label { font-size: 34px; line-height: 1; margin: 0 !important; color: var(--uc-line-strong); cursor: pointer; }
.uc-stars-input input:checked ~ label, .uc-stars-input label:hover, .uc-stars-input label:hover ~ label { color: #f5a524; }
.uc-stars-input input:focus-visible + label { outline: 3px solid var(--uc-focus); border-radius: 4px; }

/* ---------- Sell ---------- */
.uc-sell { max-width: 720px; margin: 0 auto; }
.uc-sell-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 4px; }
.uc-sell-head h1 { margin: 0; font-size: 22px; font-weight: 800; }
.uc-step { padding: 16px; margin-top: 12px; border: 1px solid var(--uc-line); border-radius: 16px; background: var(--uc-surface); }
.uc-step h2 { margin: 0; font-size: 16px; font-weight: 800; }
.uc-step > label:first-of-type { margin-top: 10px; }
.uc-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
@media (min-width: 520px) { .uc-photos { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.uc-photo { position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: var(--uc-soft); border: 1px solid var(--uc-line); }
.uc-photo img { width: 100%; height: 100%; object-fit: cover; }
.uc-photo-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
  border: 1.5px dashed var(--uc-line-strong); color: var(--uc-muted); font: inherit; font-size: 12.5px; font-weight: 700;
}
.uc-photo-add:hover { color: var(--uc-text); border-color: var(--uc-text); }
.uc-photo-cover { position: absolute; left: 6px; bottom: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.uc-photo-tools { position: absolute; top: 4px; right: 4px; display: flex; gap: 4px; }
.uc-photo-tools button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.uc-photo-prog { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .6); overflow: hidden; }
.uc-photo-prog span { display: block; height: 100%; background: var(--uc-accent); transition: width .2s; }
.uc-photo-err { border-color: var(--uc-bad); }
.uc-photo-retry { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 0; border-radius: 8px; padding: 6px 10px; background: var(--uc-bad); color: #fff; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.uc-sell-actions {
  position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 5; display: flex; gap: 10px; margin-top: 16px;
  padding: 10px 0; background: linear-gradient(to top, var(--uc-bg) 70%, transparent);
}
@media (min-width: 900px) { .uc-sell-actions { bottom: 0; } }
.uc-sell-actions .uc-btn { flex: 1; }
.uc-preview-card { max-width: 230px; margin: 4px 0 12px; }
.uc-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 0 0 12px; }
.uc-kv dt { color: var(--uc-muted); }
.uc-kv dd { margin: 0; }
.uc-gate { max-width: 420px; margin: 40px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.uc-gate svg { color: var(--uc-accent); }
.uc-gate h1 { font-size: 22px; margin: 4px 0 0; }
.uc-gate p { color: var(--uc-muted); line-height: 1.5; margin: 0 0 8px; }

/* ---------- Profile and stats ---------- */
.uc-profile { display: flex; align-items: center; gap: 14px; margin: 8px 0 14px; }
.uc-profile-main { min-width: 0; }
.uc-profile h1 { font-size: 21px; margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.uc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
@media (min-width: 600px) { .uc-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.uc-stats > div { padding: 12px; border-radius: var(--uc-radius); background: var(--uc-surface); border: 1px solid var(--uc-line); min-width: 0; }
.uc-stats b { display: block; font-size: 19px; font-weight: 800; }
.uc-stats span { display: block; font-size: 12px; color: var(--uc-muted); margin-top: 2px; }
.uc-reviews { display: flex; flex-direction: column; gap: 10px; }
.uc-review { padding: 14px; border-radius: var(--uc-radius); background: var(--uc-surface); border: 1px solid var(--uc-line); }
.uc-review p { margin: 6px 0 0; line-height: 1.55; font-size: 14px; }
.uc-review-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.uc-stars { color: #f5a524; letter-spacing: 1px; }
.uc-menu { display: flex; flex-direction: column; margin: 8px 0 16px; border-radius: 16px; overflow: hidden; background: var(--uc-surface); border: 1px solid var(--uc-line); }
.uc-menu a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; border-bottom: 1px solid var(--uc-line); text-decoration: none; font-weight: 700; font-size: 15px; }
.uc-menu a:last-child { border-bottom: 0; }
.uc-menu a:hover { background: var(--uc-soft); }
.uc-menu svg { color: var(--uc-muted); flex: 0 0 auto; }

/* ---------- Rows (listings, offers, threads, notifications) ---------- */
.uc-rows { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--uc-surface); border: 1px solid var(--uc-line); }
.uc-row-item { position: relative; display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--uc-line); text-decoration: none; color: inherit; align-items: flex-start; }
.uc-row-item:last-child { border-bottom: 0; }
a.uc-row-item:hover { background: var(--uc-soft); }
.uc-row-thumb { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--uc-soft); display: block; }
.uc-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.uc-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.uc-row-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.uc-row-title { font-weight: 800; font-size: 15px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-row-sub { font-size: 13px; color: var(--uc-muted); }
.uc-row-sub b { color: var(--uc-text); }
.uc-row-note { font-size: 13px; font-style: italic; color: var(--uc-muted); overflow-wrap: anywhere; }
.uc-row-preview { font-size: 13.5px; color: var(--uc-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-row-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--uc-muted); }
.uc-row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.uc-hot { color: var(--uc-warn); font-weight: 800; }
.uc-unread .uc-row-title, .uc-unread .uc-row-preview { color: var(--uc-text); font-weight: 800; }
.uc-dot { position: absolute; right: 14px; bottom: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--uc-accent); }
.uc-status { font-weight: 800; }
.uc-status-active, .uc-status-accepted, .uc-status-delivered { color: var(--uc-good); }
.uc-status-reserved, .uc-status-pending, .uc-status-quoted, .uc-status-requested, .uc-status-assigned { color: var(--uc-warn); }
.uc-status-declined, .uc-status-cancelled, .uc-status-withdrawn { color: var(--uc-bad); }
.uc-note-icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: var(--uc-soft); color: var(--uc-accent); display: flex; align-items: center; justify-content: center; }

/* ---------- Chat ---------- */
.uc-main-chat { margin: 0 -16px; }
@media (min-width: 900px) { .uc-main-chat { margin: 0; } }
.uc-chat {
  display: flex; flex-direction: column; height: calc(100dvh - 62px - 66px - env(safe-area-inset-bottom));
  background: var(--uc-surface); border-top: 1px solid var(--uc-line);
}
@media (min-width: 900px) { .uc-chat { height: calc(100dvh - 100px); border: 1px solid var(--uc-line); border-radius: 16px; overflow: hidden; } }
.uc-chat-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--uc-line); }
.uc-chat-item { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: center; text-decoration: none; }
.uc-chat-item .uc-row-thumb { flex-basis: 44px; width: 44px; height: 44px; }
.uc-chat-item > div:last-child { min-width: 0; }
.uc-back, .uc-icon-only { flex: 0 0 auto; width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; color: var(--uc-text); display: flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; }
.uc-back:hover, .uc-icon-only:hover { background: var(--uc-soft); }
.uc-offer-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; background: var(--uc-warn-bg); color: var(--uc-warn); font-size: 14px; }
.uc-offer-bar b { color: var(--uc-text); }
.uc-offer-bar .uc-row-actions { margin-top: 0; }
.uc-thread { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--uc-bg); overscroll-behavior: contain; }
.uc-day { align-self: center; font-size: 12px; color: var(--uc-muted); padding: 8px 0 4px; font-weight: 700; }
.uc-msg { position: relative; max-width: 80%; padding: 8px 12px 6px; border-radius: 16px; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; display: flex; flex-direction: column; }
.uc-msg-them { align-self: flex-start; background: var(--uc-surface); border: 1px solid var(--uc-line); border-bottom-left-radius: 6px; }
.uc-msg-me { align-self: flex-end; background: var(--uc-brand); color: var(--uc-on-brand); border-bottom-right-radius: 6px; }
.uc-msg-time { align-self: flex-end; font-size: 11px; opacity: .65; margin-top: 2px; }
.uc-msg-img { display: block; max-width: 220px; max-height: 260px; border-radius: 10px; margin-bottom: 4px; }
.uc-msg-flag { position: absolute; right: -30px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: var(--uc-muted); cursor: pointer; opacity: .45; display: flex; align-items: center; justify-content: center; }
.uc-msg-flag:hover, .uc-msg-flag:focus-visible { opacity: 1; background: var(--uc-soft); }
.uc-msg-system { align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--uc-warn-bg); color: var(--uc-warn); font-size: 13px; font-weight: 800; }
.uc-msg-system .uc-msg-time { margin: 0 0 0 4px; font-weight: 600; }
.uc-chat-empty { margin: auto; max-width: 320px; text-align: center; color: var(--uc-muted); font-size: 14px; line-height: 1.5; }
.uc-quick-chat { padding: 8px 12px 0; background: var(--uc-surface); }
.uc-compose { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--uc-surface); }
@media (max-width: 899px) { .uc-compose { padding-bottom: 8px; } }
.uc-compose textarea {
  flex: 1; min-width: 0; min-height: 44px; max-height: 120px; padding: 11px 14px; resize: none; border-radius: 22px;
  border: 1px solid var(--uc-line-strong); background: var(--uc-bg); color: var(--uc-text); font: inherit; font-size: 16px; line-height: 1.35;
}
.uc-compose textarea:focus { outline: none; border-color: var(--uc-accent); }
.uc-send { flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--uc-brand); color: var(--uc-on-brand); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.uc-send[disabled] { opacity: .5; }

/* ---------- Toast ---------- */
.uc-toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 2000;
  max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px; background: #111827; color: #fff;
  font-size: 14px; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: uc-up .2s ease;
}
.uc-toast-err { background: #b4233f; }
@media (min-width: 900px) { .uc-toast { bottom: 28px; } }

/* ---------- Prose ---------- */
.uc-prose { max-width: 720px; font-size: 15px; line-height: 1.65; }
.uc-prose h2 { font-size: 17px; margin: 22px 0 6px; }
.uc-prose ul { padding-left: 20px; margin: 0; }
.uc-prose li { margin-bottom: 6px; }

/* Item cards when they appear inside marketplace.html */
.mp-wrap .uc-card { background: #fff; }
html[data-theme="dark"] .mp-wrap .uc-card { background: #121a28; border-color: #243045; }
.uc-filters-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.uc-filters-row select, .uc-filters-row input {
  min-height: 40px; padding: 0 12px; border: 1px solid var(--uc-line-strong); border-radius: 10px;
  background: var(--uc-surface); color: var(--uc-text); font: inherit; font-size: 14px;
}
.uc-price-range { display: flex; align-items: center; gap: 6px; }
.uc-price-range input { width: 104px; }
