:root {
  --bg: #16120d;
  --bg-2: #1e1913;
  --panel: #261f16;
  --ink: #f3e6c8;
  --muted: #b9a88a;
  --line: #3d3224;
  --yellow: #f0c400;
  --yellow-ink: #1c1408;
  --copper: #c47a3a;
  --listed: #3d9b7a;
  --sold: #b4553a;
  --hand: #d8b36a;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 500px at 10% -10%, #2a2118, transparent 50%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.45 "IBM Plex Sans", sans-serif;
}

a { color: inherit; }

.top {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: #120f0b;
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  min-width: 280px;
}

.brand-mark {
  font-family: Oswald, sans-serif;
  background: var(--yellow);
  color: var(--yellow-ink);
  padding: 8px 10px;
  letter-spacing: 0.08em;
  font-size: 18px;
}

.brand strong {
  display: block;
  font-family: Oswald, sans-serif;
  font-size: 28px;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.search {
  flex: 1;
}

.search input, select, textarea, input, button {
  font: inherit;
}

.search input, .form input, .form select, .form textarea, .paste textarea, .grok textarea {
  width: 100%;
  background: #120f0b;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 2px;
}

::placeholder {
  color: #7d6c52;
  opacity: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #1a1611;
  color: var(--ink);
  text-decoration: none;
  padding: 10px 14px;
  cursor: pointer;
}

.btn.add {
  background: var(--yellow);
  color: var(--yellow-ink);
  border-color: var(--yellow);
  font-weight: 600;
}

.flashes { padding: 12px 22px 0; }

.flash {
  margin: 0 0 8px;
  padding: 10px 12px;
  background: #322718;
}

.flash.ok { border-left: 4px solid var(--listed); }
.flash.error { border-left: 4px solid var(--sold); }

.shell {
  display: grid;
  grid-template-columns: 92px 1fr;
  min-height: calc(100vh - 84px);
}

.rail {
  border-right: 1px solid var(--line);
  background: #120f0b;
  padding: 12px 8px 32px;
  position: sticky;
  top: 84px;
  height: calc(100vh - 84px);
  overflow-y: auto;
}

.rail-label {
  margin: 0 0 8px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.bin {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  padding: 7px 8px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: Oswald, sans-serif;
  letter-spacing: 0.08em;
}

.bin.filled { color: var(--ink); border-color: var(--line); }
.bin.on {
  background: var(--yellow);
  color: var(--yellow-ink);
  border-color: var(--yellow);
}
.bin em { font-style: normal; font-size: 12px; }

main { padding: 28px 32px 80px; }

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 28px;
}

h1, h2 { font-family: Oswald, sans-serif; font-weight: 600; letter-spacing: 0.03em; }
h1 { margin: 0 0 6px; font-size: 42px; }
h2 { margin: 0 0 12px; font-size: 22px; }
.lede { margin: 0; color: var(--muted); max-width: 60ch; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 6px 10px;
  color: var(--muted);
}
.chip.on { background: var(--ink); color: var(--bg); }

.family { margin-bottom: 36px; }
.family-head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
  color: var(--muted);
}
.family-sku {
  font-family: Oswald, sans-serif;
  color: var(--yellow);
  letter-spacing: 0.08em;
  font-size: 22px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card-wrap { position: relative; }
.card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  gap: 6px;
}
.card-remove { margin: 0; }
.card-actions .btn { padding: 6px 10px; }
.head-actions .remove-form { display: contents; }
.btn.danger {
  background: #3a221c;
  border-color: #8a4a3a;
  color: #f0c2b6;
}

.card {
  background: var(--panel);
  text-decoration: none;
  box-shadow: var(--shadow);
  border: 1px solid #3a2f22;
  overflow: hidden;
}

.shot {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0f0c09;
}

.shot img, .no-shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.no-shot {
  display: grid;
  place-items: center;
  font-family: Oswald, sans-serif;
  font-size: 32px;
  color: var(--yellow);
}

.stamp {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: var(--yellow);
  color: var(--yellow-ink);
  font-family: Oswald, sans-serif;
  padding: 4px 8px;
  letter-spacing: 0.08em;
}

