:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #12161f;
  --muted: #6b7280;
  --line: #e8eaef;
  --line-strong: #d7dae1;
  --accent: #4f46e5;
  --accent-soft: #eef0ff;
  --accent-ink: #3730a3;
  --success: #10b981;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px rgba(16, 24, 40, 0.06);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 12px rgba(16, 24, 40, 0.05);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 14px; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 100% -10%, #eef0ff 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 110%, #eafaf3 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea, h1, h2, h3, h4, h5, h6 { font: inherit; }

/* --------------------------------------------------------------- topbar -- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar__brand { display: flex; align-items: center; gap: 12px; }
.logo {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #7c74ff);
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}
.logo svg { width: 24px; height: 24px; }
.topbar__name { font-weight: 700; letter-spacing: -0.01em; }
.topbar__sub { color: var(--muted); }
.topbar__meta { display: flex; align-items: center; gap: 10px; }
.pill {
 font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
}
.pill--soft { background: #e9f9f1; color: #047857; }
@media (max-width: 640px) { .pill--soft { display: none; } }

/* ------------------------------------------------------------- progress -- */
.progress { height: 3px; background: var(--line); position: sticky; top: 71px; z-index: 39; }
.progress__bar {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------- layout -- */
.layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(360px, 1.25fr) minmax(280px, 0.95fr);
  gap: clamp(18px, 2.4vw, 34px);
  padding: clamp(18px, 2.6vw, 36px) clamp(16px, 4vw, 40px) 60px;
  max-width: 1440px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 1200px) {
  .layout { grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr); }
  .live { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .live { grid-column: auto; }
}

/* -------------------------------------------------------------- preview -- */
.preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  position: sticky;
  top: 92px;
}
@media (max-width: 980px) { .preview { position: static; } }

