/* Qmetra — v3 prototype. Собственное визуальное решение: тёплая, «витринная» подача
   объекта недвижимости вместо холодной CRM-админки. */

.valuation-block { margin-top: 20px; }
.valuation-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.valuation-form-grid label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.valuation-form-grid input, .valuation-form-grid select { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.valuation-form-grid input:focus, .valuation-form-grid select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-valuation-form][hidden] { display: none; }
[data-valuation-form] + [data-valuation-message], [data-valuation-prepare] { margin-bottom: 12px; }
.valuation-prices { display: flex; flex-wrap: wrap; gap: 24px; margin: 20px 0; }
.valuation-prices > div { display: grid; gap: 6px; }
.valuation-prices strong { font-size: 26px; }
.valuation-parameters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 12px; }
.valuation-parameters dd { margin: 4px 0 0; }
.valuation-parameters dt { color: var(--text-muted); }
.valuation-offer { padding: 16px 0; border-bottom: 1px solid var(--border); }
.valuation-offer:last-child { border-bottom: 0; }
.valuation-notice { color: var(--warning); }
.valuation-table-scroll { overflow-x: auto; margin-top: 12px; }
.valuation-table { width: 100%; border-collapse: collapse; text-align: left; }
.valuation-chart { margin: 20px 0; }
.valuation-chart svg { display: block; width: 100%; max-width: 780px; margin: 12px 0; }
.valuation-chart svg text { fill: var(--text-muted); font: 12px sans-serif; }
.valuation-table th, .valuation-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
@media (max-width: 600px) { .valuation-form-grid, .valuation-parameters { grid-template-columns: 1fr; } }

:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --surface-2: #f4ede2;
  --surface-3: #efe5d6;
  --surface-dark: #1c1816;
  --border: #e6dac6;
  --border-hover: #d3c1a0;
  --text: #2b2420;
  --text-muted: #8c8074;
  --accent: #b8542f;
  --accent-hover: #9c4526;
  --accent-soft: #f5dfce;
  --accent-soft-2: #fbeee2;
  --success: #3f7d5c;
  --success-soft: #dcefe1;
  --warning: #a9781f;
  --warning-soft: #f6ecd0;
  --info: #3f6a8f;
  --info-soft: #dfe9f2;
  --danger: #c0392b;
  --danger-soft: #fbe3e0;
  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(43, 36, 32, 0.09);
  --shadow: 0 3px 10px rgba(43, 36, 32, 0.13);
  --shadow-lg: 0 8px 20px rgba(43, 36, 32, 0.2);
  --font-display: "Space Grotesk", "Manrope", system-ui, -apple-system, sans-serif;
  --font: "Manrope", system-ui, -apple-system, sans-serif;
  --nav-h: 64px;
  /* Ориентировочная высота плавающей карточки режима поддержки (заголовок +
     фраза + padding) — нужна только для расчёта отступа .toast-viewport. */
  --impersonation-h: 110px;
  --max-w: 1180px;
  /* Правая колонка секций «Фото», «Объявление» и «Обзор» (эталон — «Фото»).
     Левая — 1fr, поэтому одна ширина aside выравнивает и контент. */
  --workspace-aside: 300px;

  /* Spacing scale — единая шкала отступов (padding/margin/gap) для всего проекта.
     Именование по значению в px: используем ближайший шаг шкалы вместо произвольных чисел. */
  --space-2: 2px;
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-28: 28px;
  --space-40: 40px;
  --space-56: 56px;
  --space-80: 80px;

  /* Кнопки — отдельная пропорциональная шкала по вертикальному паддингу (sm/base/lg) */
  --btn-py-sm: 7px;
  --btn-py: 11px;

  --radius-pill: 999px;
  --radius-circle: 50%;

  --transition-fast: 0.08s;
  --transition: 0.15s;
  --transition-slow: 0.2s;

  /* Type scale — единая шкала размеров шрифта. До этого в проекте было 37 разных
     значений с шагом ~0.02rem — округляем до ближайшего шага шкалы. */
  --fs-3xs: 0.625rem; /* ~10px — микро-глифы (чек-марки, крошечные значки) */
  --fs-2xs: 0.75rem; /* ~12px — бейджи, подписи, эйбраузы */
  --fs-sm: 0.9rem; /* ~14px — вторичный текст, форм-контролы, кнопки */
  --fs-base: 1rem; /* 16px — базовый текст */
  --fs-lg: 1.1rem; /* ~18px — заголовки карточек, h3 */
  --fs-xl: 1.25rem; /* 20px — некрупные h2 */
  --fs-2xl: 1.4rem; /* ~22px — h2 разделов */
  --fs-3xl: 1.6rem; /* ~26px — h1 мастера, крупные цены */
  --fs-4xl: 2rem; /* 32px — заголовки страниц (h1), крупные цифры */

  /* Насыщенность шрифта */
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-black: 800;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Браузерный синий outline заменён общим фирменным фокусом.
   Специальные состояния компонентов и полей определены ниже. */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  margin: 0;
}

::selection {
  background: var(--accent-soft);
}

/* ——— Режим поддержки (вход админа в ЛК пользователя) ———
   Плавающая карточка в правом нижнем углу, поверх контента, не сдвигает
   разметку страницы. Тёмная поверхность (--surface-dark, тот же приём, что
   у .ui-tooltip и вьювера фото-редактора) вместо яркого warning-фона —
   это рабочий инструмент для админа, а не праздничное уведомление. Радиус —
   как у карточек/модалок (--radius-lg), не пилюля. Тот же угол, что у
   .toast-viewport, поэтому при активном flash-тосте он сдвигается выше
   карточки (см. ниже). */

.impersonation-bar {
  position: fixed;
  right: var(--space-20);
  bottom: var(--space-20);
  z-index: 150;
  width: min(280px, calc(100vw - var(--space-40)));
}

.impersonation-bar__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-16);
  border-radius: var(--radius-lg);
  background: var(--surface-dark);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f4ede2;
  box-shadow: var(--shadow-lg);
}

.impersonation-bar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
}

.impersonation-bar__label {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #dba861;
}

.impersonation-bar__form {
  flex-shrink: 0;
  line-height: 0;
}

.impersonation-bar__exit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(244, 237, 226, 0.35);
  border-radius: var(--radius-sm);
  background: transparent;
  color: #f4ede2;
  cursor: pointer;
  transition: background var(--transition) ease, color var(--transition) ease, border-color var(--transition) ease;
}

.impersonation-bar__exit:hover {
  background: #f4ede2;
  border-color: #f4ede2;
  color: var(--surface-dark);
}

.impersonation-bar__text {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.impersonation-bar__email {
  display: block;
  color: rgba(244, 237, 226, 0.6);
}

/* Тост и карточка делят один угол — пока карточка на экране, поднимаем тост
   выше неё, чтобы они не перекрывались (--impersonation-h — приблизительная
   высота карточки + отступ). */
body.is-impersonating .toast-viewport {
  bottom: calc(var(--space-20) + var(--impersonation-h) + var(--space-12));
}

@media (max-width: 860px) {
  .impersonation-bar {
    right: var(--space-12);
    bottom: var(--space-12);
    left: var(--space-12);
    width: auto;
  }
}

/* ——— Top navigation ——— */

.topnav {
  position: relative;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(250, 246, 240, 0.88);
  backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

/* Auto-отступы у ссылок держат имя и меню аккаунта рядом справа. */
.topnav__inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-28);
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

.topnav__toggle {
  display: none;
}

/* На десктопе обёртка не должна участвовать в раскладке — её дети
   (topnav__links, topnav__user-meta) встают в общий flex-ряд topnav__inner
   так же, как до появления мобильной панели. */
.topnav__panel {
  display: contents;
}

.topnav__brand {
  display: flex;
  align-items: center;
  color: var(--text);
}

.topnav__logo {
  display: block;
  height: 45px;
  width: auto;
}

.topnav__links {
  display: flex;
  gap: var(--space-4);
  list-style: none;
  margin: 0 auto;
  padding: 0;
}

.topnav__link {
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  transition:
    background var(--transition),
    color var(--transition);
}

.topnav__link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.topnav__link.is-active {
  background: var(--text);
  color: var(--bg);
}

.topnav__icon {
  display: none;
}

.topnav__user-meta {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.topnav__user-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topnav__account {
  position: relative;
  flex-shrink: 0;
  justify-self: end;
}

.topnav__account-menu {
  position: absolute;
  top: calc(100% + var(--space-12));
  right: 0;
  width: min(220px, calc(100vw - var(--space-40)));
  padding: var(--space-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 110;
}

.topnav__account-menu[hidden] {
  display: none;
}

.topnav__account-menu form {
  margin: 0;
}

.topnav__account-item {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  width: 100%;
  min-height: 44px;
  padding: var(--space-12);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-size: var(--fs-sm);
  text-align: left;
  cursor: pointer;
}

.topnav__account-item:hover,
.topnav__account-item:focus-visible {
  background: var(--surface-2);
}

.topnav__account-item.is-active {
  background: var(--accent-soft-2);
  color: var(--accent-hover);
}

.topnav__account-item:focus-visible,
.topnav__avatar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.topnav__avatar {
  overflow: hidden;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-circle);
  background: var(--surface-3);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  border: 1px solid var(--border);
  flex-shrink: 0;
  padding: 0;
  cursor: pointer;
}

.topnav__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topnav__avatar:hover,
.topnav__avatar[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent-soft-2);
}

@media (max-width: 860px) {
  .topnav__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 var(--space-16);
  }

  /* Кнопка-гамбургер без рамки: рамка вокруг иконки читается устаревшим,
     достаточно подсветки-подложки при нажатии (2026-08-18). */
  .topnav__toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    justify-self: start;
    gap: 5px;
    width: 40px;
    height: 40px;
    margin-left: calc(-1 * var(--space-8));
    padding: 0;
    border: 0;
    border-radius: var(--radius-circle);
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition);
  }

  .topnav__toggle:hover,
  .topnav.is-open .topnav__toggle {
    background: var(--surface-3);
  }

  .topnav__toggle span {
    display: block;
    width: 19px;
    height: 2px;
    border-radius: var(--radius-pill);
    background: var(--text);
    transition:
      transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
      opacity var(--transition) ease;
  }

  .topnav.is-open .topnav__toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .topnav.is-open .topnav__toggle span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0.4);
  }

  .topnav.is-open .topnav__toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .topnav__brand {
    justify-self: center;
  }

  .topnav__avatar {
    width: 40px;
    height: 40px;
  }

  /* Меню — не плита во всю ширину под хэдером, а плавающая карточка с отбивкой
     от краёв: так оно читается как всплывающее меню, а не как «раскрытая шапка»
     (2026-08-18).
     position:absolute считается от .topnav (position:relative), а не от
     .topnav__inner — у inner высота меньше высоты хэдера (из-за вертикального
     центрирования), а горизонтальных отступов у .topnav нет вовсе. */
  .topnav__panel {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: calc(100% + var(--space-8));
    left: var(--space-12);
    right: var(--space-12);
    padding: var(--space-8);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - var(--nav-h) - var(--space-24));
    max-height: calc(100dvh - var(--nav-h) - var(--space-24));
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top left;
    transition:
      opacity var(--transition-slow) ease,
      transform 0.26s cubic-bezier(0.16, 1, 0.3, 1),
      visibility var(--transition-slow);
  }

  .topnav.is-open .topnav__panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .topnav__links {
    flex-direction: column;
    gap: var(--space-2);
    /* В карточке-меню список занимает всю ширину — auto-отступы десктопной
       раскладки здесь сжали бы пункты по контенту. */
    margin: 0;
  }

  .topnav__link {
    display: flex;
    align-items: center;
    gap: var(--space-12);
    border-radius: var(--radius);
    padding: var(--space-12) var(--space-12);
    min-height: 46px;
    color: var(--text);
    font-size: var(--fs-sm);
  }

  .topnav__link:active {
    background: var(--surface-3);
  }

  /* Активный пункт — тот же тёмный «залив», что и на десктопе: акцент на
     акценте (терракота на бежевом) давал контраст ~4:1 и выглядел выцветшим. */
  .topnav__link.is-active {
    background: var(--text);
    color: var(--bg);
  }

  .topnav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    font-size: 1.05rem;
    flex-shrink: 0;
    color: var(--text-muted);
  }

  .topnav__link .topnav__icon {
    color: inherit;
  }

  /* Личные действия находятся в отдельном меню аватара. */
  .topnav__user-meta {
    display: none;
  }

  .topnav__overlay {
    position: fixed;
    inset: 0;
    /* Выше .subnav (90), ниже шапки и карточки меню (100):
       иначе вкладки карточки объекта рисуются поверх затемнения. */
    z-index: 95;
    background: rgba(43, 36, 32, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow) ease;
  }

  .topnav.is-open ~ .topnav__overlay {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
  .topnav__panel,
  .topnav__toggle span {
    transition: none;
  }

  .topnav__panel {
    transform: none;
  }
}

/* ——— Layout ——— */

.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-40) var(--space-28) var(--space-80);
}

.verify-banner {
  background: var(--warning-soft);
  border-bottom: 1px solid rgba(169, 120, 31, 0.22);
}

.verify-banner__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-16) var(--space-28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
}

.verify-banner__content {
  min-width: 0;
}

.verify-banner__title {
  margin: 0 0 var(--space-8);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--text);
}

.verify-banner__text {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text);
}

.verify-banner__text + .verify-banner__text {
  margin-top: var(--space-8);
}

.verify-banner__email {
  font-weight: var(--fw-bold);
  overflow-wrap: anywhere;
}

.verify-banner__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-8);
  flex-shrink: 0;
}

.verify-banner__profile {
  font-size: var(--fs-sm);
  text-decoration: underline;
}

.verify-banner__status {
  margin: var(--space-8) 0 0;
  font-weight: var(--fw-bold);
}

.verify-banner:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.verify-banner__form {
  margin: 0;
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .verify-banner__inner {
    flex-direction: column;
    align-items: flex-start;
    padding-left: var(--space-16);
    padding-right: var(--space-16);
  }
}

@media (max-width: 860px) {
  /* Боковые поля — как у .topnav__inner: на узком экране 28px съедали
     ширину галереи и карточек, а край контента расходился с шапкой. */
  .page {
    padding-left: var(--space-16);
    padding-right: var(--space-16);
  }
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-20);
  margin-bottom: var(--space-28);
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-8);
}

.page-header h1:last-child {
  margin-bottom: 0;
}

.page-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-base);
  max-width: 50ch;
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

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

.text-link {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  border-bottom: 1px dashed var(--border);
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  padding: 0 0 1px;
}

.text-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ——— Buttons ——— */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--btn-py) var(--space-20);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  transition:
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(184, 84, 47, 0.38);
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  padding: var(--space-8) var(--space-16);
}

.btn--ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn--lg {
  padding: var(--space-16) var(--space-28);
  font-size: var(--fs-base);
}

.btn--sm {
  padding: var(--btn-py-sm) var(--space-16);
  font-size: var(--fs-2xs);
}

.btn--block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ——— Filter chips ——— */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  margin-bottom: var(--space-24);
}

.chip {
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    color var(--transition-fast),
    background var(--transition-fast);
}

.chip:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.chip.is-active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

/* ——— Object showcase cards ——— */

.showcase-page { font-family: var(--font); }
.showcase-page :is(h1, h2) { font-family: var(--font); }
.showcase-header { align-items: center; margin-bottom: var(--space-24); }
.showcase-header__title { display: flex; align-items: baseline; gap: var(--space-12); min-width: 0; }
.showcase-header h1 { margin: 0; color: var(--text); font-size: var(--fs-4xl); font-weight: var(--fw-black); letter-spacing: -0.035em; line-height: 1.15; }
.showcase-header__count { color: #73675d; font-size: var(--fs-xl); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.showcase-header .btn,
.showcase-page .empty-state .btn--primary { min-width: 232px; min-height: 56px; gap: var(--space-12); padding: var(--space-16) var(--space-28); border-radius: var(--radius); font-size: var(--fs-base); font-weight: var(--fw-bold); line-height: 1.25; }
.showcase-header .btn--primary,
.showcase-page .empty-state .btn--primary { box-shadow: 0 4px 12px rgba(184, 84, 47, 0.2); }
.showcase-limit-notice { margin-bottom: var(--space-24); }
.showcase-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-12); margin-bottom: var(--space-28); }
.showcase-filters { display: flex; gap: var(--space-4); width: fit-content; max-width: 100%; overflow-x: auto; padding: var(--space-4); border-radius: var(--radius); background: var(--surface-2); }
.showcase-archive { margin-left: auto; gap: var(--space-8); }
.showcase-archive.showcase-archive--mobile { display: none; }
.showcase-archive__count { font-variant-numeric: tabular-nums; opacity: 0.7; }
.showcase-filter { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-height: 44px; padding: var(--space-8) var(--space-16); border-radius: var(--radius-sm); color: #73675d; font-size: var(--fs-sm); font-weight: var(--fw-semibold); white-space: nowrap; transition: color var(--transition), background var(--transition); }
.showcase-filter:hover { background: var(--surface); color: var(--text); }
.showcase-filter.is-active { background: var(--text); color: var(--surface); }
.showcase-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.showcase-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-24); }
.showcase-card { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--surface); color: var(--text); border: 0; border-radius: var(--radius-lg); box-shadow: none; overflow: hidden; text-decoration: none; }
.showcase-card__link { display: flex; flex-direction: column; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.showcase-card__link:hover { color: inherit; }
.showcase-card__link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: inherit; }
.showcase-card__actions { position: absolute; top: var(--space-12); right: var(--space-12); z-index: 2; }
.showcase-card__menu-toggle { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.96); color: var(--text); cursor: pointer; box-shadow: 0 2px 8px rgba(43, 36, 32, 0.12); }
.showcase-card__menu-toggle:hover,
.showcase-card__menu-toggle[aria-expanded="true"] { background: var(--surface-2); }
.showcase-card__menu { position: absolute; top: calc(100% + 6px); right: 0; width: 232px; max-width: calc(100vw - 80px); padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.showcase-card__menu[hidden] { display: none; }
.showcase-card__menu-item { display: flex; align-items: center; gap: var(--space-8); width: 100%; min-height: 44px; padding: var(--space-8) var(--space-12); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; }
.showcase-card__menu-item .ui-icon { flex-shrink: 0; }
.showcase-card__menu-item:hover,
.showcase-card__menu-item:focus-visible { background: var(--surface-2); }
.showcase-card__menu-item--danger { color: var(--danger); }
.modal.modal--property-rename { max-width: 440px; }
.modal--property-rename .field-error { margin: var(--space-12) 0 0; color: var(--danger); font-size: var(--fs-sm); }
.modal--property-rename .modal__footer { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.showcase-card:hover { color: var(--text); }
.showcase-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.showcase-card__photo { aspect-ratio: 4 / 3; background: var(--surface-2); position: relative; overflow: hidden; }
.showcase-card__photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition) ease, filter var(--transition) ease; }
.showcase-card__link:is(:hover, :focus-visible) .showcase-card__photo img { transform: scale(1.025); filter: brightness(0.96); }
.showcase-card__photo-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-12); height: 100%; color: #73675d; font-size: var(--fs-sm); }
.showcase-card__photo-empty .ui-icon { width: 40px; height: 40px; opacity: 0.6; }
.showcase-card__pill { position: absolute; top: var(--space-12); left: var(--space-12); padding: var(--space-4) var(--space-12); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.92); color: var(--text); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); backdrop-filter: blur(6px); }
.showcase-card__photo-count { position: absolute; right: var(--space-12); bottom: var(--space-12); display: inline-flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-8); border-radius: var(--radius-sm); background: rgba(43, 36, 32, 0.72); color: var(--surface); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.showcase-card__photo-count .ui-icon { width: 16px; height: 16px; }
.showcase-card__body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: var(--space-20); }
.showcase-card__title { margin: 0; color: var(--text); font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -0.025em; line-height: 1.3; overflow-wrap: anywhere; transition: color var(--transition); }
.showcase-card__link:is(:hover, :focus-visible) .showcase-card__title { color: var(--accent-hover); }
.showcase-card__address { margin: var(--space-8) 0 0; color: #73675d; font-size: var(--fs-sm); line-height: 1.65; overflow-wrap: anywhere; }
.showcase-card__facts { margin-top: var(--space-20); }
.showcase-card__price { margin: 0; color: var(--text); font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: -0.02em; line-height: 1.4; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.showcase-card__price.is-empty { color: #73675d; font-size: var(--fs-sm); font-weight: 400; letter-spacing: 0; }
.showcase-card__meta { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-12); margin-top: var(--space-8); color: #73675d; font-size: var(--fs-sm); line-height: 1.6; }
.showcase-card__meta > span { overflow-wrap: anywhere; }
.showcase-card__footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-8) var(--space-12); margin-top: auto; padding-top: var(--space-24); color: #73675d; font-size: var(--fs-2xs); line-height: 1.6; }
.showcase-card__status { display: inline-flex; align-items: center; gap: var(--space-8); }
.showcase-card__status .dot { flex-shrink: 0; margin: 0; }
.showcase-card__footer time { margin-left: auto; }
.showcase-page .empty-state { padding: var(--space-56) var(--space-28); border: 0; border-radius: var(--radius-lg); background: var(--surface); }
.showcase-page .empty-state h2 { color: var(--text); font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -0.025em; line-height: 1.3; }
.showcase-page .empty-state > p { color: #73675d; font-size: var(--fs-base); line-height: 1.65; }
.showcase-page .empty-state .btn--secondary { min-height: 44px; font-size: var(--fs-sm); }
@media (max-width: 1000px) {
  .showcase-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .showcase-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-20) var(--space-8); }
  .showcase-header__title { gap: var(--space-8); }
  .showcase-header h1 { font-size: var(--fs-3xl); }
  .showcase-header__title h1 { min-width: 0; overflow-wrap: anywhere; }
  .showcase-header__count { flex-shrink: 0; }
  .showcase-archive.showcase-archive--mobile { display: inline-flex; margin-left: 0; gap: var(--space-4); padding-inline: var(--space-8); }
  .showcase-archive--desktop { display: none; }
  .showcase-header .page-header__actions { grid-column: 1 / -1; }
  .showcase-header .page-header__actions,
  .showcase-header .btn { width: 100%; }
  .showcase-header .btn,
  .showcase-page .empty-state .btn { min-width: 0; white-space: normal; }
  .showcase-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; overflow: visible; }
  .showcase-filters .showcase-filter { min-width: 0; padding-inline: var(--space-4); white-space: normal; text-align: center; }
  .showcase-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-20); }
  .showcase-card__body { padding: var(--space-16); }
  .showcase-page .empty-state { padding: var(--space-40) var(--space-16); }
}
@media (prefers-reduced-motion: reduce) {
  .showcase-card__photo img,
  .showcase-card__title,
  .showcase-filter { transition: none; }
  .showcase-card__link:is(:hover, :focus-visible) .showcase-card__photo img { transform: none; }
}

