/* Рейка. Две темы: светлая — песочная стена, солнечный свет, оливковые кнопки; тёмная — графитовая стена, белый свет.
   Цвета и картинки каждой темы — переменные в начале файла. Оформление — по макету «Рейка — новый дизайн». */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/media/fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/media/fonts/montserrat-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --bg: #f3ebe2;
  --card: #fbf7f1;
  --field: #fffdf9;
  --thumb: #f9f4ec;
  --ink: #1b1917;
  --muted: #6e675e;
  --muted2: #5c564e;
  --line: #e4d9cb;
  --line2: #d9cfc0;
  --chip: #e9dfd2;
  --olive: #75725a;
  --olive-d: #5f5c45;
  --cream: #f5efe6;
  --on-accent: #fff;      /* текст на оливковой кнопке */
  --on-cream: #4a4636;    /* значок на кремовой круглой кнопке поверх фото */
  --page: #e7ddd0;        /* поля вокруг приложения на широком экране */
  --tabs: #f5ede4;
  --tile: #d9bf98;        /* пока фото плитки грузится */
  --shade: linear-gradient(to top right, rgba(52, 36, 20, .66) 0%, rgba(52, 36, 20, .3) 30%, rgba(52, 36, 20, 0) 56%);
  --glass: rgba(251, 247, 241, .96);
  --dot: #8c857b;
  --icon-bg: #efe6da;
  --hook: #1c1b1a;
  --hook-hi: #6a6863;
  --danger: #a3321f;
  --wall: #e9d2ae url("../img/wall.jpg") center / cover no-repeat;
  --room: #e9d2ae url("../img/room.jpg") center bottom / cover no-repeat;
  --bar: linear-gradient(180deg, #4a4946 0%, #2b2a28 28%, #1c1b1a 62%, #111110 100%);
  --rail-top: 18px;
  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

/* Тёмная тема. Выделение и главные кнопки светлые (графит на графите не виден), рейка и крючки стальные,
   плитки вещей светлее фона, чтобы чёрные вещи не терялись. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1e2023;
  --card: #2a2d31;
  --field: #24272b;
  --thumb: #464a50;
  --ink: #f2f3f4;
  --muted: #a4a8ae;
  --muted2: #b4b8bd;
  --line: #3a3d42;
  --line2: #50545a;
  --chip: #2a2d31;
  --olive: #e6e7e9;
  --olive-d: #d5d7da;
  --cream: #e6e7e9;
  --on-accent: #17181a;
  --on-cream: #17181a;
  --page: #131416;
  --tabs: #191b1d;
  --tile: #2f3236;
  --shade: linear-gradient(to top right, rgba(8, 9, 11, .7) 0%, rgba(8, 9, 11, .34) 30%, rgba(8, 9, 11, 0) 56%);
  --glass: rgba(36, 39, 43, .95);
  --dot: #7c8087;
  --icon-bg: #34373c;
  --hook: #a9acb1;
  --hook-hi: #e1e3e6;
  --danger: #ff9a8a;
  --wall: #2f3236 url("../img/dark/wall.jpg") center / cover no-repeat;
  --room: #2f3236 url("../img/dark/room.jpg") center bottom / cover no-repeat;
  --bar: linear-gradient(180deg, #c9ccd0 0%, #a2a5aa 28%, #7e8186 62%, #5e6166 100%);
}

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

#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 var(--line2), 0 30px 80px rgba(30, 24, 18, .14); } }

/* ---------- шапка ---------- */
.top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(20px + env(safe-area-inset-top)) 16px 14px; }
.top-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.top h1 { font-size: 28px; font-weight: 800; letter-spacing: -.3px; line-height: 34px; }
.top-note { font-size: 14px; line-height: 20px; color: var(--muted); }
.top-btns { flex: none; display: flex; align-items: center; gap: 8px; }
.add-btn { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--olive); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }
.add-btn:active, .theme-btn:active { transform: scale(.94); }
/* выбор темы: того же размера, что «+», но спокойнее — главная кнопка остаётся одна */
.theme-btn { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
.hk-a { stroke: var(--hook); } .hk-b { stroke: var(--hook-hi); } .hk-c { fill: var(--hook); }

#screen { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 16px 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); padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); background: var(--tabs); border-top: 1px solid var(--line); }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted); }
.tabs button.on { color: var(--ink); font-weight: 700; }

/* ---------- общие элементы ---------- */
.btn { height: 50px; padding: 0 22px; border-radius: 25px; border: 1px solid var(--line2); font-size: 16px; font-weight: 700; white-space: nowrap; background: var(--field); color: var(--ink); transition: transform .12s, background .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--olive); border-color: var(--olive); color: var(--on-accent); }
.btn.ghost { border-color: var(--line); background: var(--card); }
.btn.small { height: 44px; padding: 0 18px; font-size: 14px; border-radius: 22px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link-btn { color: var(--olive-d); font-weight: 700; font-size: 15px; min-height: 44px; padding: 0 0 0 12px; }
.link-btn.small { font-size: 14px; font-weight: 600; color: var(--muted2); }
.round { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.round.small { width: 44px; height: 44px; }
.round:active { transform: scale(.94); }

.chips-row { display: flex; align-items: center; gap: 8px; padding: 0 0 12px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; margin-right: -16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 44px; padding: 0 18px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 600; transition: background .2s, color .2s; }
.chip.on { background: var(--olive); border-color: var(--olive); color: var(--on-accent); font-weight: 700; }
.sec-name { font-size: 20px; line-height: 26px; font-weight: 800; }

/* ---------- сборка вещей в одну картинку ---------- */
.comp { position: relative; width: 100%; height: 100%; }
.comp img { position: absolute; pointer-events: none; }

/* ---------- Шкаф: разделы ---------- */
.sections { display: flex; flex-direction: column; gap: 8px; }
.sec { position: relative; display: block; width: 100%; aspect-ratio: 358 / 155; border-radius: 18px; overflow: hidden; text-align: left; background: var(--tile); color: #fff; isolation: isolate; }
.sec-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.sec::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: var(--shade); }
.sec-text { position: absolute; left: 14px; bottom: 12px; right: 64px; display: flex; flex-direction: column; gap: 1px; z-index: 2; text-shadow: 0 1px 6px rgba(40, 26, 12, .45); }
.sec-text b { font-size: 22px; line-height: 26px; font-weight: 700; max-width: 150px; }
.sec-text span { font-size: 13px; line-height: 18px; font-weight: 600; }
.sec-go { position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px; border-radius: 50%; background: var(--cream); color: var(--on-cream); display: flex; align-items: center; justify-content: center; z-index: 2; }
.sec:active { transform: scale(.99); }

/* ---------- Шкаф: раздел на рейке ---------- */
.closet { display: flex; flex-direction: column; min-height: 100%; }
.rail { position: relative; margin: 0 -16px; height: 420px; min-height: 300px; flex: none; overflow: hidden; }
.rail .bar { position: absolute; left: 0; right: 0; top: var(--rail-top); height: 12px; z-index: 0; background: var(--bar); }
.rail.shoes-only .bar { display: none; }
/* раздел «Обувь»: пара стоит на полу комнаты, а не висит на стене */
.rail.shoes-only:not(.empty) { background: var(--room); }
.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); width: var(--slot); min-width: 0; height: 100%; display: flex; justify-content: center; scroll-snap-align: center; transform-origin: 50% 0; will-change: transform; overflow: visible; }
.hang .hook { position: absolute; top: 11px; left: 50%; width: 40px; height: 64px; margin-left: -20px; z-index: 2; pointer-events: none; }
.hang img { flex: none; margin-top: 71px; width: calc(var(--S) * var(--wk)); height: calc(var(--S) * var(--hk)); 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: none; }
.rail-empty { position: absolute; left: 24px; right: 24px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 20px; border-radius: 24px; background: var(--glass); text-align: center; color: var(--muted2); font-size: 14px; line-height: 20px; z-index: 2; }
.rail-empty b { color: var(--ink); font-size: 20px; line-height: 26px; font-weight: 800; }

