:root {
  --bg: #faf7f0; --surface: #ffffff; --text: #1f2a1c; --muted: #6b7366; --line: #e3ded2;
  --brand: #2f6b2f; --brand-ink: #ffffff; --accent: #c8781e;
  --ok-bg: #e3f1df; --ok: #2a6a2a; --warn-bg: #fbedd5; --warn: #8a5410; --bad-bg: #f8dfdc; --bad: #9b2c22;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141912; --surface: #1d241a; --text: #e8eee3; --muted: #9aa494; --line: #2f392b;
    --brand: #7cbf6b; --brand-ink: #10160e; --accent: #e3a35a;
    --ok-bg: #233a20; --ok: #a6d99a; --warn-bg: #3d2f17; --warn: #f0c27e; --bad-bg: #3f1f1b; --bad: #f1a097;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); }
h1 { font-size: 1.7rem; line-height: 1.2; margin: .4em 0; }
h2 { font-size: 1.2rem; margin: .2em 0 .6em; }
h3 { font-size: 1rem; margin: .2em 0; }
code { font-family: ui-monospace, Menlo, monospace; font-weight: 600; letter-spacing: .05em; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 16px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); gap: 12px; }
.topbar nav { display: flex; gap: 14px; align-items: center; }
.brand { font-weight: 800; font-size: 1.2rem; text-decoration: none; color: var(--brand); }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 32px 16px; }
.flash { background: var(--ok-bg); color: var(--ok); padding: 10px 16px; text-align: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; }
.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.big { font-size: 1.15rem; }
.pre { white-space: pre-line; }
.error { background: var(--bad-bg); color: var(--bad); padding: 8px 12px; border-radius: 8px; }
.btn { display: inline-block; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.btn.big { width: 100%; padding: 16px; font-size: 1.15rem; text-align: center; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.link.danger { color: var(--bad); }
.inline { display: inline; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; }
label { display: block; font-weight: 600; font-size: .92rem; }
label input, label select, label textarea { margin-top: 4px; font-weight: 400; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.stack { display: grid; gap: 12px; }
.formgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-items: end; margin-top: 10px; }
.formgrid .wide { grid-column: 1 / -1; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--line); color: var(--text); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.muted { color: var(--muted); }
.badge { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .75rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.list { list-style: none; padding: 0; margin: 0 0 8px; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.alert-sold_out, .alert-cash_short { color: var(--bad); }
.table { width: 100%; border-collapse: collapse; }
.table td, .table th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.neg { color: var(--bad); } .pos { color: var(--ok); }
.totalrow td { font-weight: 700; border-bottom: 0; }
.cards { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.hero { text-align: center; padding: 40px 0; max-width: 640px; margin: 0 auto; }
.hero h1 { font-size: 2.1rem; }
.ownerbar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.ownerbar select { width: auto; padding: 4px 8px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.tabs a { white-space: nowrap; padding: 6px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: .92rem; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.checklist li { margin: 4px 0; }
.checklist li.done a { text-decoration: line-through; color: var(--muted); }
.product summary { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; cursor: pointer; }
.product .pname { font-weight: 700; flex: 1 1 140px; }
.product.inactive { opacity: .7; }
.stockbtns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.order .items { margin: 6px 0; padding-left: 18px; }
.order .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status-cancelled { opacity: .6; }
.standhead { margin-bottom: 20px; }
/* Kiosk */
.kiosk .wrap { padding-bottom: 260px; }
.kgrid { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kitem { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.kitem.picked { border-color: var(--brand); }
.kitem.out { opacity: .5; }
.kname { font-weight: 700; font-size: 1.05rem; }
.stepper { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.stepper button { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.stepper button[data-step="-1"] { background: var(--line); color: var(--text); }
.kqty { font-size: 1.3rem; font-weight: 700; min-width: 2ch; text-align: center; }
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: grid; gap: 10px; max-width: 1000px; margin: 0 auto; box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
.cartbar .total { font-size: 1.2rem; display: flex; justify-content: space-between; }
.methods { display: flex; flex-wrap: wrap; gap: 8px; }
.method { border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; display: flex; gap: 6px; align-items: center; font-weight: 600; cursor: pointer; }
.method:has(input:checked) { border-color: var(--brand); background: var(--ok-bg); }
.receipt h1 { font-size: 1.5rem; }
.refcode { font-size: 1.6rem; background: var(--warn-bg); color: var(--warn); padding: 2px 10px; border-radius: 8px; }
/* Printable sign */
.sign { background: #fff; color: #111; }
.signpage { max-width: 7.5in; margin: 0 auto; text-align: center; padding: 24px; }
.signpage h1 { font-size: 2.6rem; margin-bottom: 0; }
.signpage .lead { font-size: 1.6rem; margin: 0 0 12px; color: #2f6b2f; font-weight: 700; }
.signpage .qr { width: 4in; max-width: 100%; }
.signpage .steps { text-align: left; display: inline-block; font-size: 1.3rem; }
.signpage .url { color: #555; word-break: break-all; }
.small-qr { display: flex; align-items: center; justify-content: center; gap: 12px; }
.small-qr img { width: 1.2in; }
.signpage .thanks { font-size: 1.2rem; font-weight: 600; }
.noprint { text-align: center; }
@media print { .noprint { display: none; } .signpage { padding: 0; } }
@media (max-width: 520px) { h1 { font-size: 1.45rem; } .hero h1 { font-size: 1.7rem; } }
/* Admin */
.banner { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner.admin { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.btn.danger { background: var(--bad); color: #fff; }
.dangerzone { border-color: var(--bad-bg); }
.tablewrap { overflow-x: auto; padding: 0; }
.tablewrap .table th, .tablewrap .table td { padding: 10px 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.searchform { display: flex; gap: 6px; }
.searchform input { width: 200px; }
.dangerzone h2 + p, .dangerzone form + h2 { margin-top: 20px; }
/* Addresses & domains */
.addr { display: flex; align-items: center; gap: 0; margin-top: 4px; }
.addr input { margin-top: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1; min-width: 0; }
.addr .suffix { padding: 9px 10px; border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0; background: var(--surface); color: var(--muted); font-weight: 400; white-space: nowrap; }
.okmsg { color: var(--ok); } .errmsg { color: var(--bad); }
.dnsbox { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; }
.dnsbox table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.dnsbox td, .dnsbox th { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--line); }
.dnsbox code { user-select: all; }
.pro { background: linear-gradient(135deg, var(--ok-bg), var(--warn-bg)); }
.pill.pro { background: var(--accent); color: #fff; }