/* ——— Status dots (inline in pills) ——— */

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-circle);
  margin-right: var(--space-4);
  vertical-align: middle;
}

.dot--draft {
  background: var(--text-muted);
}
.dot--ready {
  background: var(--success);
}
.dot--exported {
  background: var(--info);
}

/* ——— Empty state ——— */

.empty-state {
  text-align: center;
  padding: var(--space-80) var(--space-24);
  max-width: 460px;
  margin: var(--space-20) auto;
}

.empty-state__art {
  width: 88px;
  height: 88px;
  margin: 0 auto var(--space-24);
  background: var(--accent-soft-2);
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  color: var(--accent-hover);
}

.empty-state__art .ui-icon {
  width: 40px;
  height: 40px;
}

.empty-state h2 {
  font-size: var(--fs-3xl);
  margin-bottom: var(--space-12);
}

.empty-state p {
  margin: 0 0 var(--space-28);
  color: var(--text-muted);
  font-size: var(--fs-base);
}

.hidden {
  display: none !important;
}

/* ——— Wizard (full-screen takeover) ——— */

.wizard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.wizard__topbar {
  display: flex;
  padding: var(--space-20) 0;
}

.wizard__topbar-inner {
  position: relative;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-28);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wizard__title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-base);
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .wizard__title {
    display: none;
  }
}

.wizard__brand {
  display: flex;
  align-items: center;
}

.wizard__logo {
  display: block;
  height: 45px;
  width: auto;
}

.wizard__close {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: var(--fs-lg);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  transition: all var(--transition);
}

.wizard__close:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.wizard__stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
  padding: var(--space-8) 0 var(--space-28);
}

.wizard__step {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}

.wizard__step-num {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-circle);
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  font-size: var(--fs-2xs);
  transition: all var(--transition-slow);
}

.wizard__step.is-active {
  color: var(--text);
}

.wizard__step.is-active .wizard__step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.wizard__step.is-done .wizard__step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.wizard__step-line {
  width: 48px;
  height: 1.5px;
  background: var(--border);
}

.wizard__body {
  flex: 1;
  padding: var(--space-12) var(--space-24) var(--space-40);
}

.wizard__form {
  max-width: 560px;
  margin: 0 auto;
}

.wizard__heading {
  text-align: center;
  margin-bottom: var(--space-28);
}

.wizard__heading h1 {
  font-size: var(--fs-3xl);
  margin-bottom: var(--space-8);
}

.wizard__heading h1:last-child {
  margin-bottom: 0;
}

.wizard__heading p {
  margin: 0;
  color: var(--text-muted);
}

.wizard__footer {
  padding: var(--space-24) var(--space-28);
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  justify-content: center;
  gap: var(--space-12);
}

.wizard__footer-inner {
  max-width: 560px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: var(--space-12);
}

/* ——— Form elements ——— */

.form-group {
  margin-bottom: var(--space-24);
}

.form-group label {
  display: block;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-8);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--space-16);
}

.form-row--35-65 {
  grid-template-columns: 35fr 65fr;
}

@media (max-width: 560px) {
  .form-row,
  .form-row--35-65 {
    grid-template-columns: 1fr;
  }
}

.form-input,
.form-select {
  width: 100%;
  padding: var(--space-12) var(--space-16);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft-2);
}

.ui-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-16);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: var(--fw-bold);
  transition: all var(--transition);
  background: var(--surface);
}

.segmented input:checked + label {
  border-color: var(--accent);
  background: var(--accent-soft-2);
  color: var(--accent-hover);
}

/* ——— Drop zone ——— */

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: var(--space-56) var(--space-24);
  text-align: center;
  cursor: pointer;
  transition:
    border-color var(--transition-slow),
    background var(--transition-slow);
  background: var(--surface);
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft-2);
}

.dropzone__icon {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  margin-bottom: var(--space-16);
}

.dropzone__icon .ui-icon {
  width: 32px;
  height: 32px;
}

.dropzone p {
  margin: 0 0 var(--space-4);
  font-weight: var(--fw-bold);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
}

.dropzone span {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: var(--space-12);
  margin-top: var(--space-20);
}

.photo-preview {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  background: var(--surface-2);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview__status {
  position: absolute;
  bottom: 5px;
  left: 5px;
  right: 5px;
  background: rgba(43, 36, 32, 0.72);
  color: white;
  font-size: var(--fs-3xs);
  font-weight: var(--fw-semibold);
  padding: var(--space-2) var(--space-8);
  border-radius: var(--radius-sm);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-preview__remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-circle);
  background: rgba(43, 36, 32, 0.8);
  color: white;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.photo-preview__remove:hover {
  background: var(--accent);
}

.photo-preview__remove:focus-visible {
  outline: 2px solid white;
  outline-offset: -4px;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: var(--radius-circle);
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ——— Object workspace ——— */

.property-workspace-header {
  position: relative;
  background: transparent;
  border: 0;
  border-radius: var(--radius-lg);
}

.property-workspace-header > .workspace-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.workspace-hero {
  display: grid;
  gap: var(--space-16);
  padding: var(--space-24);
}

.workspace-hero__intro { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: var(--space-24); }
.workspace-hero__intro.has-cover { grid-template-columns: 160px minmax(0, 1fr); }
.workspace-hero__cover { position: relative; display: block; width: 100%; min-height: 160px; overflow: hidden; border: 0; border-radius: var(--radius); }
.workspace-hero__cover[hidden] { display: none; }
.workspace-hero__cover img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition) ease, filter var(--transition) ease; }
.workspace-hero__cover:is(:hover, :focus-visible) img { transform: scale(1.035); filter: brightness(0.94); }
.workspace-hero__cover:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .workspace-hero__cover img { transition: none; }
  .workspace-hero__cover:is(:hover, :focus-visible) img { transform: none; }
}
.workspace-hero__identity { display: grid; gap: var(--space-16); min-width: 0; }
.workspace-hero__heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-8) var(--space-24); flex-wrap: wrap; min-width: 0; }
.workspace-hero__title-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-8) var(--space-12); min-width: 0; }
.workspace-hero__title-row h1 { min-width: 0; }
.workspace-hero__title-row .tag { flex-shrink: 0; }
.workspace-hero__updated { flex-shrink: 0; margin-left: auto; font-size: var(--fs-2xs); }
.workspace-hero__address { display: grid; grid-template-columns: 20px minmax(0, 1fr) max-content; align-items: start; gap: var(--space-8) var(--space-12); min-width: 0; margin: 0; font-size: var(--fs-base); line-height: 1.5; }
.workspace-hero__address > .ui-icon { margin-top: 10px; }
.workspace-hero__address-copy { min-width: 0; padding: var(--space-8) 0; overflow-wrap: anywhere; }
.workspace-hero__address-copy [data-property-city] { margin-left: var(--space-12); }
.workspace-hero__address-copy [hidden] { display: none; }
.workspace-hero__address-edit { min-height: 40px; color: var(--accent-hover); }

/* Единый формат характеристик: подпись над значением, включая цену. */
.property-facts {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr));
  gap: var(--space-16) var(--space-24);
  margin: 0;
  padding-top: var(--space-16);
  border-top: 1px solid var(--border);
}
.property-facts__item { min-width: 0; }
.property-facts dt { margin-bottom: var(--space-4); color: var(--text-muted); font-size: var(--fs-2xs); }
.property-facts__value { margin: 0; color: var(--text); font-size: var(--fs-lg); font-weight: var(--fw-semibold); line-height: 1.4; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.property-facts__value.is-empty { color: var(--text-muted); }

.property-workspace-header .object-flow {
  margin-top: 0;
  border: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}

.workspace-hero h1 {
  font-family: var(--font);
  font-size: var(--fs-4xl);
  font-weight: var(--fw-black);
  letter-spacing: -0.035em;
  margin: 0;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .workspace-hero { padding: var(--space-16); }
  .workspace-hero__intro { gap: var(--space-12); }
  .workspace-hero__intro.has-cover { grid-template-columns: 80px minmax(0, 1fr); }
  .workspace-hero__cover { align-self: start; min-height: 80px; height: 80px; }
  .workspace-hero__identity { display: contents; }
  .workspace-hero__intro.has-cover .workspace-hero__heading { grid-column: 2; }
  .workspace-hero__address,
  .property-facts { grid-column: 1 / -1; }
  .workspace-hero__address { grid-template-columns: 20px minmax(0, 1fr); }
  .workspace-hero__address > .ui-icon { margin-top: 2px; }
  .workspace-hero__address-copy { padding: 0; }
  .workspace-hero__address-edit { grid-column: 2; justify-self: start; }
  .property-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .workspace-hero__intro.has-cover { grid-template-columns: 72px minmax(0, 1fr); gap: var(--space-12); }
  .workspace-hero__cover { min-height: 72px; height: 72px; }
  .workspace-hero h1 { font-size: var(--fs-3xl); }
}

.workspace-hero__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-16);
}

.workspace-hero__back:hover {
  color: var(--accent);
}

.workspace-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-pill);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
}

.tag--draft {
  background: var(--surface-3);
  color: var(--text-muted);
}
.tag--ready {
  background: var(--success-soft);
  color: var(--success);
}
.tag--exported {
  background: var(--info-soft);
  color: var(--info);
}
.tag--neutral {
  background: var(--surface-2);
  color: var(--text-muted);
}

/* Пилюли-факты в шапке карточки объекта (тип сделки, площадь/этаж/фото,
   дата обновления) — тот же нейтральный смысл (не статус, не требует
   реакции), но контрастнее и в тон бренду, а не блёкло-серые, раз это
   самый заметный ряд на странице (2026-08-11, см.
   Docs/10-object-card-ui-ux.md §2.8). */
.workspace-hero__tags .tag--neutral,
.workspace-hero__title-row .tag--neutral {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.tag--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Вкладки карточки объекта */
.subnav {
  position: relative;
  z-index: 90;
  display: flex;
  gap: var(--space-4);
  background: var(--bg);
  padding: var(--space-24) 0 var(--space-20);
  scroll-margin-top: 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.subnav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  white-space: nowrap;
  transition: all var(--transition);
}

.subnav__link:hover {
  color: var(--text);
}

.subnav__link.is-active {
  background: var(--text);
  color: var(--bg);
}

.subnav__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.subnav__activity[hidden],
[data-object-panel][hidden] {
  display: none !important;
}

.subnav__activity {
  color: inherit;
}

/* Связанные разделы объекта: активность вкладки отделена от её состояния. */
.object-flow {
  margin-top: var(--space-24);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--text);
  color: #d6ccc2;
}

.subnav--steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(176px, 1fr));
  gap: 0;
  padding: 0;
  background: transparent;
  border-bottom: 0;
}

.subnav--steps .subnav__link {
  position: relative;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  min-height: 56px;
  padding: var(--space-12);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-weight: var(--fw-semibold);
  /* При восстановлении вкладки стартовая заливка «Фото» не должна затухать. */
  transition: none;
}

.subnav--steps .subnav__link + .subnav__link {
  border-inline-start: 1px solid rgba(255, 255, 255, 0.12);
}

.subnav--steps .subnav__link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--surface);
}

.subnav--steps .subnav__link.is-active {
  background: var(--accent);
  color: var(--surface);
}

.subnav--steps .subnav__activity {
  border-color: rgba(255, 255, 255, 0.18);
  border-top-color: currentColor;
}

.subnav--steps .subnav__link.is-active .subnav__activity {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
}

.subnav--steps .subnav__link > .ui-icon { flex-shrink: 0; }
.subnav__copy { display: grid; gap: var(--space-4); min-width: 0; }
.subnav__title { display: inline-flex; align-items: center; gap: var(--space-8); line-height: 1.4; }
.subnav__meta { display: inline-flex; align-items: center; gap: var(--space-8); margin-left: auto; flex-shrink: 0; }
.subnav__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: var(--space-2) var(--space-8);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.subnav__state-slot, .subnav__completion { display: inline-flex; align-items: center; }
.subnav__completion { opacity: 0.8; }
.subnav__completion svg { display: block; flex-shrink: 0; }
.subnav__completion[data-state="idle"] { opacity: 0.55; }
.subnav__completion[data-state="error"] { color: #f0a49a; }
.subnav__completion-check, .subnav__completion-alert { display: none; }
.subnav__completion[data-state="done"] .subnav__completion-check,
.subnav__completion[data-state="error"] .subnav__completion-alert { display: block; }
.subnav__completion[hidden], .subnav__state-slot[hidden] { display: none; }
.subnav--steps .subnav__link.is-active .subnav__count { background: rgba(255, 255, 255, 0.14); }
.subnav--steps .subnav__link.is-active .subnav__completion { color: inherit; }
.subnav__status { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 var(--space-4); color: #715e50; font-size: var(--fs-2xs); font-weight: 400; line-height: 1.4; white-space: normal; }
.subnav__status-detail { display: inline-flex; gap: var(--space-4); }
.subnav__status-detail::before { content: '·'; color: inherit; }
.subnav__status-detail[hidden] { display: none; }
.subnav__status.is-error, .subnav__status .is-error { color: var(--danger); }
.subnav--steps .subnav__link.is-active .subnav__status,
.subnav--steps .subnav__link.is-active .subnav__status * { color: inherit; }

.subnav--steps .subnav__link:focus-visible {
  outline-color: var(--accent-soft);
}

.subnav--steps .subnav__link.is-active:focus-visible {
  outline-color: var(--surface);
}

@media (min-width: 1024px) {
  /* Вкладки должны закрепляться в пределах всей страницы, а не короткого паспорта. */
  .property-workspace-header { display: contents; }
  .property-workspace-header > .object-flow {
    position: sticky;
    top: 0;
    z-index: 90;
    border: 0;
  }
  .object-tab-content {
    --object-tabs-scroll-offset: calc(var(--object-tabs-height, 58px) + var(--space-16));
  }
}

.workspace-section__head > .workspace-section__head-copy {
  flex: 1 1 300px;
}

.object-step-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-12);
  margin-top: var(--space-28);
  padding-top: var(--space-20);
  border-top: 1px solid var(--border);
}

.object-step-navigation__next {
  margin-left: auto;
}

@media (max-width: 480px) {
  .object-step-navigation__next { flex: 1; justify-content: center; }
}

.object-tab-content {
  min-height: calc(100vh - var(--object-tabs-height, 58px));
  min-height: calc(100svh - var(--object-tabs-height, 58px));
  overflow-anchor: none;
}

/* До восстановления hash/памяти не показываем временный раздел «Фото».
   Контейнер сохраняет высоту экрана; паспорт остаётся видимым. */
.object-tabs-pending [data-object-tabs] { visibility: hidden; }
.object-tabs-pending [data-object-panel] { display: none !important; }

.object-tab-content [id] {
  scroll-margin-top: var(--object-tabs-scroll-offset, var(--space-16));
}

.workspace-section[data-object-panel] {
  border-bottom: none;
}

/* Переходы фокусируют секцию целиком; внешняя рамка ей не нужна. */
.workspace-section[data-object-panel]:focus {
  outline: none;
}

.analytics-placeholder {
  max-width: 640px;
}

.analytics-placeholder h3 {
  margin-bottom: var(--space-12);
}

.analytics-placeholder p {
  margin: 0 0 var(--space-16);
  line-height: 1.6;
}

.workspace-section {
  padding: var(--space-40) 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: var(--space-16);
}

.workspace-section:last-child {
  border-bottom: none;
}

.workspace-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-16);
  margin-bottom: var(--space-24);
  flex-wrap: wrap;
}

.workspace-section__head h2 {
  font-size: var(--fs-2xl);
}

.workspace-section__head p {
  margin: var(--space-4) 0 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* Целевое AI-действие секции — в левой колонке (та же сетка 1fr /
   --workspace-aside, что у контента ниже). h2 слева, кнопка справа
   по ширине этой колонки — как иконки у «Текста объявления».
   Не на всю ширину секции: иначе кнопка садится над aside.
   Docs/10-object-card-ui-ux.md §2.34. */
.workspace-section__head-main {
  display: grid;
  grid-template-columns: 1fr var(--workspace-aside);
  gap: var(--space-24);
  width: 100%;
}

.workspace-section__head-copy {
  min-width: 0;
}

.workspace-section__head-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-12) var(--space-16);
  width: 100%;
}

.workspace-section__head-title form {
  flex-shrink: 0;
  margin-left: auto;
}

@media (max-width: 860px) {
  .workspace-section__head-main {
    grid-template-columns: 1fr;
  }
}

/* Шапка секции «Фото» — три отдельные строки одна под другой (не общий flex
   с align-items:baseline, как у остальных шапок секций выше): заголовок,
   подзаголовок, чипы — каждый на своей строке (2026-08-15, после двух попыток
   свести что-то в одну строку через грид/flex — оба раза читалось как один
   смешанный ряд). */
.workspace-section__head--photos {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: var(--space-12);
}

/* Подзаголовок — та же сетка, что у .photo-workspace / .listing-editor:
   второй столбец пустует, нужен только для того, чтобы подзаголовок
   точно совпадал по ширине с колонкой галереи, а не с произвольным
   ch-лимитом. */
.workspace-section__head-subtitle {
  display: grid;
  grid-template-columns: 1fr var(--workspace-aside);
  gap: var(--space-24);
}

.workspace-section__head-subtitle p {
  margin: 0;
  max-width: none;
}

@media (max-width: 860px) {
  .workspace-section__head-subtitle {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel--pad {
  padding: var(--space-24);
}

/* Overview */

.status-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.status-list li {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12) 0;
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--border);
}

.status-list li:last-child {
  border-bottom: none;
}

.status-list__note {
  margin-left: auto;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
}

/* Локальные чипы внутри разделов (счётчики галереи и состояние данных).
   Состояния верхней навигации оформлены отдельно через .subnav__status. */

.status-strip {
  margin: 0 0 var(--space-16);
}

.status-strip__items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.status-strip__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  min-width: 0;
}

.status-strip__icon {
  font-size: var(--fs-2xs);
  line-height: 1;
  color: var(--text-muted);
  flex-shrink: 0;
}

.status-strip__icon--ok {
  color: var(--success);
}

/* AI-мотив пилюли (например «Выбрано на анализ») — не статус готово/ошибка,
   а маркер «это про AI», тот же акцентный тон, что и значок ✨ на кадрах
   фото (2026-08-14). */
.status-strip__icon--ai {
  color: var(--accent);
}

.status-strip__icon--error {
  color: var(--danger);
}

.status-strip__label {
  color: var(--text-muted);
  white-space: nowrap;
}

.status-strip__value {
  color: var(--text);
  font-weight: var(--fw-bold);
  white-space: nowrap;
}

.status-strip__value::before {
  content: '·';
  margin-right: var(--space-4);
  color: var(--text-muted);
  font-weight: normal;
}

/* Ещё нет данных (не загружены / не указана / генерируется) — значение
   звучит тише готового, но остаётся читаемым. */
.status-strip__item.is-pending .status-strip__value {
  color: var(--text-muted);
  font-weight: var(--fw-semibold);
}

.status-strip__item.is-error {
  background: var(--danger-soft);
}

.status-strip__item.is-error .status-strip__label,
.status-strip__item.is-error .status-strip__value {
  color: var(--danger);
}

/* ——— User profile ——— */

.profile-workspace {
  padding: var(--space-28);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  font-family: var(--font);
}
.profile-workspace :is(h1, h2) { font-family: var(--font); }
.profile-header { margin-bottom: var(--space-28); padding-bottom: var(--space-24); border-bottom: 1px solid var(--border); }
.profile-header h1 { margin: 0; color: var(--text); font-size: var(--fs-4xl); font-weight: var(--fw-black); letter-spacing: -0.035em; line-height: 1.15; }
.profile-header > p { margin: var(--space-12) 0 0; color: #73675d; font-size: var(--fs-sm); line-height: 1.65; }
.profile-stack { display: grid; grid-template-columns: 256px minmax(0, 1fr); align-items: start; gap: var(--space-28); }
.profile-main { min-width: 0; padding-left: var(--space-24); border-left: 1px solid var(--border); }
.profile-section__head { margin-bottom: var(--space-24); }
.profile-card-title { margin: 0; color: var(--text); font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -0.025em; line-height: 1.3; }
.profile-section__head > p { margin: var(--space-12) 0 0; color: #73675d; font-size: var(--fs-sm); line-height: 1.65; }
.profile-avatar-card { min-width: 0; }
.profile-avatar-editor { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-24); }
.profile-avatar-controls { width: 100%; min-width: 0; }
.profile-avatar-preview { display: grid; place-items: center; flex-shrink: 0; width: 128px; height: 128px; overflow: hidden; border-radius: var(--radius-circle); background: var(--surface-2); color: var(--accent-hover); font-size: var(--fs-4xl); font-weight: var(--fw-bold); }
.profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-picker { position: relative; }
.profile-avatar-picker > label { width: 100%; min-height: 44px; gap: var(--space-8); font-size: var(--fs-sm); }
.profile-avatar-picker > input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 3px; }
.profile-avatar-picker > input[aria-invalid="true"] + label { border-color: var(--danger); }
.profile-avatar-save { width: 100%; margin-top: var(--space-20); }
.profile-avatar-remove { margin-top: var(--space-12); }
.profile-avatar-remove .btn { width: 100%; min-height: 44px; color: #73675d; font-size: var(--fs-sm); }
.profile-avatar-remove .btn:hover { color: var(--danger); }
.profile-workspace :is(.profile-avatar-save, .profile-form__actions > .btn) { min-height: 56px; gap: var(--space-12); padding: var(--space-16) var(--space-28); border-radius: var(--radius); font-size: var(--fs-base); font-weight: var(--fw-bold); line-height: 1.25; white-space: normal; box-shadow: 0 4px 12px rgba(184, 84, 47, 0.2); }
.profile-form__actions > .btn { min-width: 232px; }
.profile-form { min-width: 0; }
.profile-form + .profile-form { margin-top: var(--space-28); padding-top: var(--space-28); border-top: 1px solid var(--border); }
.profile-form__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-20); }
.profile-workspace .form-group { min-width: 0; margin: 0; }
.profile-workspace .form-group label { color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); text-transform: none; letter-spacing: 0; line-height: 1.5; }
.profile-workspace .form-input { min-height: 48px; border-width: 1px; background: var(--bg); font-size: var(--fs-base); }
.profile-form__field--wide,
.profile-form__confirmation { grid-column: 1 / -1; }
.profile-form__confirmation { padding: var(--space-16); border-radius: var(--radius); background: var(--bg); }
.profile-workspace [data-profile-email-confirmation][hidden] { display: none; }
.profile-form__confirmation .form-input { background: var(--surface); }
.profile-form__actions { display: flex; flex-wrap: wrap; gap: var(--space-12); margin-top: var(--space-24); }
.profile-form__hint,
.profile-form__error { margin: var(--space-8) 0 0; color: #73675d; font-size: var(--fs-sm); line-height: 1.65; overflow-wrap: anywhere; }
[data-profile-avatar-state]:empty { margin: 0; }
.profile-form__error,
[data-profile-avatar-state][data-state="error"] { color: var(--danger); }
.profile-workspace .form-input[aria-invalid="true"] { border-color: var(--danger); }
@media (max-width: 860px) {
  .profile-stack { grid-template-columns: minmax(0, 1fr); }
  .profile-main { padding-top: var(--space-24); padding-left: 0; border-top: 1px solid var(--border); border-left: 0; }
  .profile-avatar-editor { flex-direction: row; }
  .profile-avatar-controls { flex: 1; }
}
@media (max-width: 600px) {
  .profile-workspace { padding: var(--space-16); }
  .profile-header h1 { font-size: var(--fs-3xl); }
  .profile-avatar-editor { flex-direction: column; gap: var(--space-20); }
  .profile-form__fields { grid-template-columns: minmax(0, 1fr); }
  .profile-form__actions > .btn { width: 100%; min-width: 0; }
}

/* ——— Brand profile ——— */

.page-header__actions.brand-save-actions {
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-8);
}

