/* The design tool.
 *
 * Its own stylesheet, loaded only by design.html. The tool is the one page on the site
 * that is an application rather than a document: it fills the viewport, it does not
 * scroll, and its layout is driven by a canvas that has to be measured. Putting that in
 * styles.css would ship it to every visitor reading the pricing page.
 *
 * Colours come from the tokens styles.css already defines, so the tool follows the theme
 * toggle like everything else. */

.tool {
  display: grid;
  grid-template-columns: 84px 1fr 300px;
  grid-template-rows: 1fr auto;
  height: calc(100vh - var(--hdr-h, 64px));
  min-height: 480px;
  overflow: hidden;
}

/* ---- the left rail ---- */

.rail {
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 8px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.rail button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.rail button:hover { color: var(--ink); background: var(--panel-2); }
.rail button[aria-pressed='true'] {
  color: var(--ink);
  background: var(--panel-2);
  border-color: var(--line);
}
.rail button svg { width: 22px; height: 22px; }

/* ---- the stage ---- */

.stage {
  position: relative;
  overflow: hidden;
  /* Paper in both themes: the photo's white ground disappears into it. */
  background: var(--paper);
}

.stage-canvas { position: absolute; inset: 0; }

/* fabric moves the canvas into a wrapper div of its own and sizes it in pixels. This
 * makes the wrapper fill the stage even in the instant before the first measure, so
 * nothing is ever drawn against a 300x150 default. */
.stage-canvas .canvas-container { position: absolute !important; inset: 0; }

.stage-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: var(--layer-raised);
}

.seg {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: var(--panel);
}

.seg button {
  padding: 7px 11px;
  border: 0;
  border-right: 1px solid var(--line);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--ink); background: var(--panel-2); }
.seg button[aria-pressed='true'] { color: var(--on-accent); background: var(--accent-fill); }
.seg .zoom-level {
  min-width: 52px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  cursor: default;
}

/* The oversize warning.
 *
 * Deliberately loud and deliberately not a blocker. Art bigger than the print area is a
 * documented quote trigger, not an error — the customer may absolutely draw it, and the
 * job goes to a person. Telling them what will happen beats refusing the drag. */
.stage-warning {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100% - 32px));
  padding: 10px 14px;
  border: 1px solid var(--stop-line);
  border-radius: 10px;
  background: var(--stop-bg);
  color: var(--stop-ink);
  font-size: 13px;
  line-height: 1.45;
  z-index: var(--layer-raised);
}

/* ---- the panel ---- */

.panel {
  border-left: 1px solid var(--line);
  background: var(--panel);
  overflow-y: auto;
  padding: 16px;
}

