/* auction-view: dark, opaque, vibrant text. No glass / blur. */
:root {
  --bg: #0b0d12; --panel: #12151d; --panel2: #181c27; --line: #262c3b; --text: #eef2ff; --muted: #8b93a7;
  --yellow: #ffd23f; --blue: #3fa7ff; --purple: #b46cff; --green: #43e97b; --orange: #ff7a45; --red: #ff4d6d;
  --cyan: #2ee6d6; --pink: #ff5fd2; --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--red); min-height: 1.2em; }
button, input, select, textarea { font: inherit; color: var(--text); }
input, select, textarea { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
input[type=number] { width: 120px; }

.btn { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--blue); text-decoration: none; }
.btn.primary { background: var(--yellow); color: #111; border-color: var(--yellow); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 5px 9px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.on { border-color: var(--yellow); color: var(--yellow); }

.brand { font-weight: 800; font-size: 18px; letter-spacing: .3px; color: var(--yellow); white-space: nowrap; }
.brand span { color: var(--pink); }
.brand.big { font-size: 34px; }

.login { position: fixed; inset: 0; display: grid; place-items: center; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px; max-width: 420px;
  display: flex; flex-direction: column; gap: 12px; text-align: center; }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 18px;
  background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-weight: 600; }
nav a:hover { color: var(--text); background: var(--panel2); text-decoration: none; }
nav a.active { color: #111; background: var(--cyan); }
.stats { display: flex; gap: 12px; margin-left: auto; flex-wrap: wrap; }
.stat { color: var(--muted); font-size: 12px; }
.stat b { color: var(--text); font-size: 15px; margin-right: 3px; }
.stat.hot b { color: var(--orange); }
.stat.good b { color: var(--green); }
.health { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.ok { background: var(--green); } .dot.bad { background: var(--red); } .dot.wait { background: var(--yellow); }
.dot.run { background: var(--blue); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 18px; background: var(--bg);
  border-bottom: 1px solid var(--line); position: sticky; top: 53px; z-index: 15; }
#f-q { flex: 1 1 260px; min-width: 220px; }
#f-state { width: 120px; }
.chips { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.chips button { background: var(--panel2); border: 0; border-right: 1px solid var(--line); padding: 6px 10px; cursor: pointer; color: var(--muted); }
.chips button:last-child { border-right: 0; }
.chips button.on { background: #1f2a44; color: var(--yellow); font-weight: 700; }
.tick { display: inline-flex; gap: 5px; align-items: center; color: var(--muted); }

main { padding: 16px 18px 40px; }
.count-line { color: var(--muted); margin: 0 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; position: relative; }
.card:hover { border-color: var(--blue); }
.card.sel { outline: 2px solid var(--yellow); }
.card.watched { border-color: var(--yellow); }
.card .img { aspect-ratio: 1 / 1; background: #07080c; display: grid; place-items: center; overflow: hidden; position: relative; }
.card .img img { width: 100%; height: 100%; object-fit: contain; }
.card .img .noimg { color: var(--muted); }
.card .imgcount { position: absolute; right: 6px; bottom: 6px; background: #000c; color: var(--text); font-size: 11px;
  padding: 1px 6px; border-radius: 6px; }
.card .body { padding: 10px 11px 11px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .title { font-weight: 600; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.card .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card .price { font-size: 18px; font-weight: 800; color: var(--text); }
.card .allin { color: var(--muted); font-size: 12px; }
.card .meta { color: var(--muted); font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.card .acts { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.card .acts button { background: #000b; border: 1px solid #fff2; color: var(--text); border-radius: 7px; width: 28px; height: 28px; cursor: pointer; }
.card .acts button.on { color: var(--yellow); border-color: var(--yellow); }
.badges { position: absolute; top: 6px; left: 6px; display: flex; gap: 4px; flex-wrap: wrap; max-width: 75%; }
.badge { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; color: #111; background: var(--muted); white-space: nowrap; }
.badge.slab { background: var(--yellow); } .badge.single { background: var(--blue); } .badge.lot { background: var(--purple); }
.badge.sealed { background: var(--orange); } .badge.estate { background: var(--green); } .badge.other { background: var(--muted); }
.badge.grade { background: #fff; } .badge.lang { background: var(--pink); } .badge.low { background: #39405a; color: var(--text); }
.badge.cert-match { background: var(--green); } .badge.cert-mismatch, .badge.cert-not_found { background: var(--red); color: #fff; }
.deal { font-weight: 800; padding: 1px 7px; border-radius: 6px; font-size: 12px; }
.deal.great { background: var(--green); color: #111; } .deal.good { background: #1d4d33; color: var(--green); }
.deal.meh { background: #2a2f3f; color: var(--muted); } .deal.bad { background: #4a1d27; color: var(--red); }
.cd { font-variant-numeric: tabular-nums; font-weight: 700; }
.cd.urgent { color: var(--red); } .cd.soon { color: var(--orange); } .cd.later { color: var(--cyan); }
.src { font-weight: 700; }
.src.ebay { color: var(--blue); } .src.hibid { color: var(--orange); } .src.shopgoodwill { color: var(--cyan); } .src.estatesales_net { color: var(--green); }

.more-wrap { display: flex; justify-content: center; padding: 0 0 40px; }

/* ending-soon timeline */
.tl-group { margin-bottom: 18px; }
.tl-group h3 { margin: 0 0 8px; color: var(--cyan); font-size: 14px; text-transform: uppercase; letter-spacing: .6px; }
.tl-row { display: grid; grid-template-columns: 90px 64px 1fr 110px 110px 90px 80px; gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; cursor: pointer; }
.tl-row:hover { border-color: var(--blue); }
.tl-row img { width: 56px; height: 56px; object-fit: contain; background: #07080c; border-radius: 6px; }
.tl-row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tables */
table.t { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.t th, table.t td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.t th { color: var(--muted); font-weight: 600; background: var(--panel2); }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--panel2); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 16px; color: var(--yellow); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }

/* map */
.map-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.map-wrap svg { width: 100%; height: auto; display: block; }
.map-legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; margin-top: 8px; flex-wrap: wrap; }

/* drawer */
.scrim { position: fixed; inset: 0; background: #000a; z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(1100px, 100vw); background: var(--panel); z-index: 50;
  border-left: 1px solid var(--line); overflow-y: auto; padding: 18px 22px 40px; }
.drawer .close { position: sticky; top: 0; float: right; background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  width: 36px; height: 36px; border-radius: 8px; font-size: 22px; cursor: pointer; z-index: 2; }
.d-title { font-size: 20px; font-weight: 800; margin: 2px 50px 6px 0; line-height: 1.3; }
.d-sub { color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.d-top { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 900px) { .d-top { grid-template-columns: 1fr; } .tl-row { grid-template-columns: 70px 1fr 90px; } .tl-row .hide-sm { display: none; } }
.gallery .main { background: #07080c; border-radius: 10px; aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; cursor: zoom-in; border: 1px solid var(--line); }
.gallery .main img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; max-height: 230px; overflow-y: auto; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 2px solid transparent; cursor: pointer; background: #07080c; }
.thumbs img.on { border-color: var(--yellow); }
.thumbs img.vision-yes { box-shadow: 0 0 0 2px var(--green); }
.ref { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; }
.ref img { width: 150px; border-radius: 8px; background: #07080c; cursor: zoom-in; }
.bigbtn { display: flex; justify-content: center; width: 100%; padding: 13px; font-size: 16px; margin: 4px 0 14px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 5px 12px; margin-bottom: 14px; }
.kv div:nth-child(odd) { color: var(--muted); }
.kv .big { font-size: 22px; font-weight: 800; }
.box { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.box h4 { margin: 0 0 8px; color: var(--cyan); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.calc { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.calc output { font-size: 20px; font-weight: 800; color: var(--green); }
.watch-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.watch-form textarea { grid-column: 1 / -1; min-height: 60px; }
.watch-form .acts { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.desc { white-space: pre-wrap; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  max-height: 420px; overflow-y: auto; color: #d7dcef; }
.spark { width: 100%; height: 70px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 80; background: #000; display: flex; flex-direction: column; }
.lb-stage { flex: 1; overflow: hidden; position: relative; cursor: grab; }
.lb-stage.drag { cursor: grabbing; }
.lb-stage img { position: absolute; left: 50%; top: 50%; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; max-width: none; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: #111c; color: #fff; border: 1px solid #fff3;
  width: 52px; height: 80px; font-size: 40px; cursor: pointer; border-radius: 10px; }
.lb-nav.prev { left: 12px; } .lb-nav.next { right: 12px; }
.lb-bar { display: flex; gap: 16px; align-items: center; padding: 10px 16px; background: #0b0d12; border-top: 1px solid var(--line); flex-wrap: wrap; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--yellow);
  color: var(--text); padding: 10px 16px; border-radius: 10px; z-index: 90; }
.empty { color: var(--muted); padding: 40px; text-align: center; }
.kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 12px; color: var(--muted); }
.badge.photo-real { background: rgba(67,233,123,.15); color: #43e97b; border-color: rgba(67,233,123,.4); }
/* Tailored (read-only) logins: owner-only controls are hidden; the server enforces it regardless. */
body[data-role="viewer"] .admin-only { display: none !important; }
body:not([data-tailored]) .tailored-only { display: none !important; }
.login-card .stack { display: grid; gap: 12px; margin-top: 14px; text-align: left; }
.login-card .stack label { display: grid; gap: 4px; font-size: 13px; color: var(--muted, #9aa); }
.login-card .stack input { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; color: inherit; font-size: 15px; }
.login-card .err { color: var(--red); margin: 10px 0 0; }

/* ── Track chart (static/chart.js) ───────────────────────────────────────── */
.tc { background: #0a0a0c; border: 1px solid #1c1c22; border-radius: 14px; padding: 18px 14px 14px; color: #e9eef5; }
.tc-title { font: 800 clamp(20px, 3.6vw, 38px)/1.12 "Arial Narrow", "Helvetica Neue", Arial, sans-serif; text-align: center;
  text-transform: uppercase; letter-spacing: .01em; margin: 2px 6px 10px; }
.tc-vs { color: #fff; }
.tc-stage { position: relative; height: clamp(300px, 52vw, 560px); }
.tc-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; touch-action: pan-y; }
.tc-axisline { stroke: #8a8f98; stroke-width: 1; }
.tc-gridline { stroke: #ffffff; stroke-opacity: .06; stroke-width: 1; }
.tc-ticklabel { fill: #9aa3ad; font: 12px ui-monospace, "SF Mono", Menlo, monospace; }
.tc-line, .tc-glow { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tc-line { stroke-width: 3; }
.tc-glow { stroke-width: 11; opacity: .34; }
.tc-dot { stroke: #0a0a0c; stroke-width: 1.5; }
.tc-head { stroke: #0a0a0c; stroke-width: 2; }
.tc-cross { stroke: #fff; stroke-opacity: .35; stroke-dasharray: 3 4; }
.tc-callouts { position: absolute; inset: 0; pointer-events: none; }
.tc-callout { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 10px; will-change: transform; transition: opacity .25s; }
.tc-box { min-width: 150px; padding: 7px 12px 8px; border: 1.5px solid var(--c); border-radius: 4px; background: rgba(8, 8, 10, .82);
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 35%, transparent); text-align: center; }
.tc-name { color: var(--c); font: 700 11px/1.2 "Arial Narrow", Arial, sans-serif; letter-spacing: .08em; }
.tc-price { color: var(--c); font: 800 26px/1.15 ui-monospace, "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; }
.tc-chg { color: var(--c); font: 700 17px/1.2 ui-monospace, "SF Mono", Menlo, monospace; }
.tc-img { position: relative; width: 58px; flex: none; }
.tc-img img { display: block; width: 58px; height: auto; border-radius: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.tc-badge { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); background: var(--c); color: #0a0a0c;
  font: 800 10px/1 Arial, sans-serif; padding: 3px 6px; border-radius: 3px; white-space: nowrap; }
.tc-period { text-align: center; font: 800 clamp(26px, 5.2vw, 52px)/1.1 "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: .02em; color: #fff; margin-top: 6px; min-height: 1.1em; }
.tc-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #9aa3ad; text-align: center; padding: 0 24px; }
.tc-empty[hidden] { display: none; }
/* narrow screens: chart.js moves the callouts out of the stage; they become cards in normal flow under the plot */
.tc-narrow .tc-stage { height: clamp(240px, 62vw, 340px); }
.tc-narrow .tc-callouts { position: static; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 12px 0 4px; }
.tc-narrow .tc-callout { position: static; transform: none !important; }
.tc-narrow .tc-box { min-width: 128px; }
.tc-narrow .tc-img, .tc-narrow .tc-img img { width: 40px; }
.tc-narrow .tc-price { font-size: 20px; }
.tc-narrow .tc-title { font-size: clamp(16px, 5vw, 22px); }
@media (prefers-reduced-motion: reduce) { .tc-callout { transition: none; } }

.track-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.track-bar .spacer { flex: 1; }
.track-cards { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.track-cards .btn { display: inline-flex; gap: 6px; align-items: center; }
.track-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.track-stat { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.track-stat b { display: block; font-size: 18px; }
.track-note { color: var(--muted, #9aa3ad); font-size: 13px; margin: 8px 2px; }
.track-search { position: relative; }
.track-results { position: absolute; z-index: 5; top: 100%; left: 0; min-width: 320px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; padding: 4px; max-height: 320px; overflow: auto; }
.track-results button { display: block; width: 100%; text-align: left; padding: 7px 9px; background: none; border: 0; color: inherit; cursor: pointer; border-radius: 6px; }
.track-results button:hover { background: var(--panel); }
.ask-row { display: flex; gap: .6rem; align-items: baseline; padding: .25rem 0; border-bottom: 1px solid var(--line, rgba(255,255,255,.08)); font-size: .9rem; }
.ask-row a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