.brand-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-20);
  margin-top: var(--space-28);
  padding-top: var(--space-24);
  border-top: 1px solid var(--border);
}

.brand-save-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  font-size: var(--fs-2xs);
  line-height: 1.5;
  color: var(--text-muted);
}

.brand-save-status::before {
  content: '';
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: var(--radius-circle);
  background: currentColor;
}

.brand-save-status[data-save-state="saved"] {
  color: var(--success);
}

.brand-save-status[data-save-state="dirty"],
.brand-save-status[data-save-state="saving"] {
  color: var(--accent-hover);
}

.brand-save-status[data-save-state="error"] {
  color: var(--danger);
}

@media (max-width: 640px) {
  .page-header__actions.brand-save-actions {
    align-items: flex-start;
  }

  .brand-save-row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-12);
  }
}

.brand-columns {
  display: grid;
  grid-template-columns: 1fr 360px;
  align-items: start;
  gap: var(--space-24);
}

@media (max-width: 960px) {
  .brand-columns {
    grid-template-columns: 1fr;
  }
}

.brand-forms {
  display: flex;
  flex-direction: column;
  gap: var(--space-20);
}

.brand-card h3 {
  font-size: var(--fs-base);
  margin-bottom: var(--space-4);
}

.brand-card > p {
  margin: 0 0 var(--space-20);
  font-size: var(--fs-2xs);
  color: var(--text-muted);
}

.brand-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
}

.brand-card__head h3 {
  margin-bottom: 0;
}

.brand-card__body {
  margin-top: var(--space-16);
}

.brand-card__body > p {
  margin: 0 0 var(--space-20);
  font-size: var(--fs-2xs);
  color: var(--text-muted);
}

.brand-card--muted {
  background: var(--surface-2);
  box-shadow: none;
}

.brand-card__hint {
  margin: 0;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  line-height: 1.5;
}

.brand-card > p.brand-card__hint {
  margin: 0;
}

.brand-field__control {
  margin-top: var(--space-20);
  margin-bottom: 0;
}

.dropzone--compact {
  padding: var(--space-28) var(--space-20);
}

.dropzone--compact .dropzone__icon {
  margin-bottom: var(--space-8);
}

.brand-preview {
  position: sticky;
  top: var(--space-24);
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.brand-preview-card {
  overflow: hidden;
}

.brand-preview__photo {
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  container-type: size;
}

.brand-preview__photo > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-preview__agency {
  position: absolute;
  top: 3%;
  left: 3%;
  max-width: 52%;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 14px;
  font-size: 3.8cqh;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 0.08em 0.16em rgba(20, 16, 13, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-preview__agency img {
  display: block;
  max-height: 9%;
  max-height: 9cqh;
  max-width: 18%;
  max-width: 18cqw;
  width: auto;
  height: auto;
  object-fit: contain;
}

.brand-preview__plate {
  position: absolute;
  left: 3%;
  right: auto;
  bottom: 3%;
  height: 15%;
  width: max-content;
  max-width: 78%;
  display: flex;
  align-items: center;
  gap: 3cqh;
  padding: 0 1.65cqh;
  background: #f4f1ec;
  border-radius: 999px;
  color: #221e1b;
  box-shadow: 0 0.35cqh 1.1cqh rgba(20, 16, 13, 0.18);
}

.brand-realtor-id {
  display: flex;
  align-items: flex-start;
  gap: var(--space-16);
  margin-bottom: var(--space-20);
}

.brand-realtor-id__name {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.brand-realtor-id__name .brand-card__hint {
  margin-top: var(--space-8);
}

.brand-realtor-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  flex-shrink: 0;
}

.brand-realtor-avatar {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px rgba(43, 36, 32, 0.16);
  overflow: hidden;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    box-shadow var(--transition),
    transform var(--transition);
}

.brand-realtor-avatar:hover,
.brand-realtor-avatar:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft-2);
}

.brand-realtor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-realtor-avatar__placeholder {
  font-size: var(--fs-3xs);
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.brand-realtor-avatar__remove {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-3xs);
  color: var(--text-muted);
  cursor: pointer;
}

.brand-preview__avatar {
  width: 11.7cqh;
  height: 11.7cqh;
  flex-shrink: 0;
  border-radius: 50%;
  border: 0;
  object-fit: cover;
  background: rgba(34, 30, 27, 0.08);
}

.brand-preview__plate-main {
  flex: 1;
  min-width: 0;
}

.brand-preview__contact {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.85cqh;
  min-width: 0;
}

.brand-preview__name,
.brand-preview__phone {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-preview__name {
  font-weight: var(--fw-bold);
  font-size: var(--fs-2xs);
  font-size: 2.7cqh;
  line-height: 1.15;
  color: #221e1b;
}

.brand-preview__phone {
  font-size: var(--fs-2xs);
  font-size: 2.4cqh;
  color: #7a746e;
  line-height: 1.15;
}

.brand-preview__call {
  width: 11.7cqh;
  height: 11.7cqh;
  flex-shrink: 0;
  border-radius: 50%;
  background: #d2e6da;
  color: #245842;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 0.12cqh #b8d6c4;
}

.brand-preview__call svg {
  width: 46%;
  height: 46%;
  display: block;
}

.brand-preview__note {
  margin: 0;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0 var(--space-2);
}

.brand-status h3 {
  font-size: var(--fs-base);
  margin-bottom: var(--space-4);
}

.stat-row {
  display: flex;
  gap: var(--space-20);
  padding-top: var(--space-4);
}

.stat {
  flex: 1;
}

.stat__value {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
}

.stat__label {
  font-size: var(--fs-2xs);
  color: var(--text-muted);
}

/* Photo section */
.photo-workspace {
  display: grid;
  grid-template-columns: 1fr var(--workspace-aside);
  align-items: start;
  gap: var(--space-24);
}

@media (max-width: 860px) {
  .photo-workspace {
    grid-template-columns: 1fr;
  }
}

/* Панель только рабочего лайтбокса: предпросмотр и пакеты площадок
   используют обычный GLightbox. Под панель зарезервировано место. */
.photo-lightbox {
  --photo-lightbox-footer: calc(104px + env(safe-area-inset-bottom, 0px));
}

.glightbox-container.photo-lightbox .gslider {
  height: calc(100% - var(--photo-lightbox-footer));
}

.glightbox-container.photo-lightbox .ginner-container {
  height: auto;
}

.glightbox-container.photo-lightbox .gslide .gslide-image img {
  max-height: calc(100vh - var(--photo-lightbox-footer) - 24px);
  max-height: calc(100dvh - var(--photo-lightbox-footer) - 24px);
}

.glightbox-container.photo-lightbox :is(.gprev, .gnext) {
  top: calc((100% - var(--photo-lightbox-footer)) / 2 - 25px);
}

.photo-lightbox__footer {
  position: absolute;
  inset: auto 0 0;
  z-index: 100000;
  height: var(--photo-lightbox-footer);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px));
}

.photo-lightbox__panel {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-family: var(--font);
}

.photo-lightbox__position {
  flex: 0 0 auto;
  color: #73675d;
  font-size: 13px;
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.photo-lightbox__actions {
  display: flex;
  gap: 8px;
}

.photo-lightbox__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: 600 14px / 1.3 var(--font);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.photo-lightbox__action > i { font-size: 18px; }
.photo-editor-action-icon {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
}
.photo-editor-action-icon > i { font-size: 18px; line-height: 1; }
.photo-editor-action-icon__ai {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 1px 2px;
  border-radius: 3px;
  background: var(--surface);
  color: var(--accent-hover);
  font-size: 8px;
  font-weight: var(--fw-bold);
  line-height: 1;
}
.photo-lightbox__action:hover:not(:disabled) { background: var(--surface-3); }
.photo-lightbox__action--primary { background: var(--accent); color: #fff; }
.photo-lightbox__action--primary:hover:not(:disabled) { background: var(--accent-hover); }
.photo-lightbox__action--danger { background: transparent; color: var(--danger); }
.photo-lightbox__action--danger:hover:not(:disabled) { background: var(--danger-soft); }
.photo-lightbox__action:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.photo-lightbox__action:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 680px) {
  .photo-lightbox { --photo-lightbox-footer: calc(140px + env(safe-area-inset-bottom, 0px)); }
  .photo-lightbox__footer { padding-inline: 12px; }
  .photo-lightbox__panel { width: 100%; flex-direction: column; gap: 10px; padding: 12px; }
  .photo-lightbox__actions { display: grid; width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .photo-lightbox__action { flex-direction: column; gap: 4px; min-height: 60px; padding: 8px 4px; font-size: 12px; }
}
@media (max-width: 480px) {
  .photo-lightbox { --photo-lightbox-footer: calc(210px + env(safe-area-inset-bottom, 0px)); }
  .photo-lightbox__actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Фиксированное число колонок (было auto-fill от 150px — на широких
   экранах не давало стабильной раскладки), меньше на узких экранах,
   чтобы миниатюры не мельчали. На телефоне — 2 в ряд: 3 колонки
   оставляли кадры слишком мелкими для просмотра и тапа по контролам. */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-12);
}

@media (max-width: 860px) {
  .photo-gallery {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 560px) {
  .photo-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

.photo-item {
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.photo-item__analysis-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-circle);
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent);
  cursor: pointer;
}

.photo-item__analysis-badge[data-state='done'] { color: #28704d; }
.photo-item__analysis-badge[data-state='failed'] { color: #ad302f; }
.photo-item__analysis-badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-item__analysis-progress {
  position: absolute;
  z-index: 4;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.85);
  pointer-events: none;
}
.photo-item__analysis-progress span {
  display: block;
  width: 35%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: photo-analysis-progress 1.3s ease-in-out infinite alternate;
}
.photo-item__analysis-progress:not([hidden]) ~ .photo-item__actions {
  padding-bottom: 22px;
}
@keyframes photo-analysis-progress { from { transform: translateX(0); } to { transform: translateX(185%); } }
@media (prefers-reduced-motion: reduce) { .photo-item__analysis-progress span { animation: none; width: 100%; } }
.photo-analysis-details { max-height: 60vh; overflow: auto; }
.photo-analysis-details__intro { margin: 0; color: var(--text); font-size: var(--fs-base); line-height: 1.65; }
.modal__footer.photo-analysis-actions { align-items: center; justify-content: space-between; }
@media (max-width: 480px) {
  .modal__footer.photo-analysis-actions { flex-direction: column-reverse; align-items: stretch; }
  .photo-analysis-actions .btn { width: 100%; }
}
.photo-analysis-recommendation { margin: 16px 0; padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.photo-analysis-recommendation p { margin: 0 0 8px; }

/* Общее подтверждение автоулучшения одного фото и фото объявления. */
.modal.modal--photo-auto-enhance {
  display: flex;
  flex-direction: column;
  max-width: 600px;
  overflow: hidden;
}
.modal--photo-auto-enhance > .modal__header,
.modal--photo-auto-enhance > .modal__footer { flex-shrink: 0; }
.modal--photo-auto-enhance > .modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.photo-auto-enhance { display: grid; gap: var(--space-20); }
.photo-auto-enhance p { margin: 0; }
.photo-auto-enhance__summary { font-size: var(--fs-base); font-weight: var(--fw-semibold); line-height: 1.6; }
.photo-auto-enhance__usage { display: flex; align-items: center; gap: var(--space-16); padding: var(--space-16); border-radius: var(--radius); background: var(--bg); }
.photo-auto-enhance__usage > i { flex-shrink: 0; color: var(--accent-hover); font-size: var(--fs-2xl); }
.photo-auto-enhance__cost { font-weight: var(--fw-bold); line-height: 1.5; }
.photo-auto-enhance__availability { margin-top: var(--space-4) !important; color: #73675d; font-size: var(--fs-sm); line-height: 1.5; }
.photo-auto-enhance__description { color: #73675d; font-size: var(--fs-sm); line-height: 1.65; }
.photo-auto-enhance__warning { display: flex; align-items: flex-start; gap: var(--space-12); padding: var(--space-16); border-radius: var(--radius); background: var(--accent-soft-2); color: var(--text); font-size: var(--fs-sm); line-height: 1.65; }
.photo-auto-enhance__warning > i { flex-shrink: 0; margin-top: 2px; color: var(--accent-hover); font-size: var(--fs-lg); }
.photo-auto-enhance__skip { display: flex; align-items: flex-start; gap: var(--space-8); cursor: pointer; font-size: var(--fs-sm); line-height: 1.5; }
.photo-auto-enhance__skip input { flex-shrink: 0; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.photo-auto-enhance__message { font-size: var(--fs-sm); line-height: 1.6; }
.photo-auto-enhance [hidden] { display: none; }
.photo-auto-enhance__actions .spinner { border-color: rgba(255, 255, 255, 0.4); border-top-color: #fff; }
.photo-auto-enhance__actions [hidden] { display: none; }
@media (max-width: 480px) {
  .modal--photo-auto-enhance .modal__header,
  .modal--photo-auto-enhance .modal__body,
  .modal--photo-auto-enhance .modal__footer { padding-inline: var(--space-16); }
  .photo-auto-enhance__actions { flex-direction: column-reverse; }
  .photo-auto-enhance__actions .btn { width: 100%; }
}

/* Признак «в пакете экспорта» больше не читается по прозрачности кадра
   (opacity на .photo-item img убран целиком) — кадры физически лежат в одном
   из двух блоков (.photo-gallery-group ниже), сам факт местоположения уже
   сообщает статус (решение 2026-08-15, см. Docs/10-object-card-ui-ux.md
   §2.25, отменяет §2.18). Размеры/object-fit самого <img> — уже в
   .photo-item__zoom img выше, здесь трогать нечего. */

/* Пустая галерея: единственная крупная зона загрузки на всю ширину сетки. */
.photo-gallery__dropzone {
  grid-column: 1 / -1;
}

/* Блок «Не в экспорте» — визуально приглушённый «склад» под основным пакетом
   экспорта: своя рамка/фон, чтобы отличаться от пакета без затемнения самих
   фото. Не рендерится (data-photo-group-excluded[hidden]), если там нет ни
   одного кадра — см. syncExcludedGroupVisibility() в app.js. Тело
   (.photo-gallery-group__body) свёрнуто по умолчанию при каждой загрузке
   страницы — раскрытие только кнопкой-шапкой или переносом кадра сюда
   (initPhotoGroupCollapse), решение 2026-08-15, см.
   Docs/10-object-card-ui-ux.md §2.28. */
.photo-gallery-group {
  margin-top: var(--space-24);
  padding: var(--space-16);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

/* Кнопка на всю ширину, а не просто заголовок с отдельным значком — попасть
   по всей строке проще, чем целиться в маленький шеврон. */
.photo-gallery-group__head {
  display: flex;
  align-items: center;
  width: 100%;
  gap: var(--space-8);
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
}

.photo-gallery-group__head:hover,
.photo-gallery-group__head:focus-visible {
  color: var(--text);
}

.photo-gallery-group__head i:not(.photo-gallery-group__chevron) {
  font-size: var(--fs-sm);
}

.photo-gallery-group__chevron {
  margin-left: auto;
  font-size: var(--fs-sm);
  transition: transform var(--transition);
}

.photo-gallery-group__head[aria-expanded='true'] .photo-gallery-group__chevron {
  transform: rotate(180deg);
}

.photo-note-list { display: grid; gap: 24px; }
.photo-note-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: start; gap: 20px; }
.photo-note-row[hidden],
[data-photo-notes-block]:not(.is-expanded):not(.is-generating) .photo-note-row:nth-child(n + 4) { display: none; }
.photo-note-row__thumbnail { display: flex; align-items: center; justify-content: center; width: 96px; height: 72px; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-2); }
.photo-note-row__thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; transition: filter var(--transition); }
a.photo-note-row__thumbnail:hover img { filter: brightness(0.92); }
.photo-note-row__thumbnail--unavailable { color: var(--text-muted); font-size: 24px; }
.photo-note-row__title { margin: 0 0 6px; color: var(--text); font-size: var(--fs-lg); font-weight: var(--fw-bold); line-height: 1.4; overflow-wrap: anywhere; }
.photo-note-row__description { margin: 0; color: var(--text); font-size: var(--fs-base); line-height: 1.75; white-space: pre-line; overflow-wrap: anywhere; }
.photo-note-row__stale { display: block; margin-top: 8px; color: var(--accent-hover); font-size: var(--fs-xs); line-height: 1.5; }
@media (max-width: 600px) {
  .photo-note-list { gap: 20px; }
  .photo-note-row { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .photo-note-row__thumbnail { width: 72px; height: 54px; }
  .photo-note-row__title { font-size: var(--fs-base); }
  .photo-note-row__description { font-size: var(--fs-sm); line-height: 1.65; }
}

.photo-gallery-group__description {
  max-width: 80ch;
  margin: 0 0 var(--space-16);
  color: #73675d;
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.photo-gallery-group__body {
  margin-top: var(--space-12);
}

/* Тайл «Добавить» — первая ячейка сетки, того же размера, что фото; открывает
   тот же файловый диалог и принимает drag&drop (см. initCardPhotoUpload). */
.photo-add-tile {
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  cursor: pointer;
  color: var(--text-muted);
  transition:
    border-color var(--transition-slow),
    background var(--transition-slow),
    color var(--transition-slow);
}

.photo-add-tile:hover,
.photo-add-tile.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft-2);
  color: var(--accent-hover);
}

.photo-add-tile__icon {
  font-size: var(--fs-3xl);
  line-height: 1;
}

.photo-add-tile__label {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
}

/* Плитка «в загрузке» — оптимистичный превью сразу в сетке галереи, пока
   AJAX-запрос идёт на сервер (см. initCardPhotoUpload в app.js). Изображение
   приглушено, спиннер + узкая полоса прогресса поверх; по ответу сервера
   плитка целиком заменяется на разметку из partials/photo-item.blade.php.
   Своя сизинг-разметка (не .photo-item__zoom img) — эта плитка рендерится
   голым <img> без ссылки-обёртки. */
.photo-item--uploading > img,
.photo-item--error > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-item--uploading img {
  filter: brightness(0.55);
}

.photo-item__upload-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-12);
  text-align: center;
}

.photo-item__upload-overlay .spinner {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

.photo-item__progress {
  width: 100%;
  height: 4px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

.photo-item__progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 0.15s ease;
}

/* Плитка «ошибка» — недолго держит сообщение об ошибке, затем убирается
   (см. failTile в app.js); файл на этом не отправляется повторно автоматически. */
.photo-item--error {
  border-color: var(--danger);
}

.photo-item--error .photo-item__upload-overlay {
  background: rgba(192, 57, 43, 0.82);
}

.photo-item__error-text {
  color: #fff;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  line-height: 1.3;
}

/* Удаление плитки (крестик на кадре) — не мгновенный скачок, а «выдох»:
   плитка сжимается, подкручивается и тает, соседние плитки следом плавно
   съезжают в освободившуюся ячейку (FLIP-приём в animateTileRemoval, app.js).
   С prefers-reduced-motion анимацию не запускаем — плитка/соседи переставляются
   сразу без движения (см. проверку в JS). */
.photo-item--removing {
  animation: photo-item-remove 0.26s cubic-bezier(0.4, 0, 1, 1) forwards;
  pointer-events: none;
}

@keyframes photo-item-remove {
  0% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.72) rotate(-4deg);
    filter: blur(3px);
  }
}

/* Перенос кадра между блоками «Пакет экспорта» / «Не в экспорте» по клику
   на тумблер (animateTileTransfer, app.js) — без поворота/блюра, в отличие
   от удаления: кадр не пропадает совсем, а переезжает, поэтому эффект мягче
   (только масштаб + прозрачность), симметрично на выходе и на входе. */
.photo-item--leaving {
  animation: photo-item-leave 0.22s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.photo-item--arriving {
  animation: photo-item-arrive 0.26s cubic-bezier(0, 0, 0.2, 1);
}

@keyframes photo-item-leave {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.86);
  }
}

@keyframes photo-item-arrive {
  0% {
    opacity: 0;
    transform: scale(0.86);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Значок «в AI-разбор» — теперь и переключатель (клик добавляет/убирает
   конкретное фото из выборки, независимо от его позиции в галерее, лимит —
   по тарифу, см. PropertyPhotoController::toggleAiVision). Включённое фото
   видно всегда (не только по hover, в отличие от .photo-item__actions);
   выключенное — проявляется по hover, чтобы не засорять галерею тусклыми
   значками на каждом кадре. Белая прямоугольная подложка с небольшим
   закруглением (var(--radius-sm)) — тот же язык, что у .photo-item__btn
   (✓/○/×), а не тёмный кружок хэндлера: это отдельная категория «отметка»,
   не «зона захвата». */
.photo-item__ai-badge-form {
  display: contents;
}

.photo-item__ai-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  display: none;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.55);
  color: rgba(43, 36, 32, 0.4);
  font-size: 11px;
}

.photo-item__ai-badge i {
  display: block;
}

.photo-item__ai-badge:hover {
  background: rgba(255, 255, 255, 0.85);
}

.photo-item:hover .photo-item__ai-badge,
.photo-item:focus-within .photo-item__ai-badge {
  display: flex;
}

.photo-item.is-ai-vision .photo-item__ai-badge {
  display: flex;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.photo-item.is-ai-vision .photo-item__ai-badge:hover {
  background: #fff;
}

/* Лимит тарифа исчерпан (.photo-gallery.is-ai-vision-full, см. initPhotoToggles)
   — hover по значку на невыбранном фото трясётся и краснеет, чтобы не заставлять
   кликать наугад и ловить модалку с ошибкой лимита; сам клик всё равно уходит на
   сервер и покажет ту же ошибку (см. PropertyPhotoController::toggleAiVision). */
.photo-gallery.is-ai-vision-full .photo-item:not(.is-ai-vision) .photo-item__ai-badge:hover {
  background: var(--danger-soft);
  color: var(--danger);
  animation: ai-badge-shake 0.4s ease;
}

@keyframes ai-badge-shake {
  0%, 100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-2px);
  }
  40% {
    transform: translateX(2px);
  }
  60% {
    transform: translateX(-2px);
  }
  80% {
    transform: translateX(2px);
  }
}

