:root {
  --ink: #16181b;
  --ink-2: #4a4f57;
  --ink-3: #80868f;
  --line: #e2e4e8;
  --line-2: #cfd3d9;
  --paper: #f6f6f4;
  --card: #fff;
  --accent: #1f4fd8;
  --accent-soft: #e7edfd;
  --good: #1a9a55;
  --ok: #e0a400;
  --poor: #d6453d;
  --warn: #9a5b00;
  --warn-bg: #fff4dc;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* a sideways swipe at the page's edge shouldn't bounce the page or go back a tab */
html, body { overscroll-behavior-x: none; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.45 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); margin: 28px 0 12px; }
input, select, button { font: inherit; color: inherit; }
input[type="text"], input[type="number"], input:not([type]), select {
  border: 1px solid var(--line-2); border-radius: 7px; padding: 7px 9px; background: #fff; min-width: 0;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.loading, .empty { color: var(--ink-3); padding: 40px 0; text-align: center; }
.hint { color: var(--ink-3); font-size: 13px; margin: 6px 0; }
.note { background: var(--warn-bg); color: var(--warn); border-radius: 7px; padding: 7px 10px; margin: 8px 0; font-size: 13px; }
.warn-text { color: var(--warn); font-size: 12px; }
.danger-text { color: var(--poor) !important; }
.meta { color: var(--ink-3); font-size: 12.5px; }
.spacer, .grow { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.next { text-align: right; margin: 28px 0 0; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: #fff;
  border-radius: 8px; padding: 7px 13px; cursor: pointer; text-decoration: none; color: var(--ink); font-weight: 550; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .12), 0 2px 6px rgba(31, 79, 216, .25);
}
.btn.primary:hover { background: #1a43b8; border-color: #1a43b8; }
.btn.primary:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.btn.big { padding: 11px 22px; font-size: 15px; border-radius: 10px; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 13px; }
.icon-btn { background: none; border: 0; font-size: 18px; color: var(--ink-3); cursor: pointer; padding: 0 6px; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: #e9ebee; border: 1px solid var(--line-2); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; padding: 7px 16px; border-radius: 7px; cursor: pointer; font-weight: 550; color: var(--ink-2); transition: background .12s, color .12s; }
.seg span:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .14), 0 1px 4px rgba(16, 24, 40, .08); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg.small span { padding: 5px 11px; font-size: 13px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 8px; transition: .2s; z-index: 50; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* home */
.masthead { padding: 40px 0 8px; }
.masthead h1 { font-size: 34px; letter-spacing: -0.02em; }
.lede { color: var(--ink-2); font-size: 16px; max-width: 620px; margin: 8px 0 0; }
.new-plan { padding: 18px 20px; margin-top: 24px; }
.new-plan h2 { margin-top: 0; }
#new-plan { display: grid; gap: 14px; max-width: 560px; justify-items: start; }
#new-plan > .field { justify-self: stretch; }
#new-plan .seg { justify-self: start; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 13px; }
.field em { font-style: normal; font-weight: 400; color: var(--ink-3); }
.sc-list { display: grid; gap: 6px; justify-items: start; }
.sc-row { display: flex; gap: 6px; align-items: center; }
.sc-row input[type="color"] { width: 38px; height: 34px; padding: 2px; border: 1px solid var(--line-2); border-radius: 7px; background: #fff; }
.sc-row .hex { width: 92px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.plan-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.plan-card { padding: 14px 16px; text-decoration: none; color: var(--ink); display: grid; gap: 4px; grid-template-columns: 1fr auto; align-items: center; }
.plan-card:hover { border-color: var(--ink-3); }
.plan-card .dots, .plan-card .meta { grid-column: 1 / -1; }
.plan-card strong { font-size: 16px; }
.dots { display: inline-flex; gap: 4px; }
.dots i, .dots-btn i { width: 16px; height: 16px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: 99px; background: #eee; }
.badge.nike { background: #111; color: #fff; }
.badge.adidas { background: #e8eef9; color: #1b3d8f; }
.foot { color: var(--ink-3); font-size: 12px; margin-top: 40px; }

/* editor */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 20px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px);
}
.back { text-decoration: none; color: var(--ink-2); font-weight: 550; }
.school-name { font-size: 18px; font-weight: 700; border-color: transparent !important; background: transparent !important; width: 260px; padding: 4px 6px !important; }
.school-name:hover { border-color: var(--line-2) !important; }
.dots-btn { display: inline-flex; gap: 3px; border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 4px 8px; cursor: pointer; color: var(--ink-2); font-size: 12px; }
.status { color: var(--ink-3); font-size: 12.5px; min-width: 56px; text-align: right; }
.pop { position: absolute; z-index: 30; right: 20px; top: 62px; padding: 16px; width: min(420px, calc(100% - 32px)); box-shadow: 0 12px 40px rgba(0,0,0,.14); }
.pop h3 { font-size: 15px; }
.pop .row { margin-top: 12px; justify-content: space-between; }
.steps { display: flex; gap: 0; max-width: 1240px; margin: 18px auto 6px; padding: 0 20px; overflow-x: auto; }
.steps a {
  flex: 1; display: flex; gap: 10px; align-items: center; padding: 10px 12px; text-decoration: none; color: var(--ink-2);
  border-bottom: 2px solid var(--line); min-width: 170px;
}
.steps a b { width: 24px; height: 24px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-size: 12px; flex: none; }
.steps a span { display: grid; font-weight: 600; }
.steps a small { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.steps a.on { border-color: var(--ink); color: var(--ink); }
.steps a.on b { background: var(--ink); color: #fff; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 16px 0 6px; }
.jump { display: flex; gap: 4px; flex-wrap: wrap; }
.jump a { font-size: 12.5px; text-decoration: none; padding: 4px 9px; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); }

/* art */
.drop { margin-top: 16px; padding: 22px; border: 2px dashed var(--line-2); display: grid; gap: 12px; text-align: center; justify-items: center; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { font-size: 16px; }
.drop p { margin: 4px 0 0; color: var(--ink-3); }
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 18px; }
.design { overflow: hidden; display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.checker {
  background-color: var(--check-a, #fff);
  background-image: linear-gradient(45deg, var(--check-b, #e6e8ec) 25%, transparent 25%), linear-gradient(-45deg, var(--check-b, #e6e8ec) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--check-b, #e6e8ec) 75%), linear-gradient(-45deg, transparent 75%, var(--check-b, #e6e8ec) 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.art-preview { position: relative; aspect-ratio: 4 / 3; padding: 14px; border-bottom: 1px solid var(--line); overflow: hidden; }
.art-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.num { position: absolute; top: 8px; left: 8px; background: var(--ink); color: #fff; font-weight: 700; font-size: 12px; border-radius: 99px; padding: 1px 8px; }
.design-body { padding: 12px; display: grid; gap: 9px; }
.design-name { font-weight: 650; }
.palette { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.palette i { width: 18px; height: 18px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px; }
.design-body input, .design-body select { width: 100%; }
.mini { display: grid; gap: 3px; font-size: 12px; color: var(--ink-3); }
.mini input, .mini select { color: var(--ink); font-size: 13px; padding: 5px 7px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 2px 9px; font-size: 12px; cursor: pointer; color: var(--ink-3); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.locations { display: grid; gap: 6px; justify-items: start; }
.location { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; font-size: 12px; color: var(--ink-3); }
.location select { color: var(--ink); font-size: 13px; padding: 5px 7px; }
.location-art { display: flex; gap: 8px; align-items: center; width: 100%; padding-left: 12px; }
.location-art select { flex: 1; min-width: 0; color: var(--ink); font-size: 13px; padding: 5px 7px; }
.location-art .checker { width: 36px; height: 36px; flex: none; border-radius: 4px; padding: 2px; }
.location-art img, .other-art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.prints-with { margin: 0; font-size: 12.5px; color: var(--ink-2); background: #eef3ff; border-radius: 6px; padding: 7px 9px; }
.other-art { display: flex; gap: 7px; align-items: flex-start; margin-top: 6px; font-size: 11px; font-weight: 400; color: var(--ink-3); line-height: 1.3; }
.other-art .checker { width: 34px; height: 34px; min-width: 34px; flex: none; border-radius: 4px; padding: 2px; margin: 0 !important; aspect-ratio: auto !important; }
.other-art b { display: block !important; color: var(--ink); font-size: 11px; }
.other-art a { font-size: 11px; word-break: normal !important; white-space: nowrap; }
.notes { font-size: 13px; }
.design .link-btn { justify-self: start; }

/* products */
.section .sec-head { position: sticky; top: 58px; background: var(--paper); padding: 8px 0; z-index: 5; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.section .sec-head h2 { margin: 0; }
.pick-all { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 9px; border-radius: 99px; background: #fff; border: 1px solid var(--line-2); font-size: 13px; font-weight: 550; color: var(--ink-2); cursor: pointer; user-select: none; }
.pick-all:hover { border-color: var(--ink-3); color: var(--ink); }
.pick-all input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.pick-all:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.product-list { display: grid; gap: 10px; }
.product { padding: 12px 14px; }
.product:not(.on) { opacity: .78; }
.product:not(.on):hover { opacity: 1; }
.product.on { border-color: var(--ink-3); box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.product-head { display: grid; grid-template-columns: auto 64px 1fr auto; gap: 12px; align-items: center; }
.include input { position: absolute; opacity: 0; }
.include span { display: block; width: 24px; height: 24px; border: 2px solid var(--line-2); border-radius: 6px; cursor: pointer; background: #fff; }
.include span { display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 800; }
.include input:checked + span { background: var(--ink); border-color: var(--ink); }
.include input:checked + span::after { content: "✓"; }
.include input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumb { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: #f0f0ee; display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.product-title { display: grid; gap: 1px; min-width: 0; }
.product-title strong { font-size: 15px; }
.price { display: grid; gap: 2px; font-size: 11.5px; color: var(--ink-3); text-align: right; }
.price input { width: 76px; text-align: right; }
.color-tools { display: flex; gap: 14px; align-items: center; margin: 12px 0 8px; color: var(--ink-3); font-size: 12.5px; }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-bottom: 8px; }
.color-chip {
  display: flex; align-items: center; gap: 7px; text-align: left; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; padding: 5px 7px; cursor: pointer; font-size: 12.5px; position: relative; min-width: 0;
}
.color-chip:hover { border-color: var(--ink-3); }
.color-chip i { width: 26px; height: 26px; border-radius: 6px; flex: none; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); }
.color-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.color-chip.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #f3f4f6; font-weight: 600; }
.color-chip.on::after { content: "✓"; position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; display: grid; place-items: center; }
.tag.school { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px rgba(0,0,0,.35); display: inline-block; }
.legend { display: inline-flex; gap: 6px; align-items: center; }
.add-color { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.add-color input[name="name"] { width: 220px; font-size: 13px; padding: 5px 8px; }
.add-color input[type="color"] { width: 34px; height: 30px; padding: 2px; border: 1px solid var(--line-2); border-radius: 6px; }

/* match */
.fit { display: inline-block; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1.5px #fff; vertical-align: middle; }
.fit.good { background: var(--good); }
.fit.ok { background: var(--ok); }
.fit.poor { background: var(--poor); }
.fit.unknown { background: #aaa; }
/* match grid: the page itself scrolls both ways, so there's one scroll and nothing to keep in step.
   The top bar, tabs and tools stay put; the art row and the product column are pinned. */
.editor.wide-page { width: max-content; min-width: 100%; --rowhead: 248px; }
.wrap.full { max-width: none; }
.wide-page > .topbar { left: 0; width: var(--page-w, 100vw); background: #fff; backdrop-filter: none; }
.wide-page > .steps { position: sticky; left: 0; width: var(--page-w, 100vw); max-width: none; margin-left: 0; margin-right: 0; padding-inline: max(20px, calc((var(--page-w, 100vw) - 1200px) / 2)); }
.wide-page #step > .match-controls, .wide-page #step > .no-art, .wide-page #step > .toolbar, .wide-page #step > .next { position: sticky; left: 20px; width: calc(var(--page-w, 100vw) - 40px); }
.match-controls { margin-top: 14px; }
.matrix { border-collapse: separate; border-spacing: 0; table-layout: fixed; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.matrix th, .matrix td { padding: 8px 7px; border-bottom: 1px solid var(--line); }
.lazy-row td { padding: 0; }
.rowhead-col { width: var(--rowhead); }
.matrix thead th { position: sticky; top: var(--pin-top, 0); z-index: 3; background: #fff; vertical-align: bottom; border-bottom: 2px solid var(--line-2); box-shadow: 0 6px 10px -8px rgba(16, 24, 40, .25); }
.matrix thead .corner { left: 0; z-index: 4; text-align: left; font-size: 12px; color: var(--ink-3); }
.dcol { width: 164px; font-size: 11.5px; font-weight: 600; }
.dcol .checker { width: 120px; height: 100px; border-radius: 6px; margin: 0 auto 6px; }
.dcol img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; }
.dcol span { display: block; width: 150px; margin: 0 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
/* the product column: a picture of the item, its colour, and its whole name */
.rowhead { position: sticky; left: 0; background: #fff; z-index: 2; text-align: left; font-weight: 400; vertical-align: middle; font-size: 13px; line-height: 1.3; }
.rowhead > div { display: flex; gap: 9px; align-items: center; }
.rowhead > div > span:last-child { min-width: 0; }
.row-thumb { width: 58px; height: 74px; object-fit: contain; flex: none; background: #fff; border-radius: 4px; }
.row-color { display: flex; align-items: center; gap: 5px; margin: 1px 0 2px; }
.rowhead small { display: block; color: var(--ink-3); font-size: 11px; }
.sw { width: 15px; height: 15px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.sec-row th { text-align: left; background: var(--paper); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.sec-row th span { position: sticky; left: 8px; display: inline-block; }
.cell {
  width: 150px; height: 132px; border: 0; border-radius: 8px; cursor: pointer; position: relative; display: block; padding: 0; margin: 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
/* The art is always shown at full strength on the shirt colour: that is what prints. */
/* the art is absolutely centred in the square, whatever its shape */
.cell img { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); object-fit: contain; }
.cell:hover { box-shadow: 0 0 0 2px var(--ink-3); }
.cell.on { box-shadow: 0 0 0 3px var(--ink); }
.cell.off-section:not(.on) { outline: 1.5px dashed var(--ink-3); outline-offset: 2px; }
.cell .fit { position: absolute; top: 6px; right: 6px; }
.cell .cell-num { position: absolute; top: 5px; left: 5px; padding: 0 5px; border-radius: 4px; background: rgba(255,255,255,.92); color: var(--ink); font-size: 10.5px; font-weight: 700; line-height: 16px; box-shadow: 0 0 0 1px rgba(0,0,0,.1); }
.cell .tick { position: absolute; bottom: -6px; right: -6px; width: 17px; height: 17px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 10px; display: grid; place-items: center; }

/* sheet */
.sheet { padding-top: 16px; }
.sheet .steps { max-width: none; margin: 0 0 18px; padding: 0; }
.sheet-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.sheet-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-end; border-bottom: 2px solid var(--ink); padding-bottom: 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: 12px; font-weight: 700; color: var(--ink-2); margin: 0 0 4px; }
.sheet-head h1 { font-size: 36px; letter-spacing: -0.02em; }
.sheet-head .meta { margin: 6px 0 0; font-size: 13.5px; }
.school-colors { display: flex; gap: 14px; flex-wrap: wrap; }
.school-colors span { display: grid; grid-template-columns: auto auto; column-gap: 6px; align-items: center; font-weight: 600; font-size: 13px; }
.school-colors i { width: 28px; height: 28px; border-radius: 6px; grid-row: span 2; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.school-colors small { color: var(--ink-3); font-weight: 400; font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
.art-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.art-index figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.art-index figure.unused { opacity: .6; }
.art-index .checker { aspect-ratio: 1; padding: 10px; }
.art-index img { width: 100%; height: 100%; object-fit: contain; display: block; }
.art-cap { padding: 8px 10px; display: grid; gap: 2px; font-size: 12px; color: var(--ink-3); }
.art-cap b { color: var(--ink); font-size: 13px; }
.art-cap a { word-break: break-all; }
/* one row per design (or product): what it is on the left, every garment it goes on to the right */
.sheet-row { display: grid; grid-template-columns: 190px 1fr; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.row-head { align-self: start; position: sticky; top: 12px; display: grid; gap: 4px; align-content: start; }
.row-head .checker { position: relative; aspect-ratio: 1; padding: 12px; border-radius: 8px; }
.row-head .checker img { width: 100%; height: 100%; object-fit: contain; display: block; }
.row-head .art-cap { padding: 4px 0 0; }
.row-head .count { margin: 0; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.prod-head .thumb { width: 72px; height: 72px; }
.prod-head h3 { font-size: 16px; }
.prod-head h3 span { display: block; font-weight: 500; color: var(--ink-2); font-size: 13px; }
.prod-head .meta, .prod-head .note { margin: 0; font-size: 12px; }
.prod-head .price-tag { text-align: left; font-size: 18px; margin: 4px 0 0; }
.no-art-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.no-art b small { font-weight: 500; color: var(--ink-3); }
.tile .code { font-style: normal; font-weight: 700; color: var(--ink); }
.price-tag { font-size: 20px; font-weight: 750; text-align: right; display: grid; }
.price-tag small { font-size: 11px; font-weight: 400; color: var(--ink-3); }
/* one tile per design on each colour; a front + back mock-up takes two columns */
.sheet-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; align-items: start; align-content: start; }
.tile { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; break-inside: avoid; }
.tile.wide { grid-column: span 2; }
.ground { min-height: 150px; display: flex; align-items: center; justify-content: center; padding: 16px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ground > img { max-width: 100%; max-height: 150px; object-fit: contain; }
.tile figcaption { padding: 10px 12px 12px; display: grid; gap: 3px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); }
.tile figcaption b { color: var(--ink); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.tile figcaption b small { font-weight: 400; color: var(--ink-3); font-size: 11px; margin-left: auto; }
.tile .num { position: static; display: inline-block; font-style: normal; font-weight: 700; font-size: 11px; background: var(--ink); color: #fff; border-radius: 99px; padding: 0 6px; margin-right: 2px; }
.swatch-img { width: 16px; height: 16px; border-radius: 3px; object-fit: cover; flex: none; outline: 1px solid rgba(0,0,0,.18); outline-offset: -1px; }
.placed { color: var(--ink-2); }
.tile.no-art { padding: 12px; display: grid; gap: 6px; align-content: start; font-size: 12px; color: var(--ink-3); background: var(--paper); border-style: dashed; }
.tile.no-art b { color: var(--ink-2); font-size: 12px; }
.tile.no-art span { display: flex; align-items: center; gap: 6px; }
.sheet-sec h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; }

@media (max-width: 720px) {
  .wrap { padding: 0 16px 48px; }
  .topbar { padding: 8px 16px; }
  .editor.wide-page { --rowhead: 150px; }
  .row-thumb { display: none; }
  .wide-page #step > .match-controls, .wide-page #step > .no-art, .wide-page #step > .toolbar, .wide-page #step > .next { left: 16px; width: calc(var(--page-w, 100vw) - 32px); }
  .school-name { width: 100%; order: -1; }
  .product-head { grid-template-columns: auto 48px 1fr; }
  .product-head .price { grid-column: 2 / -1; text-align: left; display: flex; gap: 6px; align-items: center; }
  .thumb { width: 48px; height: 48px; }
  .color-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .add-color input[name="name"] { width: auto; flex: 1; }
  .sheet-row { grid-template-columns: 1fr; }
  .row-head { position: static; grid-template-columns: 96px 1fr; column-gap: 12px; }
  .row-head .art-cap, .row-head .count { grid-column: 2; }
  .row-head .checker { grid-row: span 2; }
  .sheet-head h1 { font-size: 28px; }
  .section .sec-head { top: 96px; }
}

@media print {
  body { background: #fff; font-size: 11px; }
  /* browsers skip background colours when printing; the sheet needs its swatches, camo and grounds */
  .sheet, .sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .no-print, #toast { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .sheet-row, .art-index figure { border-color: #ccc; }
  .row-head { position: static; }
  .sheet-sec { break-before: auto; }
  a { color: inherit; text-decoration: none; }
  .checker { background: #fff; }
}

.base-note { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-3); }
.base-note i { width: 11px; height: 11px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); flex: none; }
.row-base { font-weight: 600; }
.base-edit > div { display: flex; gap: 6px; align-items: center; }
.base-edit input[type="color"] { width: 28px; height: 28px; padding: 1px; flex: none; }
.base-edit input:not([type="color"]) { flex: 1; min-width: 0; }
.ground-note { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; font-size: 12px; cursor: pointer; }
.ground-note span { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.ground-note i { width: 14px; height: 14px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.ground-note small { grid-column: 2; color: var(--ink-3); }

/* embroidery art */
.emb-badge { position: absolute; top: 8px; right: 8px; background: #7a3cc8; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .06em; border-radius: 4px; padding: 1px 5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.dcol .checker { position: relative; }
.dcol .emb-badge { top: -5px; right: -5px; font-size: 9px; padding: 0 4px; }
.design.emb { box-shadow: inset 0 3px 0 #7a3cc8; }
.seg.kind { align-self: start; }
.art-index .checker { position: relative; }

/* garment mock-ups on the builder sheet */
.ground.mocks { background: #f4f5f6; padding: 10px; }
.mock-fig .views { display: flex; justify-content: center; gap: 8px; min-height: 200px; width: 100%; }
.mock-fig .view { position: relative; flex: 0 1 240px; }
.mock-fig .view img { width: 100%; display: block; }
.mock-fig .view small { position: absolute; top: 4px; right: 4px; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
i.swatch-img { display: inline-block; }

/* builder sheet grid: a product on each row, a design in each column, colours in the cell */
.sheet.wide { max-width: none; }
.grid-wrap { margin-top: 18px; }
.sheet-grid { border-collapse: separate; border-spacing: 0; font-size: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); min-width: 100%; }
.sheet-grid th, .sheet-grid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px 7px; vertical-align: top; text-align: left; }
.sheet-grid tr > :last-child { border-right: 0; }
.sheet-grid thead th { position: sticky; top: 0; z-index: 2; background: #fff; vertical-align: bottom; border-bottom: 2px solid var(--ink); }
.sheet-grid .g-art { width: 84px; min-width: 84px; font-weight: 400; }
.sheet-grid .g-art.emb { box-shadow: inset 0 3px 0 #7a3cc8; }
.sheet-grid .g-art .checker { position: relative; width: 100%; aspect-ratio: 1; padding: 8px; border-radius: 6px; margin-bottom: 6px; }
.sheet-grid .g-art .checker img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sheet-grid .g-art .emb-badge { top: 4px; right: 4px; font-size: 9px; padding: 0 4px; }
.sheet-grid .g-art b { display: block; font-size: 12px; line-height: 1.25; }
.sheet-grid .g-art small { display: block; color: var(--ink-3); font-size: 11px; margin: 2px 0; }
.sheet-grid .g-art a { font-size: 11px; }
.sheet-grid .g-art .other-art .checker { width: 34px; aspect-ratio: auto; padding: 2px; border-radius: 4px; margin: 0; }
.sheet-grid .g-art .other-art b { font-size: 11px; }
.sheet-grid th.g-prod { position: sticky; left: 0; z-index: 1; background: #fff; width: 190px; min-width: 190px; display: table-cell; }
.sheet-grid thead th.g-prod { z-index: 3; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.sheet-grid tbody th.g-prod { font-weight: 400; }
.sheet-grid tbody th.g-prod > * { vertical-align: middle; }
.sheet-grid tbody th.g-prod .thumb { display: inline-block; width: 40px; height: 40px; margin-right: 8px; }
.sheet-grid tbody th.g-prod span { display: inline-block; width: calc(100% - 52px); }
.sheet-grid .g-prod b { font-size: 13px; }
.sheet-grid .g-prod a { text-decoration: none; color: var(--ink-3); }
.sheet-grid .g-prod small { display: block; color: var(--ink-3); font-size: 11px; line-height: 1.3; }
.sheet-grid .g-prod em { font-style: normal; font-weight: 650; font-size: 11px; color: var(--ink-2); }
.sheet-grid tbody tr:nth-child(odd) > * { background: #fafbfc; }
.sheet-grid td.hit { background: #eef3ff !important; }
.sheet-grid .gchip { display: flex; align-items: center; gap: 5px; line-height: 1.25; padding: 1px 0; }
.sheet-grid .gchip .swatch-img { width: 12px; height: 12px; }
.sheet-grid .g-none { width: 96px; min-width: 96px; color: var(--ink-3); }
.sheet-grid td.g-none { background: var(--paper) !important; }
.sheet-grid .g-sec th { position: sticky; left: 0; background: var(--paper) !important; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); padding: 10px 8px 6px; }
.sheet-grid tfoot td, .sheet-grid tfoot th { font-weight: 700; border-bottom: 0; }
@media print {
  .sheet-grid thead th { position: static; }
  .sheet-grid th.g-prod { position: static; }
  .sheet-grid tr { break-inside: avoid; }
  .sheet-grid .g-art { width: 80px; min-width: 80px; }
  .sheet-grid th.g-prod { width: 160px; min-width: 160px; }
}
/* builder sheet controls: sort by design or product, show a grid or mock-ups */
.sheet-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin: 18px 0 0; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.sheet-controls .ctl { display: flex; align-items: center; gap: 10px; }
.sheet-controls .ctl > span { font-weight: 650; font-size: 14px; }
.sheet-controls .hint { margin: 0; font-size: 13px; color: var(--ink-3); flex: 1 1 260px; }
/* grid sorted by design: each product the design goes on, with its colours */
.design-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; align-content: start; }
.design-list .gp { background: #eef3ff; border-radius: 6px; padding: 6px 9px 7px; font-size: 12px; break-inside: avoid; }
.design-list .gp p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-3); font-size: 11.5px; }
.design-list .gp b { color: var(--ink); font-size: 12.5px; }
.gcs { display: flex; flex-wrap: wrap; gap: 0 10px; margin-top: 3px; }
.gcs .gchip { display: flex; align-items: center; gap: 5px; line-height: 1.3; }
.gcs .swatch-img { width: 12px; height: 12px; }

@media (max-width: 720px) {
  .grid-wrap { overflow-x: auto; }
  .sheet-grid th.g-prod { width: 150px; min-width: 150px; }
  .sheet-grid tbody th.g-prod .thumb { display: none; }
  .sheet-grid tbody th.g-prod span { width: auto; }
}
