:root {
  --brand: #db7c26;
  --brand-dark: #b8651a;
  --bg: #fffaf4;
  --text: #2b2118;
  --muted: #e9e0d6;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hind", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

/* Navbar */
.navbar {
  display: grid;
  grid-template-columns: auto minmax(12rem, 1fr) auto;
  align-items: center;
  gap: 1rem 2rem;
  padding: 0.75rem 2rem;
  border-bottom: 1px solid var(--muted);
}
.logo {
  font-family: "Kaushan Script", cursive;
  font-size: 60px;
  line-height: 1;
  color: var(--brand);
}
.search input {
  width: 100%;
  padding: 0.7rem 1.1rem;
  font-size: 1rem;
  border: 1px solid var(--muted);
  border-radius: 999px;
}
.auth { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.4rem 1.25rem; white-space: nowrap; }
.auth a:hover { color: var(--brand); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 2rem;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 2rem;
}
.hero h1 { font-size: 4.6rem; line-height: 1.02; margin: 0 0 1.5rem; }
.hero-block { margin-bottom: 1.4rem; }
.hero-block h2 { margin: 0 0 0.5rem; font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: var(--brand); }
.steps, .perks { margin: 0; padding: 0; list-style: none; font-size: 1.15rem; line-height: 1.4; }
.steps li, .perks li { display: flex; align-items: flex-start; gap: 0.6rem; margin-bottom: 0.55rem; }
.num, .tick {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
  background: var(--brand);
  border-radius: 50%;
  margin-top: 0.1rem;
}
.tick { background: #4a9a6a; }
.hero-photo { position: relative; transform: rotate(1.6deg); }
.hero-photo img {
  display: block;
  width: 100%;
  height: 520px;
  object-fit: cover;
  border: 10px solid white;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgb(43 33 24 / 0.2);
}
.sticker {
  max-width: 13rem;
  position: absolute;
  left: -1.2rem;
  bottom: 2rem;
  padding: 0.7rem 1.1rem;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.15;
  color: white;
  text-align: center;
  background: var(--brand);
  border: 3px dashed white;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgb(43 33 24 / 0.25);
  transform: rotate(-6deg);
}

/* Listings */
.listings { max-width: 1100px; margin: 0 auto 4rem; padding: 0 2rem; }
.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.views { display: flex; gap: 1.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--muted); }
.view {
  padding: 0.5rem 0;
  font: inherit;
  font-size: 1.2rem;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}
.view.active { color: var(--brand); border-bottom-color: var(--brand); }
.view:disabled { color: #a99d90; cursor: not-allowed; }

.pill {
  padding: 0.4rem 1rem;
  font: inherit;
  background: white;
  border: 1px solid var(--muted);
  border-radius: 999px;
  cursor: pointer;
}
.pill:hover, .pill.active { background: var(--brand); border-color: var(--brand); color: white; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.card { background: white; border: 1px solid var(--muted); border-radius: var(--radius); overflow: hidden; }
.card-img { aspect-ratio: 4 / 3; background: var(--muted); }
.card h3 { margin: 0.75rem 1rem 0.25rem; font-size: 1rem; }
.price { margin: 0 1rem 1rem; font-weight: 700; color: var(--brand-dark); }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--muted);
}
.footer a:hover { color: var(--brand); }

/* Modals */
dialog {
  width: min(380px, 90vw);
  padding: 2rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}
dialog::backdrop { background: rgb(43 33 24 / 0.5); }
dialog h2 { margin: 0 0 1.25rem; font-size: 2rem; color: var(--brand); }

/* Every form (modal or page): one column, one spacing, one control style */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form label { display: flex; flex-direction: column; gap: 0.3rem; margin: 0; font-weight: 600; }
.form input:not([type="checkbox"]),
.form textarea,
.form select {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.6rem 0.8rem;
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: white;
  border: 1px solid var(--muted);
  border-radius: 8px;
}
.form input:not([type="checkbox"]):not([type="file"]), .form select { height: 2.9rem; }
.form textarea { resize: vertical; min-height: 5.5rem; }
.form input:focus, .form textarea:focus, .form select:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
}
.form input[type="file"] { padding: 0.5rem; }
.form input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.35rem 0.9rem;
  font: inherit;
  color: var(--brand-dark);
  background: var(--bg);
  border: 1px solid var(--brand);
  border-radius: 999px;
  cursor: pointer;
}
.form .row { display: grid; grid-template-columns: 7rem 1fr 1fr; gap: 0.75rem; }
.form fieldset { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin: 0; padding: 0; border: 0; }
.form legend { width: 100%; margin-bottom: 0.4rem; padding: 0; font-weight: 600; }
.form .check { flex-direction: row; align-items: center; gap: 0.4rem; font-weight: 400; text-transform: capitalize; cursor: pointer; }
.form .check input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--brand); }
.form-slot:empty { display: none; }
.form-slot .form-error { margin: 0; }