.photo-item.is-ai-vision .photo-item__ai-badge {
  display: flex;
}

/* Правка AI-редактора кадра всё ещё генерируется в фоне после закрытия
   окна (2–3 мин, Docs/12-ai-photo-retouch.md §10.2) — свечение по контуру
   плитки тем же фирменным градиентом, что и остальные AI-индикаторы
   (.is-generating, см. ai-icon-gradient-flow ниже), сигнализирует «что-то
   происходит», не дожидаясь возврата в редактор или перезагрузки страницы.
   Класс навешивает/снимает initPhotoAiEditor() (app.js) по фоновому
   поллингу, не Blade. Два слоя движения — обводка «дышит» (ai-tile-glow) и
   поверх кадра бежит блик (ai-tile-shimmer, ::after) — первая версия с
   одним только box-shadow на маленькой плитке читалась слишком тихо. */
.photo-item.is-ai-editing {
  animation: ai-tile-glow 1.3s ease-in-out infinite;
}

.photo-item.is-ai-editing::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.65) 48%,
    rgba(255, 111, 216, 0.55) 52%,
    transparent 65%
  );
  background-size: 260% 260%;
  animation: ai-tile-shimmer 1.6s linear infinite;
}

@keyframes ai-tile-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(168, 85, 247, 0.55),
      0 0 24px 6px rgba(168, 85, 247, 0.5);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(255, 111, 216, 0.85),
      0 0 34px 10px rgba(109, 91, 255, 0.65);
  }
}

@keyframes ai-tile-shimmer {
  0% {
    background-position: -40% -40%;
  }
  100% {
    background-position: 140% 140%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-item.is-ai-editing {
    animation: none;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.6);
  }

  .photo-item.is-ai-editing::after {
    animation: none;
    display: none;
  }
}

/* Тумблер «в экспорт» — левый верхний угол кадра, всегда виден (это не
   точечное действие по hover, как ✨/×, а основной статус кадра). Переиспользует
   фирменный компонент .toggle/.toggle.is-on (тот же, что в форме «Бренд» и
   тарифе), но уменьшенного размера — стандартные 42×24 перекрывали бы кадр. */
.photo-item__export-toggle-form {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
}

.toggle.photo-item__export-toggle {
  width: 30px;
  height: 17px;
}

.toggle.photo-item__export-toggle::after {
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  box-shadow: none;
}

.toggle.photo-item__export-toggle.is-on::after {
  transform: translateX(13px);
}

.photo-item__zoom {
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.photo-item__zoom img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-item__actions {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 3;
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 6px;
  background: linear-gradient(transparent, rgba(43, 36, 32, 0.72));
  opacity: 0;
  transition: opacity var(--transition);
}

.photo-item:hover .photo-item__actions,
.photo-item:focus-within .photo-item__actions {
  opacity: 1;
}

/* Единая подложка для кнопок-действий на кадре (AI-редактор, удаление) —
   тот же тёмный квадрат с закруглением и белой иконкой, что у
   .photo-item__handle ниже (хэндлер перетаскивания): одна визуальная семья
   «элемент управления поверх фото». Отдельная категория — .photo-item__ai-badge
   (✓/○ в углу, светлая подложка): это «отметка», а не кнопка действия, её
   стиль намеренно не трогаем. */
.photo-item__btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: rgba(43, 36, 32, 0.85);
  color: #fff;
  font-size: var(--fs-sm);
  cursor: pointer;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}

.photo-item__btn i {
  display: block;
}

.photo-item__btn:hover {
  background: rgba(43, 36, 32, 0.96);
}

.photo-item__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Удаление — деструктивное действие, поэтому вместо нейтрального
   потемнения при наведении подложка становится красной (как .btn--danger). */
.photo-item__btn--danger:hover {
  background: var(--danger);
}

/* Вход в AI-редактор кадра — рядом с удалением, но нейтральным тоном:
   это не деструктивное действие (Docs/12-ai-photo-retouch.md §2.3). При
   наведении подсвечиваем саму иконку акцентным цветом, а не подложку. */
.photo-item__btn--ai:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

/* Хэндлер перетаскивания — в левом нижнем углу кадра, остальные кнопки
   уходят вправо через spacer (см. initPhotoReorder). Та же тёмная подложка,
   что у .photo-item__btn выше — читается как единый ряд элементов управления. */
.photo-item__handle {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(43, 36, 32, 0.85);
  color: #fff;
  font-size: var(--fs-sm);
  line-height: 1;
  cursor: grab;
  touch-action: none;
}

.photo-item__handle i {
  display: block;
}

.photo-item__handle:hover {
  background: rgba(43, 36, 32, 0.96);
}

.photo-item__handle:active {
  cursor: grabbing;
}

.photo-item__actions-spacer {
  flex: 1;
}

/* Состояния SortableJS во время перетаскивания фото. */
.photo-item.sortable-chosen {
  opacity: 0.85;
}

.photo-item.sortable-ghost {
  opacity: 0.35;
}

.photo-item.sortable-drag {
  box-shadow: 0 8px 24px rgba(43, 36, 32, 0.28);
}

.photo-item__check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-circle);
  display: none;
  place-items: center;
  font-size: var(--fs-2xs);
}

.photo-item.is-selected .photo-item__check {
  display: grid;
}

.photo-sidebar h3 {
  font-size: var(--fs-base);
  margin-bottom: var(--space-4);
}

.photo-sidebar > p {
  margin: 0 0 var(--space-16);
  font-size: var(--fs-2xs);
  color: var(--text-muted);
}

.link-underline {
  text-decoration: underline;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-12) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.toggle-row:last-of-type {
  border-bottom: none;
}

.toggle {
  width: 42px;
  height: 24px;
  background: var(--border);
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  position: relative;
  transition: background var(--transition-slow);
  flex-shrink: 0;
}

.toggle.is-on {
  background: var(--accent);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: var(--radius-circle);
  transition: transform var(--transition-slow);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle.is-on::after {
  transform: translateX(18px);
}

.toggle--paid::before {
  content: "₽";
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  font-size: var(--fs-3xs);
  font-weight: var(--fw-black);
  line-height: 1;
  color: rgba(43, 36, 32, 0.38);
  pointer-events: none;
}

.toggle--paid.is-on::before {
  color: rgba(255, 255, 255, 0.55);
}

/* Listing section — та же сетка колонок, что у «Фото» (--workspace-aside). */
.listing-editor {
  display: grid;
  grid-template-columns: 1fr var(--workspace-aside);
  gap: var(--space-24);
}

@media (max-width: 860px) {
  .listing-editor {
    grid-template-columns: 1fr;
  }
}

/* Просмотр — фото и вся сводка справа, затем текст объявления. */
.property-preview {
  padding: var(--space-28);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.property-preview :is(h3, h4, h5, h6) { font-family: var(--font); }

.property-preview__overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--workspace-aside);
  align-items: start;
  gap: var(--space-28);
}

.property-preview__identity,
.property-preview__media,
.property-preview__aside { min-width: 0; }
.property-preview__aside { display: grid; gap: var(--space-24); padding-left: var(--space-24); border-left: 1px solid var(--border); }
.property-preview__deal { display: inline-block; margin-bottom: var(--space-8); color: var(--accent-hover); font-size: var(--fs-2xs); font-weight: var(--fw-bold); letter-spacing: 0.08em; text-transform: uppercase; }
.property-preview__identity h3 {
  margin: 0 0 var(--space-12);
  font-size: var(--fs-4xl);
  font-weight: var(--fw-black);
  letter-spacing: -0.035em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.property-preview__identity { margin-bottom: var(--space-24); }
.property-preview__identity p { margin: 0; color: #73675d; font-size: var(--fs-sm); line-height: 1.6; }

.property-preview__block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-8);
  margin-bottom: var(--space-20);
}
.property-preview__block-head h4 {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  margin: 0;
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.property-preview__facts > .property-preview__block-head h4 { color: #73675d; font-size: var(--fs-2xs); font-weight: var(--fw-bold); letter-spacing: 0.07em; text-transform: uppercase; }
.property-preview__edit {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: 1.5;
}
.property-preview__edit:hover { color: var(--accent-hover); }
.property-preview__edit:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.property-preview__photo-count {
  padding: var(--space-2) var(--space-8);
  border-radius: var(--radius-pill);
  background: var(--accent-soft-2);
  color: var(--accent-hover);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
}
.property-preview__parameters > .property-preview__price-row { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); padding-bottom: var(--space-20); }
.property-preview__price-row dt { font-size: var(--fs-2xs); letter-spacing: 0.06em; text-transform: uppercase; }
.property-preview__parameters .property-preview__price-row dd { color: var(--accent-hover); font-size: var(--fs-3xl); font-weight: var(--fw-bold); letter-spacing: -0.025em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.property-preview__price-row .property-preview__empty { font-weight: 400; letter-spacing: normal; }

.property-preview__gallery { display: grid; min-width: 0; gap: var(--space-12); }
.property-preview__viewer {
  display: grid;
  margin: 0;
  gap: var(--space-8);
  min-width: 0;
  color: var(--text-muted);
  font-size: var(--fs-2xs);
}
.property-preview__stage {
  position: relative;
  height: clamp(240px, 34vw, 420px);
  background: var(--bg);
  border-radius: var(--radius);
}
.property-preview__zoom {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: zoom-in;
}
.property-preview__zoom > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}
.property-preview__zoom-icon,
.property-preview__arrow {
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.property-preview__zoom-icon {
  position: absolute;
  right: var(--space-12);
  bottom: var(--space-12);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  pointer-events: none;
}
.property-preview__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-circle);
  cursor: pointer;
}
.property-preview__arrow--prev { left: var(--space-12); }
.property-preview__arrow--next { right: var(--space-12); }
.property-preview__arrow:hover { background: var(--surface-2); }
.property-preview__stage:focus-visible,
.property-preview__zoom:focus-visible,
.property-preview__arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.property-preview__thumbnails {
  position: relative;
  display: flex;
  gap: var(--space-8);
  overflow-x: auto;
  padding: var(--space-4);
  min-width: 0;
}
.property-preview__thumbnail {
  flex: 0 0 72px;
  width: 72px;
  padding: 2px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
}
.property-preview__thumbnail img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: calc(var(--radius-sm) - 4px);
}
.property-preview__thumbnail.is-active { border-color: var(--accent); }
.property-preview__thumbnail:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.property-preview__parameters,
.property-preview__market-prices { margin: 0; font-size: var(--fs-sm); }
.property-preview__parameters > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--space-12);
  padding: var(--space-12) 0;
  border-bottom: 1px solid var(--border);
}
.property-preview__parameters > div:first-child { padding-top: 0; }
.property-preview__parameters > div:last-child { padding-bottom: 0; border-bottom: 0; }
.property-preview__parameters dt,
.property-preview__market-prices dt { color: var(--text-muted); }
.property-preview__parameters dd { margin: 0; font-weight: var(--fw-semibold); }
.property-preview__parameters dt { color: #73675d; }
.property-preview__parameters dt,
.property-preview__parameters dd,
.property-preview__market-prices dt { overflow-wrap: anywhere; }

.property-preview__market { padding-top: var(--space-16); border-top: 1px solid var(--border); }
.property-preview__market summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  list-style: none;
  cursor: pointer;
}
.property-preview__market summary::-webkit-details-marker { display: none; }
.property-preview__market summary i { color: var(--text-muted); font-size: var(--fs-2xs); }
.property-preview__market[open] summary i { transform: rotate(180deg); }
.property-preview__market summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.property-preview__market-body,
.property-preview__market-prices { display: grid; gap: var(--space-12); }
.property-preview__market-body { margin-top: var(--space-16); font-size: var(--fs-sm); }
.property-preview__market p { margin: 0; }
.property-preview__market-prices dd { display: grid; gap: var(--space-4); margin: var(--space-4) 0 0; }
.property-preview__market-prices strong { font-size: var(--fs-base); font-weight: var(--fw-semibold); }

.property-preview__body { margin-top: var(--space-28); padding-top: var(--space-28); border-top: 1px solid var(--border); }
.property-preview__body > .property-preview__block-head { margin-bottom: var(--space-24); }
.property-preview__description { max-width: 88ch; font-size: var(--fs-base); line-height: 1.75; overflow-wrap: anywhere; }
.property-preview__description > * { margin: 0; }
.property-preview__description > * + * { margin-top: var(--space-16); }
.property-preview__description :is(h3, h4, h5, h6) { margin-top: var(--space-28); font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: -0.02em; line-height: 1.4; }
.property-preview__description > p:first-child { font-size: var(--fs-lg); line-height: 1.6; }
.property-preview__description > :first-child { margin-top: 0; }
.property-preview__description :is(ul, ol) { padding-left: var(--space-24); }
.property-preview__description li + li { margin-top: var(--space-8); }
.property-preview__description li::marker { color: var(--accent-hover); }
.property-preview__description li > p { margin: 0; }
.property-preview__description strong { font-weight: var(--fw-semibold); }
.property-preview__description a { color: var(--accent-hover); text-decoration: underline; }
.property-preview__empty { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.property-preview__refresh {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  margin-bottom: var(--space-16);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.property-preview__refresh[hidden] { display: none; }

@media (max-width: 860px) {
  .property-preview__overview { grid-template-columns: minmax(0, 1fr); gap: var(--space-24); }
  .property-preview__aside { padding-top: var(--space-24); padding-left: 0; border-top: 1px solid var(--border); border-left: 0; }
}
@media (max-width: 600px) {
  .property-preview { padding: var(--space-16); }
  .property-preview__identity h3 { font-size: var(--fs-3xl); }
  .property-preview__stage { height: clamp(220px, 65vw, 360px); }
}

/* Overview section — та же сетка колонок (--workspace-aside): слева
   «Анализ AI» (колонка чтения), справа карточка «Оценка». */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr var(--workspace-aside);
  align-items: start;
  gap: var(--space-24);
}

@media (max-width: 860px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

.listing-textarea {
  width: 100%;
  min-height: 260px;
  padding: var(--space-20);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  line-height: 1.65;
  font-size: var(--fs-base);
  background: var(--surface);
}

/* Клиентский срез отделён от текущих рекомендаций и оценки объявления. */
.listing-audience {
  margin-top: var(--space-24);
  padding: var(--space-24);
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
}

.listing-audience__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-20);
  margin-bottom: 0;
}

.listing-audience__head h3 {
  margin: 0 0 var(--space-8);
  font-size: var(--fs-lg);
}

.listing-audience__head p,
.listing-audience__status {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.listing-audience__head form { flex-shrink: 0; margin: 0; }
[data-listing-audience-content] > :first-child { margin-top: var(--space-20); }
.listing-audience__status { margin-bottom: var(--space-12); }
.listing-audience__status:last-child { margin-bottom: 0; }
.listing-audience__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: var(--space-16);
}

.audience-segment {
  min-width: 0;
  padding: var(--space-20);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow-wrap: anywhere;
}

.audience-segment h4 { margin: 0 0 var(--space-8); font-size: var(--fs-base); }
.audience-segment p { margin: 0; line-height: 1.6; }
.audience-segment h5 { margin: var(--space-16) 0 var(--space-8); font-size: var(--fs-sm); }
.audience-segment ul { margin: 0; padding-left: var(--space-20); line-height: 1.6; }
.audience-segment li + li { margin-top: var(--space-4); }
.listing-audience__date,
.listing-audience__caption { color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.5; }
.listing-audience__date { margin: 0 0 var(--space-12); }
.listing-audience__caption { margin: var(--space-20) 0 0; }

@media (max-width: 640px) {
  .listing-audience { padding: var(--space-16); }
  .listing-audience__head { flex-direction: column; align-items: flex-start; gap: var(--space-12); }
}

.listing-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft-2);
}

.text-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.text-block__head h3 {
  margin: 0;
  font-size: var(--fs-base);
}

.text-block__head-actions,
.ai-prose__head-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.text-block__head-actions form,
.ai-prose__head-actions form {
  margin: 0;
  display: flex;
}

.text-block__view {
  position: relative;
  overflow: hidden;
  padding: var(--space-20);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  min-height: 260px;
}

/* ——— «Магия» AI-генерации: пульсирующая переливающаяся иконка и рамка ———
   Иконка на кнопке запуска — общая для «Текста объявления» и «Заметок по
   фото»: глиф пульсирует и переливается, даже пока кнопка disabled
   (2026-08-15, см. Docs/10-object-card-ui-ux.md §2.3 / §2.27). */

[data-section].is-generating [data-ai-action],
[data-description-block].is-generating [data-ai-action],
[data-photo-notes-block].is-generating [data-ai-action] {
  overflow: visible;
}

[data-section].is-generating [data-ai-action]:disabled,
[data-description-block].is-generating [data-ai-action]:disabled,
[data-photo-notes-block].is-generating [data-ai-action]:disabled {
  opacity: 1;
}

[data-section].is-generating [data-ai-action] i,
[data-description-block].is-generating [data-ai-action] i,
[data-photo-notes-block].is-generating [data-ai-action] i {
  display: inline-block;
  animation: ai-icon-pulse 1.6s ease-in-out infinite;
}

[data-section].is-generating [data-ai-action] i::before,
[data-description-block].is-generating [data-ai-action] i::before,
[data-photo-notes-block].is-generating [data-ai-action] i::before {
  background-image: linear-gradient(90deg, #ff6fd8, #a855f7, #6d5bff, #ff6fd8);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: ai-icon-gradient-flow 2.4s linear infinite;
}

/* Рамка и полоска блика — для полноценной панели-редактора (описание
   объявления). Заметки по фото переехали на язык .ai-prose (см. ниже) и
   этот колодец больше не используют (2026-08-15). */
.text-block.is-generating .text-block__view {
  border-color: var(--accent-soft);
}

.text-block.is-generating .text-block__view::after {
  content: "";
  position: absolute;
  top: 0;
  left: -30%;
  width: 30%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: ai-shimmer-bar 1.3s ease-in-out infinite;
}

@keyframes ai-icon-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.18);
  }
}

@keyframes ai-icon-gradient-flow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 300% 50%;
  }
}

@keyframes ai-shimmer-bar {
  0% {
    left: -30%;
  }
  100% {
    left: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-section].is-generating [data-ai-action] i,
  [data-section].is-generating [data-ai-action] i::before,
  [data-description-block].is-generating [data-ai-action] i,
  [data-description-block].is-generating [data-ai-action] i::before,
  [data-photo-notes-block].is-generating [data-ai-action] i,
  [data-photo-notes-block].is-generating [data-ai-action] i::before,
  .text-block.is-generating .text-block__view::after {
    animation: none;
  }
}

.text-block__text {
  margin: 0;
}

.text-block__empty {
  margin: 0;
  line-height: 1.65;
  font-size: var(--fs-base);
  color: var(--text-muted);
}

/* ——— «Анализ объявления» на «Обзоре»: обычный текст на фоне страницы, без
   панели/рамки — это мнение AI, а не редактируемое поле (2026-08-11, см.
   Docs/10-object-card-ui-ux.md §2.10). Заметки AI по фото (.ai-prose,
   секция «Фото») переиспользуют тот же визуальный язык — реплика AI, а не
   поле формы (2026-08-15, см. Docs/10-object-card-ui-ux.md §2.26): общая
   шапка/лейбл/колонка с линией слева задаются здесь одним набором правил,
   специфика заметок (сворачивание в 3 строки, кнопка «Показать полностью»,
   textarea) — отдельным блоком ниже, рядом с .text-block__actions. ——— */

.listing-analysis,
.ai-prose {
  margin-top: 0;
}

/* Колонка чтения: шапка («Анализ AI» + дата) той же ширины, что тело.
   Иначе justify-content: space-between увозил дату на правый край страницы
   (2026-08-16, см. Docs/10-object-card-ui-ux.md §2.32). */
.listing-analysis {
  max-width: 72ch;
}

/* Заметки по фото — не первый блок в секции «Фото» (идут под галереей), им
   всегда нужен отступ сверху; раньше это был инлайн-стиль на самом блоке. */
.ai-prose {
  margin-top: var(--space-24);
}

.listing-analysis__head,
.ai-prose__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

/* Пилюля даты выше текста — выравниваем по центру с лейблом, не по
   базовой линии (у чипа свой вертикальный паддинг). */
.listing-analysis > .listing-analysis__head {
  align-items: center;
}

.listing-analysis__label,
.ai-prose__label,
.listing-scorecard__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-hover);
}

/* Текст разбора/заметок — колонка для чтения и волосяная линия слева:
   реплика AI-текста, а не сводка-метрика (2026-08-11, §2.12; заметки по
   фото — 2026-08-15). Карточка «Оценка» (.listing-scorecard) сюда не входит —
   у неё свой «геройский» блок без линии, см. §2.33. */
.listing-analysis__body,
.ai-prose__body {
  position: relative;
  max-width: 72ch;
  padding-left: var(--space-20);
  border-left: 1px solid var(--border-hover);
}

.listing-analysis__when {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
  margin: 0 0 0 auto;
  min-width: 0;
  padding: var(--space-4) var(--space-12);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  color: var(--accent-hover);
  white-space: nowrap;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast);
}

.listing-analysis__when[hidden] {
  display: none;
}

.listing-analysis__when-prefix {
  flex-shrink: 0;
}

.listing-analysis__meta {
  font-size: inherit;
  font-weight: var(--fw-bold);
  color: inherit;
  white-space: nowrap;
}

/* Переключатель дат при 2+ прошлых разборах — та же дата внутри пилюли,
   но кликабельная: без своей рамки, шеврон сразу после даты. Клик по
   всей пилюле открывает список (обёртка — <label>). */