.preview__stage {
  border-radius: var(--radius-sm);
  background:
    radial-gradient(600px 300px at 50% 0%, #ffffff, #f7f7f5);
  border: 1px solid var(--line);
  padding: 12px;
  overflow: hidden;
}
.preview__svg svg { width: 100%; height: auto; max-height: 46vh; display: block; }

.preview__info { margin-top: 20px; }
.preview__title { margin: 0 0 6px; letter-spacing: -0.01em; }
.preview__desc { color: var(--muted); margin: 0 0 14px; }
/* ------------------------------------------------------------ live panel -- */
.live {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(18px, 2.2vw, 28px);
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  min-width: 0;
}
.live__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.live__title { font-weight: 750; letter-spacing: -0.01em; }
.live__badge {
 font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: #047857; background: #e9f9f1; padding: 4px 8px; border-radius: 999px; white-space: nowrap;
}
.live__section { margin-top: 18px; }
.live__section + .live__section { padding-top: 16px; border-top: 1px solid var(--line); }
.live__label { font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 9px; }
.live__rows { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.live__row {
  display: grid; grid-template-columns: 1fr auto; gap: 3px 10px;
  padding: 8px 11px; border-bottom: 1px solid var(--line);
}
.live__row:last-child { border-bottom: none; }
.live__row:nth-child(odd) { background: #fafbfc; }
.live__cat { grid-column: 1; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-ink); }
.live__name { grid-column: 1; }
.live__price { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 650; text-align: right; white-space: nowrap; }
.live__muted { color: var(--muted); }
.live__total {
  margin-top: 14px; padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f7f8ff, #f2f5ff);
  border: 1px solid #e4e7ff;
  display: flex; flex-direction: column; gap: 7px;
}
.live__total > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.live__total span { color: var(--muted); }
.live__grand b { font-weight: 800; letter-spacing: -0.02em; }
.live__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.live__actions .btn { flex: 1; min-width: 150px; }

/* --------------------------------------------------------------- wizard -- */
.wizard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(18px, 2.2vw, 28px);
  min-height: 520px;
  min-width: 0; /* let the crumbs scroll instead of stretching the card */
  display: flex;
  flex-direction: column;
}

.crumbs-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wizard__crumbs {
  display: flex; gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.wizard__crumbs::-webkit-scrollbar { display: none; }
.crumb-arrow {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: #fff; color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.crumb-arrow svg { width: 14px; height: 14px; }
.crumb-arrow:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-ink); border-color: #d8dbff; }
.crumb-arrow:disabled { opacity: 0.35; cursor: default; }
.crumb {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
 font-weight: 600;
  padding: 5px 10px; border-radius: 999px;
  cursor: pointer; white-space: nowrap;
  transition: all 0.15s;
}
.crumb.done { color: var(--success); border-color: #cdece0; background: #f1fbf6; }
.crumb.current { color: var(--accent-ink); border-color: #d8dbff; background: var(--accent-soft); }
.crumb:disabled { opacity: 0.55; cursor: default; }

.wizard__head { margin: 16px 0 18px; }
.wizard__count { font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.wizard__title { margin: 6px 0 6px; letter-spacing: -0.02em; }
.wizard__sub { color: var(--muted); margin: 0; }

.wizard__body { flex: 1; }

.wizard__foot {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line);
}
.wizard__hint {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; color: var(--muted);
}
.wizard__hint svg { width: 20px; height: 20px; }
.wizard__done {
  align-self: center; text-align: center;
 font-weight: 650; color: #047857;
}

/* ---------------------------------------------------------------- cards -- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.cards--2 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.card {
  text-align: left;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.08s;
  display: flex; flex-direction: column; gap: 8px;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.card:active { transform: translateY(1px); }
.card.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14); }
.card__art {
  height: 92px;
  display: grid; place-items: center;
  background: #f8f9fb;
  border-radius: 9px;
  overflow: hidden;
}
.card__art svg { width: 100%; height: 100%; padding: 6px; }
.card__title { font-weight: 650; display: flex; align-items: center; gap: 6px; }
.card__sub { color: var(--muted); }
.card--choice .card__art { height: 74px; }
.tag {
 font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  background: #fff4e5; color: #b45309; padding: 2px 6px; border-radius: 5px;
}
.swatch { width: 68px; height: 68px; border-radius: 10px; border: 1px solid rgba(0,0,0,0.08); }

/* ---------------------------------------------------------------- chips -- */
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  min-width: 108px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chip:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.chip.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14); }
.chip__big { font-weight: 700; letter-spacing: -0.01em; }
.chip__price { color: var(--muted); }

/* ------------------------------------------------------------------ ral -- */
.ral { max-width: 560px; }
.ral__presets { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.ral__dot {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid transparent; padding: 0; cursor: pointer;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
  transition: transform 0.1s;
}
.ral__dot:hover { transform: scale(1.06); }
.ral__dot.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,0.2); }

.field { display: block; }
.field__label { display: block; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field__input {
  width: 100%; max-width: 360px;
 padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field__input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14); }

/* ----------------------------------------------------------------- info -- */
.info {
  display: flex; gap: 16px; align-items: center;
  background: #f8f9ff; border: 1px solid #e4e7ff; border-radius: var(--radius-sm);
  padding: 20px; max-width: 560px;
}
.info__icon svg { width: 34px; height: 34px; }
.info__ro { font-weight: 800; letter-spacing: -0.02em; }
.info__body p { margin: 8px 0 0; color: var(--muted); }

/* --------------------------------------------------------------- stepper -- */
.stepper {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff;
}
.stepper button {
  width: 44px; height: 46px; border: none; background: #fff; cursor: pointer;
 color: var(--ink);
}
.stepper button:hover { background: #f4f5f7; }
.stepper input {
  width: 52px; height: 46px; border: none; text-align: center;
 font-weight: 650; outline: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}

/* --------------------------------------------------------------- buttons -- */
.btn {
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 650;
  padding: 10px 18px; cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn--primary {
  background: linear-gradient(135deg, var(--accent), #6d63ff);
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.28);
}
.btn--primary:hover { filter: brightness(1.06); }
.btn--primary:active { transform: translateY(1px); }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--line-strong); background: #fafbfc; }
.btn--lg { padding: 13px 22px; border-radius: 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

/* ---------------------------------------------------------------- toast -- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: #101828; color: #fff; font-weight: 550;
  padding: 13px 20px; border-radius: 12px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.28);
  opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 60;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------- small screens -- */
@media (max-width: 560px) {
  .cards { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .card__art { height: 78px; }
  .wizard__foot .btn { flex: 1; }
  .live__actions .btn { width: 100%; }
}
