:root {
  --green: #2f4f3e; --green-l: #e6efe9; --bg: #f5f5f2; --card: #fff;
  --text: #1f2421; --muted: #6b726d; --line: #dcdfdb;
  --red: #b3392f; --amber: #b9770e; --blue: #2b5f9e;
}
* { box-sizing: border-box; }
:root { color-scheme: light; }
button, input, select, textarea {
  -webkit-appearance: none; appearance: none; color: var(--text);
  -webkit-text-fill-color: currentColor; opacity: 1;
}
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}
a { color: var(--green); }
main { max-width: 720px; margin: 0 auto; padding: 12px; }
h1 { font-size: 1.35rem; margin: 8px 0 12px; }
h2 { font-size: 1.05rem; margin: 0 0 8px; }
h3 { font-size: .95rem; margin: 16px 0 6px; }

.top {
  background: var(--green); color: #fff; padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top));
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 20;
}
.top a { color: #fff; }
.brand { font-weight: 700; text-decoration: none; }
.who { font-size: .85rem; }
.who em { opacity: .8; font-style: normal; }
.who a { margin-left: 6px; opacity: .85; }

.live {
  background: #fff3cd; border-bottom: 1px solid #e6d28a; text-align: center;
  padding: 8px; font-size: .9rem; position: sticky;
  top: calc(44px + env(safe-area-inset-top)); z-index: 19;
}
.live[hidden] { display: none; }

.flash { padding: 10px 12px; border-radius: 8px; margin-bottom: 10px; }
.flash.ok { background: var(--green-l); }
.flash.err { background: #fbe4e1; color: var(--red); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin-bottom: 12px;
}
.stack > * + * { margin-top: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label { display: block; font-weight: 600; font-size: .9rem; }
label small, .label small { font-weight: 400; color: var(--muted); }
.label { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
input, textarea, select {
  width: 100%; margin-top: 4px; padding: 11px; font: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
input[type=file] { padding: 9px; background: var(--bg); }
input[type=checkbox], input[type=radio] { width: auto; margin: 0 6px 0 0; }

.btn {
  display: inline-block; text-align: center; text-decoration: none;
  padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
  -webkit-text-fill-color: var(--text);
}
form .btn { width: 100%; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; -webkit-text-fill-color: #fff; }
.btn.danger { background: #fff; border-color: var(--red); color: var(--red); -webkit-text-fill-color: var(--red); }
.btn.small { width: auto; padding: 8px 12px; font-size: .85rem; }
a.btn { display: block; }

.muted, .meta { color: var(--muted); font-size: .85rem; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }
.back { margin: 0 0 6px; }
.small-link { font-size: .9rem; }

/* list */
.search { display: grid; grid-template-columns: 1fr 110px; gap: 8px; margin-bottom: 8px; }
.search input, .search select { margin: 0; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; padding-bottom: 2px; }
.tabs a {
  white-space: nowrap; padding: 7px 12px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: .88rem;
}
.tabs a.on { background: var(--green); color: #fff; border-color: var(--green); }
.tabs b { opacity: .8; margin-left: 3px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { margin-bottom: 8px; }
.row {
  display: flex; gap: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 10px; text-decoration: none; color: inherit;
}
.thumb {
  width: 84px; height: 84px; flex: none; border-radius: 8px; overflow: hidden;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .7rem;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.info { min-width: 0; flex: 1; }
.title { font-weight: 700; }
.desc {
  color: var(--muted); font-size: .88rem; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip { font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: var(--green-l); }
.chip.need { background: #fff3cd; color: var(--amber); font-weight: 700; }
.chip.count { background: transparent; color: var(--muted); padding-left: 0; }
.chip.c-want { background: #fde9a8; font-weight: 700; }
.chip.c-sell_ct { background: #dde8f5; }
.chip.c-dispose { background: #f6dedb; }
.chip.c-auction { background: #f3e6cf; }
.decided { margin-top: 6px; font-weight: 700; color: var(--green); font-size: .88rem; }

/* item */
.gallery { display: flex; gap: 8px; overflow-x: auto; margin: 12px 0; }
.gallery img { height: 220px; width: auto; max-width: 85vw; object-fit: cover; border-radius: 10px; display: block; }
.gallery.edit img { height: 90px; }
.delimg { flex: none; font-weight: 400; font-size: .8rem; }
.desc-full { white-space: pre-wrap; }

.options { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px; text-align: left; width: 100%;
  padding: 13px; border-radius: 10px; border: 2px solid var(--line); background: #fff;
  font: inherit; cursor: pointer; color: var(--text);
  -webkit-text-fill-color: var(--text); opacity: 1;
}
.opt .count {
  min-width: 26px; height: 26px; border-radius: 50%; background: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; flex: none;
}
.opt.picked { border-color: var(--green); background: var(--green-l); font-weight: 700; }
.opt b { margin-left: auto; color: var(--green); font-size: .8rem; }
.voters { width: 100%; border-collapse: collapse; font-size: .92rem; }
.voters td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.voters em { color: var(--muted); font-size: .75rem; }

.comment { padding: 8px 0; border-bottom: 1px solid var(--line); position: relative; }
.comment .x { position: absolute; right: 0; top: 4px; background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; width: auto; }
form.inline { display: inline; }

.decision-box { background: var(--green-l); border-color: var(--green); }
.decision-box .big { font-size: 1.1rem; font-weight: 700; margin: 4px 0; }
.decision-form { border-color: var(--green); border-width: 2px; }

/* login */
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pill input { position: absolute; opacity: 0; }
.pill span {
  display: block; text-align: center; padding: 13px; border: 2px solid var(--line);
  border-radius: 10px; background: #fff; font-weight: 600;
}
.pill input:checked + span { border-color: var(--green); background: var(--green-l); }

/* bottom nav */
.bottom {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff;
  border-top: 1px solid var(--line); z-index: 20;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom a {
  flex: 1; text-align: center; padding: 14px 4px; text-decoration: none;
  color: var(--text); font-weight: 600; font-size: .9rem;
}
.bottom a.plus { color: #fff; background: var(--green); }