.listing-analysis__history {
  field-sizing: content;
  width: auto;
  max-width: 12rem;
  min-width: 0;
  margin: 0;
  padding: 0 1em 0 0;
  border: none;
  border-radius: 0;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.25L6 7.75L9.5 4.25' stroke='%239c4526' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 12px;
  color: inherit;
  font: inherit;
  font-weight: var(--fw-bold);
  text-align: right;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.listing-analysis__when:has(.listing-analysis__history) {
  cursor: pointer;
}

.listing-analysis__when:has(.listing-analysis__history):hover {
  border-color: var(--accent);
}

.listing-analysis__history:focus {
  outline: none;
}

.listing-analysis__when:has(.listing-analysis__history:focus-visible) {
  box-shadow: 0 0 0 4px var(--accent-soft-2);
}

/* ——— Карточка «Оценка» на «Обзоре» (справа от «Анализ AI») ———
   Фаза 2 (2026-08-16): данные реальные, через tools у агента analyze_listing
   (Docs/13-ai-tool-calling.md §5). «Геройский» вариант (§2.33): крупная
   цифра + звёзды в мягкой тёплой зоне (--accent-soft-2), без белой
   панели/рамки/волосяной линии — это сводка-метрика, а не текстовая реплика
   и не редактируемое поле. */
.listing-scorecard__head {
  margin-bottom: var(--space-12);
}

.listing-scorecard__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-24) var(--space-16);
  margin-bottom: var(--space-20);
  border-radius: var(--radius-lg);
  background: var(--accent-soft-2);
  text-align: center;
}

/* Без этого атрибут hidden (переключение в renderScorecard()/блейде между
   реальными данными и заглушкой «оценка ещё не считалась») не работал бы —
   безусловный display: flex выше перебивает базовый UA-стиль
   [hidden] { display: none }, тот же приём, что у .listing-analysis__when. */
.listing-scorecard__hero[hidden] {
  display: none;
}

.listing-scorecard__score {
  font-family: var(--font-display);
  font-size: var(--fs-4xl);
  font-weight: var(--fw-semibold);
  line-height: 1;
  color: var(--accent-hover);
  font-variant-numeric: tabular-nums;
}

.listing-scorecard__stars {
  display: inline-flex;
  gap: 4px;
  color: var(--warning);
  font-size: var(--fs-2xl);
  line-height: 1;
}

.listing-scorecard__stars .bi-star {
  color: color-mix(in srgb, var(--warning) 28%, var(--border-hover));
}

.listing-scorecard__scale {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.listing-scorecard__breakdown {
  list-style: none;
  margin: 0;
  padding: var(--space-16) 0 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.listing-scorecard__breakdown[hidden] {
  display: none;
}

.listing-scorecard__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
}

.listing-scorecard__item-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text);
}

.badge-score {
  display: inline-flex;
  align-items: center;
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-pill);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  white-space: nowrap;
}

.badge-score--needs-work {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-score--normal {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-score--good {
  background: var(--info-soft);
  color: var(--info);
}

.badge-score--excellent {
  background: var(--success-soft);
  color: var(--success);
}

/* Заглушка, пока оценки нет (модель без tools / tool не назначен агенту /
   модель не вызвала функцию) — нейтральный текст вместо звёзд/бейджей, не
   ошибка и не моковые значения. */
.listing-scorecard__empty {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-align: center;
}

/* Skeleton во время генерации анализа — тот же силуэт, что у готовой
   оценки (hero + breakdown), без фейковых цифр и уровней. Появление —
   лёгкий fade-in (переключение [hidden] иначе выглядело резким «хлопком»);
   блик — по образцу .photo-item.is-ai-editing::after (ai-tile-shimmer):
   там же выяснилось, что мягкий цветной градиент почти не заметен на тёплом
   фоне — белый полупрозрачный блик даёт куда более читаемый эффект. */
.listing-scorecard__loading[hidden] {
  display: none;
}

.listing-scorecard__loading:not([hidden]) {
  animation: skeleton-fade-in 0.3s ease;
}

.listing-scorecard__hero--loading {
  position: relative;
  overflow: hidden;
}

.listing-scorecard__hero--loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 80%
  );
  background-size: 260% 100%;
  animation: skeleton-shimmer-sweep 3.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes skeleton-shimmer-sweep {
  0% {
    background-position: 260% 0;
  }
  100% {
    background-position: -260% 0;
  }
}

@keyframes skeleton-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes skeleton-note-pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Постепенное появление элементов skeleton (полоски/пилюли) — каждая линия
   входит с небольшой задержкой относительно соседней, а не разом. */
@keyframes skeleton-line-fade-in {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.listing-scorecard__score--placeholder {
  color: color-mix(in srgb, var(--accent-hover) 35%, var(--text-muted));
  font-variant-numeric: normal;
}

.listing-scorecard__stars--placeholder {
  color: color-mix(in srgb, var(--warning) 28%, var(--border-hover));
}

.listing-scorecard__stars--placeholder .bi-star {
  color: inherit;
}

.listing-scorecard__loading-note {
  margin: var(--space-4) 0 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text-muted);
  animation: skeleton-note-pulse 1.8s ease-in-out infinite;
}

.listing-scorecard__breakdown--loading {
  pointer-events: none;
}

.listing-scorecard__breakdown--loading .listing-scorecard__item {
  animation: skeleton-line-fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.listing-scorecard__breakdown--loading .listing-scorecard__item:nth-child(1) {
  animation-delay: 0ms;
}

.listing-scorecard__breakdown--loading .listing-scorecard__item:nth-child(2) {
  animation-delay: 110ms;
}

.listing-scorecard__breakdown--loading .listing-scorecard__item:nth-child(3) {
  animation-delay: 220ms;
}

.badge-score--placeholder {
  display: inline-block;
  min-width: 4.5rem;
  min-height: 1.625rem;
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--border-hover) 55%, var(--surface));
}

.listing-scorecard.is-generating .listing-scorecard__label {
  background-image: linear-gradient(90deg, #ff6fd8, #a855f7, #6d5bff, #ff6fd8);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: ai-icon-gradient-flow 2.4s linear infinite;
}

/* Текст разбора приходит markdown'ом и превращается в HTML дважды: на
   сервере (Str::markdown при загрузке страницы) и в браузере (markdownToFragment
   при живом поллинге). Поэтому оформление вешаем на теги внутри
   .listing-analysis__body/.ai-prose__body/.text-block__view/.channel-export-prose,
   а не на классы — «Анализ AI», «Заметки по фото», «Текст объявления» и модалка
   экспорта (2026-08-18, см. Docs/10-object-card-ui-ux.md §2.37) выглядят одинаково.
   Классы .listing-analysis__text/__heading/__list, которые ставит JS, остаются
   безвредными синонимами. */

.listing-analysis__body :is(h1, h2, h3, h4, h5, h6),
.ai-prose__body :is(h1, h2, h3, h4, h5, h6),
.text-block__view :is(h1, h2, h3, h4, h5, h6),
.channel-export-prose :is(h1, h2, h3, h4, h5, h6) {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-hover);
}

.listing-analysis__body p,
.ai-prose__body p,
.text-block__view p,
.channel-export-prose p {
  margin: 0;
  line-height: 1.7;
  font-size: var(--fs-base);
  color: var(--text);
}

.listing-analysis__body strong,
.ai-prose__body strong,
.text-block__view strong,
.channel-export-prose strong {
  font-weight: var(--fw-bold);
  color: var(--text);
}

/* .ai-prose__text/.text-block__text — обёртка вокруг разобранного HTML (не
   сама текст-нода, в отличие от .listing-analysis__body — там markdown
   разбирается прямо в тело, здесь ещё нужен один узел, который меряет/
   клампит высоту у заметок по фото, см. ниже и initNotesClamp() в app.js),
   поэтому отступ между блоками — на её детях. */
.listing-analysis__body > * + *,
.ai-prose__text > * + *,
.text-block__text > * + *,
.channel-export-prose > * + * {
  margin-top: var(--space-8);
}

/* Над заголовком темы («Текст объявления», «Фото», «Цена») воздуха больше,
   чем под ним — темы читаются как отдельные разделы разбора. */
.listing-analysis__body :is(h1, h2, h3, h4, h5, h6):not(:first-child),
.ai-prose__body :is(h1, h2, h3, h4, h5, h6):not(:first-child),
.text-block__view :is(h1, h2, h3, h4, h5, h6):not(:first-child),
.channel-export-prose :is(h1, h2, h3, h4, h5, h6):not(:first-child) {
  margin-top: var(--space-28);
}

.listing-analysis__body :is(ul, ol),
.ai-prose__body :is(ul, ol),
.text-block__view :is(ul, ol),
.channel-export-prose :is(ul, ol) {
  margin: 0;
  padding-left: 0;
  list-style: none;
  line-height: 1.7;
  font-size: var(--fs-base);
  color: var(--text);
}

.listing-analysis__body li,
.ai-prose__body li,
.text-block__view li,
.channel-export-prose li {
  position: relative;
  padding-left: var(--space-20);
}

.listing-analysis__body li + li,
.ai-prose__body li + li,
.text-block__view li + li,
.channel-export-prose li + li {
  margin-top: var(--space-8);
}

.listing-analysis__body li > p,
.ai-prose__body li > p,
.text-block__view li > p,
.channel-export-prose li > p {
  margin: 0;
}

.listing-analysis__body ul > li::before,
.ai-prose__body ul > li::before,
.text-block__view ul > li::before,
.channel-export-prose ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.8em;
  width: 9px;
  height: 1px;
  background: var(--accent);
}

.listing-analysis__body ol,
.ai-prose__body ol,
.text-block__view ol,
.channel-export-prose ol {
  counter-reset: analysis-item;
}

.listing-analysis__body ol > li,
.ai-prose__body ol > li,
.text-block__view ol > li,
.channel-export-prose ol > li {
  counter-increment: analysis-item;
  padding-left: var(--space-28);
}

.listing-analysis__body ol > li::before,
.ai-prose__body ol > li::before,
.text-block__view ol > li::before,
.channel-export-prose ol > li::before {
  content: counter(analysis-item) '.';
  position: absolute;
  left: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  color: var(--accent);
}

/* Приглашение / статус / ошибка — не часть разбора, поэтому тише текста. */
.listing-analysis__body .listing-analysis__empty,
.ai-prose__empty,
.channel-export-prose__empty {
  margin: 0;
  line-height: 1.7;
  font-size: var(--fs-base);
  color: var(--text-muted);
}

/* Skeleton «Анализ AI» — placeholder-полоски со shimmer, без подписей тем.
   Каждая строка несёт свой --stagger (см. partial) — на нём построены два
   независимых по фазе эффекта: постепенное появление линий одна за другой
   (skeleton-line-fade-in с положительной задержкой) и асинхронный блик
   (skeleton-shimmer-sweep с отрицательной задержкой — линии бликуют не в
   унисон, а вразнобой, как в реальном skeleton-loader'е). */
.listing-analysis__loading[hidden] {
  display: none;
}

.listing-analysis__skeleton-group + .listing-analysis__skeleton-group {
  margin-top: var(--space-28);
}

.listing-analysis__skeleton-block + .listing-analysis__skeleton-block {
  margin-top: var(--space-16);
}

.listing-analysis__skeleton-line {
  display: block;
  height: 0.85em;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--border-hover) 60%, var(--surface));
  overflow: hidden;
  position: relative;
  animation: skeleton-line-fade-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--stagger, 0) * 90ms);
}

.listing-analysis__skeleton-line + .listing-analysis__skeleton-line {
  margin-top: var(--space-8);
}

.listing-analysis__skeleton-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 80%
  );
  background-size: 260% 100%;
  animation: skeleton-shimmer-sweep 3.2s ease-in-out infinite;
  animation-delay: calc(var(--stagger, 0) * -0.45s);
}

.listing-analysis__skeleton-line--full {
  width: 100%;
}

.listing-analysis__skeleton-line--medium {
  width: 82%;
}

.listing-analysis__skeleton-line--short {
  width: 48%;
}

/* Заметки по фото в покое свёрнуты до 3 строк — длинный разбор не должен
   раздувать секцию «Фото» (главное на вкладке — кадры, не текст). Пока идёт
   генерация и после явного «Показать полностью» ограничение снимается
   (2026-08-15, см. Docs/10-object-card-ui-ux.md §2.26). Видимость самой
   кнопки .ai-prose__more считает JS по фактической высоте — сервер не знает,
   уложится ли текст в 3 строки. Клампим через max-height (не
   -webkit-line-clamp) — только так раскрытие можно анимировать
   (transition: max-height); высоту в пикселях (3 строки / полный текст)
   считает JS (initNotesClamp() в app.js), CSS даёт лишь фолбэк на случай,
   если JS ещё не отработал. */
.ai-prose__text {
  overflow: hidden;
  /* Та же line-height, что у абзацев/списков внутри: initNotesClamp() меряет
     3 строки по computed line-height самой обёртки — с наследованием от body
     (1.55) кламп резал ~2.9 строки и порог «текст не влез» врал. */
  line-height: 1.7;
  max-height: calc(1.7em * 3);
  transition: max-height 0.32s ease;
}

.ai-prose.is-generating .ai-prose__text {
  max-height: none;
}

@media (prefers-reduced-motion: reduce) {
  .ai-prose__text {
    transition: none;
  }
}

.ai-prose__more {
  display: inline-flex;
  margin-top: var(--space-28);
  margin-left: var(--space-20);
  padding: 0;
  border: none;
  background: none;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  color: var(--accent-hover);
  cursor: pointer;
}

/* Без этого правила безусловный display: inline-flex выше перебивает
   базовый UA-стиль [hidden] { display: none } — кнопка была видна даже
   с атрибутом hidden (баг: «Показать полностью» в пустом состоянии
   заметок, где показывать нечего; 2026-08-15). */
.ai-prose__more[hidden] {
  display: none;
}

.ai-prose__more:hover,
.ai-prose__more:focus-visible {
  text-decoration: underline;
}

/* Пока идёт разбор — переливается сама подпись, а по волосяной линии слева
   от текста бежит акцентный блик (тот же приём, что подсветка текстовых
   блоков во время генерации, только по одной линии); общее для «Анализа AI»
   и «Заметок по фото». */
.listing-analysis.is-generating .listing-analysis__body::before,
.ai-prose.is-generating .ai-prose__body::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--accent), transparent);
  background-size: 100% 55%;
  background-repeat: no-repeat;
  animation: analysis-rule-sweep 2.4s ease-in-out infinite;
}

@keyframes analysis-rule-sweep {
  from {
    background-position: 0 -55%;
  }
  to {
    background-position: 0 155%;
  }
}

.listing-analysis.is-generating .listing-analysis__label,
.ai-prose.is-generating .ai-prose__label {
  background-image: linear-gradient(90deg, #ff6fd8, #a855f7, #6d5bff, #ff6fd8);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: ai-icon-gradient-flow 2.4s linear infinite;
}

/* Пока идёт разбор, текст лейбла подменяется бегущей фразой по теме
   («Смотрю фото» → «Анализирую текст» → «Оцениваю стоимость», app.js) —
   .is-swapping мягко гасит прежнее слово перед подстановкой нового, а не
   меняет его рывком. */
[data-listing-analysis-label-text] {
  display: inline-block;
  transition: opacity 0.25s ease;
}

[data-listing-analysis-label-text].is-swapping {
  opacity: 0;
}

.ai-prose__textarea {
  width: 100%;
  min-height: 220px;
  padding: var(--space-12) var(--space-16);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  line-height: 1.65;
  font-size: var(--fs-base);
  background: var(--surface);
}

.ai-prose__textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft-2);
}

@media (prefers-reduced-motion: reduce) {
  .listing-analysis.is-generating .listing-analysis__label,
  .ai-prose.is-generating .ai-prose__label,
  .listing-scorecard.is-generating .listing-scorecard__label {
    animation: none;
    background: none;
    color: var(--accent-hover);
    -webkit-text-fill-color: currentColor;
  }

  .listing-analysis.is-generating .listing-analysis__body::before,
  .ai-prose.is-generating .ai-prose__body::before {
    display: none;
  }

  .listing-scorecard__hero--loading::after,
  .listing-analysis__skeleton-line::after {
    animation: none;
    display: none;
  }

  .listing-scorecard__loading:not([hidden]),
  .listing-analysis__skeleton-line,
  .listing-scorecard__breakdown--loading .listing-scorecard__item {
    animation: none;
  }

  .listing-scorecard__loading-note {
    animation: none;
    opacity: 1;
  }

  [data-listing-analysis-label-text] {
    transition: none;
  }
}

.text-block__actions {
  display: flex;
  gap: var(--space-12);
  margin-top: var(--space-12);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--fs-base);
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--accent-hover);
}

.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.icon-btn.is-copied {
  color: var(--success);
}

.icon-btn--confirm {
  color: var(--accent-hover);
}

.icon-btn--confirm:hover {
  background: var(--accent-soft-2);
}

.icon-btn--sm {
  width: 24px;
  height: 24px;
  font-size: var(--fs-sm);
}

/* [data-tooltip] — слой #ui-tooltip в app.js (fixed, чтобы не резало overflow). */
.ui-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: min(260px, calc(100vw - 16px));
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-dark);
  color: #f4ede2;
  font-family: var(--font);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  line-height: 1.35;
  text-align: center;
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.ui-tooltip.is-visible {
  opacity: 1;
}

.listing-params__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  margin-bottom: var(--space-16);
}

.listing-params h3 {
  font-size: var(--fs-base);
  margin: 0;
}

.param-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-8) 0;
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--border);
}

.param-row:last-child {
  border-bottom: none;
}

.param-row span:first-child {
  color: var(--text-muted);
}

.param-row span:last-child {
  font-weight: var(--fw-bold);
}

.param-row--price span:last-child {
  color: var(--accent-hover);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
}

.param-row .param-row__empty {
  color: var(--text-muted);
  font-weight: 400;
  font-family: inherit;
  font-size: var(--fs-sm);
}

/* Export section */
.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-20);
}

.export-card {
  padding: var(--space-24);
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.export-card__icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: var(--fs-lg);
  font-weight: var(--fw-black);
  font-family: var(--font-display);
}

.export-card__icon--mono {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
}

.export-card__preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.export-card__preview-shape {
  display: block;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.export-card__previews {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-16);
  align-items: flex-end;
}

.export-card__preview-label {
  font-size: 9px;
  line-height: 1;
  font-weight: var(--fw-semibold);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.export-card__icon--avito {
  background: #dff2ff;
  color: #0087cc;
}
.export-card__icon--vk {
  background: #e2ecff;
  color: #4269c9;
}
.export-card__icon--ig {
  background: #fbe2ee;
  color: #c22b73;
}
.export-card__icon--mono.export-card__icon--avito,
.export-card__icon--mono.export-card__icon--vk,
.export-card__icon--mono.export-card__icon--ig,
.export-card__icon--mono.export-card__icon--generic {
  background: var(--surface-2);
  color: var(--text-muted);
}
.export-card__icon--pdf {
  background: #fbe3e0;
  color: #c0392b;
}
.export-card__icon--processing {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.export-card__icon--templates {
  background: #ece3f5;
  color: #6b4c9e;
}
.export-card__icon--exportopt {
  background: var(--info-soft);
  color: var(--info);
}
.export-card__icon--limit {
  background: var(--success-soft);
  color: var(--success);
}
.export-card__icon--watermark {
  background: var(--warning-soft);
  color: var(--warning);
}

.export-card h3 {
  font-size: var(--fs-lg);
}

.export-card p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.export-card__meta {
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  font-weight: var(--fw-semibold);
}

.export-card__actions {
  display: flex;
  gap: var(--space-8);
  margin-top: auto;
}

.export-card__actions .btn {
  flex: 1;
}

.export-card__actions .btn--block {
  width: 100%;
}

.export-card__brand {
  margin-top: var(--space-4);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
}

.export-card__brand .toggle-row {
  padding: var(--space-8) 0;
  font-size: var(--fs-sm);
}

.export-card__brand-layers {
  padding-left: 2px;
}

/* Channel export materials */
.channel-materials {
  scroll-margin-top: var(--space-16);
  margin-top: var(--space-24);
  padding-top: var(--space-24);
  border-top: 1px solid var(--border);
}

.channel-materials__title {
  margin: 0 0 var(--space-16);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
}

.channel-materials__empty {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.channel-materials__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.channel-materials__row {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
}

.channel-materials__row.is-failed {
  background: var(--danger-soft);
  border-color: rgba(192, 57, 43, 0.18);
}

@keyframes channel-materials-row-enter {
  0% {
    opacity: 0;
    transform: translateY(-12px) scale(0.97);
    box-shadow: 0 0 0 4px var(--accent-soft);
  }
  55% {
    opacity: 1;
    transform: translateY(2px) scale(1.005);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(184, 84, 47, 0);
  }
}

.channel-materials__row--enter {
  animation: channel-materials-row-enter 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .channel-materials__row--enter {
    animation: none;
  }
}

.channel-materials__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
}
.channel-materials__icon--avito {
  background: #dff2ff;
  color: #0087cc;
  border-color: transparent;
}
.channel-materials__icon--vk {
  background: #e2ecff;
  color: #4269c9;
  border-color: transparent;
}
.channel-materials__icon--ig {
  background: #fbe2ee;
  color: #c22b73;
  border-color: transparent;
}

.channel-materials__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
  flex: 1;
}

.channel-materials__title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.channel-materials__platform-name {
  font-weight: var(--fw-semibold);
  color: var(--text);
}

.channel-materials__date {
  font-size: var(--fs-2xs);
  color: var(--text-muted);
}

.channel-materials__error {
  margin: 0;
  font-size: var(--fs-2xs);
  color: var(--danger);
  line-height: 1.35;
}

.channel-materials__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-8);
  flex-shrink: 0;
  margin-left: auto;
}

.channel-materials__actions .btn {
  min-width: 124px;
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--border);
}

.channel-materials__actions .btn i {
  font-size: 0.95em;
}

.channel-materials__actions .btn:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.channel-materials__actions .btn:disabled {
  opacity: 0.4;
}

.spinner--sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

@media (max-width: 720px) {
  .channel-materials__row {
    flex-wrap: wrap;
  }

  .channel-materials__actions {
    margin-left: calc(36px + var(--space-12));
    width: calc(100% - 36px - var(--space-12));
  }
}

/* Modal (object workspace) */
html.is-modal-open,
html.is-modal-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

html.is-modal-open {
  padding-right: var(--modal-scrollbar-gutter, 0px);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-24);
  background: rgba(26, 29, 36, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overscroll-behavior: contain;
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding: var(--space-20) var(--space-24);
  border-bottom: 1px solid var(--border);
}

.modal__header h2 {
  margin: 0;
  font-size: var(--fs-lg);
}

.modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}

.modal-backdrop.is-overlay-hover {
  cursor: pointer;
}

.modal-backdrop.is-overlay-hover .modal__close,
.modal__close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.modal__body {
  padding: var(--space-24);
}