.closet-meta { text-align: center; padding-top: 16px; }
.closet-meta h2 { font-size: 22px; font-weight: 800; line-height: 28px; min-height: 28px; }
.closet-meta p { color: var(--muted); font-size: 14px; line-height: 20px; margin-top: 4px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 28px; margin: 12px 0 0; }
.counter { color: var(--muted); font-size: 15px; font-weight: 600; letter-spacing: .5px; min-width: 70px; font-variant-numeric: tabular-nums; }
.minis { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 14px 16px; scrollbar-width: none; }
.minis::-webkit-scrollbar { display: none; }
.mini { flex: none; width: 72px; height: 76px; border-radius: 16px; background: var(--thumb); padding: 6px; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s; }
.mini img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mini.on { box-shadow: inset 0 0 0 2px var(--olive); }

/* ---------- карточка вещи ---------- */
.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; } }
.sh-top { flex: none; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; }
.sh-count { text-align: center; color: var(--muted); font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.sheet-stage { position: relative; flex: none; height: min(48dvh, 430px); min-height: 290px; margin: 0 16px; border-radius: 24px; overflow: hidden; perspective: 1500px; user-select: none; -webkit-user-select: none; cursor: pointer; }
.sheet-stage.single { cursor: default; }
.sheet-stage .bar { position: absolute; left: 0; right: 0; top: 22px; height: 12px; background: var(--bar); }
.sheet-stage .hook { position: absolute; top: 14px; left: 50%; width: 50px; height: 80px; margin-left: -25px; z-index: 3; pointer-events: none; }
.flipper { position: absolute; left: 0; right: 0; top: 89px; bottom: 16px; transform-style: preserve-3d; pointer-events: none; }
.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: 92%; object-fit: contain; }
.sheet-stage.shoe .flipper { top: 0; bottom: 0; transform-style: flat; }
.sheet-stage.shoe { background: var(--room); }
.sheet-stage.shoe .face { align-items: flex-end; padding-bottom: 7%; backface-visibility: visible; -webkit-backface-visibility: visible; }
.sheet-stage.shoe .face img { width: min(78%, 400px); height: auto; max-height: 70%; }
.tap-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); white-space: nowrap; font-size: 13px; line-height: 16px; font-weight: 600; color: var(--muted2); background: var(--glass); padding: 6px 14px; border-radius: 14px; pointer-events: none; }
.face-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 16px 0; }
.face-thumbs button { height: 92px; border-radius: 18px; background: var(--thumb); position: relative; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.face-thumbs img { height: 68px; width: auto; margin-bottom: 14px; }
.face-thumbs span { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); font-size: 13px; line-height: 16px; font-weight: 600; color: var(--muted2); padding: 3px 12px; border-radius: 12px; background: var(--glass); }
.face-thumbs button.on { box-shadow: inset 0 0 0 2px var(--olive); }
.face-thumbs button.on span { background: var(--field); color: var(--ink); font-weight: 700; }
.sh-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 20px 16px 0; }
.sh-title > div { min-width: 0; }
.sh-title h2 { font-size: 24px; line-height: 32px; font-weight: 800; letter-spacing: -.2px; overflow-wrap: anywhere; }
.sh-title p { color: var(--muted); font-size: 14px; line-height: 20px; }
.specs { margin: 12px 16px 0; }
.spec { display: grid; grid-template-columns: 22px auto 1fr; align-items: center; gap: 14px; min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.spec:last-child { border-bottom: 0; }
.spec .ic { color: var(--muted); display: flex; }
.spec .k { color: var(--muted); font-size: 15px; }
.spec .v { font-weight: 700; text-align: right; font-size: 15px; line-height: 20px; overflow-wrap: anywhere; }
.spec .v .muted { font-weight: 500; }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--dot); }
.dots i.f { background: var(--olive-d); border-color: var(--olive-d); }
.warm-view { display: inline-flex; align-items: center; justify-content: flex-end; gap: 12px; }
.warm-view small, .warm-edit small { color: var(--muted); font-size: 14px; font-weight: 600; }
.sheet-actions { display: flex; gap: 10px; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
.sheet-actions .btn { flex: 1; height: 52px; border-radius: 26px; }
.field { display: flex; flex-direction: column; gap: 8px; padding: 9px 0; }
.field > span { color: var(--muted); font-size: 13px; line-height: 18px; font-weight: 600; }
.field > span b { color: var(--ink); font-weight: 700; }
.field input, .field textarea { width: 100%; font-weight: 600; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; background: var(--field); padding: 0 16px; height: 52px; }
.field textarea { resize: vertical; height: auto; min-height: 76px; padding: 13px 16px; line-height: 1.35; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; font-weight: 500; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 1px var(--olive); }
.field input.strong { font-weight: 700; }
.warm-edit { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* правка вещи: переснять и удалить */
.manage { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 16px 0; padding-top: 16px; border-top: 1px solid var(--line); }
.manage .btn { flex: 1; }
.btn.danger { color: var(--danger); }
.manage-note { margin: 10px 16px 0; color: var(--muted); font-size: 13px; line-height: 18px; }
.dots.big { gap: 0; margin-left: -9px; }
.dots.big button { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.dots.big button::before { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--dot); transition: background .15s; }
.dots.big button.f::before { background: var(--olive-d); border-color: var(--olive-d); }
.sws { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px 6px; justify-items: center; padding: 4px 0; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line2); position: relative; }
.sw.on::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--olive); }

