/* SupplyBro — оформление страницы. Цвета — переменными, тёмная тема — по настройке системы. */
:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --text: #1c2230;
  --muted: #687385;
  --line: #e3e6eb;
  --line-strong: #cfd4dc;
  --accent: #2557d6;
  --accent-soft: #e8eefc;
  --chip: #f0f2f5;
  --ok: #157a52;
  --bad: #b3261e;
  --warn-bg: #fff6e0;
  --warn-text: #7a5300;
  --row-alt: #fafbfc;
  --sticky: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121418;
    --panel: #1b1e24;
    --text: #e7e9ed;
    --muted: #9aa3b2;
    --line: #2b3038;
    --line-strong: #3a414c;
    --accent: #7ea2ff;
    --accent-soft: #1f2a44;
    --chip: #252a32;
    --ok: #4cc38a;
    --bad: #ff8a80;
    --warn-bg: #2e2614;
    --warn-text: #f0c060;
    --row-alt: #1e2128;
    --sticky: #1b1e24;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
/* Страница сотрудника (/user): без выбора модели анализа, модели чата и поисковика цен — всё по настройкам сайта. */
body.user-mode .admin-only { display: none !important; }
/* Скрытые элементы скрыты всегда, даже если у класса задан display. */
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 20px; line-height: 1.3; margin: 2px 0 0; font-weight: 600; }
h2 { font-size: 16px; margin: 0; font-weight: 600; }
.muted { color: var(--muted); font-weight: 400; }

/* Верхняя полоса */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; letter-spacing: .2px; }

