:root {
  --green: #0b5d3b;
  --green-dark: #07432a;
  --saffron: #f4b400;
  --ink: #13241b;
  --muted: #55655c;
  --paper: #f1f6f2;
  --white: #ffffff;
  --line: #cfdcd4;
  --red: #b3261e;
  --wa: #128c4a;
  --display: 'Bricolage Grotesque', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
}
img { max-width: 100%; display: block; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5.5vw, 3.4rem); font-weight: 800; }
h2 { font-size: 1.6rem; font-weight: 800; }
h3, .h3 { font-family: var(--display); font-size: 1.15rem; font-weight: 600; margin: 1.6em 0 .4em; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.narrow { max-width: 620px; padding-block: 2.2rem 3rem; }
.small { font-size: .9rem; color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--saffron); color: var(--ink); padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.top :focus-visible, .foot :focus-visible { outline-color: var(--saffron); }

/* header */
.top { background: var(--green); color: var(--white); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: .7rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--white); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.4rem; }
.brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: var(--white); }
.nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; font-weight: 700; }
.nav a:not(.btn) { color: var(--white); text-decoration: none; }
.nav a:not(.btn):hover { text-decoration: underline; }
.nav form { margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--white); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }

.freebar { background: var(--saffron); color: var(--ink); font-weight: 700; font-size: .98rem; }
.freebar .wrap { padding-block: .45rem; }
.flash { background: #e3f3ea; border-bottom: 1px solid var(--line); }
.flash .wrap { padding-block: .7rem; font-weight: 700; }

/* buttons */
.btn {
  display: inline-block; border: 2px solid var(--green); background: var(--green); color: var(--white);
  font: 700 1rem var(--body); padding: .65rem 1.2rem; border-radius: 6px; text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--green-dark); border-color: var(--green-dark); color: var(--white); }