/* ---------- Образы ---------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--chip); border-radius: 18px; padding: 4px; margin-top: 14px; }
.seg button { height: 40px; border-radius: 14px; font-size: 15px; font-weight: 600; color: var(--muted2); }
.seg button.on { background: var(--olive); color: var(--on-accent); font-weight: 700; }
.seg.big { margin: 0 0 12px; }
.seg.big button { height: 44px; }
.build-top { margin: 0; }
.build-card { position: relative; width: 100%; aspect-ratio: 358 / 405; border-radius: 24px; overflow: hidden; background: var(--room); }
.build-card.man-view { aspect-ratio: 3 / 4; }
.build-comp { position: absolute; inset: 8px 10px 3.4%; }
.build-card.man-view .build-comp { inset: 0; }
.card-tools { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 20; }
.card-tools button { width: 44px; height: 44px; border-radius: 50%; background: var(--cream); display: flex; align-items: center; justify-content: center; color: var(--on-cream); }
.caption { text-align: center; color: var(--muted); font-size: 14px; line-height: 20px; margin: 12px 8px 0; min-height: 20px; }
.slot { margin-top: 16px; }
.slot h3 { font-size: 16px; line-height: 22px; font-weight: 700; margin-bottom: 8px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; scroll-snap-type: x proximity; }
.thumbs::-webkit-scrollbar { display: none; }
.thumb { flex: none; width: 80px; height: 84px; border-radius: 18px; background: var(--thumb); padding: 6px; scroll-snap-align: start; display: flex; align-items: center; justify-content: center; position: relative; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s; }
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb.on { box-shadow: inset 0 0 0 2px var(--olive); }
.thumb.none { font-size: 13px; line-height: 16px; color: var(--muted2); font-weight: 600; text-align: center; }
.slot-empty { padding: 16px; border: 1.5px dashed var(--line2); border-radius: 16px; color: var(--muted); font-size: 14px; text-align: center; }
.saved-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.saved { display: flex; flex-direction: column; min-width: 0; }
.saved-pic { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; border-radius: 22px; overflow: hidden; background: var(--room); }
.saved-pic .comp { position: absolute; inset: 6px 6px 3.6%; width: auto; height: auto; }
.saved-man { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.saved-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 0 4px; min-height: 48px; }
.saved-row span { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.saved-row .link-btn { flex: none; padding-left: 6px; }
.empty-box { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 50px 20px; }

/* манекен */
.viewtog { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 12px auto 0; padding: 4px; width: min(100%, 280px); background: var(--chip); border-radius: 18px; }
.viewtog button { height: 36px; border-radius: 14px; font-size: 14px; font-weight: 600; color: var(--muted2); white-space: nowrap; }
.viewtog button.on { background: var(--olive); color: var(--on-accent); font-weight: 700; }
.man { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.man-img { width: 100%; height: 100%; object-fit: cover; object-position: center bottom; display: block; cursor: zoom-in; }
.man-msg { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 24px; padding: 22px 20px; border-radius: 24px; background: var(--glass); text-align: center; color: var(--muted2); font-size: 14px; line-height: 20px; }
.man-msg b { color: var(--ink); font-size: 16px; }
.man-ic { display: none; }
.man-spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--olive); border-right-color: var(--olive); animation: spin .8s linear infinite; }
.man-redo { position: absolute; right: 12px; bottom: 12px; height: 44px; padding: 0 14px; border-radius: 14px; background: var(--cream); font-size: 14px; font-weight: 700; color: var(--on-cream); }
.zoom { position: absolute; inset: 0; z-index: 60; background: rgba(27, 25, 23, .94); display: flex; align-items: center; justify-content: center; cursor: zoom-out; animation: enter .2s ease both; }
.zoom[hidden] { display: none; }
.zoom img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }

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

