: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, .btn.on {
  background: var(--yellow);
  color: var(--yellow-ink);
  border-color: var(--yellow);
  font-weight: 600;
}

.env-badge {
  font-family: Oswald, sans-serif;
  letter-spacing: 0.08em;
  background: var(--yellow);
  color: var(--yellow-ink);
  padding: 6px 10px;
  font-size: 14px;
}

.steps { margin: 8px 0 0; padding-left: 1.2em; }
.steps li { margin: 8px 0; }
.steps code { font-size: 13px; }

.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;
}

.three {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.box-panel { grid-column: 1 / -1; }

.box-scene {
  width: min(100%, 420px);
  height: auto;
  background: #1c1814;
  display: block;
  margin: 8px 0 16px;
}

.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; }
.dialogue { max-height: 11rem; overflow: auto; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.dialogue p { margin: 0; line-height: 1.35; }
.shelf-row { display: flex; gap: 12px; align-items: center; margin: 8px 0; }
.shelf-row span { color: var(--muted); }
.machine { margin-bottom: 16px; }
.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, .three, .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; }

.landing { max-width: 980px; margin: 12px auto 40px; }
.landing h1 {
  font-family: Oswald, sans-serif;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin: 8px 0 16px;
  max-width: 14ch;
}
.eyebrow {
  margin: 0;
  color: var(--yellow);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 13px;
}
.pitch { font-size: 20px; max-width: 62ch; color: var(--ink); }
.landing-actions { display: flex; gap: 12px; margin: 22px 0 36px; }
.landing-grid { display: grid; gap: 16px; }
@media (min-width: 800px) { .landing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.landing-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px;
  min-height: 180px;
}
.landing-grid h2 { font-family: Oswald, sans-serif; letter-spacing: 0.04em; margin: 0 0 8px; }
.notify { margin-top: 28px; max-width: 460px; }
.notify h2 { font-family: Oswald, sans-serif; }
.store { max-width: 860px; margin: 0 auto; padding: 28px 22px 80px; }
.store h1 { font-family: Oswald, sans-serif; font-size: clamp(36px, 5vw, 60px); line-height: 1; margin: 8px 0; }
.ask { font-family: Oswald, sans-serif; font-size: 32px; color: var(--yellow); margin: 0; }
.store-photos { display: grid; gap: 12px; margin: 22px 0; }
.store-photos img { width: 100%; background: #000; }
.store-story p, .store section p { max-width: 68ch; }
.specs { display: grid; gap: 8px; margin: 0; }
.specs div { display: grid; grid-template-columns: 180px 1fr; gap: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }
.places { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.places a { display: inline-block; background: var(--yellow); color: var(--yellow-ink); text-decoration: none; padding: 8px 12px; font-family: Oswald, sans-serif; letter-spacing: 0.04em; }
.preview-banner { background: var(--yellow); color: var(--yellow-ink); padding: 10px 14px; }
.page-editor { grid-column: 1 / -1; }

.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; }
.rack-edit + .rack-edit { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.listing-copy { white-space: pre-wrap; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 4px 10px 4px 4px;
  cursor: pointer;
}

.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  color: var(--yellow-ink);
  font-family: Oswald, sans-serif;
}

.settings-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.research-panel { margin: 0 0 18px; }
.research-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.research-row a, .research-row .ids { display: block; }

.designer { display: grid; gap: 16px; }
@media (min-width: 960px) {
  .designer { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
}
.designer-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.label-side { display: grid; gap: 12px; }
.label-stage {
  position: relative;
  background: #f0c400;
  color: #1c1408;
  overflow: hidden;
  touch-action: none;
}
.label-item { position: absolute; cursor: move; transform-origin: 0 0; }
.label-item.locked { cursor: default; }
.label-item.on { outline: 1px dashed #1c1408; }
.label-item.text {
  font-family: Oswald, sans-serif;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.layers { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.layers li { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; }
.layers li.on button:first-child { font-weight: 600; }
.layers button { font: inherit; }
.stat-grid { display: grid; gap: 16px; }
@media (min-width: 800px) { .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; } }
.stat { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0; }
.stat span { color: var(--muted, #5c5346); }
.label-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #1c1408;
  cursor: nwse-resize;
}
label.check { display: flex; gap: 8px; align-items: center; }
