/* фирменный футер публичных страниц (Outfit, Please!) */
.brand-foot { text-align: center; color: var(--ink-soft); font-size: 12px;
  padding: 28px 16px 22px; font-family: "Golos Text", sans-serif; }
.brand-foot strong { color: var(--rosewood); font-weight: 700; }

:root {
  --linen: #F5F0E8;
  --card: #FDFBF8;
  --card-hover: #FFFFFF;
  --ink: #3A3235;
  --ink-soft: #6B5F62;
  --rosewood: #9C6B72;
  --rosewood-ink: #7A4F55;
  --sage: #7C8768;
  --sand: #DDD2C2;
  --sand-line: #E5DCCF;
  --danger: #B54C46;
  --shadow: 0 1px 2px rgba(58, 50, 53, .06), 0 8px 20px -12px rgba(58, 50, 53, .18);
  --radius: 10px;

  /* совместимость с уже написанной разметкой/JS, которые используют старые имена */
  --bg: var(--linen);
  --text: var(--ink);
  --muted: var(--ink-soft);
  --border: var(--sand-line);
  --accent: var(--rosewood);
  --accent-hover: var(--rosewood-ink);
}

@media (prefers-color-scheme: dark) {
  :root {
    --linen: #241F21;
    --card: #2F282A;
    --card-hover: #362E30;
    --ink: #F1E9E2;
    --ink-soft: #C9BBB6;
    --rosewood: #D3959B;
    --rosewood-ink: #E7B4B9;
    --sage: #A8B896;
    --sand: #4A3F41;
    --sand-line: #453B3D;
    --danger: #E39A94;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 24px -14px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --linen: #241F21;
  --card: #2F282A;
  --card-hover: #362E30;
  --ink: #F1E9E2;
  --ink-soft: #C9BBB6;
  --rosewood: #D3959B;
  --rosewood-ink: #E7B4B9;
  --sage: #A8B896;
  --sand: #4A3F41;
  --sand-line: #453B3D;
  --danger: #E39A94;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 24px -14px rgba(0, 0, 0, .5);
}
:root[data-theme="light"] {
  --linen: #F5F0E8;
  --card: #FDFBF8;
  --card-hover: #FFFFFF;
  --ink: #3A3235;
  --ink-soft: #6B5F62;
  --rosewood: #9C6B72;
  --rosewood-ink: #7A4F55;
  --sage: #7C8768;
  --sand: #DDD2C2;
  --sand-line: #E5DCCF;
  --danger: #B54C46;
  --shadow: 0 1px 2px rgba(58, 50, 53, .06), 0 8px 20px -12px rgba(58, 50, 53, .18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Golos Text", system-ui, -apple-system, sans-serif;
  background: var(--linen);
  color: var(--ink);
  transition: background .25s ease, color .25s ease;
}

::selection { background: var(--rosewood); color: var(--card); }
:focus-visible { outline: 2px solid var(--rosewood); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- шапка ---------- */

header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 20px;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  overflow: hidden;
}

.sprig-watermark {
  position: absolute;
  top: -10px;
  left: 230px;
  width: 200px;
  height: auto;
  color: var(--rosewood);
  opacity: .14;
  transform: rotate(-6deg);
  pointer-events: none;
}
@media (max-width: 760px) { .sprig-watermark { display: none; } }

.wordmark { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; position: relative; }
.wordmark .mark {
  font-family: "Alegreya", Georgia, serif;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -.01em;
  margin: 0;
}
.wordmark .tagline {
  font-family: "Alegreya", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 14.5px;
  color: var(--rosewood-ink);
}

header .ai-badge { font-size: 12px; color: var(--ink-soft); }

.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.theme-toggle {
  display: inline-flex;
  border: 1px solid var(--sand-line);
  border-radius: 8px;
  overflow: hidden;
}
.theme-toggle button {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  padding: 7px 10px;
  cursor: pointer;
  font-family: "Golos Text", sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.theme-toggle button.active { background: var(--rosewood); color: var(--card); }
.theme-toggle button:hover:not(.active) { background: var(--sand-line); }

.stitch {
  border: none;
  border-top: 1.5px dashed var(--rosewood);
  opacity: .5;
  max-width: 1200px;
  margin: 0 auto 20px;
}

/* ---------- кнопки ---------- */

.btn {
  border: 1px solid var(--sand-line);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-family: "Golos Text", sans-serif;
  font-weight: 600;
  cursor: pointer;
  background: var(--card);
  color: var(--ink);
  transition: border-color .15s, background .15s, transform .15s;
}
.btn:hover { border-color: var(--rosewood); transform: translateY(-1px); }
.btn-primary { background: var(--rosewood); border-color: var(--rosewood); color: var(--card); }
.btn-primary:hover { background: var(--rosewood-ink); border-color: var(--rosewood-ink); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--card); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

/* ---------- фильтры ---------- */

.list-toggle {
  display: flex;
  gap: 8px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 4px 24px 14px;
}
.list-toggle button {
  border: 1px solid var(--sand-line);
  background: var(--card);
  color: var(--ink-soft);
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Golos Text", sans-serif;
  font-size: 13px;
  font-weight: 600;
}
.list-toggle button.active { background: var(--rosewood); border-color: var(--rosewood); color: var(--card); }

/* режим выделения + массовая видимость (FR-2.8) */
.select-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 24px 16px;
}
.select-bar .spacer { flex: 1; }
.select-bar #selectCount { font-family: "Golos Text", sans-serif; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.card.selecting { cursor: pointer; }
.card.selected { outline: 2px solid var(--rosewood); outline-offset: 2px; }
.select-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--sand-line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-weight: 700;
  font-size: 14px;
}
.card.selected .select-check { background: var(--rosewood); border-color: var(--rosewood); color: #fff; }

/* возможный дубль (FR-10.5) */
.dup-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: "Golos Text", sans-serif;
}
.dup-section { border: 1px solid var(--danger); border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; }
.dup-section-head { color: var(--danger); font-weight: 700; font-size: 13px; margin-bottom: 8px; font-family: "Golos Text", sans-serif; }
.dup-refs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.dup-ref {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12.5px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--sand-line);
  border-radius: 999px;
}
.dup-ref:hover { border-color: var(--rosewood); }
.dup-ref-photo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sand) center / cover no-repeat;
  flex-shrink: 0;
}

