/* Lotwatch: auction tracker UI */
:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f1efea;
  --text: #16150f;
  --text-2: #57534e;
  --text-3: #8a857d;
  --line: #e7e4dd;
  --line-strong: #d6d2c8;
  --brand: #1f6f4a;
  --brand-ink: #ffffff;
  --brand-soft: #e5f1ea;
  --good: #16794c;
  --good-soft: #e3f3ea;
  --warn: #a5560a;
  --warn-soft: #fbefe0;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --violet: #5b4bc4;
  --violet-soft: #ecebfb;
  --heart: #e0245e;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(22, 21, 15, .05), 0 2px 8px rgba(22, 21, 15, .04);
  --shadow-hover: 0 2px 4px rgba(22, 21, 15, .06), 0 12px 28px rgba(22, 21, 15, .10);
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0d; --surface: #181816; --surface-2: #22211e; --text: #f2f1ec; --text-2: #b6b2a9; --text-3: #85817a;
    --line: #2a2926; --line-strong: #3a3935; --brand: #4fbf86; --brand-ink: #08130d; --brand-soft: #16271e;
    --good: #5cd394; --good-soft: #14281d; --warn: #f0a75a; --warn-soft: #2c2114; --bad: #ff8a80; --bad-soft: #2e1715;
    --violet: #a99cff; --violet-soft: #221f3a; --heart: #ff5c8a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-hover: 0 10px 30px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
.num, .price, td.num { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.topbar .inner { max-width: 1560px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; }
.brand .mark svg { width: 16px; height: 16px; color: var(--brand-ink); }
nav.tabs { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 11px; }
nav.tabs a { color: var(--text-2); padding: 6px 13px; border-radius: 8px; font-size: 14px; font-weight: 500; }
nav.tabs a:hover { color: var(--text); text-decoration: none; }
nav.tabs a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid;
  place-items: center; font-weight: 700; font-size: 14px; text-transform: uppercase; }
.avatar:hover { text-decoration: none; filter: brightness(.97); }
@media (max-width: 720px) {
  .topbar .inner { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  nav.tabs { order: 3; width: 100%; justify-content: space-between; }
  nav.tabs a { flex: 1; text-align: center; padding: 6px 4px; }
}

main { max-width: 1560px; margin: 0 auto; padding: 22px 20px 60px; }
@media (max-width: 720px) { main { padding: 16px 14px 48px; } }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; margin: 0; }
.sub { color: var(--text-2); margin: 4px 0 0; font-size: 14px; }
h2 { font-size: 17px; letter-spacing: -.01em; margin: 30px 0 12px; display: flex; align-items: center; gap: 8px; }
h2 .count { color: var(--text-3); font-weight: 500; font-size: 14px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- controls ---------- */
button, .btn { font: inherit; font-size: 14px; font-weight: 600; border: 1px solid transparent; background: var(--brand); color: var(--brand-ink);
  border-radius: 10px; padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; transition: filter .15s, background .15s; }
button:hover, .btn:hover { filter: brightness(1.06); text-decoration: none; }
button:disabled { opacity: .6; cursor: default; }
button.ghost, .btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
button.ghost:hover { background: var(--surface-2); filter: none; }
button.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
button.link { background: none; border: 0; color: var(--brand); padding: 0; font-weight: 500; }
input[type=text], input[type=number], input[type=password], input[type=search], select, textarea {
  font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 9px 11px; outline: none; transition: border-color .15s, box-shadow .15s; width: 100%; }
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
select { width: auto; padding-right: 28px; }

.toolbar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
  display: grid; gap: 10px; margin-bottom: 18px; }
.toolbar .label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); min-width: 78px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2);
  border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; transition: all .12s; }
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip input { display: none; }
.chip:has(input:checked) { background: var(--text); border-color: var(--text); color: var(--bg); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { background: transparent; color: var(--text-2); border: 0; padding: 5px 11px; font-weight: 500; border-radius: 8px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.searchbar { position: relative; }
.searchbar input { font-size: 17px; padding: 13px 16px 13px 44px; border-radius: 14px; box-shadow: var(--shadow); }
.searchbar svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; line-height: 1; border-radius: 6px;
  padding: 4px 7px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; color: inherit; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); text-decoration: none; }
.card .media { position: relative; aspect-ratio: 4 / 3; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.card .media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.card .media .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 13px; }
.card .overlay { position: absolute; left: 8px; top: 8px; display: flex; gap: 5px; flex-wrap: wrap; right: 46px; }
.card .body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .title { font-size: 14px; font-weight: 500; line-height: 1.35; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.card .pricerow { display: flex; align-items: baseline; gap: 8px; }
.card .price { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.card .bids { font-size: 12px; color: var(--text-3); }
.card .usual { font-size: 12.5px; color: var(--text-2); }
.card .foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); display: flex; justify-content: space-between;
  gap: 6px; font-size: 12px; color: var(--text-3); }