.panel h2 { margin: 0 0 4px; font-size: 15px; }
.panel .hint { margin: 0 0 16px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.panel .empty { color: var(--muted); font-size: 13px; line-height: 1.55; }

.layers { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }

.layers li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.layers li[aria-current='true'] { border-color: var(--accent-fill); }
.layers .label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.layers .icon-btn {
  padding: 2px 6px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.layers .icon-btn:hover { color: var(--ink); background: var(--panel-2); }

/* ---- the bottom bar ---- */

.tool-bar {
  grid-column: 2 / 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.tool-bar .spacer { flex: 1; }
.tool-bar .status { color: var(--muted); font-size: 12.5px; }

/* Disabled controls must still clear 4.5:1. The wizard's step buttons sat at opacity .45
 * on --muted and did not, which the accessibility audit caught. */
.tool-bar button[disabled],
.seg button[disabled] { color: var(--muted); opacity: 1; cursor: not-allowed; }

@media (max-width: 900px) {
  .tool { grid-template-columns: 64px 1fr; grid-template-rows: 1fr 260px auto; }
  .panel { grid-column: 1 / 3; border-left: 0; border-top: 1px solid var(--line); }
  .tool-bar { grid-column: 1 / 3; }
  .rail { grid-row: 1 / 2; }

  /* The location tabs and the zoom bar, on a phone.
   *
   * Floated top-right over the garment, they are wider than a 336px stage: the row ran
   * off both ends and the stage clipped it, so "Front" and "Back" were under the rail and
   * "Fit" past the edge of the screen. Here they are a bar of their own above the
   * garment instead, which wraps the two groups onto two rows when they need it, and the
   * canvas takes the rest of the stage. The canvas is measured from .stage-canvas, so it
   * is fitted to the room actually left for it and the garment is not drawn under the
   * controls. The notices (design.html) are placed in the canvas's row, clear of them. */
  .stage {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-columns: minmax(0, 1fr);
  }
  .stage-controls {
    position: relative;
    top: auto;
    right: auto;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 8px;
    padding: 6px 8px;
  }
  .stage-canvas { position: relative; inset: auto; }

  /* And when one group alone is wider than the stage — four sleeve-and-back tabs on a
     320px phone — it scrolls sideways inside its own border rather than squashing
     "Left sleeve" onto two lines or pushing a tab out of reach. */
  .seg { max-width: 100%; overflow-x: auto; }
  .seg button, .seg .zoom-level { flex: none; white-space: nowrap; }
}

/* ---------------------------------------------------------------------------
   Panel controls
   --------------------------------------------------------------------------- */

.panel h3 { margin: 14px 0 8px; font-size: 13px; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.panel hr { margin: 16px 0; border: 0; border-top: 1px solid var(--line); }
.panel .full { width: 100%; }
.panel .file-name {
  margin: 0 0 10px;
  font-weight: 600;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.ctl { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.ctl > label { font-size: 12px; font-weight: 600; color: var(--muted); }
.ctl-hint { font-size: 11.5px; line-height: 1.45; color: var(--muted); }

.select, .num, .text-input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.text-input { resize: vertical; font-family: var(--body); }

.num-wrap { display: flex; align-items: center; gap: 6px; }
.num-wrap .num { width: 90px; }
.num-suffix { font-size: 12px; color: var(--muted); }

.slider-row { display: flex; align-items: center; gap: 10px; }
.slider { flex: 1; accent-color: var(--accent-fill); }
.slider-value {
  min-width: 92px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Swatches. Every colour here is one the shop stocks — there is no free colour picker
   in this tool, because an arbitrary colour is a screen they cannot burn. */
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.swatch[aria-pressed='true'] { outline: 2.5px solid var(--focus); outline-offset: 2px; }
/* The shop's 26 inks wrap into rows. A specialty ink (metallic, glitter) carries a small
   sparkle in its corner; the picked ink is named underneath, since a phone has no hover. */
.swatch { position: relative; }
.swatch-mark {
  position: absolute; top: -5px; right: -5px;
  width: 14px; height: 14px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 9px; line-height: 1;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line);
  pointer-events: none;
}
.swatch-picked { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-top: 6px; font-size: 12.5px; }
.swatch-picked-name { font-weight: 600; }
.specialty-tag {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2);
}
.specialty-note { flex-basis: 100%; margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.swatch-legend { margin: 4px 0 8px; }
.swatch-legend-mark { font-size: 11px; }
/* Fingers need a bigger target than a mouse pointer. */
@media (pointer: coarse) {
  .swatches, .ink-choices { gap: 8px; }
  .swatch { width: 32px; height: 32px; }
}
.swatch-none {
  background:
    linear-gradient(45deg, transparent 44%, var(--stop-line) 44%, var(--stop-line) 56%, transparent 56%),
    var(--panel-2);
}

.segmented { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.segmented button {
  flex: 1;
  padding: 7px 6px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.segmented button:last-child { border-right: 0; }
.segmented button[aria-pressed='true'] { background: var(--accent-fill); color: var(--on-accent); }

.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.mini {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.mini:hover:not([disabled]) { border-color: var(--accent); }
.mini[disabled] { color: var(--muted); cursor: not-allowed; }
.mini.danger { color: var(--stop-ink); border-color: var(--stop-line); }

/* Messages. Three kinds, and they mean different things: a stop is "that file will not
   do", a warn is "this did not reach the shop", a quote is "a person will price this". */
.panel-stop, .panel-warn, .panel-quote {
  margin: 10px 0;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
}
.panel-stop  { background: var(--stop-bg);  border: 1px solid var(--stop-line);  color: var(--stop-ink); }
.panel-warn  { background: var(--warn-bg);  border: 1px solid var(--warn-line);  color: var(--warn-ink); }
.panel-quote { background: var(--quote-bg); border: 1px solid var(--quote-line); color: var(--quote-ink); }

/* ---- the drop zone ---- */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 18px 12px;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  background: var(--bg);
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}
.dropzone strong { color: var(--ink); font-size: 13.5px; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.panel .vector-hint { margin: 8px 0 12px; }

/* "Do you have a vector version of this?" — a question, not a stop: accent, not red. */
.vector-ask {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--accent-soft);
  font-size: 12.5px;
  line-height: 1.5;
}
.vector-ask strong { display: block; color: var(--ink); font-size: 13px; }
.vector-ask p { margin: 4px 0 8px; color: var(--ink); }
.mini.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- detected colours ----
   The list a customer is charged from, so the count is stated in money terms and each
   colour is a decision they can see rather than one made behind them. */

.ink-count {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--accent-soft);
}
.ink-count strong { font-size: 15px; color: var(--ink); }
.ink-count span { font-size: 12px; color: var(--muted); line-height: 1.4; }

.colour-row {
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}
.colour-row.dropped { opacity: .62; }

.colour-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.colour-head .chip {
  flex: none;
  width: 24px; height: 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.colour-row.dropped .colour-head .chip {
  /* Struck through, so a dropped colour reads as a decision rather than as a colour that
     happens to look faded. */
  background-image: linear-gradient(45deg, transparent 45%, var(--stop-ink) 45%, var(--stop-ink) 55%, transparent 55%) !important;
}
.colour-name { font-size: 12px; font-family: var(--mono); color: var(--muted); }
.coverage { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.colour-outcome {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}
.colour-outcome > span:first-child { display: flex; align-items: center; gap: 6px; flex: 1; }
.colour-outcome .chip.small { width: 16px; height: 16px; border-radius: 4px; }
.outcome-off { color: var(--muted); font-style: italic; }

.toggle { flex: none; }
.toggle[aria-pressed='false'] { color: var(--stop-ink); border-color: var(--stop-line); background: var(--stop-bg); }

.ink-choices { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---- the crop dialog ----
   A dialog rather than a control in the panel, because cropping is done by eye at a size
   you can see. The panel is 300px wide; a crop box in there is a guess with a mouse. */

.crop-overlay {
  position: fixed;
  inset: 0;
  /* Above the site header. The header is sticky and translucent, and at its old 50 over
     this 40 it sat on top of every dialog's title — "How many, and what size?" was under
     the navigation. */
  z-index: var(--layer-dialog);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 10, 16, .62);
}

.crop-dialog {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-lg);
}

.crop-head { display: flex; flex-direction: column; gap: 3px; }
.crop-head strong { font-size: 16px; }

.crop-stage {
  position: relative;
  align-self: center;
  max-width: 100%;
  /* Checkerboard, so transparency reads as transparency and not as white. */
  background-image:
    linear-gradient(45deg, var(--panel-2) 25%, transparent 25%, transparent 75%, var(--panel-2) 75%),
    linear-gradient(45deg, var(--panel-2) 25%, transparent 25%, transparent 75%, var(--panel-2) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
  touch-action: none;
}
.crop-art { display: block; max-width: 100%; }

.crop-rect {
  position: absolute;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 9999px rgba(8, 10, 16, .55);
  cursor: move;
}

/* Rule-of-thirds guides. Not decoration — they are how anybody judges a crop. */
.crop-thirds {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, transparent calc(33.333% - .5px), rgba(255,255,255,.4) calc(33.333% - .5px), rgba(255,255,255,.4) calc(33.333% + .5px), transparent calc(33.333% + .5px)),
    linear-gradient(to right, transparent calc(66.666% - .5px), rgba(255,255,255,.4) calc(66.666% - .5px), rgba(255,255,255,.4) calc(66.666% + .5px), transparent calc(66.666% + .5px)),
    linear-gradient(to bottom, transparent calc(33.333% - .5px), rgba(255,255,255,.4) calc(33.333% - .5px), rgba(255,255,255,.4) calc(33.333% + .5px), transparent calc(33.333% + .5px)),
    linear-gradient(to bottom, transparent calc(66.666% - .5px), rgba(255,255,255,.4) calc(66.666% - .5px), rgba(255,255,255,.4) calc(66.666% + .5px), transparent calc(66.666% + .5px));
}

.crop-handle {
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid var(--accent-fill);
  border-radius: 3px;
  background: #fff;
}
.crop-nw { top: -8px; left: -8px; cursor: nwse-resize; }
.crop-ne { top: -8px; right: -8px; cursor: nesw-resize; }
.crop-se { bottom: -8px; right: -8px; cursor: nwse-resize; }
.crop-sw { bottom: -8px; left: -8px; cursor: nesw-resize; }
.crop-n { top: -8px; left: 50%; margin-left: -7px; cursor: ns-resize; }
.crop-s { bottom: -8px; left: 50%; margin-left: -7px; cursor: ns-resize; }
.crop-w { left: -8px; top: 50%; margin-top: -7px; cursor: ew-resize; }
.crop-e { right: -8px; top: 50%; margin-top: -7px; cursor: ew-resize; }

.crop-foot { display: flex; align-items: center; gap: 8px; }
.crop-foot .spacer { flex: 1; }
.crop-readout { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }


/* ---------------------------------------------------------------------------
   The price dialog
   --------------------------------------------------------------------------- */

.price-dialog {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-lg);
}

.size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
  gap: 8px;
}
.size-cell { display: flex; flex-direction: column; gap: 4px; }
.size-cell span { font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: center; }
.size-cell input {
  width: 100%;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
/* The stock check (web/stock.js), as the /order grid shows it (styles.css .sizegrid). */
.size-cell input:disabled { color: var(--muted-off); cursor: not-allowed; }
.size-cell.blocked > span, .size-cell .size-stock { color: var(--muted-off); }
.size-cell .size-stock { font-weight: 400; }
.size-cell .size-stock.over { color: var(--stop-ink); }
.size-cell .size-stock:empty { display: none; }
.size-total { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

.price-result:empty { display: none; }

.price-card, .quote-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.quote-card { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.quote-card h3 { margin: 0; font-size: 16px; }
.quote-card p { margin: 0; font-size: 13.5px; line-height: 1.5; }

.price-headline {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.price-headline strong { font-family: var(--display); font-size: 34px; letter-spacing: -.01em; }
.price-headline span { color: var(--muted); font-size: 13px; }

.price-lines { display: flex; flex-direction: column; }
.price-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}
.price-label { display: block; font-size: 13.5px; }
.price-note { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.price-amount { font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.price-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 12px;
  font-size: 15px;
}
.price-total strong { font-size: 19px; font-variant-numeric: tabular-nums; }

/* ---- the checkout form ---- */

.checkout-form { display: flex; flex-direction: column; gap: 4px; max-width: 460px; }
.checkout-form .btn { align-self: flex-start; margin-top: 8px; }
.ack-row { display: flex; align-items: flex-start; gap: 9px; margin: 10px 0 4px; }
.ack-row input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent-fill); }
.ack-row label { font-size: 13.5px; line-height: 1.5; }

/* Phone orders (web/checkout.js, web/design/app.js): staff entering an order for a
 * customer. A slim line above the tool, which shrinks by its height so the page still
 * fits the window; and the folded "Change the price" at checkout. */
.phone-banner {
  height: 30px; line-height: 30px; padding: 0 22px; font-size: 13px; font-weight: 600;
  background: var(--warn-bg); color: var(--warn-ink); border-bottom: 1px solid var(--warn-line);
}
.phone-banner + .tool { height: calc(100vh - var(--hdr-h, 64px) - 31px); }
.staff-price { margin: 10px 0 4px; font-size: 13.5px; }
.staff-price summary { cursor: pointer; color: var(--muted); }
.staff-price[open] summary { margin-bottom: 6px; }
.phone-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.phone-link input { flex: 1 1 280px; }
/* "Find a customer" above the phone checkout's contact fields: a combobox whose list
 * floats under the box, and "Add new customer" beside it. */
.customer-find { margin-bottom: 6px; }
.customer-find-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.customer-find-box { position: relative; flex: 1 1 260px; }
.customer-find-box input { width: 100%; }
.checkout-form .customer-find-row .btn { align-self: center; margin-top: 0; }
.customer-results {
  position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 4px 0;
  list-style: none; max-height: 320px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
}
.customer-results[hidden] { display: none; }
.customer-results li { padding: 7px 12px; cursor: pointer; font-size: 13.5px; line-height: 1.4; }
.customer-results li[aria-selected="true"], .customer-results li:hover { background: var(--panel-2); }
.customer-results .who { font-weight: 600; }
.customer-results .more { display: block; color: var(--muted); font-size: 12.5px; }
.customer-results .none { cursor: default; color: var(--muted); }

/* The one way forward.
 *
 * There used to be two: this, and a "Get a price" button in the header that went to the
 * wizard and silently discarded the design you were standing in. The header button is
 * gone, and this one is sized so there is no question which control continues the job. */
.tool-bar .btn-primary {
  padding: 11px 22px;
  font-size: 15px;
  box-shadow: var(--shadow-md);
}
.tool-bar .btn-primary[disabled] {
  box-shadow: none;
  background: var(--panel-2);
  color: var(--muted);
  border-color: var(--line);
}
.tool-bar .status { font-size: 13px; }

/* The current page, marked in the nav. Cheap, and it stops "Design tool" reading as a
   link to somewhere else while you are already in it. */
.nav a[aria-current='page'] { color: var(--ink); font-weight: 700; }

/* ---- what you are buying ----
   Shown wherever money is discussed: the size sheet, checkout, and the cart when there
   is one. Somebody entering twenty larges should be able to see the shirt they are
   entering them for. */

.preview-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.preview-strip figure {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  text-align: center;
}
.preview-strip img {
  display: block;
  width: 132px;
  height: auto;
}
.preview-strip figcaption {
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.buying-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.buying-meta { flex: 1; min-width: 160px; }
.buying-meta p { margin: 0 0 3px; }
.buying-what { font-size: 13.5px; line-height: 1.45; }
.buying-count { font-size: 12.5px; color: var(--muted); }
.buying-total { font-family: var(--display); font-size: 22px; }
.buying-tax { margin: 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- the cart page ----
   Lines come from GET /api/cart, priced by the server. The page names things and draws
   them; it does no arithmetic. web/cart.js. */

.cart-lines { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 14px; }
.cart-line {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.cart-shot {
  flex: 0 0 150px;
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  padding: 8px;
}
.cart-shot img { display: block; width: 100%; height: auto; border-radius: 6px; }
.cart-body { flex: 1 1 260px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cart-meta h2 { margin: 0 0 4px; font-size: 17px; overflow-wrap: anywhere; }
.cart-meta p { margin: 0 0 3px; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.cart-price { margin-top: 6px !important; color: var(--ink) !important; }
.cart-price strong { font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
.cart-price-tax { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cart-why { margin-top: 6px; }
.cart-why p { margin: 4px 0 0; }
.cart-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.cart-line .problem:empty { display: none; }
.cart-line .problem { margin: 0; font-size: 13.5px; }

/* "Item 2", when the cart has more than one, so the Check out sentence can name it. */
.cart-item-no {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

/* The size steppers: every size the garment comes in, − / number / + each. */
.cart-size-head { margin: 0 0 6px; font-size: 13.5px; }
.cart-size-head .cart-pieces { color: var(--muted); font-variant-numeric: tabular-nums; }
.cart-sizes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
}
.cart-size { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cart-size-label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: center; }
.cart-stepper {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  overflow: hidden;
}
.cart-stepper input {
  width: 100%;
  min-width: 0;
  padding: 7px 2px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
.cart-stepper input::-webkit-outer-spin-button,
.cart-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-step {
  border: 0;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.cart-step:hover:not(:disabled) { background: var(--paper); }
.cart-step:disabled { color: var(--muted-off); cursor: not-allowed; }
.cart-stepper input:disabled { color: var(--muted-off); }
.cart-size.blocked .cart-size-label, .cart-size .size-stock { color: var(--muted-off); }
.cart-size .size-stock { font-size: 11.5px; text-align: center; }
.cart-size .size-stock.over { color: var(--stop-ink); }
.cart-size .size-stock:empty { display: none; }
.cart-size.chosen .cart-size-label { color: var(--ink); }

.cart-foot {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.cart-foot-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}
.cart-foot-total strong { font-family: var(--display); font-size: 26px; font-variant-numeric: tabular-nums; }
.cart-foot-tax { margin: 2px 0 0; text-align: right; color: var(--muted); }
.cart-foot-tax strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.cart-foot .hint { margin: 8px 0 0; }
.cart-foot .btn-row { margin: 12px 0 0; }
.cart-foot-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cart-foot-stop { margin: 10px 0 0; font-size: 13.5px; }
.cart-foot-stop:empty { display: none; }
.cart-foot .problem { margin: 10px 0 0; font-size: 13.5px; }
.cart-foot .problem:empty { display: none; }

.cart-empty {
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  padding: 40px 28px;
  text-align: center;
  background: var(--panel);
}
.cart-empty h2 { margin: 0; font-size: 19px; }
.cart-empty p { color: var(--muted); margin: 10px auto 18px; max-width: 52ch; }

/* After Add to cart in the price dialog. */
.cart-added { margin-top: 14px; }
.cart-added-note { margin: 0 0 10px; font-size: 14px; }

/* ---- the product panel (web/design/panels/product.js) ---- */

.product-current {
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}
.product-current-name { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.product-current-colour { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.product-chip {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  flex: none;
}
.product-current .ctl-hint { display: block; margin-top: 6px; }
.product-current .panel-quote { margin: 8px 0 0; }

/* The panel's one action. Browsing lives in the picker (product-picker.js); what stays
   here is the current style's colours, so white to navy takes one click and no overlay. */
.panel .picker-open { margin-bottom: 2px; }
/* With no catalogue there is nothing to change to, and a primary button in full accent
   blue that does nothing reads as broken software. --muted on --panel-2 still clears
   4.5:1, which the accessibility audit asks of a disabled control. */
.panel .picker-open[disabled] {
  background: var(--panel-2);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}
.product-colours .ctl-hint { display: block; margin-top: 2px; }

.colour-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
  margin: 12px 0 10px;
}
.colour-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.colour-swatch:hover { border-color: var(--line); background: var(--panel-2); }
.colour-swatch[aria-pressed='true'] { border-color: var(--accent-fill); background: var(--panel-2); }
.colour-swatch-well {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(45deg, var(--panel-2) 25%, transparent 25%, transparent 75%, var(--panel-2) 75%),
    var(--panel);
  background-size: 8px 8px;
}
.colour-swatch-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.colour-swatch-name { font-size: 10.5px; line-height: 1.2; text-align: center; color: var(--muted); max-width: 72px; }
.colour-swatch[aria-pressed='true'] .colour-swatch-name { color: var(--ink); font-weight: 600; }
.colour-swatch-hand .colour-swatch-well { border-style: dashed; }
.colour-swatch-hand .colour-swatch-name::after { content: ' · by hand'; }

/* ---------------------------------------------------------------------------
   The "Change product" dialog (web/design/panels/product-picker.js)

   Only the frame is here. What is inside is the Shop's own browsing UI
   (web/shop-browser.js) with the Shop's own CSS (shop.css, site.css), so the two look the
   same; the few lines below only fit that UI to a scrolling box instead of a page.

   A native <dialog> at showModal(), so the browser gives the focus trap, Escape, and a
   top layer over the sticky site header. Near full-screen on a desktop, full-screen on a
   phone. The display rule is on [open] and nowhere else: an author `display` on a bare
   `dialog` beats the UA's `dialog:not([open]) { display: none }` whatever the
   specificity, and a closed dialog would sit on the page.
   --------------------------------------------------------------------------- */

.picker {
  --picker-gap: 24px;
  width: calc(100vw - 2 * var(--picker-gap));
  max-width: 1480px;
  height: calc(100dvh - 2 * var(--picker-gap));
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.picker[open] { display: flex; flex-direction: column; }
.picker::backdrop { background: rgba(8, 10, 16, .62); }

.picker-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.picker-title { margin: 0; font-family: var(--display); font-size: 20px; }
.picker-close { padding: 8px 16px; font-size: 14px; }

.picker-body { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 28px 32px; }
.picker-problem { margin: 0 0 16px; }
/* The sidebar is sticky in the dialog's scrolling body, not under the site header. */
.picker .shop-filters { top: 0; max-height: calc(100dvh - 2 * var(--picker-gap) - 120px); }

@media (max-width: 900px) {
  /* The drawer's own sticky head sits at the top of the drawer, as on the Shop. */
  .picker .shop-filters { max-height: none; }
}
@media (max-width: 720px) {
  .picker {
    --picker-gap: 0px;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .picker-top { padding: 10px 14px; }
  .picker-title { font-size: 18px; }
  .picker-body { padding: 14px 14px 24px; }
}

/* ---- Add art: the library of files added (PLAN 6.3) ---------------------------- */
.art-library {
  list-style: none; margin: 0 0 4px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px;
}
.art-library li { position: relative; }
.art-thumb {
  display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 100%;
  padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  color: inherit; font: inherit; cursor: grab;
}
.art-thumb:hover, .art-thumb:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.art-thumb:active { cursor: grabbing; }
.art-thumb img, .art-file-icon {
  display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 4px;
  /* A checkerboard, so white art and transparent edges both show. */
  background: repeating-conic-gradient(rgba(0,0,0,.06) 0 25%, transparent 0 50%) 0 0 / 12px 12px;
}
.art-file-icon {
  display: grid; place-items: center; font-size: 13px; font-weight: 700; letter-spacing: .04em;
  color: var(--muted); border: 1px dashed var(--line);
}
.art-name {
  font-size: 11.5px; line-height: 1.3; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center;
}
.art-remove {
  position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--bg); color: var(--muted);
  font-size: 14px; line-height: 1; cursor: pointer; opacity: .85;
}
.art-remove:hover, .art-remove:focus-visible { color: var(--stop-ink); border-color: var(--stop-line); opacity: 1; }
.stage-canvas.drop-over { outline: 2px dashed var(--accent); outline-offset: -6px; }

/* ---------------------------------------------------------------------------
   "More print areas" (web/design/panels/more-areas.js): sleeves and legs.
   The frame borrows the Change product dialog's header (.picker-top); the cards are
   the sample photo with the layout drawn on it, as the competitors show them.
   --------------------------------------------------------------------------- */

.more-areas {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.more-areas[open] { display: flex; flex-direction: column; }
.more-areas::backdrop { background: rgba(8, 10, 16, .62); }
.more-body { overflow-y: auto; padding: 18px 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.more-lede { margin: 0; color: var(--muted); font-size: 14px; }
.more-tabs button { flex: 1; }
.more-areas .segmented button { white-space: nowrap; }
.more-side { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.more-side-label { font-weight: 600; font-size: 14px; }
.more-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.more-card {
  display: flex; flex-direction: column; gap: 8px; padding: 0 0 10px;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--bg); color: var(--ink); font: inherit; cursor: pointer; text-align: center;
}
.more-card:hover, .more-card:focus-visible { border-color: var(--accent); }
.more-card[aria-pressed='true'] { border-color: var(--accent-fill); box-shadow: 0 0 0 2px var(--accent-fill); }
/* The sample photos are shot on white whatever the theme. */
.more-sample { display: block; width: 100%; aspect-ratio: 4 / 5; background: #fff; }
.more-card-name { font-weight: 600; font-size: 14px; }
.more-note { margin: 0; color: var(--muted); font-size: 13px; }
.more-on h3 { margin: 0 0 8px; font-size: 15px; }
.more-on ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.more-on-row { display: flex; align-items: center; gap: 8px; }
.more-on-row span { flex: 1; font-size: 14px; }
/* Phone checkout: the inks staff pick for art whose colors were never counted (Q109). */
.staff-inks { border: 0; padding: 0; margin: 0 0 8px; }
.staff-inks legend { font-weight: 600; margin-bottom: 4px; }
.staff-inks .ink-picks { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.staff-inks label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.staff-inks .chip { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line, #ccc); }