/* карточка сравнения возможного дубля перед сохранением (доработка FR-10.6) */
.dup-compare-section { margin: 0 0 14px; display: flex; flex-direction: column; gap: 10px; }
.dup-card { border: 1px solid var(--danger); border-radius: 10px; padding: 12px 14px 14px; }
.dup-card-head {
  color: var(--danger);
  font-weight: 700;
  font-size: 13px;
  font-family: "Golos Text", sans-serif;
  margin-bottom: 12px;
}
.dup-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dup-col { background: var(--linen); border-radius: 8px; padding: 11px; }
.dup-col .col-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-family: "Golos Text", sans-serif;
  color: var(--ink-soft);
  margin-bottom: 9px;
}
.dup-col.incoming .col-label { color: var(--rosewood); }
.dup-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background: var(--sand) center / cover no-repeat;
  margin-bottom: 9px;
}
.dup-name {
  font-family: "Alegreya", Georgia, serif;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
  line-height: 1.25;
}
.dup-fields { margin: 0; }
.dup-fields dt {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-family: "Golos Text", sans-serif;
  color: var(--ink-soft);
  margin-top: 6px;
}
.dup-fields dt:first-child { margin-top: 0; }
.dup-fields dd { margin: 0; font-size: 13px; font-family: "Golos Text", sans-serif; }
.dup-fields dd.diff {
  color: var(--rosewood-ink);
  font-weight: 700;
  position: relative;
  padding-left: 11px;
}
.dup-fields dd.diff::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rosewood);
}
.dup-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.dup-dismissed-note {
  font-size: 13px;
  font-family: "Golos Text", sans-serif;
  color: var(--ink-soft);
  padding: 8px 2px;
}
@media (max-width: 480px) {
  .dup-compare { grid-template-columns: 1fr; }
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 0 24px 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.filters input[type="search"], .filters select {
  padding: 9px 12px;
  border: 1px solid var(--sand-line);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: "Golos Text", sans-serif;
  background: var(--card);
  color: var(--ink);
}
.filters input[type="search"] { min-width: 220px; }
.filters input[type="search"]::placeholder { color: var(--ink-soft); }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-family: "Golos Text", sans-serif;
  letter-spacing: .01em;
  border: 1.4px solid var(--tag-color, var(--ink-soft));
  color: var(--tag-color, var(--ink-soft));
  background: transparent;
  cursor: pointer;
  user-select: none;
  transition: all .15s;
}
.chip.active, .chip.static {
  background: var(--tag-color, var(--ink-soft));
  color: var(--card);
}
.chip.static { cursor: default; }