.card .foot .ends.soon { color: var(--bad); font-weight: 600; }
@media (max-width: 520px) { .card .price { font-size: 17px; } .card .body { padding: 9px 10px 10px; } }

.heart { position: absolute; top: 7px; right: 7px; width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0;
  background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--text-3); display: grid; place-items: center;
  box-shadow: var(--shadow); cursor: pointer; z-index: 2; transition: transform .12s, color .12s; }
.heart:hover { transform: scale(1.08); filter: none; color: var(--heart); }
.heart svg { width: 18px; height: 18px; }
.heart.on { color: var(--heart); }
.heart.on svg path { fill: currentColor; }
.heart.big { position: static; width: auto; height: auto; border-radius: 10px; padding: 8px 13px; gap: 6px; display: inline-flex;
  font-size: 14px; font-weight: 600; background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); box-shadow: none; }
.heart.big.on { color: var(--heart); border-color: color-mix(in srgb, var(--heart) 40%, transparent); }

/* saved strip */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 220px; gap: 12px; overflow-x: auto; padding: 2px 2px 10px;
  scroll-snap-type: x proximity; margin: 0 -2px 8px; }
.strip .card { scroll-snap-align: start; }
.strip::-webkit-scrollbar { height: 8px; }
.strip::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }

/* skeleton */
.skel { background: linear-gradient(90deg, var(--surface-2) 0%, var(--line) 50%, var(--surface-2) 100%); background-size: 200% 100%;
  animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.card.skeleton .media { background: var(--surface-2); }
.card.skeleton .line { height: 12px; margin: 4px 0; }

.empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--text-2); }
.err { color: var(--bad); font-size: 14px; }
.notice { background: var(--bad-soft); color: var(--bad); border-radius: var(--radius-sm); padding: 10px 12px; }

/* ---------- lot page ---------- */
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 14px; margin-bottom: 12px; }
.lot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: start; }
@media (max-width: 860px) { .lot { grid-template-columns: 1fr; gap: 18px; } }
.gallery { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; position: sticky; top: 78px; }
@media (max-width: 860px) { .gallery { position: relative; top: auto; aspect-ratio: 4 / 3; } }
.gallery img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.lot h1 { font-size: 22px; font-weight: 650; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin: 14px 0; }
.stat { background: var(--surface); padding: 11px 13px; }
.stat .v { font-size: 21px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.stat.hi .v { color: var(--brand); }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 12px 0; }
.meta dt { color: var(--text-3); }
.meta dd { margin: 0; }
.tip { background: var(--brand-soft); color: var(--text); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; margin: 12px 0; }
.desc { white-space: pre-wrap; font-size: 13.5px; color: var(--text-2); max-height: 260px; overflow: auto; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 14px; }

