/* РОЙ — основные стили. Этап 7: фирменный стиль по брендбуку (brandbook/, не в репозитории).
   Крем — фон страниц, белый — карточки и поля, мёд — главное действие, чёрный — текст и контуры,
   воск — подложки, зелёный («лист») — подтверждённые состояния и природные акценты. */

/* Шрифты лежат на сайте (static/fonts, лицензия SIL OFL 1.1 рядом). Open Sans — переменный
   400–700, Unbounded — только 500. Подмножества: кириллица, латиница и latin-ext (в нём знак ₽). */
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/OpenSans-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/OpenSans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/OpenSans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/Unbounded-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/Unbounded-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/Unbounded-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;

  /* Брендбук */
  --ink: #1C1B19;
  --honey: #FFC83D;
  --wax: #E9DDB8;
  --leaf: #4F7A3A;
  --cream: #FBF7EA;
  --paper: #FFFFFF;

  /* Производные для экрана (контраст — по WCAG на креме/белом) */
  --surface: #F4EDD6;       /* мягкая восковая подложка: наведение, недоступное, заглушки */
  --muted: #5E5A4F;         /* вторичный текст, 6.4:1 */
  --faint: #6B675B;         /* подсказки и плейсхолдеры, 5.3:1 */
  --line: #E3D7B0;          /* разделители и рамки карточек */
  --line-strong: #857D66;   /* граница полей, 4:1 — поле видно */
  --honey-press: #F2B620;   /* наведение на медовую кнопку */
  --honey-soft: #FFF3CF;    /* выбранное, фокусное кольцо, «новое» */
  --honey-ink: #6B4A0E;     /* текст на мягком мёде, 7.3:1 */
  --honey-deep: #A67C12;    /* подчёркивание ссылок, 3.5:1 */
  --accent: var(--ink);     /* активное и выбранное: чёрный, как «важная фраза» брендбука */
  --accent-ink: var(--cream);
  --accent-dark: #3F6330;   /* зелёный текст подтверждённых состояний, 6.5:1 */
  --success-bg: #E6EEDC;
  --danger: #B42318;
  --danger-dark: #8F1C13;
  --danger-bg: #FBE9E6;

  --font-display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --font-text: "Open Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius-s: 12px;         /* кнопки и поля */
  --radius-m: 16px;         /* блоки и карточки */
  --gutter: 16px;
  --content: 1120px;
  --tabbar-h: 64px;

  /* Движение: три длительности, две кривые. Анимируются цвет, прозрачность и transform. */
  --speed: 160ms;
  --t-fast: 120ms;
  --t-base: 200ms;
  --t-slow: 320ms;
  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.5, 1);
  --lift: 0 12px 24px -16px rgba(28, 27, 25, 0.45);

  /* Светлый сотовый узор для заглушек — никогда под основным текстом. */
  --honeycomb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='72' viewBox='0 0 42 72'%3E%3Cpath d='M21 1 40 12v24L21 47 2 36V12zM21 47v24M2 36 0 37M40 36l2 1' fill='none' stroke='%23DFD1A3' stroke-width='1.5'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font-text);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent;
}

/* Unbounded — заголовки страниц и разделов; заголовки карточек и пунктов — Open Sans. */
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h3 { font-family: var(--font-text); font-weight: 600; letter-spacing: 0; line-height: 1.3; }

p { margin: 0; }

a {
  color: var(--ink);
  text-decoration-color: var(--honey-deep);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--t-base) var(--ease-out), color var(--t-base) var(--ease-out);
}
a:hover { text-decoration-color: var(--ink); }

::selection { background: var(--honey); color: var(--ink); }
html { scrollbar-color: #C9BC94 var(--cream); }

/* Фокус: чёрный контур и мягкое медовое кольцо — видно и на креме, и на мёде. */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--honey-soft);
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-s);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Шапка и навигация. До 768 px вкладки — фиксированная нижняя панель (§17, §66). */

.site-header { background: var(--cream); border-bottom: 1px solid var(--line); }

.site-header__inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
/* Знак из трёх сот: хозяйство (чёрная), пасека (медовая), совпадение (зелёная). Цвета не меняются. */
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__hex--farm { fill: var(--ink); }
.brand__hex--apiary { fill: var(--honey); }
.brand__hex--match { fill: var(--leaf); }
.brand__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: 0.02em;
}

.tabs {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tabs__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr; /* пять вкладок участника, три у гостя */
}

.tab {
  min-height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-align: center;
  text-decoration: none;
  transition: color var(--t-base) var(--ease-out), background-color var(--t-base) var(--ease-out);
}
.tab__icon { width: 24px; height: 24px; flex: none; transition: transform var(--t-slow) var(--ease-spring); }

a.tab:hover { color: var(--ink); }

/* Активная вкладка: чёрная подпись и медовая полоса — мёд как графика, не как цвет текста. */
.tab[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 3px 0 var(--honey);
}
a.tab:active .tab__icon { transform: scale(0.9); }

@media (min-width: 768px) {
  body { padding-bottom: 0; }

  .site-header__inner { padding: 14px 24px; }

  .tabs {
    position: static;
    margin-left: auto;
    border-top: 0;
    padding-bottom: 0;
    background: none;
  }

  .tabs__list { display: flex; gap: 4px; }

  .tab {
    min-height: 40px;
    flex-direction: row;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.9375rem;
    letter-spacing: 0;
    white-space: nowrap;
    border-radius: var(--radius-s);
  }
  .tab__icon { width: 20px; height: 20px; }

  a.tab:hover { background: var(--surface); }

  .tab[aria-current="page"] {
    background: var(--paper);
    box-shadow: inset 0 0 0 1px var(--line), inset 0 -3px 0 var(--honey);
  }
}

/* Планшет: пять вкладок с «Мои объявления» помещаются в строку рядом с логотипом. */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .site-header__inner { padding-left: 16px; padding-right: 16px; }
  .tabs__list { gap: 0; }
  .tab { gap: 5px; padding: 8px 7px; font-size: 0.8125rem; }
  .tab__icon { width: 18px; height: 18px; }
}

/* Содержимое страницы */

.page {
  display: block;
  max-width: var(--content);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
}
.page:focus { outline: none; }

@media (min-width: 768px) {
  .page { padding: 48px 24px 64px; }
}

.intro { max-width: 46rem; }

.intro h1 {
  font-size: clamp(1.625rem, 1.15rem + 2.2vw, 2.375rem);
  max-width: 22ch;
}

.intro__lead {
  margin-top: 12px;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.0625rem;
}

.note {
  color: var(--muted);
  font-size: 0.875rem;
}

/* Поиск §18. На узком экране поле занимает строку, кнопки — под ним. */

.search {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search__field {
  position: relative;
  flex: 1 1 100%;
}

.search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search__input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px 10px 44px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  transition: border-color var(--t-base) var(--ease-out);
}
.search__input:hover { border-color: var(--ink); }
.search__input:focus-visible { outline: none; border-color: var(--ink); border-radius: var(--radius-s); box-shadow: 0 0 0 4px var(--honey-soft), 0 0 0 5px var(--honey); }
.search__input::placeholder { color: var(--faint); }
.search__input:disabled { background: var(--surface); cursor: not-allowed; }

.search .button { flex: 1 1 0; }

@media (min-width: 560px) {
  .search__field { flex-basis: 0; }
  .search .button { flex: none; }
}

.search + .note { margin-top: 8px; }

/* Кнопки: главная — мёд с чёрным текстом (одна на экран), обычная — белая с чёрным контуром,
   тихая — подчёркнутый текст, опасная — красная. Нажатие слегка утапливает кнопку. */
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-s);
  background: var(--paper);
  color: var(--ink);
  font: 600 1rem/1.2 var(--font-text);
  cursor: pointer;
  transition: background-color var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out),
              color var(--t-base) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.button__icon { width: 20px; height: 20px; flex: none; }
.button:active:not(:disabled) { transform: translateY(1px) scale(0.985); }

.button--primary {
  background: var(--honey);
  border-color: var(--honey);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 rgba(28, 27, 25, 0.12);
}

.button:disabled {
  background: var(--surface);
  border-color: var(--line);
  color: var(--faint);
  box-shadow: none;
  cursor: not-allowed;
}

/* Каталог и пустое состояние */

.catalog { margin-top: 40px; }

@media (min-width: 768px) {
  .catalog { margin-top: 56px; }
}

.catalog__title {
  font-size: 1.25rem;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.empty {
  margin-top: 24px;
  padding: 32px 20px;
  background: var(--paper);
  border: 1px dashed #CDBF92;
  border-radius: var(--radius-m);
  text-align: center;
}
.empty p {
  max-width: 52ch;
  margin: 8px auto 0;
}
.empty .note { margin-top: 12px; }

.empty__frame {
  display: block;
  width: min(240px, 100%);
  height: auto;
  margin: 0 auto 20px;
}
.empty__wood {
  fill: var(--paper);
  stroke: #C9B48A;
  stroke-width: 6;
}
.empty__cells use {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
}
.empty__cells .empty__honey {
  fill: var(--honey-soft);
  stroke: var(--honey);
  stroke-width: 2;
}

.empty__title { font-size: 1.125rem; }

@media (min-width: 768px) {
  .empty { padding: 48px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- Этап 2: уведомления, формы, вход, профиль ---------- */

.flashes { margin-bottom: 24px; display: grid; gap: 8px; }

.flash {
  padding: 12px 16px;
  border-radius: var(--radius-s);
  border: 1px solid #B9CDA6;
  background: var(--success-bg);
  color: var(--ink);
  animation: notice-in var(--t-slow) var(--ease-out);
}
.flash--info { border-color: #EBCB7A; background: var(--honey-soft); }
@keyframes notice-in { from { opacity: 0; transform: translateY(-6px); } }

.narrow { max-width: 30rem; margin: 0 auto; }
.narrow--wide { max-width: 44rem; }
.narrow h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); }
.narrow > .form {
  padding: 20px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--paper);
}
@media (min-width: 560px) { .narrow > .form { padding: 28px; } }
.narrow > .form + .narrow__switch { border-top: 0; padding-top: 0; }
.narrow__lead { margin-top: 8px; color: var(--muted); }
.narrow__switch { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

.back { margin-bottom: 12px; font-size: 0.9375rem; font-weight: 600; }
.back a { display: inline-flex; align-items: center; min-height: 32px; }
.back a::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--t-base) var(--ease-out);
}
.back a:hover::before { transform: translateX(-3px) rotate(45deg); }

.form { margin-top: 24px; display: grid; gap: 20px; }
.panel .form { margin-top: 0; }

/* Publication editors: one form, clear sections and native keyboard radio groups. */
.publication-form { gap: 28px; }
.publication-form__section { display: grid; gap: 20px; min-width: 0; border-top: 1px solid var(--line); padding-top: 28px; }
.publication-form__section:first-of-type { border-top: 0; padding-top: 0; }
.publication-form__section h3 { font-size: 1.125rem; line-height: 1.45; overflow-wrap: anywhere; }
.publication-form__section > [data-when-field][hidden] { display: none; }
.publication-choices { min-width: 0; }
.publication-choices__list { display: grid; gap: 8px; }
.publication-choice { display: flex; gap: 12px; align-items: flex-start; min-height: 48px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; }
.publication-choice:has(input:checked) { background: var(--honey-soft); border-color: var(--ink); }
.publication-choice input { flex: 0 0 20px; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); }
.publication-choice span { min-width: 0; overflow-wrap: anywhere; }
.publication-choice:focus-within { border-color: var(--ink); }