/* ---------- приветствие ---------- */
.onb { position: absolute; inset: 0; z-index: 70; background: var(--bg); display: flex; flex-direction: column; animation: enter .25s ease both; }
.onb[hidden] { display: none; }
.onb-wrap { flex: 1; display: flex; flex-direction: column; padding: calc(12px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom)); min-height: 0; overflow-y: auto; }
.onb-top { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.onb-dots { display: flex; gap: 6px; }
.onb-dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--line2); transition: width .2s; }
.onb-dots i.on { width: 22px; background: var(--olive); }
.onb-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.onb-body.center-box { justify-content: center; text-align: center; }
.onb-title { font-size: 30px; font-weight: 800; letter-spacing: -.3px; line-height: 36px; margin-top: 14px; }
.onb-text { font-size: 16px; line-height: 24px; color: var(--muted2); }
.onb-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.onb-foot .btn { height: 56px; border-radius: 28px; }
.onb-art { position: relative; flex: none; height: min(46dvh, 388px); min-height: 250px; border-radius: 24px; overflow: hidden; }
.onb-bar { position: absolute; left: 0; right: 0; top: 26px; height: 10px; background: var(--bar); }
.onb-hangs { position: absolute; left: 4%; right: 4%; top: 20px; bottom: 0; }
.onb-hang { position: absolute; top: 0; width: 42%; left: calc(var(--i) * 26% + 3%); z-index: calc(10 - var(--i)); display: flex; flex-direction: column; align-items: center; }
.onb-hook { width: 26px; height: 42px; flex: none; }
.onb-hang img { width: 100%; height: auto; margin-top: -4px; }
.onb-art.two { display: grid; grid-template-columns: 1fr 22px 1fr; align-items: center; gap: 8px; border-radius: 0; overflow: visible; }
.onb-raw { width: 100%; height: 100%; min-height: 0; object-fit: cover; border-radius: 22px; }
.onb-arrow { display: flex; justify-content: center; color: var(--muted2); }
.onb-res { height: 100%; border-radius: 22px; display: flex; align-items: center; justify-content: center; padding: 14px; }
.onb-res img { max-width: 100%; max-height: 100%; object-fit: contain; }
.onb-art.man-art { background: var(--room); align-self: center; height: auto; width: min(100%, 300px); aspect-ratio: 3 / 4; }
.onb-art.man-art img { width: 100%; height: 100%; object-fit: cover; }
.gender { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.g-card { display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: 24px; background: var(--card); text-align: left; border: 1px solid var(--line); }
.g-card:active { border-color: var(--olive); box-shadow: 0 0 0 1px var(--olive); }
.g-ic { width: 72px; height: 72px; border-radius: 20px; background: var(--icon-bg); color: var(--olive-d); display: flex; align-items: center; justify-content: center; flex: none; }
.g-card b { display: block; font-size: 20px; line-height: 26px; font-weight: 800; }
.g-card small { display: block; color: var(--muted2); font-size: 14px; line-height: 20px; margin-top: 4px; }
.g-card small.soon { display: inline-block; padding: 2px 10px; border-radius: 10px; background: var(--chip); font-size: 13px; line-height: 18px; font-weight: 600; }
/* выбор темы в приветствии: две карточки с настоящей картинкой раздела */
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.t-card { display: flex; flex-direction: column; gap: 10px; padding: 8px 8px 14px; border-radius: 24px; background: var(--card); border: 1px solid var(--line); text-align: center; }
.t-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 62% 50%; border-radius: 18px; }
.t-card b { font-size: 17px; line-height: 22px; font-weight: 800; }
.t-card.on { border-color: var(--olive); box-shadow: 0 0 0 1px var(--olive); }