/* ---------- tables ---------- */
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { color: var(--text-3); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); position: sticky; top: 0; }
td.num, th.num { text-align: right; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.mine td { background: var(--brand-soft); }

/* ---------- forms / watchlist ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form label, .stack label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.form .full { grid-column: 1 / -1; }
.form .hint { font-weight: 400; color: var(--text-3); font-size: 12px; }
@media (max-width: 720px) { .form { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 12px; }
.watch-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.watch-item:last-child { border-bottom: 0; }
.watch-item .name { font-weight: 600; color: var(--text); }
.watch-item .rules { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.watch-item .acts { margin-left: auto; display: flex; gap: 6px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.authbox { max-width: 400px; margin: 4vh auto 0; }
.authbox h1 { text-align: center; }
.authbox .sub { text-align: center; margin-bottom: 18px; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--brand); }
code.topic { font-size: 14px; padding: 2px 7px; background: var(--surface-2); border-radius: 6px; user-select: all; }
footer.site { max-width: 1560px; margin: 0 auto; padding: 0 20px 30px; color: var(--text-3); font-size: 12.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- timers ---------- */
.timer { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; z-index: 2;
  font-size: 12.5px; font-weight: 700; padding: 5px 9px; border-radius: 8px; font-variant-numeric: tabular-nums;
  background: rgba(22, 21, 15, .82); color: #fff; backdrop-filter: blur(6px); }
.timer svg { width: 14px; height: 14px; }
.timer.today { background: rgba(22, 21, 15, .86); }
.timer.soon { background: #c2410c; }
.timer.urgent { background: #dc2626; animation: pulse 1.6s ease-in-out infinite; }
.timer.later { background: rgba(22, 21, 15, .62); font-weight: 600; }
.timer.staging { background: var(--violet); }
.timer.ended { background: rgba(22, 21, 15, .55); font-weight: 600; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, .25); } }
.timer.flat { position: static; font-size: 11.5px; padding: 3px 7px; border-radius: 6px; backdrop-filter: none; animation: none; }
.timer.flat svg { width: 12px; height: 12px; }

.countdown { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 12px 0 2px; padding: 12px 14px;
  border-radius: var(--radius-sm); background: var(--surface-2); }
.countdown .big { display: inline-flex; align-items: center; gap: 8px; font-size: 28px; font-weight: 800; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; }
.countdown .big svg { width: 24px; height: 24px; }
.countdown .when { color: var(--text-2); font-size: 14px; }
.countdown.soon { background: #fff1e6; } .countdown.soon .big { color: #c2410c; }
.countdown.urgent { background: var(--bad-soft); } .countdown.urgent .big { color: var(--bad); }
@media (prefers-color-scheme: dark) { .countdown.soon { background: #2c1b10; } }

/* ---------- deals layout: sidebar ---------- */
.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 26px; align-items: start; }
.sidebar { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; display: grid; gap: 14px;
  padding-right: 4px; scrollbar-width: thin; }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 14px 14px; }
.filters summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 10px 0 4px; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary svg { width: 18px; height: 18px; }
.fgroup { padding-top: 12px; margin-top: 10px; border-top: 1px solid var(--line); }
.fgroup:first-of-type { border-top: 0; margin-top: 2px; }
.fgroup .label { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 8px; }
.fgroup .label .link { font-size: 12px; text-transform: none; letter-spacing: 0; }
.fgroup select { width: 100%; }
.seg.full { display: flex; width: 100%; }
.seg.full button { flex: 1; justify-content: center; }
.saved .side-title { font-weight: 700; display: flex; align-items: center; gap: 6px; margin: 2px 2px 8px; }
.saved .count { color: var(--text-3); font-weight: 500; font-size: 13px; }
.minis { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.mini { display: flex; gap: 10px; padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--text); }
.mini:last-child { border-bottom: 0; }
.mini:hover { background: var(--surface-2); text-decoration: none; }
.mini .thumb { flex: 0 0 52px; height: 52px; border-radius: 8px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.mini .thumb img { width: 100%; height: 100%; object-fit: contain; }
.mini .info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mini .t { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini .row { gap: 8px; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 14px; }
  .sidebar { position: static; max-height: none; overflow: visible; padding: 0; }
  .filters:not([open]) { padding-bottom: 4px; }
}

/* ---------- three columns: filters | results | saved ---------- */
.layout { grid-template-columns: 256px minmax(0, 1fr) 288px; }
.rightbar { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; scrollbar-width: thin; padding-right: 2px; }
.saved-left { display: none; }
.side-sub { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 14px 2px 6px; }
.side-empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 16px; font-size: 13.5px; color: var(--text-2); }
.side-empty svg { width: 14px; height: 14px; vertical-align: -2px; color: var(--heart); }
.minis.dim .mini { opacity: .75; }
@media (max-width: 1250px) {
  .layout { grid-template-columns: 256px minmax(0, 1fr); }
  .rightbar { display: none; }
  .saved-left { display: block; }
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

/* ---------- supply / next appearance ---------- */
.supply { margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.supply-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 8px; }
.supply .next { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.supply .next .k { color: var(--text-2); font-size: 14px; }
.supply .next .v { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.supply .pill { font-size: 12.5px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 3px 9px; border-radius: 999px; }
.supply .upnext { display: block; background: var(--good-soft); color: var(--text); border-radius: 8px; padding: 9px 11px; margin-bottom: 10px; font-size: 14px; }
.supply .upnext:hover { text-decoration: none; filter: brightness(.98); }
.supply .upnext b { color: var(--good); }
.supply .hist { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.supply .h { font-size: 12px; background: var(--surface-2); border-radius: 6px; padding: 3px 7px; color: var(--text-2); display: inline-flex; gap: 6px; }
.supply .h b { color: var(--text); font-variant-numeric: tabular-nums; }

details.deleted { margin-top: 26px; }
details.deleted summary { cursor: pointer; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
details.deleted .count { color: var(--text-3); font-weight: 500; }

/* saved: a card that matches the Filters panel */
.sidecard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 14px 10px; }
.sidecard-head { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 10px 0 8px; }
.sidecard-head svg { width: 18px; height: 18px; color: var(--heart); }
.sidecard-head .count { color: var(--text-3); font-weight: 500; font-size: 13px; }
.sidecard .minis { background: none; border: 0; box-shadow: none; border-radius: 0; border-top: 1px solid var(--line); }
.sidecard .mini { padding: 10px 0; }
.sidecard .mini:hover { background: none; }
.sidecard .mini:hover .t { color: var(--brand); }
.sidecard .side-sub { margin: 10px 0 4px; }
.sidecard .side-empty { border: 0; background: var(--surface-2); padding: 12px; margin: 2px 0 6px; }

.range { display: flex; align-items: center; gap: 6px; }
.range input { width: 100%; min-width: 0; padding: 7px 8px; }
.range .pre { color: var(--text-3); margin-right: -4px; }
button.chip { font: inherit; font-size: 13px; font-weight: 500; }
button.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ---------- modal ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 18px; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.28); }
dialog.modal::backdrop { background: rgba(15, 15, 13, .45); backdrop-filter: blur(3px); }
dialog.modal form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-head .x { background: none; border: 0; color: var(--text-3); font-size: 26px; padding: 0 4px; line-height: 1; }
.modal-body { padding: 4px 20px 12px; overflow: auto; display: grid; gap: 12px; }
.modal-body label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.modal-body label.big { font-size: 15px; color: var(--text); }
.modal-body label.big input { font-size: 17px; padding: 12px 14px; }
.modal-body .hint { font-weight: 400; color: var(--text-3); font-size: 12.5px; margin: 0; }
.modal-body .lbl { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.modal-body .two { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; align-items: start; }
@media (max-width: 640px) { .modal-body .two { grid-template-columns: 1fr; } }
details.adv { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; }
details.adv summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text-2); }
details.adv[open] summary { margin-bottom: 10px; }
.preview { border-top: 1px solid var(--line); padding-top: 12px; }
.preview-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.plist { display: grid; }
.plist.loading { opacity: .5; }
.plist .mini { padding: 8px 0; border-bottom: 1px solid var(--line); }
.plist .mini:last-child { border-bottom: 0; }
.plist .mini:hover { background: none; }
.plist .mini:hover .t { color: var(--brand); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.pager:empty { display: none; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.modal-foot .err { margin-right: auto; }

/* ---------- collapsible side cards; on phones Filters + Saved sit side by side above results ---------- */
.savedbox > summary { list-style: none; cursor: pointer; }
.savedbox > summary::-webkit-details-marker { display: none; }
.filters summary .count { color: var(--text-3); font-weight: 500; font-size: 13px; }
.chev { display: none; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg); transition: transform .15s; position: relative; top: -2px; }
details[open] > summary .chev { transform: rotate(-135deg); top: 2px; }
@media (max-width: 900px) {
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
  .sidebar > .filters[open], .sidebar > .saved-left:has(details[open]) { grid-column: 1 / -1; }
  .sidebar > .filters, .savedbox { padding-top: 0; }
  .sidebar > .filters:not([open]), .savedbox:not([open]) { padding-bottom: 0; }
  .sidebar > .filters > summary, .savedbox > summary { padding: 11px 0; }
  .chev { display: inline-block; }
  .sidebar .saved-left { display: block; }
}

/* ---------- watch preview: upcoming vs ended ---------- */
.pgroup { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 10px 2px 4px; }
.pgroup:first-child { margin-top: 2px; }
.pgroup.up { color: var(--brand); }
.plist .mini .badge { font-size: 11px; padding: 1px 7px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
label.check input { width: auto; margin-top: 3px; }
label.check .hint { display: block; font-weight: 400; }
button.small { padding: 6px 12px; font-size: 13px; }
button svg { width: 15px; height: 15px; vertical-align: -3px; }
.form label.check, label.check { flex-direction: row; display: flex; }
label.check > span { flex: 1; }

/* ---------- bid history: one highlight colour per bidder ---------- */
.bidder { display: inline-block; padding: 2px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; font-weight: 600;
  background: hsl(var(--h) 85% 90%); color: hsl(var(--h) 55% 28%); box-shadow: inset 0 0 0 1px hsl(var(--h) 60% 80%); }
@media (prefers-color-scheme: dark) {
  .bidder { background: hsl(var(--h) 45% 22%); color: hsl(var(--h) 80% 82%); box-shadow: inset 0 0 0 1px hsl(var(--h) 45% 32%); }
}
.bidder.once { background: var(--surface-2); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; }
.formhead { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 10px 0 0; }
.savedopts { display: flex; flex-direction: column; gap: 12px; padding-left: 4px; }
.savedopts.off { opacity: .45; pointer-events: none; }
.savedopts .lbl { font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: -4px; }
.bidder.me { font-weight: 800; box-shadow: inset 0 0 0 2px hsl(var(--h) 60% 45%); }
.stack label.switch, .form label.switch { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; color: var(--text); }
.stack label.switch input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
