/* ЭТОТ ФАЙЛ СОБРАН СКРИПТОМ scripts/build_ds_css.py из docs/design/tokens.css и components.css. Руками не править. */

/* Palo · токены дизайн-системы (версия 2: сдержанная). Источник правды для цветов, шрифтов, отступов, радиусов, теней и движения.
   Приложение и админка берут значения только отсюда; своих «магических» чисел в стилях быть не должно.
   Тема:   <html data-theme="light|dark">    (приложение: из Telegram colorScheme, админка: из prefers-color-scheme)
   Акцент: <html data-accent="blue|graphite"> (blue по умолчанию; graphite: чёрные кнопки на светлом и белые на тёмном)
   Принцип: почти монохром; цвет только на главном действии и выборе; статусы тонкими цветными точками и текстом.
   Правила производительности: ни backdrop-filter, ни blur(); анимируем только transform и opacity. */

:root {
  color-scheme: light;

  /* ---------- шрифт ---------- */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  /* размер / межстрочный */
  --fs-display: 30px;  --lh-display: 36px;   /* заголовок шторки или экрана */
  --fs-title: 20px;    --lh-title: 26px;     /* заголовок окна */
  --fs-headline: 17px; --lh-headline: 22px;  /* название события, строки списка */
  --fs-body: 15px;     --lh-body: 22px;      /* основной текст */
  --fs-body-sm: 14px;  --lh-body-sm: 20px;   /* админка, плотные списки */
  --fs-caption: 13px;  --lh-caption: 18px;   /* подписи, метаданные */
  --fs-micro: 11px;    --lh-micro: 14px;     /* подписи вкладок нижней панели */

  /* ---------- сетка (шаг 4 px) ---------- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --tap: 44px;            /* минимальная зона нажатия */
  --control: 50px;        /* высота главных кнопок и полей в приложении */
  --control-sm: 34px;     /* компактные кнопки в списках */
  --control-dense: 32px;  /* кнопки и поля в админке */

  /* ---------- радиусы ---------- */
  --r-sm: 10px;   /* маленькие кнопки, чипы-прямоугольники */
  --r-md: 14px;   /* кнопки, поля, строки */
  --r-lg: 18px;   /* карточки */
  --r-xl: 28px;   /* шторки и диалоги */
  --r-pill: 999px;

  /* ---------- движение (только transform и opacity) ---------- */
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 320ms;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* ---------- слои ---------- */
  --z-map: 0;
  --z-float: 10;     /* плавающие панели и кнопки поверх карты */
  --z-sheet: 20;
  --z-overlay: 30;   /* диалоги и формы */
  --z-toast: 40;

  /* ---------- цвета: светлая тема, акцент «синий» ---------- */
  --bg: #F2F2F7;            /* фон экранов */
  --surface: #FFFFFF;       /* карточки, шторки, диалоги */
  --surface-2: #F0F0F5;     /* заливка полей, сегментов, вторичных кнопок */
  --surface-3: #E5E5EA;     /* нажатое состояние */
  --surface-float: rgb(255 255 255 / .97);  /* плавающие панели над картой: почти плотные, БЕЗ размытия */
  --scrim: rgb(0 0 0 / .4);                 /* затемнение под диалогами */
  --border: rgb(60 60 67 / .14);            /* тонкие разделители */
  --border-strong: rgb(60 60 67 / .3);
  --text: #000000;          /* основной текст */
  --text-2: #55555C;        /* вторичный */
  --text-3: #696970;        /* подсказки и подписи (контраст не ниже 4.5) */

  --accent: #0A62D8;
  --accent-hover: #0852B8;
  --accent-text: #0A62D8;   /* акцент как цвет текста (ссылки, вторичные кнопки) */
  --on-accent: #FFFFFF;     /* текст и иконки на акценте */

  --success: #1E7B34;
  --danger: #C9202D;
  --warning: #A04A00;
  --gold: #C99A1B;       /* рамка событий администраторов */

  /* метки карты */
  --pin-me: #0A62D8;        /* вы: акцентная точка */
  --pin-edge: #FFFFFF;      /* обводка меток */

  /* тени: одна ступень на элемент, статичные */
  --shadow-1: 0 0 0 1px rgb(60 60 67 / .06);                                       /* карточка: почти только контур */
  --shadow-2: 0 1px 3px rgb(0 0 0 / .1), 0 6px 16px rgb(0 0 0 / .1);              /* плавающее над картой, метки */
  --shadow-3: 0 -2px 20px rgb(0 0 0 / .12);                                        /* шторка */
  --shadow-4: 0 10px 40px rgb(0 0 0 / .2);                                         /* диалог */

  /* аватарки одного цвета, без пёстрых заливок */
  --avatar-bg: #E5E5EA;
  --avatar-fg: #55555C;

  /* упрощённая карта для макетов (настоящая карта берёт цвета у OpenFreeMap) */
  --map-land: #F0EEE8; --map-water: #C9DEEE; --map-park: #DCE9D2; --map-road: #FFFFFF; --map-casing: #E0DCD1; --map-label: #8A8D93;
}

