:root {
  --bg: #07090E; --panel: #0E1219; --panel2: #141A24; --line: #222B38; --text: #E8EEF4; --muted: #8C99A8;
  --accent: #7FE7C4; --accent-ink: #062A20; --tile: #FFFFFF; --shadow: 0 10px 30px rgba(0,0,0,.45);
  --radius: 12px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #F4F7F9; --panel: #FFFFFF; --panel2: #EEF3F6; --line: #D9E1E8; --text: #0B1520; --muted: #5A6878;
          --accent: #0F8F72; --accent-ink: #FFFFFF; --shadow: 0 10px 30px rgba(10,30,50,.15); color-scheme: light; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }

.top { position: sticky; top: 0; z-index: 5; display: flex; gap: 16px; align-items: center; padding: 12px 20px;
       background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.logo { width: 22px; height: 16px; border-radius: 3px; background: var(--accent); position: relative; }
.logo::before, .logo::after { content: ""; position: absolute; top: -5px; width: 6px; height: 5px; border-radius: 2px 2px 0 0; background: var(--accent); }
.logo::before { left: 3px; } .logo::after { right: 3px; }
.tabs { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.tab { border: 0; background: none; padding: 6px 16px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.tab.active { background: var(--accent); color: var(--accent-ink); }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line);
          border-radius: 999px; padding: 0 14px; max-width: 720px; }
.search:focus-within { border-color: var(--accent); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.search input { flex: 1; border: 0; background: none; outline: none; padding: 10px 0; min-width: 0; }
.ghost { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; }

.layout { display: grid; grid-template-columns: 290px 1fr; min-height: calc(100vh - 62px); }
.filters { border-right: 1px solid var(--line); padding: 16px 18px 40px; position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto; }
.filters section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.filters h3 { margin: 0 0 10px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; gap: 10px; align-items: baseline; }
.filters h3 .link:first-of-type { margin-left: auto; }
.link { border: 0; background: none; color: var(--accent); padding: 0; font-size: 12px; text-transform: none; letter-spacing: 0; }
.years { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.years input { width: 100%; }
input[type=number], input[type=search].small, select {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; outline: none; }
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.presets button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.presets button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.bodyparts { display: flex; flex-wrap: wrap; gap: 6px; }
.bodyparts button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 11px; font-size: 13px; }
.bodyparts button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.checklist { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; }
.check { display: flex; gap: 8px; align-items: center; padding: 3px 0; cursor: pointer; }
.check input { accent-color: var(--accent); }
.swatches { display: grid; gap: 2px; max-height: 280px; overflow-y: auto; margin-top: 8px; }
.sw { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px; border-radius: 6px; text-align: left; }
.sw:hover { background: var(--panel2); }
.sw.on { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.dot { width: 16px; height: 16px; border-radius: 50%; flex: none; border: 1px solid rgba(128,128,128,.5); }
.dot.trans { background-image: linear-gradient(135deg, rgba(255,255,255,.6) 0 30%, transparent 30%) !important; }
.sw small { margin-left: auto; color: var(--muted); }

main { padding: 16px 20px 60px; min-width: 0; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.summary { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 12px; }
.chip button { border: 0; background: var(--panel2); border-radius: 50%; width: 18px; height: 18px; line-height: 16px; padding: 0; color: var(--muted); }
.sort { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.sort select { width: auto; padding: 6px 8px; color: var(--text); }

.grid { display: grid; gap: 14px; }
.grid.size-l { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid.size-m { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.grid.size-s { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.grid.size-s .card .name { display: none; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer;
        display: flex; flex-direction: column; text-align: left; padding: 0; transition: transform .12s, border-color .12s; }
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.thumb { background: var(--tile); aspect-ratio: 1; display: grid; place-items: center; position: relative; }
.thumb img { width: 88%; height: 88%; object-fit: contain; }
.thumb .noimg { color: #9AA6B2; font-size: 12px; }
.yr { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 58px); }
.yr { position: absolute; left: 8px; top: 8px; background: rgba(7,9,14,.82); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.meta { padding: 10px 12px 12px; display: grid; gap: 4px; }
.num { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; color: var(--accent); }
.name { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sub { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.sub .dot { width: 12px; height: 12px; }
.sub .sets { margin-left: auto; }
.more { text-align: center; padding: 24px; color: var(--muted); }
.more button { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 10px 22px; }
.empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--muted); }

.detail { width: min(1080px, 94vw); max-height: 92vh; border: 1px solid var(--line); border-radius: 16px; padding: 0;
          background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.detail::backdrop { background: rgba(0,0,0,.6); }
.close { position: sticky; top: 10px; float: right; margin: 10px 10px 0 0; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
         border: 1px solid var(--line); background: var(--panel2); font-size: 20px; line-height: 1; }
.dhead { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: 24px; padding: 24px; }
.dhead .thumb { border-radius: var(--radius); }
.dhead h2 { margin: 4px 0 8px; font-size: 20px; line-height: 1.3; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.fact { background: var(--panel2); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.fact b { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 8px 16px; text-decoration: none; font-weight: 600;
       border: 1px solid var(--line); background: var(--panel2); color: var(--text); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.dsec { padding: 0 24px 24px; }
.dsec h4 { margin: 0 0 10px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.colorrow { display: flex; flex-wrap: wrap; gap: 6px; }
.cchip { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel2); border-radius: 999px; padding: 4px 10px 4px 6px; font-size: 12px; }
.cchip.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.mini .card .meta { padding: 6px 8px 8px; }
.mini .name { font-size: 12px; }
.price { background: var(--panel2); border-radius: var(--radius); padding: 12px 14px; margin-top: 12px; font-size: 13px; }
.price table { border-collapse: collapse; width: 100%; }
.price td, .price th { padding: 4px 6px; text-align: right; }
.price th:first-child, .price td:first-child { text-align: left; }
.price th { color: var(--muted); font-weight: 600; font-size: 12px; }
.themes { display: flex; flex-wrap: wrap; gap: 6px; }
.only-narrow { display: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); font-weight: 400; font-size: 13px; }
.count:not(:empty) { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px; border-radius: 999px; font-size: 11px;
  background: color-mix(in srgb, var(--text) 15%, transparent); }
.tab.active .count { background: color-mix(in srgb, var(--accent-ink) 20%, transparent); }

/* cards hold a heart button, so they're divs acting as buttons */
.card { position: relative; }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.heart { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(7,9,14,.72); color: #fff; opacity: .0; transition: opacity .12s; padding: 0; }
.card:hover .heart, .card:focus-within .heart, .heart.on, .heart:focus-visible { opacity: 1; }
@media (hover: none) { .heart { opacity: 1; } }
.heart svg, .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.heart.on svg, .btn.saved svg { fill: #FF6B8B; stroke: #FF6B8B; }
.why { font-size: 11px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price-tag { color: var(--text); font-size: 14px; }
.soldout { color: #E8A15A; }
.gone { font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 5px; margin-top: 2px; }

.copy { border: 1px solid var(--line); background: var(--panel2); color: var(--muted); border-radius: 6px; padding: 2px 6px; vertical-align: middle;
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; line-height: 1.4; }
.copy svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.copy:hover { color: var(--accent); border-color: var(--accent); }
.copy.done { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.dhead h2 .copy { font-size: 11px; position: relative; top: -2px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.tags-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: 2px; }
.tag { border: 1px dashed color-mix(in srgb, var(--accent) 60%, var(--line)); background: none; color: var(--text); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.tag:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }

.makers { display: grid; gap: 6px; margin-bottom: 10px; }
.maker { display: grid; text-align: left; gap: 1px; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 10px; }
.maker small { color: var(--muted); font-size: 12px; }
.maker.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.listnav { display: grid; gap: 2px; margin-bottom: 12px; }
.listlink { display: flex; align-items: center; gap: 8px; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; }
.listlink:hover { background: var(--panel2); }
.listlink.on { background: color-mix(in srgb, var(--accent) 22%, transparent); font-weight: 600; }
.listlink small { margin-left: auto; color: var(--muted); }
.newlist { display: flex; gap: 6px; margin-top: 8px; }
.newlist input { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; outline: none; }
.newlist .btn { padding: 6px 14px; }
.layout.lists-mode .bar .summary { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 18px; }
.link.danger { color: #FF8A8A; }
.li-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.qty { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.qty input { width: 62px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.note { width: 100%; margin-top: 6px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: 12px; outline: none; }
.recs { padding: 24px 0 0; text-align: left; }
.grid-recs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; margin: 0;
  cursor: pointer; transition: background .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 19px; }
.strip { margin-bottom: 22px; padding: 14px; border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--line)); border-radius: var(--radius); }
.strip-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.strip-head h4 { margin: 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.strip .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.picker { position: fixed; z-index: 50; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 12px 14px; display: grid; gap: 4px; max-height: 70vh; overflow-y: auto; color: var(--text); }
.pick-title { margin: 0 0 6px; font-weight: 600; font-size: 13px; }
.picker .check small { margin-left: auto; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow); }

@media (max-width: 860px) {
  .top { flex-wrap: wrap; padding: 10px 16px; }
  .search { order: 4; flex-basis: 100%; max-width: none; }
  .only-narrow { display: inline-block; margin-left: auto; order: 2; }
  .tabs { order: 3; flex-basis: 100%; overflow-x: auto; }
  .tab { flex: 1; white-space: nowrap; }
  .layout { grid-template-columns: 1fr; }
  .filters { display: none; position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .filters.open { display: block; }
  main { padding: 14px 16px 40px; }
  .chips { order: 3; flex-basis: 100%; }
  .grid.size-l { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .dhead { grid-template-columns: 1fr; padding: 16px; }
  .dsec { padding: 0 16px 16px; }
}
@media (max-width: 460px) {
  .tab { padding: 6px 7px; font-size: 13px; }
}
