/* ADPM — дизайн-система 2.0 (этап 11). Тёмная боковая панель, светлая рабочая
   область, мягкие тени, градиентный акцент, единые статусы. Только собственные
   стили (политика безопасности: style-src 'self'); цвета графиков — классами. */
:root {
  --bg: #f4f5fa;
  --bg-glow: radial-gradient(1200px 400px at 20% -10%, rgba(99, 102, 241, 0.10), transparent 60%),
             radial-gradient(900px 360px at 100% -20%, rgba(14, 165, 233, 0.08), transparent 60%);
  --panel: #ffffff;
  --panel-2: #f7f8fc;
  --line: rgba(15, 23, 42, 0.08);
  --line-2: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #a855f7 100%);
  --brand-soft: #eef0ff;
  --ok: #059669;
  --ok-soft: #e7f8f1;
  --warn: #d97706;
  --warn-soft: #fff6e6;
  --bad: #e11d48;
  --bad-soft: #fff0f3;
  --info: #0284c7;
  --info-soft: #e6f5fd;
  --c-new: #94a3b8;
  --c-auction: #6366f1;
  --c-award: #f59e0b;
  --c-nobids: #f43f5e;
  --c-work: #0ea5e9;
  --c-done: #8b5cf6;
  --c-accepted: #10b981;
  --c-refused: #f97316;
  --c-cancelled: #cbd5e1;
  --side-bg: linear-gradient(180deg, #0b1020 0%, #111a33 100%);
  --side-text: #c7cbe0;
  --side-muted: #6b7393;
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 1px 1px rgba(15, 23, 42, 0.03), 0 2px 6px rgba(15, 23, 42, 0.04), 0 12px 32px -12px rgba(15, 23, 42, 0.10);
  --shadow-hover: 0 1px 1px rgba(15, 23, 42, 0.04), 0 8px 24px -6px rgba(79, 70, 229, 0.18);
  --side: 264px;
  --top: 64px;
  /* T-85: в полноэкранном режиме Telegram кладёт свои кнопки («Закрыть», «⋯») поверх
     страницы; отступы задаёт telegram-web-app.js — панель опускается под них. */
  --tg-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0a0f1d; --bg-glow: radial-gradient(1200px 400px at 20% -10%, rgba(99, 102, 241, 0.16), transparent 60%);
    --panel: #111827; --panel-2: #0f1626; --line: rgba(148, 163, 184, 0.12); --line-2: rgba(148, 163, 184, 0.22);
    --text: #e7eaf3; --text-2: #c3c9d9; --muted: #8a93ab; --brand: #818cf8; --brand-2: #a78bfa; --brand-soft: #1c2147;
    --ok-soft: #0e2a20; --warn-soft: #2d2410; --bad-soft: #2c1119; --info-soft: #0c2536;
    --c-new: #64748b; --c-cancelled: #475569;
    --shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.5);
    color-scheme: dark; }
}
/* Выбранная вручную тёмная тема (настройки пользователя). */
:root[data-theme="dark"] { --bg: #0a0f1d; --bg-glow: radial-gradient(1200px 400px at 20% -10%, rgba(99, 102, 241, 0.16), transparent 60%);
  --panel: #111827; --panel-2: #0f1626; --line: rgba(148, 163, 184, 0.12); --line-2: rgba(148, 163, 184, 0.22);
  --text: #e7eaf3; --text-2: #c3c9d9; --muted: #8a93ab; --brand: #818cf8; --brand-2: #a78bfa; --brand-soft: #1c2147;
  --ok-soft: #0e2a20; --warn-soft: #2d2410; --bad-soft: #2c1119; --info-soft: #0c2536;
  --c-new: #64748b; --c-cancelled: #475569;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.5);
  color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14.5px/1.55 var(--font); font-feature-settings: "cv11", "ss01", "tnum";
  background: var(--bg-glow), var(--bg); background-attachment: fixed; color: var(--text);
  min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.25; letter-spacing: -0.01em; }
h2 { font-size: 20px; }
h3 { font-size: 15px; font-weight: 650; color: var(--text); }
a { color: var(--brand); }

