:root {
  --bg: #eceef0;
  --card: #f7f8f9;
  --ink: #15171a;
  --muted: #7b808a;
  --line: #d6d9de;
  --accent: #2b3cff;
  --chip: #e1e3e6;
  --rail-top: 18px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: #dfe1e4;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; -webkit-user-drag: none; user-select: none; }
h1, h2, h3, p { margin: 0; }

#app {
  position: relative;
  max-width: 520px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 560px) {
  #app { box-shadow: 0 0 0 1px #d3d6da, 0 30px 80px rgba(20, 24, 30, .12); }
}

.top {
  flex: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 22px 8px;
}
.top h1 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.top-note { font-size: 14px; font-weight: 600; color: var(--muted); }

#screen { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 20px 20px; scrollbar-width: none; }
#screen::-webkit-scrollbar { display: none; }
.screen-enter { animation: enter .28s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- нижние вкладки ---------- */
.tabs {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(247, 248, 249, .92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.tabs button {
  height: 44px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  transition: background .2s, color .2s;
}
.tabs button.on { background: var(--chip); color: var(--ink); }

/* ---------- общие элементы ---------- */
.btn {
  height: 44px;
  padding: 0 20px;
  border-radius: 22px;
  border: 1.5px solid var(--ink);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform .12s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { border-color: var(--line); color: var(--ink); background: var(--card); }
.btn.small { height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .4; pointer-events: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 36px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 15px;
  transition: background .2s, color .2s, border-color .2s;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- сборка вещей в одну картинку ---------- */
.comp { position: relative; width: 100%; height: 100%; }
.comp img { position: absolute; filter: drop-shadow(0 8px 10px rgba(20, 24, 30, .16)); pointer-events: none; }
.comp.flat img { filter: none; }

/* ---------- Сегодня ---------- */
.date-title { font-size: 21px; font-weight: 500; text-align: center; margin: 6px 0 12px; text-transform: none; }
.look-card {
  position: relative;
  height: min(52dvh, 430px);
  min-height: 300px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 18px 14px 12px;
}
.look-card .empty-msg {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center; text-align: center; padding: 30px;
  color: var(--muted);
}
.caption { text-align: center; color: var(--muted); font-size: 15px; margin: 12px 8px 14px; min-height: 40px; }

.week { display: flex; align-items: center; gap: 6px; }
.week-nav { flex: none; width: 24px; height: 60px; color: var(--muted); font-size: 20px; }
.days { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.day {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 9px 0 8px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 14px;
  transition: border-color .15s;
}
.day b { font-size: 15px; }
.day.sel { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
.day.today b::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 3px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.day .dot { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; border: 1px solid rgba(0,0,0,.12); display: flex; flex-direction: column; }
.day .dot i { flex: 1; }
.day .dot.none { border: 1.5px dashed var(--line); }
.day .num { color: var(--muted); font-size: 13px; }

.row-actions { display: flex; gap: 10px; margin: 16px 0 8px; }
.row-actions .btn { flex: 1; }

.section-title { font-size: 15px; font-weight: 700; margin: 20px 0 10px; }
.looks-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.looks-strip::-webkit-scrollbar { display: none; }
.mini-look {
  flex: none; width: 128px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 8px 8px 10px;
}
.mini-look .comp { height: 128px; }
.mini-look span { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-look small { color: var(--muted); font-size: 12px; }

/* ---------- Шкаф: рейка ---------- */
.closet { display: flex; flex-direction: column; min-height: 100%; }
.rail {
  position: relative;
  margin: 6px -20px 0;
  height: min(54dvh, 470px);
  min-height: 330px;
  background: linear-gradient(#f4f4f2, #eeeff0 70%);
  flex: none;
}
.rail .bar {
  position: absolute; left: 0; right: 0; top: var(--rail-top); height: 9px; z-index: 0;
  background: linear-gradient(#f2f3f5 0%, #b7bbc3 40%, #8b909a 60%, #d3d6dc 100%);
  box-shadow: 0 6px 10px rgba(20, 24, 30, .12);
}
.rail .bracket {
  position: absolute; top: calc(var(--rail-top) - 8px); width: 12px; height: 26px; border-radius: 3px; z-index: 0;
  background: linear-gradient(90deg, #e6e8ec, #a4a9b2 60%, #cfd2d8);
}
.rail .bracket.l { left: 8px; } .rail .bracket.r { right: 8px; }
.track {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: flex-start;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 0 calc((100% - var(--slot)) / 2);
  cursor: grab;
}
.track::-webkit-scrollbar { display: none; }
.track.dragging { cursor: grabbing; scroll-snap-type: none; }
.hang {
  position: relative;
  flex: 0 0 var(--slot);
  display: flex; justify-content: center;
  scroll-snap-align: center;
  transform-origin: 50% 0;
  will-change: transform;
}
.hang .hook { position: absolute; top: 11px; left: 50%; width: 30px; height: 56px; margin-left: -15px; z-index: 2; pointer-events: none; }
.hang img {
  margin-top: 63px;
  width: calc(var(--S) * var(--wk));
  height: calc(var(--S) * var(--hk));
  filter: drop-shadow(0 16px 14px rgba(20, 24, 30, .22));
}
.rail-empty { padding: 60px 30px; text-align: center; color: var(--muted); }

.closet-meta { text-align: center; padding-top: 10px; }
.closet-meta h2 { font-size: 23px; font-weight: 500; letter-spacing: -.01em; min-height: 2.5em; display: flex; align-items: center; justify-content: center; line-height: 1.2; }
.closet-meta p { color: var(--muted); font-size: 16px; margin-top: 4px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 12px 0 14px; }
.round {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); font-size: 20px; line-height: 1;
}
.round:active { transform: scale(.94); }
.counter { color: var(--muted); font-size: 17px; min-width: 70px; }

/* ---------- карточка вещи ---------- */
.sheet {
  position: absolute; inset: 0; z-index: 20; background: var(--bg);
  display: flex; flex-direction: column;
  overflow-y: auto; scrollbar-width: none;
  animation: sheet-in .26s ease both;
}
.sheet[hidden] { display: none; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.sheet-close { align-self: flex-end; padding: calc(16px + env(safe-area-inset-top)) 22px 4px; font-weight: 700; font-size: 17px; }
.sheet-stage { position: relative; flex: none; height: min(44dvh, 400px); min-height: 260px; margin-top: 4px; }
.sheet-stage .hang-big { position: absolute; inset: 0; display: flex; justify-content: center; opacity: 0; transition: opacity .35s ease; }
.sheet-stage .hang-big.on { opacity: 1; }
.sheet-stage .hang-big img { height: 100%; width: auto; max-width: 92%; object-fit: contain; filter: drop-shadow(0 18px 18px rgba(20, 24, 30, .22)); margin-top: 48px; height: calc(100% - 48px); }
.sheet-stage .hook { position: absolute; top: 0; left: 50%; width: 38px; height: 70px; margin-left: -19px; z-index: 2; }
.sheet-title { text-align: center; margin-top: 8px; }
.sheet-title h2 { font-size: 23px; font-weight: 500; }
.sheet-title p { color: var(--muted); margin-top: 3px; }
.face-tabs { display: flex; justify-content: center; gap: 28px; margin: 18px 0 6px; }
.face-tabs button { padding: 8px 6px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; font-size: 17px; }
.face-tabs button.on { color: var(--ink); border-color: var(--ink); }
.specs { margin: 8px 22px 0; border-top: 1px solid var(--line); }
.spec { display: flex; justify-content: space-between; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.spec span:first-child { color: var(--muted); flex: none; }
.spec span:last-child { font-weight: 700; text-align: right; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--ink); }
.dots i.f { background: var(--ink); }
.tag-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 22px 8px; }
.tag { padding: 5px 14px; border: 1px solid var(--line); border-radius: 16px; color: var(--muted); font-size: 14px; }
.sheet-actions { display: flex; gap: 10px; padding: 14px 22px calc(26px + env(safe-area-inset-bottom)); }
.sheet-actions .btn { flex: 1; }

/* ---------- Лук ---------- */
.build-top { position: sticky; top: 0; z-index: 5; margin: 0 -20px; padding: 2px 20px 4px; background: var(--bg); }
.build-card { position: relative; height: min(34dvh, 310px); min-height: 220px; background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: 14px 12px 8px; }
.build-top .caption { margin: 8px 8px 4px; min-height: 40px; }
.slot { margin-top: 14px; }
.slot h3 { font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.thumbs::-webkit-scrollbar { display: none; }
.thumb {
  flex: none; width: 82px; height: 96px; border-radius: 16px; background: var(--card);
  border: 1.5px solid var(--line); padding: 5px; scroll-snap-align: start;
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb.on { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
.thumb.none { font-size: 13px; color: var(--muted); font-weight: 600; text-align: center; }
.slot-empty { padding: 16px; border: 1.5px dashed var(--line); border-radius: 16px; color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- Ещё ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; margin-top: 14px; }
.panel h3 { font-size: 16px; margin-bottom: 6px; }
.panel p { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.panel .btns { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-row { display: flex; gap: 10px; margin-top: 8px; }
.stat { flex: 1; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 6px; }
.stat b { display: block; font-size: 24px; }
.stat span { color: var(--muted); font-size: 13px; }

/* ---------- модальное окно и уведомление ---------- */
.modal { position: absolute; inset: 0; z-index: 40; background: rgba(20, 24, 30, .35); display: flex; align-items: flex-end; }
.modal[hidden] { display: none; }
.modal .box { width: 100%; background: var(--card); border-radius: 26px 26px 0 0; padding: 22px 22px calc(24px + env(safe-area-inset-bottom)); animation: sheet-in .22s ease both; }
.modal h3 { font-size: 18px; margin-bottom: 12px; }
.modal input { width: 100%; height: 48px; border-radius: 14px; border: 1.5px solid var(--line); padding: 0 14px; font: inherit; background: #fff; margin-bottom: 14px; }
.modal input:focus { outline: none; border-color: var(--accent); }
.modal .btns { display: flex; gap: 10px; }
.modal .btns .btn { flex: 1; }
.toast {
  position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 22px; font-size: 14px; font-weight: 600;
  width: max-content; max-width: 88%; text-align: center;
}
.toast[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ======================= v2: боковая рейка, поворот, обувь на полке, крупный лук ======================= */
.hang { height: 100%; }
.hang img { transform-origin: 50% 0; will-change: transform, filter; }

/* обувь стоит на полке */
.hang.shoe img {
  position: absolute; left: 50%; bottom: calc(var(--shelf) + 14px);
  margin: 0 0 0 calc(var(--shoeW) / -2);
  width: var(--shoeW); height: auto;
  filter: drop-shadow(0 10px 8px rgba(20, 24, 30, .22));
}
.hang.shoe::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: var(--shelf); height: 14px;
  background: linear-gradient(#f2f3f5, #cfd2d8 55%, #b3b7bf);
  box-shadow: 0 10px 16px rgba(20, 24, 30, .16);
}
.rail.shoes-only .bar, .rail.shoes-only .bracket { display: none; }

/* карточка: вещь поворачивается вокруг вешалки */
.sheet-stage {
  position: relative; flex: none; height: min(46dvh, 420px); min-height: 280px; margin-top: 4px;
  perspective: 1500px; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none;
}
.sheet-stage:active { cursor: grabbing; }
.sheet-stage .hook { position: absolute; top: 0; left: 50%; width: 38px; height: 70px; margin-left: -19px; z-index: 3; pointer-events: none; }
.flipper { position: absolute; left: 0; right: 0; top: 64px; bottom: 0; transform-style: preserve-3d; }
.sheet-stage.shoe .flipper { top: 0; transform-style: flat; }
.face { position: absolute; inset: 0; display: flex; justify-content: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face.b { transform: rotateY(180deg); }
.face img { height: 100%; width: auto; max-width: 94%; object-fit: contain; filter: drop-shadow(0 18px 18px rgba(20, 24, 30, .22)); }
.sheet-stage.shoe .face {
  flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .35s ease; transform: none; backface-visibility: visible; -webkit-backface-visibility: visible;
}
.sheet-stage.shoe .face.on { opacity: 1; }
.sheet-stage.shoe .face img { height: auto; width: min(92%, 420px); max-height: 62%; filter: drop-shadow(0 12px 10px rgba(20, 24, 30, .22)); }
.sheet-stage.shoe .face::after {
  content: ""; width: min(98%, 440px); height: 16px; margin-top: -2px; border-radius: 2px;
  background: linear-gradient(#f2f3f5, #cfd2d8 55%, #b3b7bf); box-shadow: 0 12px 20px rgba(20, 24, 30, .16);
}
.swipe-hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 2px; }

/* конструктор: крупное превью, кнопки на нём, действие внизу */
.build-card { position: relative; height: min(46dvh, 440px); min-height: 260px; padding: 0; }
.build-comp { position: absolute; inset: 10px 8px 6px; }
.card-tools { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 20; }
.card-tools button {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(247, 248, 249, .94); display: flex; align-items: center; justify-content: center; color: var(--ink);
}
.card-tools button:active { transform: scale(.94); }
.bar-bottom {
  position: sticky; bottom: 0; z-index: 6; margin: 14px -20px -20px; padding: 16px 20px 16px;
  background: linear-gradient(to bottom, rgba(236, 238, 240, 0), var(--bg) 42%);
}
.bar-bottom .btn { width: 100%; }

.hang img { flex: none; }
.rail:not(.shoes-only) .hang.shoe::after { left: -14%; right: -14%; }
.hang { min-width: 0; width: var(--slot); overflow: visible; }

/* ======================= v3: реалистичная штанга и крючок, обувь без полки, редактор ======================= */
:root { --rail-top: 18px; }

/* хромированная штанга: блик сверху, тёмный низ, тень на стене */
.rail .bar {
  left: 16px; right: 16px; top: var(--rail-top); height: 12px; border-radius: 6px; z-index: 0;
  background: linear-gradient(180deg, #6f757f 0%, #c9cdd3 16%, #fdfdfe 30%, #d5d8dd 44%, #9da2ab 62%, #7b818b 80%, #a6abb3 92%, #61666f 100%);
  box-shadow: 0 2px 2px rgba(20, 24, 30, .18), 0 12px 14px -4px rgba(20, 24, 30, .16);
}
/* настенные фланцы с винтом */
.rail .bracket {
  top: calc(var(--rail-top) - 8px); width: 28px; height: 28px; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle at 36% 32%, #ffffff 0%, #dfe2e6 22%, #a9aeb6 58%, #7a808a 86%, #666b74 100%);
  box-shadow: 0 5px 9px rgba(20, 24, 30, .22), inset 0 -2px 3px rgba(20, 24, 30, .18);
}
.rail .bracket::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f4f5f7, #8a9099 70%);
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .3);
}
.rail .bracket.l { left: 4px; } .rail .bracket.r { right: 4px; }

/* новый крючок 40×64: петля обхватывает штангу */
.hang .hook { top: 11px; width: 40px; height: 64px; margin-left: -20px; filter: drop-shadow(0 2px 1.5px rgba(20, 24, 30, .22)); }
.hang img { margin-top: 71px; }
.sheet-stage .hook { top: 0; width: 50px; height: 80px; margin-left: -25px; filter: drop-shadow(0 2px 2px rgba(20, 24, 30, .2)); }
.flipper { top: 75px; }

/* тени вещей почти невидимые */
.face img { filter: drop-shadow(0 8px 10px rgba(20, 24, 30, .10)); }
.comp img { filter: drop-shadow(0 4px 6px rgba(20, 24, 30, .08)); }

/* обувь: пара стоит сама, без полок и линий */
.hang.shoe::after, .sheet-stage.shoe .face::after { content: none; display: none; }
.hang.shoe img { filter: none; }
.sheet-stage.shoe .flipper { top: 0; }
.sheet-stage.single { cursor: default; }
.sheet-stage.shoe .face { opacity: 1; flex-direction: row; align-items: center; justify-content: center; }
.sheet-stage.shoe .face img { width: min(94%, 460px); height: auto; max-height: 92%; filter: none; }

/* характеристики и редактор */
.specs-head { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 22px 2px; }
.specs-head h3 { font-size: 15px; font-weight: 700; }
.link-btn { color: var(--accent); font-weight: 700; font-size: 15px; padding: 6px 0 6px 12px; }
.warm-view { display: inline-flex; align-items: center; gap: 10px; }
.warm-view small, .warm-edit small { color: var(--muted); font-size: 13px; font-weight: 500; }
.specs.editing { border-top: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.field > span { color: var(--muted); font-size: 14px; }
.field input, .field textarea {
  width: 100%; font: inherit; font-weight: 600; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; padding: 10px 12px;
}
.field textarea { resize: vertical; min-height: 72px; line-height: 1.35; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.warm-edit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dots.big { gap: 10px; }
.dots.big button {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); background: #fff;
  transition: background .15s, transform .12s;
}
.dots.big button.f { background: var(--ink); }
.dots.big button:active { transform: scale(.9); }

/* ======================= v4: добавление вещи ======================= */
.top { align-items: center; }
.top-right { display: flex; align-items: center; gap: 12px; }
.add-btn {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 24px; line-height: 1; font-weight: 400; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(43, 60, 255, .3);
}
.add-btn:active { transform: scale(.94); }
.jobs-bar {
  flex: none; margin: 0 16px 6px; padding: 11px 14px; border-radius: 14px; text-align: left;
  background: #e9ecff; color: #26307a; font-weight: 600; font-size: 14px;
}
.jobs-bar[hidden] { display: none; }
.jobs-bar.ready { background: var(--accent); color: #fff; }
.jobs-bar.fail { background: #fff1e0; color: #6b4300; }

.sheet.add { z-index: 30; padding: 0; }
.add-wrap { flex: 1; padding: calc(12px + env(safe-area-inset-top)) 20px 12px; }
.add-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.add-link { color: var(--accent); font-weight: 600; padding: 6px 0; }
.add-link.strong { color: var(--ink); font-weight: 700; }
.add-title { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.add-sub { color: var(--muted); margin-top: 4px; }
.add-h3 { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 8px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.add-tips { margin: 14px 0 0; padding: 14px 16px 14px 34px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; display: grid; gap: 6px; font-size: 14px; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.shots.one { grid-template-columns: 1fr; }
.shot {
  position: relative; aspect-ratio: 3 / 4; border: 2px dashed #c3c7cf; border-radius: 16px; background: #f2f3f5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); overflow: hidden;
}
.shots.one .shot { aspect-ratio: 4 / 3; }
.shot b { color: var(--ink); }
.shot small { font-size: 12px; }
.shot.filled { border-style: solid; border-color: var(--line); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot-tag { position: absolute; left: 8px; bottom: 8px; background: rgba(21, 23, 26, .75); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 8px; }
.shot-redo { position: absolute; right: 8px; top: 8px; background: rgba(255, 255, 255, .92); color: var(--ink); font-size: 12px; padding: 4px 8px; border-radius: 8px; }

.scans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.scans.one { grid-template-columns: 1fr; }
.scan { position: relative; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: #ddd; }
.scans.one .scan { aspect-ratio: 4 / 3; }
.scan img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.6); }
.scan::after { content: ""; position: absolute; left: 0; right: 0; height: 38%; top: -40%; background: linear-gradient(rgba(43, 60, 255, 0), rgba(43, 60, 255, .2), rgba(255, 255, 255, .5), rgba(43, 60, 255, 0)); animation: scan 1.6s linear infinite; }
@keyframes scan { to { top: 100%; } }
.steps { margin-top: 16px; display: grid; gap: 12px; }
.st { display: flex; gap: 12px; align-items: center; color: var(--muted); }
.st .ic { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #c9ccd3; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.st.run { color: var(--ink); font-weight: 600; }
.st.run .ic { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.st.done { color: var(--ink); }
.st.done .ic { border-color: #1f9d55; background: #1f9d55; color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.add-note { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #e9ecff; color: #26307a; font-size: 14px; }
.add-note.warn { background: #fff1e0; color: #6b4300; }

.seg { display: grid; grid-template-columns: 1fr 1fr; background: #dfe1e5; border-radius: 12px; padding: 3px; margin-top: 14px; }
.seg button { height: 36px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.cmp { position: relative; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; background: #f4f4f2; margin-top: 12px; touch-action: none; cursor: ew-resize; border: 1px solid var(--line); }
.cmp.wide { aspect-ratio: 4 / 3; }
.cmp img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cmp .after { object-fit: contain; padding: 6% 8%; }
.cmp .before { object-fit: cover; }
.cmp .line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.cmp .knob { position: absolute; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .25); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.cmp .lb { position: absolute; top: 10px; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 8px; background: rgba(21, 23, 26, .72); color: #fff; }
.cmp .lb.l { left: 10px; } .cmp .lb.r { right: 10px; background: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.row2 .btn { padding: 0 10px; }

.add-item { display: flex; justify-content: center; margin: 12px 0 4px; }
.add-item img { height: 150px; width: auto; max-width: 70%; object-fit: contain; background: #f4f4f2; border-radius: 16px; padding: 8px; }
.sws { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); position: relative; }
.sw.on::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--accent); }

.add-foot { position: sticky; bottom: 0; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(236, 238, 240, 0), var(--bg) 30%); }
.add-foot > .btn { width: 100%; }
.add-foot .row2 { margin-top: 0; }

/* ---------- образ на манекене ---------- */
.viewtog { display: flex; gap: 4px; margin: 10px auto 0; padding: 3px; width: max-content; background: #e2e5e9; border-radius: 12px; }
.viewtog button { padding: 7px 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); }
.viewtog button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(20, 24, 30, .12); }
.build-top .viewtog { margin-top: 8px; }
.look-card.is-man { padding: 0; overflow: hidden; }
.man { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: inherit; overflow: hidden; }
.build-comp .man { inset: 0; }
.man-img { width: 100%; height: 100%; object-fit: contain; display: block; background: #e4e5e7; }
.man-msg { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px; text-align: center; color: var(--muted); font-size: 15px; }
.man-msg b { color: var(--ink); }
.man-ic { width: 34px; height: 58px; border-radius: 17px 17px 8px 8px; background: radial-gradient(circle at 50% 12px, #c9ccd1 9px, transparent 10px), linear-gradient(#c9ccd1, #c9ccd1) 50% 24px / 22px 34px no-repeat; }
.man-spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.man-redo { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 7px 12px; border-radius: 10px; background: rgba(255, 255, 255, .88); font-size: 13px; font-weight: 600; color: var(--ink); box-shadow: 0 1px 4px rgba(20, 24, 30, .15); }
