:root {
  --bg: #f6f3ee; --card: #fff; --ink: #1f1d1a; --muted: #6f6a62; --line: #e4ded4;
  --accent: #d9622b; --accent-ink: #fff; --ok: #2f7d4f; --warn: #b7791f; --bad: #b4382f;
  --radius: 12px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.45; }
main { padding: 16px; max-width: 1100px; margin: 0 auto; }
main.narrow { max-width: 640px; }
main.center { padding-top: 12vh; }
h1 { font-size: 1.35rem; margin: 0 0 8px; }
h2 { font-size: 1.1rem; margin: 20px 0 8px; }
h3 { font-size: 1rem; margin: 0 0 6px; }
a { color: var(--accent); }
.top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.logo { font-weight: 800; letter-spacing: -0.02em; font-size: 1.2rem; }
.logo::before { content: "◆ "; color: var(--accent); }
.tag { font-size: .7rem; font-weight: 600; background: var(--ink); color: #fff; padding: 2px 6px; border-radius: 6px; vertical-align: middle; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--ink); padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
nav a.active { background: var(--ink); color: #fff; }
nav a .count { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 6px; font-size: .75rem; margin-left: 4px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; }
.card.clickable { cursor: pointer; }
.card.clickable:hover { border-color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.chip { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #ece7df; white-space: nowrap; }
.chip.submitted { background: #e8eefc; color: #2c4a9a; }
.chip.quoted { background: #fff1db; color: #8a5a00; }
.chip.accepted { background: #efe7fb; color: #5b3a9a; }
.chip.in_progress { background: #e0f2ff; color: #0b5f8a; }
.chip.done { background: #e2f4e8; color: var(--ok); }
.chip.rejected, .chip.declined, .chip.cancelled { background: #f3e5e3; color: var(--bad); }
.chip.warn { background: #fff1db; color: var(--warn); }
.chip.bad { background: #f9e0dd; color: var(--bad); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); vertical-align: -2px; }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: 10px; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.danger { color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
button.link { border: none; background: none; padding: 0; color: var(--accent); }
label { display: block; font-weight: 600; font-size: .9rem; margin: 10px 0 4px; }
input, textarea, select { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
input[type=checkbox] { width: auto; }
textarea { min-height: 70px; }
.inline input, .inline select { width: auto; }
.colours { display: flex; flex-direction: column; gap: 8px; }
.colour-group .options { display: flex; flex-wrap: wrap; gap: 6px; }
.colour-opt { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; font-weight: 500; margin: 0; background: #fff; }
.colour-opt.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img { width: 120px; height: 120px; object-fit: contain; background: #fafafa; border: 1px solid var(--line); border-radius: 8px; }
.price { font-size: 1.6rem; font-weight: 800; }
.pay { display: grid; gap: 6px; }
.pay .field { display: flex; gap: 8px; align-items: center; }
.pay code { background: #f3efe8; padding: 4px 8px; border-radius: 6px; flex: 1; }
.qr { width: 180px; height: 180px; }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: top; }
th { background: #faf8f4; font-weight: 600; }
.breakdown td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.error { color: var(--bad); font-weight: 600; }
.banner { padding: 10px 14px; border-radius: 10px; margin: 8px 0; }
.banner.warn { background: #fff1db; }
.banner.bad { background: #f9e0dd; }
#toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; }
.stack > * + * { margin-top: 8px; }
.progress { height: 8px; background: #ece7df; border-radius: 4px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); }
input[type=color] { height: 42px; padding: 2px 4px; cursor: pointer; }