/* ---------- Оболочка */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column; padding: calc(18px + var(--tg-top)) 12px 18px; z-index: 30; overflow-y: auto; scrollbar-width: thin;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}
.workspace { flex: 1; min-width: 0; margin-left: var(--side); display: flex; flex-direction: column; }
.shell:has(.sidebar[hidden]) .workspace { margin-left: 0; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 18px; margin-bottom: 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.logo { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 6px 14px rgba(124, 58, 237, 0.45)); }
.logo rect { fill: #6d5dfc; }
.logo path { fill: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 17px; letter-spacing: 0.06em; color: #fff; }
.brand-text span { font-size: 11px; color: var(--side-muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { margin: 16px 12px 6px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--side-muted); }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; border: 0; border-radius: 11px;
  background: transparent; color: var(--side-text); font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item i { width: 22px; height: 22px; display: grid; place-items: center; font-style: normal; font-size: 13px; color: var(--side-muted); border-radius: 7px; }
.nav-item span { flex: 1; }
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav-item.active { background: var(--brand-grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(124, 58, 237, 0.7); }
.nav-item.active i { color: #fff; background: rgba(255, 255, 255, 0.16); }
.count { font-style: normal; font-size: 11.5px; font-weight: 700; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: #fff; text-align: center; }
.nav-item.active .count { background: rgba(255, 255, 255, 0.24); }
.count.warn { background: #f59e0b; color: #1c1917; }
.count.demo { background: linear-gradient(135deg, #f59e0b, #f97316); color: #1c1917; }
.sidebar-foot { margin-top: auto; padding: 14px 8px 4px; border-top: 1px solid rgba(255, 255, 255, 0.06); display: flex; flex-direction: column; gap: 8px; }
.session { font-size: 12px; color: var(--side-muted); }
.session summary { cursor: pointer; }
.session dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 6px 0 0; word-break: break-all; }
.session dd { margin: 0; color: var(--side-text); }
.sidebar-foot .ghost { background: rgba(255, 255, 255, 0.05); color: var(--side-text); border-color: rgba(255, 255, 255, 0.08); }
.scrim { position: fixed; inset: 0; background: rgba(2, 6, 23, 0.55); backdrop-filter: blur(2px); z-index: 25; }

.topbar {
  position: sticky; top: 0; z-index: 20; height: calc(var(--top) + var(--tg-top)); display: flex; align-items: center; gap: 12px;
  padding: var(--tg-top) 28px 0; background: color-mix(in srgb, var(--panel) 78%, transparent); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.page-title { font-size: 19px; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.02em; }
.icon-btn { white-space: nowrap; flex: none; min-width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer; padding: 0 12px; }
/* T-85: кнопки окна в стиле Windows: «□» на весь экран / «❐» обратно, «×» закрыть (красная подсветка). */
.win-ctl { display: inline-flex; align-items: center; gap: 0; margin-left: 4px; flex: none; }
.win-btn {
  width: 46px; height: 32px; min-height: 0; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--text);
  box-shadow: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background-color 0.1s;
}
.win-btn:hover:not(:disabled) { background: rgba(15, 23, 42, 0.08); }
.win-btn:active:not(:disabled) { background: rgba(15, 23, 42, 0.14); }
.win-close:hover:not(:disabled) { background: #e81123; color: #fff; }
.win-close:active:not(:disabled) { background: #f1707a; color: #fff; }
.win-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.win-btn:disabled { opacity: 0.35; cursor: default; }
.win-ic { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1; shape-rendering: crispEdges; }
.win-ic[hidden] { display: none; }
.win-close .win-ic { shape-rendering: geometricPrecision; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .win-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }
  :root:not([data-theme="light"]) .win-btn:active:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
}
/* Выбранная вручную тёмная тема (настройки пользователя). */
:root[data-theme="dark"] .win-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }
:root[data-theme="dark"] .win-btn:active:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
/* T-85: переключатель «Владелец | Менеджер». */
.role-switch { display: inline-flex; align-items: center; height: 34px; box-sizing: border-box; padding: 3px; border-radius: 999px; background: var(--brand-soft); gap: 2px; flex: none; }
.role-switch button { height: 28px; min-height: 0; border: 0; background: transparent; color: var(--brand); font: inherit; font-size: 12px; font-weight: 650; padding: 0 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; box-shadow: none; }
.role-switch button.active { background: var(--brand-grad); color: #fff; }
.chip { font-size: 12px; font-weight: 650; padding: 5px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.chip:empty { display: none; }
.content { padding: 24px 28px 40px; width: 100%; max-width: 1480px; margin: 0 auto; }
.is-full .content { max-width: none; }
.grow { flex: 1; }
.status { color: var(--muted); margin: 0 0 12px; }
.status.done { display: none; }

/* ---------- Режим тестирования (панель вставляет только локальный стенд) */
.testbar {
  position: fixed; top: 0; left: 0; right: 0; height: 46px; z-index: 40; display: flex; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap;
  align-items: center; gap: 8px; padding: 8px 16px; color: #1c1917; scrollbar-width: none;
  background: repeating-linear-gradient(45deg, #fde047, #fde047 14px, #facc15 14px, #facc15 28px); border-bottom: 2px solid #a16207; font-size: 13px;
}
.testbar::-webkit-scrollbar { display: none; }
.testbar b { letter-spacing: 0.08em; padding: 3px 9px; background: #1c1917; color: #fde047; border-radius: 6px; }
.testbar a { color: #1c1917; background: rgba(255, 255, 255, 0.75); border: 1px solid #a16207; border-radius: 999px; padding: 4px 12px; text-decoration: none; font-weight: 600; }
.testbar a.on { background: #1c1917; color: #fde047; }
.testbar a.join { background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; border-color: #166534; font-weight: 800; }
.testbar select { width: auto; min-width: 0; padding: 4px 10px; border-radius: 999px; border: 1px solid #a16207; background: rgba(255, 255, 255, 0.85); font-weight: 600; font-size: 13px; }
.testbar .note { font-size: 12px; }
.testbar + .shell { padding-top: 46px; }
.testbar + .shell .sidebar { top: 46px; }
.testbar + .shell .topbar { top: 46px; }

/* ---------- Карточки, списки, текст */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.meta { color: var(--muted); font-size: 13px; }
.warn { color: var(--warn); }
.ok { color: var(--ok); }
.msg { color: var(--bad); font-weight: 600; margin: 0 0 12px; padding: 10px 14px; background: var(--bad-soft); border-radius: var(--radius-s); }
.msg:empty { display: none; }
.empty { color: var(--muted); font-size: 13.5px; text-align: center; padding: 26px 8px; margin: 0; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.list > li { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; overflow-wrap: anywhere; box-shadow: var(--shadow); }
.card .list > li { background: var(--panel-2); box-shadow: none; }
.list > li.empty { background: transparent; border-style: dashed; box-shadow: none; }
.list.compact > li { padding: 9px 13px; }
.list > li.focus { outline: 2px solid var(--brand); outline-offset: 2px; }
.list > li.muted { opacity: 0.65; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.title { font-weight: 650; font-size: 15px; letter-spacing: -0.005em; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.strike { text-decoration: line-through; }
.token { font-family: ui-monospace, Consolas, monospace; background: var(--warn-soft); border: 1px dashed var(--warn); padding: 10px; border-radius: 10px; word-break: break-all; }
.history { margin: 6px 0 0; padding-left: 0; list-style: none; font-size: 13px; color: var(--text-2); border-left: 2px solid var(--line-2); }
.history li { position: relative; padding: 0 0 8px 16px; }
.history li::before { content: ""; position: absolute; left: -5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.money { display: grid; gap: 4px; margin-top: 8px; padding: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }
.more { margin-top: 8px; }

/* Цвет этапа — полоса слева */
.stage { border-left: 4px solid var(--c-new) !important; }
.stage-auction { border-left-color: var(--c-auction) !important; }
.stage-award { border-left-color: var(--c-award) !important; }
.stage-work { border-left-color: var(--c-work) !important; }
.stage-done { border-left-color: var(--c-done) !important; }
.stage-money { border-left-color: var(--c-accepted) !important; }
.stage-closed { border-left-color: var(--c-accepted) !important; }
.stage-refused, .stage-nobids { border-left-color: var(--c-refused) !important; }
.stage-cancelled { border-left-color: var(--c-cancelled) !important; opacity: 0.75; }
.needs { box-shadow: var(--shadow), 0 0 0 1px rgba(217, 119, 6, 0.35) inset; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge:empty { display: none; }
.b-draft { background: var(--panel-2); color: var(--muted); }
.b-review, .b-open { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.b-returned, .b-closed { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.b-done, .b-awarded { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.b-rejected, .b-no_bids { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.b-cancelled { background: var(--panel-2); color: var(--muted); text-decoration: line-through; }
.b-demo { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; border-color: #fcd34d; font-weight: 800; letter-spacing: 0.06em; }
.st-badge { border-color: transparent; }
.st-new { background: #f1f5f9; color: #475569; } .st-auction { background: var(--brand-soft); color: var(--brand); }
.st-award { background: #fef3c7; color: #b45309; } .st-work { background: var(--info-soft); color: var(--info); }
.st-done { background: #f1ebff; color: #6d28d9; } .st-money { background: #dcfce7; color: #15803d; }
.st-closed { background: var(--ok-soft); color: var(--ok); } .st-refused, .st-nobids { background: #ffedd5; color: #c2410c; }
.st-cancelled { background: var(--panel-2); color: var(--muted); text-decoration: line-through; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .st-new { background: #1e293b; color: #cbd5e1; }
  :root:not([data-theme="light"]) .st-award { background: #3b2a0b; color: #fbbf24; }
  :root:not([data-theme="light"]) .st-done { background: #2a1f4a; color: #c4b5fd; }
  :root:not([data-theme="light"]) .st-money { background: #0f2a1c; color: #86efac; }
  :root:not([data-theme="light"]) .st-refused, :root:not([data-theme="light"]) .st-nobids { background: #3b1d0b; color: #fdba74; }
  :root:not([data-theme="light"]) .b-demo { background: #3b2a0b; color: #fcd34d; border-color: #92400e; }
}
/* Выбранная вручную тёмная тема (настройки пользователя). */
:root[data-theme="dark"] .st-new { background: #1e293b; color: #cbd5e1; }
:root[data-theme="dark"] .st-award { background: #3b2a0b; color: #fbbf24; }
:root[data-theme="dark"] .st-done { background: #2a1f4a; color: #c4b5fd; }
:root[data-theme="dark"] .st-money { background: #0f2a1c; color: #86efac; }
:root[data-theme="dark"] .st-refused, :root[data-theme="dark"] .st-nobids { background: #3b1d0b; color: #fdba74; }
:root[data-theme="dark"] .b-demo { background: #3b2a0b; color: #fcd34d; border-color: #92400e; }

/* ---------- Кнопки и поля */
button, .button-link {
  font: inherit; font-size: 13.5px; font-weight: 600; border-radius: var(--radius-s); padding: 9px 15px; border: 1px solid transparent;
  background: var(--brand-grad); color: #fff; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 6px 16px -8px rgba(79, 70, 229, 0.7); transition: transform 0.08s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
button:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary { background: var(--panel); color: var(--brand); border-color: var(--line-2); box-shadow: none; }
button.secondary:hover { border-color: var(--brand); }
button.ghost { background: transparent; border-color: var(--line-2); color: var(--text-2); box-shadow: none; }
button.danger { background: var(--bad); box-shadow: none; }
button.small { padding: 5px 11px; font-size: 12.5px; }
button.link { background: none; border: 0; color: var(--brand); padding: 4px 6px; text-decoration: underline; text-underline-offset: 3px; font-weight: 700; box-shadow: none; border-radius: 8px; min-height: 32px; }
button.link:hover { background: var(--brand-soft); }
input, select, textarea {
  font: inherit; font-size: 14.5px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-s);
  background: var(--panel); color: var(--text); min-width: 0; max-width: 100%; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
textarea { width: 100%; resize: vertical; }
.invalid { border-color: var(--bad) !important; background: var(--bad-soft) !important; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input, .field select { width: 100%; }
.req, .opt { font-style: normal; font-weight: 600; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.req { background: var(--bad-soft); color: var(--bad); }
.opt { background: var(--panel-2); color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.grid2.wide { gap: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters input { flex: 1; min-width: 220px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.seg { background: transparent; color: var(--muted); border: 0; padding: 7px 13px; border-radius: 9px; font-size: 13px; box-shadow: none; }
.seg.active { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 14px -8px rgba(124, 58, 237, 0.8); }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.quick-btn { flex-direction: column; align-items: flex-start; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); padding: 14px; box-shadow: none; border-radius: 14px; }
.quick-btn:hover { border-color: var(--brand); box-shadow: var(--shadow-hover); }
.quick-btn b { font-size: 18px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 8px; }
.report { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; font-size: 13.5px; }
.notify h3 { margin-bottom: 4px; }

/* ---------- Показатели */
.tiles { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 14px; }
.tiles.small { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); }
.tile {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); overflow: hidden; min-width: 0; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.tile-top { display: flex; align-items: center; gap: 8px; }
.tile-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; font-size: 14px; font-weight: 700; background: var(--brand-soft); color: var(--brand); }
.tone-green .tile-icon { background: var(--ok-soft); color: var(--ok); }
.tone-amber .tile-icon { background: var(--warn-soft); color: var(--warn); }
.tone-sky .tile-icon { background: var(--info-soft); color: var(--info); }
.tone-rose .tile-icon { background: var(--bad-soft); color: var(--bad); }
.tone-violet .tile-icon { background: #f1ebff; color: #7c3aed; }
.tile-label { font-size: 12.5px; color: var(--muted); font-weight: 550; flex: 1; min-width: 0; }
.tile-value { font-size: 27px; font-weight: 750; letter-spacing: -0.03em; overflow-wrap: anywhere; margin-top: 4px; }
.tile-hint { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.tile.zero .tile-value { color: var(--muted); }
.tile.warn { border-color: rgba(217, 119, 6, 0.35); }
.tile.warn .tile-value { color: var(--warn); }
.tile.accent .tile-value { color: var(--ok); }
.delta { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.delta.up { background: var(--ok-soft); color: var(--ok); }
.delta.down { background: var(--bad-soft); color: var(--bad); }
.spark { width: 100%; height: 32px; margin-top: 6px; display: block; }
.spark-fill { opacity: 0.16; }
.spark-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark.c1 .spark-fill, .spark.c1 .spark-line { fill: var(--c-auction); stroke: var(--c-auction); }
.spark.c2 .spark-fill, .spark.c2 .spark-line { fill: var(--c-accepted); stroke: var(--c-accepted); }
.spark.c3 .spark-fill, .spark.c3 .spark-line { fill: var(--c-done); stroke: var(--c-done); }
.spark.c4 .spark-fill, .spark.c4 .spark-line { fill: var(--c-award); stroke: var(--c-award); }
.spark .spark-line { fill: none !important; }

/* ---------- Графики */
.grid-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 18px; margin-bottom: 18px; }
.grid-charts .card { margin: 0; }
.chart-card { min-height: 270px; display: flex; flex-direction: column; }
.chart-card h3 { display: flex; align-items: center; gap: 8px; }
.chart-card h3::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--brand-grad); }
.chart { display: flex; flex-direction: column; gap: 8px; position: relative; }
.svg-wrap { padding-top: 18px; }
.svg-chart { width: 100%; height: 180px; display: block; overflow: visible; }
.svg-chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.area-line { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.area-dot { stroke: var(--panel); stroke-width: 2; vector-effect: non-scaling-stroke; }
.area-line.c1, .area-dot.c1, .col-rect.c1 { stroke: var(--c-auction); fill: var(--c-auction); }
.area-line.c2, .area-dot.c2, .col-rect.c2 { stroke: var(--c-accepted); fill: var(--c-accepted); }
.area-line.c3, .area-dot.c3, .col-rect.c3 { stroke: var(--c-done); fill: var(--c-done); }
.area-line.c4, .area-dot.c4, .col-rect.c4 { stroke: var(--c-nobids); fill: var(--c-nobids); }
.area-line.c5, .area-dot.c5, .col-rect.c5 { stroke: var(--c-cancelled); fill: var(--c-cancelled); }
.area-line { fill: none !important; }
.col-rect { stroke: none !important; }
.stop-top { stop-opacity: 0.32; } .stop-bottom { stop-opacity: 0; }
.stop-top.c1, .stop-bottom.c1 { stop-color: var(--c-auction); } .stop-top.c2, .stop-bottom.c2 { stop-color: var(--c-accepted); }
.stop-top.c3, .stop-bottom.c3 { stop-color: var(--c-done); } .stop-top.c4, .stop-bottom.c4 { stop-color: var(--c-nobids); }
.chart-peak { position: absolute; top: 0; right: 0; font-size: 11px; color: var(--muted); }
.axis { display: flex; justify-content: space-between; gap: 2px; font-size: 10.5px; color: var(--muted); }
.axis span { flex: 1; text-align: center; white-space: nowrap; overflow: visible; }
.cols { display: flex; align-items: flex-end; gap: 3px; height: 170px; padding-bottom: 22px; border-bottom: 1px solid var(--line); position: relative; }
.col { flex: 1; min-width: 4px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.col .stack { display: flex; flex-direction: column-reverse; height: 100%; justify-content: flex-start; gap: 0; }
.bar-seg { min-height: 2px; border-radius: 4px 4px 0 0; }
.col .tick { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.c1 { background: var(--c-auction); } .c2 { background: var(--c-accepted); } .c3 { background: var(--c-done); } .c4 { background: var(--c-nobids); } .c5 { background: var(--c-cancelled); }
svg .c1, svg .c2, svg .c3, svg .c4, svg .c5, svg.c1, svg.c2, svg.c3, svg.c4, svg.c5 { background: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--muted); list-style: none; padding: 0; margin: 0; }
.legend.vertical { flex-direction: column; gap: 8px; }
.legend.vertical li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.legend.vertical li span { flex: 1; }
.legend.vertical li em { font-style: normal; color: var(--muted); font-size: 12px; min-width: 38px; text-align: right; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.dot.s-new, .donut-seg.s-new { background: var(--c-new); stroke: var(--c-new); } .dot.s-auction, .donut-seg.s-auction { background: var(--c-auction); stroke: var(--c-auction); }
.dot.s-award, .donut-seg.s-award { background: var(--c-award); stroke: var(--c-award); } .dot.s-nobids, .donut-seg.s-nobids { background: var(--c-nobids); stroke: var(--c-nobids); }
.dot.s-work, .donut-seg.s-work { background: var(--c-work); stroke: var(--c-work); } .dot.s-done, .donut-seg.s-done { background: var(--c-done); stroke: var(--c-done); }
.dot.s-accepted, .donut-seg.s-accepted { background: var(--c-accepted); stroke: var(--c-accepted); } .dot.s-refused, .donut-seg.s-refused { background: var(--c-refused); stroke: var(--c-refused); }
.dot.s-cancelled, .donut-seg.s-cancelled { background: var(--c-cancelled); stroke: var(--c-cancelled); }
.hbars { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 36%) 1fr auto; gap: 12px; align-items: center; font-size: 13px; }
.hbars .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbars b { font-variant-numeric: tabular-nums; font-size: 12.5px; }
.track { height: 9px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.fill { display: block; height: 100%; border-radius: 999px; }
.fill.c1 { background: linear-gradient(90deg, #818cf8, #6366f1); } .fill.c2 { background: linear-gradient(90deg, #34d399, #10b981); } .fill.c3 { background: linear-gradient(90deg, #c4b5fd, #8b5cf6); }
.donut { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.ring { width: 160px; height: 160px; border-radius: 50%; display: grid; place-items: center; flex: none; position: relative; }
.ring.svg { border-radius: 0; }
.donut-svg { width: 160px; height: 160px; transform: rotate(-90deg); position: absolute; inset: 0; }
.donut-track { fill: none; stroke: var(--panel-2); stroke-width: 5; }
.donut-seg { fill: none !important; stroke-width: 5; stroke-linecap: round; background: none !important; }
.hole { width: 104px; height: 104px; border-radius: 50%; background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; z-index: 1; }
.hole b { font-size: 26px; letter-spacing: -0.03em; }
.hole span { font-size: 11px; color: var(--muted); }
.donut .legend { flex: 1; min-width: 180px; }

/* ---------- Период и фильтры дашборда */
.period-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 20px; }
.period-bar select { min-width: 160px; background: var(--panel); box-shadow: var(--shadow); border-color: var(--line); }
.range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.hero h2 { font-size: 24px; margin: 0; letter-spacing: -0.03em; }
.hero p { margin: 4px 0 0; color: var(--muted); }

/* ---------- Таблицы */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--panel-2); position: sticky; top: 0; }
.table tr:last-child td { border-bottom: 0; }
.table td.empty { white-space: normal; }
.table td.neg { color: var(--bad); }
#fin-ops td:nth-child(2), #fin-ops td:nth-child(3), #fin-ops td:last-child { white-space: normal; min-width: 180px; }
#fin-ops td:nth-child(5) { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.clickable { cursor: pointer; }
.clickable:hover td { background: var(--brand-soft); }

/* ---------- Доска статусов менеджера */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.lane { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--c-new); border-radius: 14px; padding: 12px; cursor: pointer; min-height: 130px; box-shadow: var(--shadow); }
.lane.st-review { border-top-color: var(--c-auction); } .lane.st-returned { border-top-color: var(--c-award); } .lane.st-done { border-top-color: var(--c-accepted); }
.lane.st-rejected { border-top-color: var(--c-nobids); } .lane.st-cancelled { border-top-color: var(--c-cancelled); }
.lane-head { display: flex; justify-content: space-between; font-weight: 650; margin-bottom: 8px; font-size: 13.5px; }
.lane-item { font-size: 12.5px; padding: 6px 8px; background: var(--panel-2); border-radius: 8px; margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Торги поставщика — карточки витрины */
.list.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 600px), 1fr)); gap: 16px; }
.auction-card { padding: 0 !important; overflow: hidden; display: flex; flex-direction: column; }
.auction-card > .head { padding: 16px 18px 10px; margin: 0; background: linear-gradient(135deg, var(--brand-soft), transparent); border-bottom: 1px solid var(--line); }
.auction-card > :not(.head) { margin-left: 18px; margin-right: 18px; }
.auction-card > .auc-top { margin: 0; padding: 14px 18px 12px; background: linear-gradient(135deg, var(--brand-soft), transparent); border-bottom: 1px solid var(--line); }
.auction-card > .auc-title { margin-top: 14px; }
.auction-card > .bid-box { margin-bottom: 18px; }
.bid-box .bid-row { padding: 0 !important; margin: 0 !important; background: none; border: 0; }
/* Описание проекта — стандартная таблица (замечание владельца 18.11.2026): название поля — жирное, значение — обычный
   текст; строки разделены линиями, чередуется фон. */
.facts { display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); margin: 12px 0; font-size: 14px;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.facts dt, .facts dd { margin: 0; padding: 9px 12px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.facts dt { font-weight: 700; color: var(--text); background: var(--panel-2); }
.facts dd { color: var(--text-2); }
.facts dt:nth-last-of-type(1), .facts dd:last-child { border-bottom: 0; }
.facts dt.sub { font-weight: 600; padding-left: 24px; color: var(--text-2); }
.facts dt.group { grid-column: 1 / -1; font-weight: 800; background: var(--brand-soft); color: var(--brand); }
.auction-card .facts { margin: 12px 18px; }
.bid-row { padding: 12px 18px !important; margin: 8px 0 0 !important; background: var(--panel-2); border-top: 1px solid var(--line); }
.bid-row input { flex: 1; min-width: 150px; }
.auction-card > div:last-child { margin-bottom: 14px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12.5px; color: var(--brand); white-space: nowrap; background: var(--brand-soft); padding: 4px 10px; border-radius: 999px; }
.timer.soon { color: var(--warn); background: var(--warn-soft); }
.timer.over { color: var(--muted); background: var(--panel-2); }

/* ---------- Мастер заявки */
.wizard { max-width: 940px; }
.steps { list-style: none; padding: 0; margin: 6px 0 20px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 9px 10px; border-radius: 12px; background: var(--panel-2); cursor: pointer; min-width: 0; overflow: hidden; border: 1px solid transparent; }
.steps li span { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--text); font-weight: 700; font-size: 12px; }
.steps li.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.steps li.active span { background: var(--brand-grad); color: #fff; }
.steps li.done span { background: var(--ok); color: #fff; }
fieldset.step { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: 18px; font-weight: 700; margin-bottom: 14px; padding: 0; letter-spacing: -0.02em; }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 16px; font-size: 13.5px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; overflow-wrap: anywhere; }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.checklist li { padding: 9px 13px; border-radius: 10px; font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; }
.checklist .bad { background: var(--bad-soft); color: var(--bad); }
.checklist .miss { background: var(--warn-soft); color: var(--warn); }
.checklist .ok { background: var(--ok-soft); color: var(--ok); }
.wizard-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.cancel-row { padding: 10px; background: var(--bad-soft); border-radius: 12px; }
.cancel-row input { flex: 1; min-width: 200px; }

/* ---------- Карточка заказа: строка списка, путь, вкладки */
.order-card { padding: 0 !important; overflow: hidden; }
.order-row { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; cursor: pointer; }
.order-row:hover { background: var(--panel-2); }
.order-row .title { display: block; overflow: hidden; text-overflow: ellipsis; }
.order-row .sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-row .num { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.order-row .chev { color: var(--muted); font-size: 13px; transition: transform 0.15s ease; }
.order-card.open .chev { transform: rotate(90deg); }
.order-detail { padding: 4px 18px 18px; border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-2), var(--panel) 120px); }
.badges { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.next-step { font-weight: 600; font-size: 13px; padding: 7px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); display: inline-flex; gap: 6px; margin: 4px 0 6px; }
.next-step::before { content: "→"; }
.problem { color: var(--bad); background: var(--bad-soft); padding: 7px 12px; border-radius: 10px; font-size: 13.5px; margin: 8px 0; }
.pipeline { list-style: none; display: flex; padding: 0; margin: 14px 0 10px; counter-reset: p; overflow-x: auto; scrollbar-width: none; }
.pipeline::-webkit-scrollbar { display: none; }
.pstep { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; font-size: 11.5px; color: var(--muted); text-align: center; }
.pstep span { line-height: 1.25; overflow-wrap: anywhere; padding: 0 2px; }
.pstep::before { content: ""; position: absolute; top: 12px; left: -50%; right: 50%; height: 2px; background: var(--line-2); z-index: 0; }
.pstep:first-child::before { display: none; }
.pstep i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 800; background: var(--panel); border: 2px solid var(--line-2); z-index: 1; color: #fff; }
.pstep.done i { background: var(--ok); border-color: var(--ok); }
.pstep.done::before, .pstep.now::before { background: var(--ok); }
.pstep.now i { background: var(--panel); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.pstep.now span { color: var(--brand); font-weight: 700; }
.pstep.fail i { background: var(--bad); border-color: var(--bad); }
.pstep.fail span { color: var(--bad); font-weight: 650; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 14px 0 12px; overflow-x: auto; scrollbar-width: none; }
.tab { background: transparent; color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 12px; box-shadow: none; font-weight: 600; white-space: nowrap; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0 10px; }
.sum-item { display: flex; flex-direction: column; min-width: 0; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.sum-k { color: var(--muted); font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; }
.sum-item b { font-weight: 650; font-size: 14px; overflow-wrap: anywhere; margin-top: 2px; }
details.block { border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; background: var(--panel); }
/* Раскрывающиеся блоки — заметные кнопки-полосы со стрелкой (замечание владельца 18.11.2026: «просто слова, на которые
   нужно догадаться нажать — так не должно быть»). */
details.block > summary, .ord-details > summary, .bin-help > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; box-sizing: border-box;
  padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-2, var(--line)); background: var(--panel-2);
  color: var(--brand); font-weight: 700; font-size: 14px; cursor: pointer; list-style: none; user-select: none;
  transition: border-color .12s ease, background .12s ease; }
details.block > summary:hover, .ord-details > summary:hover, .bin-help > summary:hover { border-color: var(--brand); background: var(--brand-soft); }
details.block > summary::-webkit-details-marker, .ord-details > summary::-webkit-details-marker, .bin-help > summary::-webkit-details-marker { display: none; }
details.block > summary::after, .ord-details > summary::after, .bin-help > summary::after {
  content: "▾"; flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 13px; transition: transform .15s ease; }
details.block[open] > summary::after, .ord-details[open] > summary::after, .bin-help[open] > summary::after { transform: rotate(180deg); }
details.block > summary::before { content: none; }
details.block > :not(summary) { margin: 0 14px 12px; }
.actions-primary { margin-top: 12px; }
.actions-secondary { margin-top: 12px; }
.actions-danger { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.actions-danger > button { background: transparent; color: var(--bad); border-color: var(--bad-soft); box-shadow: none; }

/* ---------- ДЕМО */
.demo-banner { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border-radius: 16px; margin-bottom: 18px; font-size: 13.5px;
  background: linear-gradient(135deg, #fff7e6, #fff1d6); border: 1px solid #fcd34d; color: #78350f; }
.demo-banner b { background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; padding: 3px 10px; border-radius: 7px; letter-spacing: 0.08em; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .demo-banner { background: #2d2410; border-color: #92400e; color: #fde68a; }
}
/* Выбранная вручную тёмная тема (настройки пользователя). */
:root[data-theme="dark"] .demo-banner { background: #2d2410; border-color: #92400e; color: #fde68a; }
.demo-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px !important; }
.demo-card { padding: 0 !important; overflow: hidden; border-left-width: 1px !important; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.demo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.demo-hero { position: relative; padding: 16px 18px 14px; color: #fff; background: var(--grad, linear-gradient(135deg, #4f46e5, #7c3aed)); }
.demo-hero .num { position: absolute; right: 16px; top: 8px; font-size: 44px; font-weight: 900; opacity: 0.18; letter-spacing: -0.05em; }
.demo-hero .cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.85; }
.demo-hero .title { display: block; font-size: 16px; margin-top: 4px; padding-right: 40px; color: #fff; }
.demo-hero .who { font-size: 12.5px; opacity: 0.85; margin-top: 4px; }
.g-wide { --grad: linear-gradient(135deg, #0ea5e9, #6366f1); } .g-light { --grad: linear-gradient(135deg, #f59e0b, #ef4444); }
.g-signs { --grad: linear-gradient(135deg, #7c3aed, #db2777); } .g-outdoor { --grad: linear-gradient(135deg, #0f766e, #0ea5e9); }
.g-pos { --grad: linear-gradient(135deg, #ea580c, #f59e0b); } .g-print { --grad: linear-gradient(135deg, #2563eb, #0891b2); }
.g-flags { --grad: linear-gradient(135deg, #dc2626, #f97316); } .g-expo { --grad: linear-gradient(135deg, #4f46e5, #a855f7); }
.g-service { --grad: linear-gradient(135deg, #334155, #64748b); } .g-build { --grad: linear-gradient(135deg, #a16207, #ca8a04); }
.demo-body { padding: 4px 18px 16px; }
.econ { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.econ div { background: var(--panel-2); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.econ span { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.econ b { font-size: 13.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.econ .pos { color: var(--ok); }
.demo-card .facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0; font-size: 13px; }

#bind-data { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
/* Уведомление о результате действия: сверху, видно при любой прокрутке; успех — нежно-зелёное, ошибка — красное. */
.toast {
  position: fixed; left: 50%; top: calc(var(--tg-top, 0px) + 68px); transform: translateX(-50%); z-index: 80;
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(520px, calc(100vw - 32px)); box-sizing: border-box;
  padding: 12px 18px 12px 12px; border-radius: 14px; font-size: 14.5px; font-weight: 600; line-height: 1.35; cursor: pointer;
  background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; box-shadow: 0 18px 40px -16px rgba(6, 95, 70, 0.45);
  animation: toast-in .22s ease-out;
}
.toast[hidden] { display: none; }
.toast-ic { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: 14px; background: #10b981; color: #fff; }
.toast.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; box-shadow: 0 18px 40px -16px rgba(153, 27, 27, 0.4); }
.toast.error .toast-ic { background: #e11d48; }
.toast.info { background: var(--brand-soft); color: var(--text); border-color: rgba(99, 102, 241, 0.3); }
.toast.info .toast-ic { background: var(--brand); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .toast { background: #052e24; color: #a7f3d0; border-color: #065f46; }
  :root:not([data-theme="light"]) .toast.error { background: #3b0a14; color: #fecdd3; border-color: #9f1239; }
}
/* Выбранная вручную тёмная тема (настройки пользователя). */
:root[data-theme="dark"] .toast { background: #052e24; color: #a7f3d0; border-color: #065f46; }
:root[data-theme="dark"] .toast.error { background: #3b0a14; color: #fecdd3; border-color: #9f1239; }

/* ---------- Планшет и телефон */
/* ---------- T-74: документы, итоги торгов, карточка клиента, торги поставщика */
.files { margin: 14px 0 6px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.files-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.file-grid { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.file-card { display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: auto auto; gap: 6px 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.file-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; grid-row: 1 / span 2; background: var(--panel-2); }
.file-icon { width: 52px; height: 52px; grid-row: 1 / span 2; display: grid; place-items: center; border-radius: 10px; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; color: #fff; background: linear-gradient(135deg, #64748b, #475569); }
.file-icon.t-pdf { background: linear-gradient(135deg, #f43f5e, #be123c); }
.file-icon.t-doc { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.file-icon.t-xls { background: linear-gradient(135deg, #10b981, #047857); }
.file-icon.t-ppt { background: linear-gradient(135deg, #f97316, #c2410c); }
.file-icon.t-zip { background: linear-gradient(135deg, #a855f7, #6d28d9); }
.file-info { display: flex; flex-direction: column; min-width: 0; }
.file-name { font-weight: 650; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.file-actions button { white-space: nowrap; }
button.small { padding: 5px 10px; font-size: 12px; }
.file-empty { color: var(--muted); font-size: 13px; padding: 8px 2px; }
.file-drop { position: relative; margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px; border: 2px dashed rgba(99, 102, 241, 0.35); border-radius: 12px; background: var(--brand-soft); color: var(--brand); font-weight: 650; cursor: pointer; }
.file-drop:hover { border-color: var(--brand); }
.file-drop .meta { font-weight: 500; }
.file-drop-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-grad); color: #fff; }
.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

.results { margin: 10px 0; padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.results-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.results-head b { font-size: 16px; }
.results-wait, .results-empty { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; background: var(--brand-soft); }
.res-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.res-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.res-stat span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 650; }
.res-stat b { font-size: 18px; font-variant-numeric: tabular-nums; }
.res-stat small { color: var(--muted); font-size: 11.5px; }
.res-stat.good b { color: var(--ok); }
.rule-note { margin: 4px 0 10px; }
.ranking { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rank-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.rank-row > button { grid-column: 2 / -1; justify-self: start; }
.rank-row.first { border-color: rgba(16, 185, 129, 0.45); background: linear-gradient(90deg, rgba(16, 185, 129, 0.07), transparent 60%); }
.rank-row.win { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.rank-place { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.rank-row.first .rank-place { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; border: 0; }
.rank-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rank-bar { display: block; height: 6px; margin-top: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand-grad); }
.rank-row.first .rank-bar i { background: linear-gradient(90deg, #10b981, #34d399); }
.rank-price { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.rank-price b { font-size: 18px; font-variant-numeric: tabular-nums; }
.rank-price small { font-size: 12px; }
.rank-price .best { color: var(--ok); font-weight: 650; }
.rank-price .worse { color: var(--muted); }
.b-rec { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.b-muted { background: var(--panel-2); color: var(--muted); }
.decision { padding: 12px 14px; border-radius: 12px; background: var(--ok-soft); color: var(--text); margin-bottom: 12px; }

.client-view { margin-top: 14px; padding: 16px; border-radius: var(--radius); border: 1px dashed rgba(99, 102, 241, 0.4); background: var(--panel-2); }
.client-view-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.client-card { max-width: 440px; margin: 0 auto 12px; border-radius: 22px; overflow: hidden; background: #fff; color: #0f172a; box-shadow: 0 20px 50px -20px rgba(79, 70, 229, 0.45), 0 2px 8px rgba(15, 23, 42, 0.08); }
.cc-top { display: flex; align-items: center; gap: 12px; padding: 18px 20px; background: var(--brand-grad); color: #fff; }
.cc-top div { display: flex; flex-direction: column; }
.cc-top div span { opacity: 0.85; font-size: 13px; }
.cc-logo { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: rgba(255, 255, 255, 0.2); font-weight: 900; font-size: 18px; }
.cc-hello { padding: 16px 20px 4px; font-size: 14px; }
.cc-price { margin: 10px 20px; padding: 16px; border-radius: 16px; background: linear-gradient(135deg, #ecfdf5, #d1fae5); display: flex; flex-direction: column; gap: 2px; }
.cc-price span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: #047857; font-weight: 700; }
.cc-price b { font-size: 28px; color: #065f46; font-variant-numeric: tabular-nums; }
.cc-price small { color: #047857; }
.cc-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; margin: 6px 20px 10px; font-size: 13.5px; }
.cc-facts dt { color: #64748b; }
.cc-facts dd { margin: 0; font-weight: 650; text-align: right; }
.cc-next { margin: 0 20px 18px; padding: 12px 14px; border-radius: 12px; background: #f1f5f9; font-size: 13px; color: #334155; }
.cc-text { width: 100%; margin-top: 10px; font-family: inherit; }
@media print {
  body.print-client * { visibility: hidden !important; }
  body.print-client .client-card.print-me, body.print-client .client-card.print-me * { visibility: visible !important; }
  body.print-client .client-card.print-me { position: fixed; left: 0; top: 0; margin: 24px; box-shadow: none; border: 1px solid #e2e8f0; }
}

.auc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-tag { font-size: 11.5px; font-weight: 650; padding: 4px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.chip-tag.main { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.chip-tag.hot { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.auc-title { display: block; font-size: 17px; font-weight: 750; margin: 10px 0 4px; }
.bid-box { margin-top: 14px; padding: 16px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(168, 85, 247, 0.06)); border: 1px solid rgba(99, 102, 241, 0.25); }
.bid-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bid-hint { margin: 8px 0 10px; font-size: 12.5px; color: var(--muted); }
.bid-row .bid-amount { font-size: 16px; font-weight: 700; }

.res-summary { list-style: none; padding: 0; border: 0; background: none; box-shadow: none; }
.sup-result { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.res-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; font-weight: 800; background: var(--panel-2); color: var(--muted); }
.sup-result.win .res-mark { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.res-main { display: flex; flex-direction: column; min-width: 0; }
.res-badge { font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.res-badge.win { background: var(--ok-soft); color: var(--ok); }
.res-badge.lose { background: var(--panel-2); color: var(--muted); }
@media (max-width: 760px) {
  .res-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rank-row { grid-template-columns: 32px minmax(0, 1fr); }
  .rank-price { grid-column: 2; align-items: flex-start; text-align: left; }
  .sup-result { grid-template-columns: 36px minmax(0, 1fr); }
  .res-badge { grid-column: 2; justify-self: start; }
  .file-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- T-75: подписка, НДС, итоги для VIP */
.plan-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin: 0 0 14px; border-radius: 14px; background: var(--brand-soft); color: var(--text); border: 1px solid rgba(99, 102, 241, 0.25); }
.plan-banner.warn { background: var(--warn-soft); border-color: rgba(217, 119, 6, 0.35); }
.plan-banner.bad { background: var(--bad-soft); border-color: rgba(225, 29, 72, 0.35); }
.plan-hero { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 20px 22px; margin-bottom: 14px; border-radius: var(--radius); color: #fff; background: linear-gradient(135deg, #334155, #1e293b); box-shadow: var(--shadow); }
.plan-hero.p-vip { background: linear-gradient(135deg, #4f46e5, #7c3aed 55%, #c026d3); }
.plan-hero.p-basic { background: linear-gradient(135deg, #0284c7, #0ea5e9); }
.plan-hero.p-none { background: linear-gradient(135deg, #be123c, #e11d48); }
.plan-hero > div { display: flex; flex-direction: column; gap: 2px; }
.plan-hero b { font-size: 28px; letter-spacing: 0.02em; }
.plan-hero .meta { color: rgba(255, 255, 255, 0.85); }
.plan-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.8; }
.plan-chip { padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); font-weight: 650; font-size: 12.5px; }
.vat-card .switch-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; gap: 3px; }
input.switch { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background 0.15s ease; margin: 0; padding: 0; border: 0; min-width: 0; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s ease; }
input.switch:checked { background: var(--ok); }
input.switch:checked::after { transform: translateX(20px); }
.plan-period { margin: 6px 0 14px; }
.plan-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.plan-card.vip { border: 2px solid transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--brand-grad) border-box; box-shadow: 0 20px 40px -20px rgba(124, 58, 237, 0.55); }
.plan-card.current { outline: 3px solid var(--ok-soft); }
.plan-ribbon { position: absolute; top: -12px; right: 16px; padding: 4px 12px; border-radius: 999px; background: var(--brand-grad); color: #fff; font-size: 11.5px; font-weight: 750; letter-spacing: 0.03em; }
.plan-name { font-size: 15px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.plan-card.vip .plan-name { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan-price b { font-size: 30px; font-variant-numeric: tabular-nums; }
.plan-price span { color: var(--muted); }
.plan-features { list-style: none; padding: 0; margin: 6px 0 10px; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.plan-features li { display: flex; gap: 8px; align-items: flex-start; }
.plan-features i { flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; font-style: normal; font-size: 11px; font-weight: 800; background: var(--ok-soft); color: var(--ok); }
.plan-features li.off { color: var(--muted); }
.plan-features li.off i { background: var(--panel-2); color: var(--muted); }
.plan-card > button { margin-top: auto; }
.bid-locked { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--warn-soft); border: 1px solid rgba(217, 119, 6, 0.3); font-size: 13.5px; }
/* T-84: «Вы уверены?» при цене, далёкой от ставок других участников. */
.bid-warn { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin-top: 8px; padding: 14px; border-radius: 12px; background: var(--warn-soft); border: 1px solid rgba(217, 119, 6, 0.3); font-size: 13.5px; }
.bid-warn[hidden] { display: none; }
.res-full { grid-column: 2 / -1; }
.link.lock { color: var(--muted); }
.res-table { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.res-table li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); font-size: 13px; }
.res-table li.mine { background: var(--brand-soft); font-weight: 650; }
.res-table li.winner { box-shadow: inset 3px 0 0 var(--ok); }
.res-table .place { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--panel); font-weight: 750; }
.vip-mark { color: #7c3aed; }
@media (max-width: 760px) {
  .plan-cards { grid-template-columns: minmax(0, 1fr); }
  .plan-hero b { font-size: 22px; }
}

/* ---------- T-76: основатели, скидки, рекомендации */
.plan-price s { color: var(--muted); margin-right: 8px; font-size: 16px; }
.plan-discount { align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 12px; font-weight: 700; }
.founder-card { display: flex; flex-direction: column; gap: 6px; background: linear-gradient(135deg, #fffbeb, #fef3c7); border-color: #fcd34d; }
.founder-badge { align-self: flex-start; padding: 4px 12px; border-radius: 999px; background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: 0.04em; }
.referral-card .row input { flex: 1 1 160px; }
.referral-card li.ok { color: var(--ok); }

/* ---------- T-77: реквизиты, оплата, счета */
.req-card .req-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.req-checks { display: grid; gap: 10px; margin-top: 12px; }
.req-check { padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.req-check.s-ok { background: var(--ok-soft); border-color: rgba(5, 150, 105, 0.3); }
.req-check.s-warning { background: var(--warn-soft); border-color: rgba(217, 119, 6, 0.3); }
.req-check.s-mismatch, .req-check.s-not_found { background: var(--bad-soft); border-color: rgba(225, 29, 72, 0.3); }
.req-check ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; font-size: 13px; }
.req-check li { display: flex; gap: 8px; }
.req-check li i { font-style: normal; font-weight: 800; width: 16px; }
.req-check li.i-ok i { color: var(--ok); }
.req-check li.i-warning i { color: var(--warn); }
.req-check li.i-error i { color: var(--bad); }
.req-owner { margin: 6px 0; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); display: grid; gap: 4px; }
.due-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.due-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.due-row.overdue { border-color: rgba(225, 29, 72, 0.4); background: var(--bad-soft); }
.due-check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; flex: 1; min-width: 0; }
.due-check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.due-main { display: flex; flex-direction: column; min-width: 0; }
.due-sum { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.due-total { display: flex; justify-content: flex-end; gap: 8px; align-items: baseline; margin: 6px 0 12px; font-size: 18px; }
.inv-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.inv-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.inv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.inv-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.inv-badge.s-paid { background: var(--ok-soft); color: var(--ok); }
.inv-badge.s-pending { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 760px) {
  .due-row, .inv-row { flex-direction: column; align-items: stretch; }
  .inv-side { align-items: flex-start; }
}

/* ---------- T-78: компактные реквизиты, приглашения коллег */
.req-strip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin: 0 0 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.req-strip.ok { border-color: rgba(5, 150, 105, 0.35); }
.req-strip.warn { border-color: rgba(217, 119, 6, 0.45); background: var(--warn-soft); }
.req-strip.bad { border-color: rgba(225, 29, 72, 0.45); background: var(--bad-soft); }
.req-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; font-weight: 800; color: #fff; background: var(--ok); }
.req-strip.warn .req-ico { background: var(--warn); }
.req-strip.bad .req-ico { background: var(--bad); }
.req-line { display: flex; flex-direction: column; flex: 1; min-width: 200px; }
.req-details { margin: -6px 0 14px; padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.invite-box { margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--ok-soft); display: grid; gap: 8px; }
.invite-code { flex: 1; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.ref-summary { margin: 4px 0 12px; font-size: 15px; }
.ref-summary b { font-size: 22px; color: var(--ok); }
.ref-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.ref-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.ref-row .meta { flex-basis: 100%; }
.ref-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--panel); color: var(--muted); border: 1px solid var(--line); }
.ref-badge.s-rewarded { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.ref-badge.s-rejected { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.ref-badge.s-joined { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.ref-row.used { opacity: 0.7; }

@media (max-width: 1100px) {
  .workspace { margin-left: 0; }
  .sidebar { transform: translateX(-102%); transition: transform 0.22s ease; box-shadow: 0 0 60px rgba(2, 6, 23, 0.5); }
  .sidebar.open { transform: none; }
}
@media (min-width: 1101px) {
  #menu-toggle { display: none !important; }
  .scrim { display: none !important; }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  .topbar { padding: var(--tg-top) 12px 0; gap: 8px; height: calc(52px + var(--tg-top)); }
  .win-btn { width: 40px; }
  .page-title { font-size: 16px; }
  .content { padding: 14px 12px 32px; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .grid-charts { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; }
  .tile-value { font-size: 21px; }
  .tile-icon { display: none; }
  .steps li { font-size: 0; justify-content: center; padding: 6px; }
  .steps li span { font-size: 12px; }
  .summary, .demo-card .facts { grid-template-columns: minmax(0, 1fr); }
  .summary dt { margin-top: 6px; }
  .facts { grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); font-size: 13.5px; }
  .wizard-bar button { flex: 1 1 auto; justify-content: center; }
  .chip { display: none; }
  .ring, .donut-svg { width: 130px; height: 130px; }
  .hole { width: 84px; height: 84px; }
  .tiles, .tiles.small { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .order-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; padding: 12px 14px; }
  .order-row > div:first-child { grid-column: 1 / -1; }
  .order-row .hide-m { text-align: right; }
  .order-row .chev { display: none; }
  .pstep span { display: none; }
  .pstep.now span, .pstep.fail span { display: block; white-space: nowrap; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .econ { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .period-bar select { flex: 1; }
  .pstep { min-width: 0; font-size: 10px; }
}

/* ---------- T-79: «Заказы в работе» — сводка, карточка заказа, шаги, деньги, цена, ТЗ */
.ord-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
.ord-stat { display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.ord-stat b { font-size: 1.35em; }
.ord-stat span { color: var(--muted); font-size: .9em; }
.ord-stat button { margin-top: 6px; align-self: flex-start; }
.ord-stat.t-act { border-color: var(--brand); background: var(--brand-soft); }
.ord-stat.t-due { border-color: var(--warn); background: var(--warn-soft); }
.ord-stat.t-bad { border-color: var(--bad); background: var(--bad-soft); }
.ord-stat.t-ok b { color: var(--ok); }
.ord-card { display: flex; flex-direction: column; gap: 12px; }
.ord-card.st-awarded { border-left: 4px solid var(--brand); }
.ord-card.st-commission { border-left: 4px solid var(--warn); }
.ord-card.st-in_work { border-left: 4px solid var(--info); }
.ord-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ord-badge { font-size: .8em; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.ord-badge.t-act { background: var(--brand); color: #fff; }
.ord-badge.t-work { background: var(--info-soft); color: var(--info); }
.ord-badge.t-wait { background: var(--warn-soft); color: var(--warn); }
.ord-badge.t-due { background: var(--warn); color: #fff; }
.ord-badge.t-ok { background: var(--ok-soft); color: var(--ok); }
.ord-badge.t-bad { background: var(--bad-soft); color: var(--bad); }
.ord-badge.t-off { background: var(--line); color: var(--muted); }
.ord-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ord-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ord-title .title { font-weight: 700; font-size: 1.05em; }
.ord-due { font-size: .9em; color: var(--muted); }
.ord-due.warn { color: var(--warn); font-weight: 600; }
.ord-due.bad { color: var(--bad); font-weight: 700; }
.ord-sum { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 2px; flex-shrink: 0; }
.ord-price { font-weight: 800; font-size: 1.25em; white-space: nowrap; }
.ord-next { display: flex; flex-direction: column; gap: 10px; background: var(--brand-soft); border-radius: 12px; padding: 12px 14px; }
.ord-next > span { font-weight: 600; }
.ord-actions { flex-wrap: wrap; gap: 8px; align-items: center; }
.ord-actions input { flex: 1 1 240px; }
.ord-warn { flex-basis: 100%; color: var(--warn); font-weight: 600; }
.ord-msg { color: var(--bad); font-weight: 600; }
.ord-contact { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); }
.ord-contact a { font-weight: 700; color: var(--brand); }
.ord-money { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--line); }
.ord-money > div { display: flex; flex-direction: column; gap: 2px; }
.ord-money.due { border-style: solid; border-color: var(--warn); background: var(--warn-soft); }
.ord-money.ok { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.ord-pricebox { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); }
.ord-pricebox .row { flex-wrap: wrap; gap: 8px; }
.ord-pricebox input { flex: 1 1 200px; }
.ord-note { color: var(--warn); font-weight: 600; }
.pc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pc-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; }
.ord-details[open] > summary { margin-bottom: 10px; }
.ord-details .files { margin-top: 10px; }
.ord-empty { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 22px !important; }
.due-row.expected { opacity: .8; }
@media (max-width: 720px) {
  .ord-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ord-summary .ord-stat:last-child { grid-column: 1 / -1; }
  .ord-head { flex-direction: column; gap: 6px; }
  .ord-sum { align-items: flex-start; text-align: left; }
}

/* T-81: выбор языка флагами */
.lang-host { display: inline-flex; }
/* T-85: язык — одна кнопка (флаг и название) и выпадающий список. */
.lang-switch { position: relative; display: inline-flex; }
.lang-cur {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; min-height: 0; padding: 0 10px 0 8px; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--panel); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; box-shadow: none; white-space: nowrap;
}
.lang-cur:hover, .lang-switch.open .lang-cur { background: var(--brand-soft); color: var(--text); }
.lang-caret { font-size: 10px; color: var(--muted); }
.lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; min-width: 180px; max-width: calc(100vw - 24px); padding: 6px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.28);
}
.lang-menu[hidden] { display: none; }
.lang-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 550; text-align: left; cursor: pointer; box-shadow: none;
}
.lang-opt:hover, .lang-opt:focus-visible { background: var(--brand-soft); outline: none; }
.lang-opt span:first-of-type { flex: 1; }
.lang-tick { visibility: hidden; color: var(--brand); font-weight: 700; }
.lang-opt.active .lang-tick { visibility: visible; }
.lang-switch .flag { width: 22px; height: 15px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15); flex: none; }
@media (max-width: 760px) {
  .lang-name { display: none; }
  .lang-cur { padding: 0 8px; gap: 5px; }
  .icon-btn { padding: 0 9px; font-size: 13px; }
  .role-switch button { padding: 0 9px; font-size: 11.5px; }
}
/* Телефон: шапка помещается в 320 px — у «Меню» только значок, кнопки окна и роли компактнее. */
@media (max-width: 480px) {
  .topbar { gap: 6px; }
  #menu-toggle { font-size: 0; padding: 0; width: 34px; display: inline-flex; align-items: center; justify-content: center; }
  #menu-toggle::before { content: "≡"; font-size: 18px; line-height: 1; }
  .page-title { display: none; }
  .win-ctl { margin-left: 0; }
  .win-btn { width: 34px; }
  .role-switch button { padding: 0 7px; font-size: 11px; }
}
@media (max-width: 360px) {
  .topbar { gap: 4px; padding-left: 8px; padding-right: 8px; }
  .lang-caret { display: none; }
  .lang-cur { padding: 0 7px; }
  .role-switch button { padding: 0 5px; }
}
/* Телефон: список языков — во всю ширину под верхней строкой, не выходит за края экрана. */
@media (max-width: 520px) {
  .lang-switch { position: static; }
  .lang-menu { position: absolute; top: calc(100% + 4px); left: 12px; right: 12px; min-width: 0; max-width: none; }
  .lang-opt { min-height: 46px; font-size: 15px; }
}

/* T-81: подробности показателей и таблицы «кто что выполняет» */
.drill { border-left: 3px solid var(--brand); }
.drill-table .filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.drill-table .filters input { flex: 1 1 220px; min-width: 0; }
.table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table th.sortable:hover { color: var(--brand); }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table td.neg { color: #dc2626; }
.table tfoot th { border-top: 2px solid var(--line-2, var(--line)); font-weight: 700; }
.table tr.clickable { cursor: pointer; }
#dash-income h4, #dash-work h4 { margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
/* T-70: подсказка «Где найти БИН?» в регистрации подрядчика. */
.bin-help { border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 12px; background: var(--panel-2); font-size: 13px; }

.bin-help ul { margin: 8px 0 2px; padding-left: 18px; display: grid; gap: 4px; color: var(--text-2); }
#reg-bin-note:empty { display: none; }
#reg-bin-note.bad { color: var(--bad, #c62828); }
/* T-85: удаление профиля подрядчика — отдельная «опасная» карточка внизу главной. */
.danger-zone { border-color: color-mix(in srgb, #e81123 35%, var(--line-2)); }
.danger-zone h3 { color: #c62828; }
button.danger { background: #e81123; color: #fff; border-color: #e81123; }
button.danger:disabled { opacity: 0.45; }
/* T-85: приглашение подрядчика вверху главной: ссылка и готовое письмо. */
.invite-card { border-color: color-mix(in srgb, var(--brand) 30%, var(--line-2)); }
.invite-ic { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-right: 6px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-size: 15px; vertical-align: middle; }
.invite-letter { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; line-height: 1.45; resize: vertical; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; color: var(--text-2); }
#invite-home, #inv-token { display: grid; gap: 8px; }
/* T-85: сообщение стартового скрипта (кабинет не запустился / сервер не отвечает). */
.status.boot-warn { display: block; color: #b45309; background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; }
.status.boot-warn p { margin: 8px 0; } .status.boot-warn a { font-weight: 700; }
/* T-85: гостевая страница — вкладки «Аукционы», «Как это работает», «Регистрация». */
.guest-bar { display: grid; gap: 8px; margin-bottom: 14px; }
.guest-bar .segmented { justify-self: start; max-width: 100%; overflow-x: auto; }
.guest-invited { color: var(--ok, #15803d); font-weight: 600; }
.guest-steps { margin: 6px 0 10px; padding-left: 20px; display: grid; gap: 6px; }
/* T-85: поле с ошибкой — красная рамка и подсказка под полем. */
input.invalid, select.invalid, textarea.invalid { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important; }
.field.has-err > span:first-child { color: #dc2626; }
.field-err, .field .field-err { display: block; margin-top: 4px; color: #dc2626 !important; font-size: 12.5px !important; font-weight: 600 !important; }
/* T-85: мониторинг биржи вверху главной — шесть компактных плиток. */
.market-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 14px; }
.market-tiles .tile { padding: 12px 14px; cursor: default; }
.market-tiles .tile-value { font-size: 22px; }
.market-tiles .tile.online .tile-icon { color: #16a34a; }
@media (max-width: 1100px) { .market-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .market-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .market-tiles .tile-hint { display: none; } }

/* T-85: подрядчик в списке раскрывается по нажатию; охват торгов в карточке заказа. */
.sup-item > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-start; }
.sup-item > summary::-webkit-details-marker { display: none; }
.sup-item > summary::before { content: "▸"; color: var(--muted, #888); }
.sup-item[open] > summary::before { content: "▾"; }
.sup-more { margin-top: 8px; display: grid; gap: 6px; }
.sup-activity .list li.ok { color: var(--ok, #1a7f37); }
.reach-line { margin: 6px 0; }

/* T-87: фильтр торгов подрядчика и «Мои регионы и направления». */
.auction-filter { display: grid; gap: 6px; list-style: none; padding: 4px 0 8px; }
.auction-filter select { min-width: 0; max-width: 100%; }
.auction-filter .chk, .coverage-edit .chk { display: inline-flex; gap: 6px; align-items: center; }
.coverage-edit { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line, #dfe4ee); border-radius: 12px; }
.coverage-edit .checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.new-auctions { width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--accent, #3b4fd8); color: #fff; font-weight: 700; cursor: pointer; }
/* T-87: компактная карточка торгов — подробности и ставка по нажатию. */
.auction-card.compact > .auc-title { margin-top: 10px; font-size: 16px; }
.auction-card .auc-mine { margin: 4px 18px 0; font-size: 13px; color: var(--muted); }
.auction-card .auc-toggle { margin: 10px 18px 14px; align-self: flex-start; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface, #fff); color: var(--brand, #3b4fd8); font-weight: 700; cursor: pointer; }
.auction-card .auc-details { display: grid; gap: 10px; padding-bottom: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.auction-card .auc-details[hidden] { display: none; }
.auction-card .auc-details > * { margin-left: 18px; margin-right: 18px; }
.auction-card .auc-details > .facts { margin: 0 18px; }

/* T-87: торги как папки — короткая карточка, переход внутрь и «Назад»; поиск, сортировка и фильтры-«таблетки». */
.auction-filter { position: sticky; top: calc(var(--top) + var(--tg-top)); z-index: 5; background: var(--bg, #f6f7fb); padding: 6px 0 10px; }
/* Телефон: фильтр торгов не закрепляется — верх экрана свободен (T-88 Ф0). */
@media (max-width: 760px) { .auction-filter { position: static; } }
.on-phone .win-ctl { display: none !important; }
.auc-search-row { display: flex; gap: 8px; align-items: center; }
.auc-search { flex: 1; min-width: 0; height: 44px; padding: 0 14px 0 40px; border-radius: 14px; border: 1px solid var(--line-2, var(--line)); background: var(--panel, #fff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center; color: var(--text, inherit); font: inherit; }
.auc-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2, var(--line)); background: var(--panel, #fff); color: var(--text, inherit); font: 600 13.5px/1 inherit; white-space: nowrap; cursor: pointer; }
.pill.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.pill.icon { width: 44px; height: 44px; justify-content: center; padding: 0; font-size: 18px; border-radius: 14px; }
.pill.reset { height: 30px; font-size: 12.5px; }
.pill-k { color: var(--muted); font-weight: 500; }
.pill.on .pill-k { color: inherit; opacity: .75; }
.pill-select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; padding: 0 16px 0 0; cursor: pointer; max-width: 46vw; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2364748b' d='M0 0h10L5 6z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right center; }
.pill-select:focus { outline: none; }
.auc-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.auc-count { color: var(--muted); font-size: 13px; }
.auction-card.compact { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.auction-card.compact:not(.opened):hover { transform: translateY(-1px); box-shadow: 0 10px 24px -14px rgba(79, 70, 229, .45); }
.auction-card.opened { cursor: default; overflow: visible; } /* иначе «Все торги» не закрепляется сверху */
.auction-card .auc-head { display: flex; flex-direction: column; }
.auction-card .auc-open { margin: 10px 18px 14px; align-self: flex-start; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line-2, var(--line)); background: var(--panel, #fff); color: var(--brand); font-weight: 700; cursor: pointer; }
/* «Назад» в открытых торгах — заметная кнопка (рамка, тень, 44 px), закреплена сверху при прокрутке. */
.auction-card .auc-back { position: sticky; top: calc(var(--tg-top, 0px) + 60px); z-index: 6; margin: 12px 18px 0; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px 0 10px; border-radius: 12px;
  border: 1px solid var(--line-2, var(--line)); background: var(--panel, #fff); color: var(--text); font-weight: 700; font-size: 15px;
  box-shadow: 0 8px 22px -12px rgba(15, 23, 42, 0.35); cursor: pointer; }
.auction-card .auc-back:hover { border-color: var(--brand); color: var(--brand); }
.auc-back-ic { font-size: 24px; line-height: 1; margin-top: -2px; color: var(--brand); }
.auction-card .auc-open[hidden], .auction-card .auc-back[hidden] { display: none; }
.auc-back-bottom { display: none; }
.auction-card.opened .auc-back-bottom { display: flex; align-items: center; justify-content: center; gap: 6px; width: calc(100% - 36px); min-height: 48px;
  margin: 16px 18px 18px; border-radius: 12px; border: 1px solid var(--line-2, var(--line)); background: var(--panel-2); color: var(--text); font-weight: 700; font-size: 15px; cursor: pointer; }
/* Текущая ставка — зелёный блок в форме; ошибка — красным под полем; сумма прописью — под полем. */
.bid-current { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0; padding: 12px 14px; border-radius: 12px;
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.bid-current[hidden] { display: none; }
.bid-current > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.bid-current .meta { color: #047857; }
.bid-current-ic { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #10b981; color: #fff; font-weight: 800; }
.bid-err { margin-top: 6px; color: #be123c; font-size: 13.5px; font-weight: 600; }
.bid-err[hidden], .bid-preview[hidden] { display: none; }
.bid-preview { margin-top: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bid-send { min-height: 48px; padding: 0 22px; font-size: 15px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bid-current { background: #052e24; border-color: #065f46; color: #a7f3d0; }
  :root:not([data-theme="light"]) .bid-current .meta { color: #6ee7b7; }
}
/* Выбранная вручную тёмная тема (настройки пользователя). */
:root[data-theme="dark"] .bid-current { background: #052e24; border-color: #065f46; color: #a7f3d0; }
:root[data-theme="dark"] .bid-current .meta { color: #6ee7b7; }
@media (prefers-reduced-motion: reduce) { .auction-card.compact { transition: none; } }

/* T-88 Ф0: центр уведомлений — колокольчик в шапке, число непрочитанных, список. */
.bell { position: relative; flex: none; width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line-2, var(--line)); background: var(--panel, #fff); color: var(--text, inherit); cursor: pointer; }
.bell-ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bell-n { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e11d48; color: #fff; font: 700 11px/18px system-ui, sans-serif; text-align: center; }
.bell-n[hidden] { display: none; }
.inbox-panel { margin-bottom: 14px; }
.inbox-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.inbox-item { cursor: pointer; }
.inbox-item.unread { border-left: 3px solid var(--brand); font-weight: 600; }
/* T-88 Ф1: вход по телефону или почте (без Telegram). */
.otp-login { max-width: 460px; margin: 24px auto; display: grid; gap: 12px; }
.otp-brand { display: flex; align-items: center; gap: 12px; }
.otp-brand h2 { margin: 0; }
.otp-brand .meta { font-size: 13px; }
.otp-login .row input { flex: 1; min-width: 0; }
/* T-88 Ф3: нижняя панель главных разделов на телефоне (сайт, приложение и Telegram). */
.tabbar { display: none; }
@media (max-width: 760px) {
  .tabbar:not([hidden]) { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--panel); border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px -16px rgba(15, 23, 42, 0.35); }
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: 4px 2px; border: 0; border-radius: 12px;
    background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; box-shadow: none; min-height: 48px; }
  .tab i { font-style: normal; font-size: 18px; line-height: 1.2; }
  .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab.active { color: var(--brand); background: var(--brand-soft); }
  .tab em { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 999px;
    background: var(--brand); color: #fff; font-style: normal; font-size: 10.5px; line-height: 18px; text-align: center; }
  .tab em.warn { background: var(--bad, #e11d48); }
  .tab em[hidden] { display: none; }
  body.has-tabbar .content { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media print { .tabbar { display: none !important; } }
/* Настройки и уведомления (указание владельца 18.11.2026). */
.set-card h3 { margin: 0 0 4px; }
.set-card > .meta { margin: 0 0 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.set-label { font-weight: 700; }
.set-card .segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.set-card .segmented button { min-height: 38px; padding: 0 14px; border-radius: 9px; border: 0; background: transparent; color: var(--text-2); font-weight: 650; box-shadow: none; }
.set-card .segmented button.active { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 16px -8px rgba(124, 58, 237, .7); }
.set-switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.set-switch input.switch { order: 2; flex: none; }
.set-switch > span { display: flex; flex-direction: column; gap: 2px; }
.set-open { min-height: 40px; }
.set-channel { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.set-channel > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.set-channel.off { opacity: .6; }
.set-ch-ic { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); font-size: 17px; }
.coverage-editor { padding: 10px 0; }
.coverage-editor[hidden] { display: none; }
@media (max-width: 760px) { .set-row { flex-direction: column; align-items: stretch; } .set-card .segmented { display: flex; } .set-card .segmented button { flex: 1; } }

/* Список → карточка (замечание владельца 18.11.2026): различимые строки и кнопки «Назад». */
.f-row { list-style: none; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; gap: 12px; align-items: center;
  margin: 0 0 10px; padding: 14px 14px 14px 20px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow); cursor: pointer; overflow: hidden; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.f-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--f-tone, #94a3b8); }
.f-row:hover, .f-row:focus-visible { border-color: var(--f-tone, var(--brand)); transform: translateY(-1px); box-shadow: 0 12px 26px -16px rgba(79, 70, 229, .5); outline: none; }
.f-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.f-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-title { font-size: 15.5px; line-height: 1.3; color: var(--text); overflow-wrap: anywhere; }
.f-sub { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: 13px; color: var(--text-2); }
.f-sub-item.warn { color: #b45309; font-weight: 700; }
.f-sub-item.bad { color: #be123c; font-weight: 700; }
.f-dot { color: var(--muted); }
.f-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.f-badge { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--f-tone, var(--muted)); background: var(--f-soft, var(--panel-2)); }
.f-amount { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.f-chev { font-size: 26px; color: var(--muted); line-height: 1; }
.t-act { --f-tone: #4f46e5; --f-soft: color-mix(in srgb, #4f46e5 15%, transparent); }
.t-work { --f-tone: #0284c7; --f-soft: color-mix(in srgb, #0284c7 15%, transparent); }
.t-wait { --f-tone: #7c3aed; --f-soft: color-mix(in srgb, #7c3aed 15%, transparent); }
.t-due { --f-tone: #d97706; --f-soft: color-mix(in srgb, #d97706 15%, transparent); }
.t-bad { --f-tone: #e11d48; --f-soft: color-mix(in srgb, #e11d48 15%, transparent); }
.t-ok { --f-tone: #059669; --f-soft: color-mix(in srgb, #059669 15%, transparent); }
.t-off { --f-tone: #64748b; --f-soft: color-mix(in srgb, #64748b 15%, transparent); }
.f-backbar { list-style: none; margin: 0 0 12px; background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
.f-backbar:not(.bottom) { position: sticky; top: calc(var(--tg-top, 0px) + 60px); z-index: 6; }
.f-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px 0 10px; border-radius: 12px;
  border: 1px solid var(--line-2, var(--line)); background: var(--panel); color: var(--text); font-weight: 700; font-size: 15px;
  box-shadow: 0 8px 22px -12px rgba(15, 23, 42, .35); cursor: pointer; }
.f-back:hover { border-color: var(--brand); color: var(--brand); }
.f-back-ic { font-size: 24px; line-height: 1; margin-top: -2px; color: var(--brand); }
.f-back-bottom { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 48px; border-radius: 12px;
  border: 1px solid var(--line-2, var(--line)); background: var(--panel-2); color: var(--text); font-weight: 700; font-size: 15px; cursor: pointer; }
@media (max-width: 760px) {
  .f-row { grid-template-columns: minmax(0, 1fr) 14px; padding: 12px 12px 12px 18px; }
  .f-side { grid-column: 1; grid-row: 2; flex-direction: row; align-items: center; justify-content: space-between; text-align: left; }
  .f-chev { grid-column: 2; grid-row: 1 / span 2; }
}
/* Окно поверх страницы: по центру на компьютере, панелью снизу на телефоне. */
.modal-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); animation: fade-in .15s ease; }
.modal-scrim[hidden], .modal[hidden] { display: none; }
.modal { position: fixed; z-index: 91; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 64px);
  display: flex; flex-direction: column; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 30px 80px -20px rgba(2, 6, 23, .55); animation: modal-in .18s ease-out; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-x { width: 40px; height: 40px; min-height: 0; padding: 0; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line-2, var(--line)); background: var(--panel-2); color: var(--text); font-size: 16px; box-shadow: none; }
.modal-body { padding: 16px 18px 18px; overflow: auto; }
body.modal-on { overflow: hidden; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@media (max-width: 760px) {
  .modal { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: 100%; max-height: 88vh; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); animation: sheet-in .2s ease-out; }
  @keyframes sheet-in { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) { .modal, .modal-scrim { animation: none; } }
/* Крупный текст (настройки пользователя). */
:root[data-text="large"] .content, :root[data-text="large"] .tabbar, :root[data-text="large"] .toast { zoom: 1.12; }
/* Открыта карточка заказа — фильтры и счётчик списка скрыты (вернуться — «‹ Все заказы»). */
#sec-orders:has(#order-list.f-open) #order-filter, #sec-orders:has(#order-list.f-open) #order-count { display: none; }
.f-open > .order-card > .order-row { cursor: default; }
