/* Конструктор «Свой пряник» и страница заявки. */
.ctor { padding: clamp(20px, 4vw, 44px) 0 clamp(60px, 8vw, 110px); }
.ctor__head { margin-bottom: clamp(20px, 3vw, 36px); }
.ctor__head h1 { font-size: clamp(44px, 5.6vw, 76px); margin-bottom: 12px; }
.ctor__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.ctor__stage { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 12px; }
.ctor__viewer {
  position: relative; aspect-ratio: 1 / .92; border-radius: var(--radius-lg); overflow: hidden;
  background: radial-gradient(circle at 50% 38%, #fffaf3 0%, #f3e6d4 55%, #e6d3b8 100%);
  box-shadow: inset 0 0 0 1px var(--linen), var(--shadow);
  touch-action: none;
}
.ctor__viewer canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.ctor__hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2; display: flex; gap: 8px; align-items: center;
  padding: 8px 14px; border-radius: 999px; background: rgba(255, 253, 249, .85); backdrop-filter: blur(6px);
  font-size: 12.5px; color: var(--muted); white-space: nowrap; pointer-events: none; transition: opacity .6s;
}
.ctor__sample-note {
  position: absolute; left: 14px; top: 14px; z-index: 2; padding: 8px 14px; border-radius: 999px; background: var(--choco); color: var(--cream-text);
  font-size: 12.5px; font-weight: 600; pointer-events: none; transition: opacity .4s; max-width: calc(100% - 28px);
}
.ctor__sample-note.is-hidden, .ctor__hint.is-hidden { opacity: 0; }
.ctor__busy {
  position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: rgba(251, 246, 238, .78); backdrop-filter: blur(4px); font-weight: 700; color: var(--choco); text-align: center; padding: 20px;
}
.ctor__busy[hidden] { display: none; }
.ctor__busy .rosette { width: 58px; height: 67px; color: var(--honey-deep); animation: brand-breathe 1.6s ease-in-out infinite; }
.ctor__toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.ctor__draft { padding: 14px 16px; border-radius: 18px; background: var(--white); font-size: 14px; color: var(--muted); }
.ctor__draft p { margin: 0 0 10px; line-height: 1.45; }
.ctor__draft b { color: var(--choco); }
.ctor__draft-form { display: flex; gap: 8px; flex-wrap: wrap; }
.ctor__draft-form input { flex: 1 1 200px; min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--linen-2); background: var(--flour); }
.ctor__draft-err { display: block; color: var(--berry); font-weight: 700; font-size: 13px; margin-top: 6px; }
.ctor__draft-err:empty { display: none; }
.ctor__draft-small { display: block; font-size: 12px; margin-top: 6px; opacity: .8; }
.ctor__draft-status { margin: 0 !important; display: flex; align-items: center; gap: 8px; color: var(--ok, #3f6b2c); font-weight: 700; }
.ctor__draft-status .icon { width: 18px; height: 18px; }
.ctor__draft:has([data-draft-guest][hidden]):has([data-draft-status][hidden]) { display: none; }
.ctor__resume { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 18px; background: linear-gradient(140deg, #fff6e6, #fbe6c2); border: 1.5px solid #f0d29c; }
.ctor__resume[hidden] { display: none; }
.ctor__resume img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--flour-2); }
.ctor__resume b { display: block; color: var(--choco); }
.ctor__resume span { font-size: 13px; color: var(--muted); }
.ctor__resume-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--muted); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ctor__wow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ctor__wow .btn { min-height: 46px; }
.ctor__wow-note { flex: 1 1 220px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--flour-2); border: 1px solid var(--linen); }
.seg button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent;
  font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--white); color: var(--choco); box-shadow: var(--shadow-sm); }
