:root {
  color-scheme: dark;
  --bg: #14110e;
  --card: #241c16;
  --card-2: #2e241c;
  --text: #f6f1ea;
  --muted: #b3a496;
  --accent: #e6b17a;
  --on-accent: #2a1b10;
  --line: rgba(246, 241, 234, 0.12);
  --danger: #e07a66;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  --radius: 18px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  padding:
    calc(12px + env(safe-area-inset-top))
    14px
    calc(24px + env(safe-area-inset-bottom));
}

button, input { font: inherit; color: inherit; }

.top {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 2px 12px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}

.top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
}

.who {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

.section { margin: 8px 0 18px; }

.section h2 {
  margin: 8px 2px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 228px;
}

.buy {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 228px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.buy:disabled { cursor: default; }

.card.is-out { filter: grayscale(1); opacity: 0.55; }

.photo {
  height: 132px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 20%, var(--card-2), transparent 70%),
    var(--card-2);
}

.photo img {
  width: 100%;
  height: 132px;
  object-fit: contain;
  padding: 10px;
}

.placeholder {
  padding: 16px 12px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--accent);
}

.meta { padding: 10px 12px 12px; }

.name {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  min-height: 2.5em;
}

.price {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 700;
}

.stock {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.gear {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(20, 17, 14, 0.72);
  color: var(--text);
  font-size: 12px;
}

.card.is-out .gear { filter: none; opacity: 1; }

.empty, .gate {
  margin: 28px 8px;
  color: var(--muted);
  line-height: 1.45;
}

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  align-items: end;
  padding: 16px;
  background: rgba(0, 0, 0, 0.46);
}

.sheet[hidden] { display: none; }

.sheet-card {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 16px 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.sheet-title { margin: 0; font-size: 20px; font-weight: 700; }

.sheet-sub { margin: 8px 0 0; color: var(--muted); }

.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.btn {
  border: 0;
  border-radius: 14px;
  min-height: 48px;
  padding: 10px 12px;
  cursor: pointer;
}

.btn.primary { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.slim { width: 100%; margin-top: 8px; min-height: 40px; }
.btn:disabled { opacity: 0.5; }

.field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.field input {
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.hint { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.4; }

.stock-box { margin-top: 8px; }

.file { display: block; margin-top: 12px; }
.file input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.file span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

@media (min-width: 720px) {
  body { max-width: 880px; margin: 0 auto; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