main { max-width: 1200px; margin: 0 auto; padding: 4px 24px 60px; }

/* ---------- сетка вещей ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--sand-line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--rosewood); }

.card .photo {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(155deg, var(--sand), var(--sand-line)) center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card .photo .no-photo {
  width: 46%;
  height: 46%;
  color: var(--ink-soft);
  opacity: .55;
}

/* значок «на витрине / скрыто» (FR-2.1) — не кнопка, только статус; стоит рядом
   с названием карточки, а не поверх фото */
.vis-badge {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vis-badge svg { width: 12px; height: 12px; }
.vis-badge.on { color: var(--rosewood); }
.vis-badge.off { color: var(--ink-soft); opacity: .8; }
.card .body {
  padding: 11px 13px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px dashed var(--sand-line);
}
.name-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}
.card .name {
  font-family: "Golos Text", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.35;
  min-width: 0;
}

.empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 70px 20px 90px;
  font-size: 15px;
  font-family: "Golos Text", sans-serif;
}
.empty .sprig-mini-big {
  width: 64px;
  height: auto;
  color: var(--rosewood);
  opacity: .5;
  margin-bottom: 14px;
}

/* ---------- отдельное окно одной вещи (?item=, standalone) ---------- */
/* шапка/фильтры/сетка не нужны — сама карточка (модалка) и есть страница */
body.standalone-item header,
body.standalone-item .stitch,
body.standalone-item .list-toggle,
body.standalone-item .filters,
body.standalone-item main {
  display: none;
}
/* окна-в-окне быть не должно: модалка растягивается на весь вьюпорт вместо
   плавающей карточки с затемнённым фоном. Тот же приём — .modal.fullscreen
   (form редактирования вещи, см. openModal()), но без скрытия шапки/сетки:
   страница за модалкой остаётся как есть, просто заслонена во весь экран. */
body.standalone-item .modal,
.modal.fullscreen {
  background: var(--card);
  padding: 0;
  align-items: stretch;
}
body.standalone-item .modal-box,
.modal.fullscreen .modal-box {
  max-width: none;
  width: 100%;
  border-radius: 0;
  box-shadow: none;
  padding: 32px clamp(20px, 5vw, 64px);
}

/* ---------- модальные окна ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(36, 31, 33, .5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}
/* !important: .lightbox (ниже по файлу) имеет тот же вес, что и .hidden, и без
   этого перебивал бы display:none — оверлей лайтбокса не скрывался и перехватывал
   клики по всей странице. */
.hidden { display: none !important; }

