/* Dark only, by design: no light theme, no toggle. */
:root {
  color-scheme: dark;
  --bg: #0d0f12;
  --surface: #161a1f;
  --surface-2: #1d2228;
  --border: #262c33;
  --text: #e6e8eb;
  --muted: #8a939e;
  --green: #3ecf8e;
  --blue: #4f8cff;
  --amber: #f5b942;
  --red: #f26d6d;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: var(--blue); }
img { display: block; max-width: 100%; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

header.site { border-bottom: 1px solid var(--border); padding: 12px 0; }
header.site .wrap { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; justify-content: space-between; }
header.site h1 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
header.site h1 a { color: inherit; text-decoration: none; }
header.site p { margin: 0; color: var(--muted); font-size: 13px; }

.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: 1px; }
.pulse.stale { background: var(--amber); }
.pulse.down { background: var(--red); }

main { padding: 16px 0 48px; }

/* Wide screens: guitars + a 300px sidebar. Narrower (tablets, portrait monitors, phones): one column with the
   guitars first, and the sidebar panels underneath laid out side by side where they fit. */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout aside { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; align-items: start; }
  .layout aside .panel + .panel { margin-top: 0; }
}

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.panel + .panel { margin-top: 12px; }
.panel h2 { margin: 0 0 4px; font-size: 15px; }
.panel .sub { margin: 0 0 12px; color: var(--muted); font-size: 13px; }

/* Stat tiles: one compact row; 2×2 on phones */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.tile .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .v { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tile .v { font-size: 17px; } }

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--surface); color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.toolbar input[type="search"] { padding: 7px 10px; }
@media (max-width: 560px) { .toolbar input[type="search"] { flex-basis: 100%; } }
.chip[aria-pressed="true"] { color: var(--text); border-color: var(--text); }
.toolbar input[type="search"] { flex: 1; min-width: 180px; }

input, select { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font: inherit; font-size: 14px; width: 100%; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; margin: 8px 0; }
label.check input { width: auto; accent-color: var(--green); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; width: 100%; margin-top: 14px; background: var(--green); color: #0b0d10; border: 0; border-radius: 8px; padding: 10px 14px; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.secondary { background: #5865f2; color: #fff; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.msg { font-size: 13px; margin: 10px 0 0; min-height: 1em; }
.msg.ok { color: var(--green); }
.msg.err { color: var(--red); }

/* Product grid: compact cards. The photos are tall, so a square box with object-fit keeps rows short. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.card.out { opacity: .62; }
.card .img { background: #0a0c0e; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; padding: 6px; }
.card .img img { width: 100%; height: 100%; object-fit: contain; }
.card .body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card .title { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .title a { color: var(--text); text-decoration: none; }
.card .title a:hover { text-decoration: underline; }
.card .meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; margin-top: auto; gap: 2px 8px; }
.card .price { font-weight: 650; font-size: 14px; font-variant-numeric: tabular-nums; }
.card .since { font-size: 11px; color: var(--muted); }
.card .links { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; }

.badge { display: inline-block; font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 999px; }
.badge.in { background: rgba(62, 207, 142, .14); color: var(--green); }
.badge.out { background: rgba(138, 147, 158, .14); color: var(--muted); }
.badge.new { background: rgba(79, 140, 255, .16); color: var(--blue); }

.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* Drop-time histogram */
.hist { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; align-items: end; height: 56px; }
.hist div { background: var(--green); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .85; }
.hist-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* History page */
.product-head { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: center; margin-bottom: 24px; }
.product-head .img { background: #0a0c0e; border-radius: var(--radius); aspect-ratio: 3 / 4; overflow: hidden; }
.product-head .img img { width: 100%; height: 100%; object-fit: contain; }
.product-head h2 { margin: 0 0 8px; font-size: 22px; }
@media (max-width: 560px) { .product-head { grid-template-columns: 96px 1fr; } .product-head h2 { font-size: 17px; } }

.timeline { position: relative; height: 28px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.timeline span { position: absolute; top: 0; bottom: 0; background: var(--green); }
.timeline-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }

.events { list-style: none; margin: 0; padding: 0; }
.events li { display: flex; gap: 12px; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.events li:last-child { border-bottom: 0; }
.events time { color: var(--muted); font-size: 13px; text-align: right; }

.center { max-width: 460px; margin: 60px auto; text-align: center; }

footer.site { border-top: 1px solid var(--border); padding: 20px 0; color: var(--muted); font-size: 12px; }

/* Watchlist */
.card .links { align-items: center; justify-content: space-between; }
.watch-btn { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 3px 9px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.watch-btn:hover { color: var(--text); border-color: var(--muted); }
.watch-btn[aria-pressed="true"] { color: var(--amber); border-color: rgba(245, 185, 66, .5); }
.link-btn { background: none; border: 0; padding: 0; margin-top: 12px; color: var(--blue); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.panel h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 8px; }
.watchlist { list-style: none; margin: 0; padding: 0; }
.watchlist li { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.watchlist li:last-child { border-bottom: 0; }
.watchlist a { color: var(--text); text-decoration: none; }
.watchlist a:hover { text-decoration: underline; }
.watchlist .since { font-size: 12px; color: var(--muted); }
.icon-btn { flex: none; background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; width: 28px; height: 28px; font-size: 16px; line-height: 1; cursor: pointer; }
.icon-btn:hover { color: var(--red); border-color: var(--red); }

dialog.dialog { width: min(420px, calc(100vw - 32px)); color: var(--text); padding: 22px; }
dialog.dialog::backdrop { background: rgba(0, 0, 0, .65); }
dialog.dialog .btn.ghost { margin-top: 8px; }

/* Discord login */
.header-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.btn.discord { background: #5865f2; color: #fff; }
.btn.discord:hover { background: #4752c4; }
.btn.small { width: auto; margin: 0; padding: 7px 12px; font-size: 14px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.user-chip img { border-radius: 50%; }
.user-chip .link-btn { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; font-size: 14px; z-index: 10; max-width: calc(100vw - 32px); }
.btn.danger { background: transparent; color: var(--red); border: 1px solid rgba(242, 109, 109, .4); }
/* Donate */
.btn.donate { background: #ff5e5b; color: #fff; }
.btn.donate:hover { background: #e54c49; }

[hidden] { display: none !important; }

/* Store tabs (guitar type) */
.tabs { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); margin: -2px 0 12px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 7px 10px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tab:hover:not(:disabled) { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--green); }
.tab:disabled { opacity: .4; cursor: default; }
.tab .count { margin-left: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.badge.tab { background: rgba(138, 147, 158, .12); color: var(--text); }