/* ---------- акцент «графит» (самый сдержанный: кнопки чёрные на светлом) ---------- */
[data-accent="graphite"] {
  --accent: #1C1C1E;
  --accent-hover: #000000;
  --accent-text: #1C1C1E;
  --on-accent: #FFFFFF;
  --pin-me: #1C1C1E;
}

/* ---------- тёмная тема ---------- */
[data-theme="dark"] {
  color-scheme: dark;

  --bg: #000000;
  --surface: #1C1C1E;
  --surface-2: #2C2C2E;
  --surface-3: #3A3A3C;
  --surface-float: rgb(28 28 30 / .97);
  --scrim: rgb(0 0 0 / .6);
  --border: rgb(255 255 255 / .12);
  --border-strong: rgb(255 255 255 / .25);
  --text: #FFFFFF;
  --text-2: #AEAEB2;
  --text-3: #9C9CA3;

  --accent: #5AA9FF;
  --accent-hover: #7BBBFF;
  --accent-text: #5AA9FF;
  --on-accent: #00152E;

  --success: #5BD27A;
  --danger: #FF6B6B;
  --warning: #FFB340;
  --gold: #E3B341;

  --pin-me: #5AA9FF;
  --pin-edge: #1C1C1E;

  --shadow-1: 0 0 0 1px rgb(255 255 255 / .06);
  --shadow-2: 0 1px 3px rgb(0 0 0 / .5), 0 6px 16px rgb(0 0 0 / .4);
  --shadow-3: 0 -2px 20px rgb(0 0 0 / .55);
  --shadow-4: 0 10px 40px rgb(0 0 0 / .65);

  --avatar-bg: #3A3A3C;
  --avatar-fg: #D1D1D6;

  --map-land: #1D1F22; --map-water: #14283A; --map-park: #1B2A21; --map-road: #2E3239; --map-casing: #121417; --map-label: #7E858F;
}

[data-theme="dark"][data-accent="graphite"] {
  --accent: #F2F2F7;
  --accent-hover: #FFFFFF;
  --accent-text: #FFFFFF;
  --on-accent: #000000;
  --pin-me: #F2F2F7;
}

/* Palo · компоненты дизайн-системы (версия 2: сдержанная). Классы с префиксом ds-.
   Подключается после tokens.css. Здесь только токены, никаких «магических» чисел.
   Запрещено: backdrop-filter, blur(), filter: drop-shadow() на метках карты, анимации не transform/opacity.
   Принцип: почти монохром. Цвет только у главной кнопки и выбранного; всё остальное нейтральное. */

*, *::before, *::after { box-sizing: border-box; }
.ds { font: var(--fw-regular) var(--fs-body)/var(--lh-body) var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
:where(.ds) :where(button, input, textarea, select) { font: inherit; color: inherit; }
:where(.ds) button { cursor: pointer; border: 0; background: none; padding: 0; }  /* :where(): нулевая специфичность, компоненты ниже её перекрывают */
:where(.ds) :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ds [hidden] { display: none !important; }

/* ---------- иконки ---------- */
.ds-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ds-icon--sm { width: 16px; height: 16px; }
.ds-icon--lg { width: 24px; height: 24px; }

/* ---------- текст ---------- */
.ds-display { font-size: var(--fs-display); line-height: var(--lh-display); font-weight: var(--fw-bold); letter-spacing: -.015em; margin: 0; }
.ds-title { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-bold); margin: 0; }
.ds-headline { font-size: var(--fs-headline); line-height: var(--lh-headline); font-weight: var(--fw-semibold); margin: 0; }
.ds-body { font-size: var(--fs-body); line-height: var(--lh-body); }
.ds-caption { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-2); }
.ds-label { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: var(--fw-semibold); color: var(--text-2); }  /* заголовок раздела: обычным регистром */
.ds-muted { color: var(--text-2); }

