/* Customize: brand book + products. Built on the Settings page's own fieldset
   look (set-group / set-field) and the product cards of the research page, so it
   reads as the same product; only what those do not cover is here. */

.cz-shell { display: flex; flex-direction: column; gap: var(--s5); }
.cz-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); border-bottom: 1px solid var(--border); }
.cz-tabs { display: flex; gap: var(--s4); }
.cz-tab {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted);
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 2px; margin-bottom: -1px; cursor: pointer;
}
.cz-tab:hover { color: var(--text); }
.cz-tab.is-on { color: var(--text); border-bottom-color: var(--text); }
.cz-tab:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-xs); }
.cz-actions { display: flex; align-items: center; gap: var(--s2); padding-bottom: 6px; }
.cz-sync { display: inline-flex; align-items: center; gap: 6px; }
.cz-ico { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cz-pane { display: block; }
.cz-wide { width: 100%; }
.cz-name { margin: 0; font-size: 15px; font-weight: 600; }
.cz-desc { width: 100%; flex: none; resize: vertical; line-height: 1.5; min-height: 76px; }

/* colours: a swatch you can click, its hex, a note, a remove button */
.cz-colors { display: flex; flex-direction: column; gap: var(--s2); width: 100%; }
.cz-color { display: flex; align-items: center; gap: var(--s2); }
.cz-swatch {
  flex: none; width: 36px; height: 36px; padding: 0; cursor: pointer;
  border: 1px solid var(--text-2); border-radius: var(--r-sm); background: none;
}
.cz-swatch::-webkit-color-swatch-wrapper { padding: 3px; }
.cz-swatch::-webkit-color-swatch { border: 0; border-radius: var(--r-xs); }
.cz-swatch::-moz-color-swatch { border: 0; border-radius: var(--r-xs); }
.cz-swatch:focus-visible { outline: none; box-shadow: var(--focus); }
.cz-hex { flex: 0 0 104px; font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; }
.cz-note { flex: 1 1 160px; }

/* logo */
.cz-logo {
  width: 72px; height: 72px; flex: none; display: grid; place-items: center;
  /* logos are drawn for a light page, whatever the room around them is */
  border: 1px solid var(--border-2); border-radius: var(--r); background: #fff;
}
.cz-logo.is-dark { background: var(--rail-bg); }
.cz-logo img { width: 64px; height: 64px; object-fit: contain; display: block; }

/* products */
.cz-toolbar { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; margin-bottom: var(--s3); }
.cz-search { flex: 0 1 340px; }
.cz-count { margin: 0; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cz-hint { margin: var(--s5) 0 0; padding: var(--s4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); }
.cz-hint b { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.cz-hint p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.cz-foot { margin: var(--s5) 0 0; padding-top: var(--s3); border-top: 1px solid var(--border); font-size: 12px; line-height: 1.5; color: var(--muted); }
.cz-result { margin-bottom: var(--s3); }
.cz-result .set-note, .cz-result .set-status { margin: 0 0 6px; }
.cz-details summary { cursor: pointer; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.cz-details .set-result { max-height: 260px; overflow: auto; }
.cz-grid { margin-top: var(--s3); }
.cz-grid .res-product-name { font-size: 12.5px; margin: 0; padding: 8px 10px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cz-more { justify-content: center; margin-top: var(--s4); }

/* first-time setup: three steps, one line each */
.cz-setup { margin-bottom: 0; }
.cz-steps { list-style: none; margin: 0 0 var(--s3); padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cz-step { display: flex; align-items: center; gap: var(--s3); font-size: 13.5px; color: var(--muted); }
.cz-step.is-run, .cz-step.is-ok { color: var(--text); }
.cz-step.is-err { color: var(--danger); }
.cz-step-dot {
  flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border-2); font-size: 11px; font-weight: 700; line-height: 1;
}
.cz-step.is-ok .cz-step-dot { background: var(--ok, var(--accent)); border-color: transparent; color: var(--ok-ink, #fff); }
.cz-step.is-err .cz-step-dot { border-color: var(--danger); }
.cz-step.is-run .cz-step-dot { border-color: var(--accent); color: var(--accent-ink); animation: cz-pulse 1.1s ease-in-out infinite; }
@keyframes cz-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .cz-step.is-run .cz-step-dot { animation: none; } }

@media (max-width: 600px) {
  .cz-color { flex-wrap: wrap; }
  .cz-note { flex-basis: 100%; order: 5; }
}

/* the two-field "New brand" window (app.js askBrand) */
.confirm-group { margin: 0 0 var(--s4); }
.confirm-group .confirm-field { margin: 0; }
.confirm-label { display: block; margin: 0 0 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.confirm-error { margin: calc(var(--s2) * -1) 0 var(--s4); font-size: 12.5px; color: var(--danger); }
.confirm-error[hidden] { display: none; }

/* "Make a packshot from this photo": wraps inside a narrow product card */
.cz-grid .res-product { height: auto; }
.cz-pk-btn { display: block; width: calc(100% - 20px); margin: 0 10px 10px; height: auto; min-height: 32px; padding: 7px 10px; white-space: normal; line-height: 1.3; text-align: center; }

/* Loading: three blocks shaped like the settings groups, shimmering until the paint replaces them. */
.cz-skel { display: grid; gap: 14px; }
.cz-skel i {
  display: block; height: 120px; border-radius: var(--r-lg);
  background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 240% 100%;
  animation: cz-sh 1.2s linear infinite;
}
.cz-skel i:first-child { height: 220px; }
@keyframes cz-sh { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .cz-skel i { animation: none; } }
.cz-step.is-new .cz-step-dot { animation: mo-pop-in var(--dur-3) var(--spring) backwards; }
