/* =====================================================================
   АвтоКит — дополнения к дизайн-системе КИТ (style.css скелета)
   ===================================================================== */

/* Широкая рабочая область под таблицы автосалона */
main { max-width: 1400px; }
.topbar-inner { max-width: 1400px; gap: 18px; height: auto; min-height: 56px; padding-top: 6px; padding-bottom: 6px; }
.nav-links { row-gap: 2px; }
.nav-links { flex-wrap: wrap; }
.nav-links a { padding: 7px 11px; }

/* выпадающие подменю в шапке */
.nav-drop { position: relative; }
.nav-drop-menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 220px; z-index: 30;
  background: var(--surface-1); border: 1px solid var(--modal-ring); border-radius: 10px;
  padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.nav-drop:hover .nav-drop-menu, .nav-drop:focus-within .nav-drop-menu { display: block; }
.nav-drop-menu a { display: block; border-radius: 6px; }

/* заголовок страницы с действиями справа */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; font-weight: 600; margin: 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-head .actions form { margin: 0; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 12px; }

/* --- Зонирование (стиль Кит): вензельные углы, яркая обводка, цветной фон.
   Эталон — C:\py\Make1s\static\style.css (section.card + ::before). --- */
:root {
  --vz-tl: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M64 1.6L18 1.6C9 1.6 1.6 9 1.6 18L1.6 64M6 6C14 9 18 15 17 22C16.5 26 12.5 27.5 10 25M6 6C9 14 15 18 22 17C26 16.5 27.5 12.5 25 10M30 1.6C31 8 27 11 22 9.5M1.6 30C8 31 11 27 9.5 22'/></svg>");
  --vz-tr: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><g transform='translate(64 0) scale(-1 1)'><path d='M64 1.6L18 1.6C9 1.6 1.6 9 1.6 18L1.6 64M6 6C14 9 18 15 17 22C16.5 26 12.5 27.5 10 25M6 6C9 14 15 18 22 17C26 16.5 27.5 12.5 25 10M30 1.6C31 8 27 11 22 9.5M1.6 30C8 31 11 27 9.5 22'/></g></svg>");
  --vz-bl: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><g transform='translate(0 64) scale(1 -1)'><path d='M64 1.6L18 1.6C9 1.6 1.6 9 1.6 18L1.6 64M6 6C14 9 18 15 17 22C16.5 26 12.5 27.5 10 25M6 6C9 14 15 18 22 17C26 16.5 27.5 12.5 25 10M30 1.6C31 8 27 11 22 9.5M1.6 30C8 31 11 27 9.5 22'/></g></svg>");
  --vz-br: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><g transform='translate(64 64) scale(-1 -1)'><path d='M64 1.6L18 1.6C9 1.6 1.6 9 1.6 18L1.6 64M6 6C14 9 18 15 17 22C16.5 26 12.5 27.5 10 25M6 6C9 14 15 18 22 17C26 16.5 27.5 12.5 25 10M30 1.6C31 8 27 11 22 9.5M1.6 30C8 31 11 27 9.5 22'/></g></svg>");
}
section.card {
  --vz-size: 42px;
  --vz-gap: var(--vz-size);
  --vz-line-w: calc(var(--vz-size) / 40);
  --vz-inset: calc(var(--vz-size) / 80);
  --vz-vshift: 0px;
  position: relative;
  border: none;
  border-radius: 0;
  padding: 18px 22px 20px;
  --vz-line: linear-gradient(var(--sect-border, var(--border)), var(--sect-border, var(--border)));
  background:
    var(--vz-line) no-repeat center top var(--vz-inset)    / calc(100% - 2 * var(--vz-gap)) var(--vz-line-w),
    var(--vz-line) no-repeat center bottom var(--vz-inset) / calc(100% - 2 * var(--vz-gap)) var(--vz-line-w),
    var(--vz-line) no-repeat left calc(var(--vz-inset) + var(--vz-vshift)) center           / var(--vz-line-w) calc(100% - 2 * var(--vz-gap)),
    var(--vz-line) no-repeat right max(0px, calc(var(--vz-inset) - var(--vz-vshift))) center / var(--vz-line-w) calc(100% - 2 * var(--vz-gap)),
    var(--sect-bg, var(--surface-1));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 0 12px -4px var(--sect-glow, transparent);
}
section.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-color: var(--sect-border, var(--border));
  -webkit-mask-image: var(--vz-tl), var(--vz-tr), var(--vz-bl), var(--vz-br);
          mask-image: var(--vz-tl), var(--vz-tr), var(--vz-bl), var(--vz-br);
  -webkit-mask-position: top left, top right, bottom left, bottom right;
          mask-position: top left, top right, bottom left, bottom right;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: var(--vz-size) var(--vz-size); mask-size: var(--vz-size) var(--vz-size);
}
section.card > * { position: relative; z-index: 1; }
section.card > h2 {
  padding-bottom: 8px; margin-bottom: 12px;
  border-bottom: 2px solid var(--sect-border, var(--border));
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
section.card > h2 .h-actions { display: flex; gap: 6px; font-weight: 400; }
section.card.sect-blue   { --sect-border: rgba(30,110,215,0.98);  --sect-bg: rgba(42,120,214,0.16);  --sect-glow: rgba(42,120,214,0.28); }
section.card.sect-green  { --sect-border: rgba(0,140,50,0.98);    --sect-bg: rgba(27,175,122,0.18);  --sect-glow: rgba(27,175,122,0.28); }
section.card.sect-amber  { --sect-border: rgba(220,140,0,1);      --sect-bg: rgba(237,161,0,0.20);   --sect-glow: rgba(237,161,0,0.30); }
section.card.sect-slate  { --sect-border: rgba(70,95,135,0.98);   --sect-bg: rgba(109,127,150,0.18); --sect-glow: rgba(109,127,150,0.26); }
section.card.sect-violet { --sect-border: rgba(130,60,200,0.98);  --sect-bg: rgba(140,80,210,0.15);  --sect-glow: rgba(140,80,210,0.28); }
section.card.sect-red    { --sect-border: rgba(200,50,50,0.98);   --sect-bg: rgba(227,73,72,0.14);   --sect-glow: rgba(227,73,72,0.28); }
section.card.sect-aqua   { --sect-border: rgba(0,150,160,0.98);   --sect-bg: rgba(27,175,175,0.16);  --sect-glow: rgba(27,175,175,0.28); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) section.card.sect-blue { --sect-border: rgba(110,165,255,1);   --sect-bg: rgba(42,120,214,0.28);  --sect-glow: rgba(90,150,255,0.30); }
  :root:not([data-theme="light"]) section.card.sect-green { --sect-border: rgba(90,225,160,1);    --sect-bg: rgba(27,175,122,0.28);  --sect-glow: rgba(80,210,150,0.28); }
  :root:not([data-theme="light"]) section.card.sect-amber { --sect-border: rgba(255,210,100,1);   --sect-bg: rgba(237,161,0,0.26);   --sect-glow: rgba(255,205,90,0.30); }
  :root:not([data-theme="light"]) section.card.sect-slate { --sect-border: rgba(165,185,215,1);   --sect-bg: rgba(109,127,150,0.28); --sect-glow: rgba(150,170,200,0.26); }
  :root:not([data-theme="light"]) section.card.sect-violet { --sect-border: rgba(190,140,255,1);   --sect-bg: rgba(140,80,210,0.26);  --sect-glow: rgba(190,140,255,0.30); }
  :root:not([data-theme="light"]) section.card.sect-red { --sect-border: rgba(255,140,140,1);   --sect-bg: rgba(227,73,72,0.24);   --sect-glow: rgba(255,140,140,0.30); }
  :root:not([data-theme="light"]) section.card.sect-aqua { --sect-border: rgba(110,225,230,1);   --sect-bg: rgba(27,175,175,0.26);  --sect-glow: rgba(110,225,230,0.30); }
}
/* ручной выбор тёмной темы (кнопка в шапке) — те же значения */
:root[data-theme="dark"] section.card.sect-blue { --sect-border: rgba(110,165,255,1);   --sect-bg: rgba(42,120,214,0.28);  --sect-glow: rgba(90,150,255,0.30); }
:root[data-theme="dark"] section.card.sect-green { --sect-border: rgba(90,225,160,1);    --sect-bg: rgba(27,175,122,0.28);  --sect-glow: rgba(80,210,150,0.28); }
:root[data-theme="dark"] section.card.sect-amber { --sect-border: rgba(255,210,100,1);   --sect-bg: rgba(237,161,0,0.26);   --sect-glow: rgba(255,205,90,0.30); }
:root[data-theme="dark"] section.card.sect-slate { --sect-border: rgba(165,185,215,1);   --sect-bg: rgba(109,127,150,0.28); --sect-glow: rgba(150,170,200,0.26); }
:root[data-theme="dark"] section.card.sect-violet { --sect-border: rgba(190,140,255,1);   --sect-bg: rgba(140,80,210,0.26);  --sect-glow: rgba(190,140,255,0.30); }
:root[data-theme="dark"] section.card.sect-red { --sect-border: rgba(255,140,140,1);   --sect-bg: rgba(227,73,72,0.24);   --sect-glow: rgba(255,140,140,0.30); }
:root[data-theme="dark"] section.card.sect-aqua { --sect-border: rgba(110,225,230,1);   --sect-bg: rgba(27,175,175,0.26);  --sect-glow: rgba(110,225,230,0.30); }
/* Сетка зон: две колонки на широких экранах */
.zones { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 18px; align-items: start; margin-bottom: 18px; }
.zones > section { margin-bottom: 0; }
.zones .span2 { grid-column: 1 / -1; }