.modal-box {
  position: relative;
  background: var(--card);
  border-radius: 14px;
  width: 100%;
  max-width: 680px;
  padding: 26px;
  box-shadow: 0 24px 60px rgba(36, 31, 33, .35);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--sand-line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.modal-close:hover { border-color: var(--rosewood); color: var(--rosewood); }

.modal-box h2 {
  margin: 0 0 18px;
  font-family: "Alegreya", Georgia, serif;
  font-weight: 600;
  font-size: 23px;
  line-height: 1.25;
}

.tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.tabs .tab {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--sand-line);
  background: var(--linen);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  font-family: "Golos Text", sans-serif;
  text-align: center;
  transition: border-color .15s;
}
.tabs .tab.active { background: var(--rosewood); border-color: var(--rosewood); color: var(--card); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
/* размеры и цены: 3 связанных поля в один ряд (нужна ширина — nested grid внутри
   .full-ячейки внешнего form-grid, а не переход всей формы на 3 колонки) */
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* чекбокс «показывать публично» и панель аккаунта (Фаза 2) */
label.field.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  text-transform: none;
  font-size: 13px;
}
label.field.checkbox-field input { width: auto; }
.account-panel .muted { color: var(--ink-soft); font-size: 13px; text-transform: none; letter-spacing: 0; }
.share-link-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.share-link-row input {
  flex: 1;
  min-width: 200px;
  padding: 8px 10px;
  border: 1px solid var(--sand-line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font-family: "Golos Text", sans-serif;
}
/* Блок «Мой план» (Фаза 12, FR-12.4) */
.plan-block { display: flex; flex-direction: column; gap: 6px; }
.plan-badge {
  align-self: flex-start; padding: 2px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
}
.plan-badge.free { background: var(--bg-alt); color: var(--ink-soft); border: 1px solid var(--sand-line); }
.plan-badge.premium { background: var(--rosewood); color: var(--card); }
.plan-badge.demo { background: var(--bg-alt); color: var(--ink-soft); border: 1px dashed var(--sand-line); }
.plan-usage {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 2px 10px; font-size: 13.5px; color: var(--ink);
}
.plan-usage .plan-unlimited { color: var(--rosewood-ink); font-weight: 600; }
.plan-bar {
  grid-column: 1 / -1; height: 6px; border-radius: 999px;
  background: var(--bg-alt); overflow: hidden; margin-bottom: 4px;
}
.plan-bar i { display: block; height: 100%; background: var(--rosewood); border-radius: 999px; }
.plan-bar i.full { background: var(--rosewood-ink); }
.backup-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.checkbox-inline {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-soft); font-family: "Golos Text", sans-serif;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-family: "Golos Text", sans-serif;
}
label.field input, label.field select, label.field textarea {
  padding: 9px 11px;
  border: 1px solid var(--sand-line);
  border-radius: 8px;
  font-size: 14px;
  font-family: "Golos Text", sans-serif;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  background: var(--card);
}
label.field input:focus, label.field select:focus, label.field textarea:focus {
  outline: none;
  border-color: var(--rosewood);
}
label.field textarea { resize: vertical; min-height: 64px; }
label.field textarea.tall { min-height: 220px; }

