:root {
  --ink: #16181b;
  --muted: #6d727a;
  --line: rgba(22, 24, 27, .08);
  --soft: #f3f1ee;
  --glass: rgba(255, 255, 255, .78);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Onest, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
  font-size: 14px; line-height: 1.4; -webkit-font-smoothing: antialiased; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 38%, #fbfaf8 0%, #f1eee9 55%, #e6e2dc 100%);
}
button { font: inherit; color: inherit; }

/* окно-попап с полями: transform — чтобы fixed внутри считались от окна, а не от экрана */
body { background: #cfcac3; }
.shell {
  position: fixed; inset: 20px 0; margin: 0 auto; width: calc(100% - 356px); min-width: min(1000px, calc(100% - 56px)); border-radius: 28px; overflow: hidden; transform: translateZ(0);
  background: radial-gradient(120% 90% at 50% 38%, #fbfaf8 0%, #f1eee9 55%, #e6e2dc 100%);
  box-shadow: 0 30px 80px rgba(30, 26, 20, .25);
}
.stage { position: fixed; inset: 0; }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--muted); font-size: 15px; transition: opacity .5s ease;
}
.loading.done { opacity: 0; pointer-events: none; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #d6d2cc; border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* верхняя полоса */
.topbar {
  position: fixed; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center;
  padding: 20px 28px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.brand h1 { margin: 0; font-size: 28px; font-weight: 700; line-height: 1.1; letter-spacing: -.03em; }
.brand h1 em { font-style: normal; color: var(--muted); font-weight: 500; }
.mvp { color: var(--muted); font-size: 12px; display: inline-flex; gap: 6px; align-items: center; opacity: .7; }
.mvp:hover, .mvp:focus-within { opacity: 1; }
.drop { position: relative; }
.drop-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; color: var(--ink); border: 0; background: var(--glass);
  border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.drop-btn:hover { background: #fff; }
.drop-list { position: absolute; left: 0; top: calc(100% + 6px); z-index: 10; min-width: 190px; padding: 6px; display: grid; gap: 2px;
  background: #fff; border-radius: 14px; box-shadow: 0 12px 34px rgba(30, 26, 20, .14), 0 0 0 1px var(--line); animation: fade .15s ease; }
.drop-list button { border: 0; background: transparent; text-align: left; font: inherit; font-size: 14px; color: var(--ink);
  padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.drop-list button:hover { background: var(--soft); }
.drop-list button[aria-selected="true"] { font-weight: 600; background: rgba(22, 24, 27, .06); }
.pane-h { margin: 0 0 10px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.pane + .pane[data-step="2"] { border-top: 1px solid var(--line); margin-top: 6px; }
.next { margin-top: 14px; width: 100%; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.round {
  width: 40px; height: 40px; border-radius: 999px; border: 0; background: var(--glass); backdrop-filter: blur(14px);
  display: grid; place-items: center; cursor: pointer; position: relative; transition: transform .15s ease, background .15s ease;
}
.round:hover { transform: translateY(-1px); }
.round[aria-pressed="true"] { background: var(--ink); color: #fff; }
.pill-link { color: var(--muted); font-size: 13px; text-decoration: none; padding: 10px 12px; border-radius: 999px; }
.pill-link:hover { color: var(--ink); background: var(--glass); }
[data-name]:hover::before {
  content: attr(data-name); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap;
  padding: 6px 8px; border-radius: 8px; pointer-events: none; z-index: 3;
}

/* сегменты */
.seg { display: inline-grid; grid-auto-flow: column; background: rgba(22, 24, 27, .05); border-radius: 14px; padding: 4px; gap: 2px; }
.seg button {
  border: 0; background: transparent; border-radius: 10px; height: 34px; padding: 0 14px; font-weight: 500; color: var(--muted);
  cursor: pointer; white-space: nowrap; transition: background .15s ease, color .15s ease;
}
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20, 20, 20, .06); }
.views { background: var(--glass); backdrop-filter: blur(14px); }

.hint {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 214px; color: var(--muted); font-size: 13px;
  pointer-events: none; transition: opacity .4s ease; white-space: nowrap;
}
.hint.off { opacity: 0; }

/* нижняя панель */
.dock {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); width: min(1040px, calc(100% - 32px));
  background: var(--glass); backdrop-filter: blur(22px) saturate(1.2); border-radius: 26px; padding: 14px 16px 16px;
  box-shadow: 0 18px 50px rgba(30, 26, 20, .10);
}
.dock-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.tabs button i { font-style: normal; font-size: 11px; color: var(--muted); margin-right: 7px; }
.tabs button[aria-pressed="true"] i { color: var(--ink); }
.cta { display: flex; gap: 14px; align-items: center; min-width: 0; }
.summary { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.btn {
  height: 46px; border-radius: 14px; border: 0; padding: 0 20px; font-weight: 600; cursor: pointer; white-space: nowrap;
  background: var(--ink); color: #fff; transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: #fff; color: var(--ink); }
.pane { padding: 16px 4px 2px; min-height: 96px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row + .row { margin-top: 12px; }
.upload { display: inline-flex; align-items: center; gap: 8px; height: 44px; }
.or { color: var(--muted); }
.field {
  height: 44px; border: 0; background: #fff; border-radius: 14px; padding: 0 14px; font: inherit; font-size: 15px;
  min-width: 220px; outline: none; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s ease;
}
.field:focus { box-shadow: inset 0 0 0 1.5px var(--ink); }
.link { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:hover { color: var(--ink); }
.note { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.note.warn { color: #a4521c; }
.lbl { color: var(--muted); font-size: 13px; }
.sliders { gap: 24px; }
.range { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 170px; height: 26px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: rgba(22, 24, 27, .12); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.14); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(22, 24, 27, .12); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.14); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  border: 0; background: #fff; border-radius: 999px; height: 36px; padding: 0 14px; cursor: pointer; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px; transition: background .15s ease, color .15s ease;
}
.chips button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.chips button .x { opacity: .55; font-size: 16px; line-height: 1; }
.chips .dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.chips .dot.fur { box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 0 0 3px currentColor; }
#matRow + .row .sw { width: 28px; height: 28px; }
.fonts button { font-size: 15px; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px; }   /* padding — обводка выбранного не обрезается */
.sw {
  width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: transform .15s ease;
}
.sw:hover { transform: scale(1.08); }
.sw[aria-pressed="true"]::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ink); }
.sw.custom { background: conic-gradient(#ff2d55, #ffcc00, #34c759, #00c7be, #007aff, #af52de, #ff2d55); }
.sw.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.sw[data-name]:hover::before { top: auto; bottom: calc(100% + 8px); }

.modes { gap: 10px; }
.modes button {
  border: 0; background: #fff; border-radius: 16px; padding: 12px 16px; text-align: left; cursor: pointer; min-width: 200px;
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s ease, transform .15s ease;
}
.modes button:hover { transform: translateY(-1px); }
.modes button b { display: block; font-weight: 600; }
.modes button span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.modes button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }

.toast {
  position: fixed; left: 50%; top: 84px; transform: translateX(-50%); max-width: min(560px, calc(100% - 32px));
  background: var(--ink); color: #fff; padding: 14px 18px; border-radius: 16px; font-size: 14px; z-index: 20;
}

@media (max-width: 760px) {
  body { overflow: auto; }
  .stage { position: fixed; top: 0; height: 56vh; }
  .topbar { padding: 14px 16px; }
  .pill-link, .views { display: none; }
  .hint { bottom: auto; top: calc(56vh - 30px); font-size: 12px; }
  .dock {
    left: 0; right: 0; bottom: 0; transform: none; width: auto; top: 56vh; border-radius: 22px 22px 0 0;
    overflow: auto; padding: 12px 14px 24px; background: rgba(255, 255, 255, .94);
  }
  .dock-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .tabs { overflow-x: auto; }
  .tabs button { padding: 0 10px; }
  .cta { justify-content: space-between; flex-wrap: wrap; gap: 8px; }
  .cta .btn { flex: 1 1 auto; padding: 0 14px; }
  .summary { flex: 1 1 100%; max-width: none; }
  .seg { max-width: 100%; overflow-x: auto; }
  .seg button { padding: 0 11px; }
  .field { min-width: 0; flex: 1; }
  .modes button { min-width: 0; flex: 1 1 140px; }
  input[type="range"] { width: 130px; }
}

/* кнопка фото */
.photo-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; }

/* окно «Фото как в жизни» */
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px;
  background: rgba(30, 26, 20, .32); backdrop-filter: blur(6px); animation: fade .2s ease; }
.modal-card { width: min(1180px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: #fbfaf8; border-radius: 26px; padding: 18px 20px 20px; }
.modal-head { display: flex; align-items: center; gap: 16px; justify-content: space-between; }
.modal-head b { font-size: 18px; letter-spacing: -.02em; }
.modal-head .seg { overflow-x: auto; max-width: 100%; }
.modal-head .seg button span { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 12px; }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.photo-grid figure { margin: 0; }
.photo-grid img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 18px; background: #efece7; }
.photo-grid figcaption { color: var(--muted); font-size: 13px; margin-top: 8px; min-height: 18px; }
.ai-box { position: relative; aspect-ratio: 3 / 2; border-radius: 18px; background: #efece7; overflow: hidden; }
.ai-box img { position: absolute; inset: 0; height: 100%; }
.ai-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
@media (max-width: 760px) {
  .photo-btn { padding: 0 12px; font-size: 13px; }
  .photo-grid { grid-template-columns: 1fr; }
  .modal { padding: 0; }
  .modal-card { border-radius: 0; max-height: 100vh; height: 100vh; }
  .modal-head { flex-wrap: wrap; }
  .modal-foot { flex-direction: column; align-items: stretch; }
}

.ai-confirm { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 20px; }
.ai-confirm b { font-size: 17px; letter-spacing: -.01em; }
.ai-confirm > span { color: var(--muted); font-size: 13.5px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; margin: 4px 0 6px; }
.check i { font-style: normal; color: var(--muted); }
.check input { width: 16px; height: 16px; accent-color: var(--ink); margin: 0; }

.range output { color: var(--ink); font-variant-numeric: tabular-nums; min-width: 52px; font-size: 13px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; height: 44px; }
.toggle[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ожидание фото: размытый 3D-кадр и полоса на ожидаемое время */
.ai-wait { flex-direction: column; }
.ai-ghost { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(14px) saturate(.9);
  opacity: .55; transform: scale(1.06); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .75; } }
.ai-progress { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink);
  background: rgba(255, 255, 255, .78); backdrop-filter: blur(8px); padding: 14px 18px; border-radius: 16px; min-width: 260px; }
.ai-progress .bar { width: 100%; height: 4px; border-radius: 4px; background: rgba(22, 24, 27, .1); overflow: hidden; }
.ai-progress .bar i { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 4px; }

/* ---------- ТЗ в производство ---------- */
.tz-actions { display: flex; align-items: center; gap: 10px; }
.tz-meta { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 16px; }
.tz-meta label { display: grid; gap: 6px; color: var(--muted); font-size: 12.5px; }
.tz-meta .field { min-width: 0; width: 200px; }
.tz-meta #tzQty { width: 110px; }
.tz-meta #tzDue { width: 160px; }
.tz-date { margin-left: auto; color: var(--muted); font-size: 13px; }
.tz-spec { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.tz-spec > div { background: #fff; border-radius: 16px; padding: 12px 14px; box-shadow: inset 0 0 0 1px var(--line); }
.tz-spec .wide { grid-column: 1 / -1; }
.tz-spec span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.tz-spec b { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.tz-spec em { display: block; font-style: normal; color: var(--muted); font-size: 13px; margin-top: 3px; }
.tz-spec .chip, .tz-table .chip { display: inline-block; vertical-align: -3px; margin-right: 6px; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.hex { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.tz-views { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.tz-views figure { margin: 0; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.tz-views img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.tz-views figcaption { color: var(--muted); font-size: 12px; padding: 0 10px 8px; }
.tz-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13.5px; background: #fff; border-radius: 14px; overflow: hidden; }
.tz-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.tz-table td { padding: 10px; vertical-align: top; border-bottom: 1px solid var(--line); }
.tz-table tr:last-child td { border-bottom: 0; }
.tz-table td:nth-child(3), .tz-table td:nth-child(5) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tz-table .sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.tz-table .warn, .tz-spec .warn { display: block; color: #b4471b; font-size: 12.5px; margin-top: 4px; }
.num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #e6007e; color: #fff; font-style: normal; font-weight: 700; font-size: 12px; }
.tz-card h3 { font-size: 14px; margin: 18px 0 8px; letter-spacing: -.01em; }
.tz-layout { display: block; width: 100%; max-height: 360px; object-fit: contain; background: #fff; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.tz-rapport { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.tz-rapport img { width: 120px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.tz-p { margin: 0; font-size: 13.5px; }
.tz-notes { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.45; }
.tz-notes li + li { margin-top: 4px; }
.tz-files { justify-content: flex-start; flex-wrap: wrap; }
.tz-files .btn { height: 38px; font-size: 13.5px; }
@media (max-width: 760px) {
  .tz-spec { grid-template-columns: 1fr; }
  .tz-views { grid-template-columns: 1fr 1fr; }
  .tz-table th:nth-child(5), .tz-table td:nth-child(5) { display: none; }
  .tz-date { margin-left: 0; }
}
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body > :not(#tz) { display: none !important; }
  html, body { height: auto; overflow: visible; background: #fff; }
  #tz { position: static; padding: 0; background: none; display: block; }
  .tz-card { width: auto; max-height: none; overflow: visible; padding: 0; background: #fff; border-radius: 0; box-shadow: none; }
  .tz-actions, .tz-files { display: none !important; }
  .tz-meta .field { box-shadow: none; padding-left: 0; }
  .tz-views figure, .tz-table, .tz-spec > div, .tz-rapport { break-inside: avoid; }
  .tz-card h3 { break-after: avoid; }
  .tz-layout { max-height: 170mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* широкий экран: модель слева, панель управления справа во всю высоту */
@media (min-width: 1000px) {
  .topbar { right: 484px; align-items: flex-start; }
  /* виды и кнопки — внизу под моделью: заголовок наверху может быть любой длины */
  .top-actions { position: fixed; bottom: 22px; left: calc((100% - 484px) / 2); transform: translateX(-50%); }
  .top-actions [data-name]:hover::before { top: auto; bottom: calc(100% + 8px); }
  .dock {
    left: auto; right: 20px; top: 20px; bottom: 20px; transform: none; width: 440px;
    display: flex; flex-direction: column; padding: 0 18px; overflow-y: auto; overflow-x: hidden; background: #fbfaf8;
  }
  .dock-head { display: contents; }
  .tabs { order: 0; position: sticky; top: 14px; z-index: 2; margin-top: 18px; box-shadow: 0 -14px 0 14px #fbfaf8; background: #efedea; }   /* залипает с отступом, тень закрывает зазор над ней */
  /* скролл — только когда не влезает (шаг 2), тонкий внутри рамки, не режет скругление */
  .dock::-webkit-scrollbar { width: 14px; }
  .dock::-webkit-scrollbar-track { background: transparent; }
  .dock::-webkit-scrollbar-thumb { border: 4px solid transparent; background: rgba(22, 24, 27, .18); background-clip: padding-box; border-radius: 999px; }
  .dock .pane { order: 1; flex: none; min-height: 0; padding: 16px 2px 8px; }
  .cta { order: 2; margin-top: auto; position: sticky; bottom: 0; z-index: 2; background: #fbfaf8;
    flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 12px 0 16px; border-top: 1px solid var(--line); }
  .summary { flex: 1 1 100%; max-width: none; white-space: normal; }
  .cta .btn { flex: 1; }
  .field { min-width: 0; flex: 1 1 100%; }
  .or { display: none; }
  .modes button { flex: 1 1 100%; }
  /* плотнее, чтобы шаг «Материал» влезал без прокрутки и на невысоком экране */
  .dock .pane { padding-top: 12px; }
  .dock .row + .row { margin-top: 10px; }
  .dock .chips { gap: 6px; }
  .dock .chips button { height: 32px; padding: 0 12px; }
  .dock .sw { width: 28px; height: 28px; }
  .dock .swatches { gap: 8px; }
  .dock .note { margin-top: 6px; }
  .dock .next { margin-top: 10px; height: 40px; }
  .cta .btn { height: 42px; }
  .range { width: 100%; }
  .range > span { min-width: 64px; }
  input[type="range"] { flex: 1; width: auto; }
  .hint { transform: translateX(-50%); }
}
@media (min-width: 1000px) and (max-width: 1250px) { .brand h1 { font-size: 22px; } }
@media (max-width: 760px) { .brand h1 { font-size: 19px; } .brand h1 em { display: block; font-size: 13px; } }
@media (max-width: 760px) { .shell { inset: 0; width: 100%; min-width: 0; border-radius: 0; } }

/* заявка */
.ord-card { width: min(440px, 100%); }
#ordForm { display: grid; gap: 10px; margin-top: 8px; }
#ordForm .field { min-width: 0; width: 100%; }
#ordForm textarea.field { height: auto; padding: 12px 14px; resize: vertical; font: inherit; }
.ord-done { font-size: 16px; margin: 18px 0 6px; }
/* встроено в сайт (попап А+): вокруг окна — затемнение страницы, крестик в углу окна */
html.embed body { background: rgba(24, 21, 18, .5); }
.embed-close { position: fixed; z-index: 50; top: 20px; background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  right: max(8px, calc((100vw - max(1000px, 100vw - 356px)) / 2 - 52px)); }   /* снаружи окна, у правого верхнего угла */
@media (max-width: 760px) { .embed-close { top: 12px; right: 12px; } html.embed .top-actions { margin-right: 48px; } }
html.embed .mvp { display: none; }

/* цена брендинга */
.calc { display: grid; gap: 8px; flex: 1 1 100%; }
.qty { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.qty > span { margin-right: 4px; }
.qty input { width: 54px; height: 32px; border: 0; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); text-align: center; font: inherit; font-size: 14px; color: var(--ink); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-b { width: 32px; height: 32px; border: 0; border-radius: 10px; background: rgba(22, 24, 27, .06); cursor: pointer; font-size: 16px; line-height: 1; color: var(--ink); }
.qty-b:hover { background: rgba(22, 24, 27, .1); }
.calc-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.calc-sum b { font-size: 17px; letter-spacing: -.01em; }
.calc-sum span { color: var(--muted); font-size: 13px; }
.calc-more summary { cursor: pointer; color: var(--muted); font-size: 12px; list-style: none; }
.calc-more summary::-webkit-details-marker { display: none; }
.calc-more summary::after { content: ' ▾'; }
.calc-more[open] summary::after { content: ' ▴'; }
#calcLines { display: grid; gap: 4px; margin-top: 6px; font-size: 12px; }
#calcLines div { display: flex; justify-content: space-between; gap: 10px; }
#calcLines b { font-weight: 600; white-space: nowrap; }
.calc-note { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.btn.add { background: linear-gradient(135deg, #FE5D26 30%, #7B2FF2 120%); flex: 1 1 100%; }

/* вариант чехла: однотонный / с логотипом / полноцвет */
.covers { padding: 14px 2px 4px; }
.cover-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cover-list button {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; border: 0; background: #fff; border-radius: 16px;
  padding: 10px 12px 12px; text-align: left; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s ease, transform .15s ease;
}
.cover-list button:hover { transform: translateY(-1px); z-index: 6; }   /* подсказка поверх липких вкладок */
.cover-list button svg { margin-bottom: 4px; }
.cover-list button b { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
/* уточнение — выпадает под карточкой при наведении */
.cover-list button span {
  position: absolute; left: 50%; top: calc(100% + 8px); z-index: 5; width: max-content; max-width: 190px;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.35; padding: 7px 10px; border-radius: 10px;
  opacity: 0; visibility: hidden; transform: translate(-50%, -4px); transition: opacity .15s ease, transform .15s ease, visibility .15s;
  pointer-events: none; box-shadow: 0 8px 22px rgba(20, 20, 20, .18);
}
/* стрелка — у самой карточки, по её центру: подсказку крайних карточек прижимаем к их краю, чтобы панель её не срезала */
.cover-list button::after {
  content: ""; position: absolute; left: 50%; top: calc(100% + 3px); z-index: 6; width: 10px; height: 10px; margin-left: -5px;
  background: var(--ink); transform: rotate(45deg); border-radius: 2px; opacity: 0; visibility: hidden; transition: opacity .15s ease, visibility .15s;
}
.cover-list button:hover span, .cover-list button:focus-visible span { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.cover-list button:hover::after, .cover-list button:focus-visible::after { opacity: 1; visibility: visible; }
.cover-list button:first-child span { left: 0; transform: translateY(-4px); }
.cover-list button:last-child span { left: auto; right: 0; transform: translateY(-4px); }
.cover-list button:first-child:hover span, .cover-list button:last-child:hover span,
.cover-list button:first-child:focus-visible span, .cover-list button:last-child:focus-visible span { transform: none; }
.cover-list button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }

/* галерея принтов и паттернов */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 12px; }
.gal { border: 0; background: #fff; border-radius: 14px; padding: 5px 5px 7px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 2px;
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s ease, transform .15s ease; }
.gal:hover { transform: translateY(-1px); }
.gal img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; margin-bottom: 4px; }
.gal span { font-size: 12.5px; font-weight: 600; line-height: 1.2; padding: 0 3px; }
.gal i { font-style: normal; font-size: 11px; color: var(--muted); padding: 0 3px; }
.gal[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
#ownBox { margin-top: 12px; }
#designComment { height: auto; padding: 10px 14px; resize: vertical; font: inherit; font-size: 14px; flex: 1 1 100%; }
#designNote.ok { color: #1f7a4a; }
[data-pane="print"] .check { margin-top: 12px; }
.calc-x { color: var(--muted); }

/* заявка: формат, количество, дата, файлы */
.ord-format { width: 100%; grid-auto-columns: 1fr; }
.ord-grid { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; }
.ord-grid label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; min-width: 0; }
.ord-grid .field { height: 40px; padding: 0 10px; font-size: 14px; }
.ord-files { display: grid; gap: 6px; }
.ord-files:empty { display: none; }
.ord-file { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 12px; padding: 7px 10px; font-size: 13px; box-shadow: inset 0 0 0 1px var(--line); }
.ord-file span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ord-file em { font-style: normal; color: var(--muted); font-size: 12px; white-space: nowrap; }
.ord-file button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 2px; }
.ord-attach { justify-self: start; font-size: 13px; }
.ord-preview { white-space: pre-wrap; font: 12px/1.45 ui-monospace, Consolas, monospace; background: #fff; border-radius: 12px; padding: 10px 12px; margin: 0; box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 760px) {
  .covers { padding: 0 0 6px; }
  .cover-list { gap: 6px; }
  .cover-list button { padding: 8px 9px 10px; }
  .cover-list button span, .cover-list button::after { display: none; }
  .ord-grid { grid-template-columns: 1fr 1fr; }
  .ord-grid label:last-child { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .covers { order: -1; margin-bottom: 12px; }   /* «юбка» липких вкладок (тень 28 px вверх) не наезжает на обводку карточек */
}
