/* Łowca PWA — раскладка «как OLX» (Ваня 22.10: лента с крупными фото и ценой, 5 вкладок Главная · Находки · Сообщения ·
   Мои · Ещё, сделка — как объявление), вид — как NaZdrow (Ваня 26.10: «выглядит сыро», образец — приложение NaZdrow):
   одна тёмная тёплая тема в духе chess.com (холст #312e2b, непрозрачные карточки #3c3936), трава #81b64c — только
   действие, объёмная главная кнопка с нижним бортом, плавающая панель вкладок. Шрифты свои (static/fonts, OFL):
   Onest — текст, Geologica — заголовки и цены, JetBrains Mono — номера наборов; без внешних CDN (CSP). Кнопки ≥ 44 px,
   отступы safe-area для iPhone. */

@font-face {
  font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/onest-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: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/onest-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("/fonts/jbmono-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: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("/fonts/jbmono-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Geologica"; font-style: normal; font-weight: 600 800; font-display: swap;
  src: url("/fonts/geologica-bold.woff2") format("woff2");
}

/* токены — зеркало NaZdrow tokens.dart (V6 «Trawa»): одна тёмная тема, светлой больше нет */
:root {
  color-scheme: dark;
  --bg: #312e2b;          /* холст */
  --surface: #3c3936;     /* карточки — непрозрачные, «хрусткие» */
  --surface-2: #26231f;   /* поля, чипы, плашки внутри карточек, листы */
  --photo: #2a2723;       /* место под фото */
  --line: rgba(255, 255, 255, .11);
  --text: #f4f6f9;
  --text-2: rgba(235, 240, 246, .80);
  --muted: rgba(235, 240, 246, .56);
  --ink: #26231f;         /* тёмные плашки и кнопки */
  --ink-2: #3c3936;
  --on-ink: #f4f6f9;
  --on-ink-muted: rgba(235, 240, 246, .62);
  --accent: #81b64c;      /* трава: главная кнопка, активная вкладка — только действие */
  --accent-dark: #567f35; /* нижний борт объёмной кнопки */
  --accent-ink: #ffffff;
  --accent-text: #a3d160; /* ссылки и акцент текстом */
  --ok: #93c55c;  --ok-bg: rgba(147, 197, 92, .18);
  --bad: #f2837d; --bad-bg: rgba(224, 64, 58, .20);
  --warn: #f7c631; --warn-bg: rgba(247, 198, 49, .16);
  --info: #8cbcea; --info-bg: rgba(108, 169, 224, .20);
  --need-bg: #423d33;     /* строка «нужен ты» в списках */
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --radius: 18px;
  --tabs-h: 78px;         /* плавающая панель 62 px + зазор снизу (вкладки вернулись 27.11) */
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Geologica", var(--font);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 var(--font); min-height: 100vh; overflow-x: hidden; -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent-text); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1, h2 { font-family: var(--display); }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
pre, code { font-family: var(--mono); font-size: 12.5px; }
pre {
  margin: 8px 0 0; padding: 10px; border-radius: 10px; background: var(--surface-2);
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 60vh; overflow: auto;
}
[hidden] { display: none !important; }
svg.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; stroke-width: 2.1; }
.mono { font-family: var(--mono); font-weight: 500; }
.num { font-family: var(--mono); color: var(--muted); font-weight: 500; }

/* --- шапка (на холсте, как OLX: без отдельной полосы) --- */
#top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px; min-height: 56px;
  padding: calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-right) + 12px) 8px calc(env(safe-area-inset-left) + 12px);
  background: var(--bg); color: var(--on-ink);
}
#top h1 { flex: 1; font-size: 20px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#top h1.brand { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--accent-text); }
#back {
  min-width: 44px; min-height: 44px; margin-left: -8px; border: 0; border-radius: 22px; background: none; color: var(--on-ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
#link {
  display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 10px; border-radius: 16px;
  font-size: 13px; color: var(--text); background: var(--bad-bg); white-space: nowrap; max-width: 60%;
  overflow: hidden; text-overflow: ellipsis; flex: none;
}
#top h1:not(.brand) + #link { max-width: 42%; }
#link::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--on-ink-muted); }
#link.on::before { background: #5bd6a0; }
#link.off::before { background: #ff8a73; }
#link.warn::before { background: #f2c14e; }
#link.bad::before { background: #ff8a73; }
a#link { cursor: pointer; }