/* ---------- кнопки: одна цветная (primary), остальные нейтральные ---------- */
.ds-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: var(--control); padding: 0 var(--s-5); border-radius: var(--r-md); font-size: 16px; font-weight: var(--fw-semibold); line-height: 1; white-space: nowrap; transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast); }
.ds-btn:active { transform: scale(.98); }
.ds-btn--primary { background: var(--accent); color: var(--on-accent); }
.ds-btn--soft { background: var(--surface-2); color: var(--accent-text); }
.ds-btn--ghost { background: var(--surface-2); color: var(--text); }
.ds-btn--danger { background: var(--surface-2); color: var(--danger); }
.ds-btn--sm { min-height: var(--control-sm); padding: 0 var(--s-4); font-size: var(--fs-body-sm); border-radius: var(--r-pill); }  /* капсула в списках */
.ds-btn--dense { min-height: var(--control-dense); padding: 0 var(--s-3); font-size: var(--fs-body-sm); border-radius: var(--r-sm); }
.ds-btn--block { width: 100%; }
.ds-btn[disabled] { opacity: .4; pointer-events: none; }
.ds-icon-btn { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: var(--r-pill); background: var(--surface-float); color: var(--text); box-shadow: var(--shadow-2); }
.ds-icon-btn.on { color: var(--danger); } .ds-icon-btn.on .ds-icon { fill: currentColor; }  /* включено (сердечко «в избранном») */
.ds-icon-btn--flat { width: var(--control-dense); height: var(--control-dense); background: var(--surface-2); box-shadow: none; color: var(--text-2); }
.ds-fab { position: absolute; right: var(--s-4); bottom: var(--s-6); width: 56px; height: 56px; border-radius: var(--r-pill); display: grid; place-items: center; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-2); }

/* ---------- поля ---------- */
.ds-field { display: grid; gap: var(--s-2); }
.ds-field__head { display: flex; justify-content: space-between; font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: var(--fw-semibold); color: var(--text-2); }
.ds-field__head em { font-style: normal; font-weight: var(--fw-regular); color: var(--text-3); }
.ds-input, .ds-textarea { width: 100%; min-height: var(--control); padding: var(--s-3) var(--s-4); border: 1px solid transparent; border-radius: var(--r-md); background: var(--surface-2); font-size: 16px; line-height: 22px; color: var(--text); }
.ds-input::placeholder, .ds-textarea::placeholder { color: var(--text-3); }
.ds-input:focus, .ds-textarea:focus { outline: 0; border-color: var(--accent); background: var(--surface); }
.ds-textarea { min-height: 96px; resize: none; }
.ds-input--dense { min-height: var(--control-dense); padding: 0 var(--s-3); font-size: var(--fs-body-sm); border-radius: var(--r-sm); }
.ds-input--search { padding-left: 40px; }
.ds-search { position: relative; }
.ds-search .ds-icon { position: absolute; left: var(--s-3); top: 50%; transform: translateY(-50%); color: var(--text-3); }
.ds-error { color: var(--danger); font-size: var(--fs-caption); line-height: var(--lh-caption); }