.modal__body .form-group:last-child {
  margin-bottom: 0;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-12);
  padding: var(--space-16) var(--space-24);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ——— Фирменное окно подтверждения/уведомления (замена confirm()/alert()) ——— */

.modal--confirm {
  max-width: 440px;
}

.modal--confirm .modal__title-group {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  min-width: 0;
}

.modal--confirm .modal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-circle);
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 1.1rem;
}

.modal--confirm .modal__icon[data-tone="danger"] {
  background: var(--danger-soft);
  color: var(--danger);
}

.modal--confirm .modal__icon[data-tone="info"] {
  background: var(--info-soft);
  color: var(--info);
}

.modal--confirm .modal__message {
  margin: 0;
  line-height: 1.6;
  color: var(--text);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--danger:hover {
  filter: brightness(0.92);
}

.modal--channel-text {
  display: flex;
  flex-direction: column;
  max-width: 40rem;
  overflow: hidden;
}

.modal--channel-text .modal__header,
.modal--channel-text .modal__footer {
  flex-shrink: 0;
}

.modal--channel-text .modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.channel-export-prose {
  min-height: 12rem;
}

.channel-export-text-hint {
  margin-top: var(--space-16);
}

/* ——— Tariff status ——— */

.tariff-status__eyebrow {
  display: block;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: var(--space-12);
}

.tariff-status__row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-20);
  flex-wrap: wrap;
}

.tariff-status__plan-block {
  flex: 0 0 auto;
  min-width: 8rem;
}

.tariff-status__row .stat {
  flex: 1;
  min-width: 6.5rem;
}

.tariff-status__plan {
  margin: 0;
  font-size: var(--fs-2xl);
  line-height: 1.2;
}

.tariff-status__price {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .tariff-status__row {
    gap: var(--space-16);
  }

  .tariff-status__plan-block {
    flex: 1 1 100%;
  }

  .tariff-status__row .stat {
    flex: 1 1 calc(50% - var(--space-8));
  }
}

/* ——— Tariff page sections ——— */

.tariff-section {
  padding-top: var(--space-40);
}

.tariff-section__head {
  margin-bottom: var(--space-40);
  text-align: center;
}

.tariff-section__head h2 {
  font-size: var(--fs-xl);
}

.tariff-section__head p {
  margin: var(--space-4) auto 0;
  max-width: 70ch;
  font-size: var(--fs-base);
  color: var(--text-muted);
}

/* ——— Pricing grid ——— */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-16);
}

@media (max-width: 760px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

.pricing-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  position: relative;
}

.pricing-card--popular {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.pricing-card__badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-pill);
}

.pricing-card__head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pricing-card__name {
  font-weight: var(--fw-bold);
  font-size: var(--fs-base);
  color: var(--text-muted);
}

.pricing-card__price {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: var(--fw-semibold);
  color: var(--text);
}

.pricing-card__price span {
  font-family: var(--font);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
}

.pricing-card__price-note {
  font-size: var(--fs-2xs);
  color: var(--text-muted);
}

.pricing-card__pay-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.pricing-card__auto-renew {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  cursor: pointer;
}

.pricing-features {
  list-style: none;
  margin: 0;
  padding: var(--space-16) 0 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.pricing-features li {
  position: relative;
  padding-left: var(--space-28);
  font-size: var(--fs-base);
  line-height: 1.4;
  color: var(--text);
}

.pricing-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.7em;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: var(--radius-circle);
  background: var(--success-soft);
  color: var(--success);
  font-size: var(--fs-3xs);
  font-weight: var(--fw-black);
  display: grid;
  place-items: center;
}

.pricing-features li.is-off {
  color: var(--text-muted);
}

.pricing-features li.is-off::before {
  content: "–";
  background: var(--surface-2);
  color: var(--text-muted);
}

.pricing-features__hint {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ——— Narrow centered page ——— */

.page--narrow {
  max-width: 980px;
}

.page-header--center {
  display: block;
  text-align: center;
}

.page-header--center h1 {
  font-size: var(--fs-4xl);
}

.page-header--center p {
  margin: 0 auto;
}

/* ——— Free plan plate ——— */

.free-plate {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  margin-top: var(--space-20);
  padding-top: var(--space-20);
  border-top: 1px solid var(--border);
}

.free-plate__icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--text-muted);
}

.free-plate__desc {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  line-height: 1.45;
}

.free-plate--warning .free-plate__icon {
  background: var(--warning-soft);
  color: var(--warning);
}

.free-plate--warning .free-plate__desc {
  color: var(--warning);
}

/* ——— À la carte option rows ——— */

.option-row {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16) 0;
  border-bottom: 1px solid var(--border);
}

.option-row:last-child {
  border-bottom: none;
}

.option-row__icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--text-muted);
}

.option-row__icon--processing {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.option-row__icon--templates {
  background: #ece3f5;
  color: #6b4c9e;
}
.option-row__icon--exportopt {
  background: var(--info-soft);
  color: var(--info);
}
.option-row__icon--limit {
  background: var(--success-soft);
  color: var(--success);
}
.option-row__icon--watermark {
  background: var(--warning-soft);
  color: var(--warning);
}

.option-row__body {
  flex: 1;
  min-width: 0;
}

.option-row__title {
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
}

.option-row__desc {
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  margin-top: var(--space-2);
}

.option-row__meta {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .option-row {
    flex-wrap: wrap;
  }

  .option-row__meta {
    order: 3;
    margin-left: var(--space-56);
  }
}

/* ——— Agency banner ——— */

.agency-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-20);
  margin-top: var(--space-40);
  background: var(--surface-2);
  box-shadow: none;
  flex-wrap: wrap;
}

.agency-banner h3 {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-8);
}

.agency-banner p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  max-width: 46ch;
}

.info-banner {
  display: flex;
  gap: var(--space-12);
  padding: var(--space-16) var(--space-20);
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: var(--fs-sm);
  margin-bottom: var(--space-16);
}

.info-banner--success {
  background: var(--success-soft);
  border-color: rgba(63, 125, 92, 0.2);
}

.info-banner--error {
  background: var(--danger-soft);
  border-color: rgba(192, 57, 43, 0.2);
}

/* ——— Toast (flash-уведомления) ———
   Плавающий контейнер в правом нижнем углу для session('status') и т.п.
   Внутри — те же .info-banner/.info-banner--success/.info-banner--error,
   но с полупрозрачным размытым фоном и анимацией появления/скрытия.
   См. Docs/08-tech-notes.md §7. */

.toast-viewport {
  position: fixed;
  right: var(--space-20);
  bottom: var(--space-20);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-12);
  pointer-events: none;
  max-width: min(380px, calc(100vw - var(--space-40)));
}

.toast-viewport .info-banner {
  position: relative;
  align-items: center;
  width: 100%;
  padding: var(--space-16) var(--space-40) var(--space-16) var(--space-16);
  pointer-events: auto;
  color: #fff6ee;
  font-weight: 500;
  background: linear-gradient(135deg, rgba(156, 69, 38, 0.95), rgba(200, 92, 52, 0.92));
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 36px rgba(43, 36, 32, 0.3), 0 3px 10px rgba(43, 36, 32, 0.18);
  margin-bottom: 0;
  animation: toast-in 0.25s ease-out;
}

.toast-viewport .info-banner__icon {
  flex-shrink: 0;
  font-size: 1.15em;
  line-height: 1;
  color: #ffe1c9;
}

.toast-viewport .info-banner--error {
  background: linear-gradient(135deg, rgba(133, 32, 22, 0.95), rgba(178, 51, 38, 0.92));
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff1ef;
}

.toast-viewport .info-banner--error .info-banner__icon {
  color: #ffd6cf;
}

.toast-viewport .info-banner.is-leaving {
  animation: toast-out 0.2s ease-in forwards;
}

.info-banner__close {
  position: absolute;
  top: var(--space-8);
  right: var(--space-8);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.75;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: opacity 0.15s ease, background 0.15s ease;
}

.info-banner__close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.18);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@media (max-width: 640px) {
  .toast-viewport {
    left: var(--space-16);
    right: var(--space-16);
    bottom: var(--space-16);
    max-width: none;
    align-items: stretch;
  }
}

a.chip {
  text-decoration: none;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand-card__body.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ——— AI-редактор кадра (React-остров, Docs/12-ai-photo-retouch.md) ———
   Разметку рисует React, но стили живут здесь: остров переиспользует
   дизайн-систему сайта (.btn, .spinner, .info-banner), своих не тащит. */

/* Окно ровно по доступному месту и без своего скролла: единственная
   прокрутка на десктопе — лента чата. Высота считается от бэкдропа
   (`height: 100%`), а не в `vh`: иначе высота окна и отступы бэкдропа
   складываются и низ ленты версий уезжает за край экрана.
   Отсюда же `min-height: 0` на всех уровнях грида — без него блок
   не сжимается ниже контента и внутренний скролл не включается. */
.modal-backdrop--photo-editor {
  transition: opacity var(--transition-slow) ease;
}

/* Закрытие — не мгновенный display:none, а короткое затухание бэкдропа
   и «усыхание» окна (styles ниже, .modal--photo-editor): closeModal()
   (app.js) навешивает .is-closing и ждёт transitionend перед .hidden,
   чтобы «магия» плавно перетекла в свечение на плитке в галерее
   (.photo-item.is-ai-editing), если генерация ещё не закончилась. */
.modal-backdrop--photo-editor.is-closing {
  opacity: 0;
  pointer-events: none;
}

/* Открытие — то же самое состояние, что и .is-closing, но как стартовая
   точка: openModal() (app.js) навешивает класс синхронно с показом окна,
   затем снимает его на следующем кадре — получается вход тем же fade/scale,
   что и выход, только в обратную сторону. */
.modal-backdrop--photo-editor.is-opening {
  opacity: 0;
}

.modal-backdrop--photo-editor.is-opening .modal--photo-editor {
  transform: scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop--photo-editor {
    transition: none;
  }
}

/* Общая оболочка AI-редакторов: отдельные карточки контента, управления и чата;
   между ними виден бэкдроп. */
.ai-editor-modal {
  --ai-editor-sidebar-width: 380px;
  position: relative;
  width: 100%;
  max-width: 1080px;
  height: 100%;
  max-height: 780px;
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  background: transparent;
  box-shadow: none;
  transition: transform var(--transition-slow) ease;
}

.modal-backdrop--photo-editor.is-closing .modal--photo-editor {
  transform: scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
  .modal--photo-editor {
    transition: none;
  }
}

.ai-editor__layout {
  flex: 1;
  min-height: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--ai-editor-sidebar-width);
  grid-template-rows: minmax(0, 1fr);
  gap: var(--space-12);
}

.photo-editor__content {
  display: flex;
  min-width: 0;
  min-height: 0;
}

.ai-editor__sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-width: 0;
  min-height: 0;
}

/* Две отдельные подложки управления с просветом бэкдропа между ними. */
.ai-editor__toolbar {
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
  gap: var(--space-8);
}

.modal-backdrop--ai-editor { padding: var(--space-16); }

.ai-editor__toolbar-surface {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.photo-editor__navigation {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  padding: var(--space-2);
}

.photo-editor__navigation-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.photo-editor__navigation-button:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--accent);
}

.photo-editor__navigation-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.photo-editor__navigation-button:disabled {
  opacity: 0.3;
  cursor: default;
}

.photo-editor__position {
  color: var(--text-muted);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}

/* React-корень и сообщение загрузки делят оставшееся место; без
   `min-height: 0` flex-item держит высоту кадра и распирает окно. */
.modal--photo-editor [data-photo-editor-root],
.modal--photo-editor [data-photo-editor-message] {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ai-editor__panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: var(--space-20);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}

.ai-editor-modal [hidden] {
  display: none !important;
}

/* Крестик остаётся справа и при скрытой навигации единственного фото. */
.ai-editor__close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  min-height: 50px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1;
  cursor: pointer;
}

.modal-backdrop.is-overlay-hover .ai-editor__close,
.ai-editor__close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.photo-editor {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
}

.photo-editor__state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
  min-height: 320px;
  padding: var(--space-40);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.ai-editor__canvas, .photo-editor__main {
  min-width: 0;
  min-height: 0;
  padding: var(--space-12);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.photo-editor__main {
  flex: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: var(--space-12);
}

.photo-editor__viewer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-dark);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 0;
}

.photo-editor__viewer--generation {
  background: var(--surface-2);
}

.photo-editor__generation-spinner {
  position: absolute;
  top: var(--space-16);
  right: var(--space-16);
}

.photo-editor__generation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-16);
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: var(--space-24);
  overflow-y: auto;
  color: var(--text);
  text-align: center;
}

.photo-editor__generation-icon {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-circle);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 28px;
}

.photo-editor__generation-icon.is-failed { color: var(--danger); }
.photo-editor__generation .photo-editor__generation-logo { display: block; flex: 0 0 auto; width: 64px; height: 64px; object-fit: contain; }
.photo-editor__generation h3 { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: 1.3; }
.photo-editor__generation p { max-width: 36ch; margin: 0; font-size: var(--fs-sm); line-height: 1.6; }
.photo-editor__generation-hint { max-width: 36ch; color: #73675d; font-size: var(--fs-xs); line-height: 1.5; }

@media (max-width: 860px), (max-height: 600px) {
  .photo-editor__generation { gap: var(--space-8); padding: var(--space-12); }
  .photo-editor__generation-icon { width: 40px; height: 40px; font-size: 22px; }
  .photo-editor__generation .photo-editor__generation-logo { width: 40px; height: 40px; }
  .photo-editor__generation-spinner { top: var(--space-12); right: var(--space-12); }
  .photo-editor__generation h3 { font-size: var(--fs-lg); }
  .photo-editor__generation p { font-size: 13px; line-height: 1.5; }
}

/* Кадр занимает бокс вьюера и вписывается в него (`contain`):
   `max-height: 100%` при `height: auto` не работает — родитель сам
   растёт от интринсика вертикального фото, процент замыкается в круг
   и окно вылезает за экран. `height/width: 100%` привязывает размер
   к уже ограниченной строке грида (`minmax(0, 1fr)`). */
.photo-editor__viewer img {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Дата версии — оверлеем на кадре, чтобы не отнимать высоту отдельной
   строкой. Состояние «выбрана / можно выбрать» показывает соседняя
   кнопка/пометка (`__viewer-action`), здесь дублировать не нужно. */
.photo-editor__viewer-meta {
  position: absolute;
  left: var(--space-12);
  top: var(--space-12);
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-pill);
  background: rgba(26, 29, 36, 0.55);
  color: #fff;
  font-size: var(--fs-2xs);
}

.photo-editor__viewer-action {
  position: absolute;
  right: var(--space-12);
  top: var(--space-12);
  box-shadow: var(--shadow-sm);
}

/* Активная версия: на месте кнопки — неактивная пометка того же размера,
   чтобы угол кадра не «прыгал» при переключении версий. */
.photo-editor__viewer-action--static {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--btn-py-sm) var(--space-16);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-muted);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  white-space: nowrap;
}

.photo-editor__viewer-badge {
  position: absolute;
  left: var(--space-12);
  bottom: var(--space-12);
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-2xs);
  color: var(--text);
}

/* Лента версий — нативная горизонтальная прокрутка со scroll-snap
   (решение 2026-08-15): без карусель-библиотеки, свайп и инерция
   трекпада работают сами. */
.photo-editor__strip {
  display: flex;
  align-items: flex-start;
  gap: var(--space-8);
  /* Одинаковое место для загрузки, одного оригинала и истории со скроллом. */
  height: 88px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  padding-bottom: var(--space-8);
}

.photo-editor__strip--loading .photo-editor__thumb {
  cursor: default;
  pointer-events: none;
}

.photo-editor__thumb {
  position: relative;
  flex: 0 0 84px;
  scroll-snap-align: start;
  display: flex;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
}

.photo-editor__thumb:hover {
  border-color: var(--border-hover);
}

.photo-editor__thumb.is-selected {
  border-color: var(--accent);
}

.photo-editor__thumb img,
.photo-editor__thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 62px;
  object-fit: cover;
  background: var(--surface-2);
  color: var(--text-muted);
}

.photo-editor__thumb-placeholder.is-failed {
  color: var(--danger);
}

/* Номер версии на самом кадре — вместо подписи под ним (2026-08-16). */
.photo-editor__thumb-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: rgba(26, 29, 36, 0.6);
  color: #fff;
  font-size: var(--fs-3xs);
  line-height: 1.5;
  text-align: center;
}

.photo-editor__thumb-flag {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-circle);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
}

.photo-editor__chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* Лента лежит прямо на фоне колонки: белые баблы на бежевом дают контраст
   сами по себе, а лишний слой-подложка под ними добавлял только шума. */
.photo-editor__chat-feed,
.ai-editor__feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.photo-editor__chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.photo-editor__chat-empty-icon {
  margin-bottom: var(--space-12);
  font-size: var(--fs-3xl);
  line-height: 1;
  color: var(--accent);
}

.photo-editor__chat-empty-title {
  margin: 0 0 var(--space-8);
  max-width: 240px;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
  color: var(--text);
}

.photo-editor__chat-empty-text {
  margin: 0;
  max-width: 240px;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--text-muted);
}

/* Приветствие в ленте с историей: тот же заголовок, что в пустом
   состоянии, но компактной строкой над баблами — уезжает вверх
   вместе с ними, не прилипает. */
.photo-editor__chat-hello {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  flex: 0 0 auto;
  padding: var(--space-8) 0 var(--space-12);
}

.photo-editor__chat-hello i {
  font-size: var(--fs-lg);
  line-height: 1;
  color: var(--accent);
}

.photo-editor__chat-hello h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
  color: var(--text);
}

/* Бабл без рамки, белый на бежевой колонке: рамка делала сообщение
   похожим на редактируемое поле. Ширина одна на все сообщения — ленту
   с разной шириной и рваным краем читать заметно тяжелее. */
.photo-editor__message,
.ai-editor__message {
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius);
  background: var(--surface);
}

.photo-editor__message-text,
.ai-editor__message-text {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.photo-editor__message-status {
  display: block;
  font-size: var(--fs-3xs);
  color: var(--text-muted);
}

/* Текст ошибки от модели бывает длинным — в ленте показываем две строки,
   полный текст остаётся в подсказке. */
.photo-editor__message-status.is-failed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  color: var(--danger);
}

.photo-editor__chat-error {
  margin: 0;
}

/* Поле ввода с кнопкой отправки внутри (2026-08-16). */
.photo-editor__chat-input,
.ai-editor__composer {
  position: relative;
}

.photo-editor__chat-textarea,
.ai-editor__textarea {
  display: block;
  width: 100%;
  min-height: 0;
  max-height: 132px;
  padding: var(--space-12) var(--space-40) var(--space-12) var(--space-16);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  resize: none;
  overflow-y: auto;
  font-size: var(--fs-sm);
  line-height: 1.65;
}

.photo-editor__chat-send,
.ai-editor__send {
  position: absolute;
  right: var(--space-8);
  bottom: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--radius-circle);
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.photo-editor__chat-send:hover:not(:disabled),
.ai-editor__send:hover:not(:disabled) {
  background: var(--accent-hover);
}

.photo-editor__chat-send:disabled,
.ai-editor__send:disabled {
  opacity: 0.4;
  cursor: default;
}

.photo-editor__chat-send .spinner,
.ai-editor__send .spinner {
  border-color: rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
}

.ai-editor__textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft-2);
}

/* AI и ручная коррекция делят постоянную правую карточку. */
.photo-editor__tabs,
.ai-editor__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 0 0 auto;
  gap: var(--space-4);
  margin-bottom: var(--space-20);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.45);
}

.photo-editor__tab,
.ai-editor__tab {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-8);
  min-height: 42px;
  padding: var(--space-8);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: 1.4;
  cursor: pointer;
}

.photo-editor__tab.is-selected,
.ai-editor__tab[aria-selected="true"] {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.ai-editor__close:focus-visible,
.ai-editor__send:focus-visible,
.ai-editor__tab:focus-visible,
.photo-editor__tab:focus-visible,
.photo-editor__ratio:focus-visible,
.photo-editor__correction-reset:focus-visible,
.photo-editor__crop-frame:focus-visible,
.photo-editor__crop-handle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.photo-editor__context {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  min-height: 32px;
  color: var(--text-muted);
  font-size: var(--fs-2xs);
  line-height: 1.4;
}

.photo-editor__tab-panel,
.photo-editor__correction {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.photo-editor__correction-tools {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--space-24);
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-2) var(--space-2) var(--space-16);
}

.photo-editor__correction-field {
  display: block;
  flex: 0 0 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.photo-editor__correction-field legend,
.photo-editor__slider-label {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  width: 100%;
  padding: 0;
  margin-bottom: var(--space-12);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: 1.4;
}

.photo-editor__slider-label > span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
}

.photo-editor__correction-field legend > i,
.photo-editor__slider-label > span > i {
  flex: 0 0 18px;
  width: 18px;
  font-size: 18px;
  line-height: 1;
  text-align: center;
}

.photo-editor__ratios {
  display: grid;
  grid-template-columns: auto repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0;
}

.photo-editor__ratio {
  min-width: 0;
  min-height: 36px;
  padding: var(--space-4) var(--space-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: var(--fs-2xs);
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
}

.photo-editor__ratio.is-selected {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light, #fff0e8);
}

.photo-editor__correction-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-2xs);
  line-height: 1.5;
}

.photo-editor__slider-label {
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.photo-editor__slider-label output {
  min-width: 42px;
  text-align: right;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.photo-editor__slider input {
  display: block;
  width: 100%;
  height: 24px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.photo-editor__slider-scale {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-4);
  color: var(--text-muted);
  font-size: var(--fs-3xs);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.photo-editor__correction-reset {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  min-height: 32px;
  padding: var(--space-4) 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--fs-2xs);
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
}

.photo-editor__correction-reset:not(:disabled) {
  color: var(--accent);
}

.photo-editor__correction-reset:hover:not(:disabled) {
  color: var(--accent-hover);
}

.photo-editor__correction-footer {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: var(--space-12);
  padding-top: var(--space-12);
  border-top: 1px solid var(--border);
}

.photo-editor__correction-actions {
  display: flex;
  gap: var(--space-8);
}

.photo-editor__correction-save {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding-inline: var(--space-12);
  justify-content: center;
  gap: var(--space-8);
  font-weight: var(--fw-semibold);
  line-height: 1.4;
}

@media (max-width: 480px) {
  .photo-editor__correction-save {
    padding-inline: var(--space-8);
    font-size: var(--fs-2xs);
  }
}

.photo-editor__correction button:disabled,
.photo-editor__correction input:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Рамка накладывается на реальные границы contain-фото, без чёрных полей. */
.photo-editor__image-stage {
  position: absolute;
  inset: 0;
  min-width: 0;
  min-height: 0;
}

.photo-editor__transparency-background {
  position: absolute;
  background: #fff;
}

.photo-editor__image-stage > img {
  position: relative;
}

.photo-editor__correction-preview {
  position: absolute;
  pointer-events: none;
}

.photo-editor__crop-area {
  position: absolute;
  overflow: hidden;
  touch-action: none;
}

.photo-editor__crop-frame {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid #fff;
  box-shadow: 0 0 0 16000px rgba(0, 0, 0, 0.48);
  cursor: move;
  touch-action: none;
}

.photo-editor__crop-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to right, transparent calc(33.333% - 0.5px), rgba(255, 255, 255, 0.55) 33.333%, transparent calc(33.333% + 0.5px), transparent calc(66.666% - 0.5px), rgba(255, 255, 255, 0.55) 66.666%, transparent calc(66.666% + 0.5px)),
    linear-gradient(to bottom, transparent calc(33.333% - 0.5px), rgba(255, 255, 255, 0.55) 33.333%, transparent calc(33.333% + 0.5px), transparent calc(66.666% - 0.5px), rgba(255, 255, 255, 0.55) 66.666%, transparent calc(66.666% + 0.5px));
}

