/* Общие стили сайта (были внутри base.html до рефакторинга 12.2026, docs/REFACTOR_PLAN.md шаг 2).
   Порядок правил важен — не переставлять. Стили отдельных страниц — в {% block style %} шаблонов. */
  :root { --bg: #fff; --fg: #1d1d1f; --muted: #6b6b70; --line: #e4e4e7; --accent: #c2410c; --ok: #137a43; --bad: #b42318; --on-accent: #fff; color-scheme: light; }
  :root[data-theme=dark] { --bg: #151517; --fg: #ececee; --muted: #9a9aa0; --line: #2c2c30; --accent: #ff7a1a; --ok: #6fdc9f; --bad: #ff7b6b; --on-accent: #1a0c00; color-scheme: dark; }
  /* Промежуточные темы: светло-бежевая и тёмно-синяя. */
  :root[data-theme=beige] { --bg: #f7f1dd; --fg: #2b2417; --muted: #6b604a; --line: #e3d8b6; --accent: #b43c0b; --ok: #2c6e33; --bad: #a3312a; --on-accent: #fff; color-scheme: light; }
  :root[data-theme=navy] { --bg: #0e1b2e; --fg: #e8eef5; --muted: #9db0c3; --line: #22385a; --accent: #ff8a3d; --ok: #6fdc9f; --bad: #ff8a80; --on-accent: #0b1a2e; color-scheme: dark; }
  :root[data-contrast=high] { --bg: #fff; --fg: #000; --muted: #1d1d1f; --line: #000; --accent: #0033cc; --ok: #005a1e; --bad: #a00000; --on-accent: #fff; }
  :root[data-contrast=high][data-theme=dark], :root[data-contrast=high][data-theme=navy] { --bg: #000; --fg: #fff; --muted: #f2f2f2; --line: #fff; --accent: #ffd400; --ok: #7dffb0; --bad: #ff8a80; --on-accent: #000; }
  :root[data-contrast=high] a { text-decoration: underline; }
  :root[data-contrast=high] .main-nav a, :root[data-contrast=high] .icon-button { text-decoration: none; }
  :root[data-contrast=high] :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
  * { box-sizing: border-box; }
  body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 "Manrope", system-ui, sans-serif; }
  h1 { font-size: 26px; line-height: 1.25; letter-spacing: -0.01em; font-weight: 700; }
  h2 { letter-spacing: -0.005em; }
  button, input, select, textarea { font-family: inherit; }
  /* Safari на iPhone приближает страницу, когда фокус в поле со шрифтом меньше 16px (у нас 15px от body
     и 14–15px в фильтрах и формах): на сенсорных экранах поля — 16px, на компьютере — как было. */
  @media (hover: none) and (pointer: coarse) {
    input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]):not([type=button]),
    select, textarea { font-size: 16px !important; }
  }
  button, .icon-button, input, select { border-radius: 8px; }
  header, main { max-width: 1600px; margin: 0 auto; padding: 12px 24px; }
  header { display: flex; gap: 18px; align-items: center; border-bottom: 1px solid var(--line);
           position: sticky; top: 0; z-index: 50; background: var(--bg); }
  .site-foot { max-width: 1400px; margin: 32px auto 0; padding: 18px 24px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
  .to-top { position: fixed; right: 18px; bottom: 22px; z-index: 45; width: 46px; height: 46px; border-radius: 50%;
            border: 1px solid var(--line); background: var(--bg); color: var(--fg); font-size: 22px; line-height: 1;
            box-shadow: 0 6px 18px rgb(0 0 0 / 25%); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .to-top.show { opacity: .92; pointer-events: auto; }
  @media (max-width: 760px) { .to-top { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); } }
  .brand { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
  .brand img { width: auto; height: 30px; display: block; }
  /* Логотип: тёмные буквы на светлых темах, светлые — на тёмной и синей. */
  .logo-dark-bg { display: none !important; }
  :root[data-theme=dark] .logo-light-bg, :root[data-theme=navy] .logo-light-bg { display: none !important; }
  :root[data-theme=dark] .logo-dark-bg, :root[data-theme=navy] .logo-dark-bg { display: block !important; }
  .main-nav { display: flex; gap: 22px; }
  .main-nav a { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
  .main-nav a.on { color: var(--fg); font-weight: 600; }
  .main-nav svg, .icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .icon-button { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; color: inherit; }
  .lang-switch { font-size: 13px; font-weight: 600; min-width: 40px; }
  .icon-button.on { border-color: var(--accent); color: var(--accent); }
  .theme-toggle, .a11y-toggle { padding: 4px 9px; font-size: 16px; line-height: 1; }
  .theme-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 28px; }
  .theme-toggle .swatch { display: block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--fg); }
  .a11y { position: relative; }
  .a11y-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: 260px; padding: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / 20%); }
  .a11y-panel[hidden] { display: none; }
  .a11y-panel b { display: block; margin-bottom: 8px; }
  .a11y-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
  .a11y-row output { min-width: 48px; text-align: center; font-weight: 600; }
  .a11y-row button { min-width: 40px; font-size: 18px; }
  a { color: var(--accent); text-decoration: none; }
  /* Поле пароля с кнопкой «показать» (app.js). */
  /* span: сброс правил страниц для span в полях (.field span в настройках). */
  .pass-wrap { position: relative; display: block; padding: 0; margin: 0; font-size: inherit; color: inherit; }
  .pass-wrap > input { display: block; width: 100%; padding-right: 44px !important; box-sizing: border-box; }
  .pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center;
            justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
  .pw-eye:hover { color: var(--fg); }
  .pw-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  /* Ссылки в содержимом и подвале: при наведении — светло-оранжевая заливка (боковое меню
     и кнопки-ссылки — со своими стилями). :where — нулевой вес: свои :hover страниц важнее. */
  :where(main a:not(.button, .primary, .pw-buy, .buy, .wa, .org-wa, .org-call, .call, .icon-button,
                    .lang-card, .chip-link, .more-tile), .site-foot a) {
    border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone;
    transition: background-color .15s, box-shadow .15s; }
  :where(main a:not(.button, .primary, .pw-buy, .buy, .wa, .org-wa, .org-call, .call, .icon-button,
                    .lang-card, .chip-link, .more-tile):hover, .site-foot a:hover) {
    background-color: color-mix(in srgb, var(--accent) 12%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent); }
  form.filters, form.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
  input[type=text], input:not([type]) { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: inherit; }
  button { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
  /* Неактивная кнопка (идёт поиск, отправка) — видно, что нажать нельзя; на всех страницах. */
  button:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.4); }
  /* Кнопка, похожая на ссылку («по подписке 🔒» и т. п.) — общая для всех страниц. */
  .link-button { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
  table { width: 100%; border-collapse: collapse; }
  th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
  th { color: var(--muted); font-weight: 500; font-size: 13px; }
  td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .muted { color: var(--muted); font-size: 13px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .logout { margin-left: auto; display: flex; gap: 10px; align-items: center; }
  .logout form { margin: 0; }
  @media (max-width: 760px) {
    header, main { padding: 10px 12px; }
    header { gap: 8px 12px; }
    /* На телефоне разделы — нижняя панель: иконка и подпись, в одну строку. */
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    .main-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; gap: 0; justify-content: space-around; background: var(--bg); border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
    .main-nav a { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px; font-size: 11px; line-height: 1.15; color: var(--muted); padding: 2px 1px; text-align: center; }
    .main-nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .main-nav a.on { color: var(--accent); font-weight: 600; }
    .main-nav svg { width: 24px; height: 24px; }
    header { flex-wrap: nowrap; }
    header .logout { gap: 6px; }
    .a11y-panel { position: fixed; left: 12px; right: 12px; top: 56px; width: auto; }
    header .who { display: none; }
    .table-wrap table { min-width: 760px; }
    /* Узкие таблицы (две колонки: количество — цена, название — значение) — по ширине экрана. */
    .table-wrap table.narrow { min-width: 0; }
    .table-wrap table.narrow td { overflow-wrap: anywhere; }
  }
  .billing-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft, transparent); }
  .billing-note p { margin: 0; flex: 1; }
  .billing-note button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 4px; }
  dialog.paywall { width: min(480px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--bg); color: var(--fg); }
  dialog.paywall::backdrop { background: rgba(0, 0, 0, .55); }
  .pw-wrap { padding: 22px 22px 18px; position: relative; }
  .pw-wrap h2 { margin: 0 0 10px; padding-right: 40px; font-size: 20px; }
  .pw-wrap ul { padding-left: 20px; margin: 8px 0 12px; } .pw-wrap li { margin: 4px 0; }
  .pw-close { position: absolute; top: 10px; right: 10px; }
  .pw-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 14px; }
  .pw-actions button.link { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
  .popup-form { display: grid; gap: 10px; margin: 12px 0 4px; }
  .popup-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
  .popup-form input { width: 100%; padding: 10px 12px; font: inherit; font-size: 16px; border: 1px solid var(--line);
                      border-radius: 8px; background: transparent; color: var(--fg); }
  .popup-form .popup-submit { padding: 10px 16px; font: inherit; font-weight: 600; border: 0; border-radius: 8px;
                       background: var(--accent); color: var(--on-accent); cursor: pointer; }
  .pw-buy { padding: 10px 16px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
  .primary-link { background: var(--accent); color: var(--on-accent) !important; border-color: transparent !important; }
  .impersonating { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: center; padding: 8px 12px; background: #b45309; color: #fff; font-size: 14px; }
  .impersonating button { background: #fff; color: #7c2d12; border: 0; font-weight: 600; padding: 4px 10px; }
  /* Бот заблокирован или не подключён — видно всегда, не закрывается (zakup.tg_status). */
  .tg-bar { position: sticky; top: 0; z-index: 51; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: center; padding: 8px 12px; background: #b91c1c; color: #fff; font-size: 14px; text-align: center; }
  .tg-bar form { margin: 0; }
  .tg-bar button { border: 0; border-radius: 8px; padding: 5px 12px; font: inherit; font-weight: 600; cursor: pointer; background: #fff; color: #7f1d1d; }
  .tg-bar .tg-why { background: transparent; color: #fff; text-decoration: underline; padding: 5px 4px; }
  #tg-why .pw-actions form { margin: 0; }
  .tg-bar[hidden] { display: none; }
  .tg-short { display: none; }
  @media (max-width: 760px) {
    .tg-bar { flex-wrap: nowrap; gap: 8px; padding: 6px 10px; font-size: 13px; text-align: left; justify-content: space-between; }
    .tg-long { display: none; } .tg-short { display: inline; flex: 1; min-width: 0; }
    .tg-bar button { padding: 4px 8px; white-space: nowrap; }
    .tg-bar button.tg-why:not([data-tg-hide]) { display: none; }   /* «Зачем?» — нажатие на текст */
    .tg-short { text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
  }
  /* Шапка тоже прилипает к верху — ставим её под плашку, иначе при прокрутке она закроет плашку. */
  body:has(.tg-bar:not([hidden])) header { top: var(--tg-bar-h, 0px); }
  .burger { display: none; font-size: 20px; line-height: 1; padding: 4px 10px; }
  .tools { display: flex; gap: 10px; align-items: center; }
  .tool-label { display: none; }
  @media (max-width: 760px) {
    /* Тема, язык и режим для слабовидящих на телефоне — в «Настройки» → «Интерфейс». */
    .tools .ui-ctl { display: none !important; }
  }
  /* Компьютер: шапка — левая панель у края экрана; узкая (значки) — по кнопке «Свернуть»
     или сама на экране уже 1100 px. Телефон — нижняя панель и шторки «Закупки», «Товары», «Аккаунт» (ниже). */
  .side-head, .side-gap, .side-view, .side-collapse, .brand img.brand-mark { display: none; }
  /* Описание платформы: на телефоне — в шапке справа от логотипа, на компьютере — под ним. */
  .brand-tag { font-size: 11px; line-height: 1.3; color: var(--muted); min-width: 0; flex: 1 1 auto;
               display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  @media (max-width: 340px) { .brand-tag { display: none; } }
  @media (max-width: 760px) {
    /* Телефон: в шапке — логотип и описание; гостю «Вход» и «Регистрация» — в шторке «Аккаунт». */
    header .logout > a.primary-link, header .logout > a[href^="/login"] { display: none; }
    header .brand-tag { font-size: 10.5px; line-height: 1.25; -webkit-line-clamp: 3; }
    header .brand img { height: 24px; width: auto; }
    header .logout > a.icon-button:not(.searches) { padding: 6px 10px; font-size: 14px; }
  }
  @media (min-width: 761px) {
    header .main-nav a.nav-sub { display: flex; }
    :root { --side: 240px; }
    :root[data-side=mini] { --side: 68px; }
    body { padding-left: var(--side); }
    header { position: fixed; top: 0; bottom: 0; left: 0; width: var(--side); max-width: none; margin: 0;
             flex-direction: column; align-items: stretch; gap: 2px; padding: 16px 12px 12px; border-bottom: 0;
             border-right: 1px solid var(--line); overflow-y: auto; overflow-x: hidden; }
    header .logout, header .tools { display: contents; }
    header .burger { display: none; }
    .brand { order: 0; padding: 0 8px 6px; }
    .brand-tag { order: 0; flex: none; padding: 0 8px 12px; font-size: 12px; -webkit-line-clamp: 3; }
    :root[data-side=mini] .brand-tag { display: none; }
    .main-nav { order: 1; flex-direction: column; gap: 2px; }
    .main-nav::before, .side-head { content: attr(data-head); display: block; font-size: 11px; text-transform: uppercase;
             letter-spacing: .05em; color: var(--muted); padding: 10px 10px 4px; }
    .side-head { order: 2; }
    .main-nav a, header .tool-row, header .tools .tool-row button, header .searches {
             display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 0; border-radius: 8px;
             color: var(--fg); background: none; font-size: 14px; font-weight: 400; white-space: nowrap; width: 100%; text-align: left;
             justify-content: flex-start; }
    .main-nav a:hover, header .tool-row:hover, header .searches:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); }
    .main-nav a.on, header .tool-row.on, header .searches.on { color: var(--accent); font-weight: 600;
             background: color-mix(in srgb, var(--accent) 12%, transparent); }
    .main-nav svg, header .tool-row svg { width: 20px; height: 20px; flex: none; }
    header .tool-label { display: inline; }
    /* Порядок верха панели: Закупки (с подпунктами), Инвестиции, Каталог, потом остальное.
       Заголовок «Закупки» над ними не нужен — это первый пункт. */
    .main-nav::before { display: none; }
    .main-nav > * { order: 5; }
    .main-nav > a[data-search-open] { order: 0; }
    .main-nav .nav-subs > a { order: 1; }
    .main-nav > .nav-invest { order: 2; }
    .main-nav > .nav-cat { order: 3; }
    /* Раскрывающиеся группы (app.js): свёрнутая — без пунктов; в узкой панели видны все значки. */
    .side-group { display: contents; }
    /* Свёрнуты по умолчанию все, кроме «Закупок»; группа текущей страницы (data-current) открыта. Без
       скрипта (нет data-sg-ready) — всё открыто. Состояние — атрибуты data-sg-<группа> у <html>. */
    :root[data-sg-ready]:not([data-side=mini]):not([data-sg-analytics=open]) header .side-group[data-group=analytics]:not([data-current]) > * { display: none !important; }
    :root[data-sg-ready]:not([data-sg-analytics=open]) header [data-group-toggle=analytics]:not([data-current]) > .chev { transform: rotate(-90deg); }
    :root[data-sg-ready]:not([data-side=mini]):not([data-sg-goods=open]) header .side-group[data-group=goods]:not([data-current]) > * { display: none !important; }
    :root[data-sg-ready]:not([data-sg-goods=open]) header [data-group-toggle=goods]:not([data-current]) > .chev { transform: rotate(-90deg); }
    :root[data-sg-ready]:not([data-side=mini]):not([data-sg-refs=open]) header .side-group[data-group=refs]:not([data-current]) > * { display: none !important; }
    :root[data-sg-ready]:not([data-sg-refs=open]) header [data-group-toggle=refs]:not([data-current]) > .chev { transform: rotate(-90deg); }
    :root[data-sg-ready]:not([data-side=mini]):not([data-sg-tools=open]) header .side-group[data-group=tools]:not([data-current]) > * { display: none !important; }
    :root[data-sg-ready]:not([data-sg-tools=open]) header [data-group-toggle=tools]:not([data-current]) > .chev { transform: rotate(-90deg); }
    :root[data-sg-buy=closed]:not([data-side=mini]) header .side-group[data-group=buy]:not([data-current]) > * { display: none !important; }
    :root[data-sg-buy=closed] header [data-group-toggle=buy]:not([data-current]) > .chev { transform: rotate(-90deg); }
    header .main-nav .chev, header .chev { display: block; width: 14px !important; height: 14px !important; margin-left: auto;
             fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
             transition: transform .15s; opacity: .6; }
    :root[data-side=mini] header .chev { display: none; }
    button.side-head { display: flex; align-items: center; width: 100%; border: 0; background: none; cursor: pointer;
             font: inherit; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
             padding: 10px 10px 4px; text-align: left; border-radius: 6px; }
    button.side-head:hover { color: var(--fg); }
    /* Подпункты «Закупок»: объявления и лоты, с отступом. */
    .main-nav a.nav-sub { padding: 6px 10px 6px 42px; font-size: 13px; color: var(--muted); }
    .main-nav a.nav-sub.on { color: var(--accent); background: none; }
    .main-nav a.nav-sub::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-left: -18px; margin-right: 8px; }
    :root[data-side=mini] .main-nav a.nav-sub, :root[data-side=mini] header .tool-row.sub { display: none; }
    header .tools .tool-row.sub { padding: 6px 10px 6px 42px; font-size: 13px; }
    header .tools .tool-row.sub { color: var(--muted); }
    header .tools .tool-row.sub .tool-label { font-size: 13px; }
    header .tools .tool-row.sub.on { background: none; color: var(--accent); }
    /* Точка и отступ — как у подпунктов «Закупок» (.nav-sub). */
    header .tools .tool-row.sub::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-left: -18px; margin-right: -4px; }
    header .sec { order: 2; }
    .side-gap { display: block; order: 3; flex: 1 1 auto; min-height: 18px; }
    header .who { order: 4; display: block; padding: 6px 10px 2px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
    header .searches { order: 4; }
    header .acc { order: 4; }
    header .tools form.side-out { padding: 0; }
    header .tools form.side-out button { color: var(--bad); }
    header .logout > a.icon-button:not(.searches) { order: 4; justify-content: center; margin-top: 6px; padding: 8px 10px; }
    .side-view { order: 5; display: flex; gap: 4px; padding: 10px 4px 4px; border-top: 1px solid var(--line); margin-top: 8px; }
    .side-view .tool-row { width: auto; padding: 6px 8px; }
    .side-view .tool-label { display: none; }
    .side-view .a11y-panel { left: 0; right: auto; top: auto; bottom: calc(100% + 6px); }
    .side-collapse { order: 6; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 0; background: none; color: var(--muted); font-size: 13px; }
    .side-collapse svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
    /* Узкая панель: только значки, подписи — во всплывающей подсказке (title). */
    .brand img.brand-mark { display: none !important; }
    :root[data-side=mini] .brand img:not(.brand-mark) { display: none !important; }
    :root[data-side=mini] .brand img.brand-mark { display: block !important; }
    :root[data-side=mini] .main-nav span, :root[data-side=mini] header .tool-label,
    :root[data-side=mini] .main-nav::before, :root[data-side=mini] .side-head, :root[data-side=mini] header .who,
    :root[data-side=mini] header .logout > a.primary-link { display: none; }
    :root[data-side=mini] header .logout > a.icon-button:not(.searches) { padding: 8px 2px; font-size: 12px; }
    :root[data-side=mini] .side-view { flex-direction: column; }
    :root[data-side=mini] .side-collapse svg { transform: rotate(180deg); }
    :root[data-side=mini] header .searches { font-size: 12px; padding: 8px 4px; }
    :root[data-side=mini] .main-nav a, :root[data-side=mini] header .tool-row, :root[data-side=mini] header .tools .tool-row button { justify-content: center; }
  }
  /* Строка поиска по словам внизу (word_form): компьютер — плавающая, по центру, на половину экрана и
     шире; планшет — панель во всю ширину; телефон — шторка «Поиск» (стили шторок ниже). */
  .word-bar { display: none; }
  .word-bar, .word-sheet-form { align-items: center; gap: 8px; }
  .word-bar svg, .word-sheet-form svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
  .word-bar input, .word-sheet-form input { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 16px; color: var(--fg);
    background: none; border: 0; outline: 0; padding: 8px 2px; }
  .word-bar button, .word-sheet-form button { flex: none; font: inherit; font-weight: 600; color: #fff; background: var(--accent);
    border: 0; border-radius: 10px; padding: 9px 18px; cursor: pointer; }
  .word-bar:focus-within, .word-sheet-form:focus-within { border-color: var(--accent); }
  /* «Сбросить» — свой крестик (data-word-clear); встроенный крестик поля поиска убираем, чтобы не было двух. */
  .word-bar input::-webkit-search-cancel-button, .word-sheet-form input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
  .word-bar .word-clear, .word-sheet-form .word-clear { flex: none; width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 15px; font-weight: 400;
    color: var(--muted); background: none; }
  .word-bar .word-clear:hover, .word-sheet-form .word-clear:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 8%, transparent); }
  .word-clear[hidden] { display: none; }
  @media (min-width: 761px) {
    .word-bar { display: flex; position: fixed; z-index: 44; left: var(--side); right: 0; bottom: 0; margin: 0;
      padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
    .has-word .site-foot { padding-bottom: 90px; }
    .has-word .to-top { bottom: 84px; }
  }
  @media (min-width: 1200px) {
    .word-bar { left: calc(var(--side) + (100vw - var(--side)) / 2); right: auto; bottom: 18px; transform: translateX(-50%);
      width: min(calc(100vw - var(--side) - 48px), max(50vw, 640px)); padding: 6px 6px 6px 16px;
      border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 28px rgb(0 0 0 / 18%); }
  }
  /* Подсказки из истории поиска (app.js) — под полем слов или над ним, если поле внизу экрана. */
  .word-suggest { position: fixed; z-index: 95; margin: 0; padding: 4px; list-style: none; background: var(--bg); border: 1px solid var(--line);
    border-radius: 12px; box-shadow: 0 10px 30px rgb(0 0 0 / 22%); max-height: 50vh; overflow-y: auto; }
  .word-suggest[hidden] { display: none; }
  .word-suggest .ws-head { padding: 4px 10px 2px; font-size: 12px; color: var(--muted); }
  .word-suggest li[data-value] { display: flex; align-items: center; gap: 8px; padding: 0 0 0 10px; border-radius: 8px; cursor: pointer; }
  .word-suggest li[data-value].on, .word-suggest li[data-value]:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .word-suggest .ws-text { flex: 1 1 auto; min-width: 0; padding: 9px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .word-suggest .ws-text b { font-weight: 700; }
  .word-suggest button { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; font-size: 13px; }
  .word-suggest button:hover { color: var(--bad); }
  /* Кнопки шторок и шторки — только на телефоне; там же верхнее меню ☰ не нужно. */
  .nav-phone, .more-sheet, .more-backdrop, .main-nav a.nav-sub, .main-nav .chev { display: none; }
  .side-group { display: contents; }
  @media (max-width: 760px) {
    /* «Мои лоты» — в шторке «Аккаунт», «Поиск поставщиков» — в «Товары». */
    .main-nav a.phone-hide { display: none; }
    .main-nav a.on-m { color: var(--accent); font-weight: 600; }
    /* Порядок в панели: Закупки, Товары, Лента, Инвестиции, Аккаунт (в разметке Лента раньше — для компьютера). */
    .main-nav .nav-feed { order: 1; }
    .main-nav .nav-invest { order: 2; }
    .main-nav .nav-account { order: 3; }
    .main-nav .nav-word { order: 4; }
    .word-sheet-form { display: flex; margin: 4px 2px 2px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: 12px; }
    .burger, .tools { display: none !important; }
    .main-nav .nav-wide { display: none; }
    .nav-phone { display: inline-flex; flex: 1 1 0; min-width: 0; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; line-height: 1.15; color: var(--muted); padding: 2px 1px; background: none; border: 0; }
    .nav-phone svg { width: 24px; height: 24px; }
    .nav-phone span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .nav-phone.on, .nav-phone[aria-expanded=true], .main-nav a[aria-expanded=true] { color: var(--accent); font-weight: 600; }
    .more-who { font-size: 13px; margin: 2px 6px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .more-tile.more-accent { color: var(--accent); font-weight: 600; }
    button.more-tile { font: inherit; font-size: 12px; width: 100%; cursor: pointer; }
    .more-backdrop:not([hidden]) { display: block; position: fixed; inset: 0 0 calc(58px + env(safe-area-inset-bottom)) 0; z-index: 46; background: rgb(0 0 0 / 45%); opacity: 0; transition: opacity .22s; }
    .more-backdrop.open { opacity: 1; }
    .more-sheet:not([hidden]) { display: block; position: fixed; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 47;
      background: var(--bg); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 8px 10px 14px;
      box-shadow: 0 -10px 30px rgb(0 0 0 / 25%); transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); max-height: 70vh; overflow-y: auto; }
    .more-sheet.open { transform: translateY(0); }
    .more-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 2px auto 6px; }
    .more-head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 8px 6px 2px; }
    .more-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
    .more-form { margin: 0; display: contents; }
    .more-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px; border-radius: 12px; color: var(--fg); background: none; border: 0;
      font-size: 12px; line-height: 1.2; text-align: center; opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s; }
    .more-tile svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .more-tile.on { color: var(--accent); font-weight: 600; background: color-mix(in srgb, var(--accent) 10%, transparent); }
    .more-tile.more-out { color: var(--bad); }
    .more-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 4px; }
    .more-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: 4px; }
    .more-grid.four .more-tile { padding: 14px 2px; font-size: 13px; }
    .more-grid.two .more-tile { padding: 16px 4px; font-size: 14px; }
    .more-tile .more-swatch { display: block; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); }
    .more-sheet.open .more-tile { opacity: 1; transform: none; }
    .more-sheet.open .more-grid.g0 > :nth-child(1), .more-sheet.open .more-grid.g0 > :nth-child(1) .more-tile { transition-delay: 30ms; }
    .more-sheet.open .more-grid.g0 > :nth-child(2), .more-sheet.open .more-grid.g0 > :nth-child(2) .more-tile { transition-delay: 52ms; }
    .more-sheet.open .more-grid.g0 > :nth-child(3), .more-sheet.open .more-grid.g0 > :nth-child(3) .more-tile { transition-delay: 74ms; }
    .more-sheet.open .more-grid.g0 > :nth-child(4), .more-sheet.open .more-grid.g0 > :nth-child(4) .more-tile { transition-delay: 96ms; }
    .more-sheet.open .more-grid.g0 > :nth-child(5), .more-sheet.open .more-grid.g0 > :nth-child(5) .more-tile { transition-delay: 118ms; }
    .more-sheet.open .more-grid.g0 > :nth-child(6), .more-sheet.open .more-grid.g0 > :nth-child(6) .more-tile { transition-delay: 140ms; }
    .more-sheet.open .more-grid.g0 > :nth-child(7), .more-sheet.open .more-grid.g0 > :nth-child(7) .more-tile { transition-delay: 162ms; }
    .more-sheet.open .more-grid.g0 > :nth-child(8), .more-sheet.open .more-grid.g0 > :nth-child(8) .more-tile { transition-delay: 184ms; }
    .more-sheet.open .more-grid.g0 > :nth-child(9), .more-sheet.open .more-grid.g0 > :nth-child(9) .more-tile { transition-delay: 206ms; }
    .more-sheet.open .more-grid.g0 > :nth-child(10), .more-sheet.open .more-grid.g0 > :nth-child(10) .more-tile { transition-delay: 228ms; }
    .more-sheet.open .more-grid.g1 > :nth-child(1), .more-sheet.open .more-grid.g1 > :nth-child(1) .more-tile { transition-delay: 118ms; }
    .more-sheet.open .more-grid.g1 > :nth-child(2), .more-sheet.open .more-grid.g1 > :nth-child(2) .more-tile { transition-delay: 140ms; }
    .more-sheet.open .more-grid.g1 > :nth-child(3), .more-sheet.open .more-grid.g1 > :nth-child(3) .more-tile { transition-delay: 162ms; }
    .more-sheet.open .more-grid.g1 > :nth-child(4), .more-sheet.open .more-grid.g1 > :nth-child(4) .more-tile { transition-delay: 184ms; }
    .more-sheet.open .more-grid.g1 > :nth-child(5), .more-sheet.open .more-grid.g1 > :nth-child(5) .more-tile { transition-delay: 206ms; }
    .more-sheet.open .more-grid.g1 > :nth-child(6), .more-sheet.open .more-grid.g1 > :nth-child(6) .more-tile { transition-delay: 228ms; }
    .more-sheet.open .more-grid.g1 > :nth-child(7), .more-sheet.open .more-grid.g1 > :nth-child(7) .more-tile { transition-delay: 250ms; }
    .more-sheet.open .more-grid.g1 > :nth-child(8), .more-sheet.open .more-grid.g1 > :nth-child(8) .more-tile { transition-delay: 272ms; }
    .more-sheet.open .more-grid.g1 > :nth-child(9), .more-sheet.open .more-grid.g1 > :nth-child(9) .more-tile { transition-delay: 294ms; }
    .more-sheet.open .more-grid.g1 > :nth-child(10), .more-sheet.open .more-grid.g1 > :nth-child(10) .more-tile { transition-delay: 316ms; }
    .more-sheet.open .more-grid.g2 > :nth-child(1), .more-sheet.open .more-grid.g2 > :nth-child(1) .more-tile { transition-delay: 206ms; }
    .more-sheet.open .more-grid.g2 > :nth-child(2), .more-sheet.open .more-grid.g2 > :nth-child(2) .more-tile { transition-delay: 228ms; }
    .more-sheet.open .more-grid.g2 > :nth-child(3), .more-sheet.open .more-grid.g2 > :nth-child(3) .more-tile { transition-delay: 250ms; }
    .more-sheet.open .more-grid.g2 > :nth-child(4), .more-sheet.open .more-grid.g2 > :nth-child(4) .more-tile { transition-delay: 272ms; }
    .more-sheet.open .more-grid.g2 > :nth-child(5), .more-sheet.open .more-grid.g2 > :nth-child(5) .more-tile { transition-delay: 294ms; }
    .more-sheet.open .more-grid.g2 > :nth-child(6), .more-sheet.open .more-grid.g2 > :nth-child(6) .more-tile { transition-delay: 316ms; }
    .more-sheet.open .more-grid.g2 > :nth-child(7), .more-sheet.open .more-grid.g2 > :nth-child(7) .more-tile { transition-delay: 338ms; }
    .more-sheet.open .more-grid.g2 > :nth-child(8), .more-sheet.open .more-grid.g2 > :nth-child(8) .more-tile { transition-delay: 360ms; }
    .more-sheet.open .more-grid.g2 > :nth-child(9), .more-sheet.open .more-grid.g2 > :nth-child(9) .more-tile { transition-delay: 382ms; }
    .more-sheet.open .more-grid.g2 > :nth-child(10), .more-sheet.open .more-grid.g2 > :nth-child(10) .more-tile { transition-delay: 404ms; }
    
  }
  @media (max-width: 760px) and (prefers-reduced-motion: reduce) {
    .more-sheet, .more-tile, .more-backdrop { transition: none !important; }
  }