/* строка-настройка: подпись слева, значение справа, шеврон или крестик */
.ds-rows { background: var(--surface-2); border-radius: var(--r-md); overflow: hidden; }
.ds-row { display: flex; align-items: center; gap: var(--s-3); min-height: 50px; padding: 0 var(--s-4); width: 100%; text-align: left; }
.ds-row + .ds-row { border-top: 1px solid var(--border); }
.ds-row--flush { padding: 0; }  /* строка вне группы (в листе, на странице): по ширине контента */
.ds-row__icon { color: var(--text-2); }
.ds-row__label { flex: 1; }
.ds-row__value { color: var(--text-3); max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-row__value--set { color: var(--text); }
.ds-row__chev { color: var(--text-3); }

/* сегменты */
.ds-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 2px; border-radius: var(--r-sm); background: var(--surface-2); }
.ds-seg button { min-height: 32px; border-radius: calc(var(--r-sm) - 2px); font-size: var(--fs-body-sm); font-weight: var(--fw-medium); color: var(--text); }
.ds-seg button[aria-checked="true"], .ds-seg button.on { background: var(--surface); font-weight: var(--fw-semibold); box-shadow: var(--shadow-1), 0 1px 3px rgb(0 0 0 / .08); }

/* плитки типа события: выбранная с рамкой акцента */
.ds-kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-2); }
.ds-kind { display: grid; justify-items: center; gap: var(--s-1); padding: var(--s-3) var(--s-1); border-radius: var(--r-md); background: var(--surface-2); border: 2px solid transparent; font-size: var(--fs-caption); font-weight: var(--fw-medium); color: var(--text-2); }
.ds-kind__emoji { font-size: 24px; line-height: 28px; }
.ds-kind[aria-checked="true"] { border-color: var(--accent); background: var(--surface); color: var(--text); }

/* ---------- статусы, пометки, чипы ---------- */
/* бейдж: просто текст с необязательной точкой, без заливки */
.ds-badge { display: inline-flex; align-items: center; gap: var(--s-1); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: var(--fw-semibold); color: var(--text-2); white-space: nowrap; }
.ds-badge--accent { color: var(--accent-text); }
.ds-badge--success { color: var(--success); }
.ds-badge--danger { color: var(--danger); }
.ds-badge--warning { color: var(--warning); }
.ds-dot { width: 7px; height: 7px; border-radius: var(--r-pill); background: currentColor; flex: none; }
/* пометка: маленькая нейтральная капсула («Моё», «автор», «вы») */
.ds-tag { display: inline-flex; align-items: center; min-height: 20px; padding: 0 var(--s-2); border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); font-size: 12px; line-height: 16px; font-weight: var(--fw-semibold); white-space: nowrap; }
.ds-chip { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--control-sm); padding: 0 var(--s-3); border-radius: var(--r-pill); background: var(--surface-2); color: var(--text); font-size: var(--fs-body-sm); font-weight: var(--fw-medium); white-space: nowrap; }
.ds-chip--on { background: var(--text); color: var(--bg); }
.ds-chip[disabled] { opacity: .4; pointer-events: none; }
.ds-pulse { width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--success); animation: ds-pulse 1.6s var(--ease) infinite; }
@keyframes ds-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }
@media (prefers-reduced-motion: reduce) { .ds-pulse { animation: none; } }

/* ---------- аватарки (один цвет) ---------- */
.ds-avatar { overflow: hidden; width: 40px; height: 40px; border-radius: var(--r-pill); display: grid; place-items: center; font-size: 15px; font-weight: var(--fw-semibold); flex: none; background: var(--avatar-bg); color: var(--avatar-fg); }
.ds-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }  /* фото человека заполняет круг */
.ds-avatar--sm { width: 28px; height: 28px; font-size: 12px; }
.ds-avatar--lg { width: 48px; height: 48px; font-size: 18px; }
.ds-avstack { display: flex; }
.ds-avstack .ds-avatar { border: 2px solid var(--surface); margin-left: -8px; }
.ds-avstack .ds-avatar:first-child { margin-left: 0; }

/* значок типа события: нейтральная подложка и эмодзи */
.ds-kindicon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 22px; flex: none; background: var(--surface-2); }
.ds-kindicon--sm { width: 34px; height: 34px; font-size: 18px; border-radius: var(--r-sm); }

/* ---------- плавающие элементы над картой ---------- */
.ds-tabs { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-float); box-shadow: var(--shadow-2); }
.ds-tabs button { flex: 1; min-height: 38px; border-radius: var(--r-pill); font-size: var(--fs-body-sm); font-weight: var(--fw-medium); color: var(--text-2); }
.ds-tabs button.on { background: var(--surface-2); color: var(--text); font-weight: var(--fw-semibold); }
.ds-float { background: var(--surface-float); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }


/* ---------- карточка события: плоская, без обводки ---------- */
.ds-card { display: block; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.ds-card--admin { box-shadow: 0 0 0 2px var(--gold), var(--shadow-1); }  /* событие администратора: золотая рамка */
/* строка события внутри карточки (ds-card): время слева (если есть), название с эмодзи типа и одна строка деталей, справа кнопка */
.ds-evrow__row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3); min-height: 56px; }
.ds-evrow__time { width: 44px; flex: none; font-size: var(--fs-body-sm); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.ds-evrow__main { flex: 1; min-width: 0; }
.ds-evrow__title { font-size: 15px; line-height: 20px; font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-evrow__meta { font-size: 12px; line-height: 16px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-card__row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); }
.ds-card__main { flex: 1; min-width: 0; }
.ds-card__title { font-size: var(--fs-headline); line-height: var(--lh-headline); font-weight: var(--fw-semibold); display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.ds-card__title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-card__meta { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-card__more { padding: var(--s-4); display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; gap: var(--s-4); border-top: 1px solid var(--border); }
.ds-facts { display: grid; }
.ds-fact { display: flex; align-items: center; gap: var(--s-3); min-height: 44px; }
.ds-fact + .ds-fact { border-top: 1px solid var(--border); }
.ds-fact .ds-icon { color: var(--text-3); }
.ds-fact--link { color: var(--accent-text); }
/* «Ищу» в барахолке: запрос карточкой без крупного фото; переключатель «Продам / Ищу» под заголовком */
.ds-seg--lg button { min-height: 38px; font-size: var(--fs-body); }
.ds-requests { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
.ds-request { display: grid; gap: var(--s-2); padding: var(--s-4); cursor: pointer; }
.ds-request__title { font-size: var(--fs-headline); line-height: var(--lh-headline); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.ds-request__text { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ds-request__thumbs { display: flex; gap: var(--s-2); }
.ds-request__thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--r-sm); background: var(--surface-2); display: block; }
.ds-request__meta { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.ds-request__who { flex: 1; min-width: 0; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-request__budget { margin-left: auto; flex: none; font-size: var(--fs-body-sm); font-weight: var(--fw-semibold); }
.ds-request__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.ds-request__resp { font-size: var(--fs-caption); font-weight: var(--fw-semibold); color: var(--accent-text); }
.ds-descbox { display: grid; gap: var(--s-2); padding: var(--s-4); border-radius: var(--r-md); background: var(--surface-2); }  /* описание на странице объявления */
.ds-quote { margin: 0; padding-left: var(--s-3); border-left: 2px solid var(--border-strong); color: var(--text-2); }
.ds-section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }

/* ---------- шторка, диалог, всплывающая карточка ---------- */
.ds-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: var(--z-sheet); background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-3); padding: var(--s-2) var(--s-5) var(--s-6); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
.ds-grab { width: 36px; height: 5px; border-radius: var(--r-pill); background: var(--surface-3); margin: var(--s-1) auto 0; }
.ds-scrim { position: absolute; inset: 0; background: var(--scrim); z-index: var(--z-overlay); display: flex; align-items: flex-end; }
.ds-modal { width: 100%; max-height: 86%; display: flex; flex-direction: column; gap: var(--s-4); background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-4); padding: var(--s-5) var(--s-5) var(--s-6); overflow: hidden; }
.ds-modal__head { display: flex; align-items: center; justify-content: space-between; min-height: var(--control-sm); }
.ds-modal__body { overflow-y: auto; display: grid; grid-auto-rows: max-content; gap: var(--s-4); min-height: 0; }  /* max-content: иначе блоки с overflow:hidden сжимаются, а не прокручиваются */
.ds-toast { position: absolute; left: 50%; transform: translateX(-50%); z-index: var(--z-toast); background: var(--text); color: var(--bg); padding: var(--s-3) var(--s-4); border-radius: var(--r-pill); font-size: var(--fs-body-sm); font-weight: var(--fw-medium); box-shadow: var(--shadow-2); white-space: nowrap; }
.ds-list { display: grid; grid-template-columns: minmax(0, 1fr); }
.ds-list__item { display: flex; align-items: center; gap: var(--s-3); min-height: 56px; padding: var(--s-2) 0; width: 100%; text-align: left; }
.ds-list__item + .ds-list__item { border-top: 1px solid var(--border); }
.ds-list__main { flex: 1; min-width: 0; }
.ds-list__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-list__sub { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- пустое состояние ---------- */
.ds-empty { display: grid; justify-items: center; gap: var(--s-2); text-align: center; padding: var(--s-10) var(--s-6); }
.ds-empty__icon { width: 64px; height: 64px; border-radius: var(--r-pill); display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); margin-bottom: var(--s-2); }
.ds-empty__icon .ds-icon { width: 28px; height: 28px; }
.ds-empty p { margin: 0; color: var(--text-2); max-width: 28ch; }

/* ---------- навигация и страницы ---------- */
/* нижняя панель вкладок: основной способ переключать разделы, под большим пальцем */
.ds-tabbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: calc(var(--z-sheet) + 1); height: 84px; padding: var(--s-2) var(--s-2) 0; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface-float); border-top: 1px solid var(--border); }
.ds-tabbar a, .ds-tabbar button { display: grid; justify-items: center; align-content: start; gap: 2px; padding-top: var(--s-1); color: var(--text-3); font-size: var(--fs-micro); line-height: var(--lh-micro); font-weight: var(--fw-medium); text-decoration: none; }
.ds-tabbar a .ds-icon, .ds-tabbar button .ds-icon { width: 26px; height: 26px; }
.ds-tabbar a.on, .ds-tabbar button.on { color: var(--accent-text); font-weight: var(--fw-semibold); }
.ds-largetitle { font-size: 32px; line-height: 38px; font-weight: var(--fw-bold); letter-spacing: -.02em; margin: 0; }
.ds-pagehead { position: sticky; top: calc(-1 * (var(--top-inset, 0px) + 12px)); z-index: 5; display: grid; gap: var(--s-4); background: var(--bg); margin: calc(-1 * (var(--top-inset, 0px) + 12px)) calc(-1 * var(--s-4)) 0; padding: calc(var(--top-inset, 0px) + 12px) var(--s-4) var(--s-2); }  /* top отрицательный: липнет к краю с учётом верхнего отступа прокручиваемого раздела; шапка раздела стоит на месте, прокручивается только список под ней */
.ds-pagebar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.ds-chips { display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--s-4) * -1); padding: 0 var(--s-4); }
.ds-daylabel { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: var(--fw-semibold); color: var(--text-2); margin: var(--s-2) var(--s-1) calc(var(--s-1) * -1); }
.ds-switch { width: 51px; height: 31px; border-radius: var(--r-pill); background: var(--surface-3); position: relative; flex: none; }
.ds-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: var(--r-pill); background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform var(--dur) var(--ease); }
.ds-switch.on { background: var(--accent); }
.ds-switch.on::after { transform: translateX(20px); }
.ds-group { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.ds-group .ds-row { background: none; }
.ds-grouplabel { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: var(--fw-semibold); color: var(--text-2); margin: var(--s-2) var(--s-4) calc(var(--s-1) * -1); }
.ds-actionbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: var(--z-sheet); padding: var(--s-3) var(--s-4) var(--s-8); display: flex; gap: var(--s-2); background: var(--surface-float); border-top: 1px solid var(--border); }

