:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-primary);
  background: var(--canvas);
  line-height: 1.5;
  font-size: 17px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand-violet); outline-offset: 3px; }
main:focus, h1:focus { outline: none; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.bar { max-width: 860px; padding: 4px 20px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.logo { width: 192px; height: 64px; object-fit: contain; }
.layout { width: min(100% - 32px, 780px); margin: 0 auto; padding: 26px 0 48px; }
.narrow { max-width: 540px; margin-inline: auto; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: clamp(18px, 5vw, 34px); }
.stack { display: grid; gap: 16px; }
.stack > * { margin: 0; }
.stack.small { gap: 9px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spread { justify-content: space-between; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.actions > .button { flex: 1 1 auto; }
.muted { color: var(--text-secondary); }
.status { color: var(--success); }
.error { color: var(--danger); }
.error:empty, .status:empty { display: none; }
.hint { font-size: .91rem; color: var(--text-secondary); }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.62rem, 6vw, 2.22rem); line-height: 1.15; letter-spacing: -.022em; }
h2 { font-size: 1.18rem; line-height: 1.25; }
h3 { font-size: 1rem; }

.button {
  min-height: 48px;
  padding: 9px 17px;
  border-radius: 8px;
  border: 1px solid var(--brand-violet);
  background: var(--brand-violet);
  color: var(--surface);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-weight: 650;
  line-height: 1.25;
  text-decoration: none;
}
.button:hover { background: var(--violet-hover); color: var(--surface); }
.button.secondary { color: var(--violet-hover); background: var(--surface); }
.button.secondary:hover, .button.quiet:hover { color: var(--violet-hover); background: var(--canvas); }
.button.quiet { color: var(--violet-hover); background: transparent; border-color: transparent; }
.button:disabled, .button[aria-disabled="true"] { opacity: .58; cursor: default; }
.button.square { width: 48px; padding: 0; font-size: 1.35rem; }
.button.remove { color: var(--danger); }
.full { width: 100%; }

label:not(.button) { display: grid; gap: 5px; font-weight: 650; }
input:not([type=file]) {
  min-width: 0;
  width: 100%;
  padding: 11px 12px;
  min-height: 50px;
  border: 1px solid var(--brand-slate);
  border-radius: 8px;
  color: var(--text-primary);
  background: var(--surface);
  font-weight: 400;
}
input::placeholder { color: var(--text-secondary); opacity: 1; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.file-input:focus-visible + label { outline: 3px solid var(--brand-violet); outline-offset: 3px; }

.access { margin-top: 12px; }
.access .panel { border-top: 4px solid var(--brand-coral); }
.empty { padding-block: clamp(27px, 7vw, 46px); }
.catalog-heading { display: grid; gap: 10px; }
.catalog-heading .button { width: fit-content; }
.product-list { margin: 0; padding: 0; list-style: none; }
.product-list li + li { border-top: 1px solid var(--border); }
.product-link {
  width: 100%;
  min-height: 88px;
  padding: 12px;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 16px;
  gap: 13px;
  align-items: center;
  text-align: start;
  text-decoration: none;
  color: inherit;
}
.product-link:hover { background: var(--canvas); }
.product-thumb { width: 62px; height: 62px; object-fit: cover; border-radius: 7px; background: var(--canvas); }
.placeholder { display: grid; place-items: center; color: var(--brand-slate); font-size: .71rem; }
.product-data { display: grid; gap: 2px; overflow-wrap: anywhere; }
.chevron { color: var(--violet-hover); font-size: 1.35rem; }
.list-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.count { min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.unit-line { border-bottom: 1px solid var(--border); padding: 12px 0; }
.unit-line:last-child { border: 0; padding-bottom: 0; }

.wizard-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.progress { color: var(--violet-hover); font-weight: 650; font-size: .92rem; }
.progress-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 0; padding: 0; list-style: none; }
.progress-bar li { background: var(--border); height: 4px; border-radius: 4px; }
.progress-bar li.done { background: var(--brand-violet); }
.photo-pick { border: 1px dashed var(--brand-violet); border-radius: 12px; background: var(--canvas); padding: 15px; display: grid; gap: 9px; }
.photo-pick label { cursor: pointer; }
.photos { padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.photos img { aspect-ratio: 1; width: 100%; object-fit: cover; background: var(--canvas); border-radius: 8px; }
.photos .button { padding-inline: 8px; }
.photo-tile { display: grid; align-content: start; gap: 4px; }
.photo-tile .hint { text-align: center; }
.candidate { border: 1px solid var(--border); background: var(--canvas); border-radius: 10px; padding: 13px; }
.option { border: 1px solid var(--border); padding: 13px; border-radius: 8px; }
.summary { padding: 12px 0; border-top: 1px solid var(--border); }

@media (min-width: 580px) {
  .logo { width: 222px; height: 74px; }
  .layout { padding-top: 40px; }
  .catalog-heading { grid-template-columns: 1fr auto; align-items: end; }
  .photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .photo-pick { grid-template-columns: 1fr 1fr; }
}
