:root {
  --ink: #1d2330; --muted: #5f6675; --line: #e3e5ea; --bg: #f5f6f8; --card: #ffffff;
  --accent: #e4572e; --accent-ink: #ffffff; --ok: #1f7a4d; --ok-bg: #e8f5ee; --err: #b42318; --err-bg: #fdecea;
  --info-bg: #eef3fb; --radius: 12px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; font-size: 16px; }
a { color: var(--ink); }
code { font-size: 0.9em; background: #f0f1f4; padding: 1px 5px; border-radius: 4px; word-break: break-all; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1180px; }
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.brand { font-weight: 800; font-size: 1.3rem; text-decoration: none; letter-spacing: -0.02em; }
.brand span { color: var(--accent); }
.top-nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.top-nav a { text-decoration: none; font-weight: 600; }
main.wrap { padding-top: 28px; padding-bottom: 48px; }
.site-footer { color: var(--muted); font-size: 0.85rem; padding: 24px 0 40px; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); line-height: 1.2; margin: 0 0 16px; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; margin: 24px 0 12px; }
.card h2:first-child, .form h2:first-of-type { margin-top: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.narrow-left { max-width: 560px; }
.center { text-align: center; }
.intro { margin-bottom: 20px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 700; color: var(--accent); margin: 0 0 6px; }
.lead { font-size: 1.08rem; color: var(--muted); margin: 0; }
.referral-note { background: var(--ok-bg); color: var(--ok); display: inline-block; padding: 6px 12px; border-radius: 999px; margin-top: 12px; font-size: 0.95rem; }
.form h2 { border-top: 1px solid var(--line); padding-top: 20px; }
.form h2:first-of-type { border-top: 0; padding-top: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
input, select, textarea { font: inherit; color: inherit; }
.field input:not([type=color]):not([type=checkbox]):not([type=radio]), .field select, .filters input, .filters select, .inline-form input, .inline-form select, input.copy {
  width: 100%; padding: 11px 12px; border: 1px solid #c9ccd3; border-radius: 8px; background: #fff; min-height: 44px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #8fb3ff; outline-offset: 2px; }
.field input[type=file] { padding: 8px; }
.has-error input, .has-error select { border-color: var(--err) !important; }
.error { color: var(--err); font-size: 0.9rem; margin: 6px 0 0; }
.hint, .small { color: var(--muted); font-size: 0.88rem; margin: 6px 0 0; }
.muted { color: var(--muted); }
.colour-row { display: flex; align-items: center; gap: 10px; }
input[type=color] { width: 56px; height: 44px; border: 1px solid #c9ccd3; border-radius: 8px; padding: 3px; background: #fff; }
.grid-2, .grid-3 { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .wide .grid-2 { gap: 0 20px; } }
.radios { display: grid; gap: 8px; }
.radio, .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; margin: 0 0 6px; cursor: pointer; }
.radio input, .check input { margin-top: 4px; width: 18px; height: 18px; flex: 0 0 18px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 8px;
  border: 1px solid var(--ink); background: #fff; color: var(--ink); font-weight: 700; text-decoration: none; cursor: pointer; font-size: 1rem; }
.button.primary { background: var(--ink); color: #fff; }
.button.danger { border-color: var(--err); color: var(--err); }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; font-weight: 600; }
form.inline { display: inline; }
.flash { padding: 12px 14px; border-radius: 8px; margin: 0 0 16px; background: var(--info-bg); }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--err-bg); color: var(--err); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sub-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.sub-nav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 0.92rem; }
.sub-nav a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--muted); font-size: 0.9rem; }
.stat span { display: block; font-size: 1.8rem; font-weight: 800; color: var(--ink); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; display: block; overflow-x: auto; }
@media (min-width: 760px) { .table { display: table; } }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.table.small td { font-size: 0.86rem; }
td.json { font-family: ui-monospace, Menlo, monospace; font-size: 0.78rem; max-width: 320px; word-break: break-word; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #eef0f3; font-size: 0.78rem; font-weight: 700; vertical-align: middle; }
.badge.accent { background: #fde7df; color: #a63a17; }
.badge.danger { background: var(--err-bg); color: var(--err); }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0 0 16px; }
.dl dt { color: var(--muted); font-size: 0.9rem; }
.dl dd { margin: 0; word-break: break-word; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); vertical-align: -3px; margin-right: 4px; }
.logo-preview { margin: 0 0 16px; }
.logo-preview img { display: block; max-width: 100%; max-height: 220px; object-fit: contain; padding: 16px; border-radius: 8px;
  background: repeating-conic-gradient(#f0f1f4 0% 25%, #fff 0% 50%) 50% / 20px 20px; border: 1px solid var(--line); }
.logo-preview figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.filters, .inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input, .inline-form input { flex: 1 1 200px; width: auto; }
.filters select, .inline-form select { flex: 0 1 220px; width: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.perm-grid fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0; }
.perm-grid legend { font-weight: 700; padding: 0 4px; }
.danger-zone { margin-top: 12px; }
details summary { cursor: pointer; font-weight: 600; margin: 8px 0; }

.checklist { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 14px; }
.checklist li.done > strong { color: var(--ok); }
.checklist .inline-form { margin: 8px 0 0; }
.button[disabled] { opacity: .45; cursor: not-allowed; }

/* Logo approval (embroiderer) */
textarea { width: 100%; padding: 10px 12px; border: 1px solid #c9ccd3; border-radius: 8px; background: #fff; font: inherit; }
.plain-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; font-size: 0.92rem; }
.logo-card { display: flex; gap: 14px; align-items: center; text-decoration: none; }
.logo-card:hover { border-color: #b9bdc6; }
.logo-thumb { flex: 0 0 72px; width: 72px; height: 72px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line);
  background: repeating-conic-gradient(#f0f1f4 0% 25%, #fff 0% 50%) 50% / 14px 14px; font-weight: 700; }
.logo-thumb img { max-width: 60px; max-height: 60px; object-fit: contain; }
.logo-card small { display: block; margin-top: 4px; }
.emb-list { display: grid; gap: 12px; margin-bottom: 16px; }
.emb-item { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.emb-preview { flex: 0 0 110px; width: 110px; height: 110px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px; }
.emb-none { display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.draft-maker { padding: 12px; border-radius: 10px; background: var(--info-bg); margin-bottom: 16px; }
.draft-maker .inline-form { align-items: center; margin: 0; }
.draft-maker label { font-weight: 600; }
.draft-maker input[type=number] { flex: 0 0 90px; width: 90px; }
.upload-form h3 { margin: 0 0 10px; font-size: 1rem; }
.decision .radio select { margin-left: 4px; padding: 6px 8px; border-radius: 6px; border: 1px solid #c9ccd3; }
.swatch + code { margin-right: 6px; }