.seg--wide { display: flex; width: 100%; flex-wrap: wrap; border-radius: 18px; }
.seg--wide button { flex: 1; justify-content: center; border-radius: 14px; }
.swatches { display: inline-flex; align-items: center; gap: 8px; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--white); background: var(--c); box-shadow: 0 0 0 1px var(--linen-2); cursor: pointer; }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ginger); }
.ctor__glaze { font-size: 13.5px; font-weight: 600; margin-left: 6px; align-items: center; }
.ctor__price {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 20px; border-radius: var(--radius); background: var(--choco); color: var(--cream-text);
}
.ctor__price span { font-size: 13px; opacity: .7; display: block; }
.ctor__price strong { font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.ctor__dims { text-align: right; font-size: 13.5px; }
.ctor__dims span:first-child { opacity: 1; font-weight: 700; font-size: 14.5px; }

.ctor__panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.ctor-step { padding: 22px; border-radius: var(--radius); background: var(--white); border: 1px solid var(--linen); display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.ctor-step__title { display: flex; align-items: center; gap: 12px; font-size: 26px; }
.ctor-step__title span {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 19px; font-style: italic; background: var(--flour-2); color: var(--ginger); border: 1px solid var(--linen-2);
}
.ctor-step--order { background: linear-gradient(160deg, #fffaf2, #fbefdc); border-color: #edd5b0; }
.drop {
  display: block; border-radius: 18px; border: 2px dashed var(--linen-2); background: var(--flour); cursor: pointer;
  transition: border-color .2s, background .2s; overflow: hidden;
}
.drop:hover, .drop.is-over { border-color: var(--ginger); background: #fff7ec; }
.drop__empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 28px 18px; font-size: 14px; color: var(--muted); }
.drop__empty[hidden] { display: none; }
.drop__empty strong { color: var(--choco); font-size: 16px; }
.drop__icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--white); color: var(--ginger); box-shadow: var(--shadow-sm); margin-bottom: 6px; }
.drop__icon .icon { width: 26px; height: 26px; }
.drop__preview { display: flex; align-items: center; gap: 16px; padding: 12px; }
.drop__preview[hidden] { display: none; }
.drop__preview canvas { width: 96px; height: 96px; border-radius: 12px; flex: none; }
.drop__preview > span { display: grid; gap: 2px; font-size: 13.5px; color: var(--muted); }
.drop__preview strong { color: var(--choco); font-size: 15.5px; }
.ctor__samples { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.ctor__samples .chip { min-height: 34px; font-size: 13px; }
.ctor__opts { display: grid; gap: 10px; }
.ctor__opts[hidden] { display: none; }
.ctor__note { font-size: 13px; color: var(--muted); margin: 0; }
.ctor__note--warn { color: var(--berry, #9c3b2c); font-weight: 600; }
.ctor__note[hidden] { display: none; }
.slider { display: grid; gap: 8px; }
.slider[hidden] { display: none; }
.slider label { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; color: var(--choco); }
.slider output { font-weight: 800; color: var(--ginger); font-variant-numeric: tabular-nums; }
.shapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.shapes button, .styles button {
  display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 16px; border: 1.5px solid var(--linen-2); background: var(--white);
  font-weight: 700; font-size: 13px; color: var(--choco); cursor: pointer; transition: border-color .2s, background .2s;
}
.shapes svg { width: 34px; height: 34px; fill: var(--flour-2); stroke: var(--ginger); stroke-width: 2; }
.shapes button[aria-pressed="true"], .styles button[aria-pressed="true"] { border-color: var(--ginger); background: #fff7ec; }
.shapes button[aria-pressed="true"] svg { fill: var(--honey); }
.styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.styles button { justify-items: start; text-align: left; padding: 12px 14px; }
.styles b { font-size: 15px; }
.styles span { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.ctor__more summary { cursor: pointer; font-weight: 700; color: var(--ginger); font-size: 14px; }
.ctor__more[open] summary { margin-bottom: 14px; }
.ctor__more > div, .ctor__more > label { margin-bottom: 14px; }
.field__err { color: var(--berry); font-size: 12.5px; font-weight: 600; }
.ctor__err { padding: 12px 14px; border-radius: 12px; background: rgba(163, 53, 43, .08); color: var(--berry); font-weight: 600; font-size: 14px; }
.ctor__err[hidden] { display: none; }
.ctor-modal { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 20px; background: rgba(42, 26, 16, .7); backdrop-filter: blur(6px); }
.ctor-modal[hidden] { display: none; }
.ctor-modal__box { width: min(720px, 100%); max-height: 92vh; overflow: auto; padding: clamp(24px, 4vw, 44px); border-radius: var(--radius-lg); background: var(--flour); text-align: center; box-shadow: var(--shadow-lg); }
.ctor-modal__box .rosette { width: 68px; height: 79px; margin: 0 auto 14px; color: var(--honey-deep); }
.ctor-modal__box .lead { margin: 12px auto 20px; }
.ctor-modal__shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 22px; }
.ctor-modal__shots img { border-radius: 12px; aspect-ratio: 1; object-fit: cover; }
.postcard { position: relative; width: min(600px, 100%); }
.postcard__x { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--white); color: var(--choco); font-size: 16px; cursor: pointer; box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,.08)); }
.postcard .lead { margin-bottom: 16px; }
.postcard__screen { position: relative; width: min(440px, 100%); margin: 0 auto; aspect-ratio: 1; border-radius: 22px; overflow: hidden; background: #ead7bd; box-shadow: 0 18px 40px -22px rgba(58, 35, 23, .55); }
.postcard__screen canvas, .postcard__screen video { width: 100%; height: 100%; display: block; object-fit: cover; }
.postcard__screen video[hidden], .postcard__screen canvas[hidden] { display: none; }
.postcard__bar { width: min(440px, 100%); height: 6px; margin: 14px auto 0; border-radius: 999px; background: var(--flour-2); overflow: hidden; }
.postcard__bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--honey), var(--ginger)); transition: width .2s linear; }
.postcard__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.postcard__actions[hidden] { display: none; }

/* Страница заявки */
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.status-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.status-steps li { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 16px; padding-bottom: 22px; }
.status-steps li::before { content: ""; position: absolute; left: 19px; top: 40px; bottom: 0; border-left: 2px dashed var(--linen-2); }
.status-steps li:last-child::before { display: none; }
.status-steps .dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--flour-2); border: 1.5px solid var(--linen-2); color: var(--muted); }
.status-steps li.is-done .dot { background: var(--ginger); border-color: var(--ginger); color: var(--cream-text); }
.status-steps li.is-current .dot { background: var(--honey); border-color: var(--honey); color: var(--ink); box-shadow: 0 0 0 6px rgba(224, 160, 58, .2); }
.status-steps strong { display: block; color: var(--choco); }
.status-steps span { font-size: 14px; color: var(--muted); }
.status-shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.status-shots img { border-radius: var(--radius-sm); aspect-ratio: 1; object-fit: cover; background: var(--flour-2); }

