:root {
  --paper: #edf0ea;
  --surface: #ffffff;
  --ink: #15252a;
  --muted: #56676b;
  --line: #c8d1ca;
  --accent: #0d6b57;
  --accent-ink: #ffffff;
  --tag: #f3c24a;
  --tag-ink: #2b2208;
  --danger: #a8322d;
  --sans: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;
  --r: 6px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111a1c; --surface: #182427; --ink: #e6ece7; --muted: #9aaaa8;
    --line: #2d3d40; --accent: #3fb394; --accent-ink: #0b1a16; --danger: #e4776f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans); font-optical-sizing: auto;
}
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2 { line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); font-weight: 800; margin: 0 0 .6rem; }
h2 { font-size: 1.3rem; font-weight: 600; margin: 2rem 0 .6rem; }
.mono, .dn, code { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hint { display: block; color: var(--muted); font-size: .9rem; font-weight: 400; }

/* ---------- chrome ---------- */
header.site {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem;
  max-width: 1120px; margin: 0 auto; padding: 1.1rem 1.25rem;
}
.brand { font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
header.site nav { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.1rem; }
header.site nav a { color: var(--ink); text-decoration: none; }
header.site nav a:hover { text-decoration: underline; }
main { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem 4rem; }
footer.site { max-width: 1120px; margin: 0 auto; padding: 2rem 1.25rem; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
footer.site p { max-width: 70ch; margin: .3rem 0; }

/* ---------- controls ---------- */
.btn {
  display: inline-block; border: 0; border-radius: var(--r); cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: 600 1rem var(--sans);
  padding: .7rem 1.2rem; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.small { padding: .4rem .8rem; font-size: .95rem; color: var(--accent-ink) !important; }
.btn.large { font-size: 1.15rem; padding: .9rem 1.6rem; }
.btn.secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.danger { color: var(--danger); }
form.inline { display: inline; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--r); padding: .6rem .7rem; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
.stack { display: grid; gap: 1rem; max-width: 34rem; }
.stack label { display: grid; gap: .3rem; font-weight: 600; }

.flash { padding: .75rem 1rem; border-radius: var(--r); background: var(--surface); border-left: 4px solid var(--accent); max-width: 70ch; }
.flash.err { border-left-color: var(--danger); }
.note { color: var(--muted); }

/* ---------- hero + search ---------- */
.hero { padding: 3rem 0 2rem; max-width: 46rem; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 40rem; margin: 0 0 1.6rem; }
.search { display: grid; grid-template-columns: 1fr auto auto; gap: .5rem; }
.search input { font-family: var(--mono); font-size: 1.05rem; }
@media (max-width: 640px) { .search { grid-template-columns: 1fr; } }

/* ---------- listings: the price tag is the one bold element ---------- */
.count { color: var(--muted); margin: 1rem 0; }
.listings { list-style: none; margin: 0; padding: 0 1px 1px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.listings li { background: var(--surface); border: 1px solid var(--line); margin: 0 -1px -1px 0; }
.listings a { display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; padding: 1.4rem 1.25rem 1.6rem; color: var(--ink); text-decoration: none; min-height: 9rem; }
.listings a:hover .dn { text-decoration: underline; text-decoration-color: var(--accent); }
.listings .dn { font-size: 1.25rem; font-weight: 600; word-break: break-all; }
.tag {
  position: relative; display: inline-block; background: var(--tag); color: var(--tag-ink);
  font: 600 .95rem var(--mono); padding: .35rem .8rem .35rem 1.55rem;
  clip-path: polygon(.75rem 0, 100% 0, 100% 100%, .75rem 100%, 0 50%);
  transform: rotate(-2deg);
}
.tag .hole { position: absolute; left: .7rem; top: 50%; width: .4rem; height: .4rem; margin-top: -.2rem; border-radius: 50%; background: var(--surface); }
.detail .tag { font-size: 1.4rem; padding-left: 2.1rem; margin: .5rem 0 1rem; }
.detail .tag .hole { left: .95rem; width: .55rem; height: .55rem; margin-top: -.275rem; background: var(--paper); }
@media (prefers-reduced-motion: no-preference) {
  .listings a:hover .tag { transform: rotate(0deg); transition: transform .15s ease-out; }
}

.empty { padding: 3rem 0; font-size: 1.15rem; max-width: 46rem; }
.pager { display: flex; gap: 1.2rem; align-items: center; margin-top: 1.5rem; }

/* ---------- detail / order ---------- */
.detail, .order, .narrow { max-width: 46rem; padding-top: 2rem; }
.dn.big { font-size: clamp(2rem, 7vw, 4rem); font-weight: 600; word-break: break-all; letter-spacing: -0.02em; }
.desc { max-width: 65ch; }
.meta { color: var(--muted); font-size: .95rem; }
.steps { padding-left: 1.3rem; max-width: 60ch; }
.steps li { margin-bottom: .5rem; }

.record, .facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 1rem 0 1.5rem; }
.record { background: var(--surface); padding: 1rem 1.2rem; border-radius: var(--r); border: 1px solid var(--line); }
.record dd, .facts dd { margin: 0; overflow-wrap: anywhere; }
.record dt, .facts dt { color: var(--muted); }
.code { background: var(--surface); padding: .2rem .5rem; border-radius: 4px; border: 1px solid var(--line); user-select: all; }

.status { display: inline-block; font-weight: 600; padding: .25rem .7rem; border-radius: 99px; background: var(--surface); border: 1.5px solid var(--line); }
.status.s-completed { border-color: var(--accent); color: var(--accent); }
.status.s-disputed, .status.s-refunded { border-color: var(--danger); color: var(--danger); }
.aside-action { margin-top: 1rem; }
.dispute { margin-top: 1.5rem; }
.dispute summary { cursor: pointer; color: var(--danger); font-weight: 600; margin-bottom: .8rem; }
.order form + form, .order form + details { margin-top: 1rem; }

/* ---------- dashboard / admin ---------- */
.panel { margin-top: 2rem; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--surface); border: 1px solid var(--line); }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 600; color: var(--muted); font-size: .9rem; }
.price-in { width: 7.5rem; padding: .35rem .5rem; margin-right: .4rem; }
td.actions form + form { margin-left: .8rem; }

.payout-form { display: grid; gap: .6rem; max-width: 26rem; }
.payout-form label { display: grid; gap: .3rem; font-weight: 600; }
.payout-form + form { margin-top: .8rem; }

/* ---------- offers ---------- */
.make-offer { margin: 1.25rem 0 .5rem; max-width: 34rem; }
.make-offer summary { cursor: pointer; font-weight: 600; color: var(--accent); margin-bottom: .9rem; }
.thread { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: .75rem; max-width: 40rem; }
.thread li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem 1rem; max-width: 85%; }
.thread li.mine { justify-self: end; border-color: var(--accent); }
.thread .who { margin: 0; }
.thread .when { display: block; color: var(--muted); font-size: .85rem; }
.thread .msg { margin: .5rem 0 0; white-space: normal; }
.offer-actions { display: grid; gap: 1.25rem; max-width: 34rem; }
.badge { display: inline-block; background: var(--tag); color: var(--tag-ink); font-weight: 600; font-size: .85rem; padding: .15rem .55rem; border-radius: 99px; text-decoration: none; }
header.site nav .link { color: var(--ink); text-decoration: none; }
header.site nav .link:hover { text-decoration: underline; }
.stack button { justify-self: start; }

/* ---------- on/off switch ---------- */
.stack label.switch-row { display: flex; align-items: center; gap: .7rem; font-weight: 600; cursor: pointer; width: fit-content; }
input.switch {
  -webkit-appearance: none; appearance: none; flex: none; position: relative; cursor: pointer;
  width: 2.6rem; height: 1.5rem; padding: 0; margin: 0; border: 0; border-radius: 99px;
  background: var(--line);
}
input.switch::before {
  content: ""; position: absolute; top: .2rem; left: .2rem; width: 1.1rem; height: 1.1rem;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
input.switch:checked { background: var(--accent); }
input.switch:checked::before { transform: translateX(1.1rem); }
input.switch:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  input.switch, input.switch::before { transition: background .15s ease, transform .15s ease; }
}
.is-off { opacity: .45; }

.row-actions { display: flex; align-items: center; gap: 1.25rem; }
td.actions a + form { margin-left: .8rem; }

/* ---------- parked "for sale" page ---------- */
.lander-body { min-height: 100vh; display: flex; flex-direction: column; }
.lander { flex: 1; width: 100%; max-width: 46rem; margin: 0 auto; padding: clamp(3rem, 12vh, 8rem) 1.25rem 3rem; }
.lander-kicker { color: var(--muted); font-size: 1.1rem; margin: 0 0 .4rem; }
.lander-lede { font-size: 1.2rem; color: var(--muted); max-width: 40rem; }
.lander .tag { font-size: 1.4rem; padding-left: 2.1rem; margin: .5rem 0 1.25rem; }
.lander .tag .hole { left: .95rem; width: .55rem; height: .55rem; margin-top: -.275rem; background: var(--paper); }
.lander-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 2rem; }
.lander-trust { padding-left: 1.2rem; color: var(--muted); max-width: 40rem; }
.lander-trust li { margin-bottom: .35rem; }
.lander-foot { max-width: 46rem; width: 100%; margin: 0 auto; padding: 1.5rem 1.25rem 2rem; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.lander-foot a { color: var(--ink); }

/* ---------- parked page setup (edit page) ---------- */
.parked { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.copy-row { display: flex; gap: .5rem; align-items: stretch; }
.copy-row input { font-family: var(--mono); font-size: .95rem; }
.copy-row button { flex: none; }
.parked ol { padding-left: 1.3rem; max-width: 60ch; }
.parked li { margin-bottom: .45rem; }
.label { display: block; font-weight: 600; margin-bottom: .3rem; }
h3 { font-size: 1.05rem; margin: 1.6rem 0 .4rem; }
