* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #ffffff;
  color: #111827;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}
a { color: #1f5c12; }
button, input, select, textarea { font: inherit; color: #111827; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #1f5c12; outline-offset: 2px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: #ffffff; border-bottom: 2px solid #111827;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; flex-wrap: wrap;
}
.brand { font-size: 28px; font-weight: 800; letter-spacing: 0.5px; }
.brand small { display: block; font-size: 13px; font-weight: 600; color: #374151; letter-spacing: 0; }
.topbar .spacer { flex: 1; }
.mode {
  font-size: 13px; font-weight: 700; color: #374151;
  border: 1px solid #9ca3af; border-radius: 999px; padding: 4px 10px;
}
main { max-width: 960px; margin: 0 auto; padding: 16px; }
h1 { font-size: 26px; line-height: 1.25; margin: 8px 0 4px; }
.lead { color: #374151; margin: 0 0 16px; max-width: 62ch; }

.btn {
  background: #1f5c12; color: #ffffff; border: 2px solid #1f5c12;
  border-radius: 10px; padding: 10px 16px; font-weight: 700;
}
.btn.secondary { background: #ffffff; color: #111827; border-color: #111827; }
.btn.danger { background: #ffffff; color: #7f1d1d; border-color: #7f1d1d; }
.btn.small { padding: 6px 10px; font-size: 15px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.badge {
  display: inline-block; min-width: 22px; text-align: center;
  background: #b91c1c; color: #fff; border-radius: 999px;
  font-size: 13px; font-weight: 800; padding: 1px 6px; margin-left: 4px;
}
.badge[hidden] { display: none; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.toolbar input[type="search"], .toolbar select {
  border: 2px solid #374151; border-radius: 10px; padding: 9px 12px; background: #fff;
}
.toolbar input[type="search"] { flex: 1; min-width: 180px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.chip {
  border: 2px solid #374151; background: #fff; border-radius: 999px;
  padding: 6px 12px; font-weight: 600;
}
.chip[aria-pressed="true"] { background: #111827; color: #fff; border-color: #111827; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: #fff; border: 2px solid #d1d5db; border-radius: 16px;
  overflow: hidden; text-align: left; padding: 0; display: block; width: 100%;
}
.card:hover { border-color: #111827; }
.card img { width: 100%; height: 180px; object-fit: cover; display: block; background: #e5e7eb; }
.card-body { padding: 14px; }
.price { font-size: 28px; font-weight: 800; color: #1f5c12; line-height: 1.1; }
.card h2 { font-size: 19px; line-height: 1.3; margin: 6px 0 4px; }
.meta { color: #374151; font-size: 15px; margin: 2px 0; }
.tag {
  display: inline-block; background: #e5e7eb; color: #111827;
  border-radius: 6px; padding: 2px 8px; font-size: 14px; font-weight: 700; margin-right: 6px;
}
.claimed-tag { background: #fef3c7; }
.empty { border: 2px dashed #9ca3af; border-radius: 16px; padding: 24px; color: #374151; }

.sheet {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(17, 24, 39, 0.55);
}
.sheet[hidden] { display: none; }
.sheet-card {
  background: #fff; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 20px;
}
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-card { border-radius: 20px; } }
.sheet-card img.main-photo { width: 100%; max-height: 320px; object-fit: cover; border-radius: 12px; background: #e5e7eb; }
.sheet-card h2 { font-size: 24px; margin: 10px 0 4px; }
.close-row { display: flex; justify-content: flex-end; }
form label { display: block; font-weight: 700; margin: 14px 0 4px; }
form input, form select, form textarea {
  width: 100%; border: 2px solid #374151; border-radius: 10px; padding: 10px 12px; background: #fff;
}
form textarea { min-height: 90px; }
.hint { color: #374151; font-size: 14px; margin: 4px 0 0; }
.error { color: #7f1d1d; font-weight: 700; }
.success { color: #1f5c12; font-weight: 700; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; }

.thread { border: 2px solid #d1d5db; border-radius: 12px; padding: 12px; margin: 10px 0; }
.thread h3 { margin: 0 0 4px; font-size: 18px; }
.bubbles { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.bubble { max-width: 85%; padding: 10px 12px; border-radius: 14px; background: #e5e7eb; }
.bubble.mine { align-self: flex-end; background: #dcfce7; }
.bubble .who { font-size: 13px; font-weight: 700; color: #374151; display: block; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.composer { display: flex; gap: 8px; }
.composer input { flex: 1; border: 2px solid #374151; border-radius: 10px; padding: 10px 12px; }
.footer { color: #374151; font-size: 14px; border-top: 1px solid #d1d5db; margin-top: 32px; padding: 16px 0 32px; }