.card-body { padding: 14px; }
.card-body h2 { font-size: 18px; margin-bottom: 8px; }
.meta, .ids { color: var(--muted); font-size: 13px; margin: 0; }
.ids.big { margin: 8px 0; font-size: 14px; color: var(--ink); }
code {
  font-family: "IBM Plex Sans", sans-serif;
  background: #120f0b;
  padding: 1px 6px;
  border: 1px solid var(--line);
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pill.on_hand { background: #3a2f1a; color: var(--hand); }
.pill.listed { background: #17352c; color: #8ee0c3; }
.pill.sold { background: #3a1c16; color: #f0a090; }
.listing { margin-left: 8px; }

.panel {
  background: var(--panel);
  border: 1px solid #3a2f22;
  padding: 20px;
  box-shadow: var(--shadow);
}

.split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  align-items: start;
}

.form label, .paste label, .grok label {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.sku-row, .two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sku-row { grid-template-columns: 0.55fr 0.55fr 0.55fr 0.55fr 1fr; align-items: end; }
.head-actions { flex-wrap: wrap; }
.sku-live {
  font-family: Oswald, sans-serif;
  font-size: 28px;
  color: var(--yellow);
  margin: 0 0 14px;
}

.drop {
  border: 1px dashed var(--copper);
  padding: 18px;
  text-align: center;
  color: var(--muted);
  margin-bottom: 16px;
  background: #1b1611;
}
.drop.hot { background: #332615; }
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.frame {
  margin: 0;
  background: #120f0b;
  border: 1px solid var(--line);
}
.frame img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  display: block;
  background: #0f0c09;
}
.frame.cover { outline: 2px solid var(--yellow); }
.frame figcaption {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 12px;
}
.frame button, .danger-zone button {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.danger, .danger-zone button { color: #e7a395; }
.danger-zone { margin-top: 28px; }

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.sku-xl {
  color: var(--yellow);
  margin-right: 8px;
}
.crumb { color: var(--muted); margin: 0 0 6px; }
.crumb a { color: var(--yellow); }
.head-actions { display: flex; gap: 10px; align-items: center; }
.form-actions { margin-top: 8px; }
.empty {
  padding: 48px;
  border: 1px dashed var(--line);
  text-align: center;
}
.muted { color: var(--muted); }

.grok {
  margin-bottom: 20px;
  border-color: var(--yellow);
}
.grok p { margin: 0 0 12px; color: var(--muted); }
.grok-missing { color: var(--hand); }
.grok-actions { display: flex; gap: 12px; align-items: center; margin: 0 0 14px; }
.grok-status { margin: 0; color: var(--muted); }
.grok-status.error { color: #f0a090; }
.spec-label { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.specs { margin-bottom: 14px; }
.spec-row {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.spec-remove {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    display: flex;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px;
  }
  .bin, button.bin { min-width: 52px; width: auto; }
  .split, .sku-row, .two, .spec-row, .item-head, .toolbar, .top, .grok-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
  .brand { min-width: 0; }
}

button.bin, button.btn, button.chip {
  font: inherit;
  cursor: pointer;
}

button.chip {
  background: transparent;
  text-align: center;
}

button.bin {
  width: 100%;
  background: transparent;
  color: var(--muted);
}

.account { display: flex; gap: 8px; align-items: center; }

#gate { padding: 28px 32px 80px; }
#gate .panel { max-width: 440px; }

.form-actions, .head-actions, .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-actions { margin-top: 8px; }

.pill.draft, .pill.submitted, .pill.researching, .pill.publishing {
  background: #3a2f1a;
  color: var(--hand);
}
.pill.ready { background: #3a3214; color: var(--yellow); }
.pill.error { background: #3a1c16; color: #f0a090; }

pre {
  white-space: pre-wrap;
  background: #120f0b;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 12px;
  overflow-x: auto;
}

.drop input[type="file"] { margin-bottom: 8px; }
.listing-copy { white-space: pre-wrap; }