/* продолжение шапки на экране: поиск, чипы, цифры */
.hero {
  background: var(--bg); color: var(--on-ink);
  margin: 0 calc(-1 * (env(safe-area-inset-right) + 16px)) 0 calc(-1 * (env(safe-area-inset-left) + 16px));
  padding: 2px calc(env(safe-area-inset-right) + 16px) 14px calc(env(safe-area-inset-left) + 16px);
  display: flex; flex-direction: column; gap: 12px;
}
.hero .muted { color: var(--on-ink-muted); }
.search {
  display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.search input { flex: 1; min-width: 0; min-height: 44px; border: 0; padding: 0; background: transparent; color: var(--text); font-size: 16px; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hero-stats div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hero-stats span { font-size: 12px; color: var(--on-ink-muted); }
.hero-stats b { font-size: 18px; font-weight: 800; color: #ffffff; white-space: nowrap; }
.hero-stats b.ok { color: var(--accent-text); }
.under-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: -14px; }
.under-tabs::-webkit-scrollbar { display: none; }
.under-tabs button, .under-tabs a {
  flex: none; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--on-ink-muted);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.under-tabs .on { color: #ffffff; font-weight: 700; box-shadow: inset 0 -3px 0 var(--accent); }

/* --- контент --- */
#view {
  max-width: 760px; margin: 0 auto;
  padding: 0 calc(env(safe-area-inset-right) + 16px) calc(var(--tabs-h) + env(safe-area-inset-bottom) + 24px) calc(env(safe-area-inset-left) + 16px);
}
body.unpaired #view { padding-bottom: 32px; }
body.has-bar #view { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 96px); }
.stack { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; }
.stack .stack { padding-top: 0; }
.stack.flush { padding-top: 0; gap: 8px; }
.sec { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sec-head a { font-size: 14px; font-weight: 600; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
a.card { color: inherit; }
.card.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-head h3 { flex: 1; min-width: 0; }
.card h3 a { color: inherit; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.html { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); font-size: 14px; }
.html a { word-break: break-all; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.error-box { border-color: var(--bad); background: var(--bad-bg); }
.spinner { display: flex; justify-content: center; padding: 40px; color: var(--muted); }
.spinner::before {
  content: ""; width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.nowrap { white-space: nowrap; }
.oneline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.grow { flex: 1; min-width: 0; }
.status:empty { display: none; }

/* --- чипы, метки, точки --- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips-row::-webkit-scrollbar { display: none; }
.pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 19px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
}
.pill b { font-weight: 700; }
.pill.on { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 700; }
.pill.hot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.hero .pill { border-color: var(--line); background: var(--surface); color: var(--on-ink); }
.hero .pill.hot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 8px;
  font-size: 13px; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.info { background: var(--info-bg); color: var(--info); }
.tag { font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--accent-text); }
.tag.bad { color: var(--bad); }
.tag.ok { color: var(--ok); }
.tag.info { color: var(--info); }
.badge-box { align-self: flex-start; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; letter-spacing: .02em; }
.badge-box.ok { background: var(--ok-bg); color: var(--ok); }
.badge-box.warn { background: var(--warn-bg); color: var(--warn); }
.badge-box.bad { background: var(--bad-bg); color: var(--bad); }
.badge-box.quiet { background: var(--surface-2); color: var(--text-2); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.dot.warn { background: #e0a21f; }

/* --- деньги --- */
.price { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1.15; }
.price.big { font-size: 28px; letter-spacing: -.02em; }
.price.sm { font-size: 18px; }
.old { color: var(--muted); text-decoration: line-through; font-size: 15px; white-space: nowrap; }
.gain { font-weight: 700; white-space: nowrap; color: var(--ok); }
.gain.bad { color: var(--bad); }
.amt { font-size: 21px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* --- фото-заглушка и миниатюры --- */
.ph {
  position: relative; background: var(--photo); color: var(--muted); display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex: none; font-size: 12px;
}
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .corner { position: absolute; font-size: 11.5px; font-weight: 700; padding: 3px 7px; border-radius: 7px; }
.ph .tl { top: 8px; left: 8px; }
.ph .bl { bottom: 8px; left: 8px; }
.ph .br { bottom: 8px; right: 8px; }
.on-photo { background: rgba(20, 18, 16, .78); color: #ffffff; font-weight: 600; }
.on-photo.gain { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* --- «Нужен ты» лентой --- */
.need-strip {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 calc(-1 * (env(safe-area-inset-right) + 16px)) 0 calc(-1 * (env(safe-area-inset-left) + 16px));
  padding: 2px calc(env(safe-area-inset-right) + 16px) 4px calc(env(safe-area-inset-left) + 16px);
}
.need-strip::-webkit-scrollbar { display: none; }
.need-strip > .card { flex: none; width: min(86%, 340px); scroll-snap-align: start; }
.need-strip > .card:only-child { width: 100%; }
.need-top { display: flex; gap: 10px; align-items: flex-start; }
.need-top .ph { width: 56px; height: 56px; border-radius: 10px; }
.need-top .grow { display: flex; flex-direction: column; gap: 2px; }
.need-top h3 a { color: var(--text); }
.card.need .html { font-size: 13.5px; color: var(--text-2); }
/* главная кнопка — во всю ширину отдельной строкой (длинные подписи вроде «Покупатель получил» вылезали), под ней
   «Исходное» и «⋯» */
.card.need .btns { flex-wrap: wrap; }
.card.need .btns .grow1 { flex: 1 1 100%; min-width: 0; }
.card.need .btns > .btn:not(.grow1):not(.icon) { flex: 1; }
.card.need { justify-content: space-between; }

/* --- сетка находок (главная) --- */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text);
  display: flex; flex-direction: column;
}
.tile .ph { aspect-ratio: 1 / 1; width: 100%; }
.tile-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.tile-body .name { font-size: 15px; line-height: 1.3; min-height: 39px; }
.tile-body .price { margin-top: 4px; }

/* --- карточка-строка (как выдача OLX) --- */
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.item.need { background: var(--need-bg); }
.item-main { display: flex; gap: 12px; padding: 10px; color: var(--text); min-width: 0; }
.item-main .ph { width: 112px; height: 112px; border-radius: 10px; }
.item-main .ph.md { width: 92px; height: 92px; }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item-body .name { font-size: 14px; line-height: 1.3; }
.item-body .where { margin-top: auto; font-size: 12px; color: var(--muted); }
.item-foot { display: flex; align-items: center; gap: 8px; padding: 0 10px 10px; }
.item-foot .note { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.35; color: var(--text-2); }
.item-foot .note.bad { color: var(--bad); }
.item-stats { display: flex; align-items: center; gap: 12px; margin: 0 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.item-stats span { display: inline-flex; align-items: center; gap: 4px; }
.item .btns { padding: 0 10px 10px; }

/* строка-ссылка «Исходное объявление» и подобные */
.link-row {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 10px;
  background: var(--surface-2); color: var(--text); font-size: 14px;
}
.link-row b { font-weight: 600; }
.link-row .side { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item > .link-row { margin: 0 10px 10px; }
.link-row.outline { background: transparent; border: 1px solid var(--line); border-radius: 12px; }

/* --- сделка и исходное объявление --- */
.full-bleed { margin: 0 calc(-1 * (env(safe-area-inset-right) + 16px)) 0 calc(-1 * (env(safe-area-inset-left) + 16px)); }
.gallery {
  position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--photo);
  height: 300px;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 100%; height: 300px; object-fit: cover; scroll-snap-align: start; scroll-snap-stop: always; cursor: zoom-in; display: block; }
.gallery .empty-ph { flex: none; width: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.gallery-wrap { position: relative; }
.gallery-wrap .corner { position: absolute; z-index: 1; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 8px; }
.gallery-wrap .tl { top: 12px; left: 16px; }
.gallery-wrap .br { bottom: 12px; right: 16px; }
.thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.thumbs img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; background: var(--photo); cursor: pointer; }
.panel { background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.panel h2 { font-size: 17px; }
.panels { display: flex; flex-direction: column; gap: 8px; }
.panels.full-bleed .panel { padding-left: calc(env(safe-area-inset-left) + 16px); padding-right: calc(env(safe-area-inset-right) + 16px); }
.ad-title { font-size: 20px; line-height: 1.3; font-weight: 600; }
.sum-rows { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.sum-rows > div { display: flex; justify-content: space-between; gap: 12px; }
.sum-rows > div > span:first-child { color: var(--text-2); }
.sum-rows > .total { padding-top: 8px; border-top: 1px solid var(--line); font-size: 17px; font-weight: 600; }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.35; }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.quiet { background: var(--surface-2); color: var(--text-2); }
.changes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.4; }
.changes li { display: flex; gap: 10px; }
.changes .when { width: 48px; flex: none; font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 2px; }
.seller { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 48px; height: 48px; flex: none; border-radius: 24px; background: var(--photo); color: var(--text-2);
  display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700;
}
.avatar.sm { width: 40px; height: 40px; font-size: 16px; }
.avatar.buyer { background: var(--info-bg); color: var(--info); }

/* нижняя панель действий (сделка, исходное) — над вкладками */
.actionbar {
  /* до самого низа: под плавающей панелью вкладок не просвечивает лента */
  position: fixed; left: 0; right: 0; z-index: 19; bottom: 0;
  display: flex; gap: 8px;
  padding: 10px calc(env(safe-area-inset-right) + 16px) calc(var(--tabs-h) + env(safe-area-inset-bottom) + 6px) calc(env(safe-area-inset-left) + 16px);
  background: var(--bg); border-top: 1px solid var(--line);
}
.actionbar .btn { min-height: 50px; font-size: 16px; }
.actionbar .btn.primary { flex: 1; }
.actionbar .composer-bar { flex: 1; }
.actionbar .composer-bar .btn { min-height: 46px; }
.stack > .hero:first-child { margin-top: -14px; }

/* --- сообщения --- */
.chat-list { display: flex; flex-direction: column; background: var(--surface); }
/* список разговоров (27.11, Ваня: «очень неудобно читать… не отмечается, что прочитано… не в понятном порядке»):
   два раздела с заголовками («Ждут тебя» и «Остальные»), внутри — свежие сверху; непрочитанное — жирным с точкой,
   прочитанное — приглушено; в строке: имя и кто это, товар, последнее сообщение в две строки, что с разговором */
.chat-sec { padding: 14px 16px 6px; font-size: 13px; font-weight: 700; color: var(--text-2); display: flex; justify-content: space-between; }
.chat-sec.need { color: var(--accent-text); }
.chat-row { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text); min-width: 0; }
.chat-row .dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: transparent; }
.chat-row.unread .dot { background: var(--accent); }
.chat-row .grow { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.chat-row .top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-row .who { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row .at { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.chat-row .about { font-size: 12.5px; color: var(--muted); }
.chat-row .last { font-size: 15px; line-height: 1.35; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.chat-row.unread .who { font-weight: 800; }
.chat-row.unread .last { color: var(--text); font-weight: 600; }
.chat-row.unread .at { color: var(--accent-text); font-weight: 700; }
.chat-row .last .tick { font-style: normal; font-size: 12px; color: var(--muted); letter-spacing: -2px; margin-right: 6px; }
.chat-row .state { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.chat-row .state.warn { color: var(--accent-text); }
.chat-row .state.bad { color: var(--bad); }
.chat-row .state.ok { color: var(--ok); }
.chat-row .last .tick.seen { color: var(--ok, #81b64c); }
.role { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.role.buyer { background: var(--info-bg); color: var(--info); }
.unread-n {
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.chat-head { background: var(--surface); display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head .person { display: flex; align-items: center; gap: 10px; }
.item-strip { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: var(--surface-2); color: var(--text); }
.item-strip .ph { width: 44px; height: 44px; border-radius: 8px; }
.thread { display: flex; flex-direction: column; gap: 8px; padding: 16px 0; }
.msg { display: flex; flex-direction: column; gap: 3px; max-width: 84%; }
.msg .b { padding: 10px 12px; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.them { align-self: flex-start; }
.msg.them .b { background: var(--surface); border-radius: 16px 16px 16px 4px; }
.msg.me { align-self: flex-end; }
.msg.me .b { background: rgba(129, 182, 76, .18); border: 1px solid rgba(129, 182, 76, .35); color: var(--text); border-radius: 16px 16px 4px 16px; }
.msg.me .m { text-align: right; }
.msg .m { font-size: 11.5px; color: var(--muted); }
/* 13.11: прочитано собеседником, предложение цены кнопкой площадки, кнопка «Торг» */
.msg .m.seen { color: var(--ok, #81b64c); }
.msg.offer .b { border: 1px dashed var(--warn, #d9a441); font-weight: 600; }
.msg .offer-tag { font-size: 11px; color: var(--warn, #d9a441); text-transform: uppercase; letter-spacing: .04em; }
.msg.me .offer-tag { text-align: right; }
.composer-bar .btn.haggle { flex: none; padding: 0 14px; font-weight: 600; }
.day-sep { align-self: center; font-size: 12px; color: var(--muted); padding: 2px 10px; border-radius: 10px; background: color-mix(in srgb, var(--muted) 12%, transparent); }
.day-sep[hidden] { display: none; }
.decision { border-radius: 16px; background: var(--surface); border: 1px solid rgba(247, 198, 49, .45); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.decision .opt {
  min-height: 48px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; text-align: left; display: flex; flex-direction: column; gap: 1px; cursor: pointer;
}
.decision .opt.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.decision .opt b { font-size: 15px; }
.decision .opt span { font-size: 13px; opacity: .85; }

/* --- процессы, цифры, списки --- */
.procs, .stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.proc { padding: 12px; gap: 4px; }
.proc-name { display: flex; align-items: center; gap: 8px; font-weight: 600; min-height: 28px; }
.proc .icon-btn { margin: -8px -8px -8px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.stat b { display: block; font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.stat span { font-size: 12.5px; color: var(--muted); }
.kv { display: grid; grid-template-columns: minmax(100px, auto) 1fr; gap: 4px 12px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line);
  color: inherit; min-height: 44px;
}
.row:first-child { border-top: 0; }
.row .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.big { font-size: 17px; min-height: 56px; }
.chev { color: var(--muted); display: inline-flex; }
ul.plain { margin: 0; padding-left: 18px; }
ul.plain li { margin: 2px 0; overflow-wrap: anywhere; }
.sub { display: flex; flex-direction: column; gap: 4px; }
.sub h2 { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* --- кнопки и поля --- */
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 8px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .07); color: var(--text); font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2;
  cursor: pointer; user-select: none; -webkit-user-select: none; text-align: center;
  transition: transform 70ms ease, box-shadow 70ms ease, filter 70ms ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
/* главная — объёмная, как «Graj» у chess.com и primary-cta у NaZdrow: нижний борт, нажатие опускает её на борт */
.btn.primary {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 800;
  box-shadow: inset 0 -4px 0 var(--accent-dark); padding-bottom: 12px;   /* борт внутри — ряды кнопок не съезжают */
}
.btn.primary:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 var(--accent-dark); }
.btn.dark { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn.outline { border-color: var(--text); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.grow1 { flex: 1; }
.btn.sm { min-height: 40px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.icon { width: 44px; padding: 0; flex: none; }
.btn.icon.sm { width: 40px; }
.btn.busy { opacity: .6; pointer-events: none; }
.icon-btn {
  min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--muted);
  border-radius: 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .pill:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline > input, .inline > select { flex: 1; min-width: 0; }
.inline > .btn { flex: none; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.seg a, .seg button {
  min-height: 40px; padding: 6px 10px; border-radius: 9px; border: 0; background: transparent;
  color: var(--muted); font: inherit; font-size: 14px; text-align: center; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
}
.seg .on { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.composer-bar { display: flex; gap: 8px; align-items: center; }
.composer-bar input { border-radius: 23px; background: var(--surface-2); }
.composer-bar .btn { border-radius: 23px; }

/* --- журналы --- */
.log { padding: 10px 12px; gap: 4px; }
.log .msg-text { font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; }
.log.clip .msg-text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.lvl-ERROR, .lvl-CRITICAL { color: var(--bad); }
.lvl-WARNING { color: var(--warn); }
.lvl-INFO { color: var(--info); }
.scroll-x { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x .btn { flex: none; min-height: 38px; padding: 6px 12px; font-size: 14px; }
.scroll-x .btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* --- агент --- */
.feed { display: flex; flex-direction: column; gap: 8px; }
.bubble {
  padding: 10px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--line);
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px;
}
.bubble.me { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--info-bg); border-color: transparent; max-width: 88%; }
.bubble.result { border-color: var(--accent); }
.bubble.fail { border-color: var(--bad); }
details.tool { border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--surface-2); font-size: 13px; }
details.tool summary {
  min-height: 36px; padding: 8px 0; cursor: pointer; list-style: none;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
details.tool summary::-webkit-details-marker { display: none; }
details.tool[open] summary { color: var(--text); white-space: normal; }
details.tool pre { margin: 0 0 10px; }
.sys { font-size: 12px; color: var(--muted); text-align: center; }
.composer { display: flex; flex-direction: column; gap: 8px; }

/* --- нижние вкладки: плавающая панель (док NaZdrow), активная — травяная подложка под значком --- */
#tabs {
  position: fixed; z-index: 20;
  left: calc(env(safe-area-inset-left) + 10px); right: calc(env(safe-area-inset-right) + 10px);
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 4px; border-radius: 30px; border: 1px solid var(--line);
  background: rgba(38, 35, 31, .92); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
body.unpaired #tabs { display: none; }
#tabs a {
  position: relative; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--muted); font-size: 11px; font-weight: 500;
}
#tabs a.on { color: var(--accent-text); font-weight: 700; }
#tabs .ico { position: relative; display: inline-flex; padding: 3px 16px; border-radius: 14px; }
#tabs a.on .ico { background: rgba(129, 182, 76, .20); }
#tabs .badge {
  position: absolute; top: -5px; left: 30px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

/* --- тосты --- */
#toasts {
  position: fixed; left: 0; right: 0; z-index: 60; pointer-events: none;
  bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 12px);
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 16px;
}
body.has-bar #toasts { bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 84px); }
body.unpaired #toasts { bottom: calc(env(safe-area-inset-bottom) + 16px); }
.toast {
  max-width: 560px; padding: 10px 14px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 500;
  box-shadow: var(--shadow); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere;
  pointer-events: auto; animation: rise .2s ease-out; border-left: 4px solid var(--accent);
}
.toast.ok { border-left-color: #81b64c; }
.toast.err { border-left-color: #e0403a; }
.toast.info { border-left-color: #6ca9e0; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* --- нижний лист и PIN --- */
.backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; margin: 0;
  background: var(--surface); border-radius: 28px 28px 0 0;
  padding: 10px 18px calc(env(safe-area-inset-bottom) + 18px); display: flex; flex-direction: column; gap: 12px;
  animation: slide .2s ease-out; color: var(--text);
}
.sheet::before { content: ""; align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet h3 { font-size: 18px; font-weight: 700; }
.sheet .err { color: var(--bad); font-size: 14px; }
.sheet .err:empty { display: none; }
@keyframes slide { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.pin-input { font-size: 26px; letter-spacing: .4em; text-align: center; font-family: var(--mono); }
.sheet.menu { gap: 8px; }
.sheet.menu .btn { justify-content: flex-start; text-align: left; font-weight: 500; }
.sheet.menu .btn.cancel { justify-content: center; margin-top: 4px; }

/* --- сопряжение --- */
.pair { max-width: 420px; margin: 6vh auto 0; text-align: center; }
.pair .logo { width: 88px; height: 88px; border-radius: 22px; margin: 0 auto 4px; display: block; }
.pair p { margin: 0; }

/* --- «Ничего не требуется» --- */
.calm { text-align: center; padding: 28px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.calm-big { font-family: var(--display); font-size: 22px; font-weight: 700; }

/* плашка заморозки на «Главной»: строка текста и короткая кнопка; на узком экране кнопка уходит вниз */
.banner.freeze { flex-wrap: wrap; padding: 12px 14px; font-size: 14.5px; }
.banner.freeze .grow { min-width: 60%; color: var(--text); }
.calm-big::before { content: "✓"; display: block; font-size: 40px; line-height: 1.1; margin-bottom: 4px; color: var(--ok); }
.calm-day { color: var(--muted); font-size: 14px; }
.calm-day:empty { display: none; }

/* --- свёртки --- */
details.fold { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
details.fold > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 12px 14px; user-select: none; -webkit-user-select: none; font-weight: 600;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .chev { transition: transform .15s; }
details.fold[open] > summary .chev { transform: rotate(90deg); }
details.fold > .fold-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
details.fold.quiet > summary { font-weight: 500; color: var(--muted); }
.count { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--muted); }

/* тревоги строкой */
.card.alerts { padding: 2px 14px; }
.row.alert { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 6px 8px; color: var(--text); }
.row.alert > .alert-icon { grid-column: 1; grid-row: 1; color: var(--bad); display: inline-flex; }
.row.alert > .alert-text { grid-column: 2; grid-row: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; font-weight: 600; }
.row.alert > .alert-age { grid-column: 3; grid-row: 1; }
.row.alert > .btn { grid-column: 4; grid-row: 1; }
.row.alert > .alert-text.open { grid-column: 1 / -1; grid-row: 2; white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 400; }

/* загрузка фото */
.strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.add-photo {
  flex: none; position: relative; overflow: hidden; width: 100%; min-height: 52px; border: 1px dashed var(--muted); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-2); font-size: 15px; font-weight: 600; cursor: pointer;
}
.add-photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }

@media (min-width: 700px) {
  .grid2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery, .gallery img { height: 420px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}

/* ── «Продажи в работе» (13.11): цепочка шагов продажи на «Главной» ── */
.card.sale.late { border-color: var(--bad); }
.steps { list-style: none; margin: 2px 0 0; padding: 0; display: flex; gap: 4px; }
.steps li { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; color: var(--muted); }
.steps li + li::before { content: ""; position: absolute; top: 11px; right: calc(50% + 14px); width: calc(100% - 24px); height: 2px; background: var(--line); }
.steps li.done + li::before { background: var(--accent); }
.steps .sdot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--mono); background: var(--surface-2); border: 2px solid var(--line); z-index: 1; }
.steps .lbl { font-size: 11.5px; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.steps li.done { color: var(--text-2); }
.steps li.done .sdot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps li.cur { color: var(--text); font-weight: 700; }
.steps li.cur .sdot { border-color: var(--accent-text); color: var(--accent-text); }
.steps li.cur.late { color: var(--bad); }
.steps li.cur.late .sdot { border-color: var(--bad); color: var(--bad); }
.sale-hint { color: var(--text-2); }
/* «Сделки» (13.11): строка сделки по этапам */
.crm-list { display: flex; flex-direction: column; gap: 8px; }
.crm-row { display: flex; align-items: center; gap: 6px; padding: 8px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.crm-row.bad { border-color: var(--bad); }
.crm-row.bad .crm-line { color: var(--bad); }
.crm-row.warn .crm-line { color: var(--warn); }
.crm-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--text); }
.crm-main .ph { width: 52px; height: 52px; border-radius: 8px; flex: none; font-size: 10px; }
.crm-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.crm-body .name { font-size: 14px; font-weight: 600; }
.crm-line { font-weight: 600; }
.sale-order { font-weight: 600; }
.sale-order.warn { color: var(--warn); }
.sale-order a { font-weight: 400; }
.linkish { background: none; border: 0; padding: 4px 0; margin: 0; font: inherit; color: var(--accent-text); text-decoration: underline; cursor: pointer; }
.small.bad, .tiny.bad { color: var(--bad); }
.card.sale .bot-note { font-size: 12.5px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 8px; }

/* «Для себя» (21.11): миниатюра объявления OLX в строке */
.thumb { width: 56px; height: 56px; flex: none; object-fit: cover; border-radius: 10px; background: var(--line); }

/* ── макет 26.11 (Ваня: «мне нужно только то, что мне необходимо… покупать и следить… срочное — в верхних списках»):
   без вкладок; «Главная» — сроки по дням, «Нужно сделать», «В пути», строки-входы; «Товар» — блок «Сейчас», цепочка,
   плитки объявлений, разговоры; «Разговор» — по-русски с оригиналом по касанию ── */
#link.on.ok { color: var(--muted); }
.small.warn, .tiny.warn { color: var(--warn); }
.stack.tight { gap: 10px; }

.due-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.due-day { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.due-day .d { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due-day b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due-day.bad { border-color: var(--bad); background: var(--bad-bg); }
.due-day.bad .d { color: var(--bad); }
.due-day.warn { border-color: var(--warn); }

.todo { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); min-width: 0; }
.todo .ph { width: 64px; height: 64px; border-radius: 14px; flex: none; font-size: 10px; }
.todo .grow { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.todo .when { font-size: 13px; font-weight: 600; color: var(--text-2); }
.todo .what { font-size: 16px; font-weight: 600; line-height: 1.25; }
.todo.bad { border-color: var(--bad); }
.todo.bad .when { color: var(--bad); }
.todo.warn { border-color: var(--warn); }
.todo.warn .when { color: var(--warn); }
.todo:active { transform: scale(.99); }

.row.way { gap: 12px; align-items: center; color: var(--text); }
.row.way .ph { width: 48px; height: 48px; border-radius: 12px; flex: none; font-size: 9px; }
.row.way .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row.way .title { font-weight: 600; }

.entries { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.entry { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.entry .side { color: var(--muted); font-size: 14px; white-space: nowrap; }
.entry .chev { color: var(--muted); display: inline-flex; }
.entry.ask { background: var(--surface-2); border-color: var(--info); min-height: 56px; font-weight: 600; }
.entry.ask .side { color: var(--info); font-size: 13px; font-weight: 400; }
.entry.hot { border-color: var(--warn); font-weight: 600; }
.entry.hot .side { color: var(--warn); font-weight: 700; }
.entry.gain { font-weight: 400; white-space: normal; }
.entry.gain .side { color: var(--ok); font-weight: 600; }

.prod-head { display: flex; gap: 14px; align-items: center; }
.prod-head .ph-btn { background: none; border: 0; padding: 0; flex: none; cursor: pointer; }
.prod-head .ph { width: 72px; height: 72px; border-radius: 16px; font-size: 10px; }
.prod-head .grow { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.prod-head .ad-title { font-family: var(--display); font-size: 21px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }

.now-box { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.now-box .when { font-size: 13px; font-weight: 600; color: var(--accent-text); }
.now-box h2 { font-size: 19px; font-weight: 600; line-height: 1.25; }
.now-box.bad { border-color: var(--bad); }
.now-box.bad .when { color: var(--bad); }
.now-box.warn { border-color: var(--warn); }
.now-box.warn .when { color: var(--warn); }
.now-box.quiet .when { color: var(--muted); }
.now-box .btns { flex-wrap: wrap; }
.now-box .btns .btn { min-height: 50px; }

.step-list { list-style: none; margin: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.step-list li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.step-list .mark { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.step-list li.done { color: var(--text-2); }
.step-list li.done .mark { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step-list li.cur { color: var(--text); font-weight: 600; }
.step-list li.cur .mark { border-color: var(--accent-text); }
.step-list li.cur.late, .step-list li.cur.late .side { color: var(--bad); }
.step-list li.cur.late .mark { border-color: var(--bad); }
.step-list .side { white-space: nowrap; font-variant-numeric: tabular-nums; }

.ad-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ad-tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px; padding-right: 30px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); min-width: 0; min-height: 92px; }
.ad-tile > .i { position: absolute; top: 14px; right: 12px; color: var(--muted); }
.ad-tile .k { font-size: 12px; font-weight: 600; }
.ad-tile .k.src { color: var(--warn); }
.ad-tile .k.our { color: var(--info); }
.ad-tile.off { opacity: .75; }
.ad-tile:active { transform: scale(.99); }

.talks { display: flex; flex-direction: column; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.talk { display: flex; flex-direction: column; gap: 4px; padding: 13px 14px; color: var(--text); border-top: 1px solid var(--line); min-width: 0; }
.talk:first-child { border-top: 0; }
.talk.need { background: var(--need-bg); }
.talk .top { display: flex; align-items: center; gap: 8px; }
.talk .top b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.talk .at { font-size: 12px; color: var(--muted); white-space: nowrap; }
.talk .state { color: var(--muted); }
.talk .state.warn { color: var(--accent-text); font-weight: 600; }
.talk .state.bad { color: var(--bad); }
.talk .state.ok { color: var(--ok); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.seg a { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 10px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--muted); min-width: 0; }
.seg a .oneline { min-width: 0; }
.seg a.on { background: var(--surface); color: var(--text); }
.chat-meta { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.chat-meta .grow { flex: 1; min-width: 0; }
.chat-meta .linkish { font-size: 13px; font-weight: 600; white-space: nowrap; min-height: 44px; }
.msg .b .orig { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.preview-out { padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--line); font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 48px; }
.preview-out.bad { color: var(--bad); border-color: var(--bad); }

/* «Для себя»: разговор с нейросетью — «как я понял», варианты, строка ввода */
.ask-me { align-self: flex-end; max-width: 86%; padding: 10px 12px; border-radius: 16px 16px 4px 16px; background: rgba(129, 182, 76, .18); border: 1px solid rgba(129, 182, 76, .35); overflow-wrap: anywhere; }
.under { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--info); }
.under .k { font-size: 12px; font-weight: 600; color: var(--info); }
.under dl { margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.under dt { font-size: 12px; color: var(--muted); }
.under dd { margin: 0; overflow-wrap: anywhere; }
.ask-bar { display: flex; flex-direction: column; gap: 8px; }
.ask-bar textarea { min-height: 76px; border-radius: 14px; background: var(--surface-2); }

/* «Мои вещи»: загрузка пачкой, ход, вопросы */
progress.batch-bar { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border: 0; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
progress.batch-bar::-webkit-progress-bar { background: var(--surface-2); }
progress.batch-bar::-webkit-progress-value { background: var(--accent); }
progress.batch-bar::-moz-progress-bar { background: var(--accent); }
.batch-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; font-size: 13px; color: var(--muted); }
.batch-nums b { display: block; font-family: var(--display); font-size: 20px; color: var(--text); }
.batch-nums .ok b { color: var(--ok); }
.batch-nums .warn b { color: var(--warn); }
.q-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.q-card .top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.q-card .ph { width: 48px; height: 48px; border-radius: 12px; flex: none; font-size: 9px; }
.q-card .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.q-card .opts .btn { border-radius: 22px; min-height: 44px; padding: 0 16px; font-weight: 500; }
.q-card form { display: flex; gap: 8px; }
.q-card form input { flex: 1; min-width: 0; }

.add-many { position: relative; min-height: 54px; font-size: 16px; }
.add-many input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.add-many.busy { opacity: .6; pointer-events: none; }
.now-box .btns .btn.primary { flex: 1 1 70%; }
.now-box .btns .btn.grow1:not(.primary) { flex: 1; }
.under .btns .btn.primary { flex: 1 1 100%; }
.under .btns .btn:not(.primary) { flex: 1; }
.chat-meta { align-items: center; }
.chat-meta .linkish { display: inline-flex; align-items: center; }
.msg-new { align-self: center; font-size: 12px; font-weight: 700; color: var(--accent-text); padding: 2px 10px; border-radius: 10px; background: var(--surface); }

/* «Товары» (27.11): выставленное по интересу */
.goods-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.goods-sort { min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; max-width: 60%; }
.goods-list { display: flex; flex-direction: column; gap: 10px; }
.goods-card .item-body .price { font-size: 20px; font-weight: 800; }
.goods-card .item-stats .hot { color: var(--ok); font-weight: 700; }
.goods-card .item-stats .hang { justify-content: flex-end; color: var(--muted); }
.goods-card .item-stats .hang.warn-text { color: var(--warn); font-weight: 600; }
.goods-card .btns .btn { min-height: 40px; }

/* Главная «как у OLX» (27.11): поиск, круглые ярлыки, плитки */
.search-box { display: flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.search-box .search { flex: 1; min-width: 0; border: 0; background: none; padding: 0; min-height: 46px; font-size: 16px; color: var(--text); outline: none; box-shadow: none; }
.search-rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 10px; }
.search-rows .pad { padding: 12px 4px; }
.shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.btn.wide { width: 100%; margin-top: 8px; }
.sc { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; min-width: 0; }
.sc-ico { position: relative; width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.sc.on .sc-ico { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sc.on .sc-t { color: var(--text); font-weight: 700; }
.sc-ico .badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.sc-ico .badge.hot { background: var(--bad); color: #ffffff; }
.sc-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.todo-tile.bad { border-color: var(--bad); }
.todo-tile .badge-box { align-self: flex-start; }
.tile-body .name.oneline { min-height: 0; }
.tile-stats { display: flex; gap: 10px; font-size: 13px; color: var(--text-2); }
.tile-stats span { display: inline-flex; align-items: center; gap: 3px; }
.tile-stats .hot { color: var(--ok); font-weight: 700; }
#tabs a.add .ico { padding: 9px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
#tabs a.add.on .ico { background: var(--accent); }

/* «Товары» со всеми данными (27.11) */
.g-cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.g-cell { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.g-cell b { font-size: 16px; font-weight: 800; white-space: nowrap; }
.g-cell span { font-size: 11px; color: var(--muted); }
.g-cell.hot b { color: var(--ok); }
.g-cell.warn b { color: var(--warn); }
.g-plats { display: flex; flex-direction: column; margin: 0 10px; border-top: 1px solid var(--line); }
.g-plat { display: flex; align-items: center; gap: 8px; min-height: 38px; font-size: 13px; color: var(--text-2); min-width: 0; }
.g-plat + .g-plat { border-top: 1px dashed var(--line); }
.g-plat b { color: var(--text); min-width: 54px; }
.g-plat .grow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-note { display: flex; align-items: center; gap: 6px; margin: 0 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); min-width: 0; }
.g-note.muted { color: var(--muted); font-size: 12px; }
.g-note span { min-width: 0; }
.goods-card .btns { padding-top: 8px; }

/* «Товары» плитками по два в ряд (27.11) */
.goods-tile .warn-text { color: var(--warn); font-weight: 600; }
.grid2 > .empty { grid-column: 1 / -1; }

/* Близость к продаже (01.12): строка стадии на плитке, пилюли стадий над плитками, строка на главной */
.stage-line { font-size: 12px; font-weight: 700; color: var(--text-2); }
.stage-line.st-agreed, .live-near .st-agreed b, .pill.st-agreed b { color: var(--ok); }
.stage-line.st-later, .live-near .st-later b, .pill.st-later b { color: var(--accent-text); }
.stage-line.st-haggle, .live-near .st-haggle b, .pill.st-haggle b { color: var(--warn); }
.pill.on b { color: inherit; }
.live-near { display: flex; align-items: center; gap: 8px; padding: 10px 0 0; border-top: 1px solid var(--line); color: var(--text); font-size: 13px; min-width: 0; }
.live-near .k { color: var(--text-2); flex: none; }
.live-near .i { color: var(--muted); flex: none; }
.live-near .near-list { display: flex; flex-wrap: wrap; gap: 2px 10px; flex: 1; min-width: 0; }

/* Этикетки на странице «Отправить» (28.11) */
.label-list { display: flex; flex-direction: column; }
.label-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; min-height: 56px; }
.label-pick { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.label-open { flex: none; padding: 12px 4px; }
.card.label-list { padding: 4px 14px; }
.label-probe { text-align: center; padding: 8px 0; }
.label-row + .label-row { border-top: 1px solid var(--line); }
.label-row.off .label-pick { cursor: default; opacity: .7; }
/* 28.11 ночью: у фото в строке не было размера — картинка вставала в полный размер и растягивала страницу */
.label-row .ph { width: 48px; height: 48px; border-radius: 12px; flex: none; font-size: 9px; overflow: hidden; }
.label-row input { width: 22px; height: 22px; min-height: 0; padding: 0; margin: 0; flex: none; accent-color: var(--accent, currentColor); }
.label-box, .label-list { min-width: 0; max-width: 100%; }
.label-row .small { overflow-wrap: anywhere; }
.label-row .grow { display: flex; flex-direction: column; min-width: 0; }
.small.ok-text { color: var(--ok); }

/* Страница товара в стиле «Товаров» (27.11) */
.deal-head { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.deal-head .ad-title { font-family: var(--display); font-size: 21px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.deal-head .price.big { font-size: 30px; font-weight: 800; }
.card.deal-cells { margin: 0; padding: 12px 6px; border-top: 1px solid var(--line); flex-direction: row; }
.card.deal-plats { margin: 0; padding: 2px 14px; border-top: 1px solid var(--line); gap: 0; }
.deal-plats .g-plat { min-height: 46px; font-size: 14px; }
.deal-plats .g-plat b { min-width: 76px; }
.deal-plats .g-plat.src b { color: var(--warn); }

/* цена и доход рядом (27.11) */
.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price-row .gain { font-size: 14px; }
.deal-head .price-row .gain { font-size: 18px; }

/* главная без шапки; просмотр фото внутри приложения (27.11) */
body.no-top #top { display: none; }
body.no-top #view { padding-top: calc(env(safe-area-inset-top) + 14px); }
.viewer { position: fixed; inset: 0; z-index: 80; background: #000000; display: flex; flex-direction: column; }
.viewer-strip { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.viewer-strip::-webkit-scrollbar { display: none; }
.viewer-page { flex: none; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; scroll-snap-align: center; scroll-snap-stop: always; }
.viewer-page img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.viewer-x { position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #ffffff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.viewer-n { position: absolute; bottom: calc(env(safe-area-inset-bottom) + 18px); left: 0; right: 0; text-align: center; color: #ffffff; font-size: 14px; font-weight: 600; pointer-events: none; }

/* главная: важные цифры; своя вещь (27.11) */
.info-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); min-width: 0; }
.info-tile .k { font-size: 12px; color: var(--muted); }
.info-tile b { font-family: var(--display); font-size: 22px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-tile.ok b { color: var(--ok); }
.info-tile.bad b { color: var(--bad); }
a.banner { color: inherit; }
a.banner.bad { background: var(--bad-bg); color: var(--bad); }
a.banner.quiet { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.own-mark { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); align-self: center; }

/* «Как у продавца» — как страница объявления OLX (27.11) */
.olx-head .ad-title { font-size: 22px; font-weight: 600; line-height: 1.25; }
.olx-head .price.big { font-size: 30px; font-weight: 800; }
.olx-tags .chip { border: 1px solid var(--line); background: none; color: var(--text); padding: 6px 10px; }
.olx-h { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.olx-place { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.src-entry { gap: 10px; }
.src-entry .grow { display: flex; flex-direction: column; min-width: 0; }

/* страница товара по макету 27.11: две вкладки сверху, значки, плашки */
.deal-top { display: flex; align-items: center; gap: 10px; }
.deal-back { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.deal-top .seg { flex: 1; }
.deal-top .seg button { flex: 1; min-height: 40px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; font-weight: 600; border-radius: 12px; cursor: pointer; }
.deal-top .seg button.on { background: var(--surface-2); color: var(--text); }
.deal-head .chips .chip { padding: 6px 12px; font-size: 13px; }
.deal-icons { display: flex; justify-content: space-between; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: 17px; font-weight: 700; }
.deal-icons span { display: inline-flex; align-items: center; gap: 6px; }
.deal-icons .hot { color: var(--ok); }
.deal-icons .warn { color: var(--warn); }
.deal-btns .btn { min-height: 50px; font-size: 16px; }
.src-title { display: flex; align-items: flex-start; gap: 10px; }
.src-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 7px; background: var(--muted); }
.src-dot.ok { background: var(--ok); }
.src-dot.bad { background: var(--bad); }
.src-opis { gap: 6px; }

/* «У продавца»: карточки с деталями и переписка на странице (27.11) */
.src-card { gap: 10px; padding: 16px; }
.card-h { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.card-h h2 { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); flex: 1; }
.src-card.place { border-color: var(--accent); }
.place-city { font-family: var(--display); font-size: 22px; font-weight: 800; line-height: 1.2; }
.place-ship { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.place-ship.ok { color: var(--ok); }
.place-ship.warn { color: var(--warn); }
.src-price { align-items: center; }
.olx-open { margin-left: auto; min-height: 36px; gap: 4px; }
.src-thread { padding: 0; }
.src-thread a.sys { text-align: center; font-size: 13px; color: var(--accent-text); text-decoration: underline; }

/* главная, вариант 27.11 поздно: два значка на ярлыке, карточка денег, лента продаж, выставленное */
.sc-ico .badge.left { right: auto; left: -4px; }
.money-hero { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.money-hero .k { font-size: 13px; color: var(--muted); }
.money-hero .big { font-family: var(--display); font-size: 36px; font-weight: 800; line-height: 1.05; }
.money-hero .big.bad { color: var(--bad); }
.money-bar { width: 100%; height: 10px; border: 0; border-radius: 5px; overflow: hidden; background: var(--surface-2); appearance: none; -webkit-appearance: none; }
.money-bar::-webkit-progress-bar { background: var(--surface-2); border-radius: 5px; }
.money-bar::-webkit-progress-value { background: var(--accent); border-radius: 5px; }
.money-bar::-moz-progress-bar { background: var(--accent); border-radius: 5px; }
.money-legend { display: flex; justify-content: space-between; }
.money-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.money-mini div { display: flex; flex-direction: column; gap: 1px; }
.money-mini span { font-size: 12px; color: var(--muted); }
.money-mini b { font-size: 18px; font-weight: 800; white-space: nowrap; }
.money-mini b.ok { color: var(--ok); }
.money-mini b.bad { color: var(--bad); }
.sale-strip { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.sale-strip::-webkit-scrollbar { display: none; }
.sale-chip { flex: none; width: 116px; display: flex; flex-direction: column; gap: 2px; color: var(--text); min-width: 0; }
.sale-chip .ph { width: 116px; height: 116px; border-radius: 14px; margin-bottom: 4px; }
.sale-chip b { font-size: 16px; font-weight: 800; }
.live-card { gap: 12px; padding: 16px; }
.live-top { display: flex; align-items: baseline; gap: 8px; color: var(--text); flex-wrap: wrap; }
.live-top .k { font-size: 13px; color: var(--muted); width: 100%; }
.live-top b { font-family: var(--display); font-size: 24px; font-weight: 800; }
.live-top .i { margin-left: auto; color: var(--muted); align-self: center; }
.live-parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.live-part { display: flex; flex-direction: column; gap: 1px; padding: 10px; border-radius: 12px; background: var(--surface-2); color: var(--text); }
.live-part b { font-size: 20px; font-weight: 800; }
.live-part span { font-size: 12px; color: var(--muted); }
.live-part.ok b { color: var(--ok); }
.live-part.warn b { color: var(--warn); }

/* «У продавца», компактный вариант (27.11 поздно) */
.src-card { padding: 14px; gap: 8px; }
.src-main .ad-title { font-size: 19px; line-height: 1.25; }
.src-main .price.big { font-size: 28px; }
.src-tags .chip { padding: 3px 8px; font-size: 12px; }
.opis { font-size: 14px; line-height: 1.45; color: var(--text-2); }
.clamp4 { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.src-seller { flex-direction: row; align-items: center; gap: 12px; }
.src-seller .grow { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.src-seller .avatar { flex: none; }
.place-line { display: inline-flex; align-items: center; gap: 4px; }
.ship-ico { flex: none; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.ship-ico.ok { background: var(--ok-bg); color: var(--ok); }
.ship-ico.bad { background: var(--bad-bg); color: var(--bad); }

/* значки ярлыка: слева красный «срочно», справа зелёный «всего», на одной высоте (27.11) */
.sc-ico .badge, .sc-ico .badge.left { top: -5px; background: var(--accent); color: var(--accent-ink); border: 2px solid var(--bg); box-sizing: content-box; }
.sc-ico .badge.left.hot { background: var(--bad); color: #ffffff; }

/* значок-цифра на вкладке «Главная» убран (Ваня 27.11: «не несёт полезной информации» — срочное видно на ярлыках) */
#tabs #badge { display: none !important; }

/* значки ярлыка — дальше друг от друга и выше (Ваня 27.11) */
.sc-ico .badge { top: -10px; right: -12px; }
.sc-ico .badge.left { top: -10px; left: -12px; right: auto; }
.shortcuts { padding-top: 8px; }

/* «Наше»: значок сообщений — кнопка, лист «кто писал» (27.11) */
.deal-icons .stat-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--surface-2); color: inherit; font: inherit; font-weight: 700; padding: 6px 12px; margin: -6px -12px; border-radius: 12px; cursor: pointer; }
.deal-icons .stat-btn.hot { color: var(--ok); }
.buyers-sheet .talks { max-height: 60vh; overflow-y: auto; }

/* проход 27.11 вечером: текст раскрывается касанием, цветные счётчики, быстрые действия главной */
.fold-text { display: -webkit-box; width: 100%; text-align: left; border: 0; background: none; padding: 0; margin: 0; font: inherit; font-size: 14px; line-height: 1.45; color: var(--text-2); cursor: pointer; }
.fold-text:not(.clamp4) { display: block; }
.src-thread button.sys { align-self: center; border: 0; background: none; font: inherit; font-size: 13px; color: var(--accent-text); text-decoration: underline; cursor: pointer; padding: 4px 0 8px; }
.deal-icons.tinted .c-view { color: #6fb1ff; }
.deal-icons.tinted .c-like { color: #ff7b8a; }
.deal-icons.tinted .c-talk { color: var(--ok); }
.deal-icons.tinted .c-offered, .tile-stats .c-offered { color: #b79cff; }
.deal-icons.tinted .c-days { color: #e8c268; }
.deal-icons.tinted .c-days.warn { color: var(--warn); }
.quick-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.quick-row::-webkit-scrollbar { display: none; }
.quick { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; border-radius: 21px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.quick.on { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.quick.cold { background: #23405c; border-color: #6fb1ff; color: #bfe0ff; }
.quick:disabled { opacity: .6; }
/* --- голосовой ассистент (27.11): кнопка-микрофон поверх экранов, лист, экран «Нашёл» --- */
#assist-fab {
  position: fixed; z-index: 21; right: calc(env(safe-area-inset-right) + 6px);
  bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); padding: 0;
  display: grid; place-items: center; background: var(--ink); color: var(--accent-text); box-shadow: var(--shadow);
}
#assist-fab:active { transform: scale(.94); }
#assist-fab .i { width: 22px; height: 22px; }
/* панель действий сделки и строка ввода переписки стоят над вкладками — кнопка поднимается над ними */
body.has-bar #assist-fab { bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 72px); }
body.unpaired #assist-fab { display: none; }
.sheet.assist { gap: 10px; }
.assist-state { min-height: 22px; font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.assist-state:empty { display: none; }
.assist-state.on { color: var(--accent-text); }
.assist-state.on::before, .assist-state.busy::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: assist-pulse 1s ease-in-out infinite;
}
.assist-state.busy { color: var(--muted); }
.assist-state.bad { color: var(--warn); font-weight: 500; }
@keyframes assist-pulse { 0%, 100% { transform: scale(.6); opacity: .5; } 50% { transform: scale(1.2); opacity: 1; } }
.assist-text { font-size: 18px; line-height: 1.35; min-height: 64px; resize: none; }
.assist-row { display: flex; gap: 8px; }
.assist-row .btn.primary { flex: 1; min-height: 50px; font-size: 16px; }
.assist-mic { width: 50px; min-height: 50px; border-radius: 50%; }
.assist-mic.on { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); animation: assist-pulse 1.2s ease-in-out infinite; }
.assist-last { align-self: center; color: var(--accent-text); padding: 4px 8px; }
.assist-head { display: flex; flex-direction: column; gap: 4px; }
/* 28.11: ответ числом в листе и три прошлых запроса (SPEC_ASSISTANT, этап 1) */
.assist-answer { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.assist-answer[hidden] { display: none; }
.assist-big { font-size: 30px; font-weight: 700; line-height: 1.15; }
.assist-line { font-size: 15px; color: var(--text-2); }
.assist-answer .btn { align-self: flex-start; margin-top: 4px; }
.assist-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.assist-foot:empty { display: none; }
.assist-speak { padding: 4px 8px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; text-decoration: underline; }
.assist-rows { display: flex; flex-direction: column; gap: 2px; }
.assist-rowpick { display: flex; align-items: flex-start; gap: 10px; padding: 8px 2px; font-size: 15px; line-height: 1.3; }
.assist-rowpick input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.assist-go { width: 100%; min-height: 48px; margin-top: 4px; }
.assist-opts { display: flex; flex-direction: column; gap: 8px; }
.assist-opt { width: 100%; min-height: 46px; justify-content: flex-start; text-align: left; font-size: 15px; }
.assist-hist { display: flex; flex-direction: column; gap: 2px; }
.assist-hist:empty { display: none; }
.assist-hrow { display: flex; align-items: center; gap: 8px; }
.assist-hask { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 4px; background: none; border: 0; color: inherit; text-align: left; font: inherit; font-size: 14px; }
.assist-hask .oneline { max-width: 100%; }
.assist-hfail { color: var(--warn); }
.assist-bad { flex: none; padding: 6px 8px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; text-decoration: underline; }
.assist-bad.on { text-decoration: none; }
.assist-hit { color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ph .corner.found-ok { background: var(--accent); color: var(--accent-ink); }
.ph .corner.found-info { background: var(--info); color: var(--ink); }
.ph .corner.found-warn { background: var(--warn); color: var(--ink); }
.ph .corner.found-plain { background: var(--ink); color: var(--on-ink); }


/* Фильтр поиска в ряду быстрых действий и лист режимов обхода (27.11) */
.quick-wrap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.quick.round { width: 44px; min-height: 44px; padding: 0; justify-content: center; border-radius: 50%; }
/* ряд быстрых действий по центру, значок заморозки и суммы одной высоты (Ваня 28.11) */
.quick-row { justify-content: center; align-items: center; gap: 10px; }
.quick.range { min-height: 44px; padding: 0 20px; border-radius: 22px; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* лист пределов: две суммы рядом, по центру */
.lim-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.lim-in { width: 100%; min-width: 0; height: 68px; padding: 0 8px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: center; font-family: var(--display); font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lim-in:focus { outline: none; border-color: var(--ok); }
.lim-in.bad { border-color: var(--bad, #e06c5a); }
.lim-dash { font-family: var(--display); font-size: 28px; font-weight: 700; color: var(--text-2); }
.lim-week { text-align: center; font-size: 14px; color: var(--text-2); min-height: 20px; }
.lim-week.bad { color: var(--bad, #e06c5a); }
.thread.foldable { cursor: pointer; }
.later-gain { font-family: var(--display); font-size: 20px; font-weight: 800; color: var(--ok); }
.warn-text { color: var(--warn); }
.ok-text { color: var(--ok); }

/* ссылка «Чат в OLX» в заголовке переписки (28.11) */
.chat-ext { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border-radius: 16px; border: 1px solid var(--line); color: var(--accent-text); font-size: 13px; font-weight: 600; text-decoration: none; }

/* «Товары»: фильтры выпадающими списками в один ряд (28.11) */
.drop-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.drop { min-width: 0; min-height: 40px; padding: 0 19px 0 9px; border-radius: 20px; border: 1px solid var(--line); background-color: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; text-overflow: ellipsis; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 13px) 17px, calc(100% - 8px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.drop.on { background-color: var(--text); border-color: var(--text); color: var(--bg); }
.drop option { background: var(--surface); color: var(--text); }

/* код отправки вместо наклейки (29.11): строка-кнопка в «Этикетках» и лист с кодом и QR */
button.label-row.label-code { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.label-code .code-ico { width: 22px; flex: none; text-align: center; font-size: 11px; font-weight: 800; color: var(--ok); }
.label-code .code-pill { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 10px; border-radius: 10px; background: var(--ok-bg); color: var(--ok); font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 700; }
.code-sheet { align-items: stretch; text-align: center; gap: 10px; }
.code-sheet .code-qr { align-self: center; width: min(240px, 70vw); height: auto; border-radius: 12px; background: #fff; padding: 10px; }
.code-sheet .code-big { border: 1px dashed var(--line); border-radius: 16px; background: var(--surface-2); color: var(--text); font-family: "JetBrains Mono", monospace; font-size: 30px; font-weight: 800; letter-spacing: 2px; padding: 18px 10px; overflow-wrap: anywhere; cursor: pointer; }
.code-sheet .btn.block { justify-content: center; }

/* напечатанная этикетка: карточка на странице товара и строка «всё напечатано» (29.11) */
.label-done { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; padding: 10px 14px; }
.label-done .ph { width: 48px; height: 48px; border-radius: 12px; flex: none; overflow: hidden; }
.label-done .grow { display: flex; flex-direction: column; min-width: 0; }

/* карточка «Ситуация» на экране сделки (04.12, lead.py) */
.card.lead-card { display: flex; flex-direction: column; gap: 8px; }
.card.lead-card h2 { margin: 0; font-size: 15px; }
.card.lead-card .lead-tell { border-left: 2px solid var(--line); padding-left: 8px; }

/* «Ждёт тебя» на главной (04.12, lead.waits_me) */
.card.lead-wait { padding: 0; }
.lead-wait-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: inherit; text-decoration: none; }
.lead-wait-row + .lead-wait-row { border-top: 1px solid var(--line); }