/* ---------- модальное окно и уведомление ---------- */
.modal { position: absolute; inset: 0; z-index: 40; background: rgba(27, 25, 23, .4); 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 20px calc(24px + env(safe-area-inset-bottom)); animation: sheet-in .22s ease both; }
.modal h3 { font-size: 19px; font-weight: 800; margin-bottom: 12px; }
.modal input { width: 100%; height: 52px; border-radius: 16px; border: 1px solid var(--line); padding: 0 16px; font-weight: 600; background: var(--field); color: var(--ink); margin-bottom: 14px; }
.modal input:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 1px var(--olive); }
.modal .btns { display: flex; gap: 10px; }
.modal .btns .btn { flex: 1; }
.toast { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 80; background: var(--ink); color: var(--bg); 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; }
.toast.with-btn { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 18px; }
.toast.with-btn[hidden] { display: none; }
.toast.with-btn button { min-height: 44px; padding: 0 14px; border-radius: 18px; font-size: 14px; font-weight: 800; color: var(--bg); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- добавление вещи ---------- */
.jobs-bar { flex: none; margin: 0 16px 8px; padding: 12px 14px; border-radius: 16px; text-align: left; background: var(--chip); color: var(--ink); font-weight: 600; font-size: 14px; }
.jobs-bar[hidden] { display: none; }
.jobs-bar.ready { background: var(--olive); color: var(--on-accent); }
.jobs-bar.fail { background: #f6e3cf; color: #6b4300; }
.sheet.add { z-index: 30; padding: 0; }
.add-wrap { flex: 1; padding: calc(6px + env(safe-area-inset-top)) 16px 12px; }
.add-top { display: flex; justify-content: space-between; align-items: center; min-height: 50px; }
.add-link { color: var(--olive-d); font-weight: 700; font-size: 15px; min-height: 44px; }
.add-link.strong { color: var(--ink); }
.add-title { font-size: 30px; font-weight: 800; letter-spacing: -.3px; line-height: 36px; overflow-wrap: anywhere; }
.add-sub { color: var(--muted); font-size: 15px; line-height: 20px; margin-top: 6px; }
.add-h3 { font-size: 12px; line-height: 16px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin: 20px 0 10px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin-right: 0; padding-right: 0; }
.chips.wrap .chip { font-size: 15px; padding: 0 16px; }
.add-tips { margin: 18px 0 0; padding: 14px 16px 14px 34px; background: var(--card); border-radius: 18px; display: grid; gap: 6px; font-size: 14px; line-height: 20px; border: 1px solid var(--line); }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.shots.one { grid-template-columns: 1fr; }
.shot { position: relative; aspect-ratio: 3 / 4; border: 2px dashed var(--line2); border-radius: 20px; background: var(--thumb); 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); font-weight: 700; }
.shot small { font-size: 12px; }
.shot.filled { border-style: solid; border-color: transparent; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot-tag { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(27, 25, 23, .8); color: #fff; font-size: 13px; line-height: 18px; font-weight: 600; padding: 4px 14px; border-radius: 12px; white-space: nowrap; }
.shot-redo { position: absolute; right: 8px; top: 8px; background: var(--glass); color: var(--ink); font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 12px; }
.scans { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.scans.one { grid-template-columns: 1fr; }
.scan { position: relative; aspect-ratio: 3 / 4; border-radius: 20px; overflow: hidden; background: #cfcfcf; }
.scans.one .scan { aspect-ratio: 4 / 3; }
.scan img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.7); }
.scan::after { content: ""; position: absolute; left: 0; right: 0; height: 38%; top: -40%; background: linear-gradient(rgba(255, 250, 240, 0), rgba(255, 250, 240, .6), rgba(255, 250, 240, 0)); animation: scan 1.6s linear infinite; }
@keyframes scan { to { top: 100%; } }
.steps { margin-top: 20px; display: grid; gap: 14px; }
.st { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 15px; line-height: 20px; }
.st .ic { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line2); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.st.run { color: var(--ink); font-weight: 700; }
.st.run .ic { border: 3px solid var(--line2); border-top-color: var(--olive); border-right-color: var(--olive); animation: spin .8s linear infinite; }
.st.done .ic { border-color: var(--olive); background: var(--olive); color: var(--on-accent); }
.st.fail { color: var(--danger); } .st.fail .ic { border-color: var(--danger); color: var(--danger); font-weight: 800; }
@keyframes spin { to { transform: rotate(360deg); } }
.add-note { margin-top: 14px; padding: 12px 16px; border-radius: 18px; background: var(--card); color: var(--ink); font-size: 14px; line-height: 20px; border: 1px solid var(--line); }
.add-note.warn { background: #f6e3cf; color: #6b4300; border-color: transparent; }
.cmp { position: relative; aspect-ratio: 358 / 392; border-radius: 22px; overflow: hidden; background: var(--wall); margin-top: 10px; touch-action: none; cursor: ew-resize; }
.cmp.wide { aspect-ratio: 4 / 3; }
.cmp img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cmp .after { object-fit: contain; padding: 8% 12%; }
.cmp .before { object-fit: cover; }
.cmp .line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--card); }
.cmp .knob { position: absolute; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: var(--card); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.cmp .lb { position: absolute; top: 10px; font-size: 13px; line-height: 18px; font-weight: 600; padding: 4px 12px; border-radius: 12px; background: rgba(27, 25, 23, .8); color: #fff; }
.cmp .lb.l { left: 10px; } .cmp .lb.r { right: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.row2 .btn { padding: 0 8px; height: 48px; font-size: 14px; }
.add-item { display: flex; justify-content: center; margin: 16px 0 8px; }
.add-item span { width: 128px; height: 150px; border-radius: 20px; background: var(--wall); display: flex; align-items: center; justify-content: center; padding: 16px; }
.add-item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.add-foot { position: sticky; bottom: 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.add-foot > .btn { width: 100%; height: 56px; border-radius: 28px; }
.add-foot .row2 { margin-top: 0; }
.add-foot .row2 .btn { height: 56px; border-radius: 28px; font-size: 16px; }

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

/* ---------- Стилист ---------- */
.stylist { display: flex; flex-direction: column; min-height: 100%; }
.chat-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 0 8px; }
.city-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink); max-width: 70%; }
.city-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-chip.empty { color: var(--muted); border-style: dashed; }
.city-form { display: flex; gap: 8px; margin: 0 0 10px; }
.city-form input { flex: 1; min-width: 0; height: 44px; border-radius: 16px; border: 1px solid var(--line); background: var(--field); padding: 0 14px; font-weight: 600; color: var(--ink); }
.city-form input:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 1px var(--olive); }
.msg .city-form { margin: 8px 0 4px; }
.chat { flex: 1; display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.msg { display: flex; flex-direction: column; gap: 8px; max-width: 100%; }
.msg.me { align-items: flex-end; }
.msg.st { align-items: stretch; }
.bubble { max-width: 86%; padding: 11px 14px; border-radius: 18px; font-size: 15px; line-height: 21px; white-space: pre-wrap; word-break: break-word; }
.msg.me .bubble { background: var(--olive); color: var(--on-accent); border-bottom-right-radius: 6px; align-self: flex-end; }
.msg.st .bubble { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; align-self: flex-start; }
.bubble.think { display: flex; align-items: center; gap: 10px; color: var(--muted2); }
.bubble.think .man-spin { width: 18px; height: 18px; border-width: 2px; margin: 0; flex: none; }
.hints { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.ask { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 8px; padding: 10px 0 6px; background: var(--bg); } /* поверх карточек образов: у вещей в картинке свои слои */
.ask input { flex: 1; min-width: 0; height: 50px; border-radius: 25px; border: 1px solid var(--line2); background: var(--field); padding: 0 18px; font-weight: 600; color: var(--ink); }
.ask input::placeholder { color: var(--muted); opacity: 1; font-weight: 500; }
.ask input:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 1px var(--olive); }
.ask .send { flex: none; width: 50px; height: 50px; border-radius: 25px; background: var(--olive); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }
.ask .send[disabled] { opacity: .45; }
.ocard { display: flex; align-items: flex-start; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 10px; } /* flex-start: картинка не растягивается по высоте текста */
.oc-pic { flex: none; width: 42%; aspect-ratio: 3 / 4; border-radius: 16px; background: var(--room); position: relative; overflow: hidden; isolation: isolate; } /* рамка всегда 3:4, как в «Моих образах» */
.oc-pic .comp { position: absolute; inset: 6px 6px 4%; width: auto; height: auto; }
.oc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 4px 2px 2px 0; }
.oc-head { display: flex; flex-direction: column; gap: 2px; }
.oc-head b { font-size: 16px; line-height: 20px; }
.oc-day { font-size: 12px; line-height: 16px; color: var(--muted); font-weight: 600; }
.oc-why { font-size: 13px; line-height: 18px; color: var(--muted2); flex: 1; }
.oc-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.oc-btns .btn.small { height: 38px; padding: 0 14px; font-size: 13px; }
.trip-box { display: flex; flex-direction: column; gap: 10px; }
.trip-head { display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 4px 2px; color: var(--ink); }
.trip-head b { font-weight: 800; }
.trip-head span { color: var(--muted); font-size: 13px; }
.trip-pack { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 10px 14px 6px; }
.small-note { font-size: 13px; line-height: 18px; color: var(--muted); padding: 0 4px; }
.pack { display: flex; flex-direction: column; gap: 4px; }
.pack-group h4 { font-size: 12px; line-height: 16px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 8px 0 4px; }
.pack-row { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 600; }
.pack-row input { width: 22px; height: 22px; accent-color: var(--olive); flex: none; }
.pack-row img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.pack-row.done span { color: var(--muted); text-decoration: line-through; }
.trip-list { display: flex; flex-direction: column; gap: 8px; }
.trip-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px 16px; text-align: left; }
.trip-ic { flex: none; width: 36px; height: 36px; border-radius: 18px; background: var(--icon-bg); display: flex; align-items: center; justify-content: center; }
.trip-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trip-txt b { font-size: 16px; }
.trip-txt span { font-size: 13px; line-height: 18px; color: var(--muted); }
.trip-page { display: flex; flex-direction: column; gap: 10px; }
.trip-page .chips-row { padding-bottom: 4px; }
.trip-title { display: flex; flex-direction: column; min-width: 0; }
.trip-title b { font-size: 18px; }
.trip-title span { font-size: 13px; color: var(--muted); }
.trip-sub { font-size: 17px; font-weight: 800; padding: 8px 2px 0; }

/* ---------- Админка ---------- */
.admin { display: flex; flex-direction: column; gap: 14px; }
.admin .chips-row { display: flex; align-items: center; gap: 12px; }
.adm-title { font-size: 24px; font-weight: 800; flex: 1; }
.admin-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; }
.admin-entry .sec-go { flex: none; color: var(--muted); font-size: 22px; }
.adm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adm-tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.adm-tile b { font-size: 30px; font-weight: 800; line-height: 1.1; }
.adm-tile span { font-size: 13px; color: var(--muted); }
.adm-tile.warn { background: var(--olive); border-color: var(--olive); }
.adm-tile.warn b, .adm-tile.warn span { color: var(--on-accent); }
.adm-chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 8px 2px 0; }
.adm-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.adm-bar-fill { width: 60%; max-width: 22px; background: var(--olive); border-radius: 5px 5px 0 0; }
.adm-bar-x { font-size: 10px; color: var(--muted); }
.adm-kinds { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.adm-kind { background: var(--thumb); border-radius: 12px; padding: 8px 14px; display: flex; flex-direction: column; }
.adm-kind span { font-size: 12px; color: var(--muted); }
.adm-kind b { font-size: 17px; }
.adm-user { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.adm-user:first-of-type { border-top: none; }
.adm-user-top { display: flex; align-items: center; gap: 10px; }
.adm-user-top b { font-size: 16px; }
.adm-badge { font-size: 12px; font-weight: 700; }
.adm-user-sub { font-size: 13px; color: var(--muted); }
.adm-user-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adm-you { font-size: 13px; color: var(--muted); }
.adm-confirm { font-size: 14px; font-weight: 600; color: var(--ink); }
.adm-health { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.adm-health:first-of-type { border-top: none; }
.adm-health span { color: var(--muted); }
.adm-seg { margin-top: 4px; }
.adm-lims { display: flex; flex-direction: column; gap: 8px; }
.adm-lim { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; }
.adm-lim input { width: 110px; height: 42px; border-radius: 12px; border: 1px solid var(--line2); background: var(--field); padding: 0 14px; font-size: 16px; font-weight: 600; color: var(--ink); text-align: right; }
.adm-area { width: 100%; min-height: 90px; border-radius: 14px; border: 1px solid var(--line2); background: var(--field); padding: 12px 14px; font: inherit; font-size: 15px; color: var(--ink); resize: vertical; }
.btn.danger { color: #fff; background: #9a4a3c; }
.btn.ghost.danger { color: #9a4a3c; background: transparent; border: 1px solid #d9b1a8; }