.primary {
  width: 100%;
  padding: 0.7rem;
  font: inherit;
  font-weight: 700;
  color: white;
  background: var(--brand);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.primary:hover { background: var(--brand-dark); }
.switch { margin: 0; text-align: center; }
.switch a { color: var(--brand-dark); text-decoration: underline; }
.close {
  position: absolute;
  top: 0.5rem;
  right: 0.9rem;
  font-size: 1.8rem;
  background: none;
  border: 0;
  cursor: pointer;
}

@media (max-width: 1100px) and (min-width: 801px) {
  /* Not enough room beside the logo and search: the links go on their own row. */
  .navbar { grid-template-columns: auto minmax(12rem, 1fr); }
  .auth { grid-column: 1 / -1; }
}

@media (max-width: 800px) {
  .navbar { grid-template-columns: 1fr; justify-items: center; }
  .auth { justify-content: center; gap: 0.4rem 1rem; }
  /* Stack as: title, photo, then the text blocks. display: contents lets the title and
     the blocks be reordered around the photo even though they share a wrapper. */
  .hero { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-text { display: contents; }
  .hero h1 { order: 1; margin: 0; font-size: 3.2rem; }
  .hero-photo { order: 2; margin: 0.5rem 0.5rem 0; }
  .hero-block { order: 3; margin: 0; }
  .hero-photo img { height: 340px; }
  .sticker { left: 0.5rem; }
}

/* Listing page */
.listing { max-width: 1100px; margin: 1.5rem auto 4rem; padding: 0 2rem; }
.back { display: inline-block; margin-bottom: 1rem; text-transform: capitalize; }
.back:hover { color: var(--brand); }
.listing-body { display: grid; grid-template-columns: minmax(0, 460px) 1fr; gap: 2.5rem; align-items: start; }
.listing-photo { aspect-ratio: 4 / 3; background: var(--muted); border-radius: var(--radius); }
.listing-info h1 { margin: 0; font-size: 2.5rem; overflow-wrap: anywhere; } /* a long unbroken title must not widen the page */
.listing-info { min-width: 0; }
.listing-price { margin: 0.25rem 0 1rem; font-size: 2rem; font-weight: 700; color: var(--brand-dark); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 0 0 1rem; }
.meta .pill { display: inline-block; }
.description { font-size: 1.1rem; line-height: 1.5; overflow-wrap: anywhere; }
.detail-row { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: start; }
.description { margin-top: 0; }
.seller { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 1.5rem; }
.actions { display: flex; flex-direction: column; gap: 0.6rem; min-width: 150px; }

.secondary {
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  color: var(--brand-dark);
  background: white;
  border: 2px solid var(--brand);
  border-radius: 999px;
  cursor: pointer;
}
.secondary:hover { background: var(--brand); color: white; }
.category-title { overflow-wrap: anywhere; text-transform: capitalize; font-size: 2.5rem; margin: 2rem 0 1rem; }

@media (max-width: 800px) {
  /* the reject form opens inline: a popover anchored to the right edge would fall off the left of a phone */
  .offer-actions { flex-wrap: wrap; }
  .reject[open] { flex-basis: 100%; }
  .reject form { position: static; width: auto; }
  .listing-body { grid-template-columns: minmax(0, 1fr); }
  .detail-row { grid-template-columns: minmax(0, 1fr); }
  .actions { flex-direction: row; flex-wrap: wrap; }
  .actions > *, .actions .primary, .actions .secondary { flex: 1; width: auto; }
}

.reports { display: flex; gap: 1.25rem; margin-top: 0.75rem; }
.report {
  padding: 0;
  font: inherit;
  font-size: 0.95rem;
  color: #7a6e62;
  background: none;
  border: 0;
  cursor: pointer;
}
.report:hover { color: var(--brand-dark); text-decoration: underline; }

.get-it { margin: 0 0 1rem; text-transform: capitalize; }

/* Auth */
.auth form { margin: 0; }
.link { padding: 0; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.link:hover { color: var(--brand); }
.form-error { margin: 0 0 0.9rem; color: #b3261e; }

/* Actions that need a login */
.primary:disabled, .secondary:disabled {
  color: #fff;
  background: var(--muted);
  border-color: var(--muted);
  cursor: not-allowed;
}
.report:disabled { color: #bdb3a8; cursor: not-allowed; text-decoration: none; }

.new-listing .primary { width: auto; padding: 0.7rem 1.5rem; white-space: nowrap; }

dialog.wide { width: min(580px, 92vw); max-height: 90vh; overflow-y: auto; }

/* Photos */
img.card-img { display: block; width: 100%; object-fit: cover; }
img.listing-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.thumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.thumb { padding: 0; line-height: 0; background: none; border: 2px solid transparent; border-radius: 10px; cursor: pointer; opacity: 0.7; }
.thumb:hover, .thumb.active { opacity: 1; }
.thumb.active { border-color: var(--brand); }
.thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 7px; }

/* Owner actions, edit page, profile */
.actions form { margin: 0; }
.actions .primary, .actions .secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 2.9rem;
  padding: 0 1rem;
  font-size: 1rem;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  border-radius: 999px;
}

.secondary.danger, .link.danger { color: #b3261e; }
.secondary.danger { border-color: #b3261e; }
.secondary.danger:hover { background: #b3261e; color: white; }
.edit-page { max-width: 600px; margin: 2rem auto 4rem; padding: 0 2rem; }
.edit-page h1 { margin: 0 0 1.25rem; font-size: 2.5rem; color: var(--brand); }
.cancel { text-align: center; }
.cancel:hover { color: var(--brand); }
.photos-hint { margin: 0 0 -0.4rem; font-weight: 600; }
.photos-hint small { font-weight: 400; color: #7a6e62; }
.current-photos { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.form .photo { position: relative; display: block; width: 104px; height: 104px; cursor: pointer; }
.form .photo input { position: absolute; width: 1px; height: 1px; opacity: 0; } /* hidden, still keyboard-focusable */
.form .photo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 8px; transition: opacity 0.15s; }
.form .photo input:focus-visible + img { outline: 2px solid var(--brand); outline-offset: 2px; }
.photo-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 10px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: white;
  background: rgb(0 0 0 / 0.65);
  border-radius: 999px;
}
.photo-badge::after { content: "Remove"; }
.form .photo input:checked + img { opacity: 0.3; filter: grayscale(1); }
.form .photo input:checked ~ .photo-badge { background: #b3261e; }
.form .photo input:checked ~ .photo-badge::after { content: "Undo"; }
.profile-meta { margin: -0.5rem 0 1.5rem; color: #7a6e62; }
.section-title { margin: 0 0 1rem; font-size: 1.4rem; }
.card-wrap { display: flex; flex-direction: column; }
.card-wrap .card { flex: 1; }
.card-actions { display: flex; flex-direction: row; align-items: center; gap: 1rem; padding: 0.4rem 0.25rem 0; }
.card-actions form { display: block; margin: 0; }
.card-actions a, .card-actions .link { font: inherit; font-size: 0.95rem; line-height: 1.4; }
.card-actions a:hover, .card-actions .link:hover { color: var(--brand); }
.card-actions .link.danger:hover { color: #b3261e; text-decoration: underline; }
.seller a:hover { color: var(--brand); }
.auth a[href^="/u/"]:hover { color: var(--brand); }

@media (max-width: 600px) {
  .form .row { grid-template-columns: 1fr; }
}

/* Offers, messages */
.form-ok { margin: 0; padding: 0.6rem 0.9rem; color: #1e6b34; background: #e6f4ea; border-radius: 8px; }
.modal-note { margin: -0.75rem 0 0; color: #7a6e62; }
.badge { display: inline-block; padding: 0.1rem 0.6rem; font-size: 0.85rem; font-weight: 600; vertical-align: middle; color: #7a6e62; background: var(--muted); border-radius: 999px; }
.unavailable { margin: 0.75rem 0 0; color: #7a6e62; }
.inbox { margin: 0 0 2rem; padding: 0; list-style: none; background: white; border: 1px solid var(--muted); border-radius: var(--radius); }
.inbox li + li { border-top: 1px solid var(--muted); }
.inbox a { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.75rem 1rem; }
.inbox a:hover { background: var(--bg); }
.inbox-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; }
.inbox-post { color: #7a6e62; }
.inbox time { margin-left: auto; font-size: 0.85rem; color: #7a6e62; }
.inbox-last { overflow: hidden; color: #5c5046; white-space: nowrap; text-overflow: ellipsis; }
.conversation { max-width: 640px; margin: 1.5rem auto 4rem; padding: 0 2rem; }
.conversation h1 { margin: 0.25rem 0 0; }
.convo-about { margin: 0 0 1.25rem; color: #7a6e62; }
.convo-about a { text-decoration: underline; }
.thread { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.5rem; padding: 1rem; background: #f3ebe0; border: 1px solid #e4d8c8; border-radius: var(--radius); }
.chat .thread { max-height: 26rem; min-height: 8rem; margin: 0; overflow-y: auto; border: 0; border-radius: 0; }
.msg { align-self: flex-start; max-width: 80%; padding: 0.6rem 0.9rem; background: white; border: 1px solid var(--muted); border-radius: var(--radius); box-shadow: 0 1px 2px rgb(43 33 24 / 0.08); }
.msg.mine { align-self: flex-end; background: #fbe3c3; border-color: #efcb99; }
.msg p { margin: 0 0 0.25rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg small { color: #7a6e62; }
.msg-photos { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.4rem; }
.msg-photos img { display: block; width: 110px; height: 110px; object-fit: cover; border-radius: 8px; }
.reply { padding-top: 1rem; border-top: 1px solid var(--muted); }

/* Unread counts and read ticks */
.unread { display: inline-block; min-width: 1.3rem; padding: 0 0.4rem; font-size: 0.8rem; font-weight: 700; line-height: 1.3rem; text-align: center; color: white; background: var(--brand); border-radius: 999px; vertical-align: middle; }
.inbox .has-unread { background: #fff8ee; }
.inbox .has-unread .inbox-last { font-weight: 600; color: var(--text); }
.inbox .unread { margin-left: auto; }
.inbox .unread + time { margin-left: 0.5rem; }
.ticks { margin-left: 0.25rem; letter-spacing: -0.2em; color: #9a8f84; }
.ticks.read { color: #2f80ed; }

/* Offers */
.offers { margin-top: 2.5rem; }
.offer-list { margin-bottom: 2rem; }
.offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; margin-bottom: 0.6rem; padding: 0.8rem 1rem; background: white; border: 1px solid var(--muted); border-radius: var(--radius); }
.offer p { margin: 0; }
.offer-what a { text-decoration: underline; }
.offer-ask, .offer-meta { color: #7a6e62; font-size: 0.95rem; }
.offer-meta { margin-top: 0.25rem; }
.offer-meta a:hover { color: var(--brand); }
.badge.status-pending { color: #8a5a00; background: #fdf0d2; }
.badge.status-countered { color: #8a5a00; background: #fdf0d2; }
.badge.status-accepted { color: #1e6b34; background: #e6f4ea; }
.badge.status-declined, .badge.status-expired { color: #7a6e62; background: var(--muted); }
.offer-actions { display: flex; align-items: flex-start; gap: 0.6rem; }
.offer-actions form { margin: 0; }
.small { width: auto; height: auto; padding: 0.4rem 1.1rem; font-size: 0.95rem; }
.reject { position: relative; }
.reject summary { padding: 0.4rem 1.1rem; list-style: none; color: #b3261e; border: 2px solid #b3261e; border-radius: 999px; cursor: pointer; }
.reject summary::-webkit-details-marker { display: none; }
.reject[open] summary { background: #b3261e; color: white; }
.reject form { position: absolute; right: 0; z-index: 5; display: flex; flex-direction: column; gap: 0.6rem; width: 15rem; margin-top: 0.4rem; padding: 0.9rem; background: white; border: 1px solid var(--muted); border-radius: var(--radius); box-shadow: 0 6px 20px rgb(0 0 0 / 0.12); }
.reject label { display: flex; flex-direction: column; gap: 0.25rem; font-weight: 600; }
.reject label small { font-weight: 400; color: #7a6e62; }
.reject input[type="number"] { width: 100%; height: 2.4rem; padding: 0 0.7rem; font: inherit; border: 1px solid var(--muted); border-radius: 8px; }
.secondary.small.danger { border-color: #b3261e; }

/* Sold listings */
.card { position: relative; }
.card.sold .card-img { filter: grayscale(1); opacity: 0.5; }
.card.sold h3, .card.sold .price { color: #9a8f84; }
.sold-badge { position: absolute; top: 0.6rem; left: 0.6rem; padding: 0.15rem 0.7rem; font-size: 0.85rem; font-weight: 700; color: white; background: rgb(43 33 24 / 0.75); border-radius: 999px; }
.category-title.query { text-transform: none; }

/* Live search dropdown */
.search { position: relative; }
.suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; overflow: hidden; background: white; border: 1px solid var(--muted); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / 0.14); }
.suggest:empty { display: none; }
.suggest-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.9rem; }
.suggest-item:hover, .suggest-item:focus, .suggest-all:hover, .suggest-all:focus { background: var(--bg); outline: none; }
.suggest-item img, .suggest-noimg { flex: none; width: 44px; height: 44px; object-fit: cover; background: var(--muted); border-radius: 8px; }
.suggest-name { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.suggest-price { font-weight: 700; color: var(--brand-dark); }
.suggest-item.sold img { filter: grayscale(1); opacity: 0.5; }
.suggest-item.sold .suggest-name, .suggest-item.sold .suggest-price { color: #9a8f84; }
.suggest-none { margin: 0; padding: 0.7rem 0.9rem; color: #7a6e62; }
.suggest-all { display: block; padding: 0.65rem 0.9rem; font-weight: 600; text-align: center; color: var(--brand-dark); border-top: 1px solid var(--muted); }

.footer-logo { font-family: "Kaushan Script", cursive; font-size: 1.9rem; line-height: 1; color: var(--brand); vertical-align: middle; }
.footer span { display: inline-flex; align-items: center; gap: 0.5rem; }

/* Related listings, view counter */
.related { margin-top: 3rem; }
.view-count { margin: 1.5rem 0 0; color: #7a6e62; }
.card-actions .views { margin-left: auto; font-size: 0.9rem; color: #7a6e62; }

.form [hidden] { display: none !important; }

/* Hand-offs */
.handoff { max-width: 640px; margin: 1.5rem auto 4rem; padding: 0 2rem; }
.handoff h1 { margin: 0.25rem 0 0.5rem; font-size: 2.2rem; }
.handoff-who { margin: 0 0 0.75rem; }
.underline { text-decoration: underline; }
.badge.status-in_locker { color: #1f4f8a; background: #dbe9fb; }
.badge.status-completed { color: #1e6b34; background: #e6f4ea; }
.locker-box { margin: 1rem 0 1.5rem; padding: 1rem 1.2rem; background: #eef5ff; border: 1px solid #c9dcf7; border-radius: var(--radius); }
.locker-box p { margin: 0.4rem 0 0; }
.locker-box code, .event code { padding: 0.1rem 0.5rem; font-size: 1.05rem; background: white; border: 1px solid var(--muted); border-radius: 6px; }
.locker-note { color: #5c5046; }
.timeline { margin: 0 0 2rem; padding: 0 0 0 1.2rem; list-style: none; border-left: 3px solid var(--muted); }
.event { position: relative; margin-bottom: 1rem; padding-left: 0.4rem; }
.event::before { content: ""; position: absolute; left: calc(-1.2rem - 7px); top: 0.4rem; width: 11px; height: 11px; background: var(--brand); border-radius: 50%; }
.event p { margin: 0.2rem 0 0; }
.event-head { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; align-items: baseline; }
.event-meta { font-size: 0.9rem; color: #7a6e62; }
.event-text { color: #5c5046; overflow-wrap: anywhere; white-space: pre-wrap; }
.handoff-forms { display: flex; flex-direction: column; gap: 1rem; }
.panel { padding: 1rem 1.2rem; background: white; border: 1px solid var(--muted); border-radius: var(--radius); }
.panel h3 { margin: 0; font-size: 1.15rem; }
.panel label small { font-weight: 400; color: #7a6e62; }
.handoff-done { padding: 0.8rem 1rem; color: #1e6b34; background: #e6f4ea; border-radius: var(--radius); }
.panel .secondary { width: auto; align-self: flex-start; height: 2.6rem; padding: 0 1.4rem; }
.panel .primary { width: auto; align-self: flex-start; padding: 0.6rem 1.4rem; }

/* How to get it: pick-up, delivery or locker */
.fee { color: #7a6e62; font-size: 0.95em; }
.fee-note { margin: -0.5rem 0 1rem; font-size: 0.9rem; color: #7a6e62; }
.form .choices { flex-wrap: nowrap; flex-direction: column; align-items: stretch; gap: 0.5rem; }
.form .choice { flex-direction: row; align-items: center; gap: 0.6rem; padding: 0.6rem 0.9rem; font-weight: 400; background: white; border: 1px solid var(--muted); border-radius: 10px; cursor: pointer; }
.form .choice:has(input:checked) { border-color: var(--brand); background: #fff6ea; }
.form .choice input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--brand); }
.choice-name { flex: 1; font-weight: 600; }
.choice-price { color: var(--brand-dark); font-weight: 600; }
.address { display: flex; flex-direction: column; gap: 1rem; }
.address .row2 { display: grid; grid-template-columns: 1fr 8rem; gap: 0.75rem; }
.address-note { margin: 0; font-size: 0.9rem; color: #7a6e62; }
.address label small { font-weight: 400; color: #7a6e62; }
.form:has(input[name="method"][value="pickup"]:is(:checked, [type="hidden"])) .address { display: none; }
.quote { padding: 0.7rem 0.9rem; background: #fff6ea; border-radius: 10px; }
.quote:empty { display: none; }
.quote p { margin: 0; }
.quote-hint { color: #7a6e62; }
.quote-total { margin-top: 0.2rem; font-size: 1.15rem; }
.handoff-method { margin: 0 0 1rem; color: #5c5046; }

/* Admin */
.admin { max-width: 1100px; margin: 1.5rem auto 4rem; padding: 0 2rem; }
.admin h1 { margin: 0 0 1rem; font-size: 2.5rem; }
.admin .count { display: inline-block; min-width: 1.5rem; padding: 0 0.5rem; font-size: 0.9rem; line-height: 1.5rem; text-align: center; color: #7a6e62; background: var(--muted); border-radius: 999px; vertical-align: middle; }
.user-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.user-chips li { padding: 0.25rem 0.9rem; background: white; border: 1px solid var(--muted); border-radius: 999px; }
.user-chips a:hover { color: var(--brand); }
.admin-list { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.5rem; }
.admin-item { padding: 0.8rem 1rem; background: white; border: 1px solid var(--muted); border-radius: var(--radius); }
.admin-item p { margin: 0 0 0.25rem; overflow-wrap: anywhere; }
.admin-item .reason { margin: 0.3rem 0 0; color: #b3261e; }
.admin-item .when { margin-left: 0.4rem; font-size: 0.9rem; color: #7a6e62; }
.admin-text { white-space: pre-wrap; padding: 0.4rem 0.7rem; background: var(--bg); border-radius: 8px; }
.admin-item.with-photo { display: flex; gap: 1rem; align-items: flex-start; }
.admin-item.with-photo img { display: block; width: 120px; height: 120px; object-fit: cover; border-radius: 8px; }
.none { margin: 0 0 1.5rem; color: #7a6e62; }

/* Reporting messages and photos */
.report-details { margin-top: 0.3rem; font-size: 0.85rem; }
.report-details summary { display: inline; color: #7a6e62; cursor: pointer; }
.report-details summary:hover { color: #b3261e; text-decoration: underline; }
.report-details[open] summary { margin-bottom: 0.4rem; }
.report-form select, .report-form input[type="text"] { height: 2.4rem; }
.msg-photo { display: flex; flex-direction: column; align-items: flex-start; }
.msg .report-form { max-width: 18rem; gap: 0.5rem; }

/* Profile with a side menu */
.profile { max-width: 1100px; margin: 0 auto 4rem; padding: 0 2rem; }
.profile .category-title { margin-bottom: 0.25rem; }
.profile-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2.5rem; align-items: start; margin-top: 1.5rem; }
.side-nav { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 0.2rem; padding: 0.5rem; background: white; border: 1px solid var(--muted); border-radius: var(--radius); }
.side-nav a { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.6rem 0.9rem; font-weight: 600; border-radius: 8px; }
.side-nav a:hover { background: var(--bg); }
.side-nav a.active { color: white; background: var(--brand); }
.side-nav a.active .unread { color: var(--brand-dark); background: white; }
.profile-content { min-width: 0; }
.profile-content .section-title:first-child { margin-top: 0; }
.tabs { display: flex; gap: 1.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--muted); }
.tabs a { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0; font-size: 1.05rem; border-bottom: 3px solid transparent; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs a:hover { color: var(--brand); }
.notice { margin-bottom: 1rem; padding: 0.7rem 1rem; color: #8a5a00; background: #fdf0d2; border-radius: var(--radius); }
.admin-bar { margin-bottom: 1rem; }
.admin-bar button { width: auto; }

@media (max-width: 800px) {
  .profile-layout { grid-template-columns: 1fr; gap: 1rem; }
  .side-nav { position: static; flex-direction: row; overflow-x: auto; padding: 0.3rem; }
  .side-nav a { flex: none; }
}

/* Admin: users and actions */
.user-list { display: flex; flex-direction: column; margin: 0 0 1.5rem; padding: 0; list-style: none; background: white; border: 1px solid var(--muted); border-radius: var(--radius); }
.user-list li { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 1rem; }
.user-list li + li { border-top: 1px solid var(--muted); }
.user-list form { display: block; margin: 0 0 0 auto; }
.user-list a:hover { color: var(--brand); }
.badge.banned { color: #b3261e; background: #fbe4e2; }
.admin-actions { display: flex; align-items: center; gap: 0.6rem; margin: 0.6rem 0 0; }
.admin-actions button { width: auto; }

/* Single way to get an item: ask for a confirmation instead of a choice */
.only-option { margin: 0; }
.form .confirm { flex-direction: row; align-items: center; gap: 0.6rem; font-weight: 600; }
.form .confirm input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--brand); }

/* Admin: user search, paging, categories */
.admin-search { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 1rem; }
.admin-search input[type="search"] { flex: 1; min-width: 12rem; height: 2.4rem; }
.admin-search select { height: 2.4rem; }
.admin-search button { width: auto; }
.pager { display: flex; justify-content: space-between; margin: 0 0 1.5rem; }
.user-list .joined { margin-left: auto; font-size: 0.9rem; color: #7a6e62; }
.user-list .joined + form { margin: 0; }
.cat-list li form { margin: 0; }
.cat-list .rename { display: flex; flex: 1; gap: 0.5rem; }
.cat-list .rename input { flex: 1; height: 2.2rem; }
.cat-list button { width: auto; }
.cat-add { display: flex; gap: 0.5rem; margin: 0 0 1.5rem; }
.cat-add input { flex: 1; height: 2.4rem; }
.cat-add button { width: auto; }
.admin-error { margin: 0 0 1rem; color: #b3261e; font-weight: 600; }
.cat-list .cat-name { flex: 1; font-weight: 600; }
.cat-list .rename input:not([hidden]) { flex: 1; }
.cat-list .edit-actions { display: flex; gap: 0.4rem; }
.cat-list a.count:hover { color: var(--brand); background: #fff6ea; }
.cat-list [hidden] { display: none !important; }

/* Desktop: connect a phone */
.phone-page { max-width: 36rem; margin: 1.5rem auto 4rem; padding: 0 2rem; }
.phone-page h1 { margin: 0 0 1rem; font-size: 2.5rem; }
.phone-page form { margin: 1rem 0 0; }
.phone-page button { width: auto; }
.qr { display: block; margin: 1rem 0; padding: 0.75rem; background: white; border: 1px solid var(--muted); border-radius: var(--radius); }
.qr-meta { margin: 0.5rem 0; color: #5c5046; overflow-wrap: anywhere; }
.photo-caption { margin: 0.4rem 0 0; color: #5c5046; }
.photo-caption:empty { display: none; }

/* Phone: step-by-step new listing */
body.m { margin: 0; background: var(--bg); }
.m-top { display: flex; align-items: center; justify-content: space-between; padding: 0.8rem 1rem; background: white; border-bottom: 1px solid var(--muted); }
.m-top .logo { font-family: "Kaushan Script", cursive; font-size: 1.6rem; color: var(--brand); }
.m-user { color: #7a6e62; }
.m-main { max-width: 32rem; margin: 0 auto; padding: 1rem 1rem 6rem; }
.m-main h1 { margin: 0.5rem 0 1rem; font-size: 1.9rem; line-height: 1.15; }
.m-progress { margin: 0.5rem 0 0; font-size: 0.9rem; color: #7a6e62; }
.m-hint { margin: -0.5rem 0 1rem; color: #7a6e62; }
.m-main input[type="text"], .m-main input[type="number"], .m-main textarea, .m-main select { width: 100%; box-sizing: border-box; padding: 0.8rem 0.9rem; font: inherit; font-size: 1.1rem; background: white; border: 1px solid var(--muted); border-radius: 10px; }
.m-main textarea { resize: vertical; }
.m-price { display: flex; align-items: center; gap: 0.5rem; font-size: 1.6rem; font-weight: 700; }
.m-btn { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 3rem; padding: 0 1.2rem; font: inherit; font-weight: 700; text-decoration: none; border-radius: 10px; border: 1px solid var(--brand); cursor: pointer; }
.m-btn.primary { color: white; background: var(--brand); }
.m-btn.secondary { color: var(--brand-dark); background: white; }
.m-btn:disabled { opacity: 0.6; }
.m-photo-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.m-photos { display: flex; flex-direction: column; gap: 0.7rem; margin: 0; padding: 0; list-style: none; }
.m-photos li { display: flex; gap: 0.7rem; padding: 0.6rem; background: white; border: 1px solid var(--muted); border-radius: 10px; }
.m-photos img { width: 6rem; height: 6rem; flex: none; object-fit: cover; border-radius: 8px; }
.m-photos li > div { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 0.5rem; }
.m-photos input { font-size: 1rem !important; padding: 0.5rem 0.7rem !important; }
.m-photo-actions { display: flex; gap: 0.4rem; }
.m-photo-actions button { min-width: 2.6rem; min-height: 2.4rem; font: inherit; background: var(--bg); border: 1px solid var(--muted); border-radius: 8px; }
.m-photo-actions button:disabled { opacity: 0.35; }
.m-choices { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.m-choices label { cursor: pointer; }
.m-choices input { position: absolute; opacity: 0; pointer-events: none; }
.m-choices span { display: block; padding: 0.7rem 1.1rem; font-size: 1.1rem; font-weight: 600; background: white; border: 1px solid var(--muted); border-radius: 999px; }
.m-choices input:checked + span { color: white; background: var(--brand); border-color: var(--brand); }
.m-choices input:focus-visible + span { outline: 2px solid var(--brand-dark); outline-offset: 2px; }
.m-choices.stack { flex-direction: column; }
.m-choices.stack span { border-radius: 10px; }
.m-choices small { font-weight: 400; opacity: 0.8; }
.m-review p { margin: 0 0 0.5rem; overflow-wrap: anywhere; }
.m-thumbs { display: flex; gap: 0.4rem; overflow-x: auto; }
.m-thumbs img { width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: 8px; }
.m-error { margin: 1rem 0 0; color: #b3261e; font-weight: 600; }
.m-nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 0.6rem; max-width: 32rem; margin: 0 auto; padding: 0.8rem 1rem; box-sizing: border-box; background: var(--bg); border-top: 1px solid var(--muted); }
.m-nav .m-btn { flex: 1; }
#done .m-btn { display: flex; margin-bottom: 0.7rem; }

/* Admin: seller aliases */
.alias-add { display: flex; flex-direction: column; gap: 0.8rem; max-width: 28rem; margin: 0 0 1.5rem; }
.alias-add label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; }
.alias-add small { font-weight: 400; color: #7a6e62; }
.alias-add textarea, .alias-add input { padding: 0.5rem 0.7rem; font: inherit; border: 1px solid var(--muted); border-radius: 8px; }
.alias-add button { width: auto; align-self: flex-start; }
.alias-list li form { margin: 0; }
.alias-list .alias-edit { display: flex; flex: 1; flex-wrap: wrap; gap: 0.5rem; }
.alias-list .alias-edit input { height: 2.2rem; padding: 0 0.6rem; font: inherit; border: 1px solid var(--muted); border-radius: 8px; }
.alias-list .alias-edit input[type="text"] { flex: 1; min-width: 8rem; }
.alias-list button { width: auto; }
.m-alias { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 1rem; font-weight: 600; }
.admin-ok { margin: 0 0 1rem; color: #1e6b34; font-weight: 600; }
.alias-assign { display: flex; flex-direction: column; gap: 0.7rem; margin: 0 0 1.5rem; padding: 1rem; background: white; border: 1px solid var(--muted); border-radius: var(--radius); }
.alias-assign h3 { margin: 0; }
.alias-assign .qr-meta { margin: 0; }
.assign-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.assign-row input[type="number"] { width: 6rem; height: 2.2rem; padding: 0 0.6rem; font: inherit; border: 1px solid var(--muted); border-radius: 8px; }
.assign-aliases { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-top: 0.5rem; }
.alias-assign button { width: auto; align-self: flex-start; }

/* Place filter and map */
.filters { margin: 0 0 1rem; }
.filters label { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.filters select { height: 2.4rem; max-width: 100%; padding: 0 0.7rem; font: inherit; background: white; border: 1px solid var(--muted); border-radius: 10px; }


.view { display: inline-block; text-decoration: none; }
.map-wrap { margin: 0 0 0.6rem; }
.hood-map { width: 100%; height: min(70vh, 640px); min-height: 22rem; background: #efe6da; border: 1px solid var(--muted); border-radius: var(--radius); overflow: hidden; }
.map-legend { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.5rem; font-size: 0.85rem; color: #5c5046; }
.map-legend .ramp { width: 8rem; height: 0.6rem; background: linear-gradient(to right, #efe6da, #f8cf9a, #a85a14); border-radius: 999px; }
.map-hint { margin: 0.4rem 0 1.5rem; color: #7a6e62; }
.maplibregl-popup-content { font-family: inherit; padding: 0.6rem 0.9rem; }
.maplibregl-popup-content a { color: var(--brand-dark); font-weight: 600; text-decoration: underline; }
.map-page { max-width: 1100px; margin: 1.5rem auto 4rem; padding: 0 2rem; }
.map-page h1 { margin: 0 0 0.5rem; font-size: 2.5rem; }
.borough-list { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.borough-list a { display: flex; flex-direction: column; padding: 0.7rem 1.1rem; background: white; border: 1px solid var(--muted); border-radius: var(--radius); }
.borough-list a:hover { border-color: var(--brand); }
.borough-list span { color: #7a6e62; }
.area summary { display: flex; align-items: center; gap: 0.7rem; cursor: pointer; }
.area-table { width: 100%; margin-top: 0.7rem; border-collapse: collapse; }
.area-table th, .area-table td { padding: 0.35rem 0.5rem; text-align: right; border-top: 1px solid var(--muted); }
.area-table th:first-child, .area-table td:first-child { text-align: left; }
.area-table a:hover { color: var(--brand); }
@media (max-width: 800px) { .map-page { padding: 0 1rem; } .nav-map { margin-right: 0.6rem; } }

/* Searchable place picker */
.wp { position: relative; display: inline-block; }
.wp-btn { min-width: 14rem; height: 2.4rem; padding: 0 2rem 0 0.9rem; font: inherit; text-align: left; background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%237a6e62' stroke-width='2'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 0.8rem center; border: 1px solid var(--muted); border-radius: 10px; cursor: pointer; }
.wp-btn:hover, .wp-btn[aria-expanded="true"] { border-color: var(--brand); }
.wp-panel { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; width: max(100%, 18rem); background: white; border: 1px solid var(--muted); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / 0.14); }
.wp-panel input { display: block; width: calc(100% - 1rem); height: 2.4rem; margin: 0.5rem; padding: 0 0.8rem; font: inherit; border: 1px solid var(--muted); border-radius: 8px; }
.wp-panel ul { max-height: 18rem; margin: 0; padding: 0 0 0.4rem; overflow-y: auto; list-style: none; }
.wp-panel li { padding: 0.4rem 1rem; cursor: pointer; }
.wp-panel li[hidden] { display: none; }
.wp-panel .wp-group { padding-top: 0.6rem; font-size: 0.8rem; font-weight: 700; color: #7a6e62; text-transform: uppercase; letter-spacing: 0.04em; cursor: default; }
.wp-panel li[role="option"]:hover, .wp-panel li.active { background: var(--bg); }
.wp-panel li[aria-selected="true"] { font-weight: 700; color: var(--brand-dark); }
.category-title.heading { text-transform: none; }
.page-head { max-width: 1100px; margin: 1.5rem auto 0; padding: 0 2rem; }
.page-head h1 { margin: 0 0 0.3rem; font-size: 2.8rem; line-height: 1.1; }
@media (max-width: 800px) { .page-head { padding: 0 1rem; } .page-head h1 { font-size: 2.2rem; } }

/* Pick-up instructions */
.pickup-note { display: none; margin: 0; }
.form:has(input[name="method"][value="pickup"]:is(:checked, [type="hidden"])) .pickup-note { display: block; }
.pickup-card h3 { margin: 0 0 0.5rem; }
.pickup-details { display: grid; grid-template-columns: 5rem 1fr; gap: 0.3rem 1rem; margin: 0 0 0.6rem; }
.pickup-details dt { font-weight: 700; color: #7a6e62; }
.pickup-details dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }

/* Chat: messages and the reply box in one card */
.chat { margin: 0 0 1.5rem; overflow: hidden; background: white; border: 1px solid #e4d8c8; border-radius: var(--radius); }
.chat-empty { margin: auto; color: #7a6e62; }
.chat-composer { padding: 0.7rem; border-top: 1px solid #e4d8c8; }
.composer-row { display: flex; align-items: flex-end; gap: 0.5rem; }
.composer-row textarea { flex: 1; min-height: 2.6rem; max-height: 10rem; padding: 0.6rem 0.9rem; font: inherit; line-height: 1.3; resize: none; background: var(--bg); border: 1px solid var(--muted); border-radius: 20px; }
.composer-row .primary { width: auto; height: 2.6rem; padding: 0 1.2rem; }
.attach { display: grid; place-items: center; flex: none; width: 2.6rem; height: 2.6rem; color: #7a6e62; border-radius: 50%; cursor: pointer; }
.attach:hover, .attach:focus-within { color: var(--brand); background: var(--bg); }
.attach-count { margin: 0.4rem 0 0 0.4rem; font-size: 0.9rem; color: #7a6e62; }
.chat-composer .form-slot:empty { display: none; }
.chat-composer .form-slot { margin-top: 0.5rem; }
.chat-closed { margin: 0; padding: 0.8rem 1rem; color: #7a6e62; border-top: 1px solid #e4d8c8; background: var(--bg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Order page: side menu with Overview, Messages and Timeline */
.handoff.profile { max-width: 1100px; margin: 0 auto 4rem; padding: 0 2rem; }
.handoff .back { display: inline-block; margin: 1rem 0 0; }
.handoff .category-title { text-transform: none; margin: 0.4rem 0 0.25rem; }
.handoff .handoff-who { margin: 0 0 1rem; }
.next-step { margin: 0 0 1.2rem; padding: 1.1rem 1.3rem; background: #fff6ea; border: 1px solid #efcb99; border-radius: var(--radius); }
.next-step.done { background: #eef7f0; border-color: #bcd9c4; }
.next-step h2 { margin: 0.5rem 0 0.2rem; font-size: 1.5rem; }
.next-step p { margin: 0; color: #5c5046; }
.handoff .panel, .handoff .locker-box { margin: 0 0 1.2rem; }
.finish summary { cursor: pointer; font-weight: 600; }
.finish form { margin-top: 0.8rem; }
.details-title { margin: 1.8rem 0 0.6rem; font-size: 1.2rem; }
.order-details { display: grid; grid-template-columns: 7rem 1fr; gap: 0.5rem 1rem; margin: 0; padding: 1rem 1.3rem; background: white; border: 1px solid var(--muted); border-radius: var(--radius); }
.order-details dt { font-weight: 700; color: #7a6e62; }
.order-details dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 800px) { .handoff.profile { padding: 0 1rem; } .order-details { grid-template-columns: 6rem 1fr; } }

/* Reporting an order */
.side-nav .side-subtle { margin-top: 0.6rem; font-weight: 400; font-size: 0.95rem; color: #7a6e62; border-top: 1px solid var(--muted); border-radius: 0; }
.side-nav .side-subtle.active { color: white; border-radius: 8px; }
.report-hint { margin: 0.8rem 0 0; font-size: 0.95rem; color: #7a6e62; }
.report-link { margin-left: 1rem; color: #b3261e; }
.confirm-card h3 { margin: 0 0 0.5rem; }
.report-card { margin: 0 0 1rem; }
.report-card p { margin: 0 0 0.4rem; }
.admin-reply { padding: 0.6rem 0.8rem; background: var(--bg); border-radius: 8px; }
.handoff .choices { margin: 0 0 1rem; padding: 0; border: 0; }
.handoff .choice { margin-bottom: 0.4rem; }
.order-report summary { cursor: pointer; margin: 0.4rem 0; font-weight: 600; }
.close-report { flex-wrap: wrap; }
.close-report input[type="text"] { flex: 1; min-width: 12rem; height: 2.3rem; padding: 0 0.7rem; font: inherit; border: 1px solid var(--muted); border-radius: 8px; }
.admin-thread { max-height: 20rem; overflow-y: auto; margin: 0.4rem 0 0; }
