/* One stylesheet for the reseller pages and the dashboard. No framework.
   Brand: The Salvaged Yard line sheet: coral, blue-gray, ink black, Glacial Indifference. */
@font-face {
  font-family: "Glacial Indifference";
  src: url("/fonts/glacial-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Glacial Indifference";
  src: url("/fonts/glacial-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
:root {
  --paper: #ffffff;
  --card: #ffffff;
  --ink: #111111;
  --muted: #4d545b;
  --line: #dde2e7;
  /* Coral is only the header and footer bands (and the line sheet's stripe under the
     slogan band). Never an outline, border or badge: next to form fields it reads as an
     error (Jeff, 2026-10-18). Never text either. e2e/order.spec.js checks this. */
  --coral: #ff6767;
  --slate: #c8d1d9;          /* the line sheet's blue-gray */
  --slate-soft: #eef1f4;
  --accent: #111111;         /* buttons: the "MAKE SOMETHING" black box */
  --accent-ink: #ffffff;
  --ok: #2e6b3c;
  --ok-soft: #e3f0e4;
  --err: #b3261e;
  --err-soft: #fbe9e7;
  --radius: 6px;
  --font: "Glacial Indifference", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.45 var(--font);
}
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; margin-top: 1.25em; }
code { font-size: .9em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 20px 16px 48px; }

/* ---------- brand frame (reseller pages) ---------- */
.brand { background: var(--coral); text-align: center; padding: 16px 16px 8px; }
/* The logo is black line art on white: multiply drops the white onto the coral. */
.brand img { width: 168px; height: 168px; object-fit: contain; mix-blend-mode: multiply; display: inline-block; }
.brand-name { display: inline-block; padding: 24px 0; font-size: 1.6rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.banner-band { background: var(--slate); border-bottom: 8px solid var(--coral); padding: 12px 16px; text-align: center; }
.banner-band img { width: min(560px, 100%); height: auto; display: inline-block; vertical-align: middle; }
.brand-foot {
  background: var(--coral); color: var(--ink); border-top: 8px solid var(--slate);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); font-weight: 700; line-height: 1.5;
}
.brand-foot a { color: var(--ink); text-decoration: none; }
.brand-foot-links { display: flex; flex-direction: column; gap: 6px; font-weight: 400; overflow-wrap: anywhere; }
.brand-foot-links a { display: inline-flex; align-items: center; gap: 8px; }
.brand-foot-links svg { flex: none; }
@media (min-width: 760px) {
  .brand-foot { padding-left: max(16px, calc(50% - 524px)); padding-right: max(16px, calc(50% - 524px)); }
}

.sheet-head { margin-bottom: 24px; }
.sheet-title { font-size: 1.7rem; letter-spacing: .02em; }
.intro { color: var(--muted); }
.intro p { margin: 0 0 .7em; }

/* Sits between the products and "Your details" (Jeff, 2026-10-18). */
.info-box { background: var(--slate); padding: 18px 20px; border-radius: var(--radius); margin-top: 28px; }
.info-box h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }
.info-box dl { margin: 0; display: grid; gap: 12px; }
.info-box dt { font-weight: 700; }
.info-box dd { margin: 0; overflow-wrap: anywhere; }

.banner { padding: 12px 14px; border-radius: var(--radius); background: var(--slate-soft); margin: 0 0 16px; }
.banner-ok { background: var(--ok-soft); }
.banner-err { background: var(--err-soft); color: var(--err); }

/* ---------- product cards ---------- */
.products { display: grid; gap: 12px; }
.card {
  display: grid; grid-template-columns: 116px 1fr; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
}
.card.has-err { border-color: var(--err); }
.card.picked { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.card-img { position: relative; display: block; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--slate-soft); align-self: start; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img-none { background: repeating-linear-gradient(45deg, var(--slate-soft) 0 8px, var(--line) 8px 9px); }
/* One dot per photo on a product's cover, so it's clear there's more to see. */
.photo-dots {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); display: flex; gap: 5px;
  padding: 4px 7px; border-radius: 999px; background: rgb(17 17 17 / 55%);
}
.photo-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgb(255 255 255 / 55%); }
.photo-dots i:first-child { background: #fff; }
.card-body { min-width: 0; display: flex; flex-direction: column; }
.card h2 { font-size: 1.05rem; margin: 0; }
.sku { font-weight: 700; font-size: .9rem; margin: 2px 0 0; }
.sub { color: var(--muted); font-size: .8rem; margin: 0; display: block; }
.price { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 0 14px; text-transform: uppercase; font-size: .9rem; }
.price strong { font-size: 1.05rem; }
.msrp { color: var(--muted); }
.desc { font-size: .9rem; color: var(--muted); margin-top: 6px; }
.desc p { margin: 0 0 .5em; }
.desc ul { margin: 0 0 .5em; padding-left: 1.2em; }
.desc li { margin: 2px 0; }
.hint { margin: 6px 0 0; font-size: .85rem; font-weight: 700; }
.qty { display: flex; align-items: stretch; margin-top: 10px; max-width: 168px; }
.card-body > .qty { margin-top: auto; padding-top: 10px; }
.qty input {
  width: 100%; min-width: 0; text-align: center; font: inherit; font-weight: 700;
  border: 1px solid var(--line); border-left: 0; border-right: 0; padding: 8px 4px; background: var(--card);
  border-radius: 0; color: var(--ink);
}
.qty input[aria-invalid="true"] { color: var(--err); }
.qty-btn {
  flex: 0 0 44px; height: 44px; font: inherit; font-size: 1.3rem; line-height: 1;
  border: 1px solid var(--line); background: var(--slate-soft); color: var(--ink); cursor: pointer;
}
.qty-btn:first-child { border-radius: 6px 0 0 6px; }
.qty-btn:last-child { border-radius: 0 6px 6px 0; }
.qty-btn:active { background: var(--slate); }
.err { color: var(--err); font-size: .85rem; }
.err:empty { display: none; }

/* The featured item (Starter Assortment): last, full width, framed in the brand colours. */
.featured { margin-top: 20px; }
.card-featured { background: var(--slate-soft); border: 2px solid var(--ink); padding: 16px; grid-template-columns: 1fr; }
.card-featured .card-img { aspect-ratio: 4 / 3; }
.card-featured h2 { font-size: 1.35rem; }
.card-featured .desc { color: var(--ink); font-size: 1rem; }
.featured-label {
  align-self: flex-start; margin: 0 0 8px; padding: 4px 12px; background: var(--ink); color: #fff;
  font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem;
}

/* ---------- photo gallery (order.js) ---------- */
.gallery { border: 0; padding: 0; margin: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; background: rgb(17 17 17 / 94%); }
.gallery::backdrop { background: rgb(17 17 17 / 70%); }
.gallery-track {
  display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track figure { flex: 0 0 100%; margin: 0; scroll-snap-align: center; display: grid; place-items: center; padding: 56px 12px 48px; }
.gallery-track img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.gallery-close {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: #fff; color: var(--ink); font: 700 1.4rem/1 var(--font); cursor: pointer;
}
.gallery-dots { position: absolute; left: 0; right: 0; bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 2px; }
/* Dots are buttons: 28px targets around an 8px dot. */
.gallery-dots button { width: 28px; height: 28px; border: 0; padding: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.gallery-dots button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: rgb(255 255 255 / 40%); }
.gallery-dots button[aria-current="true"]::before { background: #fff; }
/* Previous / next, for mice and desktop browsers that can't swipe. */
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%;
  border: 0; background: rgb(255 255 255 / 90%); color: var(--ink); font: 700 1.6rem/1 var(--font); cursor: pointer;
}
.gallery-nav[disabled] { opacity: .3; cursor: default; }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }

/* ---------- details form ---------- */
.contact { margin-top: 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field > span { font-weight: 700; font-size: .95rem; }
.field em { font-weight: 400; color: var(--muted); font-style: normal; }
.field input, .field textarea, .field select {
  font: inherit; padding: 10px 12px; border: 1px solid #b9c1c9; border-radius: var(--radius);
  background: var(--card); color: var(--ink); width: 100%;
}
.field input[aria-invalid="true"] { border-color: var(--err); }
.field input:focus, .field textarea:focus, .qty input:focus, .field select:focus, .price-input input:focus {
  outline: 2px solid var(--ink); outline-offset: 1px;
}
.grid-2 { display: grid; gap: 0 12px; }
.grid-3, .grid-addr { display: grid; gap: 0 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-addr { grid-template-columns: 2fr 1fr 1.2fr; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.totalbar {
  position: sticky; bottom: 0; z-index: 2; margin: 20px -16px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgb(255 255 255 / 95%); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 3px solid var(--slate);
}
.totalbar-sum { margin: 0; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.totalbar-sum span, .totalbar-sum small { color: var(--muted); font-size: .8rem; }
.totalbar-sum strong { font-size: 1.3rem; }
.totalbar-sum small.short { color: var(--err); font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  padding: 10px 16px; min-height: 44px; border-radius: var(--radius);
  border: 1px solid #b9c1c9; background: var(--card); color: var(--ink);
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); text-transform: uppercase; letter-spacing: .06em; }
.btn-primary:hover { background: #333; }
.btn[disabled], .btn[aria-disabled="true"] { background: #9aa1a7; border-color: #9aa1a7; cursor: not-allowed; }
.btn-small { min-height: 32px; padding: 4px 10px; font-size: .85rem; }
.btn-quiet { border-color: transparent; background: transparent; text-decoration: underline; }

.order-status { text-align: center; }
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: var(--slate-soft); border: 1px solid var(--line); text-transform: capitalize; white-space: nowrap;
}
.pill-new, .pill-open { background: var(--slate); border-color: transparent; }
.pill-confirmed, .pill-sent { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.pill-fulfilled { background: var(--ok); color: #fff; border-color: transparent; }
.pill-cancelled, .pill-failed { background: var(--err-soft); color: var(--err); border-color: transparent; }
.pill-closed, .pill-skipped { color: var(--muted); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { font-size: .8rem; color: var(--muted); font-weight: 700; }
tfoot th { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.notes { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }

/* ---------- dashboard ---------- */
.adminbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px;
  padding: 10px 16px; background: var(--ink); color: #fff; border-bottom: 6px solid var(--slate);
}
.adminbar a { color: #fff; text-decoration: none; }
.adminbar-brand { font-weight: 700; letter-spacing: .04em; margin-right: auto; text-transform: uppercase; }
.adminbar nav { display: flex; gap: 4px; overflow-x: auto; order: 3; width: 100%; }
.adminbar nav a { padding: 6px 10px; border-radius: 6px; white-space: nowrap; opacity: .8; }
.adminbar nav a[aria-current="page"] { background: rgb(255 255 255 / 16%); opacity: 1; }
.adminbar-user { font-size: .8rem; opacity: .7; overflow: hidden; text-overflow: ellipsis; max-width: 50vw; }
.admin main a:not(.btn) { color: var(--ink); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.page-head h1 { margin: 0; }
.crumbs { margin: 0 0 4px; font-size: .9rem; color: var(--muted); }
.lede, .help { color: var(--muted); font-size: .9rem; }
.help { margin: 6px 0 0; }
.empty { color: var(--muted); font-style: italic; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 16px 0; }
.panel table { background: transparent; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }
.count { color: var(--muted); font-weight: 400; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font: inherit; font-size: .9rem; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--slate-soft); }
.inline-form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.inline-form .field { flex: 1 1 220px; margin: 0; }
.stack > * + * { margin-top: 4px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 8px 0 12px; min-width: 0; }
legend { font-weight: 700; font-size: .9rem; padding: 0 4px; }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }
.product-pick img, .thumb-none { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; flex: none; background: var(--slate-soft); display: inline-block; }
.thumb-lg { width: 120px; height: 120px; }
.savebar { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--paper) 30%); }

.product-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.product-list li {
  display: grid; grid-template-columns: 1fr 96px 96px; gap: 8px 12px; align-items: center;
  padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.product-list li.has-err { border-color: var(--err); }
.product-list li > .err { grid-column: 1 / -1; }
.product-list-main { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.product-list img, .product-list .thumb-none { width: 56px; height: 56px; border-radius: 4px; object-fit: cover; flex: none; }
.product-list-body { flex: 1; min-width: 0; }
.product-list .archived { opacity: .55; }
.price-input { display: flex; flex-direction: column; gap: 2px; font-size: .75rem; color: var(--muted); }
.price-input input { font: inherit; font-size: 1rem; color: var(--ink); width: 100%; padding: 8px; border: 1px solid #b9c1c9; border-radius: var(--radius); text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 639px) {
  .product-list li { grid-template-columns: 1fr 1fr; }
  .product-list-main { grid-column: 1 / -1; }
}

.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.photo-grid li { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.photo-grid img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.photo-grid form { margin: 0; }
.photo-previews { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-previews img { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.photo-field { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.photo-field img { width: 120px; height: 120px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.photo-field img.logo-preview { object-fit: contain; background: #fff; }
.photo-field .wide-preview { width: 240px; height: 126px; object-fit: contain; background: var(--slate-soft); border-radius: 6px; }
.email-log { list-style: none; padding: 0; margin: 0; }
.email-log li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; overflow-wrap: anywhere; }

@media (max-width: 639px) {
  .hide-sm { display: none; }
}
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .adminbar nav { order: 0; width: auto; }
  .adminbar-user { max-width: 240px; }
}
@media (min-width: 760px) {
  .products { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
  /* Photo on top; the body takes the rest so steppers line up along a row of cards. */
  .card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .card-featured { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: auto; gap: 24px; padding: 24px; }
  .brand img { width: 200px; height: 200px; }
  .totalbar { margin: 24px 0 0; border: 1px solid var(--line); border-top: 3px solid var(--slate); border-radius: var(--radius); bottom: 12px; }
}
@media (min-width: 640px) {
  .info-box dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
}
@media (min-width: 960px) {
  .info-box dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .intro { max-width: 760px; }
}

/* ---------- prototype lab ---------- */
.lab-banner {
  position: sticky; top: 0; z-index: 5; padding: 8px 16px; font-size: .85rem;
  background: repeating-linear-gradient(-45deg, #111 0 12px, #222 12px 24px); color: #fff;
}
.lab-banner a { color: #fff; }
.lab-list { list-style: none; margin: 0; padding: 0; }
.lab-links { display: flex; flex-wrap: wrap; gap: 8px; }