@media (max-width: 980px) {
  .ctor__grid, .status-grid { grid-template-columns: 1fr; }
  .ctor__stage { position: sticky; top: calc(var(--header-h) + 6px); z-index: 20; background: var(--flour); padding-bottom: 8px; }
  .ctor__viewer { aspect-ratio: auto; height: 42vh; min-height: 260px; border-radius: var(--radius); }
  .ctor__toolbar { gap: 6px; }
  .ctor__toolbar .seg button { padding: 0 10px; font-size: 12.5px; }
  .ctor__price { padding: 10px 16px; }
  .ctor__price strong { font-size: 22px; }
  .ctor-modal__shots { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .ctor__hint { display: none; }
  .ctor__toolbar [data-seg="view"] { display: none; }
  .ctor__toolbar .seg { width: 100%; }
  .ctor__toolbar .seg button { flex: 1; justify-content: center; }
  .ctor__viewer { height: 38vh; }
  .swatches { display: none; }
  .ctor__dims span:last-child { display: none; }
  .ctor__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Узоры на прянике ---------- */
.layers { display: grid; gap: 10px; margin-bottom: 16px; }
.layers__row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.layers__list { display: flex; gap: 8px; flex-wrap: wrap; }
.layer-chip { position: relative; width: 62px; height: 62px; padding: 0; border-radius: 16px; border: 2px solid transparent; background: var(--white); cursor: pointer; overflow: hidden; box-shadow: 0 1px 2px rgba(58, 35, 23, .08); transition: border-color .15s, transform .15s; }
.layer-chip canvas { width: 100%; height: 100%; display: block; }
.layer-chip:hover { transform: translateY(-1px); }
.layer-chip.is-active { border-color: var(--ginger); box-shadow: 0 0 0 4px rgba(148, 83, 42, .14); }
.layer-chip.is-empty canvas { opacity: .45; }
.layer-chip.is-empty::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; font-weight: 800; color: var(--ginger); }
.layer-chip__n { position: absolute; left: 4px; top: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--choco); color: var(--flour); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.layer-chip.is-active .layer-chip__n { background: var(--honey); color: var(--ink); }
.layers__add { display: grid; justify-items: center; align-content: center; gap: 2px; width: 74px; min-height: 62px; border-radius: 16px; border: 2px dashed var(--linen-2); background: transparent; color: var(--ginger); font-size: 11.5px; font-weight: 800; cursor: pointer; }
.layers__add:hover { border-color: var(--ginger); background: #fff7ec; }
.layers__add .icon { width: 20px; height: 20px; }
.layers__add[hidden] { display: none; }
.layers__tools { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.layers__tools .link-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.layers__tools .link-btn .icon { width: 16px; height: 16px; }
.layers__tools .link-btn[hidden] { display: none; }
.layers__tools .link-btn:disabled { opacity: .45; cursor: default; }
.link-btn--danger { color: var(--berry) !important; }
.layers__count { font-weight: 800; color: var(--choco); }
.layers__count:empty { display: none; }
.layers__note { margin: 0; }
.ctor-step__title small { font-family: var(--font-body, Manrope), sans-serif; font-size: 14px; font-weight: 700; color: var(--ginger); margin-left: 6px; }
.ctor__wow .btn:disabled { opacity: .5; }

/* Режим расстановки: прозрачный слой поверх 3D */
.layer-editor { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; touch-action: none; outline: none; }
.layer-editor.is-dragging { cursor: grabbing !important; }
.ctor__viewer.is-editing .ctor__hint, .ctor__viewer.is-editing .ctor__sample-note { opacity: 0; pointer-events: none; }
.ctor__viewer.is-editing { box-shadow: inset 0 0 0 3px rgba(224, 160, 58, .55); }
.ctor__editbar { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 999px; background: rgba(42, 26, 16, .86); color: #fbf3e6; font-size: 13.5px; font-weight: 600; box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .6); white-space: nowrap; max-width: calc(100% - 24px); }
.ctor__editbar[hidden] { display: none; }
.ctor__editbar span { display: inline-flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; }
.ctor__editbar .icon { width: 18px; height: 18px; color: var(--honey); flex: none; }
@media (max-width: 640px) {
  /* плашка — внизу окна во всю ширину, пряник в режиме расстановки чуть выше */
  .ctor__editbar { top: auto; bottom: 10px; left: 10px; right: 10px; transform: none; max-width: none; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 16px; white-space: normal; }
  .ctor__editbar span { flex: 1; min-width: 0; font-size: 11.5px; line-height: 1.3; white-space: normal; }
  .ctor__editbar .btn { flex: none; }
  .layer-chip { width: 54px; height: 54px; }
}
/* Подсказка-сообщение («Новый узор: …») — переносится и видна и на телефоне */
.ctor__hint.is-msg { white-space: normal; text-align: center; width: max-content; max-width: calc(100% - 28px); border-radius: 16px; color: var(--choco); font-weight: 600; }
@media (max-width: 640px) { .ctor__hint.is-msg { display: flex; } }

@media (max-width: 400px) {
  .ctor-step { padding: 18px 16px; }
}

/* Телефон: 3D, кнопки и цена «прилипают» сверху — держим их компактными, чтобы шагам оставалось место. */
@media (max-width: 640px) {
  .ctor__stage { gap: 8px; }
  .ctor__wow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .ctor__wow .btn { min-height: 42px; padding: 4px 6px; gap: 5px; font-size: 12.5px; line-height: 1.15; white-space: normal; }
  .ctor__wow .btn .icon { width: 16px; height: 16px; flex: none; }
  .ctor__wow-note { display: none; }
  .ctor__viewer { height: 34vh; min-height: 230px; }
  .ctor__price { padding: 8px 14px; flex-wrap: nowrap; gap: 10px; }
  .ctor__price > div:first-child span { display: none; }
  .ctor__price strong { font-size: 20px; white-space: nowrap; }
  .ctor__dims { font-size: 12px; text-wrap: balance; }
  .ctor__dims span:first-child { font-size: 12.5px; }
}

/* Бортики и метка «ИИ» у стилей (раньше — в шаблоне страницы) */
.rims { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rims button { font-size: 12.5px; }
.rims svg { fill: var(--ginger) !important; }
.styles button .ai { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--honey); color: var(--ink); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; vertical-align: 2px; }

/* ---------- Конструктор в мастерской ---------- */
.ws-studio { --header-h: 0px; margin-top: 8px; }
.ws-studio .ctor__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: clamp(18px, 2.4vw, 32px); align-items: start; }
.ws-studio .ctor__draft-status { margin: 0; font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ws-studio .ctor__draft-status[hidden] { display: none; }
.ws-studio .ctor__draft-status .icon { width: 16px; height: 16px; color: var(--ginger); }
.studio-actions { display: grid; gap: 10px; margin: 6px 0 4px; }
.studio-done { margin: 0; padding: 10px 14px; border-radius: 14px; background: #eef6e6; color: #355a2a; font-weight: 600; }
.studio-done a { color: inherit; font-weight: 800; }
.studio-tip { margin: 0 0 14px; }
.studio-variant { display: inline-flex; }
.studio-variant a { padding: 9px 16px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--choco); }
.studio-variant a[aria-pressed="true"] { background: var(--white); box-shadow: 0 1px 3px rgba(58, 35, 23, .12); }
.studio-projects { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; margin-bottom: 6px; scrollbar-width: thin; }
.studio-project { position: relative; flex: none; width: 150px; }
.studio-project > a { display: grid; gap: 2px; padding: 8px; border-radius: 18px; background: var(--white); text-decoration: none; color: var(--choco); border: 2px solid transparent; box-shadow: 0 1px 2px rgba(58, 35, 23, .06), 0 8px 20px -14px rgba(58, 35, 23, .3); }
.studio-project.is-current > a { border-color: var(--honey); }
.studio-project img, .studio-project__ph { width: 100%; aspect-ratio: 1; border-radius: 12px; object-fit: cover; background: #f6ede1; display: grid; place-items: center; margin-bottom: 6px; }
.studio-project__ph .rosette { width: 40px; height: 46px; color: #d9c3a5; }
.studio-project b { font-size: 13.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-project small { font-size: 12px; color: var(--muted); }
.studio-project form { position: absolute; top: 12px; right: 12px; }
.studio-project form button { width: 28px; height: 28px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(42, 26, 16, .6); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s; }
.studio-project:hover form button, .studio-project form button:focus-visible { opacity: 1; }
.studio-project form button .icon { width: 14px; height: 14px; }
@media (hover: none) { .studio-project form button { opacity: .85; } }
@media (max-width: 1180px) { .ws-studio .ctor__grid { grid-template-columns: minmax(0, 1fr); } .ws-studio .ctor__stage { position: sticky; top: 6px; z-index: 20; background: var(--flour); padding-bottom: 8px; } }
@media (max-width: 860px) { .ws-studio { --header-h: 60px; } .ws-studio .ctor__stage { top: 66px; } }

/* ---------- Быстрый старт по поводу ---------- */
.ctor-tpl { padding: 18px 22px; border-radius: var(--radius); background: linear-gradient(140deg, #fff8ec, #fbefdc); border: 1px solid #f0d9b4; display: grid; gap: 10px; }
.ctor-tpl__title { margin: 0; display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 24px; color: var(--choco); }
.ctor-tpl__title .icon { width: 20px; height: 20px; color: var(--honey-deep, #c9862b); }
.ctor-tpl .ctor__note { margin: 0; }
.ctor-tpl__list { display: flex; flex-wrap: wrap; gap: 8px; }
.ctor-tpl__chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1.5px solid #ecd3a8; background: var(--white); color: var(--choco); font-weight: 700; font-size: 14px; cursor: pointer; transition: transform .15s, border-color .15s; }
.ctor-tpl__chip:hover { transform: translateY(-1px); border-color: var(--ginger); }
.ctor-tpl__chip img, .ctor-tpl__logo { width: 34px; height: 34px; border-radius: 50%; background: #f6ede1; object-fit: contain; padding: 3px; display: grid; place-items: center; }
.ctor-tpl__logo .icon { width: 18px; height: 18px; color: var(--ginger); }
.tpl-box { position: relative; max-width: 460px; text-align: left; }
.tpl-box h2 { text-align: center; }
.tpl-box .lead { text-align: center; }
.tpl-box__art { display: block; width: 96px; height: 96px; margin: 0 auto 6px; object-fit: contain; }
.tpl-box__art[hidden] { display: none; }
.tpl-box__form { display: grid; gap: 12px; margin-top: 8px; }
.tpl-box__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.tpl-box__fields .field { margin: 0; }
.tpl-box__fields .field--full { grid-column: 1 / -1; }
.tpl-box__warn { margin: 0; color: var(--berry); }
@media (max-width: 480px) { .tpl-box__fields { grid-template-columns: minmax(0, 1fr); } .ctor-tpl { padding: 16px; } }

/* ---------- Ещё надписи ---------- */
.texts { display: grid; gap: 8px; }
.texts__list { display: grid; gap: 8px; }
.texts__list:empty { display: none; }
.text-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 8px; align-items: center; padding: 10px; border-radius: 14px; background: #fbf6ee; border: 1.5px solid transparent; }
.text-row.is-active { border-color: var(--honey); }
.text-row input[type="text"] { min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--linen-2); background: var(--white); font: inherit; }
.text-row select { height: 40px; border-radius: 10px; border: 1.5px solid var(--linen-2); background: var(--white); padding: 0 6px; font: inherit; font-size: 13.5px; }
.text-row__del { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: var(--berry); cursor: pointer; font-size: 16px; }
.text-row__del:hover { background: #fbe9e7; }
.text-row__size { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.text-row__size input { flex: 1; }
.text-row__size output { min-width: 46px; text-align: right; font-weight: 700; color: var(--choco); }
.texts__add { justify-self: start; display: inline-flex; align-items: center; gap: 6px; }
.texts__add .icon { width: 16px; height: 16px; }
.texts__add[hidden] { display: none; }
.texts__note { margin: 0; }

/* ---------- Будет плохо видно ---------- */
.ctor__warn { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 5; width: max-content; max-width: calc(100% - 24px); display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; justify-content: center; padding: 10px 12px 10px 16px; border-radius: 18px; background: rgba(255, 250, 243, .96); box-shadow: 0 10px 30px -14px rgba(58, 35, 23, .55); border: 1.5px solid #f2b8ae; font-size: 13.5px; color: var(--choco); }
.ctor__warn[hidden] { display: none; }
.ctor__warn > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.ctor__warn .icon { width: 18px; height: 18px; color: #c4361f; flex: none; }
.ctor__warn b { color: #c4361f; }
.ctor__warn-actions { display: inline-flex; align-items: center; gap: 10px; }
.ctor__viewer.is-editing .ctor__warn, .ctor__viewer.is-painting .ctor__warn { display: none; }
@media (max-width: 640px) { .ctor__warn { bottom: 8px; font-size: 12.5px; padding: 8px 10px; } }

/* ---------- Мастер: станок и заготовка ---------- */
.studio-machine { margin: 0; padding: 10px 14px; border-radius: 14px; background: #f3ece2; color: var(--choco); font-size: 13.5px; font-weight: 600; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.studio-machine[hidden] { display: none; }
.studio-machine b { font-weight: 800; }

/* ---------- Пряничная доска или резное панно ---------- */
.ctor-kind { display: grid; gap: 8px; }
.ctor-kind .ctor__note { margin: 0; }
.ctor:not(.is-panno) .for-panno, .ctor.is-panno .for-board { display: none !important; }
.ctor.is-panno [data-seg="mode"], .ctor.is-panno .swatches, .ctor.is-panno [data-press], .ctor.is-panno [data-postcard],
.ctor.is-panno [data-paint-open] { display: none !important; }
@media (max-width: 640px) { .ctor.is-panno .ctor__wow { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Роспись глазурью ---------- */
.ctor__viewer.is-painting { box-shadow: inset 0 0 0 3px rgba(243, 162, 189, .6); }
.ctor__viewer.is-painting canvas { cursor: crosshair; touch-action: none; }
.ctor__viewer.is-painting .ctor__hint, .ctor__viewer.is-painting .ctor__sample-note { opacity: 0; pointer-events: none; }
.ctor__paintbar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 6; display: grid; gap: 8px; padding: 10px 12px; border-radius: 20px; background: rgba(42, 26, 16, .88); color: #fbf3e6; box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .6); width: max-content; max-width: calc(100% - 20px); }
.ctor__paintbar[hidden] { display: none; }
.paint__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.paint__colors button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); background: var(--c); cursor: pointer; padding: 0; }
.paint__colors button[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px rgba(224, 160, 58, .9); }
.paint__colors button.is-gold { background: linear-gradient(135deg, #f7e1a0, #c99a35 55%, #f2d58a); }
.paint__sizes { display: inline-flex; gap: 4px; }
.paint__sizes button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); display: grid; place-items: center; cursor: pointer; }
.paint__sizes button span { display: block; border-radius: 50%; background: #fbf3e6; }
.paint__sizes button[aria-pressed="true"] { background: rgba(224, 160, 58, .55); }
.paint__toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.paint__tool { height: 30px; min-width: 30px; padding: 0 8px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .12); color: #fbf3e6; display: inline-grid; place-items: center; cursor: pointer; font-weight: 700; font-size: 12.5px; }
.paint__tool .icon { width: 16px; height: 16px; }
.paint__tool[aria-pressed="true"] { background: rgba(224, 160, 58, .55); }
.paint__tool:hover { background: rgba(255, 255, 255, .22); }
@media (max-width: 640px) {
  .ctor__paintbar { bottom: 6px; padding: 8px; gap: 6px; border-radius: 16px; }
  .paint__colors button { width: 26px; height: 26px; }
  .paint__row { gap: 6px; }
  .ctor__wow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ctor__viewer.is-painting { height: 52vh; } /* панель росписи снизу — прянику нужно место */
}

/* ---------- Шрифт надписей ---------- */
.fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.fonts button { display: grid; gap: 2px; justify-items: center; padding: 10px 6px 8px; border-radius: 14px; border: 1.5px solid var(--linen-2); background: var(--white); color: var(--choco); cursor: pointer; transition: border-color .15s, background .15s; }
.fonts button b { font-size: 22px; line-height: 1.1; white-space: nowrap; }
.fonts button span { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.fonts button[aria-pressed="true"] { border-color: var(--ginger); background: #fff7ec; }
.fonts button[aria-pressed="true"] span { color: var(--ginger); }