.drop-zone {
  border: 1.5px dashed var(--sand-line);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-family: "Golos Text", sans-serif;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop-zone.dragover { border-color: var(--rosewood); background: var(--linen); }

/* ---------- кадрирование фото ---------- */

.crop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(36, 31, 33, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 150;
}
.crop-overlay-box {
  background: var(--card);
  border-radius: 14px;
  padding: 22px;
  max-width: 640px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(36, 31, 33, .4);
}

.crop-hint {
  font-family: "Golos Text", sans-serif;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.crop-stage {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 4px;
  line-height: 0;
}
.crop-stage img {
  display: block;
  max-width: 100%;
  max-height: 56vh;
  border-radius: 6px;
  user-select: none;
  -webkit-user-drag: none;
}
.crop-rect {
  position: absolute;
  border: 1.5px dashed var(--rosewood);
  box-shadow: 0 0 0 9999px rgba(36, 31, 33, .55);
  cursor: move;
  touch-action: none;
}
.crop-handle {
  position: absolute;
  width: 15px;
  height: 15px;
  background: var(--rosewood);
  border: 2px solid var(--card);
  border-radius: 50%;
  touch-action: none;
}
.crop-handle[data-h="nw"] { left: -8px; top: -8px; cursor: nwse-resize; }
.crop-handle[data-h="ne"] { right: -8px; top: -8px; cursor: nesw-resize; }
.crop-handle[data-h="sw"] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.crop-handle[data-h="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }

.photo-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 8px; }
.thumb {
  position: relative;
  width: 92px;
  height: 118px;
  border-radius: 8px;
  background: var(--sand) center / cover no-repeat;
  border: 2px solid transparent;
}
.thumb.main { border-color: var(--rosewood); }
.thumb .badge {
  position: absolute; left: 4px; top: 4px;
  background: var(--rosewood); color: var(--card);
  font-family: "Golos Text", sans-serif;
  font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 6px;
}
.thumb .actions {
  position: absolute; right: 4px; top: 4px;
  display: flex; gap: 3px;
}
.thumb .actions button {
  border: none; border-radius: 6px; width: 22px; height: 22px;
  cursor: pointer; font-size: 12px;
  background: rgba(253, 251, 248, .92);
  color: var(--ink);
}

.warnings { margin: 10px 0; }
.warning {
  background: var(--linen);
  border: 1px solid var(--sand-line);
  color: var(--rosewood-ink);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: "Golos Text", sans-serif;
  margin-bottom: 6px;
}

.section-label {
  font-family: "Golos Text", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--rosewood-ink);
  margin: 20px 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.section-label .sprig-mini { width: 19px; height: auto; color: var(--sage); opacity: .85; flex: none; }
.section-label .line { flex: 1; border-top: 1.5px dashed var(--sand-line); }

.new-tag-row { display: flex; gap: 8px; margin-top: 8px; }
.new-tag-row input {
  flex: 1; padding: 8px 11px; border: 1px solid var(--sand-line); border-radius: 8px;
  font-size: 13.5px; font-family: "Golos Text", sans-serif; background: var(--card); color: var(--ink);
}
.new-tag-row select {
  padding: 8px; border: 1px solid var(--sand-line); border-radius: 8px;
  font-size: 13.5px; font-family: "Golos Text", sans-serif; background: var(--card); color: var(--ink);
}

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-actions .left { margin-right: auto; }

.spinner {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid rgba(253,251,248,.4);
  border-top-color: var(--card);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -3px;
  margin-right: 7px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- карточка вещи (просмотр) ---------- */

.detail { display: grid; grid-template-columns: 260px 1fr; gap: 22px; }
.detail .gallery .main-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  background: var(--sand) center / contain no-repeat;
  cursor: zoom-in;
}
.detail .gallery .thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.detail .gallery .thumbs div {
  width: 46px; height: 58px; border-radius: 6px;
  background: var(--sand) center / cover no-repeat;
  cursor: pointer; border: 2px solid transparent;
}
.detail .gallery .thumbs div.sel { border-color: var(--rosewood); }
.detail .detail-tags { margin-bottom: 14px; }
/* ИИ-описание — короткая «шапка» карточки, первое, что видит пользователь */
.detail .detail-lead {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 16px;
  background: var(--bg-alt);
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid var(--rosewood);
}
.detail .detail-price {
  margin-top: 16px;
  font-family: "Golos Text", sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 19px;
}
.detail .detail-price s { color: var(--ink-soft); font-size: 14px; margin-right: 8px; }
.detail .detail-price b { color: var(--rosewood-ink); font-weight: 700; }
.detail .detail-price b:only-child { color: var(--ink); }
.detail dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 13.5px; font-family: "Golos Text", sans-serif; }
.detail dt { color: var(--ink-soft); font-weight: 600; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.detail dd { margin: 0; }

/* «Развернуть / Свернуть» — расширенная карточка (Sizes / Purchase / Description) */
.detail .detail-toggle {
  border: none;
  background: none;
  padding: 13px 0 2px;
  color: var(--rosewood-ink);
  font-family: "Golos Text", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.detail .detail-toggle::before { content: "▸"; font-size: 9px; }
.detail .detail-toggle[aria-expanded="true"]::before { content: "▾"; }
.detail .detail-toggle:hover { color: var(--rosewood); }
.detail #detailExtra { margin-top: 4px; }
.detail .desc {
  font-size: 13.5px;
  font-family: "Golos Text", sans-serif;
  color: var(--ink);
  margin-top: 10px;
  line-height: 1.55;
  white-space: pre-line;
}

@media (max-width: 640px) {
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .detail { grid-template-columns: 1fr; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}

/* ---------- лайтбокс: фото в оригинальном качестве, во весь экран ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 18, .94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 200;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(253, 251, 248, .14);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .15s;
}
.lightbox-close:hover { background: rgba(253, 251, 248, .28); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: rgba(253, 251, 248, .14);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .15s;
}
.lightbox-nav:hover { background: rgba(253, 251, 248, .28); }
.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }

/* AI Stylist */
.looks-view { max-width: 800px; margin: 0 auto; padding: 20px 0; }
.looks-form { display: flex; flex-direction: column; gap: 16px; background: var(--bg-alt); padding: 24px; border-radius: 12px; margin-bottom: 24px; }
.looks-result { display: flex; flex-direction: column; gap: 20px; }
.look-rationale { padding: 16px; border-left: 4px solid var(--sage); background: var(--bg-alt); border-radius: 4px 12px 12px 4px; }
.look-occasion { padding: 16px; border-left: 4px solid var(--rosewood); background: var(--bg-alt); border-radius: 4px 12px 12px 4px; font-weight: 500; }
.look-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.look-item { display: flex; flex-direction: column; gap: 8px; }
.look-item.suggested { border: 2px dashed var(--sand-line); padding: 12px; border-radius: 8px; opacity: 0.9; text-align: center; justify-content: center; min-height: 180px; }
.look-item.suggested .item-desc { font-style: italic; color: var(--text-muted); }
/* ---------- My Look (Фаза 5) ---------- */
.saved-looks-head { max-width: 1200px; margin: 0 auto; padding: 4px 24px; font-family: "Alegreya", serif; font-size: 18px; color: var(--ink); }
.looks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; max-width: 1200px; margin: 0 auto; padding: 4px 24px 20px; }
.look-card { background: var(--card); border: 1px solid var(--sand-line); border-radius: var(--radius); overflow: hidden; cursor: pointer; padding-bottom: 10px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.look-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--rosewood); }
.look-collage { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1; gap: 1px; background: var(--sand-line); }
/* образ с AI-визуализацией (Look.visual_photo) — одна картинка вместо коллажа
   из фото отдельных вещей (см. renderSavedLooks) */
.look-collage.single { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.look-collage-cell { background: var(--sand) center / cover no-repeat; }
.look-card-name { padding: 8px 12px 4px; font-weight: 700; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.look-card-name > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.look-card .tag-row { padding: 0 12px; }

/* фильтр образов по тэгам (FR-5.17) */
.looks-tag-filter { max-width: 1200px; margin: 0 auto; padding: 2px 24px 8px; }

/* креативное имя образа от ИИ (FR-5.20) */
.look-ai-name { font-family: "Alegreya", serif; font-size: 22px; font-weight: 600; color: var(--rosewood-ink); margin: 4px 0 8px; }

/* оценка стилиста (FR-5.21) */
.look-critique { margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: var(--bg-alt); }
.crit-verdict { font-weight: 700; margin-bottom: 6px; }
.crit-verdict.yes { color: var(--sage); }
.crit-verdict.no { color: var(--rosewood); }
.crit-why { font-size: 13.5px; line-height: 1.5; color: var(--ink); margin-bottom: 10px; white-space: pre-line; }

/* раскладка «силуэтом» (FR-5.13) */
.silhouette { display: grid; grid-template-columns: 1fr auto; gap: 14px; margin: 6px 0 14px; align-items: start; }
.sil-main { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.sil-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.sil-side { display: flex; flex-direction: column; gap: 10px; }
.sil-item { position: relative; cursor: pointer; }
.sil-photo { width: 96px; height: 96px; border-radius: 10px; background: var(--sand) center / cover no-repeat; border: 1px solid var(--sand-line); }
.sil-side .sil-photo { width: 60px; height: 60px; }
.sil-item:hover .sil-photo { border-color: var(--rosewood); }
.wl-flag { position: absolute; top: -6px; right: -6px; font-size: 13px; }
.sil-remove {
  position: absolute; top: -6px; left: -6px; width: 20px; height: 20px;
  border-radius: 50%; border: 1px solid var(--sand-line); background: var(--card);
  color: var(--ink-soft); font-size: 11px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.sil-remove:hover { color: var(--rosewood); border-color: var(--rosewood); }
/* конфликт слота (FR-5.22): янтарная подсветка дублей + кнопка «оставить эту» */
.sil-item.conflict .sil-photo { border-color: #d97706; box-shadow: 0 0 0 2px rgba(217, 119, 6, .35); }
.sil-keep {
  position: absolute; bottom: -6px; right: -6px; width: 20px; height: 20px;
  border-radius: 50%; border: 1px solid #6b8f5e; background: var(--card);
  color: #6b8f5e; font-size: 11px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.sil-keep:hover { background: #6b8f5e; color: var(--card); }
.look-visual { margin-top: 10px; }
.look-visual img { max-width: 100%; border-radius: 10px; display: block; }

/* «в N образах ▸» в карточке вещи (FR-5.23): разворачиваемый список-переход */
.detail-rating { margin-bottom: 6px; }
.look-refs-toggle {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--ink-soft); font-size: 12.5px; font-family: "Golos Text", sans-serif;
  display: inline-flex; align-items: center; gap: 5px;
}
.look-refs-toggle::after { content: "▸"; font-size: 9px; }
.look-refs-toggle[aria-expanded="true"]::after { content: "▾"; }
.look-refs-toggle:hover { color: var(--rosewood); }
.look-refs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.look-ref {
  border: 1px solid var(--sand-line); border-radius: 999px; background: var(--card);
  padding: 4px 12px; font-size: 12px; font-family: "Golos Text", sans-serif;
  color: var(--ink); cursor: pointer;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.look-ref:hover { border-color: var(--rosewood); color: var(--rosewood); }