/* Кто вошёл (0.7.0) и кнопки, недоступные роли сотрудника, — их скрывает класс на <body> (сервер всё равно не пустит). */
.me-box { display: flex; align-items: center; gap: 8px; }
.me-name { font-size: 13px; color: var(--muted); white-space: nowrap; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
body.no-upload .need-upload, body.no-analyze .need-analyze, body.no-prices .need-prices,
body.no-chat .need-chat, body.no-jobs .job-ctl { display: none !important; }

/* Вкладки-переходы: панель под выбором конкурса (как остальные блоки), при прокрутке закреплена под шапкой.
   Нажатие прокручивает к разделу этой же страницы. Подложка цвета фона закрывает щели между панелями. */
.jump-wrap {
  position: sticky; top: var(--topbar-h, 53px); z-index: 4;
  margin: -7px -20px; padding: 7px 20px; background: var(--bg);
}
.jump-nav {
  display: flex; gap: 4px; padding: 6px; overflow-x: auto; scrollbar-width: none;
  transition: box-shadow .15s;
}
.jump-nav::-webkit-scrollbar { display: none; }
.jump-wrap.stuck .jump-nav { box-shadow: 0 4px 14px rgba(16, 24, 40, .12); }
.jump {
  flex: none; padding: 8px 16px; border-radius: 8px; font-size: 15px; font-weight: 500; color: var(--text);
  text-decoration: none; white-space: nowrap; border: 1px solid transparent;
}
.jump:hover { background: var(--chip); }
.jump.active { background: var(--accent); color: var(--panel); }
.jump:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Раздел после перехода — сразу под панелью вкладок, а не под ней спрятан. */
main > section { scroll-margin-top: calc(var(--sticky-h, 120px) + 6px); }
.ver { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }

main { max-width: 1400px; margin: 0 auto; padding: 16px 20px 40px; display: grid; gap: 14px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; box-shadow: var(--shadow); min-width: 0;
}

/* Выпадающие списки */
.pickers { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(200px, 1fr) minmax(260px, 2.4fr); gap: 12px; }
.field { display: grid; gap: 4px; min-width: 0; }
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
select {
  width: 100%; min-width: 0; padding: 8px 10px; font: inherit; color: var(--text);
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px;
}
select:disabled { opacity: .6; }
.inline select { width: auto; padding: 5px 8px; margin-left: 6px; }
.hint {
  grid-column: 1 / -1; margin: 0; padding: 8px 10px; border-radius: 8px;
  background: var(--warn-bg); color: var(--warn-text); font-size: 13px;
}

.btn {
  font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.small { padding: 4px 10px; }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

/* Шапка конкурса */
.head-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.tender-no { color: var(--muted); font-size: 13px; }
.links { display: flex; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip { background: var(--chip); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.chip b { font-weight: 600; }

/* Заголовок раздела с настройками */
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-tools { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.status { font-size: 13px; color: var(--muted); }
.status.error { color: var(--bad); }
.status:empty { display: none; }

/* Поля карточки */
.fields { display: grid; grid-template-columns: minmax(160px, 260px) 1fr; margin: 0; }
.fields dt, .fields dd { padding: 7px 0; border-top: 1px solid var(--line); margin: 0; }
.fields dt { color: var(--muted); padding-right: 16px; font-size: 13px; }
.fields dd { white-space: pre-wrap; word-break: break-word; min-width: 0; }
.fields dd.empty-val { color: var(--muted); }

/* Длинный текст: свёрнут до нескольких строк, раскрывается по щелчку */
.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; cursor: pointer; }
.clamp.open { display: block; -webkit-line-clamp: unset; }
.more { font-size: 12px; color: var(--accent); cursor: pointer; user-select: none; }

.files { display: flex; gap: 6px; flex-wrap: wrap; }
.file { background: var(--accent-soft); border-radius: 6px; padding: 2px 8px; font-size: 13px; text-decoration: none; }
.sel { display: inline-block; background: var(--chip); border-radius: 6px; padding: 1px 8px; margin: 0 4px 2px 0; }

/* Таблица спецификации */
.table-wrap { overflow: auto; max-height: 75vh; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
th, td { padding: 6px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; text-align: left; }
th {
  position: sticky; top: 0; z-index: 2; background: var(--sticky); font-weight: 600;
  min-width: 90px; max-width: 220px; border-bottom: 1px solid var(--line-strong);
}
td { max-width: 340px; min-width: 70px; white-space: pre-wrap; word-break: break-word; }
tbody tr:nth-child(even) td { background: var(--row-alt); }
tbody tr:nth-child(odd) td { background: var(--panel); }
td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* «№» и «Наименование позиции» закреплены слева */
.stick0 { position: sticky; left: 0; z-index: 1; min-width: 44px; }
.stick1 { position: sticky; left: var(--stick1-left, 44px); z-index: 1; min-width: 240px; box-shadow: 1px 0 0 var(--line-strong); }
th.stick0, th.stick1 { z-index: 3; }
td .clamp { -webkit-line-clamp: 3; }

/* Телефон и узкие окна */
@media (max-width: 760px) {
  main { padding: 12px 12px 32px; }
  .topbar { padding: 10px 12px; }
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar-tools { flex-wrap: wrap; row-gap: 6px; }       /* кнопки шапки — второй строкой, а не за край экрана */
  .jump-wrap { margin: -7px -12px; padding: 7px 12px; }
  /* Узкий экран: все вкладки видны сразу (в две строки), а не уезжают за край. */
  .jump-nav { flex-wrap: wrap; overflow-x: visible; }
  .jump { padding: 6px 10px; font-size: 14px; }
  .pickers { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .fields dt { border-top: 1px solid var(--line); padding-bottom: 0; }
  .fields dd { border-top: 0; padding-top: 2px; }
  .stick1 { position: static; min-width: 180px; box-shadow: none; }
}

/* ---------- Поля ввода, кнопки ---------- */
input[type="text"], input:not([type]), .newtender input {
  width: 100%; min-width: 0; padding: 8px 10px; font: inherit; color: var(--text);
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.link { color: var(--accent); cursor: pointer; text-decoration: underline; }

/* Новый конкурс */
.pickers { grid-template-columns: minmax(180px, 1fr) minmax(200px, 1fr) minmax(260px, 2.4fr) auto; }
.add-field .btn { padding: 8px 14px; font-size: 14px; }
.newtender {
  grid-column: 1 / -1; display: grid; grid-template-columns: minmax(160px, 1fr) minmax(240px, 3fr);
  gap: 10px 12px; align-items: end; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 8px;
}
.nt-title { grid-column: 1 / -1; font-weight: 600; }
.nt-drop { grid-column: 1 / -1; margin: 0; }
.nt-files { margin-top: 8px; font-size: 13px; color: var(--text); }
.nt-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.newtender .status { grid-column: 1 / -1; margin: 0; }
.nt-nofiles { grid-column: 1 / -1; margin: 0; }
.nt-nofiles-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.nt-nofiles-actions .btn { margin: 0; }

/* ---------- Документы ---------- */
.path { font-size: 13px; color: var(--muted); margin-bottom: 10px; word-break: break-all; }
.nofolder { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px; background: var(--chip); border-radius: 8px; }
.drop {
  border: 2px dashed var(--line-strong); border-radius: 10px; padding: 18px 16px; text-align: center;
  color: var(--muted); transition: border-color .15s, background .15s; margin-bottom: 12px;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.drop-main { font-size: 15px; color: var(--text); margin-bottom: 4px; }
.drop-sub { font-size: 13px; }
.drop-sub select { width: auto; padding: 3px 6px; margin-left: 4px; }
.progress { height: 6px; background: var(--chip); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.job { margin-bottom: 12px; font-size: 13px; }
.job .progress { margin: 0 0 6px; }
.job.done .progress span { background: var(--ok); }
.job.error .progress span { background: var(--bad); }
.job.error .job-text { color: var(--bad); }
.docs-wrap { max-height: 60vh; }
.docs-wrap td { max-width: none; }
.doc-name { min-width: 260px; }
.doc-dir { font-size: 12px; color: var(--muted); }
.doc-note { font-size: 12px; color: var(--muted); max-width: 360px; }
.warn-text { color: var(--warn-text); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; background: var(--chip); }
.badge.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.badge.ocr { background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.badge.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.badge.wait { color: var(--muted); }
.badge.muted { color: var(--muted); }

@media (max-width: 760px) {
  .pickers { grid-template-columns: 1fr; }
  .add-field .label { display: none; }
  .newtender { grid-template-columns: 1fr; }
  .doc-name { min-width: 180px; }
}

/* ---------- Анализ документов ---------- */
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary:disabled:hover { filter: none; }
.notice { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; background: var(--chip); }
.notice.warn { background: var(--warn-bg); color: var(--warn-text); }
.notice.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); }
.notice.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.notice .btn { margin-top: 8px; margin-right: 8px; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.checks { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; font-size: 13px; }
/* Изменения документации (0.9.0) */
#an-changes { display: grid; gap: 10px; margin-bottom: 12px; }
#an-changes:empty { display: none; }
.change-set { border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); border-radius: 8px;
  padding: 10px 12px; background: var(--panel); display: grid; gap: 8px; font-size: 13px; }
.change-set.old { border-left-color: var(--line-strong); }
.change-set > summary { cursor: pointer; }
.change-set > summary .cs-head { display: inline; }
.cs-head { font-weight: 600; font-size: 14px; }
.cs-head .muted { font-size: 12px; }
.cs-summary { font-size: 14px; }
.cs-docs { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
.cs-table { font-size: 13px; }
.cs-table td { vertical-align: top; }
.cs-table td.cs-old { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.cs-table td.cs-new { font-weight: 500; }
.cs-table .cs-col { color: var(--muted); font-size: 12px; }
.cs-comments { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.cs-comments li { background: var(--chip); border-radius: 6px; padding: 6px 10px; }
.change-set .notice { margin: 0; }
.changed-badge { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--accent); cursor: help; }
tr.row-changed td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.checks li { padding: 4px 10px; border-radius: 6px; background: var(--chip); }
.checks li.warn { background: var(--warn-bg); color: var(--warn-text); }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tab {
  font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text);
}
.tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.an-wrap { max-height: 70vh; }
.an-wrap td { max-width: 520px; }
td.block-row { background: var(--chip) !important; font-weight: 600; }
.src-file { font-size: 12px; color: var(--muted); word-break: break-word; }
.quote { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 4px; }
.usage { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---------- Чат по документации ---------- */
.chat-log { display: grid; gap: 10px; max-height: 65vh; overflow: auto; padding: 2px; margin-bottom: 10px; }
.chat-log:empty { display: none; }
.msg { padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.5; max-width: 100%; min-width: 0; word-break: break-word; }
.msg.user { background: var(--accent-soft); justify-self: end; max-width: 85%; white-space: pre-wrap; }
.msg.assistant { background: var(--chip); }
.msg.error { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); white-space: pre-wrap; }
.msg p { margin: 0 0 6px; }
.msg p:last-child { margin-bottom: 0; }
.msg ul { margin: 2px 0 6px; padding-left: 20px; }
.msg .sources { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.msg .sources li { margin-bottom: 3px; }
.msg .meta { margin-top: 6px; font-size: 11px; color: var(--muted); }
.msg .typing { color: var(--muted); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea {
  flex: 1; min-width: 0; resize: vertical; padding: 8px 10px; font: inherit; color: var(--text);
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px;
}
.chat-form .btn { padding: 9px 16px; font-size: 14px; }
.chat-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Прайсы, КП и счета поставщиков в чате (0.8.0) */
.chat-form .btn.attach { padding: 9px 12px; font-size: 16px; line-height: 1; cursor: pointer; }
#chat.drag-over { outline: 2px dashed var(--accent); outline-offset: -6px; }
.msg.pricelist { background: var(--panel); border: 1px solid var(--line); display: grid; gap: 8px; }
.pl-head { font-weight: 600; }
.pl-head .muted { font-weight: 400; font-size: 12px; }
.pl-status { font-size: 13px; }
.pl-status.wait { color: var(--accent); }
.pl-status.ok { color: var(--text); }
.pl-wrap { max-height: 420px; }
.pl-table { font-size: 13px; }
.pl-table td { vertical-align: top; }
.pl-table td.pl-line { max-width: 360px; color: var(--muted); font-size: 12px; }
.pl-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pl-remove { justify-self: start; font-size: 12px; }
.msg.pricelist .notice { margin: 0; }
.offers.unverified { margin-top: 4px; }
.offers.unverified .badge { font-size: 11px; padding: 0 6px; }
.muted.small, .small { font-size: 12px; }
/* Состояние чата: готов ли, в кэше ли документы и сколько стоит следующий вопрос */
.chat-cache { font-size: 13px; margin-top: 8px; color: var(--muted); }
.chat-cache:empty { display: none; }
.chat-cache .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--line-strong); }
.chat-cache.warm .dot { background: var(--ok); }
.chat-cache.cold .dot { background: var(--warn-text); }
.chat-cache.wait .dot { background: var(--accent); }
.chat-cache b { color: var(--text); font-weight: 600; }

/* Поиск цен */
#pr-table td { vertical-align: top; }
#pr-table .offers div { white-space: nowrap; line-height: 1.5; }
#pr-table .offers a { font-variant-numeric: tabular-nums; font-weight: 600; }
#pr-table .offers .muted { font-size: 12px; }
#pr-table .clamp { white-space: pre-line; font-size: 12px; color: var(--muted); max-width: 360px; }
#pr-table td.stick1 { min-width: 220px; }
.empty-val { color: var(--muted); }

/* Обработчик: что выполняется сейчас (шапка) */
.topbar-tools { display: flex; align-items: center; gap: 10px; }
.activity-wrap { position: relative; }
.activity {
  font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--chip); color: var(--text, inherit); white-space: nowrap;
}
.activity.busy { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.activity.idle { color: var(--muted); }
.activity.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.activity-panel {
  position: absolute; right: 0; top: calc(100% + 6px); width: min(640px, 92vw); max-height: 70vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  padding: 12px; display: grid; gap: 10px; z-index: 20; font-size: 13px;
}
.act-title { font-weight: 600; margin-bottom: 4px; }
.act-job { padding: 4px 8px; border-radius: 6px; cursor: pointer; line-height: 1.4; }
.act-job:hover { background: var(--chip); }
.act-job.running { border-left: 3px solid var(--accent); }
.act-job.queued { border-left: 3px solid var(--line); color: var(--muted); }
.act-job.error { border-left: 3px solid var(--bad); }
.act-job.done { border-left: 3px solid var(--ok); color: var(--muted); }
.act-job.paused { border-left: 3px dashed var(--warn-text); }
.act-job.canceled { border-left: 3px solid var(--line-strong); color: var(--muted); }
.act-job { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 10px; }
.act-text { flex: 1 1 280px; min-width: 0; }
.act-job .job-ctl { margin-left: auto; }

/* Отмена и пауза задач */
.job-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.job-ctl:empty { display: none; }
.job .job-ctl { margin-top: 6px; }
.job-ctl .btn { padding: 2px 10px; font-size: 12px; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.danger:hover { color: var(--bad); border-color: var(--bad); }
.ctl-ask { flex-basis: 100%; color: var(--text); line-height: 1.4; }
.job.paused .progress span { background: var(--warn-text); }
.job.canceled .progress span { background: var(--line-strong); }
.job.paused .job-text, .job.canceled .job-text { color: var(--muted); }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; max-width: min(560px, 92vw);
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 24px rgba(16, 24, 40, .18); padding: 10px 14px; font-size: 13px;
}
.toast.bad { border-color: var(--bad); color: var(--bad); }
@media (max-width: 700px) { .activity { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; } }

/* ---------- Панель «Конкурсы» (0.13.0) ---------- */
.pickers.mode-list { grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.6fr) auto; }
.pickers.mode-list .tender-field, .pickers.mode-list .to-list-field { display: none; }
.pickers.mode-tender { grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr) minmax(240px, 2.4fr) auto auto; }
.to-list-field .btn { padding: 8px 14px; font-size: 14px; text-align: center; }
.tl-search {
  width: min(340px, 70vw); padding: 7px 10px; font: inherit; font-size: 13px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px;
}
.tl-note { margin: -4px 0 10px; font-size: 13px; }
.tl-more { margin: 10px 0 0; font-size: 13px; }
table.tl-table { width: 100%; }
.tl-table th { white-space: nowrap; }
.tl-table th.sort { cursor: pointer; user-select: none; }
.tl-table th.sort:hover { color: var(--accent); }
.tl-table th .arrow { color: var(--accent); margin-left: 4px; }
.tl-table td { white-space: normal; max-width: none; }
.tl-table tbody tr { cursor: pointer; }
.tl-table tbody tr:hover td { background: var(--accent-soft); }
.tl-table td.no { white-space: nowrap; width: 1%; }
.tl-no { font-weight: 700; font-size: 14px; color: var(--accent); text-decoration: none; }
.tl-no:hover { text-decoration: underline; }
.tl-sub { color: var(--muted); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.tl-cust { min-width: 180px; width: 24%; }
.tl-subj { min-width: 220px; width: 36%; }
.tl-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.tl-table td.price, .tl-table td.dl { white-space: nowrap; width: 1%; }
.tl-table td.price { text-align: right; font-variant-numeric: tabular-nums; }
.tl-table td.dl { font-variant-numeric: tabular-nums; }
.tl-left { display: inline-block; margin-top: 3px; }
.tl-table td.st { min-width: 120px; width: 14%; }
.tl-empty-val { color: var(--muted); }
.tl-group td { background: var(--chip) !important; font-weight: 600; cursor: default; }
@media (max-width: 760px) {
  .pickers.mode-list, .pickers.mode-tender { grid-template-columns: 1fr; }
  .tl-search { width: 100%; }
  /* Телефон: строка конкурса — карточкой (номер и НМЦ, заказчик, оборудование, срок и стадия), без сортировки. */
  .tl-wrap { max-height: none; overflow: visible; }
  .tl-table thead { display: none; }
  .tl-table, .tl-table tbody { display: block; width: 100%; min-width: 0; }
  .tl-table tbody tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "no price" "cust cust"
    "subj subj" "dl st"; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .tl-table tbody tr:nth-child(even) { background: var(--row-alt); }
  .tl-table tbody tr:nth-child(odd) { background: var(--panel); }
  .tl-table tbody td { display: block; border: 0; padding: 0; min-width: 0; width: auto; background: none !important; }
  .tl-table td.no { grid-area: no; } .tl-table td.price { grid-area: price; }
  .tl-table td.tl-cust { grid-area: cust; font-weight: 600; } .tl-table td.tl-subj { grid-area: subj; }
  .tl-table td.dl { grid-area: dl; white-space: normal; } .tl-table td.st { grid-area: st; text-align: right; }
  .tl-table td .tl-empty-val:only-child { display: none; }
  .tl-table tbody tr td[colspan] { grid-column: 1 / -1; }
}

/* Заявка (0.15.0): итог готовности, цена заявки, таблица документов, «Нужно от вас». */
.bid-summary { margin: 4px 0 12px; display: grid; gap: 4px; font-size: 13px; }
.bid-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bid-ready { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.bid-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.bid-facts { color: var(--text); }
.bid-price { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.bid-price-label { font-weight: 600; }
.bid-price select { width: auto; max-width: 100%; padding: 5px 8px; }
.bid-price input { padding: 5px 8px; }
.bid-price input { width: 140px; }
.bid-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; }
.bid-notes li { line-height: 1.45; }
.bid-price-now { flex-basis: 100%; }
#bid-docs-table td.bid-files div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
#bid-docs-table td.bid-files .badge { margin-left: 6px; }
#bid-docs-table tr.muted td { color: var(--muted); }
#bid-req-table td.quote { font-style: italic; }
.bid-list { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.bid-list .badge { margin-right: 2px; }
#bid-need h3, #bid-files h3 { font-size: 14px; margin: 10px 0 6px; }
@media (max-width: 760px) {
  .bid-price input { width: 110px; }
  #bid-docs-table td.bid-files div { max-width: 200px; }
  #bid-docs-table td:nth-child(2) { min-width: 180px; }
}
/* Длинные сообщения об ошибках (JSON ответа API, ссылки) переносятся — страница не шире экрана телефона (0.15.1). */
.job-text, .status { overflow-wrap: anywhere; }