/* барахолка */
.ds-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4) var(--s-3); align-items: start; }
.ds-listing { display: grid; gap: 2px; min-width: 0; }
.ds-listing__photo { margin-bottom: var(--s-1); }
.ds-listing__photo { position: relative; aspect-ratio: 1 / 1.02; border-radius: var(--r-lg); overflow: hidden; }
.ds-ph { width: 100%; height: 100%; display: grid; place-items: center; background: var(--surface-2); font-size: 54px; }  /* заглушка фото: в продукте настоящая картинка */
.ds-heart { position: absolute; top: var(--s-2); right: var(--s-2); width: 32px; height: 32px; border-radius: var(--r-pill); display: grid; place-items: center; background: var(--surface-float); color: var(--text); }
.ds-heart.on { color: var(--danger); } .ds-heart.on .ds-icon { fill: currentColor; }
.ds-price { font-size: var(--fs-headline); line-height: var(--lh-headline); font-weight: var(--fw-bold); }
.ds-listing__price { font-size: var(--fs-body-sm); line-height: 18px; font-weight: var(--fw-medium); }  /* в сетке главное название, цена вторая */
.ds-listing__meta { font-size: 12px; line-height: 16px; color: var(--text-3); margin-top: -1px; }  /* район · время: одна тихая строка */
.ds-price--free { color: var(--success); }
.ds-listing__title { font-size: 16px; line-height: 21px; font-weight: var(--fw-semibold); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ds-gallery { position: relative; }
.ds-gallery .ds-ph { aspect-ratio: 1 / 1; height: auto; font-size: 110px; }
.ds-dots { position: absolute; left: 0; right: 0; bottom: var(--s-3); display: flex; justify-content: center; gap: 6px; }
.ds-dots i { width: 6px; height: 6px; border-radius: var(--r-pill); background: rgb(0 0 0 / .25); }
.ds-dots i.on { background: var(--text); }
.ds-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.ds-photos .ds-ph { aspect-ratio: 1; height: auto; border-radius: var(--r-md); font-size: 34px; }
.ds-photo-add { aspect-ratio: 1; border-radius: var(--r-md); border: 1.5px dashed var(--border-strong); display: grid; place-content: center; justify-items: center; gap: var(--s-1); color: var(--text-2); font-size: var(--fs-caption); }
.ds-seller { display: flex; align-items: center; gap: var(--s-3); }
.ds-thumb { width: 64px; height: 64px; border-radius: var(--r-md); overflow: hidden; flex: none; }
.ds-thumb .ds-ph { font-size: 30px; }
.ds-radio { width: 22px; height: 22px; border-radius: var(--r-pill); border: 2px solid var(--border-strong); flex: none; }
.ds-radio.on { border: 7px solid var(--accent); }

/* экран поверх приложения (страница объявления, «Мои объявления»): своя шапка и прокручиваемое содержимое */
.ds-screen { position: fixed; inset: 0; z-index: 1300; display: flex; flex-direction: column; background: var(--bg); }
.ds-screen__bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: calc(var(--top-inset, 0px) + var(--s-2)) var(--s-4) var(--s-2); }
.ds-screen__body { flex: 1; overflow-y: auto; padding: var(--s-2) var(--s-4) var(--s-8); display: grid; grid-auto-rows: max-content; align-content: start; gap: var(--s-4); }
.ds-listing__photo img, .ds-thumb img, .ds-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ds-photos .ds-photo { position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.ds-photo__x { position: absolute; top: var(--s-1); right: var(--s-1); width: 26px; height: 26px; border-radius: var(--r-pill); display: grid; place-items: center; background: var(--surface-float); color: var(--text); }
.ds-photo__tag { position: absolute; left: var(--s-1); bottom: var(--s-1); padding: 0 var(--s-2); border-radius: var(--r-pill); background: var(--surface-float); font-size: 11px; line-height: 18px; font-weight: var(--fw-semibold); }
.ds-photo--busy::after { content: ""; position: absolute; inset: 0; background: var(--surface-float); opacity: .7; }
.ds-gallery__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ds-gallery__track > * { flex: 0 0 100%; min-width: 0; width: 100%; scroll-snap-align: center; aspect-ratio: 1; object-fit: cover; display: block; background: var(--surface-2); }
.ds-skeleton { background: var(--surface-2); border-radius: var(--r-lg); animation: ds-skeleton 1.2s var(--ease) infinite; }
@keyframes ds-skeleton { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .ds-skeleton { animation: none; } }

/* Чат (магазин): пузыри сообщений, поле ввода, точка «есть непрочитанное». Свои сообщения чёрные (инверсия), чужие серые: цветная кнопка остаётся одна, «Отправить». */
.ds-chat { display: grid; gap: var(--s-2); align-content: start; }
.ds-bubble { justify-self: start; max-width: 82%; padding: var(--s-2) var(--s-3); border-radius: var(--r-lg); background: var(--surface-2); color: var(--text); font-size: 16px; line-height: 21px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ds-bubble--mine { justify-self: end; background: var(--text); color: var(--bg); }
.ds-bubble__time { display: block; margin-top: 2px; font-size: 11px; line-height: 14px; opacity: .65; }
.ds-composer { flex: none; display: flex; align-items: flex-end; gap: var(--s-2); padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom, 0px)); background: var(--surface-float); border-top: 1px solid var(--border); }
.ds-composer .ds-textarea { flex: 1; min-height: var(--control); max-height: 120px; padding-top: 13px; padding-bottom: 13px; }
.ds-bubble__tick { letter-spacing: -1px; }
.ds-bubble__tick.is-read { opacity: 1; font-weight: var(--fw-bold); }
.ds-bubble__photo { display: block; width: min(240px, 100%); max-height: 240px; margin: 0 0 var(--s-1); border-radius: var(--r-md); object-fit: cover; background: var(--surface-3); cursor: zoom-in; }
.ds-composer { flex-wrap: wrap; }
.ds-composer__preview { flex: 0 0 100%; }
.ds-composer__thumb { position: relative; width: 64px; height: 64px; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.ds-composer__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ds-dot { flex: none; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--text); }