.form__pair { display: grid; gap: 20px; }

.form__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.form__actions .button { flex: 1 1 auto; }

@media (min-width: 560px) {
  .form__actions .button { flex: none; }
  .form__pair { grid-template-columns: 1fr 1fr; gap: 16px; }
}

.form-alert {
  padding: 12px 16px;
  border-radius: var(--radius-s);
  border: 1px solid #EBB4AC;
  background: var(--danger-bg);
  color: var(--danger-dark);
  font-weight: 600;
  animation: notice-in var(--t-slow) var(--ease-out);
}

.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }

.field__label { font-weight: 600; padding: 0; font-size: 0.9375rem; }
.field__optional { font-weight: 400; color: var(--muted); }
.field__hint { color: var(--muted); font-size: 0.875rem; }

.field__error { color: var(--danger); font-size: 0.9375rem; font-weight: 600; }
.field__error:empty { display: none; }

.input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  transition: border-color var(--t-base) var(--ease-out);
}
.input::placeholder { color: var(--faint); }
textarea.input { min-height: 8rem; resize: vertical; line-height: 1.5; }
.input:hover { border-color: var(--ink); }
/* Недоступное поле (населённый пункт до выбора региона) — как недоступный поиск. */
.locality .input:disabled { background: var(--surface); border-color: var(--line); cursor: not-allowed; }
.input:focus-visible { outline: none; border-color: var(--ink); border-radius: var(--radius-s); box-shadow: 0 0 0 4px var(--honey-soft), 0 0 0 5px var(--honey); }
.field--invalid .input { border-color: var(--danger); border-width: 2px; }
.field--invalid .input:focus-visible { border-color: var(--danger); }

.input--file { padding: 8px; }
.input--file::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: 600 0.9375rem var(--font-text);
  cursor: pointer;
}

/* Выбор роли: карточки-переключатели */
.roles { gap: 10px; }
.role { display: block; cursor: pointer; }
.role__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.role__body {
  display: grid;
  gap: 2px;
  padding: 14px 16px 14px 48px;
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  transition: border-color var(--speed) ease, background-color var(--speed) ease;
}
.role__body::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 17px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  background: var(--paper);
}
.role__title { font-weight: 600; }
.role__text { color: var(--muted); font-size: 0.9375rem; }
.role:hover .role__body { border-color: var(--muted); }
.role__input:checked + .role__body { border-color: var(--ink); border-width: 2px; padding: 13px 15px 13px 47px; background: var(--honey-soft); }
.role__input:checked + .role__body::before { left: 15px; top: 16px; border-color: var(--ink); box-shadow: inset 0 0 0 4px var(--paper); background: var(--ink); }
.role__input:focus-visible + .role__body { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--honey-soft); }
.field--invalid .role__body { border-color: var(--danger); }

@media (min-width: 560px) {
  .roles { grid-template-columns: 1fr 1fr; }
  .roles .field__label, .roles .field__error { grid-column: 1 / -1; }
}

/* Кнопки этапа 2 */
.button { text-decoration: none; }
.button--primary:hover:not(:disabled) { background: var(--honey-press); border-color: var(--honey-press); }
.button:not(.button--primary):not(.button--danger):not(:disabled):hover { background: var(--surface); }
.button--quiet {
  border-color: transparent;
  background: none;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--honey-deep);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.button.button--quiet:not(:disabled):hover { background: none; text-decoration-color: var(--ink); }
.button--quiet:disabled { background: none; border-color: transparent; text-decoration-color: var(--line); }
.button--danger { background: var(--danger); border-color: var(--danger); color: #FFFFFF; }
/* Первый шаг удаления — тихая красная кнопка; подтверждение ниже — сплошная красная. */
.button--quiet.button--quiet-danger { color: var(--danger); text-decoration-color: rgba(180, 35, 24, 0.45); }
.button--quiet.button--quiet-danger:disabled { color: var(--faint); text-decoration-color: var(--line); }
.button.button--quiet-danger:not(:disabled):hover { text-decoration-color: var(--danger); }
.button--danger:hover { background: var(--danger-dark); border-color: var(--danger-dark); }
.button.is-busy { cursor: progress; opacity: 0.8; }

/* Аватар */
.avatar {
  width: 96px;
  height: 96px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--wax);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink);
}
.avatar--empty { display: inline-grid; place-items: center; color: var(--honey-ink); }
.avatar--empty svg { width: 52px; height: 52px; }

/* Профиль */
.profile { max-width: 44rem; margin: 0 auto; }
.profile__head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile__who { min-width: 0; flex: 1 1 14rem; }
.profile__name { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); overflow-wrap: anywhere; }
.profile__meta { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); }
.profile__since { margin-top: 4px; color: var(--muted); font-size: 0.875rem; }

.chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--honey-soft);
  color: var(--honey-ink);
  font-weight: 600;
  font-size: 0.875rem;
}

.hint-box {
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid #EBCB7A;
  border-radius: var(--radius-s);
  background: var(--honey-soft);
  color: var(--ink);
}

.details {
  margin: 28px 0 0;
  padding: 4px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--paper);
}
.details__row { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.details__row:last-child { border-bottom: 0; }
@media (min-width: 560px) { .details { padding: 4px 24px; } }
.details dt { color: var(--muted); font-size: 0.875rem; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.details__note { display: block; color: var(--muted); font-size: 0.8125rem; }
.details__text { white-space: pre-line; max-width: 65ch; }

@media (min-width: 560px) {
  .details__row { grid-template-columns: 11rem 1fr; gap: 16px; }
}

.profile__actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.profile__actions > *, .profile__logout .button { flex: 1 1 100%; }
.profile__logout { display: contents; }
@media (min-width: 560px) {
  .profile__actions > *, .profile__logout .button { flex: none; }
  .profile__logout .button { margin-left: auto; }
}

/* Редактирование */
.panel {
  margin-top: 24px;
  padding: 20px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--paper);
}
@media (min-width: 560px) { .panel { padding: 28px; } }
.panel__title { font-size: 1.125rem; margin-bottom: 18px; }

.avatar-edit { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.avatar-edit__forms { flex: 1 1 16rem; min-width: 0; display: grid; gap: 12px; }

/* V1.2: «Выбрать фото» — подпись скрытого поля файла; фокус поля показывается на подписи. */
.avatar-edit__form { display: grid; gap: 8px; }
.avatar-edit__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-edit__file:focus-visible + .button { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--honey-soft); }
.avatar-edit__actions [hidden] { display: none; }
.avatar-edit__status { color: var(--accent-dark); font-weight: 600; }
.avatar-edit__status:empty, .avatar-edit__form .field__error:empty { display: none; }

/* Окно обрезки. Область квадратная — так фото и сохранится; круг поверх показывает будущий аватар. */
html.is-modal { overflow: hidden; }
.cropper {
  width: min(420px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-m);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 48px -20px rgba(28, 27, 25, 0.55);
  overflow: auto;
  overscroll-behavior: contain;
}
.cropper[open] { animation: dialog-in var(--t-slow) var(--ease-out); }
.cropper::backdrop { background: rgba(28, 27, 25, 0.6); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px); } }
.cropper--confirm { width: min(380px, calc(100vw - 16px)); }
.cropper__body { padding: 16px; display: grid; gap: 14px; }
@media (min-width: 560px) { .cropper__body { padding: 20px 24px 24px; } }
.cropper__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cropper__title { font-size: 1.25rem; }
.cropper__close, .cropper__step {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.cropper__close { margin-right: -10px; }
.cropper__close:hover:not(:disabled), .cropper__step:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.cropper__close:focus-visible, .cropper__step:focus-visible { border-radius: 50%; }
.cropper__close svg, .cropper__step svg { width: 22px; height: 22px; }
.cropper__close:disabled, .cropper__step:disabled { cursor: default; opacity: 0.4; }
/* На низком экране (телефон боком) область уменьшается, чтобы кнопки остались видны. */
.cropper__stage {
  position: relative;
  width: min(100%, max(200px, calc(100dvh - 300px)));
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-s);
  background: var(--ink);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.cropper__stage.is-dragging { cursor: grabbing; }
.cropper__stage.is-saving { cursor: progress; }
.cropper__stage:focus-visible { outline: 3px solid var(--honey); outline-offset: 3px; border-radius: var(--radius-s); }
.cropper__image {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: 0 0;
  pointer-events: none;
  -webkit-user-drag: none;
}
.cropper__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 100vmax rgba(28, 27, 25, 0.55);
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: -2px;
  pointer-events: none;
}
.cropper__hint { margin-top: -4px; text-align: center; color: var(--muted); font-size: 0.875rem; }
.cropper__zoom { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 4px; }
.cropper__range { width: 100%; margin: 0; accent-color: var(--ink); cursor: pointer; }
.cropper__error { color: var(--danger); font-weight: 600; }
.cropper__error:empty { display: none; }
.cropper__actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 559px) { .cropper__actions .button { flex: 1 1 0; } }
/* Низкий экран (телефон боком): область слева, управление справа — всё видно без прокрутки. */
@media (max-height: 520px) and (min-width: 560px) {
  .cropper:not(.cropper--confirm) { width: min(680px, calc(100vw - 16px)); }
  .cropper:not(.cropper--confirm) .cropper__body {
    padding: 12px 16px 16px;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "stage head" "stage hint" "stage zoom" "stage error" "stage actions";
    grid-template-rows: auto auto auto auto 1fr;
    column-gap: 20px;
    row-gap: 10px;
  }
  .cropper__head { grid-area: head; }
  .cropper__stage { grid-area: stage; width: calc(100dvh - 44px); }
  .cropper__hint { grid-area: hint; margin-top: 0; text-align: left; }
  .cropper__zoom { grid-area: zoom; }
  .cropper__error { grid-area: error; }
  .cropper__actions { grid-area: actions; align-self: end; }
}

.confirm > summary { list-style: none; width: fit-content; }
.confirm > summary::-webkit-details-marker { display: none; }
.confirm[open] > summary { color: var(--muted); }
.confirm__body {
  margin-top: 8px;
  padding: 14px 16px;
  border: 1px solid #EBB4AC;
  border-radius: var(--radius-s);
  background: var(--danger-bg);
  display: grid;
  gap: 12px;
  justify-items: start;
}

/* ---------- Страница ошибок 400 / 413 / 503 ---------- */

.error-page { padding-top: 8px; }

.error-page__mark { width: 48px; height: 48px; display: block; margin-bottom: 16px; }
.error-page__mark polygon { fill: var(--honey); stroke: var(--ink); stroke-width: 1.5; }
.error-page__mark path { fill: none; stroke: var(--honey-ink); stroke-width: 2.6; stroke-linecap: round; }

.error-page__code { color: var(--muted); font-size: 0.9375rem; margin-bottom: 4px; }
.error-page__message { margin-top: 12px; font-size: 1.0625rem; max-width: 60ch; }
.error-page__more { margin-top: 12px; color: var(--muted); max-width: 60ch; }
.error-page__actions { margin-top: 28px; }