.btn-accent { background: var(--saffron); border-color: var(--saffron); color: var(--ink); }
.btn-accent:hover { background: #ffc933; border-color: #ffc933; color: var(--ink); }
.btn-quiet { background: transparent; color: var(--green); }
.btn-quiet:hover { background: var(--paper); color: var(--green-dark); }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: var(--white); }
.btn-wa { background: var(--wa); border-color: var(--wa); }
.btn-wa:hover { background: #0d6e3a; border-color: #0d6e3a; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* hero */
.hero { background: var(--paper); border-bottom: 1px solid var(--line); padding-block: 2.6rem 2rem; }
.hero h1 { max-width: 14ch; }
.search { display: grid; grid-template-columns: 1fr; gap: .6rem; margin: 1.4rem 0 1.2rem; max-width: 900px; }
.search input, .search select { width: 100%; }
@media (min-width: 800px) {
  .search { grid-template-columns: 2fr 1.2fr 1fr auto; }
}
.stalls { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.stalls a {
  display: block; padding: .35rem .8rem; background: var(--white); border: 1px solid var(--line); border-left: 5px solid var(--saffron);
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: .95rem;
}
.stalls a:hover { border-left-color: var(--green); background: var(--white); color: var(--green-dark); }

/* listings grid */
.listing-area { padding-block: 2rem 3rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1.8rem 1rem; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2rem 1.2rem; } }
.tile { display: block; color: var(--ink); text-decoration: none; }
.tile-img { position: relative; aspect-ratio: 4 / 3; background: #dfeae3; border-radius: 6px; overflow: hidden; }
.tile-img img { width: 100%; height: 100%; object-fit: cover; }
.noimg { display: grid; place-items: center; width: 100%; height: 100%; padding: .8rem; text-align: center; font-family: var(--display); font-weight: 600; color: var(--green-dark); background: repeating-linear-gradient(135deg, #e3eee7, #e3eee7 12px, #d8e6dd 12px, #d8e6dd 24px); }
.noimg.big { aspect-ratio: 4 / 3; font-size: 1.4rem; border-radius: 6px; }
.price { position: absolute; left: 0; bottom: 0; background: var(--saffron); color: var(--ink); font-weight: 800; padding: .25rem .65rem; border-top-right-radius: 6px; font-size: .98rem; }
.tile h3 { margin: .6rem 0 .1rem; font-size: 1.05rem; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile:hover h3 { text-decoration: underline; }
.meta { color: var(--muted); font-size: .92rem; margin: 0; }
.empty { padding: 2rem 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2.2rem; }

/* detail */
.detail { display: grid; gap: 1.8rem; padding-block: 1.6rem 3rem; }
@media (min-width: 860px) { .detail { grid-template-columns: 1.2fr 1fr; gap: 2.6rem; align-items: start; } }
.detail-media img { width: 100%; border-radius: 6px; background: #dfeae3; }
.detail h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.crumbs { margin: 0 0 .4rem; font-weight: 700; }
.detail-price { font-family: var(--display); font-size: 1.9rem; font-weight: 800; margin: 0 0 .3rem; }
.contact { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.2rem 0; }
.desc { white-space: pre-wrap; max-width: 62ch; }
.share { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0 0 .6rem; }
.share a, .share button {
  display: inline-block; font: 700 .95rem var(--body); padding: .4rem .85rem; background: var(--white); border: 2px solid var(--line);
  border-radius: 6px; color: var(--ink); text-decoration: none; cursor: pointer;
}
.share a:hover, .share button:hover { border-color: var(--green); color: var(--green-dark); }
.owner { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.owner form, .mine-actions form { margin: 0; }
.notice { background: var(--paper); border-left: 5px solid var(--saffron); padding: .8rem 1rem; font-weight: 700; }

.chip { display: inline-block; font: 700 .85rem var(--body); padding: .1rem .6rem; border-radius: 999px; vertical-align: middle; }
.chip-live { background: #d9f0e2; color: var(--green-dark); }
.chip-wait { background: #fff0c2; color: #6a4b00; }
.chip-sold { background: #e6e6e6; color: #333; }

/* forms */
.form { display: grid; gap: .35rem; margin: 1.2rem 0 1.4rem; }
.form label { font-weight: 700; margin-top: .8rem; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--white); border: 2px solid var(--line); border-radius: 6px; padding: .6rem .75rem; min-height: 46px;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(11, 93, 59, .2); }
textarea { resize: vertical; }
.form .btn { margin-top: 1.2rem; justify-self: start; min-width: 11rem; }
.error { background: #fdecea; border-left: 5px solid var(--red); padding: .7rem 1rem; color: #6d1510; font-weight: 700; }
.preview { margin-top: .5rem; }
.preview img { max-height: 220px; border-radius: 6px; border: 1px solid var(--line); }
[hidden] { display: none !important; }

/* dashboard */
.mine { list-style: none; margin: 1.4rem 0 3rem; padding: 0; }
.mine li { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.mine-main { display: grid; gap: .1rem; }
.mine-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; }
@media (min-width: 800px) { .mine li { grid-template-columns: 1fr auto auto; } .mine-actions { grid-column: auto; } }

.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }

/* footer */
.foot { background: var(--green-dark); color: #d6e6dc; padding-block: 1.8rem; margin-top: 2rem; font-size: .95rem; }
.foot a { color: var(--white); }
.foot p { margin: 0 0 .6rem; max-width: 70ch; }
.foot .small { color: #a9c3b3; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* seller profiles and verification */
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #dfeae3; flex: none; }
.avatar-lg { width: 96px; height: 96px; }
.avatar-sm { width: 40px; height: 40px; }
.avatar-none { display: inline-grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.4rem; color: var(--green-dark); }
.avatar-sm.avatar-none { font-size: 1.1rem; }
.avatar-lg.avatar-none { font-size: 2.2rem; }
.profile-head { display: flex; align-items: center; gap: 1rem; margin: 1rem 0 .6rem; }
.vbadge { display: inline-block; background: #d9f0e2; color: var(--green-dark); font: 700 .82rem var(--body); padding: .05rem .55rem; border-radius: 999px; white-space: nowrap; vertical-align: middle; }
.who { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* filters, reviews, safety */
.search .more { grid-column: 1 / -1; background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: .5rem .8rem; }
.search .more summary { cursor: pointer; font-weight: 700; }
.morerow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-top: .6rem; align-items: end; }
.morerow label { font-weight: 700; font-size: .92rem; }
.morerow label.chk { display: flex; gap: .5rem; align-items: center; min-height: 46px; }
.morerow label.chk input { width: auto; min-height: 0; }
.stars { color: #c98900; letter-spacing: .05em; white-space: nowrap; }
.review { border-bottom: 1px solid var(--line); padding: .7rem 0; }
.review p { margin: .2rem 0 0; }
.tipbox { background: var(--paper); border-left: 5px solid var(--saffron); padding: .6rem .9rem; margin: 1rem 0 .4rem; font-size: .95rem; }
.reportbox { margin: .4rem 0 1rem; }
.reportbox summary { cursor: pointer; color: var(--muted); }
.reportbox form { margin-top: .5rem; }
.reportbox select { min-width: 220px; }