/* Просмотр фото на весь экран: карусель со свайпом, счётчик, закрыть. Фон без размытия, появление только прозрачностью. */
.ds-viewer { position: fixed; inset: 0; z-index: 1400; /* выше экранов поверх приложения (ds-screen, 1300) */ background: #000; display: flex; flex-direction: column; animation: ds-fade var(--dur) var(--ease); }
.ds-viewer__track { flex: 1; min-height: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.ds-viewer__track::-webkit-scrollbar { display: none; }
.ds-viewer__slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; }
.ds-viewer__slide img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.ds-viewer__close { position: absolute; top: calc(var(--top-inset, 0px) + 8px); right: 12px; }
.ds-viewer__count { position: absolute; top: calc(var(--top-inset, 0px) + 8px); left: 50%; transform: translateX(-50%); height: 44px; display: flex; align-items: center; color: #fff; font-size: 15px; font-variant-numeric: tabular-nums; pointer-events: none; }
@keyframes ds-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- корзина и избранное (магазин Vova Market) ---------- */
.ds-icon-btn--card { position: absolute; top: var(--s-2); right: var(--s-2); width: 36px; height: 36px; }   /* сердечко на фото карточки */
.ds-cartbar { position: fixed; left: var(--s-4); right: var(--s-4); bottom: calc(var(--s-4) + env(safe-area-inset-bottom, 0px)); z-index: 60; max-width: 608px; margin: 0 auto; min-height: var(--control); padding: 0 var(--s-5); display: flex; align-items: center; gap: var(--s-3); border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-3); font-size: 16px; font-weight: var(--fw-semibold); animation: ds-rise var(--dur) var(--ease); }
.ds-cartbar[hidden] { display: none; }
.ds-cartbar__label { flex: 1; text-align: left; }
.ds-cartbar__count { min-width: 24px; height: 24px; padding: 0 var(--s-2); border-radius: var(--r-pill); background: var(--on-accent); color: var(--accent-text); display: grid; place-items: center; font-size: 13px; }
@keyframes ds-rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.ds-stepper { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: var(--r-pill); }
.ds-stepper button { width: 36px; height: 36px; display: grid; place-items: center; color: var(--text); }
.ds-stepper button:disabled { color: var(--text-3); }
.ds-stepper b { min-width: 24px; text-align: center; font-size: 16px; font-weight: var(--fw-semibold); }
.ds-cartline { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); }
.ds-cartline + .ds-cartline { border-top: 1px solid var(--border); }
.ds-cartline__text { flex: 1; min-width: 0; display: grid; gap: 2px; text-align: left; }
.ds-cartline__text b { font-size: 16px; line-height: 21px; font-weight: var(--fw-semibold); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.ds-cartline__side { display: grid; justify-items: end; gap: var(--s-2); flex: none; }
.ds-total { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); padding: var(--s-4); font-size: 16px; }
.ds-total b { font-size: var(--fs-title, 20px); font-weight: var(--fw-semibold); }