.limits { margin: 20px 0 0; border-top: 1px solid var(--line); }
.limits__row { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.limits dt { color: var(--muted); font-size: 0.875rem; }
.limits dd { margin: 0; font-weight: 600; }
.limits__exact { font-weight: 400; color: var(--muted); white-space: nowrap; }

/* ---------- Этап 3: объявления ---------- */

/* Статусы публикаций — как метки брендбука: заглавные, плотные. Зелёный — опубликовано. */
.chip--published, .chip--hidden, .chip--deleted {
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.chip--published { background: var(--leaf); color: var(--paper); }
.chip--hidden { background: var(--wax); color: var(--ink); }
.chip--deleted { background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

/* Обложка 4:3, как миниатюра сервера 480×360. Без фото — соты §32. */
.cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface);
}
/* Без фото — восковые соты и знак РОЙ вместо пустого прямоугольника. */
.cover--empty {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--honeycomb) center / 42px 72px, var(--wax);
}
.cover--empty svg { width: 44px; height: 44px; color: var(--honey-ink); }

/* Каталог */
.catalog__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.catalog__head .catalog__title { padding-bottom: 0; border-bottom: 0; }
.catalog__count { color: var(--muted); font-size: 0.9375rem; }

.cards {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
}
@media (min-width: 768px) { .cards { gap: 24px; } }

/* Белая карточка на креме. Мышью — рамка темнеет, карточка приподнимается на 3 px. */
.card {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--paper);
  transition: border-color var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
}
.card .cover { border-bottom: 1px solid var(--line); }
@media (hover: hover) {
  .card:hover { border-color: var(--ink); transform: translateY(-3px); box-shadow: var(--lift); }
}
.card:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--honey-soft); }

.card__body { flex: 1 0 auto; padding: 14px 16px 16px; display: grid; gap: 4px; align-content: start; }
/* Автор внизу карточки: строка одной высоты во всех карточках ряда. */
.card__author {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
.card__author-name { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.card__author--preview { position: relative; z-index: 2; color: inherit; text-decoration: none; }
.guest-auth { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; margin: auto; padding: 28px; border: 1px solid var(--line-strong); border-radius: 16px; color: var(--ink); background: var(--paper); box-shadow: 0 20px 70px #1c1b1933; }
.guest-auth::backdrop { background: #1c1b1999; }
.guest-auth__close { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -12px -12px 8px auto; padding: 10px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); cursor: pointer; }
.guest-auth__close svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.guest-auth h2 { margin: 0 0 24px; font-size: clamp(20px, 4vw, 24px); line-height: 1.4; overflow-wrap: anywhere; }
.guest-auth__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.guest-auth__actions .button { flex: 1 1 160px; }
.showcase-attribution { margin-top: 24px; }
@media (max-width: 359px) {
  [data-guest-showcase] .cards { grid-template-columns: minmax(0, 1fr); }
  .guest-auth { padding: 20px; }
  .guest-auth h2 { font-size: 18px; overflow-wrap: normal; }
}
.avatar--tiny { width: 32px; height: 32px; box-shadow: 0 0 0 1px var(--line); }
.avatar--tiny svg { width: 20px; height: 20px; }
.card__title { font-size: 1.0625rem; overflow-wrap: anywhere; }
.card__link { color: var(--ink); text-decoration: none; }
.card__link:focus-visible { outline: none; }
/* Вся карточка ведёт на подробную страницу. */
.card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card__place { color: var(--muted); font-size: 0.9375rem; overflow-wrap: anywhere; }
.card__price {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.card__unit { font-family: var(--font-text); font-size: 0.8125rem; font-weight: 400; color: var(--muted); }
.card__facts { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 0.9375rem; }
.card__facts dd { margin: 0; }
.card__facts > div { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.card__terms { display: grid; gap: 8px; margin: 8px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 0.875rem; line-height: 1.4; overflow-wrap: anywhere; }
.card__terms dt { color: var(--muted); font-size: 0.8125rem; }
.card__terms dd { margin: 2px 0 0; font-weight: 600; }


/* Страницы */
.pager {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pager__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.pager__page, .pager__step {
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  border-radius: var(--radius-s);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.pager__page:hover, a.pager__step:hover { background: var(--surface); }
.pager__page, .pager__step { transition: background-color var(--t-base) var(--ease-out); font-variant-numeric: tabular-nums; }
.pager__page[aria-current="page"] { background: var(--ink); color: var(--cream); }
.pager__step { border: 1.5px solid var(--ink); background: var(--paper); }
.pager__step--off { color: var(--faint); background: var(--surface); border-color: var(--line); }
.pager__gap { min-width: 20px; display: grid; place-items: center; color: var(--muted); }
@media (max-width: 420px) {
  .pager { gap: 4px; }
  .pager__page { min-width: 40px; padding: 0 6px; }
  .pager__step { padding: 0 8px; }
}

/* Мои объявления */
.own { max-width: 56rem; margin: 0 auto; }
.own__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.own__head h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); }
.own__head .button { flex: 1 1 100%; }
@media (min-width: 560px) { .own__head .button { flex: none; } }
.own__count { margin-top: 8px; color: var(--muted); }

.own__list { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 12px; }

.own-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--paper);
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px 16px;
  align-items: start;
  transition: border-color var(--t-base) var(--ease-out);
}
.own-item:hover { border-color: #CDBF92; }
.own-item__media { display: block; border-radius: var(--radius-s); overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.own-item__body { min-width: 0; display: grid; gap: 4px; justify-items: start; }
.own-item__title { font-family: var(--font-text); font-size: 1.125rem; font-weight: 600; letter-spacing: 0; line-height: 1.3; overflow-wrap: anywhere; }
.own-item__title a { color: var(--ink); text-decoration-color: transparent; }
.own-item__title a:hover { text-decoration-color: var(--honey-deep); }
.own-item__meta { color: var(--muted); font-size: 0.9375rem; }
.own-item__note { font-size: 0.875rem; }
.own-item--deleted .own-item__media { opacity: 0.55; }
.own-item--deleted .own-item__title a { color: var(--muted); }

.own-item__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.own-item__actions > .button, .own-item__actions > form { flex: 1 1 auto; }
.own-item__actions > form .button { width: 100%; }
.own-item__delete { flex: 1 1 100%; }

@media (min-width: 720px) {
  .own-item { grid-template-columns: 160px minmax(0, 1fr); padding: 20px; }
  .own-item__actions { grid-column: 2; }
  .own-item__actions > .button, .own-item__actions > form { flex: none; }
  .own-item__delete { flex: none; }
  .own-item__delete[open] { flex: 1 1 100%; }
}

.empty--compact { text-align: left; }
.empty--compact p { margin-left: 0; }
.empty__icon { width: 48px; height: 48px; color: var(--ink); margin-bottom: 12px; }
.empty .empty__action { margin-top: 20px; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }

/* Подробная страница §43 */
.listing__head { display: grid; gap: 6px; justify-items: start; }
.listing__title { font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem); max-width: 30ch; overflow-wrap: anywhere; }
.listing__place { color: var(--muted); font-size: 1.0625rem; overflow-wrap: anywhere; }
.listing__notice { margin-top: 16px; }

.listing__layout { margin-top: 24px; display: grid; gap: 28px; }
.listing__layout > .gallery, .listing__text { min-width: 0; }

@media (min-width: 900px) {
  .listing__layout { grid-template-columns: minmax(0, 7fr) minmax(18rem, 4fr); gap: 28px 40px; align-items: start; }
  .listing__layout > .gallery { grid-column: 1; grid-row: 1; }
  .listing__aside { grid-column: 2; grid-row: 1 / span 2; }
  .listing__text { grid-column: 1; grid-row: 2; }
}

.gallery { margin: 0; display: grid; gap: 8px; }
/* Главное фото — с чёрной линией обводки 2 px, как фото в брендбуке. */
.gallery__stage {
  display: block;
  aspect-ratio: 4 / 3;
  border: 2px solid var(--ink);
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--surface);
}
.gallery__main { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery__stage.cover--empty { display: grid; background: var(--honeycomb) center / 42px 72px, var(--wax); }
.gallery__stage.cover--field { background: repeating-linear-gradient(172deg, transparent 0 18px, rgba(79, 122, 58, 0.12) 18px 20px), var(--success-bg); }
.gallery__main { transition: opacity var(--t-base) var(--ease-out); }
.gallery__thumbs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.gallery__thumb { display: block; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); transition: box-shadow var(--t-base) var(--ease-out), transform var(--t-fast) var(--ease-out); }
.gallery__thumb:hover { box-shadow: 0 0 0 2px var(--ink); }
.gallery__thumb img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery__thumb[aria-current="true"] { box-shadow: 0 0 0 2px var(--ink), 0 0 0 5px var(--honey); }

.listing__subtitle { font-size: 1.125rem; }
.listing__text { display: grid; gap: 24px; }
.listing__date { color: var(--muted); font-size: 0.875rem; }
.listing__subtitle + .listing__prose { margin-top: 8px; }
.listing__prose { white-space: pre-line; max-width: 65ch; overflow-wrap: anywhere; }
.listing__prose--empty { color: var(--muted); }
.cooperation { display: grid; gap: 12px; margin: 12px 0 0; }
.cooperation > div { display: grid; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.cooperation dt { color: var(--muted); font-size: 0.9375rem; }
.cooperation dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.cooperation ~ .listing__prose { margin-top: 12px; }
@media (min-width: 560px) { .cooperation > div { grid-template-columns: minmax(0, 10rem) minmax(0, 1fr); gap: 16px; } }

.listing__aside {
  min-width: 0;
  padding: 20px 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-m);
  background: var(--paper);
}
@media (min-width: 560px) { .listing__aside { padding: 24px; } }

.listing__label { margin-bottom: 6px; color: var(--muted); font-size: 0.875rem; }
.listing__price { font-family: var(--font-display); font-size: clamp(1.5rem, 1.25rem + 0.8vw, 2rem); font-weight: 500; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.listing__unit { margin-top: 4px; color: var(--muted); font-size: 0.9375rem; }

.facts { margin: 20px 0 0; border-top: 1px solid var(--line); }
.facts__row { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 12px; }
.facts dt { color: var(--muted); font-size: 0.9375rem; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.author { margin-top: 20px; display: flex; align-items: center; gap: 12px; }
.avatar--small { width: 44px; height: 44px; box-shadow: 0 0 0 1px var(--line); }
.avatar--small svg { width: 26px; height: 26px; }
.author__label { display: block; color: var(--muted); font-size: 0.8125rem; }
.author__name { font-weight: 600; overflow-wrap: anywhere; }
.listing__aside .author > p { min-width: 0; }
.listing__aside .avatar { flex: none; }

.manage { margin-top: 20px; display: grid; gap: 8px; }
.manage > .button, .manage form .button { width: 100%; }
.manage .confirm > summary { width: 100%; }
.manage .note { margin-top: 4px; }

/* Форма объявления */
.form-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.form-alert--top { margin-top: 20px; }
.form-alert p + p { margin-top: 4px; }
.input--select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231C1B19' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  cursor: pointer;
}
.price-set { display: grid; gap: 12px; }

.panel__count { font-family: var(--font-text); font-size: 0.9375rem; font-weight: 400; color: var(--muted); margin-left: 6px; }

.previews { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.previews[hidden] { display: none; }
.previews__item { display: grid; gap: 4px; font-size: 0.8125rem; color: var(--muted); }
.previews__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--surface); }

.photo-grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 20px 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.photo { display: grid; gap: 8px; align-content: start; min-width: 0; }
.photo__frame { position: relative; border-radius: var(--radius-s); overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.photo__frame img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.photo__badge {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--honey);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 0 0 1.5px var(--ink);
}
.photo__tools { display: flex; flex-wrap: wrap; gap: 6px; }
.photo__tools form { display: contents; }
.button--small { min-height: 40px; padding: 6px 12px; font-size: 0.9375rem; }
.confirm__body--plain { background: var(--surface); border-color: var(--line); }
.confirm__body .input--file { max-width: 100%; }
.photo-upload { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.previews__item img { box-shadow: 0 0 0 1px var(--line); }
.photo__more { display: flex; flex-wrap: wrap; gap: 0 6px; }
.photo__more > .confirm[open] { flex: 1 1 100%; order: 1; }
.own-item__media { text-decoration: none; }

/* Регион с поиском и максимальный срок */
/* Регион: одно поле с автодополнением (combobox). Без JS — обычный select. */
.region__select[hidden] { display: none; }
.combo { position: relative; }
.combo__list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: min(16rem, 45vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-s);
  background: var(--paper);
  box-shadow: 0 16px 32px -18px rgba(28, 27, 25, 0.5);
  transform-origin: top center;
  animation: drop-in var(--t-base) var(--ease-out);
}
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.combo__list[hidden] { display: none; }
/* На телефоне открытый список прокручивается в видимую часть, над нижней панелью вкладок. */
.combo__list { scroll-margin-top: 16px; scroll-margin-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px); }
@media (min-width: 768px) { .combo__list { scroll-margin-bottom: 12px; } }
/* Ошибка под одним полем пары не растягивает соседнее. */
.form__pair > .field { align-content: start; }
.combo__option {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.combo__option:hover { background: var(--surface); }
.combo__option.is-active { background: var(--honey-soft); box-shadow: inset 0 0 0 1.5px var(--ink); }
.combo__option[aria-selected="true"] { font-weight: 600; }
.combo__empty { padding: 10px 12px; color: var(--muted); }
/* Подсказок больше, чем показано: просьба уточнить название, не пункт выбора. */
.combo__more { padding: 8px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; }

.duration > legend { margin-bottom: 6px; }
.duration__row { display: flex; align-items: center; gap: 10px; }
.duration__word { font-weight: 600; }
.duration__value { width: 6.5rem; flex: none; }
.duration__todo { margin-top: 0; }

.own-item__todo { font-size: 0.875rem; padding: 6px 10px; border-radius: 10px; border: 1px solid #EBCB7A; background: var(--honey-soft); color: var(--honey-ink); }
.hint-box--todo { background: var(--honey-soft); color: var(--honey-ink); }
.hint-box--todo a { color: inherit; font-weight: 600; }

/* ---------- Этап 4: поиск, фильтры, избранное ---------- */

.search-form { margin-top: 24px; }
.search-form > .search { margin-top: 0; }
.search-form > .field__error { margin-top: 6px; }
.search-form > .form-alert { margin-bottom: 12px; }
.search__field.field--invalid .search__input { border-color: var(--danger); border-width: 2px; }

.filters { margin-top: 12px; }
.filters__toggle { list-style: none; display: inline-flex; width: auto; cursor: pointer; }
.filters__toggle::-webkit-details-marker { display: none; }
.filters__toggle::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--t-slow) var(--ease-out);
}
.filters[open] > .filters__toggle::after { transform: translateY(2px) rotate(-135deg); }
.filters__count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: var(--honey);
  font-size: 0.8125rem;
}
.filters__body {
  margin-top: 12px;
  padding: 20px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--paper);
}
@media (min-width: 560px) { .filters__body { padding: 24px; } }
.filters__grid { display: grid; gap: 22px; }
@media (min-width: 720px) {
  .filters__grid { grid-template-columns: 1fr 1fr; gap: 22px 24px; align-items: start; }
  .filters__set--wide { grid-column: 1 / -1; }
}
.filters__set > legend { margin-bottom: 6px; }
.filters__actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.filters__actions .button { flex: 1 1 auto; }
@media (min-width: 560px) { .filters__actions .button { flex: none; } }

