:root {
  --ink: #17181a;
  --paper: #f7f6f2;
  --card: #ffffff;
  --line: #dcdad2;
  --amber: #e8952e;
  --amber-dark: #b5701a;
  --red: #d1402c;
  --muted: #6b6a64;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 0 24px; }

.topbar {
  background: var(--ink);
  color: white;
  border-bottom: 4px solid var(--amber);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  gap: 20px;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  font-size: 13px;
  color: #cfcdc4;
}
.role-badge {
  background: rgba(255,255,255,0.12);
  color: var(--amber);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 6px;
  text-transform: capitalize;
}
.admin-link { color: var(--amber); text-decoration: none; font-weight: 600; }
.admin-link:hover { text-decoration: underline; }
button.small { padding: 6px 12px; font-size: 13px; }
.user-box button.secondary { color: #cfcdc4; border-color: #4a4a46; }
.user-box button.secondary:hover { background: rgba(255,255,255,0.08); }

.auth-switch { display: flex; gap: 4px; margin-bottom: 20px; }
.auth-switch .tab-btn { color: var(--muted); }
.auth-switch .tab-btn.active { background: var(--ink); color: white; }
.auth-form { max-width: 380px; }
.logo { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.logo-accent { color: var(--amber); }

.tabs { display: flex; gap: 4px; }
.tab-btn {
  background: transparent;
  color: #cfcdc4;
  border: none;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  border-radius: var(--radius);
}
.tab-btn.active { background: rgba(255,255,255,0.1); color: white; }
.tab-btn:hover { color: white; }

main.wrap { padding-top: 40px; padding-bottom: 80px; }

.panel { display: none; }
.panel.active { display: block; }

h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
h2 { font-size: 19px; font-weight: 700; margin: 0 0 12px; }
.lede { color: var(--muted); max-width: 62ch; margin: 0 0 28px; }

.search-row { display: flex; gap: 10px; margin-bottom: 20px; max-width: 560px; }
.search-row input {
  flex: 1;
  padding: 12px 14px;
  font-size: 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.search-row input:focus { outline: none; border-color: var(--amber-dark); }

button {
  background: var(--ink);
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
}
button:hover { background: #000; }
button.secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
button.secondary:hover { background: #eeece5; }

.status { min-height: 20px; color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.status.error { color: var(--red); }
.status.success { color: #2f7a3d; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card img { width: 100%; height: 150px; object-fit: cover; display: block; background: #eee; }
.card-body { padding: 12px; }
.card-tags {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  color: var(--amber-dark);
  margin-bottom: 6px;
}
.card-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.card-price { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.card label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.cart-bar {
  position: sticky;
  bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--ink);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius);
}
.cart-bar.hidden { display: none; }
.cart-bar button { background: var(--amber); color: var(--ink); }
.cart-bar button:hover { background: #f0a53f; }

.upload-form {
  display: grid;
  gap: 14px;
  max-width: 480px;
  margin-bottom: 24px;
}
.upload-form label { font-size: 13px; font-weight: 600; display: flex; flex-direction: column; gap: 6px; }
.upload-form .hint { font-weight: 400; color: var(--muted); }
.upload-form input {
  padding: 10px 12px;
  font-size: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font-weight: 400;
}
.upload-form button { width: fit-content; }

.earnings-check {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  max-width: 480px;
}

.hidden { display: none !important; }

.hero {
  display: grid;
  gap: 32px;
  align-items: center;
  margin: 8px 0 36px;
}
.hero.image-right,
.hero.image-left {
  grid-template-columns: 1fr 1fr;
}
.hero.image-left .hero-image { order: -1; }
.hero.text-only {
  grid-template-columns: 1fr;
  text-align: center;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.hero-image img {
  width: 100%;
  height: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}
.hero-text h1 { font-size: 34px; margin-bottom: 12px; }
.hero.text-only .lede { margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; gap: 12px; margin-top: 20px; }
.hero.text-only .hero-actions { justify-content: center; }

.hero.image-background {
  position: relative;
  grid-template-columns: 1fr;
  border-radius: 12px;
  overflow: hidden;
  min-height: 380px;
  padding: 40px;
  color: white;
}
.hero.image-background .hero-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero.image-background .hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(23,24,26,0.35), rgba(23,24,26,0.75));
}
.hero.image-background .hero-image img { height: 100%; max-height: none; border-radius: 0; }
.hero.image-background .hero-text { position: relative; z-index: 1; max-width: 560px; }
.hero.image-background .hero-text .lede { color: #e8e6df; }

@media (max-width: 720px) {
  .hero.image-right, .hero.image-left { grid-template-columns: 1fr; }
  .hero.image-left .hero-image { order: 0; }
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}
.feature-card h3 { font-size: 15px; font-weight: 700; margin: 0 0 8px; }
.feature-card p { font-size: 13px; color: var(--muted); margin: 0; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(23,24,26,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  background: var(--card);
  border-radius: 10px;
  padding: 28px;
  max-width: 420px;
  width: 100%;
}
.modal-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0;
}
.modal-card input {
  padding: 10px 12px;
  font-size: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

.checkout-method-tabs { display: flex; gap: 4px; margin: 16px 0; }
.checkout-method-tabs .tab-btn { color: var(--muted); }
.checkout-method-tabs .tab-btn.active { background: var(--ink); color: white; }
#qr-image-wrap { display: flex; justify-content: center; margin: 16px 0; }
.qr-image { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: white; }
#qr-simulate-confirm { display: block; margin: 0 auto 12px; }

a.download-link { color: var(--amber-dark); font-weight: 600; }

.status-pill {
  display: inline-block;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 10px;
  background: #e6f2e8;
  color: #2f7a3d;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 16px 0 24px;
}
.stat-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-value { font-size: 22px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--muted); }

.my-statement, .my-photos { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }

.report-controls { display: flex; flex-direction: column

/* ---- Event dropdown (buyer page) ---- */
.event-picker {
  max-width: 560px;
  margin-bottom: 16px;
}
.event-picker label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.event-picker select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
}
.event-picker select:focus {
  outline: none;
  border-color: var(--amber-dark);
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  max-width: 560px;
}
.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}