.photo-editor__crop-handle {
  position: absolute;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0 solid #fff;
  background: transparent;
  touch-action: none;
}

.photo-editor__crop-handle--nw { top: -1px; left: -1px; border-top-width: 3px; border-left-width: 3px; cursor: nwse-resize; }
.photo-editor__crop-handle--ne { top: -1px; right: -1px; border-top-width: 3px; border-right-width: 3px; cursor: nesw-resize; }
.photo-editor__crop-handle--sw { bottom: -1px; left: -1px; border-bottom-width: 3px; border-left-width: 3px; cursor: nesw-resize; }
.photo-editor__crop-handle--se { bottom: -1px; right: -1px; border-bottom-width: 3px; border-right-width: 3px; cursor: nwse-resize; }
.photo-editor__crop-area.is-disabled .photo-editor__crop-frame,
.photo-editor__crop-area.is-disabled .photo-editor__crop-handle { cursor: default; }

/* На узком экране колонка одна: фиксированная высота и общий `overflow:
   hidden` схлопнули бы чат, поэтому здесь возвращаем обычный скролл окна. */
@media (max-width: 860px), (max-height: 600px) {
  .ai-editor-modal {
    height: auto;
    max-height: 100%;
    overflow-y: auto;
  }

  .ai-editor__layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .photo-editor__main {
    grid-template-rows: auto auto;
  }

  .photo-editor__viewer {
    /* Высота не зависит от пропорций следующего фото и загрузки истории. */
    height: clamp(220px, 46vh, 460px);
    height: clamp(220px, 46svh, 460px);
    min-height: 0;
  }

  .photo-editor__viewer img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
  }

  .ai-editor__panel {
    flex: 0 0 auto;
    height: clamp(280px, 46vh, 480px);
    height: clamp(280px, 46svh, 480px);
  }
}