.range { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.range__part { flex: 1 1 8rem; min-width: 0; display: flex; align-items: center; gap: 8px; }
.range__word { color: var(--muted); white-space: nowrap; }

/* Сортировка в шапке каталога */
.sort { flex: 1 1 100%; min-width: 0; display: flex; align-items: center; gap: 8px; }
.sort__apply { flex: none; }
.sort__apply[hidden] { display: none; }
.sort__label { color: var(--muted); font-size: 0.9375rem; white-space: nowrap; }
.sort__select { min-height: 44px; padding-top: 6px; padding-bottom: 6px; width: 0; flex: 1 1 0; min-width: 0; }
@media (min-width: 720px) {
  .sort { flex: none; margin-left: auto; }
  .sort__select { flex: none; width: auto; }
}

/* Выбранные фильтры */
.active-filters { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.active-filter {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 12px;
  border-radius: 999px;
  border: 1px solid #EBCB7A;
  background: var(--honey-soft);
  color: var(--ink);
  font-size: 0.9375rem;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color var(--t-base) var(--ease-out);
}
.active-filter:hover { background: var(--honey); }
.active-filter svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.active-filters__reset { min-height: 36px; display: inline-flex; align-items: center; padding: 0 6px; font-size: 0.9375rem; }

.empty--plain .empty__icon { display: block; margin: 0 auto 12px; }
.empty--compact.empty--plain { text-align: left; }

/* Избранное: круглая кнопка на обложке карточки и кнопка с текстом на подробной странице. */
.favorite { margin: 0; }
.favorite--icon { position: absolute; top: 10px; right: 10px; z-index: 2; }
.favorite--icon .favorite__button, a.favorite--icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 2px 6px -2px rgba(28, 27, 25, 0.35);
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--t-base) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.favorite__button svg { width: 22px; height: 22px; transition: transform var(--t-fast) var(--ease-out); }
.favorite--icon .favorite__button:hover, a.favorite--icon:hover { background: var(--honey-soft); }
/* Сохранено: медовый круг и чёрное сердце (на подробной — мягкий мёд на кнопке). */
.favorite__button.is-saved { color: var(--ink); --heart-fill: var(--ink); }
.favorite--icon .favorite__button.is-saved { background: var(--honey); }
.favorite__button:active svg { transform: scale(0.88); }
.favorite--wide, .favorite--wide .button { width: 100%; }
.favorite--wide .favorite__button.is-saved { background: var(--honey-soft); border-color: var(--ink); --heart-fill: var(--honey); }
.favorites__note { margin-top: 24px; }
/* Отправка: сердце пульсирует, повторные нажатия игнорирует favorites.js. */
.favorite__button.is-busy { cursor: progress; }
.favorite__button.is-busy svg { animation: favorite-busy 0.7s ease-in-out infinite alternate; }
@keyframes favorite-busy { from { opacity: 1; } to { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  .favorite__button svg { transition: none; }
  .favorite__button.is-busy svg { animation: none; opacity: 0.5; }
}

/* Итог действия без перезагрузки — над нижней панелью на телефоне, в углу на компьютере. */
.toast {
  position: fixed;
  z-index: 20;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px);
  margin: 0 auto;
  max-width: 28rem;
  padding: 12px 16px;
  border-radius: var(--radius-s);
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 12px 28px -14px rgba(28, 27, 25, 0.6);
  animation: toast-in var(--t-slow) var(--ease-spring);
}
.toast--error { background: var(--danger-bg); color: var(--danger-dark); border: 1px solid #EBB4AC; font-weight: 600; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.toast[hidden] { display: none; }
@media (min-width: 768px) { .toast { left: auto; right: 24px; bottom: 24px; } }

/* ---------- Этап 5: переписка §§44, 47–52 ---------- */

/* Счётчик непрочитанных во вкладке: медовый, как всё «новое» в переписке. */
.tab { position: relative; }
.tab__badge, .thread__count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--honey);
  font: 700 0.75rem/20px var(--font-text);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
/* Телефон: бейдж у правого плеча иконки и целиком внутри своей вкладки — «99+» на 320–375 px
   не заходит на «Профиль», нажатие по нему открывает сообщения. */
.tab__badge { position: absolute; top: 5px; left: calc(50% + 2px); max-width: calc(50% - 2px); padding: 0 4px; }
.tab__badge[hidden], .thread__count[hidden] { display: none; }
.push-settings { display:flex; align-items:center; gap:12px; padding:16px; border-bottom:1px solid var(--line); background:var(--white, #fff); }
.push-settings__copy { min-width:0; flex:1; font-size:0.875rem; color:var(--muted); }
.push-settings p { margin:0; overflow-wrap:anywhere; }
.push-settings__title { font-weight:600; color:var(--ink); }
.push-settings .push-settings__state { margin-top:4px; }
.push-settings [hidden] { display:none; }
@media (max-width:430px) {
  .push-settings { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 12px; }
  .push-settings__copy { display:contents; }
  .push-settings p { grid-column:1 / -1; }
  .push-settings .push-settings__state { grid-column:1; align-self:center; margin-top:0; }
  .push-settings button { grid-column:2; grid-row:3; }
}
@media (min-width: 768px) { .tab__badge { position: static; max-width: none; padding: 0 6px; } }

/* «Написать» */
.start-chat { margin: 0; display: grid; gap: 6px; }
.start-chat__error { color: var(--danger); font-size: 0.9375rem; font-weight: 600; }
.start-chat__error:empty { display: none; }
.button--small { min-height: 44px; padding: 8px 14px; font-size: 0.9375rem; }
.card__actions { position: relative; z-index: 2; padding: 0 16px 14px; }
.card__actions .button { width: 100%; }

/* Список переписок */
.chat-layout--inbox { display: grid; gap: 24px; }
.chat-side__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.chat-side__title { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); }
.chat-side__count { color: var(--muted); font-size: 0.9375rem; }
.chat-side__pager { justify-content: flex-start; margin-top: 16px; }
.chat-empty { margin-top: 16px; }
.chat-empty[hidden] { display: none; }

.threads { list-style: none; margin: 0; padding: 0; }
.threads[hidden] { display: none; }
.thread + .thread { border-top: 1px solid var(--line); }
.threads__loading { padding: 16px 4px; color: var(--muted); font-size: 0.9375rem; }
.thread__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 8px;
  margin: 0 -8px;
  border-radius: var(--radius-m);
  color: var(--ink);
  text-decoration: none;
  transition: background-color var(--speed) ease;
}
.thread__link:hover { background: var(--surface); }
.thread__link[aria-current="page"] { background: var(--honey-soft); box-shadow: inset 0 0 0 1.5px var(--ink); }
.avatar--thread { width: 48px; height: 48px; box-shadow: 0 0 0 1px var(--line); }
.avatar--thread svg { width: 28px; height: 28px; }
.thread__body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.thread__top, .thread__bottom { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.thread__bottom { align-items: center; }
.thread__name, .thread__listing, .thread__preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thread__name { flex: 1; font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
.thread__time { flex: none; color: var(--faint); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.thread__listing { color: var(--muted); font-size: 0.875rem; }
.thread__preview { flex: 1; color: var(--muted); font-size: 0.9375rem; }
.thread__you { color: var(--faint); }
.thread__count { flex: none; }
.thread--unread .thread__name { font-weight: 700; }
.thread--unread .thread__preview { color: var(--ink); }
.thread--unread .thread__time { color: var(--ink); font-weight: 700; }

.chat-pane--placeholder { display: none; }

@media (min-width: 1024px) {
  .chat-layout--inbox { grid-template-columns: minmax(320px, 400px) 1fr; align-items: start; }
  .chat-pane--placeholder {
    position: sticky;
    top: 24px;
    min-height: 420px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    padding: 32px;
    border: 1px dashed #CDBF92;
    border-radius: var(--radius-m);
    background: var(--surface);
    color: var(--muted);
    text-align: center;
  }
  .chat-pane__icon { width: 48px; height: 48px; color: var(--ink); }
}

/* Переписка: экран фиксированной высоты — прокручивается только история, поле ввода всегда внизу.
   --viewport-h ставит chat.js по visualViewport, чтобы экранная клавиатура не закрывала поле. */
.body--chat {
  height: auto;
  overflow: visible;
}
.body--chat .site-shell {
  height: var(--viewport-h, 100vh);
  height: var(--viewport-h, 100dvh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.body--chat .site-header { flex: none; }
.body--chat .page {
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.body--chat .flashes { margin: 12px var(--gutter) 0; }
.chat-layout--open { flex: 1; min-height: 0; display: flex; }
.chat-side--rail { display: none; }

.chat { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--cream); }
.chat__head { background: var(--paper); }

.chat__head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px var(--gutter);
  border-bottom: 1px solid var(--line);
}
.chat__back {
  flex: none;
  width: 44px;
  height: 44px;
  margin-left: -10px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
}
.chat__back:hover { background: var(--surface); }
.chat__back svg { width: 24px; height: 24px; }
.avatar--chat { width: 44px; height: 44px; box-shadow: 0 0 0 1px var(--line); }
.avatar--chat svg { width: 26px; height: 26px; }
.chat__who { flex: 1; min-width: 0; }
.chat__name, .chat__listing { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat__name { font-family: var(--font-text); font-size: 1.0625rem; font-weight: 700; letter-spacing: 0; white-space: normal; overflow-wrap: anywhere; }
.chat__listing { color: var(--muted); font-size: 0.875rem; }
.chat__archived { color: var(--faint); }

.chat__scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  padding: 16px var(--gutter) 12px;
}
.chat__scroll:focus-visible { outline-offset: -3px; }
.chat__older { text-align: center; margin-bottom: 8px; }
.chat__older[hidden] { display: none; }

/* Мало сообщений — прижаты к полю ввода, как в мессенджере. */
.chat__messages { list-style: none; margin: auto 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.msg {
  max-width: min(85%, 36rem);
  display: flex;
  flex-direction: column;
  padding: 8px 12px 6px;
  border-radius: 18px;
}
.msg--peer { align-self: flex-start; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); border-bottom-left-radius: 6px; }
.msg--own { align-self: flex-end; background: var(--ink); color: var(--cream); border-bottom-right-radius: 6px; }
.msg--follow { margin-top: -6px; }
.msg--peer.msg--follow { border-top-left-radius: 6px; }
.msg--own.msg--follow { border-top-right-radius: 6px; }
.msg__body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg__meta { align-self: flex-end; display: flex; gap: 6px; margin-top: 2px; color: var(--muted); font-size: 0.75rem; line-height: 1.3; }
.msg--own .msg__meta { color: #D8D2BE; }
.msg__read[hidden] { display: none; }

.chat__day {
  align-self: center;
  margin: 8px 0 2px;
  padding: 2px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.8125rem;
}
/* Граница непрочитанного — медовая полоса. */
.chat__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  color: var(--honey-ink);
  font-size: 0.8125rem;
  font-weight: 600;
}
.chat__divider::before, .chat__divider::after { content: ""; flex: 1; height: 2px; border-radius: 1px; background: var(--honey); }

.chat__empty {
  margin: auto;
  max-width: 34ch;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 32px 0;
  color: var(--muted);
  text-align: center;
}
.chat__empty[hidden] { display: none; }
.chat__empty svg { width: 48px; height: 48px; color: var(--ink); }

.chat__jump {
  position: sticky;
  bottom: 4px;
  align-self: center;
  margin-top: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 20px;
  background: var(--ink);
  color: var(--cream);
  font: 600 0.9375rem/1.2 var(--font-text);
  cursor: pointer;
  box-shadow: 0 10px 20px -12px rgba(28, 27, 25, 0.6);
  animation: toast-in var(--t-slow) var(--ease-spring);
}
.chat__jump[hidden] { display: none; }

.chat__disclosure { flex: none; margin: 0; padding: 8px var(--gutter); color: var(--muted); font-size: 0.8125rem; }

.chat__connection {
  flex: none;
  padding: 8px var(--gutter);
  border-top: 1px solid var(--honey);
  background: var(--honey-soft);
  color: var(--honey-ink);
  font-size: 0.875rem;
  font-weight: 600;
}
.chat__connection[hidden] { display: none; }
.chat__connection--ok { border-top-color: var(--leaf); background: var(--success-bg); color: var(--accent-dark); }

.composer { flex: none; margin: 0; padding: 10px var(--gutter); border-top: 1px solid var(--line); background: var(--paper); }
.composer__row { display: flex; align-items: flex-end; gap: 8px; }
.composer__input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  max-height: 168px;
  padding: 12px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 24px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
  resize: none;
  transition: border-color var(--t-base) var(--ease-out);
}
.composer__input::placeholder { color: var(--faint); }
.composer__input:focus-visible { outline: none; border-color: var(--ink); border-radius: 24px; box-shadow: 0 0 0 4px var(--honey-soft), 0 0 0 5px var(--honey); }
.composer--invalid .composer__input { border: 2px solid var(--danger); }
.composer__send {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--honey);
  color: var(--ink);
  cursor: pointer;
  box-shadow: inset 0 -2px 0 rgba(28, 27, 25, 0.12);
  transition: background-color var(--t-base) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.composer__send:hover { background: var(--honey-press); }
.composer__send:active { transform: scale(0.92); }
.composer__send:focus-visible { border-radius: 50%; }
.composer__send svg { width: 22px; height: 22px; }
.composer__send.is-busy { cursor: progress; }
.composer__send.is-busy svg { animation: send-busy 0.7s ease-in-out infinite alternate; }
@keyframes send-busy { from { opacity: 1; transform: none; } to { opacity: 0.45; transform: translate(2px, -2px); } }
.composer__foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 6px; }
.composer__error { color: var(--danger); font-size: 0.875rem; font-weight: 600; }
.composer__error:empty { display: none; }
.composer__hint { margin-left: auto; color: var(--faint); font-size: 0.8125rem; text-align: right; }
.composer__hint--over { color: var(--danger); font-weight: 600; }
.composer__keys { display: none; }
.composer--keys .composer__keys { display: inline; }
.chat__read { flex: none; padding: 0 var(--gutter) 10px; }
.chat__read[hidden] { display: none; }

/* Телефон: пока открыта клавиатура (фокус в поле), нижняя панель вкладок уступает место полю ввода. */
@media (max-width: 767px) {
  /* Панель вкладок выше --tabbar-h на свою верхнюю границу: поле ввода не должно уходить под неё. */
  .body--chat { padding-bottom: calc(var(--tabbar-h) + 1px + env(safe-area-inset-bottom, 0px)); }
  .body--chat .site-shell { padding-bottom: calc(var(--tabbar-h) + 1px + env(safe-area-inset-bottom, 0px)); }
  /* Только с chat.js: он не даёт кнопке отправки забрать фокус, поэтому панель не прыгает посреди нажатия. */
  .chat-enhanced:has(.composer__input:focus) { padding-bottom: 0; }
  .chat-enhanced:has(.composer__input:focus) .site-shell { padding-bottom: 0; }
  .chat-enhanced:has(.composer__input:focus) .tabs { display: none; }
  .chat-enhanced:has(.composer__input:focus) .composer { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .composer__hint:not(.composer__hint--count) { display: none; }
  .composer__foot:has(.composer__error:empty):has(.composer__hint:not(.composer__hint--count)) { display: none; }
}

@media (min-width: 768px) {
  .body--chat .page { padding: 16px 24px 24px; }
  .chat-layout--open { border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; background: var(--paper); }
  .chat__head { padding: 12px 20px; }
  .chat__scroll { padding: 20px 24px 12px; }
  .composer { padding: 12px 20px 14px; }
  .msg { max-width: min(75%, 36rem); }
}

@media (min-width: 1024px) {
  .chat-side--rail:not([hidden]) {
    display: flex;
    flex-direction: column;
    width: 340px;
    flex: none;
    padding: 12px 16px;
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }
  .chat-side--rail .chat-side__title { font-size: 1.25rem; }
  .chat-side--rail .chat-side__title a { color: var(--ink); text-decoration: none; }
  .chat-side--rail .chat-side__title a:hover { text-decoration: underline; }
  .chat-side--rail:not([hidden]) ~ .chat .chat__back { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .composer__send.is-busy svg { animation: none; opacity: 0.6; }
}

/* ---------- V1.2 C3: две стороны площадки — пчелосемьи и заявки фермеров ---------- */

/* Вкладки каталога: обычные ссылки, активная — светлая «плашка» на сером треке. */
.market-switch {
  display: flex;
  width: 100%;
  max-width: 30rem;
  margin-bottom: 24px;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}
.market-switch__tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--t-base) var(--ease-out), color var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out);
}
.market-switch__tab svg { width: 20px; height: 20px; flex: none; }
.market-switch__tab:hover { color: var(--ink); background: rgba(255, 255, 255, 0.6); }
.market-switch__tab[aria-current="page"] {
  background: var(--paper);
  border-color: var(--ink);
  color: var(--ink);
}
@media (min-width: 768px) { .market-switch { margin-bottom: 32px; } }
/* Узкий телефон: «Заявки фермеров» остаётся в одну строку — иконки уступают место подписи. */
@media (max-width: 419.98px) {
  .market-switch__tab { padding: 8px 6px; }
  .market-switch__tab svg { display: none; }
}
/* 320 px: вкладки делят ширину по длине подписи, а не поровну — иначе «Заявки фермеров» не помещается. */
@media (max-width: 359.98px) {
  .market-switch__tab { flex: 1 1 auto; padding: 8px 4px; font-size: 0.9375rem; }
}

/* Заявка без фото: поле в рядах и название культуры. Фото пасек вместо фото полей не подставляются. */
.cover--field {
  background:
    repeating-linear-gradient(172deg, transparent 0 18px, rgba(79, 122, 58, 0.12) 18px 20px),
    var(--success-bg);
  color: var(--accent-dark);
  padding: 12px 16px;
  text-align: center;
}
.cover--field svg { color: var(--leaf); }
/* Название культуры переносится по словам; длинное слово делится только если иначе не помещается. */
.cover__crop {
  max-width: 100%;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  overflow-wrap: break-word;
  hyphens: auto;
}
.own-item__cover.cover--field { padding: 6px 4px; }
.own-item__cover.cover--field svg { width: 26px; height: 26px; }
.own-item__cover .cover__crop { font-family: var(--font-text); font-weight: 700; font-size: 0.75rem; letter-spacing: -0.01em; }

.card__crop { color: var(--accent-dark); font-size: 0.875rem; font-weight: 600; overflow-wrap: anywhere; }

.listing__kind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 12px 2px 8px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--accent-dark);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.listing__kind svg { width: 20px; height: 20px; flex: none; }

/* Подробная страница без фото: соты, знак и подпись. У заявки — росток и название культуры. */
.gallery__stage--empty { place-content: center; justify-items: center; gap: 10px; padding: 20px; text-align: center; }
.gallery__stage--empty .gallery__icon { width: 64px; height: 64px; color: var(--leaf); }
.listing .gallery__stage--empty { aspect-ratio: auto; min-height: clamp(15rem, 45vw, 30rem); }
.gallery__stage--empty .cover__crop { max-width: 22ch; font-size: clamp(1.125rem, 1rem + 1vw, 1.5rem); }
.gallery__note { color: var(--muted); font-size: 0.9375rem; font-weight: 600; }

/* Телефон: две карточки в ряд. Название, место и условия читаются целиком;
   цена и срок сохраняют единицы. Сердце — те же 44 px. */
@media (max-width: 559.98px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .card__body { padding: 10px 10px 12px; gap: 3px; }
  .card__title, .card__place, .card__crop {
    overflow-wrap: anywhere;
    hyphens: auto;
  }
  .card__title { font-size: 0.9375rem; line-height: 1.3; }
  .card__place, .card__crop { font-size: 0.8125rem; }
  .card__terms { font-size: 0.8125rem; }
  .card__price { margin-top: 4px; font-size: 1rem; overflow-wrap: break-word; }
  .card__unit { display: block; margin-top: 2px; font-size: 0.75rem; line-height: 1.3; }
  .card__facts { flex-direction: column; gap: 2px; font-size: 0.8125rem; line-height: 1.35; }
  .card__author { gap: 8px; padding: 8px 10px 10px; font-size: 0.8125rem; }
  .card .favorite--icon { top: 6px; right: 6px; }
  .card .cover--empty { gap: 4px; padding: 8px; font-size: 0.8125rem; }
  .card .cover--empty svg { width: 30px; height: 30px; }
  .card .cover__crop {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-family: var(--font-text);
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
  }
  .card__actions { padding: 0 10px 10px; }
  .card__actions .button { padding: 8px; font-size: 0.8125rem; text-align: center; }
}

.input--short { max-width: 12rem; }

/* ---------- Этап 7: движение ----------
   Спокойно и по делу: движение отвечает на действие человека. Три длительности и две кривые из :root.
   При «уменьшить движение» общий блок выше сокращает все переходы и анимации до мгновенных. */

/* Раскрытие фильтров и подтверждений: содержимое доступно сразу (фокус, чтение), панель лишь
   проявляется и встаёт на место. Высоту не анимируем — она скрывала бы содержимое в первые кадры. */
.filters[open] .filters__body, .confirm[open] .confirm__body { animation: reveal var(--t-slow) var(--ease-out); }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }

/* Отправка формы: кнопка сохраняет ширину, внизу бежит медовая полоска. */
.button.is-busy { position: relative; overflow: hidden; }
.button.is-busy::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40%;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.55;
  animation: busy-bar 1.1s var(--ease-out) infinite;
}
.button--primary.is-busy::after { background: var(--ink); }
@keyframes busy-bar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* Избранное: сердце «выпрыгивает» после успешного сохранения (favorites.js ставит is-popped). */
.favorite__button.is-popped svg { animation: heart-pop var(--t-slow) var(--ease-spring); }
@keyframes heart-pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* Новое сообщение (отправленное или полученное после открытия) появляется снизу. */
.msg--new { animation: msg-in var(--t-slow) var(--ease-out); }
.msg--own.msg--new { transform-origin: 100% 100%; }
.msg--peer.msg--new { transform-origin: 0 100%; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(0.97); } }

/* Счётчик непрочитанных коротко «толкается», когда число растёт (chat-unread.js ставит is-bumped). */
.tab__badge.is-bumped { animation: badge-bump var(--t-slow) var(--ease-spring); }
@keyframes badge-bump { 0% { transform: scale(0.7); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
  .button.is-busy::after { animation: none; left: 0; width: 100%; opacity: 0.35; }
}
/* Nationwide settlement picker: same fields, focus and surface tokens as catalog. */
.geo-search { grid-column: 1 / -1; min-width: 0; }
[data-settlement-picker] { position: relative; min-width: 0; }
.settlement-options { position: absolute; z-index: 30; inset-inline: 0; top: 80px;
  max-height: 320px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--paper); border: 1.5px solid var(--line-strong); border-radius: 12px;
  box-shadow: 0 8px 24px #1c1b191a; }
.settlement-options[hidden] { display: none; }
.settlement-options [role="option"] { min-height: 44px; padding: 10px 12px;
  cursor: pointer; overflow-wrap: anywhere; font-size: 14px; border-radius: 8px; }
.settlement-options [role="option"]:hover,
.settlement-options [aria-selected="true"] { background: var(--honey-soft); outline: 2px solid var(--ink); outline-offset: -2px; }
.geo-form { margin-block: 16px 24px; }
[data-settlement-clear][hidden] { display: none; }
.settlement-scope { margin-block: var(--space-2, .5rem); }

/* Catalog search: compact first screen; the same GET fields enhance into dialogs. */
.catalog-search .market-switch { margin-block: 16px; }
.catalog-search .intro { margin-top: 20px; max-width: none; }
.catalog-search .intro h1 { font-size: clamp(1.375rem, 3.2vw, 2rem); line-height: 1.35; margin-bottom: 20px; }
.catalog-search .search-form { margin-top: 0; }
.catalog-search .search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.catalog-search .search > .button { width: auto; padding-inline: 22px; }
.catalog-toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; align-items: start; }
.catalog-disclosure { min-width: 0; }
.catalog-disclosure > summary { list-style: none; cursor: pointer; }
.catalog-disclosure > summary::-webkit-details-marker { display: none; }
.catalog-location { flex: 1; }
.catalog-location__toggle { width: 100%; text-align: left; justify-content: start; gap: 12px; min-height: 58px; }
.catalog-location__toggle > span { min-width: 0; overflow-wrap: anywhere; }
.catalog-location__caption { display: block; font-size: .75rem; color: var(--muted); font-weight: 400; line-height: 1.5; }
.catalog-chevron { width: 16px; height: 16px; flex: none; margin-left: auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.catalog-conditions > .filters__toggle { min-height: 58px; gap: 8px; }
.catalog-conditions > .filters__toggle::after { display: none; }
.catalog-search .catalog { margin-top: 24px; }
.catalog-search .catalog__head { align-items: center; gap: 12px; margin-bottom: 16px; }
.catalog-search .catalog__count { margin: 0; font-size: .9375rem; }
.catalog-page { font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.catalog-search .sort { gap: 8px; min-width: 0; }
.catalog-search .sort__select { min-width: 0; max-width: 250px; }
.catalog-search .sort__label { font-size: .8125rem; }
.catalog-active { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0 0 16px; }
.catalog-active .active-filters { margin: 0; flex-wrap: nowrap; overflow-x: auto; min-width: 0; padding: 3px; scrollbar-width: thin; }
.catalog-active .active-filters > li { flex: none; }
.catalog-active .active-filter { position: relative; min-height: 40px; gap: 8px; font-size: .8125rem; }
.active-filter__text { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-active .active-filters__reset { flex: none; font-size: .8125rem; min-height: 44px; padding: 0; }
.catalog-panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); margin-top: 12px; }
.catalog-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.catalog-panel__head h2 { margin: 0; font-family: var(--font-display); font-size: 1.125rem; line-height: 1.5; }
.catalog-panel__close { flex: none; display: grid; place-items: center; width: 44px; height: 44px; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer; }
.catalog-panel__close svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.catalog-panel__content { padding: 24px; }
.catalog-panel__footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--paper); }
.catalog-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 20px; align-items: start; }
.catalog-field { margin: 0; padding: 0; border: 0; min-width: 0; position: relative; }
.catalog-field > .field__label, .catalog-field__label { margin-bottom: 8px; }
.catalog-field__label { display: flex; align-items: center; justify-content: space-between; min-height: 24px; gap: 8px; }
.catalog-field__label .field__label { margin: 0; }
.catalog-field .input { width: 100%; min-width: 0; }
.catalog-field .duration__value { width: 6.5rem; }
.catalog-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.catalog-range label { position: relative; min-width: 0; }
.catalog-range label > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .8125rem; pointer-events: none; }
.catalog-range .input { padding-left: 38px; }
.catalog-additional { margin-top: 28px; border-top: 1px solid var(--line); }
.catalog-additional > summary { padding-block: 18px; cursor: pointer; font-weight: 600; font-size: .9375rem; }
.catalog-additional[open] > summary { margin-bottom: 8px; }
.catalog-help { position: relative; flex: none; font-weight: 400; }
.catalog-help > summary { display: grid; place-items: center; list-style: none; cursor: pointer; width: 28px; height: 28px; color: var(--muted); }
.catalog-help > summary::-webkit-details-marker { display: none; }
.catalog-help svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
fieldset.catalog-field > .catalog-help { position: absolute; right: 0; top: -32px; }
.catalog-help > p { position: absolute; right: 0; top: 30px; z-index: 5; margin: 0; width: min(260px, 75vw); padding: 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--paper); color: var(--ink); font-size: .8125rem; box-shadow: 0 8px 24px #1c1b1914; }
.location-fallback { display: grid; gap: 16px; }
.location-query__input { position: relative; }
.location-query__input > .input { padding-right: 48px; }
.location-query__clear { position: absolute; right: 2px; top: 2px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.location-query__clear:hover { background: var(--honey-soft); color: var(--ink); }
.location-query__clear svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.location-legacy { margin-top: 16px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.location-legacy .field__hint { margin: 0; }
.location-legacy button { margin-top: 8px; font-size: .8125rem; }
.location-query .field__hint:empty { display: none; }
[data-radius-field] { margin-top: 24px; }
.place-options { list-style: none; padding: 4px; margin: 8px 0; max-height: 300px; overflow: auto; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--paper); }
.place-options [role=option] { padding: 12px; min-height: 44px; border-radius: 8px; cursor: pointer; font-size: .875rem; overflow-wrap: anywhere; }
.place-options [role=option]:hover, .place-options [aria-selected=true] { background: var(--honey-soft); }
.place-options [data-place-kind=all] { border-top: 1px solid var(--line); font-weight: 600; }
.place-options [role=presentation] button { width: 100%; }
.catalog-dialog { width: min(680px, calc(100% - 48px)); max-width: none; max-height: calc(100dvh - 64px); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-m); background: var(--paper); color: var(--ink); box-shadow: 0 20px 80px #1c1b1933; }
.catalog-dialog::backdrop { background: #1c1b1980; }
.catalog-dialog[open] { display: flex; flex-direction: column; }
.catalog-dialog .catalog-panel { display: flex; flex-direction: column; min-height: 0; border: 0; margin: 0; border-radius: inherit; }
.catalog-dialog .catalog-panel__head, .catalog-dialog .catalog-panel__footer { flex: none; }
.catalog-dialog .catalog-panel__content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.catalog-dialog .catalog-panel__cancel { margin-left: auto; }
.catalog-modal-open { overflow: hidden; }
.catalog-search [hidden] { display: none !important; }
.catalog-search summary:focus-visible, .catalog-dialog button:focus-visible, .catalog-dialog summary:focus-visible { outline: 3px solid var(--honey); outline-offset: 3px; }
@media (max-width: 559px) {
  .catalog-search .intro { margin-top: 16px; }
  .catalog-search .intro h1 { margin-bottom: 16px; }
  .catalog-search .search > .button { padding-inline: 16px; }
  .catalog-toolbar { gap: 8px; }
  .catalog-location__toggle { padding: 8px 12px; gap: 8px; font-size: .8125rem; }
  .catalog-location__toggle > .button__icon { display: none; }
  .catalog-conditions > .filters__toggle { padding-inline: 12px; font-size: .8125rem; }
  .catalog-conditions .filters__count { min-width: 20px; padding-inline: 4px; }
  .catalog-search .catalog__head { flex-wrap: wrap; gap: 8px; }
  .catalog-search .catalog__count { font-size: .8125rem; }
  .catalog-page { display: block; }
  .catalog-search .sort { margin-left: auto; }
  .catalog-search .sort__label { display: none; }
  .catalog-search .sort__select { font-size: .8125rem; max-width: 200px; min-height: 44px; padding-left: 10px; }
  .catalog-active { gap: 8px; }
  .active-filter__text { max-width: 180px; }
  .catalog-fields { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .catalog-dialog { width: 100%; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .catalog-dialog .catalog-panel { flex: 1; }
  .catalog-panel__head { padding: 12px 16px; }
  .catalog-panel__content { padding: 20px 16px; }
  .catalog-panel__footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); gap: 6px 12px; }
  .catalog-panel__footer > .button--primary { flex: 1 1 100%; }
  .catalog-panel__footer > .button--quiet { min-height: 40px; padding-block: 8px; }
  .catalog-help > summary { width: 36px; height: 32px; }
}
.settlement-scope > summary { padding-block: .5rem; cursor: pointer; font-size: .875rem; }
.settlement-scope[open] > summary { margin-bottom: .5rem; }
/* Cooperation terms stay in the existing message stream and composer context. */
.chat__identity { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 10px; }
.chat__role { color: var(--muted); font-size: .75rem; }
.chat__head .chat__listing { line-height: 1.5; margin-top: 3px; }
.chat__listing a { text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.chat__messages { gap: 12px; }
.msg:not(.msg--terms) { line-height: 1.55; }
.thread__attention { display: block; margin-top: 4px; font-size: .75rem; font-weight: 600; color: var(--honey-ink); }
.thread__attention[hidden] { display: none; }

/* A snapshot reads like a message; previous snapshots fold into the same timeline. */
.terms-record { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.terms-record__summary { display: none; cursor: pointer; min-height: 48px; padding: 12px 16px; font-size: .8125rem; color: var(--muted); }
.terms-record__brief { display: block; color: var(--ink); margin-top: 3px; }
.terms-card--historical .terms-record__summary { display: list-item; list-style-position: inside; }
.terms-record__body { padding: 16px; }
.terms-card--historical .terms-record[open] .terms-record__body { border-top: 1px solid var(--line); }
.terms-card__top { display: grid; gap: 6px; }
.terms-card__by { color: var(--muted); font-size: .75rem; margin-top: 8px; }
.terms-key { margin-block: 16px 8px; display: grid; gap: 4px; }
.terms-key__quantity { font: 500 1.25rem/1.5 var(--font-display); }
.terms-key__quantity span { font: 600 .875rem/1.5 var(--font-text); }
.terms-key__period { font-size: .875rem; color: var(--muted); }
.terms-key__price { font-size: 1rem; font-weight: 700; }
.terms-detail > summary, .agreement-meta > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-size: .8125rem; font-weight: 600; list-style: none; }
.terms-detail > summary::after, .agreement-meta > summary::after { content: '+'; margin-left: auto; font-size: 1.0625rem; }
.terms-detail[open] > summary::after, .agreement-meta[open] > summary::after { content: '−'; }
.terms-detail > .terms-fields-view { padding-block: 10px; }
.terms-detail summary::-webkit-details-marker, .agreement-meta summary::-webkit-details-marker { display: none; }
.terms-fields-view { overflow-wrap: anywhere; }
.terms-fields-view .terms-card__listing { margin: 12px 0 0; }
.terms-diff { display: grid; gap: 8px; padding: 12px; margin: 14px 0 0; background: var(--cream); border-radius: 10px; }
.terms-diff > div { display: grid; gap: 2px; }
.terms-diff dt { font-size: .75rem; color: var(--muted); }
.terms-diff dd { margin: 0; font-size: .875rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.terms-diff del { color: var(--muted); }
.terms-diff__text > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; }
.terms-diff__text > p { white-space: pre-wrap; }
.terms-unchanged { font-size: .75rem; color: var(--muted); margin-top: 8px; }
.terms-more { position: relative; margin-left: auto; }
.terms-more > summary { cursor: pointer; min-height: 44px; min-width: 44px; display: grid; place-content: center; padding-inline: 8px; font-size: .8125rem; list-style: none; }
.terms-more > summary::-webkit-details-marker { display: none; }
.terms-more__items { display: grid; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.terms-more[open] { flex-basis: 100%; }
.terms-more[open] > summary { width: fit-content; margin-left: auto; }
.terms-more__items .button { text-align: left; justify-content: flex-start; }
.terms-card__actions .button--quiet-danger { background: transparent; color: var(--danger); border-color: transparent; box-shadow: none; }
.terms-card__actions .button--quiet-danger:hover { background: var(--danger-bg); }

/* Events keep their details, but occupy a quiet line instead of another full card. */
.msg.msg--event { align-self: center; width: min(100%,30rem); padding: 0 8px; }
.msg--event .msg__meta { align-self: center; font-size: .6875rem; margin-top: 0; }
.terms-event { min-width: 0; color: var(--muted); font-size: .8125rem; }
.terms-event > details > summary { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; list-style: none; cursor: pointer; text-align: center; }
.terms-event > details > summary::-webkit-details-marker { display: none; }
.terms-event__dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--leaf); }
.terms-event__body { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.terms-event__body > time, .terms-event__body > p:last-child { display: block; margin-top: 12px; font-size: .75rem; }
.terms-event--request { padding: 12px 16px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.terms-event__prompt { font-size: .875rem; color: var(--ink); }
.terms-event__prompt:empty { display: none; }
.terms-event__prompt[hidden] { display: none; }
.agreement-details > summary { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-height: 48px; cursor: pointer; font-size: .8125rem; font-weight: 600; }
.agreement-details > summary > span:last-child { font-weight: 400; color: var(--muted); }
.agreement-details__body { padding: 8px 0 12px; }
.agreement-section-title { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-dark); }
.agreement-details .terms-key { margin-top: 8px; }
.agreement-meta { margin-top: 12px; border-top: 1px solid var(--line); }
.agreement-meta > p { font-size: .8125rem; color: var(--muted); margin-bottom: 8px; }
@media (max-width: 559px) {
  .chat__scroll { padding-inline: 12px; }
  .chat__head { gap: 8px; }
  .chat__head .avatar--chat { width: 36px; height: 36px; }
  .chat__identity { gap: 0 8px; }
  .chat__name { font-size: .9375rem; }
  .chat__listing { font-size: .75rem; }
  .terms-record__body { padding: 14px; }
  .terms-card__actions { gap: 6px; }
  .terms-card__actions > .button { flex: 1 1 auto; }
  .terms-card__actions > .terms-more { flex: none; }
  .terms-card__actions > .terms-more[open] { flex: 1 1 100%; }
  .terms-key__quantity { font-size: 1.125rem; }
}
.terms-editor { flex: none; min-width: 0; padding: 0 var(--gutter); border-top: 1px solid var(--line); background: var(--paper); }
.terms-editor__toggle { width: fit-content; min-height: 44px; display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: .875rem; font-weight: 600; cursor: pointer; list-style: none; }
.terms-editor__toggle > svg { width: 24px; height: 24px; padding: 3px; border-radius: 8px; background: var(--honey-soft); }
.terms-editor__toggle::-webkit-details-marker { display: none; }
.terms-editor[open] { min-height: 0; overflow: auto; }
.terms-body { display: flex; flex-direction: column; max-height: min(75dvh, 52rem); min-width: 0; }
.terms-body__head { display: flex; gap: 16px; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); flex: none; }
.terms-body__head h2 { font-size: 1.125rem; line-height: 1.4; }
.terms-body__head p { font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; margin-top: 6px; }
.terms-close { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); background: var(--cream); color: var(--ink); border-radius: 12px; cursor: pointer; }
.terms-close svg { width: 20px; height: 20px; }
.terms-close[hidden], .terms-actions [hidden] { display: none; }
.terms-body form { display: flex; flex-direction: column; min-height: 0; }
.terms-fields { display: grid; gap: 24px; padding: 24px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.terms-form-section { display: grid; gap: 16px; min-width: 0; }
.terms-form-section + .terms-form-section { padding-top: 22px; border-top: 1px solid var(--line); }
.terms-form-section h3 { font: 700 .9375rem/1.4 var(--font-text); }
.terms-form-section .field__label { font-size: .875rem; }
.terms-dates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.terms-dates .field, .terms-fields .input { min-width: 0; }
.terms-fields input[type=date] { width: 100%; min-height: 48px; }
.terms-field-group { display: grid; gap: 14px; min-width: 0; }
.terms-price { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.terms-price .field__label { margin-bottom: 8px; }
.terms-price__choice { min-height: 44px; flex: 1 1 140px; display: flex; justify-content: center; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: .8125rem; text-align: center; cursor: pointer; position: relative; }
.terms-price__choice:has(:checked) { background: var(--honey-soft); border-color: var(--ink); font-weight: 600; }
.terms-price__choice:has(:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
.terms-price__choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.terms-soon { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--cream); color: var(--ink); font: 600 .875rem/1.45 var(--font-text); text-align: left; cursor: pointer; }
.terms-soon > svg { width: 22px; height: 22px; flex: none; }
.terms-soon__badge { margin-left: auto; border-radius: 999px; background: var(--wax); padding: 2px 8px; font-size: .75rem; white-space: nowrap; }
.terms-actions { flex: none; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--paper); }
.terms-actions .button--primary { flex: 1; }
.terms-dialog { width: min(640px,calc(100% - 32px)); max-height: calc(var(--viewport-h,100dvh) - 32px); margin: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 80px #1c1b1933; }
.terms-dialog::backdrop { background: #1c1b1977; }
.terms-dialog .terms-body { max-height: calc(var(--viewport-h,100dvh) - 32px); }
.terms-notice { inset: 0; width: min(380px,calc(100% - 32px)); margin: auto; padding: 24px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: 0 16px 80px #1c1b1940; }
.terms-notice::backdrop { background: #1c1b1944; }
.terms-notice h2 { font-size: 1.0625rem; line-height: 1.5; margin-bottom: 12px; }
.terms-notice p { color: var(--muted); margin-bottom: 20px; }
.terms-notice .button { width: 100%; }
.msg.msg--terms { width: min(100%,28rem); max-width: 100%; color: var(--ink); background: transparent; box-shadow: none; padding: 0; border-radius: 16px; }
.msg--terms .msg__meta { color: var(--muted); margin-top: 5px; flex-wrap: wrap; justify-content: flex-end; padding-inline: 6px; }
.terms-card { min-width: 0; overflow-wrap: anywhere; }
.terms-card__title { font: 700 .9375rem/1.45 var(--font-text); }
.terms-card__status { display: inline-block; width: fit-content; background: var(--honey-soft); color: var(--honey-ink); padding: 3px 9px; border-radius: 8px; font-size: .75rem; font-weight: 600; }
.terms-card__listing { font-size: .8125rem; color: var(--muted); margin-bottom: 14px; }
.terms-card__values { margin: 0; display: grid; gap: 10px; }
.terms-card__values > div { display: grid; grid-template-columns: minmax(85px,1fr) minmax(0,2fr); gap: 10px; }
.terms-card__values dt { color: var(--muted); font-size: .8125rem; }
.terms-card__values dd { margin: 0; font-size: .9375rem; font-weight: 600; }
.terms-card__conditions { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 14px; }
.terms-card__conditions h3 { font-family: var(--font-text); font-size: .8125rem; color: var(--muted); font-weight: 400; }
.terms-card__conditions p { font-size: .9375rem; white-space: pre-wrap; margin-top: 6px; }
.terms-card__note { color: var(--muted); font-size: .8125rem; margin-top: 10px; }
@media (max-width: 559px) {
  .terms-dialog { width: 100%; max-width: none; height: var(--viewport-h,100dvh); max-height: var(--viewport-h,100dvh); border: 0; border-radius: 0; }
  .terms-dialog .terms-body { height: 100%; max-height: var(--viewport-h,100dvh); }
  .terms-dialog .terms-body form { flex: 1; }
  .terms-fields { flex: 1; padding: 18px 16px; }
  .terms-body__head, .terms-actions { padding: 14px 16px; }
  .terms-actions { padding-bottom: calc(14px + env(safe-area-inset-bottom,0px)); }
  .terms-actions .button--quiet { flex: none; }
  .terms-price__choice { flex-basis: 110px; }
}

/* A small agreed-state disclosure; historical message fields never change. */
.cooperation-summary { flex: none; min-width: 0; background: var(--paper); border-bottom: 1px solid var(--line); }
.cooperation-summary[hidden], .cooperation-notice[hidden], .terms-card__actions[hidden], .terms-action-status[hidden] { display: none; }
.cooperation-summary > summary { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 16px; padding: 10px 20px; min-height: 56px; list-style: none; cursor: pointer; }
.cooperation-summary > summary::-webkit-details-marker { display: none; }
.cooperation-summary__heading { font-size: .875rem; font-weight: 700; color: var(--accent-dark); }
.cooperation-summary__brief { grid-column: 1; font-size: .8125rem; color: var(--muted); overflow-wrap: anywhere; }
.cooperation-summary__state { grid-column: 1; color: var(--accent-dark); font-size: .75rem; font-weight: 600; }
.cooperation-summary__view { grid-column: 2; grid-row: 1 / 4; align-self: center; font-size: .8125rem; text-decoration: underline; text-decoration-color: var(--honey-deep); text-underline-offset: 4px; }
.cooperation-summary__body { max-height: min(36dvh,26rem); overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px; border-top: 1px solid var(--line); }
.agreement-details { min-width: 0; overflow-wrap: anywhere; }
.agreement-details + .agreement-details { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.agreement-details > h2 { font-size: .9375rem; margin-bottom: 12px; }
.agreement-details__actions { margin-top: 12px; }
.agreement-disclosure { font-size: .75rem; color: var(--muted); margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.agreement-pages { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding-top: 16px; font-size: .875rem; }
.agreement-pages a { display: flex; align-items: center; min-height: 44px; }
.agreement-pending { margin-top: 16px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--cream); }
.agreement-pending > summary { min-height: 44px; padding-block: 10px; cursor: pointer; font-size: .875rem; font-weight: 600; overflow-wrap: anywhere; }
.agreement-pending > .terms-card { padding-block: 12px; }
.terms-card__note:empty { display: none; }
.terms-card--agreed .terms-card__status { background: var(--success-bg); color: var(--accent-dark); }
.terms-card--historical .terms-card__status { background: var(--surface); color: var(--muted); }
.terms-card__actions { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.terms-card__actions form { margin: 0; }
.terms-card__actions .button { min-height: 44px; padding: 10px 12px; font-size: .8125rem; line-height: 1.45; }
.terms-card__actions .button--quiet { padding-inline: 4px; }
.terms-action-status { color: var(--danger); font-size: .8125rem; margin-top: 8px; overflow-wrap: anywhere; }
.cooperation-notice { flex: none; margin: 0; padding: 10px 20px; background: var(--danger-bg); color: var(--danger); font-size: .875rem; overflow-wrap: anywhere; }
@media (max-width: 559px) {
  .cooperation-summary > summary { padding: 9px 16px; gap: 3px 10px; }
  .cooperation-summary__view { max-width: 84px; }
  .cooperation-summary__body { max-height: 30dvh; padding: 12px 16px; }
  .terms-card__actions > form { flex: 1 1 auto; }
  .terms-card__actions form .button { width: 100%; }
}

/* Explicit lifecycle confirmations stay small and use the existing chat palette. */
.lifecycle-dialog { width: min(100% - 24px,560px); max-height: min(90dvh,48rem); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); color: var(--ink); }
.lifecycle-dialog::backdrop { background: rgb(20 19 14 / .46); }
.lifecycle-panel { padding: 22px; max-height: 55dvh; overflow-y: auto; flex: none; border-bottom: 1px solid var(--line); background: var(--paper); min-width: 0; overflow-wrap: anywhere; }
.lifecycle-dialog .lifecycle-panel { max-height: 88dvh; border: 0; }
.lifecycle-panel h2 { font-size: 1.125rem; line-height: 1.5; margin-bottom: 14px; }
.lifecycle-panel > p { margin-block: 12px; }
.lifecycle-panel details > summary { padding-block: 12px; min-height: 44px; cursor: pointer; }
.lifecycle-panel .field { margin-top: 14px; }
.lifecycle-panel label { display: block; margin-bottom: 8px; }
.lifecycle-buttons { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
.lifecycle-buttons .button { min-height: 44px; font-size: .875rem; padding-inline: 14px; }
.lifecycle-warning { border-left: 3px solid var(--honey); padding: 8px 12px; background: var(--cream); font-size: .875rem; }
.terms-lifecycle__reason { white-space: pre-wrap; overflow-wrap: anywhere; }
[data-lifecycle-error] { color: var(--danger); font-size: .875rem; margin-top: 12px; }
[data-lifecycle-event-actions][hidden] { display: none; }
@media (max-width:559px) {
 .lifecycle-panel { padding: 18px 16px; }
 .lifecycle-buttons > .button { flex: 1 1 100%; }
}

/* Public information: in-flow footer, existing chat viewport kept above it. */
/* Two-line navigation labels need their full height on the narrowest phones. */
@media (max-width: 359px) { :root { --tabbar-h: 72px; } }
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.site-shell { flex: 1; min-width: 0; }
.body--chat .site-shell { flex: none; }
.site-footer { flex: none; border-top: 1px solid var(--line); background: var(--cream); }
.site-footer__inner { max-width: var(--content); margin-inline: auto; padding: 20px var(--gutter); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.site-footer__brand .brand__mark { width: 26px; height: 26px; }
.site-footer__brand .brand__name { font-size: 1rem; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.site-footer__links a, .site-footer__email { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-size: .875rem; overflow-wrap: anywhere; }
.site-footer__email { margin-left: auto; }
.site-footer__copyright { color: var(--muted); white-space: nowrap; font-size: .75rem; }
.site-footer__geodata { display: inline-flex; align-items: center; flex-basis: 100%; grid-column: 1 / -1; min-height: 44px; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
@media (max-width: 767px) {
  .site-footer a { scroll-margin-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px); }
}
.information { max-width: 860px; margin-inline: auto; min-width: 0; overflow-wrap: anywhere; }
.information__nav { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 32px; }
.information__nav a { display: inline-flex; align-items: center; padding: 8px 12px; min-height: 44px; color: var(--muted); border-radius: var(--radius-s); font-size: .875rem; }
.information__nav a[aria-current] { background: var(--honey-soft, #FFF0BB); color: var(--ink); font-weight: 600; text-decoration: none; }
.information__header { max-width: 46rem; margin-bottom: 28px; }
.information__eyebrow { color: var(--muted); font-size: .8125rem; margin-bottom: 12px; }
.information__header h1 { font-size: clamp(1.5rem, 3.3vw, 2.15rem); line-height: 1.3; margin: 0 0 16px; }
.information__header > p:last-child:not(:first-child) { color: var(--muted); font-size: 1.0625rem; line-height: 1.65; }
.information__article { max-width: 46rem; }
.information__article h2 { font-family: var(--font-text); font-size: 1.1875rem; line-height: 1.45; font-weight: 700; margin: 32px 0 12px; }
.information__article p + p { margin-top: 12px; }
.information__article ul, .information__article ol { padding-left: 1.4em; margin-block: 12px 20px; }
.information__article li + li { margin-top: 8px; }
.information__article section { scroll-margin-top: 24px; }
.information__toc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px 24px; margin-bottom: 32px; }
.information__toc ol { margin-bottom: 0; columns: 2; column-gap: 32px; }
.information__toc li { break-inside: avoid; padding-block: 3px; }
.information__toc a { text-underline-offset: 3px; }
.information__definitions { margin: 20px 0; }
.information__definitions dt { font-weight: 700; margin-top: 20px; }
.information__definitions dd { margin: 6px 0 0; }
.document-draft { background: #FFF5D8; border-left: 3px solid var(--honey); padding: 16px 20px; margin-bottom: 28px; border-radius: 0 var(--radius-s) var(--radius-s) 0; font-size: .875rem; line-height: 1.65; max-width: 46rem; }
.document-draft p { margin-top: 6px; }
.document-list { display: grid; gap: 12px; margin: 24px 0; }
.document-list__item { display: grid; gap: 8px; padding: 20px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); color: var(--muted); text-decoration: none; }
.document-list__item:hover { border-color: var(--ink); }
.document-list__title { color: var(--ink); font-size: 1.0625rem; font-weight: 700; }
.document-list__status { color: var(--muted); font-size: .8125rem; }
.contact-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 24px; }
.information__article .contact-card h2 { margin-top: 0; font-size: .875rem; color: var(--muted); font-weight: 600; }
.contact-card__email { font-size: clamp(1.1rem, 3vw, 1.7rem); font-weight: 600; color: var(--ink); text-underline-offset: 5px; overflow-wrap: anywhere; }
.contact-card__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.contact-card__actions [hidden] { display: none; }
.contact-card__status { font-size: .875rem; color: var(--muted); }
.contact-card__status:not(:empty) { margin-top: 12px; }
.information__support { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 40px; color: var(--muted); font-size: .875rem; }
.information__support > p { color: var(--ink); font-weight: 600; width: 100%; }
.legal-note { color: var(--muted); font-size: .8125rem; line-height: 1.65; overflow-wrap: anywhere; }
.panel > .legal-note { margin-bottom: 16px; }
.push-settings__copy .legal-note { margin-top: 8px; }
@media (max-width: 767px) {
  .site-footer__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding-block: 20px; }
  .site-footer__brand { grid-column: 1; grid-row: 1; justify-self: start; }
  .site-footer__copyright { grid-column: 2; grid-row: 1; }
  .site-footer__links { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .site-footer__email { grid-column: 1 / -1; margin-left: 0; }
  .information__nav { margin: -8px -4px 24px; gap: 0; }
  .information__nav a { padding-inline: 10px; }
  .information__toc { padding: 16px 20px; }
  .information__toc ol { columns: 1; }
  .contact-card, .document-list__item { padding: 20px; }
}