/* --- Формы: подпись СЛЕВА от поля в одну строку (стиль Кит, эталон Make1s) --- */
.frow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.frow .flabel { flex: 0 0 200px; min-width: 200px; white-space: nowrap; font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; }
.frow .fctl { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: center; position: relative; }
.frow input[type=text], .frow input[type=number], .frow input[type=date], .frow input[type=search],
.frow input[type=password], .frow input[type=email], .frow input[type=file], .frow select, .frow textarea {
  width: 100%; background: var(--page-plane); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; font-size: 13px; color: var(--text-primary); font-family: inherit;
}
.frow input:focus, .frow select:focus, .frow textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.frow input.num { text-align: right; font-variant-numeric: tabular-nums; }
.frow .chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.frow .unit { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.frow input[readonly] { color: var(--text-muted); }
.narrow .frow .flabel { flex-basis: 150px; min-width: 150px; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.form-actions .btn + .btn { margin-left: 0; }
.vin-hint { font-size: 11.5px; margin: -4px 0 8px 210px; }
.vin-hint.ok { color: var(--status-good); }
.vin-hint.warn { color: #b26a00; }
.vin-hint.err { color: var(--status-critical); }
.lookup-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 40; background: var(--surface-1);
  border: 1px solid var(--modal-ring); border-radius: 8px; max-height: 260px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.lookup-item { padding: 7px 10px; cursor: pointer; font-size: 13px; }
.lookup-item:hover { background: var(--page-plane); }

/* --- Таблицы: курсор, совпадения поиска (эталон grafost) --- */
table.rows tbody tr { cursor: default; }
table.rows tbody tr:hover td { background: rgba(42,120,214,0.06); }
table.rows tbody tr.match td { background: rgba(240,190,0,0.22); }
table.rows tbody tr.cursor td { background: rgba(42,120,214,0.20); }
table.rows tbody tr.cursor.match td { background: rgba(240,190,0,0.32); }
table.rows tbody tr.cursor td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.rows tbody tr[data-href], table.rows tbody tr[data-modal-open] { cursor: pointer; }
table.rows td.num, table.rows th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.rows tfoot td { padding: 10px; font-weight: 600; border-top: 2px solid var(--gridline); }
table.compact td, table.compact th { padding: 6px 8px; }
.table-filter { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.table-filter input[type=search] {
  width: 320px; max-width: 100%; background: var(--page-plane); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; font-size: 13px; color: var(--text-primary);
}
.table-filter input[type=search]:focus { outline: none; border-color: var(--accent); }
.filter-label {
  background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
  font-size: 12.5px; color: var(--text-secondary); cursor: pointer;
}
.filter-label.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-count { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; min-width: 80px; }

/* бейджи статусов */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; color: #fff; }
.badge-blue { background: var(--slot-blue); }
.badge-green { background: var(--slot-green); }
.badge-amber { background: var(--slot-yellow); }
.badge-aqua { background: var(--slot-aqua); }
.badge-violet { background: var(--slot-violet); }
.badge-red { background: var(--slot-red); }
.badge-slate { background: #6d7f96; }
.badge.lite { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); font-weight: 500; }

/* фильтр-чипсы над списком */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chips a { text-decoration: none; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; }
.chips a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.chips a .n { opacity: 0.7; margin-left: 4px; }

/* карточка: подпись/значение */
.kv { display: flex; gap: 8px; padding: 3px 0; font-size: 13px; border-bottom: 1px dashed rgba(128,128,128,0.15); }
.kv:last-child { border-bottom: none; }
.kv-l { flex: 0 0 200px; color: var(--text-muted); }
.kv-v { flex: 1; word-break: break-word; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.big-price { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.price-pos { color: var(--status-good); }
.price-neg { color: var(--status-critical); }
.car-title { font-size: 22px; font-weight: 700; margin: 0; }
.car-sub { color: var(--text-secondary); font-size: 13px; margin: 2px 0 0; }
.car-vin { font-family: ui-monospace, Consolas, monospace; font-size: 15px; letter-spacing: 0.08em; }

/* фотографии */
.photos { display: flex; flex-wrap: wrap; gap: 10px; }
.photo { position: relative; width: 180px; }
.photo img { width: 180px; height: 130px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.photo form { position: absolute; top: 4px; right: 4px; margin: 0; }
.thumb { width: 72px; height: 52px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }

/* модалка-форма */
.modal.wide { width: 860px; }
.modal-body { padding: 4px 16px 16px; }
.modal-body .frow .flabel { flex-basis: 170px; min-width: 170px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 16px 16px; }

/* чек-лист приёмки */
.checklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.checklist h4 { margin: 0 0 6px; font-size: 13px; }
.checklist label { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; padding: 2px 0; }
.lkp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 6px 14px; }
.lkp-grid .frow .flabel { flex-basis: 140px; min-width: 140px; }

/* дашборд склада */
.stat-cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; min-width: 160px; background: var(--surface-1); }
.stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--text-muted); }

/* журнал обмена */
pre.code.wrap { white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; }

/* вход */
.login-box { max-width: 420px; margin: 60px auto; }
.login-box .frow .flabel { flex-basis: 90px; min-width: 90px; }

/* about */
.about h3 { margin: 18px 0 6px; font-size: 15px; }
.about ul { margin: 4px 0 8px 18px; padding: 0; }
.about li { margin: 2px 0; }

@media print {
  .topbar, footer, .no-print { display: none !important; }
  main { padding: 0; max-width: none; }
}

/* --- Комбобокс select[data-combo]: ввод с клавиатуры, фильтр по буквам --- */
.combo { position: relative; flex: 1; min-width: 0; display: flex; }
.combo .combo-input { width: 100%; }
.combo .combo-select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: 0; bottom: 0; }
.combo-list { max-height: 320px; z-index: 60; }
section.card > .frow.combo-open { z-index: 50; }
.combo-list .lookup-item mark { background: rgba(240,190,0,0.35); color: inherit; border-radius: 2px; padding: 0 1px; }
.combo-list .lookup-item.active { background: rgba(42,120,214,0.20); }
.combo-list .lookup-item.selected { font-weight: 600; }
.combo-list .lookup-item.selected::after { content: ' ✓'; color: var(--accent); }
.combo-list .lookup-item.muted { color: var(--text-muted); cursor: default; }

/* drom.ru: строчные формы в шапке зоны и в ячейках таблицы (индекс моделей) */
form.inline { display: inline-flex; align-items: center; gap: 6px; }
td .chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; margin-left: 6px; }
#drom-box .btn-sm + .muted { margin-left: 8px; }

/* --- счета / УПД: строки документа --- */
#inv-lines td { vertical-align: top; }
#inv-lines input[type=number] { width: 100%; text-align: right; }
#inv-lines select { width: 100%; }
#inv-lines .ln-extra { display: flex; gap: 4px; margin-top: 3px; }
#inv-lines .ln-extra input { flex: 1; font-size: 12px; padding: 2px 6px; min-width: 0; }
#inv-lines tfoot td { border-top: 2px solid var(--sect-border, var(--border)); padding-top: 8px; }

/* --- кабинеты, регистрация, подтверждение (0.5.0) --- */
.topbar-user .cab-name { color: var(--text-primary); font-weight: 600; max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.topbar-user a.user-name { text-decoration: none; }
.topbar-user a.user-name:hover { color: var(--accent); }
.topbar-user > a.active { color: var(--accent); font-weight: 600; }
.support-banner { background: rgba(240,170,0,0.18); border-bottom: 2px solid rgba(240,170,0,0.7);
  padding: 8px 16px; text-align: center; font-size: 13px; }
.auth-box { max-width: 620px; margin: 30px auto; }
.auth-box .frow .flabel { flex-basis: 170px; min-width: 170px; }
.big-code { font: 700 34px/1.2 ui-monospace, Consolas, monospace; letter-spacing: 4px; text-align: center;
  padding: 16px; margin: 12px 0; border-radius: 10px; background: rgba(42,120,214,0.12);
  border: 2px dashed rgba(42,120,214,0.55); color: var(--accent); user-select: all; }
.confirm-wait { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--text-secondary); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--border);
  border-top-color: var(--accent); animation: kit-spin .9s linear infinite; }