/* Место объекта: карта загружается только при открытии модалки. */
.modal--property-location { max-width: 900px; }
.property-location__address-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-16); }
.property-location__actions { display: flex; flex-wrap: wrap; gap: var(--space-8); margin: var(--space-16) 0; }
.property-location__actions [hidden] { display: none; }
.property-location__manual { margin-top: var(--space-16); }
.property-location__manual summary { cursor: pointer; color: var(--text-muted); font-size: var(--fs-sm); }
.property-location__canvas { height: clamp(250px, 40vh, 400px); width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; background: var(--surface-2); }
.property-location__candidates { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 12px 0; }
.property-location__candidates[hidden] { display: none; }
.property-location__coordinates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-16); margin-top: var(--space-16); }
.property-location__error { color: var(--danger, #b42318); }
.property-location__retry { margin-top: var(--space-8); }
.map-point-marker { width: 22px; height: 22px; border: 3px solid #fff; border-radius: 50%; background: var(--primary, #5b57e8); box-shadow: 0 2px 8px #0004; transform: translate(-50%, -50%); cursor: grab; }
@media (max-width: 600px) {
  .property-location__coordinates, .property-location__address-fields { grid-template-columns: 1fr; }
  .modal--property-location .modal__body { padding: var(--space-16); }
}

/* Адрес в мастере */
[data-wizard-location] [hidden] { display: none; }
.wizard-location__actions { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-bottom: var(--space-12); }
.wizard-location__canvas { height: clamp(260px, 42vh, 380px); }
@media (max-width: 600px) {
  .wizard__stepper { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .wizard__step { flex-direction: column; gap: 4px; font-size: 0.75rem; }
  .wizard__step-num { flex-shrink: 0; }
  .wizard__step-line { width: 8px; }
}

/* Рабочие разделы карточки — общие поверхность, типографика и шапка. */
.analysis-report,
.listing-workspace,
.photo-workspace-shell,
.export-workspace,
.valuation-workspace {
  padding: var(--space-28);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
}
:is(.analysis-report, .listing-workspace, .photo-workspace-shell, .property-preview, .export-workspace, .valuation-workspace) :is(h2, h3, h4, h5, h6),
.analysis-report .listing-scorecard__score { font-family: var(--font); }
:is(.analysis-report, .listing-workspace, .photo-workspace-shell, .property-preview, .export-workspace, .valuation-workspace) > .workspace-section__head {
  margin-bottom: var(--space-28);
  padding-bottom: var(--space-24);
  border-bottom: 1px solid var(--border);
}
:is(.analysis-report, .listing-workspace, .photo-workspace-shell, .property-preview, .export-workspace, .valuation-workspace) .workspace-section__head-main { grid-template-columns: minmax(0, 1fr); width: 100%; }
:is(.analysis-report, .listing-workspace, .photo-workspace-shell, .property-preview, .export-workspace, .valuation-workspace) .workspace-section__head-title { align-items: center; justify-content: space-between; gap: var(--space-20); }
:is(.analysis-report, .listing-workspace, .photo-workspace-shell, .property-preview, .export-workspace, .valuation-workspace) .workspace-section__head [data-ai-run-form] .btn,
.listing-audience__head [data-ai-run-form] .btn,
.export-workspace .export-card__actions > .btn,
.export-workspace .export-pdf__download,
.valuation-workspace [data-valuation-prepare],
.valuation-workspace [data-valuation-submit] {
  min-width: 232px;
  min-height: 56px;
  gap: var(--space-12);
  padding: var(--space-16) var(--space-28);
  border-radius: var(--radius);
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  line-height: 1.25;
  box-shadow: 0 4px 12px rgba(184, 84, 47, 0.2);
}
:is(.analysis-report, .listing-workspace, .photo-workspace-shell, .property-preview, .export-workspace, .valuation-workspace) .workspace-section__head [data-ai-run-form] .btn > i,
.listing-audience__head [data-ai-run-form] .btn > i { font-size: var(--fs-xl); }
:is(.analysis-report, .listing-workspace, .photo-workspace-shell, .property-preview, .export-workspace, .valuation-workspace) .workspace-section__head h2 {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-black);
  letter-spacing: -0.035em;
  line-height: 1.15;
}
:is(.analysis-report, .listing-workspace, .photo-workspace-shell, .property-preview, .export-workspace, .valuation-workspace) .workspace-section__head p { margin-top: var(--space-12); color: #73675d; font-size: var(--fs-sm); line-height: 1.6; }
.analysis-report .overview-grid { grid-template-columns: minmax(0, 1fr) var(--workspace-aside); gap: var(--space-28); }
.analysis-report .listing-analysis { max-width: none; min-width: 0; }
.analysis-report .listing-analysis__head { margin-bottom: var(--space-24); gap: var(--space-12); }
.analysis-report .listing-analysis__label {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.025em;
  text-transform: none;
  line-height: 1.3;
}
.analysis-report .listing-analysis__label > i { color: var(--accent-hover); font-size: var(--fs-sm); }
.analysis-report .listing-analysis__when { padding: var(--space-4) var(--space-8); border-color: var(--border); border-radius: var(--radius-sm); background: var(--bg); color: #73675d; font-weight: 400; }
.analysis-report .listing-analysis__meta,
.analysis-report .listing-analysis__history { font-weight: var(--fw-semibold); }
.analysis-report .listing-analysis__body { max-width: 88ch; padding-left: 0; border-left: 0; }
.analysis-report .listing-analysis__content { font-size: var(--fs-base); line-height: 1.75; overflow-wrap: anywhere; }
.analysis-report .listing-analysis__content p { font: inherit; color: var(--text); }
.analysis-report .listing-analysis__content > * + * { margin-top: var(--space-16); }
.analysis-report .listing-analysis__content :is(h1, h2, h3, h4, h5, h6) {
  margin-top: var(--space-28);
  color: var(--text);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  text-transform: none;
  line-height: 1.4;
}
.analysis-report .listing-analysis__content > :first-child { margin-top: 0; }
.analysis-report .listing-analysis__content strong { font-weight: var(--fw-semibold); }
.analysis-report .listing-analysis__content :is(ul, ol) { padding-left: var(--space-24); line-height: inherit; }
.analysis-report .listing-analysis__content ul { list-style: disc; }
.analysis-report .listing-analysis__content ol { list-style: decimal; }
.analysis-report .listing-analysis__content li { padding-left: 0; }
.analysis-report .listing-analysis__content li::before { content: none; }
.analysis-report .listing-analysis__content li::marker { color: var(--accent-hover); }
.analysis-report .listing-analysis__content > ul { padding-left: 0; list-style: none; }
.analysis-report .listing-analysis__content > ul > li { margin: 0; padding: var(--space-20) 0; border-bottom: 1px solid var(--border); }
.analysis-report .listing-analysis__content > ul > li:first-child { padding-top: 0; }
.analysis-report .listing-analysis__content > ul > li:last-child { padding-bottom: 0; border-bottom: 0; }
.analysis-report .listing-analysis__content > ul > li > strong:first-child,
.analysis-report .listing-analysis__content > ul > li > p:first-child > strong:first-child {
  display: block;
  margin-bottom: var(--space-8);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: -0.015em;
  line-height: 1.4;
}
.analysis-report .listing-analysis__content .listing-analysis__empty { color: #73675d; font-size: var(--fs-sm); line-height: 1.65; }

.analysis-report .listing-scorecard { min-width: 0; padding-left: var(--space-24); border-left: 1px solid var(--border); }
.analysis-report .listing-scorecard__head { margin-bottom: var(--space-20); }
.analysis-report .listing-scorecard__label { margin: 0; color: #73675d; font-size: var(--fs-2xs); font-weight: var(--fw-bold); letter-spacing: 0.07em; line-height: 1.5; }
.analysis-report .listing-scorecard__hero { align-items: flex-start; gap: var(--space-12); margin-bottom: var(--space-24); padding: 0; border-radius: 0; background: transparent; text-align: left; }
.analysis-report .listing-scorecard__hero[hidden] { display: none; }
.analysis-report .listing-scorecard__value { display: flex; align-items: baseline; gap: var(--space-8); }
.analysis-report .listing-scorecard__score { color: var(--accent-hover); font-size: calc(var(--fs-4xl) * 1.75); font-weight: var(--fw-black); letter-spacing: -0.05em; line-height: 1; }
.analysis-report .listing-scorecard__scale { color: #73675d; font-size: var(--fs-sm); font-weight: var(--fw-semibold); letter-spacing: 0; text-transform: none; }
.analysis-report .listing-scorecard__stars { color: var(--accent-hover); font-size: var(--fs-lg); }
.analysis-report .listing-scorecard__stars .bi-star { color: var(--border-hover); }
.analysis-report .listing-scorecard__breakdown { display: grid; gap: 0; padding: 0; border-top: 1px solid var(--border); }
.analysis-report .listing-scorecard__breakdown[hidden] { display: none; }
.analysis-report .listing-scorecard__item { padding: var(--space-12) 0; border-bottom: 1px solid var(--border); }
.analysis-report .listing-scorecard__item:last-child { border-bottom: 0; padding-bottom: 0; }
.analysis-report .listing-scorecard__item-label { color: #73675d; font-size: var(--fs-sm); font-weight: 400; }
.analysis-report .badge-score { gap: var(--space-8); padding: 0; border-radius: 0; background: transparent; color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.analysis-report .badge-score::before { content: ''; width: 6px; height: 6px; border-radius: var(--radius-circle); background: var(--border-hover); flex-shrink: 0; }
.analysis-report .badge-score--needs-work::before { background: var(--danger); }
.analysis-report .badge-score--normal::before { background: var(--warning); }
.analysis-report .badge-score--good::before { background: var(--info); }
.analysis-report .badge-score--excellent::before { background: var(--success); }
.analysis-report .badge-score--placeholder { min-height: 1rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.analysis-report .badge-score--placeholder::before { display: none; }
.analysis-report .listing-scorecard__empty { color: #73675d; text-align: left; line-height: 1.65; }

#overview .listing-audience { padding: var(--space-28); }
#overview .listing-audience :is(h3, h4, h5) { font-family: var(--font); }
#overview .listing-audience__head h3 { font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -0.025em; line-height: 1.3; }
#overview .listing-audience__head p { color: #73675d; font-size: var(--fs-sm); }
#overview .audience-segment { padding: var(--space-20); border: 0; border-radius: var(--radius); background: var(--bg); }
#overview .audience-segment h4 { font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: -0.02em; line-height: 1.4; }
#overview .audience-segment p,
#overview .audience-segment ul { font-size: var(--fs-sm); line-height: 1.7; }
#overview .audience-segment h5 { color: #73675d; font-size: var(--fs-2xs); font-weight: var(--fw-bold); letter-spacing: 0.05em; text-transform: uppercase; }
#overview .audience-segment li::marker { color: var(--accent-hover); }
#overview .listing-audience__caption { font-size: var(--fs-2xs); }

@media (max-width: 640px) {
  .listing-audience__head [data-ai-run-form] { width: 100%; }
  .listing-audience__head [data-ai-run-form] .btn { width: 100%; min-width: 0; white-space: normal; }
}

@media (max-width: 860px) {
  .analysis-report .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .analysis-report .listing-scorecard { padding-top: var(--space-24); padding-left: 0; border-top: 1px solid var(--border); border-left: 0; }
}
@media (max-width: 600px) {
  .analysis-report,
  .listing-workspace,
  .photo-workspace-shell,
  .export-workspace,
  .valuation-workspace,
  #overview .listing-audience { padding: var(--space-16); }
  :is(.analysis-report, .listing-workspace, .photo-workspace-shell, .property-preview, .export-workspace, .valuation-workspace) .workspace-section__head h2 { font-size: var(--fs-3xl); }
  :is(.analysis-report, .listing-workspace, .photo-workspace-shell, .property-preview, .export-workspace, .valuation-workspace) .workspace-section__head [data-ai-run-form] { width: 100%; margin-left: 0; }
  :is(.analysis-report, .listing-workspace, .photo-workspace-shell, .property-preview, .export-workspace, .valuation-workspace) .workspace-section__head [data-ai-run-form] .btn { width: 100%; min-width: 0; }
  .analysis-report .listing-scorecard__score { font-size: calc(var(--fs-4xl) * 1.5); }
  .analysis-report .listing-analysis__when { flex-wrap: wrap; white-space: normal; }
}

/* Объявление: полотно текста и характеристики на одной поверхности. */
.listing-workspace .listing-editor { grid-template-columns: minmax(0, 1fr) var(--workspace-aside); align-items: start; gap: var(--space-28); }
.listing-workspace .listing-editor__main { min-width: 0; }
.listing-workspace :is(.text-block__head, .listing-params__head) { flex-wrap: wrap; margin-bottom: var(--space-24); }
.listing-workspace :is(.text-block__head, .listing-params__head) h3 {
  color: var(--text);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.025em;
  line-height: 1.3;
}
.listing-workspace .text-block__head-actions { flex-shrink: 0; }
.listing-workspace .text-block__view { min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.listing-workspace .text-block__text { max-width: 88ch; font-size: var(--fs-base); line-height: 1.75; overflow-wrap: anywhere; }
.listing-workspace .text-block__text > * { margin: 0; }
.listing-workspace .text-block__text > * + * { margin-top: var(--space-16); }
.listing-workspace .text-block__text p { font: inherit; }
.listing-workspace .text-block__text > p:first-child { font-size: var(--fs-lg); line-height: 1.6; }
.listing-workspace .text-block__text :is(h1, h2, h3, h4, h5, h6) {
  margin-top: var(--space-28);
  color: var(--text);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  text-transform: none;
  line-height: 1.4;
}
.listing-workspace .text-block__text > :first-child { margin-top: 0; }
.listing-workspace .text-block__text strong { font-weight: var(--fw-semibold); }
.listing-workspace .text-block__text :is(ul, ol) { padding-left: var(--space-24); line-height: inherit; }
.listing-workspace .text-block__text ul { list-style: disc; }
.listing-workspace .text-block__text ol { list-style: decimal; }
.listing-workspace .text-block__text li { padding-left: 0; }
.listing-workspace .text-block__text li::before { content: none; }
.listing-workspace .text-block__text li::marker { color: var(--accent-hover); }
.listing-workspace .text-block__text li > p { margin: 0; }
.listing-workspace .text-block__text a { color: var(--accent-hover); text-decoration: underline; }
.listing-workspace .text-block__view > .text-block__empty { color: #73675d; font-size: var(--fs-base); line-height: 1.65; }
.listing-workspace .listing-textarea { min-height: 420px; padding: var(--space-20); border-width: 1px; background: var(--bg); line-height: 1.75; }
.listing-workspace .text-block__actions { flex-wrap: wrap; margin-top: var(--space-16); }
.listing-workspace .text-block__actions .btn { min-height: 44px; padding: var(--space-12) var(--space-20); font-size: var(--fs-sm); }
.listing-workspace .listing-params { min-width: 0; padding-left: var(--space-24); border-left: 1px solid var(--border); }
.listing-workspace .listing-params__list { margin: 0; }
.listing-workspace .param-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--space-12); padding: var(--space-12) 0; }
.listing-workspace .param-row dt { color: #73675d; overflow-wrap: anywhere; }
.listing-workspace .param-row dd { margin: 0; font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.listing-workspace .param-row--price { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); padding-top: 0; padding-bottom: var(--space-20); }
.listing-workspace .param-row--price dt { font-size: var(--fs-2xs); letter-spacing: 0.06em; text-transform: uppercase; }
.listing-workspace .param-row--price dd { color: var(--accent-hover); font-size: var(--fs-3xl); font-weight: var(--fw-bold); letter-spacing: -0.025em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.listing-workspace .param-row .param-row__empty { color: #73675d; font-size: var(--fs-sm); font-weight: 400; letter-spacing: normal; }
.listing-workspace .param-row:last-child { padding-bottom: 0; }

@media (max-width: 860px) {
  .listing-workspace .listing-editor { grid-template-columns: minmax(0, 1fr); }
  .listing-workspace .listing-params { padding-top: var(--space-24); padding-left: 0; border-top: 1px solid var(--border); border-left: 0; }
}

/* Фото: широкая галерея, служебные счётчики и вспомогательные заметки. */
.photo-workspace-shell [data-ai-describe-form][hidden] { display: none; }
.photo-workspace-shell .workspace-section__head--photos { gap: var(--space-16); }
.photo-workspace-shell .workspace-section__head-subtitle { display: block; }
.photo-workspace-shell .workspace-section__head-subtitle p { max-width: 88ch; margin: 0; }
.photo-workspace-shell .status-strip__items { gap: var(--space-12) var(--space-24); }
.photo-workspace-shell .status-strip__item { gap: var(--space-8); padding: 0; border-radius: 0; background: transparent; font-size: var(--fs-sm); }
.photo-workspace-shell .status-strip__label { color: #73675d; }
.photo-workspace-shell .status-strip__value { color: var(--text); font-size: var(--fs-base); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.photo-workspace-shell .status-strip__icon { color: #73675d; font-size: var(--fs-base); }
.photo-workspace-shell .photo-workspace { grid-template-columns: minmax(0, 1fr); }
.photo-workspace-shell .photo-workspace__main { min-width: 0; }
.photo-workspace-shell .photo-workspace__gallery-title,
.photo-workspace-shell .ai-prose__label {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.025em;
  text-transform: none;
  line-height: 1.3;
}
.photo-workspace-shell .photo-workspace__gallery-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-12) var(--space-20); margin-bottom: var(--space-24); }
.photo-workspace-shell .photo-workspace__auto-enhance { min-height: 44px; white-space: nowrap; }
.photo-workspace-shell .photo-workspace__auto-enhance > i { color: var(--accent-hover); font-size: var(--fs-lg); }
.photo-workspace-shell .photo-workspace__auto-enhance-progress { margin: calc(-1 * var(--space-12)) 0 var(--space-20); color: #73675d; font-size: var(--fs-sm); line-height: 1.6; }
.photo-workspace-shell .photo-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-16); }
.photo-workspace-shell :is(.photo-item, .photo-add-tile) { border-radius: var(--radius); }
.photo-workspace-shell :is(.photo-gallery__dropzone, .photo-add-tile) { border-width: 1px; background: var(--bg); }
.photo-workspace-shell :is(.photo-gallery__dropzone, .photo-add-tile):is(:hover, .is-dragover) { background: var(--accent-soft-2); }
.photo-workspace-shell .photo-gallery__dropzone p { font-family: var(--font); font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -0.025em; }
.photo-workspace-shell .photo-gallery__dropzone span { color: #73675d; }
.photo-workspace-shell .photo-add-tile__icon { color: var(--accent-hover); font-size: var(--fs-4xl); font-weight: 400; }
.photo-workspace-shell .photo-add-tile__label { color: #73675d; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.photo-workspace-shell .photo-gallery-group { padding: var(--space-20); border: 0; background: var(--bg); }
.photo-workspace-shell .photo-gallery-group__head { min-height: 32px; color: #73675d; font-size: var(--fs-base); }
.photo-workspace-shell .photo-gallery-group__head:is(:hover, :focus-visible) { color: var(--text); }
.photo-workspace-shell .photo-gallery-group__body { margin-top: var(--space-20); }
.photo-workspace-shell .ai-prose { margin-top: var(--space-28); padding-top: var(--space-28); border-top: 1px solid var(--border); }
.photo-workspace-shell .ai-prose__head { align-items: center; margin-bottom: var(--space-20); }
.photo-workspace-shell .ai-prose__label > i { color: var(--accent-hover); font-size: var(--fs-base); }
.photo-workspace-shell .ai-prose__body { max-width: 88ch; padding-left: 0; border-left: 0; }
.photo-workspace-shell .ai-prose__text { font-size: var(--fs-base); line-height: 1.75; max-height: calc(1.75em * 3); overflow-wrap: anywhere; }
.photo-workspace-shell .ai-prose__text p { font: inherit; }
.photo-workspace-shell .ai-prose__text > * + * { margin-top: var(--space-16); }
.photo-workspace-shell .ai-prose__text :is(h1, h2, h3, h4, h5, h6) { color: var(--text); font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: -0.02em; text-transform: none; line-height: 1.4; }
.photo-workspace-shell .ai-prose__text strong { font-weight: var(--fw-semibold); }
.photo-workspace-shell .ai-prose__text :is(ul, ol) { padding-left: var(--space-24); line-height: inherit; }
.photo-workspace-shell .ai-prose__text ul { list-style: disc; }
.photo-workspace-shell .ai-prose__text ol { list-style: decimal; }
.photo-workspace-shell .ai-prose__text li { padding-left: 0; }
.photo-workspace-shell .ai-prose__text li::before { content: none; }
.photo-workspace-shell .ai-prose__text li::marker { color: var(--accent-hover); }
.photo-workspace-shell .ai-prose__empty { color: #73675d; font-size: var(--fs-sm); line-height: 1.65; }
.photo-workspace-shell .ai-prose__more { margin-top: var(--space-16); margin-left: 0; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.photo-workspace-shell .ai-prose__form { max-width: 88ch; }
.photo-workspace-shell .ai-prose__textarea { padding: var(--space-20); border-width: 1px; background: var(--bg); line-height: 1.75; }
.photo-workspace-shell .text-block__actions { flex-wrap: wrap; margin-top: var(--space-16); }
.photo-workspace-shell .text-block__actions .btn { min-height: 44px; padding: var(--space-12) var(--space-20); font-size: var(--fs-sm); }

@media (max-width: 860px) {
  .photo-workspace-shell .photo-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .photo-workspace-shell .photo-workspace__auto-enhance { width: 100%; }
  .photo-workspace-shell .photo-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12); }
  .photo-workspace-shell .photo-gallery-group { padding: var(--space-12); }
}

/* Экспорт: площадки, PDF и готовые материалы на одной поверхности. */
.export-workspace .export-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-20); }
.export-workspace .export-card { min-width: 0; padding: var(--space-20); gap: var(--space-16); border: 0; border-radius: var(--radius); background: var(--bg); box-shadow: none; }
.export-workspace .export-card--empty { grid-column: 1 / -1; }
.export-workspace .export-card__head { display: flex; align-items: center; gap: var(--space-12); min-width: 0; }
.export-workspace .export-card h3,
.export-workspace .export-pdf h3,
.export-workspace .channel-materials__title { margin: 0; color: var(--text); font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -0.025em; line-height: 1.3; overflow-wrap: anywhere; }
.export-workspace .export-card__icon { width: 40px; height: 40px; flex-shrink: 0; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--accent-hover); font-family: var(--font); font-size: var(--fs-2xs); font-weight: var(--fw-bold); }
.export-workspace :is(.export-card > p, .export-pdf__copy > p) { margin: 0; color: #73675d; font-size: var(--fs-sm); line-height: 1.65; }
.export-workspace .export-card__meta { color: #73675d; font-size: var(--fs-2xs); font-weight: 400; line-height: 1.6; overflow-wrap: anywhere; }
.export-workspace .export-card__previews { gap: var(--space-16); }
.export-workspace .export-card__preview-label { color: #73675d; font-family: var(--font); font-size: var(--fs-2xs); }
.export-workspace .export-card__brand { margin-top: 0; padding-top: var(--space-16); }
.export-workspace .export-card__brand > .toggle-row { padding-top: 0; color: var(--text); font-size: var(--fs-base); }
.export-workspace .export-card__brand-layers { padding-left: 0; }
.export-workspace [data-export-brand-layers][hidden] { display: none; }
.export-workspace .export-card__brand-layers .toggle-row { gap: var(--space-12); color: #73675d; font-weight: 400; }
.export-workspace .export-card__brand-layers .status-list__note { font-size: var(--fs-2xs); line-height: 1.6; }
.export-workspace .export-card__actions { padding-top: var(--space-8); }
.export-workspace .export-card__actions > .btn { min-width: 0; white-space: normal; }
.export-workspace .export-pdf { display: grid; grid-template-columns: minmax(0, 1fr) var(--workspace-aside); gap: var(--space-28); margin-top: var(--space-28); padding-top: var(--space-28); border-top: 1px solid var(--border); }
.export-workspace .export-pdf__copy { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-16); min-width: 0; }
.export-workspace .export-pdf__copy > p { max-width: 60ch; }
.export-workspace .export-pdf__download { margin-top: var(--space-4); }
.export-workspace .export-pdf__settings { min-width: 0; padding-left: var(--space-24); border-left: 1px solid var(--border); }
.export-workspace .export-pdf__settings .export-card__brand { padding-top: 0; border-top: 0; }
.export-workspace .channel-materials { margin-top: var(--space-28); padding-top: var(--space-28); }
.export-workspace .channel-materials__title { display: flex; align-items: center; gap: var(--space-12); margin-bottom: var(--space-24); }
.export-workspace .channel-materials__title-icon { width: 24px; height: 24px; color: var(--accent); }
.export-workspace .channel-materials__empty { color: #73675d; line-height: 1.65; }
.export-workspace .channel-materials__list { gap: var(--space-12); }
.export-workspace .channel-materials__row { gap: var(--space-16); padding: var(--space-16); border: 0; background: var(--bg); }
.export-workspace .channel-materials__row.is-failed { background: var(--danger-soft); }
.export-workspace .channel-materials__icon { width: 40px; height: 40px; border: 0; background: var(--surface); color: var(--accent-hover); font-family: var(--font); }
.export-workspace .channel-materials__platform-name { font-size: var(--fs-base); font-weight: var(--fw-bold); }
.export-workspace .channel-materials__date { color: #73675d; line-height: 1.6; }
.export-workspace .channel-materials__error { font-size: var(--fs-sm); line-height: 1.6; }
.export-workspace .channel-materials__title-line .tag { gap: var(--space-8); padding: 0; background: transparent; color: #73675d; font-weight: var(--fw-semibold); }
.export-workspace .channel-materials__title-line .tag--danger { color: var(--danger); }
.export-workspace .channel-materials__title-line :is(.tag--ready, .tag--danger)::before { content: ''; width: 6px; height: 6px; flex-shrink: 0; border-radius: var(--radius-circle); background: var(--success); }
.export-workspace .channel-materials__title-line .tag--danger::before { background: var(--danger); }
.export-workspace .channel-materials__actions .btn { min-width: 0; min-height: 44px; padding: var(--space-12) var(--space-16); font-size: var(--fs-sm); background: var(--surface); border-color: var(--border); }
.export-workspace .channel-materials__actions .btn:hover:not(:disabled) { background: var(--accent-soft-2); color: var(--accent-hover); }

#channel-export-text-modal :is(h2, h3, h4, h5, h6) { font-family: var(--font); }
#channel-export-text-modal .modal__header h2 { font-size: var(--fs-3xl); font-weight: var(--fw-black); letter-spacing: -0.025em; line-height: 1.25; }
#channel-export-text-modal .channel-export-prose { color: var(--text); font-size: var(--fs-base); line-height: 1.75; overflow-wrap: anywhere; }
#channel-export-text-modal .channel-export-prose > * + * { margin-top: var(--space-16); }
#channel-export-text-modal .channel-export-prose p { font: inherit; }
#channel-export-text-modal .channel-export-prose :is(h1, h2, h3, h4, h5, h6) { margin-top: var(--space-28); color: var(--text); font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: -0.02em; text-transform: none; line-height: 1.4; }
#channel-export-text-modal .channel-export-prose > :first-child { margin-top: 0; }
#channel-export-text-modal .channel-export-prose strong { font-weight: var(--fw-semibold); }
#channel-export-text-modal .channel-export-prose :is(ul, ol) { padding-left: var(--space-24); line-height: inherit; }
#channel-export-text-modal .channel-export-prose ul { list-style: disc; }
#channel-export-text-modal .channel-export-prose ol { list-style: decimal; }
#channel-export-text-modal .channel-export-prose li { padding-left: 0; }
#channel-export-text-modal .channel-export-prose li::before { content: none; }
#channel-export-text-modal .channel-export-prose li::marker { color: var(--accent-hover); }
#channel-export-text-modal .channel-export-prose li > p { margin: 0; }
#channel-export-text-modal .channel-export-prose .channel-export-prose__empty { color: #73675d; font-size: var(--fs-sm); }

@media (max-width: 1000px) {
  .export-workspace .export-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .export-workspace .export-pdf { grid-template-columns: minmax(0, 1fr); }
  .export-workspace .export-pdf__settings { padding-top: var(--space-24); padding-left: 0; border-top: 1px solid var(--border); border-left: 0; }
  .export-workspace .channel-materials__row { flex-wrap: wrap; }
  .export-workspace .channel-materials__actions { margin-left: calc(40px + var(--space-16)); width: calc(100% - 40px - var(--space-16)); }
}
@media (max-width: 640px) {
  .export-workspace .export-grid { grid-template-columns: minmax(0, 1fr); }
  .export-workspace .channel-materials__actions { width: 100%; margin-left: 0; }
  .export-workspace .channel-materials__actions .btn { flex: 1; }
}
@media (max-width: 600px) {
  .export-workspace .export-card { padding: var(--space-16); }
  .export-workspace .export-pdf__download { width: 100%; min-width: 0; white-space: normal; }
}

/* Рыночная оценка: расчёт и данные на общей поверхности без вложенных панелей. */
.valuation-workspace { min-width: 0; }
.valuation-workspace > .workspace-section__head { align-items: center; }
.valuation-workspace__actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-12); }
.valuation-workspace__actions > .btn--secondary,
.valuation-workspace .valuation-form__actions > .btn--secondary { min-height: 44px; font-size: var(--fs-sm); }
.valuation-workspace [data-valuation-prepare] { margin-bottom: 0; }
.valuation-workspace :is([data-valuation-prepare], [data-valuation-form], [data-valuation-message])[hidden] { display: none; }
.valuation-workspace :is(.valuation-form, .valuation-section) h3 { margin: 0; color: var(--text); font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -0.025em; line-height: 1.3; overflow-wrap: anywhere; }
.valuation-workspace .valuation-form { margin: 0 0 var(--space-28); padding: var(--space-24); border: 0; border-radius: var(--radius); background: var(--bg); }
.valuation-workspace .valuation-form > p { margin: var(--space-12) 0 0; color: #73675d; font-size: var(--fs-sm); line-height: 1.65; }
.valuation-workspace .valuation-form-grid { gap: var(--space-20); margin: var(--space-24) 0; }
.valuation-workspace .valuation-form-grid label { gap: var(--space-8); color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.valuation-workspace .valuation-form-grid :is(input, select) { min-height: 44px; font-size: var(--fs-base); font-weight: 400; }
.valuation-workspace .valuation-form-grid small { color: #73675d; font-size: var(--fs-2xs); font-weight: 400; line-height: 1.6; }
.valuation-workspace .valuation-form__actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-12); margin-top: var(--space-20); }
.valuation-workspace :is(.valuation-unavailable, .valuation-state, [data-valuation-message]) { padding: var(--space-16) var(--space-20); border: 0; border-radius: var(--radius); background: var(--bg); color: #73675d; font-size: var(--fs-sm); line-height: 1.65; overflow-wrap: anywhere; }
.valuation-workspace .valuation-unavailable { margin: 0 0 var(--space-28); }
.valuation-workspace [data-valuation-message] { margin: 0 0 var(--space-28); }
.valuation-workspace .valuation-state { margin: 0; }
.valuation-workspace .valuation-state p { margin: 0; font: inherit; }
.valuation-workspace .valuation-state.is-error { background: var(--danger-soft); color: var(--danger); }
.valuation-workspace .valuation-section { min-width: 0; margin-top: var(--space-28); padding-top: var(--space-28); border-top: 1px solid var(--border); }
.valuation-workspace .valuation-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.valuation-workspace .valuation-section__head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: var(--space-8) var(--space-20); margin-bottom: var(--space-20); }
.valuation-workspace .valuation-section__head > p { margin: 0; color: #73675d; font-size: var(--fs-2xs); line-height: 1.6; }
.valuation-workspace .valuation-section > p { margin: var(--space-12) 0 0; font-size: var(--fs-sm); line-height: 1.65; overflow-wrap: anywhere; }
.valuation-workspace .valuation-section > .text-muted { color: #73675d; }
.valuation-workspace .valuation-notice { padding: var(--space-12) var(--space-16); border-radius: var(--radius-sm); background: var(--warning-soft); color: var(--warning); }
.valuation-workspace .valuation-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--space-16); margin: var(--space-24) 0; }
.valuation-workspace .valuation-prices__item { min-width: 0; align-content: start; gap: var(--space-8); padding: var(--space-20); border-radius: var(--radius); background: var(--bg); overflow-wrap: anywhere; }
.valuation-workspace .valuation-prices__label { color: #73675d; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.valuation-workspace .valuation-prices__value { color: var(--accent-hover); font-size: var(--fs-4xl); font-weight: var(--fw-black); letter-spacing: -0.035em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.valuation-workspace :is(.valuation-prices__unit, .valuation-prices__comparison) { color: #73675d; font-size: var(--fs-sm); line-height: 1.6; font-variant-numeric: tabular-nums; }
.valuation-workspace .valuation-block { margin-top: var(--space-20); }
.valuation-workspace details > summary { padding: var(--space-12) 0; color: var(--text); font-size: var(--fs-base); font-weight: var(--fw-semibold); line-height: 1.5; cursor: pointer; }
.valuation-workspace details > summary::marker { color: var(--accent); }
.valuation-workspace details > summary:hover { color: var(--accent-hover); }
.valuation-workspace details > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.valuation-workspace details > :is(p, h4) { margin: var(--space-12) 0 0; font-size: var(--fs-sm); line-height: 1.65; }
.valuation-workspace details > h4 { font-size: var(--fs-xl); font-weight: var(--fw-bold); }
.valuation-workspace .valuation-parameters { gap: var(--space-16) var(--space-24); margin: 0; padding: var(--space-12) 0; font-size: var(--fs-sm); line-height: 1.6; }
.valuation-workspace .valuation-parameters > div { min-width: 0; overflow-wrap: anywhere; }
.valuation-workspace .valuation-parameters dt { color: #73675d; font-size: var(--fs-2xs); }
.valuation-workspace .valuation-parameters dd { font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.valuation-workspace .valuation-offers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-16); margin-top: var(--space-24); }
.valuation-workspace .valuation-offer { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-12); min-width: 0; padding: var(--space-20); border: 0; border-radius: var(--radius); background: var(--bg); overflow-wrap: anywhere; }
.valuation-workspace .valuation-offer h4 { margin: 0; color: var(--text); font-size: var(--fs-lg); font-weight: var(--fw-bold); line-height: 1.4; }
.valuation-workspace .valuation-offer p { margin: 0; }
.valuation-workspace .valuation-offer__price { color: var(--text); font-size: var(--fs-base); font-weight: var(--fw-semibold); line-height: 1.6; font-variant-numeric: tabular-nums; }
.valuation-workspace .valuation-offer__meta { color: #73675d; font-size: var(--fs-sm); line-height: 1.65; }
.valuation-workspace .valuation-offer__link { display: inline-flex; align-items: center; min-height: 44px; margin-top: auto; color: var(--accent-hover); font-size: var(--fs-sm); font-weight: var(--fw-semibold); text-decoration: underline; text-underline-offset: 3px; }
.valuation-workspace .valuation-offer__link:hover { color: var(--text); }
.valuation-workspace .valuation-offers > .text-muted { margin: 0; color: #73675d; font-size: var(--fs-sm); line-height: 1.65; }
.valuation-workspace .valuation-table-scroll { margin-top: var(--space-20); }
.valuation-workspace .valuation-table { font-size: var(--fs-sm); line-height: 1.6; }
.valuation-workspace .valuation-table :is(th, td) { padding: var(--space-12) var(--space-16); }
.valuation-workspace .valuation-table th { background: var(--bg); color: #73675d; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); }
.valuation-workspace .valuation-table td { font-variant-numeric: tabular-nums; }
.valuation-workspace .valuation-chart { margin: var(--space-20) 0 0; }
.valuation-workspace .valuation-chart figcaption { color: var(--text); font-size: var(--fs-base); font-weight: var(--fw-semibold); line-height: 1.5; }
.valuation-workspace .valuation-chart svg { max-width: none; margin: var(--space-16) 0; }
.valuation-workspace .valuation-chart svg text { fill: #73675d; font-family: var(--font); }
.valuation-workspace .valuation-chart > .text-muted { font-size: var(--fs-sm); line-height: 1.65; }
@media (max-width: 860px) {
  .valuation-workspace .valuation-offers { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .valuation-workspace__actions { width: 100%; flex-direction: column-reverse; align-items: stretch; }
  .valuation-workspace :is([data-valuation-prepare], [data-valuation-submit]) { width: 100%; min-width: 0; white-space: normal; }
  .valuation-workspace .valuation-form { padding: var(--space-16); }
  .valuation-workspace .valuation-form__actions { align-items: stretch; flex-direction: column; }
  .valuation-workspace .valuation-form__actions > .btn { width: 100%; white-space: normal; }
  .valuation-workspace .valuation-prices { grid-template-columns: minmax(0, 1fr); }
  .valuation-workspace .valuation-prices__value { font-size: var(--fs-3xl); }
}

/* Купон на экране тарифа. */
.tariff-coupon { margin-bottom: var(--space-24); }
.tariff-coupon__fields { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-8) var(--space-16); min-width: 0; margin: 0; }
.tariff-coupon__fields > label { grid-column: 1 / -1; grid-row: 1; margin: 0; }
.tariff-coupon__fields > .form-input { grid-column: 1; grid-row: 2; min-width: 0; }
.tariff-coupon__fields > .form-input[aria-invalid="true"] { border-color: var(--danger); }
.tariff-coupon__submit { grid-column: 2; grid-row: 2; align-self: stretch; white-space: nowrap; }
.tariff-coupon__error { grid-column: 1 / -1; grid-row: 3; margin: 0; color: var(--danger); font-size: var(--fs-sm); line-height: 1.5; overflow-wrap: anywhere; }
.tariff-coupon__status { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.tariff-coupon__status p { flex: 1 1 240px; margin: 0; color: var(--text-muted); }
.pricing-card__original-price { display: block; color: var(--text-muted); font-size: var(--fs-sm); font-weight: 400; }
@media (max-width: 600px) {
  .tariff-coupon__fields { grid-template-columns: minmax(0, 1fr); }
  .tariff-coupon__error,
  .tariff-coupon__submit { grid-column: 1; grid-row: auto; }
}

/* Улучшение готового текста: исходник и предложение до явного применения. */
.listing-workspace .text-block__head { flex-wrap: wrap; }
.listing-workspace .text-block__head-actions { flex-wrap: wrap; max-width: 100%; gap: var(--space-8); }
.listing-workspace [data-improve-listing-open] { color: var(--text-muted); }
.listing-workspace [data-improve-listing-open]:hover { color: var(--accent-hover); }
.listing-workspace [data-insert-listing-text] { margin-top: var(--space-16); }
/* Редактор текста: одна рабочая версия и диалог, в стиле редактора фото. */

.listing-editor-chat__document {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}
.listing-editor-chat__document-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-12) var(--space-16); flex-shrink: 0; }
.listing-editor-chat__document-footer .listing-editor-chat__status { grid-column: 1 / -1; max-height: 100px; overflow-y: auto; }
.listing-editor-chat__document-footer .btn { min-height: 44px; white-space: normal; }

.listing-editor-chat__toolbar h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: var(--space-8) var(--space-16);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.listing-editor-chat__document-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; flex-shrink: 0; gap: var(--space-8) var(--space-12); }
.listing-editor-chat__document-head h3 { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-bold); line-height: 1.4; }
.listing-editor-chat__reset { min-height: 32px; padding: var(--space-4) var(--space-8); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); white-space: normal; }

.listing-editor-chat__pane { flex: 1; min-height: 0; }
.listing-editor-chat__text { display: block; width: 100%; height: 100%; min-height: 0; padding: var(--space-20); resize: none; overflow-y: auto; overscroll-behavior: contain; font-size: 16px; line-height: 1.75; background: var(--surface); }
.listing-editor-chat__text[readonly] { background: var(--bg); }
.listing-editor-chat__note { flex-shrink: 0; margin: 0; color: #73675d; font-size: var(--fs-2xs); line-height: 1.5; }
.listing-editor-chat__status { flex-shrink: 0; margin: 0; color: #73675d; font-size: var(--fs-sm); line-height: 1.5; overflow-wrap: anywhere; }
.listing-editor-chat__status:empty { display: none; }
.listing-editor-chat__status.is-error { color: var(--danger); }

.listing-editor-chat__assistant { gap: var(--space-12); }
.listing-editor-chat__assistant > h3 { flex-shrink: 0; display: flex; align-items: center; gap: var(--space-8); margin: 0; font-size: 18px; font-weight: 700; }
.listing-editor-chat__assistant > h3 i { color: var(--accent); }

.listing-editor-chat__welcome { padding: var(--space-24) var(--space-4); color: #73675d; font-size: var(--fs-sm); line-height: 1.7; }
.listing-editor-chat__welcome p { margin: var(--space-8) 0 0; }
.listing-editor-chat__welcome .listing-editor-chat__welcome-title { margin-top: 0; color: var(--text); font-size: 18px; font-weight: 700; }
[data-editor-messages] {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.listing-editor-chat__speaker { display: block; margin-bottom: var(--space-4); color: #73675d; font-size: var(--fs-2xs); font-weight: 600; }
.listing-editor-chat__bubble p {
  white-space: pre-wrap;
}
.listing-editor-chat__waiting { display: flex; align-items: center; gap: var(--space-8); margin: var(--space-16) 0 0; color: #73675d; font-size: var(--fs-sm); }
.listing-editor-chat__quick-actions { display: flex; flex-wrap: wrap; flex-shrink: 0; gap: var(--space-8); }
.listing-editor-chat__quick-actions button { min-height: 32px; padding: var(--space-4) var(--space-12); border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: #73675d; font-size: var(--fs-2xs); line-height: 1.5; text-align: left; cursor: pointer; }
.listing-editor-chat__quick-actions button:hover { color: var(--accent-hover); border-color: var(--accent); }
.listing-editor-chat__quick-actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.listing-editor-chat__quick-actions button:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 860px), (max-height: 600px) {
  .listing-editor-chat__document { height: clamp(380px, 60vh, 620px); height: clamp(380px, 60svh, 620px); }
}
@media (max-width: 480px) {
  .listing-editor-chat__document-footer { grid-template-columns: minmax(0, 1fr); }
  .listing-editor-chat__document-footer .btn { width: 100%; }
}
