:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #1d1b18;
  --muted: #6f6a62;
  --line: #e8e1d6;
  --gold: #b0802c;
  --gold-dark: #8a6420;
  --gold-soft: #f5ecdc;
  --yes: #2f7a4f;
  --yes-soft: #e4f2ea;
  --no: #b4453a;
  --no-soft: #f8e5e2;
  --abs: #8a857c;
  --abs-soft: #efede9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(30,25,15,.05), 0 6px 20px rgba(30,25,15,.05);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); }
a { color: var(--gold-dark); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.35rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.boot { padding: 4rem 1rem; text-align: center; color: var(--muted); }

/* ---------- layout ---------- */
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
header.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
header.top .bar { display: flex; align-items: center; gap: 12px; padding: 10px 0 6px; }
header.top img { height: 34px; }
header.top .who { margin-left: auto; text-align: right; font-size: .82rem; color: var(--muted); line-height: 1.3; }
header.top .who b { color: var(--ink); font-weight: 500; }
nav.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 0; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a { white-space: nowrap; text-decoration: none; color: var(--muted); padding: 8px 12px 10px; border-bottom: 2px solid transparent; font-weight: 500; font-size: .92rem; }
nav.tabs a.on { color: var(--ink); border-color: var(--gold); }
nav.tabs .badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--gold); color: #fff; font-size: .72rem; text-align: center; line-height: 18px; }
main { padding: 22px 0 60px; }
.demo-banner { background: #2b2620; color: #f4e9d4; font-size: .82rem; text-align: center; padding: 6px 12px; }
.demo-banner button { margin-left: 8px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 12px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi .value { font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1.1; margin-top: 4px; }
.kpi .sub { font-size: .82rem; color: var(--muted); }

.hero { background: linear-gradient(135deg, #2b2620, #4a3d29); color: #fbf3e4; border-radius: var(--radius); padding: 24px 22px; margin-bottom: 16px; }
.hero .eyebrow { font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: #d9b675; }
.hero h1 { color: #fff; margin: 6px 0 4px; }
.hero .meta { color: #e6d8bf; }
.hero .count { font-family: var(--serif); font-size: 1.4rem; color: #f0d394; margin-top: 8px; }

/* ---------- vendor ---------- */
.vendor, .card[id] { scroll-margin-top: 110px; }
.vendor .head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.vendor .head .title { flex: 1 1 260px; }
.chip { display: inline-block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-dark); background: var(--gold-soft); padding: 2px 8px; border-radius: 20px; margin-bottom: 6px; }
.status { font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.status.ok { background: var(--yes-soft); color: var(--yes); }
.status.bad { background: var(--no-soft); color: var(--no); }
.status.open { background: var(--gold-soft); color: var(--gold-dark); }
.status.closed { background: var(--abs-soft); color: var(--abs); }
.price { text-align: right; min-width: 150px; }
.price .big { font-family: var(--serif); font-size: 2rem; font-weight: 700; line-height: 1; }
.price .per { font-size: .85rem; color: var(--muted); }
.price .reg { font-size: .85rem; color: var(--muted); text-decoration: line-through; }
.price .save { font-size: .82rem; color: var(--yes); font-weight: 700; }
.price .tbd { font-family: var(--serif); font-size: 1.3rem; color: var(--muted); }
.note { background: var(--gold-soft); border-radius: 10px; padding: 10px 12px; font-size: .88rem; margin: 10px 0; }
ul.scope { margin: 8px 0 4px; padding-left: 0; list-style: none; columns: 2 220px; column-gap: 24px; }
ul.scope li { padding-left: 20px; position: relative; break-inside: avoid; margin-bottom: 3px; font-size: .92rem; }
ul.scope li::before { content: "✓"; position: absolute; left: 0; color: var(--gold); font-weight: 700; }

.tally { margin: 14px 0 10px; }
.bar3 { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--line); }
.bar3 span { display: block; height: 100%; }
.bar3 .y { background: var(--yes); }
.bar3 .n { background: var(--no); }
.bar3 .a { background: #c4bfb6; }
.tally .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .84rem; color: var(--muted); margin-top: 6px; }
.tally .legend b { color: var(--ink); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }

.votebtns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.votebtns button { flex: 1 1 120px; }
.vb { border: 1.5px solid var(--line); background: #fff; }
.vb.yes.on { background: var(--yes); border-color: var(--yes); color: #fff; }
.vb.no.on { background: var(--no); border-color: var(--no); color: #fff; }
.vb.abstain.on { background: var(--abs); border-color: var(--abs); color: #fff; }
.vb.yes:not(.on):hover { border-color: var(--yes); color: var(--yes); }
.vb.no:not(.on):hover { border-color: var(--no); color: var(--no); }
.myvote { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.locked { font-size: .88rem; color: var(--muted); background: var(--abs-soft); padding: 10px 12px; border-radius: 10px; margin-top: 6px; }

details { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
details summary { cursor: pointer; font-weight: 500; color: var(--gold-dark); list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "▸ "; }
details[open] summary::before { content: "▾ "; }
.who-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 16px; margin-top: 8px; font-size: .86rem; }
.who-list div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.c-yes { color: var(--yes); font-weight: 700; }
.c-no { color: var(--no); font-weight: 700; }
.c-abstain { color: var(--abs); font-weight: 700; }
.c-none { color: #b9b3a9; }

/* ---------- comments ---------- */
.comments { margin-top: 10px; }
.comment { padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment .meta { font-size: .8rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.comment .meta b { color: var(--ink); font-weight: 500; }
.comment .body { white-space: pre-wrap; word-wrap: break-word; margin-top: 2px; }
.comment .del { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .8rem; padding: 0; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.comment-form textarea { flex: 1; min-height: 44px; }

/* ---------- forms ---------- */
button, .btn { font: inherit; font-weight: 500; border-radius: 10px; padding: 10px 16px; cursor: pointer; border: 1.5px solid transparent; transition: .15s; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-dark); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold); }
.btn-link { background: none; border: 0; color: var(--gold-dark); padding: 4px 6px; text-decoration: underline; }
.btn-danger { background: none; border: 0; color: var(--no); padding: 4px 6px; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, textarea, select { font: inherit; width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); }
textarea { resize: vertical; }
label { display: block; font-size: .84rem; font-weight: 500; margin-bottom: 4px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--ink); }
.check input { width: auto; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 500; }
td.num, th.num { text-align: right; white-space: nowrap; }

/* ---------- login ---------- */
.login { max-width: 420px; margin: 8vh auto; padding: 0 16px; text-align: center; }
.login img { width: 200px; margin-bottom: 18px; }
.login .card { text-align: left; }
.persona { display: block; width: 100%; text-align: left; margin-bottom: 8px; }
.persona small { display: block; color: var(--muted); font-weight: 400; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,16,10,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: var(--radius); max-width: 520px; width: 100%; padding: 22px; max-height: 90vh; overflow: auto; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #2b2620; color: #fff; padding: 10px 18px; border-radius: 10px; opacity: 0; transition: .25s; pointer-events: none; z-index: 60; font-size: .92rem; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--no); }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 12px; }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }

@media (max-width: 600px) {
  h1 { font-size: 1.8rem; }
  .price { text-align: left; min-width: 0; }
  header.top .who .email { display: none; }
}