@keyframes kit-spin { to { transform: rotate(360deg); } }
.chan-list { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.chan-list label.off { color: var(--text-muted); }
.hp-field { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.wait-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: flex; align-items: center;
  justify-content: center; z-index: 200; }
.wait-overlay[hidden] { display: none; }
.wait-box { background: var(--surface-1); color: var(--text-primary); padding: 22px 28px; border-radius: 12px;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.25); }
.badge.lite { font-weight: 500; }

/* =====================================================================
   Кнопка темы в шапке (светлая / тёмная; выбор — localStorage auto-theme)
   ===================================================================== */
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  padding: 0; border: 1px solid var(--border); border-radius: 8px; background: transparent;
  color: var(--text-secondary); cursor: pointer;
}
.theme-toggle:hover { color: var(--text-primary); background: var(--page-plane); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .ico-moon { display: none; }
.theme-toggle.is-dark .ico-sun { display: none; }
.theme-toggle.is-dark .ico-moon { display: block; fill: currentColor; stroke: none; }

.nav-links { align-items: center; }
.topbar-user .reg-link { color: var(--accent); text-decoration: none; font-weight: 500; }
.topbar-user .reg-link:hover { text-decoration: underline; }

/* окно входа гостя */
.modal.modal-login { width: 520px; }
.modal-login .login-to { margin: 0 0 12px; }
.modal-login .frow .flabel { flex-basis: 90px; min-width: 90px; }

/* =====================================================================
   Публичная заставка на «/» (стиль КИТ, эталон MailGuard landing)
   ===================================================================== */
section.landing { background: transparent; border: none; padding: 0; margin: 0; box-shadow: none; }
.landing-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 44px; align-items: center; margin-top: 18px; }
.eyebrow { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.landing-title { font-size: 60px; font-weight: 800; letter-spacing: -0.01em; line-height: 1; margin: 0 0 18px; }
.landing-title .b-1 { color: var(--accent); }
.landing-title .b-2 { color: var(--slot-yellow); }
.landing-lead { font-size: 16px; line-height: 1.6; color: var(--text-secondary); max-width: 540px; margin: 0 0 22px; }
.landing-points { list-style: none; padding: 0; margin: 0 0 30px; max-width: 540px; }
.landing-points li { position: relative; padding-left: 26px; margin-bottom: 10px; font-size: 14.5px; }
.landing-points li::before { content: ""; position: absolute; left: 0; top: 6px; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.landing-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn.btn-lg { padding: 11px 22px; font-size: 14.5px; }

.landing-art {
  /* светлая тема: дневное небо */
  --art-bg: radial-gradient(130% 130% at 30% 10%, #f4f9ff 0%, #dcebfb 55%, #c3daf3 100%);
  --art-ring: rgba(42,120,214,0.35);
  --art-city: #b3c9e4; --art-city-far: #d2e1f2; --art-win: #fff6c9; --art-win-op: 0;
  --art-sun: #ffd35c; --art-sun-glow: rgba(255,200,60,0.45);
  --art-road: #3b4553; --art-edge: #8594a8; --art-lane: #f4f6f9;
  --art-track: rgba(42,120,214,0.35); --art-node: #ffffff; --art-node-ring: #2a78d6; --art-node-on: #2a78d6;
  --art-text: #2c4b70; --art-speed: rgba(42,120,214,0.45);
  --art-body-top: #4a95ee; --art-body-bottom: #1b5bb3; --art-glass: #d9ecff; --art-glass-op: 0.92;
  --art-glass-hi: #dff5ff; --art-glass-lo: #4c759a; --art-rim-hi: #f7fbff; --art-rim-lo: #75879b;
  --art-line: rgba(8,30,60,0.35); --art-stripe: rgba(255,255,255,0.45);
  --art-tire: #1c2129; --art-rim: #d5dde8; --art-spoke: #7d8898;
  --art-doc-bg: #ffffff; --art-doc-ring: #2a78d6; --art-doc-text: #1d5fb8;
  --art-beam-op: 0.35; --art-shadow: rgba(0,0,0,0.28); --art-caption: rgba(28,60,100,0.6);
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--art-bg); border: 2px solid var(--art-ring); border-radius: 20px; padding: 26px 22px 20px;
  overflow: hidden; min-height: 360px; box-shadow: 0 0 24px -8px var(--art-ring);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .landing-art {
    --art-bg: radial-gradient(130% 130% at 30% 15%, #10456b 0%, #0a2a43 58%, #071d2f 100%);
    --art-ring: rgba(110,165,255,0.55);
    --art-city: #15405f; --art-city-far: #0f3452; --art-win-op: 0.85;
    --art-sun: #e9f1ff; --art-sun-glow: rgba(200,220,255,0.35);
    --art-road: #0b1520; --art-edge: #2b4a66; --art-lane: rgba(234,246,255,0.75);
    --art-track: rgba(127,209,255,0.35); --art-node: #0a2a43; --art-node-ring: #7fd1ff; --art-node-on: #7fd1ff;
    --art-text: rgba(234,246,255,0.8); --art-speed: rgba(127,209,255,0.5);
    --art-body-top: #5aa2ff; --art-body-bottom: #1d4f9c; --art-glass: #0d2c47; --art-glass-op: 0.95;
    --art-glass-hi: #447a9f; --art-glass-lo: #071a2a; --art-rim-hi: #d9e6f2; --art-rim-lo: #44566c;
    --art-line: rgba(0,0,0,0.45); --art-stripe: rgba(127,209,255,0.45);
    --art-tire: #05090e; --art-rim: #9fb2c8; --art-spoke: #3f5570;
    --art-doc-bg: rgba(127,209,255,0.16); --art-doc-ring: #7fd1ff; --art-doc-text: #eaf6ff;
    --art-beam-op: 0.7; --art-shadow: rgba(0,0,0,0.55); --art-caption: rgba(234,246,255,0.6);
  }
}
/* ручной выбор тёмной темы — те же значения */
:root[data-theme="dark"] .landing-art {
  --art-bg: radial-gradient(130% 130% at 30% 15%, #10456b 0%, #0a2a43 58%, #071d2f 100%);
  --art-ring: rgba(110,165,255,0.55);
  --art-city: #15405f; --art-city-far: #0f3452; --art-win-op: 0.85;
  --art-sun: #e9f1ff; --art-sun-glow: rgba(200,220,255,0.35);
  --art-road: #0b1520; --art-edge: #2b4a66; --art-lane: rgba(234,246,255,0.75);
  --art-track: rgba(127,209,255,0.35); --art-node: #0a2a43; --art-node-ring: #7fd1ff; --art-node-on: #7fd1ff;
  --art-text: rgba(234,246,255,0.8); --art-speed: rgba(127,209,255,0.5);
  --art-body-top: #5aa2ff; --art-body-bottom: #1d4f9c; --art-glass: #0d2c47; --art-glass-op: 0.95;
  --art-glass-hi: #447a9f; --art-glass-lo: #071a2a; --art-rim-hi: #d9e6f2; --art-rim-lo: #44566c;
  --art-line: rgba(0,0,0,0.45); --art-stripe: rgba(127,209,255,0.45);
  --art-tire: #05090e; --art-rim: #9fb2c8; --art-spoke: #3f5570;
  --art-doc-bg: rgba(127,209,255,0.16); --art-doc-ring: #7fd1ff; --art-doc-text: #eaf6ff;
  --art-beam-op: 0.7; --art-shadow: rgba(0,0,0,0.55); --art-caption: rgba(234,246,255,0.6);
}
.landing-art-caption { font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--art-caption); }
.car-scene { width: 100%; max-width: 560px; height: auto; display: block; }

/* этапы */
.car-scene .cs-track { stroke: var(--art-track); stroke-width: 2; stroke-dasharray: 4 6; fill: none; }
.car-scene .cs-stage circle { fill: var(--art-node); stroke: var(--art-node-ring); stroke-width: 2; animation: cs-stage 8s infinite; }
.car-scene .cs-stage text { fill: var(--art-text); font-size: 12px; font-weight: 600; text-anchor: middle; font-family: system-ui, "Segoe UI", sans-serif; }
.car-scene .s2 circle { animation-delay: 2s; } .car-scene .s3 circle { animation-delay: 4s; } .car-scene .s4 circle { animation-delay: 6s; }
@keyframes cs-stage { 0%, 26%, 100% { fill: var(--art-node); } 4%, 20% { fill: var(--art-node-on); } }
.car-scene .cs-pulse { fill: var(--art-node-on); animation: cs-pulse 8s ease-in-out infinite; filter: drop-shadow(0 0 5px var(--art-node-on)); }
@keyframes cs-pulse { 0% { transform: translateX(0); opacity: 1; } 25% { transform: translateX(127px); } 50% { transform: translateX(253px); } 75%, 96% { transform: translateX(380px); opacity: 1; } 99% { opacity: 0; } 100% { transform: translateX(0); opacity: 0; } }

/* город, дорога, скорость */
.car-scene .cs-city-strip { animation: cs-scroll 30s linear infinite; }
.car-scene .cs-city path { fill: var(--art-city); }
.car-scene .cs-city-far path { fill: var(--art-city-far); }
.car-scene .cs-city-far .cs-city-strip { animation-duration: 60s; }
.car-scene .cs-sun { fill: var(--art-sun); filter: drop-shadow(0 0 14px var(--art-sun-glow)); animation: cs-sun 6s ease-in-out infinite; }
@keyframes cs-sun { 0%, 100% { opacity: 1; } 50% { opacity: 0.8; } }
.car-scene .cs-win rect { fill: var(--art-win); opacity: var(--art-win-op); }
@keyframes cs-scroll { from { transform: translateX(0); } to { transform: translateX(-520px); } }
.car-scene .cs-road { fill: var(--art-road); }
.car-scene .cs-road-edge { stroke: var(--art-edge); stroke-width: 2; }
.car-scene .cs-lane { stroke: var(--art-lane); stroke-width: 4; stroke-dasharray: 34 30; animation: cs-lane 0.55s linear infinite; }
@keyframes cs-lane { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 64; } }
.car-scene .cs-speed path { stroke: var(--art-speed); stroke-width: 3; stroke-linecap: round; animation: cs-speed 1.1s linear infinite; }
.car-scene .cs-speed .sp2 { animation-delay: 0.35s; } .car-scene .cs-speed .sp3 { animation-delay: 0.7s; }
@keyframes cs-speed { 0% { transform: translateX(40px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateX(-60px); opacity: 0; } }

/* автомобиль */
.car-scene .cs-body-top { stop-color: var(--art-body-top); }
.car-scene .cs-body-bottom { stop-color: var(--art-body-bottom); }
.car-scene .cs-glass-top { stop-color: var(--art-glass-hi); }
.car-scene .cs-glass-bottom { stop-color: var(--art-glass-lo); }
.car-scene .cs-rim-top { stop-color: var(--art-rim-hi); }
.car-scene .cs-rim-bottom { stop-color: var(--art-rim-lo); }
.car-scene .cs-car { animation: cs-bounce 0.9s ease-in-out infinite; }
@keyframes cs-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
.car-scene .cs-glass { fill: var(--art-glass); opacity: var(--art-glass-op); }
.car-scene .cs-glint { stroke: rgba(255,255,255,0.7); stroke-width: 3; stroke-linecap: round; }
.car-scene .cs-glint-soft { opacity: 0.5; stroke-width: 2; }
.car-scene .cs-roof-line { fill: none; stroke: rgba(225,247,255,0.72); stroke-width: 1.5; stroke-linecap: round; }
.car-scene .cs-line { stroke: var(--art-line); stroke-width: 1.5; }
.car-scene .cs-door-line { fill: none; opacity: 0.72; }
.car-scene .cs-stripe { fill: none; stroke: var(--art-stripe); stroke-width: 2; }
.car-scene .cs-sill { fill: none; stroke: rgba(5,23,45,0.42); stroke-width: 4; stroke-linecap: round; }
.car-scene .cs-handle { fill: var(--art-line); }
.car-scene .cs-mirror { fill: var(--art-body-bottom); }
.car-scene .cs-head { fill: #eafbff; filter: drop-shadow(0 0 5px #a7ecff); }
.car-scene .cs-tail { fill: #ff5a4f; animation: cs-tail 2.4s ease-in-out infinite; }
.car-scene .cs-intake { fill: rgba(4,18,34,0.72); }
.car-scene .cs-diffuser { fill: none; stroke: rgba(4,14,26,0.75); stroke-width: 3; stroke-linecap: round; }
@keyframes cs-tail { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }
.car-scene .cs-beam { opacity: var(--art-beam-op); animation: cs-beam 3s ease-in-out infinite; }
@keyframes cs-beam { 0%, 100% { opacity: var(--art-beam-op); } 50% { opacity: calc(var(--art-beam-op) * 0.6); } }
.car-scene .cs-shadow { fill: var(--art-shadow); }
.car-scene .cs-wheel { animation: cs-spin 0.7s linear infinite; }
@keyframes cs-spin { to { transform: rotate(360deg); } }
.car-scene .cs-tire { fill: var(--art-tire); }
.car-scene .cs-sidewall { fill: none; stroke: rgba(104,124,146,0.5); stroke-width: 1.5; }
.car-scene .cs-rim { fill: var(--art-rim); stroke: rgba(255,255,255,0.42); stroke-width: 1; }
.car-scene .cs-spoke { stroke: var(--art-spoke); stroke-width: 2.4; stroke-linecap: round; }
.car-scene .cs-brake { fill: #ff765f; opacity: 0.9; }
.car-scene .cs-hub { fill: var(--art-spoke); }

/* документы этапа */
.car-scene .cs-doc { opacity: 0; animation: cs-doc 8s ease-out infinite; }
.car-scene .cs-doc rect { fill: var(--art-doc-bg); stroke: var(--art-doc-ring); stroke-width: 1.6; }
.car-scene .cs-doc text { fill: var(--art-doc-text); font-size: 12px; font-weight: 700; text-anchor: middle; font-family: system-ui, "Segoe UI", sans-serif; }
.car-scene .d2 { animation-delay: 2s; } .car-scene .d3 { animation-delay: 4s; } .car-scene .d4 { animation-delay: 6s; }
@keyframes cs-doc { 0% { opacity: 0; transform: translateY(12px); } 5% { opacity: 1; } 22% { opacity: 1; transform: translateY(-58px); } 28%, 100% { opacity: 0; transform: translateY(-72px); } }

@media (prefers-reduced-motion: reduce) {
  .car-scene * { animation: none !important; }
  .car-scene .cs-doc { opacity: 1; }
}

/* разделы под заставкой */
.land-head { font-size: 17px; font-weight: 600; margin: 30px 0 12px; }
.land-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 12px; }
.land-tile {
  --t: var(--accent);
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 10px; text-decoration: none;
  color: var(--text-primary); background: color-mix(in srgb, var(--t) 12%, transparent);
  border: 2px solid color-mix(in srgb, var(--t) 70%, transparent);
  transition: transform 0.12s, box-shadow 0.12s;
}
.land-tile b { color: var(--t); font-size: 14.5px; }
.land-tile span { font-size: 12.5px; color: var(--text-secondary); line-height: 1.4; }
.land-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px -6px var(--t); }
.land-tile.t-blue { --t: var(--slot-blue); }   .land-tile.t-aqua { --t: var(--slot-aqua); }
.land-tile.t-green { --t: var(--slot-green); } .land-tile.t-amber { --t: var(--slot-yellow); }
.land-tile.t-red { --t: var(--slot-red); }     .land-tile.t-violet { --t: var(--slot-violet); }
.land-tile.t-slate { --t: #5b7090; }

.landing-grid > * { min-width: 0; }
@media (max-width: 900px) {
  /* шапка на узком экране: меню переносится отдельной строкой под брендом */
  .topbar-inner { height: auto; flex-wrap: wrap; row-gap: 4px; padding: 8px 16px; }
  .nav-links { order: 3; width: 100%; margin-left: 0; gap: 2px; }
  .nav-links a { padding: 6px 9px; font-size: 13px; }
  main { padding-left: 16px; padding-right: 16px; }
  .landing-grid { grid-template-columns: 1fr; gap: 24px; min-height: 0; }
  .landing-art { order: -1; min-height: 0; padding: 18px 12px 14px; }
  .landing-title { font-size: 44px; }
}
