* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #3d2914 0%, #1a120c 70%);
  font-family: 'Press Start 2P', monospace;
  color: #fff8ef;
  padding: 28px 16px 120px;
}

.home-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 5;
  color: #e9c46a;
  text-decoration: none;
  font-size: 8px;
}

.shop-hero {
  max-width: 920px;
  margin: 36px auto 24px;
  text-align: center;
}

.kicker a {
  color: inherit;
  text-decoration: none;
}

h1 {
  font-size: 22px;
  line-height: 1.5;
  margin-bottom: 14px;
  text-shadow: 3px 3px 0 #000;
}

.sub,
.owner-banner,
.empty {
  font-size: 8px;
  line-height: 1.8;
  color: #d4b896;
}

.owner-banner {
  margin-top: 12px;
  color: #e9c46a;
}

.hidden {
  display: none !important;
}

body:not(.is-owner) #owner-desk,
body:not(.is-owner) #camera-modal {
  display: none !important;
}

.owner-desk,
.shelf {
  max-width: 920px;
  margin: 0 auto 24px;
  padding: 18px;
  border: 3px solid #e9c46a;
  background: rgba(0, 0, 0, 0.35);
}

h2 {
  font-size: 10px;
  margin-bottom: 14px;
  color: #e9c46a;
}

#list-form {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
}

#list-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 8px;
  color: #d4b896;
}

#list-form .wide {
  grid-column: 1 / -1;
}

#list-form input,
#list-form textarea,
#list-form button,
.chat-form input,
.chat-form button,
.thread-bar select,
.ai-btn {
  font-family: inherit;
  font-size: 8px;
  padding: 10px 12px;
  border: 2px solid #e9c46a;
  background: #1a120c;
  color: #fff8ef;
}

#list-form textarea {
  min-height: 72px;
  resize: vertical;
}

#photo-btn,
#list-form button[type="submit"],
.chat-form button,
.ai-btn,
.camera-actions button {
  background: #e9c46a;
  color: #1a120c;
  cursor: pointer;
}

#list-form button[type="submit"] {
  grid-column: 1 / -1;
}

.photo-row {
  display: grid;
  grid-template-columns: 140px 140px 1fr;
  gap: 10px;
  align-items: center;
}

#photo-btn,
.pick-photo {
  font-family: inherit;
  font-size: 8px;
  padding: 14px 12px;
  border: 2px solid #e9c46a;
  text-align: center;
}

.pick-photo {
  display: inline-block;
  background: #1a120c;
  color: #e9c46a;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.photo-preview {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border: 2px solid #e9c46a;
  background: #1a120c;
}

.photo-status {
  grid-column: 1 / -1;
  font-size: 8px;
  line-height: 1.6;
  color: #d4b896;
}

.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #0b0704;
}

.camera-modal.hidden {
  display: none !important;
}

#camera-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.camera-ui {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85) 40%);
}

.camera-status {
  font-size: 8px;
  line-height: 1.7;
  color: #e9c46a;
}

#camera-snap {
  width: 100%;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  padding: 18px 16px;
  border: 3px solid #000;
  background: #e9c46a;
  color: #1a120c;
  cursor: pointer;
}

.camera-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.camera-extra button,
.camera-extra .pick-photo {
  font-family: inherit;
  font-size: 8px;
  padding: 12px 14px;
  border: 2px solid #e9c46a;
  background: #e9c46a;
  color: #1a120c;
  cursor: pointer;
}

.camera-extra .pick-photo {
  background: #1a120c;
  color: #e9c46a;
}

#camera-close {
  background: #1a120c;
  color: #fff8ef;
}

.orders {
  margin-top: 18px;
}

#order-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#order-list li {
  font-size: 8px;
  line-height: 1.7;
  color: #fff8ef;
  border: 2px solid #2a9d8f;
  padding: 10px;
  background: #10211d;
}

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

.card {
  border: 4px solid #000;
  box-shadow: 4px 4px 0 #000;
  background: linear-gradient(180deg, #e9c46a 0%, #2a9d8f 100%);
  color: #1a120c;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border: 2px solid #000;
  background: #1a120c;
}

.card h3 {
  font-size: 10px;
  line-height: 1.5;
}

.card p,
.card .price {
  font-size: 8px;
  line-height: 1.6;
}

.card .actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.card button {
  font-family: inherit;
  font-size: 8px;
  padding: 8px 10px;
  border: 2px solid #000;
  background: #000;
  color: #fff;
  cursor: pointer;
}

.card button.ghost {
  background: transparent;
}

.chat {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(360px, calc(100vw - 24px));
  z-index: 8;
  border: 3px solid #e9c46a;
  background: #1a120c;
  box-shadow: 6px 6px 0 #000;
}

.chat-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  font-family: inherit;
  font-size: 8px;
  line-height: 1.5;
  color: #1a120c;
  background: #e9c46a;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6c757d;
  flex-shrink: 0;
}

.dot.on {
  background: #2a9d8f;
}

.dot.ai {
  background: #9b5de5;
}

.chat-body {
  display: flex;
  flex-direction: column;
  height: 320px;
}

.chat.collapsed .chat-body {
  display: none;
}

.thread-bar {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-bottom: 2px solid #e9c46a;
}

.thread-bar label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 7px;
  color: #d4b896;
}

.thread-bar select {
  width: 100%;
}

.ai-btn.on {
  background: #9b5de5;
  color: #fff;
  border-color: #9b5de5;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble {
  max-width: 90%;
  font-size: 8px;
  line-height: 1.7;
  padding: 8px 10px;
  border: 2px solid #e9c46a;
}

.bubble.visitor {
  align-self: flex-end;
  background: #2a9d8f;
  color: #fff;
  border-color: #2a9d8f;
}

.bubble.owner {
  align-self: flex-start;
  background: #e9c46a;
  color: #1a120c;
}

.bubble.ai {
  align-self: flex-start;
  background: #9b5de5;
  color: #fff;
  border-color: #9b5de5;
}

.bubble.system {
  align-self: center;
  background: transparent;
  color: #d4b896;
  border: 0;
  text-align: center;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-top: 2px solid #e9c46a;
}

.chat-form input {
  flex: 1;
  min-width: 0;
}

.account-chip {
  margin-top: 12px;
  font-size: 8px;
  line-height: 1.7;
  color: #2a9d8f;
}

.account-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 6, 3, 0.8);
}

.account-modal.hidden {
  display: none !important;
}

.account-card {
  width: min(420px, 100%);
  padding: 20px;
  border: 3px solid #e9c46a;
  background: #1a120c;
  box-shadow: 6px 6px 0 #000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-need {
  font-size: 14px;
  line-height: 1.5;
  color: #e9c46a;
  text-align: center;
}

.account-card h2 {
  margin: 0;
  text-align: center;
}

.account-copy {
  font-size: 8px;
  line-height: 1.7;
  color: #d4b896;
}

.account-card label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 8px;
  color: #d4b896;
}

.account-card input,
.account-actions button {
  font-family: inherit;
  font-size: 8px;
  padding: 10px 12px;
  border: 2px solid #e9c46a;
  background: #1a120c;
  color: #fff8ef;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-actions button[type="submit"] {
  background: #e9c46a;
  color: #1a120c;
  cursor: pointer;
}

#account-cancel {
  cursor: pointer;
}

@media (max-width: 640px) {
  #list-form {
    grid-template-columns: 1fr;
  }
}
