/* =========================================================================
   АВТОПАРК — форма водителя. Utility-дизайн-система.
   Inter · navy/blue · semantic-токены · тач-цели 52px · light + dark.
   ========================================================================= */

:root {
  /* --- Палитра (semantic tokens) --- */
  --navy-900: #0f172a;
  --navy-800: #1e293b;
  --navy-700: #334155;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --white: #ffffff;

  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-50:  #eff6ff;

  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-50:  #f0fdfa;

  --green-600: #16a34a;
  --green-50:  #f0fdf4;
  --amber-500: #f59e0b;
  --amber-700: #b45309;
  --amber-50:  #fffbeb;
  --red-600:  #dc2626;
  --red-50:   #fef2f2;

  /* --- Роли --- */
  --bg:         var(--slate-100);
  --surface:    var(--white);
  --surface-2:  var(--slate-50);
  --text:       var(--navy-900);
  --text-muted: var(--slate-500);
  --border:     var(--slate-200);
  --border-strong: var(--slate-300);

  --primary:      var(--blue-600);
  --primary-hover:var(--blue-700);
  --on-primary:   var(--white);
  --ring:         rgba(37, 99, 235, .35);

  --accent:       var(--teal-600);      /* заправка */
  --accent-ring:  rgba(13, 148, 136, .30);

  --danger: var(--red-600);

  /* --- Скругления, тени, отступы (4/8) --- */
  --r-sm: 8px;  --r-md: 12px;  --r-lg: 16px;  --r-xl: 22px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 4px 16px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.16);
  --tap: 52px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Тёмная тема — для ночных рейсов (авто по системе). */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #0b1220;
    --surface:    #131c2e;
    --surface-2:  #0f1727;
    --text:       #e8eef7;
    --text-muted: #93a2ba;
    --border:     #263349;
    --border-strong: #35455f;
    --blue-50:  #14233f;
    --teal-50:  #0e2626;
    --green-50: #0e2519;
    --amber-50: #2a2010;
    --amber-700:#fbbf24;
    --red-50:   #2a1518;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 6px 20px rgba(0,0,0,.45);
    --shadow-lg: 0 16px 48px rgba(0,0,0,.6);
    --ring: rgba(59,130,246,.45);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  min-height: 100dvh;
}
.tnum { font-variant-numeric: tabular-nums; }

/* --- Каркас --- */
.wrap { width: 100%; max-width: 480px; margin: 0 auto; padding: var(--sp-4); }
.screen { display: none; }
.screen.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* --- Брендовая шапка --- */
.brand { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--blue-600), var(--navy-800));
  box-shadow: var(--shadow-sm);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-title { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand-sub { font-size: 12.5px; color: var(--text-muted); }

/* --- Карточка --- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  padding: var(--sp-5);
}

/* =======================  ПИН-ГЕЙТ  ======================= */
.gate { text-align: center; }
.gate-lock {
  width: 64px; height: 64px; margin: var(--sp-2) auto var(--sp-4);
  border-radius: 50%; display: grid; place-items: center;
  background: var(--blue-50); color: var(--primary);
}
.gate-lock svg { width: 30px; height: 30px; }
.gate h1 { font-size: 21px; margin: 0 0 var(--sp-1); letter-spacing: -.02em; }
.gate p { color: var(--text-muted); margin: 0 0 var(--sp-5); font-size: 14px; }

.pin-input {
  width: 100%; height: 64px; text-align: center;
  font-size: 30px; font-weight: 700; letter-spacing: .5em; text-indent: .5em;
  font-variant-numeric: tabular-nums;
  border: 2px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text);
  transition: border-color .18s, box-shadow .18s;
}
.pin-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.pin-input::placeholder { letter-spacing: .35em; color: var(--slate-400); font-weight: 600; }

/* =======================  ФОРМА  ======================= */
.top {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.who { flex: 1; min-width: 0; }
.who-hi { font-size: 12px; color: var(--text-muted); }
.who-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); display: grid; place-items: center; cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

/* Сегмент-переключатель Рейс / Заправка */
.seg {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--sp-1);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-1); margin-bottom: var(--sp-4);
}
.seg button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  min-height: 46px; border-radius: 9px; font: inherit; font-weight: 600; font-size: 13.5px;
  color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .18s, color .18s, box-shadow .18s;
}
.seg button svg { width: 18px; height: 18px; flex: none; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button[data-tab="trip"][aria-selected="true"]  { color: var(--primary); }
.seg button[data-tab="fuel"][aria-selected="true"]   { color: var(--accent); }
.seg button[data-tab="mats"][aria-selected="true"]   { color: var(--navy-900); }
@media (prefers-color-scheme: dark) { .seg button[data-tab="mats"][aria-selected="true"] { color: var(--text); } }
@media (max-width: 360px) { .seg button { font-size: 12.5px; } .seg button svg { display: none; } }

/* Подотчёт (кабинет водителя) */
.mats-group { margin-bottom: var(--sp-5); }
.mats-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); font-weight: 700; font-size: 15px; }
.mats-head svg { width: 20px; height: 20px; color: var(--text-muted); }
.mat-item {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0;
  border-top: 1px solid var(--border);
}
.mat-item:first-child { border-top: 0; }
.mat-main { flex: 1; min-width: 0; }
.mat-main b { display: block; font-weight: 600; font-size: 15px; }
.mat-main span { color: var(--text-muted); font-size: 12.5px; }
.mat-qty { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mats-empty { color: var(--text-muted); font-size: 14px; padding: var(--sp-2) 0; }
.mats-note { color: var(--text-muted); font-size: 12px; text-align: center; margin: var(--sp-2) 0 0; }
.mat-right { display: flex; align-items: center; gap: var(--sp-3); flex: none; }
.mat-ok { display: inline-flex; align-items: center; gap: 4px; color: var(--green-600); font-size: 13px; font-weight: 600; white-space: nowrap; }
.mat-ok svg { width: 15px; height: 15px; }
.mat-accept {
  appearance: none; border: 1.5px solid var(--primary); background: var(--blue-50); color: var(--primary);
  font: inherit; font-weight: 600; font-size: 13.5px; min-height: 38px; padding: 0 16px; border-radius: 10px; cursor: pointer;
  transition: background .15s; white-space: nowrap;
}
.mat-accept:hover { background: var(--primary); color: #fff; }
.mat-accept:active { transform: scale(.96); }
.pending-banner {
  display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-4);
  background: var(--red-50); color: var(--danger); border: 1px solid rgba(220,38,38,.25);
  border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); font-size: 13.5px;
}
.pending-banner svg { width: 20px; height: 20px; flex: none; }
.pending-banner b { font-variant-numeric: tabular-nums; }

/* Поля */
.field { margin-bottom: var(--sp-4); }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.req { color: var(--danger); }

.control {
  width: 100%; min-height: var(--tap); padding: 0 var(--sp-4);
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface-2); border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md); transition: border-color .16s, box-shadow .16s, background .16s;
}
textarea.control { min-height: 80px; padding-top: var(--sp-3); resize: vertical; line-height: 1.45; }
select.control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 42px;
}
.control:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px var(--ring); }
.fuel .control:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.control::placeholder { color: var(--slate-400); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }

/* № ТТН: префикс + номер */
.ttn { display: grid; grid-template-columns: 96px 1fr; gap: var(--sp-2); }
.ttn .prefix { text-align: center; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.ttn-preview { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.ttn-preview b { color: var(--text); font-variant-numeric: tabular-nums; }

/* Чипсы (тип топлива / оплата / полный бак) */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  min-height: 44px; padding: 0 var(--sp-4); border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--border-strong); background: var(--surface-2);
  color: var(--text); font: inherit; font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 7px; transition: all .15s;
}
.chip svg { width: 17px; height: 17px; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--teal-50); color: var(--accent); font-weight: 600; }
.chip:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }

/* Сводка суммы */
.summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4); border-radius: var(--r-md); margin: var(--sp-4) 0;
  background: var(--blue-50); border: 1px solid transparent;
}
.fuel .summary { background: var(--teal-50); }
.summary-label { font-size: 13px; color: var(--text-muted); }
.summary-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.trip .summary-value { color: var(--primary); }
.fuel .summary-value { color: var(--accent); }
.summary-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; text-align: right; }

/* Кнопки */
.btn {
  width: 100%; min-height: var(--tap); border: 0; border-radius: var(--r-md);
  font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  transition: background .16s, transform .08s, box-shadow .16s; -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); }
.fuel .btn-primary { background: var(--accent); }
.fuel .btn-primary:hover { background: var(--teal-500); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-muted); min-height: 44px; }
.btn-ghost:hover { color: var(--text); }
.btn-block-2 { margin-top: var(--sp-2); }

/* Спиннер в кнопке */
.spin { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* Ошибка */
.alert {
  display: none; align-items: center; gap: var(--sp-2);
  background: var(--red-50); color: var(--danger);
  border: 1px solid rgba(220,38,38,.25); border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4); font-size: 14px; margin-bottom: var(--sp-4);
}
.alert.show { display: flex; }
.alert svg { width: 18px; height: 18px; flex: none; }

/* =======================  SUCCESS  ======================= */
.done { text-align: center; padding: var(--sp-6) var(--sp-4); }
.done-check {
  width: 76px; height: 76px; margin: 0 auto var(--sp-4); border-radius: 50%;
  background: var(--green-50); color: var(--green-600); display: grid; place-items: center;
  animation: pop .4s cubic-bezier(.2,.8,.2,1);
}
.done-check svg { width: 40px; height: 40px; }
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.done h2 { margin: 0 0 var(--sp-1); font-size: 20px; }
.done-amount { font-size: 34px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: var(--sp-2) 0; }
.done-meta { color: var(--text-muted); font-size: 14px; margin-bottom: var(--sp-6); }
.done-meta b { color: var(--text); }

/* Мини-история последних документов */
.recent { margin-top: var(--sp-6); }
.recent-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: var(--sp-2); }
.recent-item {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0;
  border-top: 1px solid var(--border); font-size: 14px;
}
.recent-ic { width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; }
.recent-ic svg { width: 18px; height: 18px; }
.recent-ic.t { background: var(--blue-50); color: var(--primary); }
.recent-ic.f { background: var(--teal-50); color: var(--accent); }
.recent-main { flex: 1; min-width: 0; }
.recent-main b { display: block; font-weight: 600; }
.recent-main span { color: var(--text-muted); font-size: 12.5px; }
.recent-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.foot { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: var(--sp-6); }
.foot a { color: var(--text-muted); }

/* Заголовок раздела */
.section-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 var(--sp-4); }

/* =======================  ГЛАВНАЯ · ПЛИТКИ  ======================= */
.hello { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: var(--sp-1) 0 var(--sp-5); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.tile {
  position: relative; appearance: none; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-4);
  min-height: 128px; padding: var(--sp-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm); color: var(--text);
  transition: transform .09s ease, box-shadow .16s ease, border-color .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.tile:active { transform: scale(.97); }
.tile:hover { box-shadow: var(--shadow-md); }
.tile:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.tile-ic { width: 48px; height: 48px; border-radius: 13px; flex: none; display: grid; place-items: center; }
.tile-ic svg { width: 26px; height: 26px; }
.tile-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-t { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.tile-s { font-size: 12.5px; color: var(--text-muted); }
/* Широкая плитка (Подотчёт) */
.tile.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: var(--sp-4); min-height: 76px; }
.tile.wide .tile-txt { flex: 1; }
/* Цвета иконок по типу */
.tile.trip   .tile-ic { background: var(--blue-50);  color: var(--primary); }
.tile.fuel   .tile-ic { background: var(--teal-50);  color: var(--accent); }
.tile.repair .tile-ic { background: var(--amber-50); color: var(--amber-700); }
.tile.tires  .tile-ic { background: var(--slate-100); color: var(--navy-800); }
@media (prefers-color-scheme: dark) { .tile.tires .tile-ic { background: #1c2942; color: var(--slate-300); } }
.tile.mats   .tile-ic { background: var(--green-50); color: var(--green-600); }
.tile.docs   .tile-ic { background: var(--blue-50); color: var(--primary); }
/* Экран «Документы» */
.doc-tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin: 4px 0 6px; }
.doc-tab { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--text-muted); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.doc-tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.doc-hint { font-size: 12.5px; color: var(--text-muted); padding: 2px 4px 8px; }
.doc-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 11px 13px; margin-bottom: 8px; cursor: pointer; }
.doc-row:active { background: var(--surface-2); }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-main b { font-size: 14.5px; }
.doc-main span { font-size: 12px; color: var(--text-muted); }
.doc-side { display: flex; align-items: center; gap: 8px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-ph { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--primary); }
.doc-ph svg { width: 15px; height: 15px; }
.doc-chev { width: 18px; height: 18px; color: var(--text-muted); }
.dd-sum { font-size: 14px; line-height: 1.45; margin: -2px 0 10px; }
.dd-acts { display: flex; gap: 8px; margin-top: 14px; }
.dd-btn { flex: 1; min-height: 46px; border: 1.5px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.dd-btn.danger { color: var(--danger); border-color: var(--danger); }
.dd-btn:active { transform: scale(.98); }
/* Значок «ждут приёмки» */
.tile-badge {
  position: absolute; top: 12px; right: 12px; min-width: 22px; height: 22px; padding: 0 6px;
  background: var(--danger); color: #fff; border-radius: 999px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.tile.wide .tile-badge { top: 50%; right: 16px; transform: translateY(-50%); }

/* ---- Нижняя навигация ---- */
body.has-nav .wrap { padding-bottom: 84px; }
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 20px rgba(15,23,42,.06);
}
.bottomnav button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; border-radius: 10px; color: var(--text-muted); font: inherit; font-size: 11px; font-weight: 600;
  transition: color .15s;
}
.bottomnav button svg { width: 23px; height: 23px; }
.bottomnav button.on { color: var(--primary); }
.bottomnav button:active { background: var(--surface-2); }

/* ---- Строки ремонта (работы / запчасти) — карточка на позицию ---- */
.items-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-2); }
.items-head label { margin: 0; }
.add-row { appearance: none; border: 0; background: var(--blue-50); color: var(--primary); font: inherit; font-weight: 600; font-size: 13.5px; min-height: 38px; padding: 0 16px; border-radius: 999px; cursor: pointer; }
.add-row:active { transform: scale(.96); }
.item-row {
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-2); padding: var(--sp-3); margin-bottom: var(--sp-3);
}
.item-row:last-child { margin-bottom: 0; }
.ir-top { display: grid; grid-template-columns: 1fr 48px; gap: var(--sp-2); align-items: center; }
.item-row .control { min-height: 48px; font-size: 16px; }
.ir-del {
  width: 48px; height: 48px; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text-muted);
  border-radius: var(--r-sm); cursor: pointer; transition: color .15s, background .15s;
}
.ir-del svg { width: 19px; height: 19px; }
.ir-del:active { color: var(--danger); background: var(--red-50); }
.ir-fld { display: block; }
.ir-fld > span { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); margin: var(--sp-2) 0 5px; }
.ir-sub.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.ir-sub.three { display: grid; grid-template-columns: 1fr 0.8fr 1fr; gap: var(--sp-2); }
.items-empty { color: var(--text-muted); font-size: 13px; padding: 2px 0 6px; }

/* ---- Шины (кабинет водителя) ---- */
.tires-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.tires-title { font-weight: 700; font-size: 16px; }
.tires-sub { color: var(--text-muted); font-size: 12.5px; }
.btn-inline { width: auto; min-height: 42px; padding: 0 16px; font-size: 14px; }
.tire-item { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--border); }
.tire-item:first-child { border-top: 0; }
.tire-item.removed { opacity: .5; }
.tire-main { flex: 1; min-width: 0; }
.tire-main b { display: block; font-weight: 600; font-size: 15px; }
.tire-main span { color: var(--text-muted); font-size: 12.5px; }
.tire-mileage { text-align: right; white-space: nowrap; }
.tire-mileage b { font-weight: 800; font-variant-numeric: tabular-nums; }
.tire-mileage span { display: block; color: var(--text-muted); font-size: 11px; }
.tire-rm { width: 38px; height: 38px; flex: none; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); border-radius: 9px; cursor: pointer; display: grid; place-items: center; }
.tire-rm:active { color: var(--danger); }
.tire-rm svg { width: 17px; height: 17px; }

/* ---- Мини-модалка водителя ---- */
.dscrim { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: none; align-items: flex-end; z-index: 100; }
.dscrim.on { display: flex; }
.dmodal { width: 100%; max-width: 480px; margin: 0 auto; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92dvh; overflow: auto; padding-bottom: calc(var(--sp-5) + env(safe-area-inset-bottom)); animation: slideup .25s cubic-bezier(.2,.8,.2,1); }
@keyframes slideup { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.dmodal h2 { font-size: 18px; margin: 0 0 var(--sp-4); }
.dmodal .field { margin-bottom: var(--sp-3); }
.dmodal-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.dmodal-actions .btn { flex: 1; }

/* ---- Верхняя панель формы: назад · заголовок · выход ---- */
.section-head { flex: 1; min-width: 0; text-align: center; }
.top .section-title { margin: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-sub { margin-top: 1px; color: var(--text-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-btn { width: auto; display: inline-flex; align-items: center; gap: 3px; padding: 0 12px; }
.back-btn span { font-size: 13px; font-weight: 600; }
/* ---- Кнопка выбора машины на хабе ---- */
.who-truck { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; padding: 3px 9px 3px 7px;
  font-size: 12.5px; color: var(--text); font-weight: 700; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; cursor: pointer; max-width: 100%; }
.who-truck:active { transform: scale(.97); }
.who-truck .wt-ic { width: 15px; height: 15px; color: var(--primary); flex: none; }
.who-truck #home-truck, .who-truck span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-truck .wt-chev { width: 14px; height: 14px; color: var(--text-muted); flex: none; }
.home-name, .who-name { font-weight: 700; }

/* ---- Пикер машины ---- */
.truck-picker { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.truck-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 13px 15px; text-align: left; background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--radius); cursor: pointer; min-height: 56px; }
.truck-opt:active { transform: scale(.99); }
.truck-opt.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.truck-opt .to-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.truck-opt .to-main b { font-size: 16px; font-weight: 800; }
.truck-opt .to-main span { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.truck-opt .to-chk { width: 22px; height: 22px; color: var(--primary); flex: none; }

/* ---- Ярлык-подсказка у метки ---- */
.lbl-hint { font-weight: 500; font-size: 11px; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }

/* ---- Тройная строка полей ---- */
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--sp-2); }

/* ---- Схема осей / колёс ---- */
.axle-diagram { display: flex; flex-direction: column; align-items: center; margin: 2px 0 14px; }
.axle-diagram:empty { display: none; }
/* Скролл свободен на фоне; на самих шинах — touch-action:none, чтобы касание шины сразу тащило её, а не листало страницу */
.tires-card.sm-move .axsvg .wheel[data-tire],
.tires-card.sm-move .axsvg .wheel[data-tire] rect,
.tires-card.sm-move .axsvg .wheel[data-tire] text,
.tires-card.sm-move .stire, .tires-card.sm-move .stire * { touch-action: manipulation; }
/* палец не должен попадать на ТЕКСТ/протектор (иначе браузер лезет с выделением/лупой) — тап идёт по колесу */
.axsvg .wnum, .axsvg .tread, .axsvg .wsh, .axsvg .wgloss, .axsvg .axn { pointer-events: none; }
.axsvg text, .axsvg .wheel { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.stire-cap, .stire-cap *, .stire-wheel, .stire-wheel * { pointer-events: none; }
.axsvg { width: 260px; max-width: 100%; height: auto; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.axsvg, .axsvg * { -webkit-touch-callout: none; }
.axsvg .chassis { fill: var(--surface-2); stroke: var(--border); stroke-width: 1.5; }
.axsvg .cab { fill: var(--surface-2); stroke: var(--border); stroke-width: 1.5; }
.axsvg .cab-glass { stroke: var(--border-strong); stroke-width: 1.5; stroke-linecap: round; }
.axsvg .we-plus { stroke: var(--slate-400); stroke-width: 2.6; }
.axsvg .we-rim { fill: none; stroke: var(--slate-400); stroke-width: 1.4; opacity: .7; }
.axsvg .we-rim2 { fill: none; stroke: var(--slate-400); stroke-width: 1.1; opacity: .45; }
.axsvg .we-hub { fill: var(--slate-400); opacity: .75; }
.axsvg .spare-div { stroke: var(--border-strong); stroke-width: 1.5; stroke-dasharray: 4 4; }
.axsvg .axle { stroke: var(--border-strong); stroke-width: 2; }
.axsvg .spine { stroke: var(--border-strong); stroke-width: 3; }
.axsvg .axn { fill: var(--text-muted); font-family: var(--font); font-size: 11px; font-weight: 600; }
.axsvg rect.wf { fill: var(--primary); }
.axsvg rect.wf-new  { fill: var(--green-600); }
.axsvg rect.wf-mid  { fill: var(--amber-500); }
.axsvg rect.wf-worn { fill: var(--red-600); }
.axsvg rect.we { fill: var(--surface-2); stroke: var(--slate-400); stroke-width: 1.5; stroke-dasharray: 3 3; }
.axsvg .tread { stroke: rgba(255,255,255,.55); stroke-width: 1.3; stroke-linecap: round; pointer-events: none; }
.axsvg .axfront { fill: var(--text-muted); font-family: var(--font); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.axsvg .wheel { cursor: pointer; }
.axle-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.axle-legend i.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }
i.lg.wf { background: var(--primary); }
i.lg.wf-new  { background: var(--green-600); }
i.lg.wf-mid  { background: var(--amber-500); }
i.lg.wf-worn { background: var(--red-600); }
i.lg.we { background: var(--surface-2); border: 1.5px dashed var(--slate-400); }
.axle-empty { font-size: 12.5px; color: var(--amber-700); margin-top: 8px; text-align: center; padding: 0 8px; }
.axle-full { font-size: 12.5px; color: var(--green-600); margin-top: 8px; text-align: center; }

/* ---- Градиентная шкала износа + счётчики ---- */
.wear-scale { width: 300px; max-width: 100%; margin: 12px auto 0; }
.tires-hint { text-align: center; font-size: 12.5px; color: var(--text-muted); padding: 4px 10px 2px; }
/* Поля раздела «Шины»: сегментированный переключатель */
.tire-tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin: 2px 0 8px; }
.tire-tab { flex: 1; min-height: 42px; border: 0; border-radius: 9px; background: transparent; color: var(--text-muted); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.tire-tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tire-submode-hint { text-align: center; font-size: 12.5px; color: var(--text-muted); padding: 0 10px 10px; }
/* Номер шины (6 цифр) внутри колеса — в 2 строки по 3 */
.axsvg .wnum { fill: #fff; stroke: rgba(0,0,0,.4); stroke-width: 2.2px; paint-order: stroke; font-family: var(--font); font-weight: 800; font-size: 11.5px; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.stire-wheel b { color: #fff; font-size: 11.5px; font-weight: 800; line-height: 1.02; text-align: center; letter-spacing: .3px; font-variant-numeric: tabular-nums; text-shadow: 0 1px 1.5px rgba(0,0,0,.45); }
/* «Поднятая» шина (в руке) — оригинал полупрозрачный */
.axsvg .wheel.lifted rect { opacity: .38; }
.stire.lifted { opacity: .4; }
/* Полка склада/списания — шины «лежат» на доске */
.shelf { position: relative; padding-bottom: 12px; }
/* Полка — по 4 шины в ряд */
.shelf-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; align-items: end; min-height: 84px; padding: 6px 2px 0; }
.shelf-tiles .stire { width: auto; }
.shelf-tiles .tray-empty { grid-column: 1 / -1; }
.shelf-board { height: 10px; margin-top: -2px; border-radius: 3px; background: linear-gradient(180deg, var(--slate-300), var(--slate-400)); box-shadow: 0 3px 5px rgba(15,23,42,.14); }
@media (prefers-color-scheme: dark) { .shelf-board { background: linear-gradient(180deg, var(--slate-600, #475569), var(--slate-700, #334155)); } }
.stire-wheel { box-shadow: 0 3px 4px rgba(15,23,42,.22); }
/* Полка списания — красноватая тема */
.scrap-tray { border-color: var(--red-300, #fca5a5); background: color-mix(in srgb, var(--red-600) 6%, var(--surface-2)); }
.tray-head.scrap { color: var(--red-700, #b91c1c); }
.tray-head.scrap .th-ic svg { width: 18px; height: 18px; }
.scrap-tray.drop-hover { border-color: var(--red-600); background: color-mix(in srgb, var(--red-600) 12%, var(--surface-2)); }
.scrap-drop { text-align: center; font-size: 13px; color: var(--red-700, #b91c1c); padding: 14px 10px; border: 1.5px dashed var(--red-300, #fca5a5); border-radius: var(--r-md); background: color-mix(in srgb, var(--red-600) 4%, transparent); }
.scrap-tray.drop-hover .scrap-drop { border-color: var(--red-600); }
/* Чипы причины перемещения/списания */
.reason-chips { flex-wrap: wrap; gap: 7px; }
.reason-chips .chip[aria-pressed="true"] { border-color: var(--primary); background: var(--blue-50); color: var(--primary); }
/* Зафиксированный госномер в формах (менять только на главной) */
.control.locked, .control.locked:disabled { opacity: 1; color: var(--text); -webkit-text-fill-color: var(--text); background: var(--surface-2); cursor: default; }
/* Приёмка машины: варианты по позиции */
.accept-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.accept-item { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; }
.ai-name b { display: block; font-size: 14.5px; }
.ai-name span { font-size: 12px; color: var(--text-muted); }
.accept-opts { display: flex; gap: 6px; margin-top: 8px; }
.aopt { flex: 1; min-height: 40px; border: 1.5px solid var(--border-strong); border-radius: 9px; background: var(--surface); color: var(--text-muted); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.aopt-accepted[aria-pressed="true"] { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.aopt-missing[aria-pressed="true"] { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.aopt-damaged[aria-pressed="true"] { background: var(--amber-500); border-color: var(--amber-500); color: #fff; }
/* Панель операций раздела «Шины» */
.tire-ops { display: flex; gap: var(--sp-2); margin: 4px 0 10px; }
.tire-op { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; padding: 0 12px; border: 1.5px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.tire-op svg { width: 19px; height: 19px; }
.tire-op:active { transform: scale(.98); }
.tire-op.on { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
@media (prefers-color-scheme: dark) { .tire-op.on { background: var(--blue-700); border-color: var(--blue-700); } }
.move-banner { position: sticky; bottom: 88px; z-index: 40; display: flex; align-items: center; gap: 10px; background: var(--navy-900); color: #fff; border-radius: var(--r-md); padding: 11px 14px; margin: 0 0 10px; font-size: 13.5px; box-shadow: var(--shadow-md); }
@media (prefers-color-scheme: dark) { .move-banner { background: var(--blue-700); } }
.move-banner .mb-done { margin-left: auto; background: #fff; color: var(--navy-900); border: 0; border-radius: 8px; padding: 8px 16px; font: inherit; font-weight: 700; cursor: pointer; }
/* Визуальные шины на складе — «шайбы» с цветом по износу, лежат рядком */
.stire-row { gap: 14px 16px; }
.stire { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 66px; cursor: grab; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.stire-wheel { position: relative; width: 42px; height: 54px; border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: var(--shadow-sm); }
.stire-wheel i { width: 24px; height: 1.4px; background: rgba(255,255,255,.5); border-radius: 2px; }
.stire-wheel.wf-new  { background: var(--green-600); }
.stire-wheel.wf-mid  { background: var(--amber-500); }
.stire-wheel.wf-worn { background: var(--red-600); }
.stire-wheel.wf     { background: var(--primary); }
.stire-cap { text-align: center; line-height: 1.15; min-height: 30px; }
.tire-savebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 10px; padding: 8px 10px 8px 14px; border-radius: 12px; background: #fffbeb; border: 1px solid #fcd34d; }
.tire-savebar span { font-size: 13px; font-weight: 700; color: #92400e; }
.tire-savebar .btn { flex: none; width: auto; min-height: 38px; }
.tire-selbar { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; padding: 6px 8px 6px 14px; border-radius: 12px; background: #ecfeff; border: 1px solid #67e8f9; }
.tire-selbar span { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: #0e7490; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tire-selbar .btn { flex: none; width: auto; min-height: 36px; padding: 0 12px; }
.axsvg .wsh { pointer-events: none; }
.axsvg .wgloss { pointer-events: none; }
.rn-changes { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; max-height: 190px; overflow: auto; }
.rn-change { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.rn-change span { color: var(--text-muted); white-space: nowrap; }
.two-trays { display: flex; gap: 8px; align-items: stretch; }
.two-trays .half { flex: 1 1 0; min-width: 0; overflow: hidden; }
.two-trays .storage-tray { padding: var(--sp-2); margin: 2px 0 12px; height: 100%; }
.two-trays .tray-head { font-size: 12.5px; gap: 4px; }
.two-trays .tray-head b { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.two-trays .scrap-drop { padding: 12px 6px; font-size: 11.5px; line-height: 1.2; }
.tray-head.mount { color: var(--primary); }
.tray-head.mount .th-ic svg { width: 18px; height: 18px; }
.shelf.mount { min-height: 58px; display: flex; align-items: center; justify-content: center; }
.mount-tray.drop-hover .shelf.mount { outline: 2px dashed var(--primary); outline-offset: -4px; border-radius: 12px; }
.stire-cap b { display: block; font-size: 12px; font-weight: 600; }
.stire-cap span { font-size: 10.5px; color: var(--text-muted); }
.stire.tsel .stire-wheel { box-shadow: 0 0 0 3px var(--accent-ring); }
.wear-bar { height: 9px; border-radius: 999px;
  background: linear-gradient(90deg, var(--green-600) 0 28%, var(--amber-500) 38% 62%, var(--red-600) 72% 100%); }
.wear-ticks { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.wear-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 12px; color: var(--text-muted); margin-top: 9px; }
.wear-legend .wl { display: inline-flex; align-items: center; gap: 5px; }
.wear-legend .wl i { width: 11px; height: 11px; border-radius: 3px; }
.wear-legend .wl.new  i { background: var(--green-600); }
.wear-legend .wl.mid  i { background: var(--amber-500); }
.wear-legend .wl.worn i { background: var(--red-600); }
.wear-legend .wl.empty i { background: var(--surface-2); border: 1.5px dashed var(--slate-400); }

/* ---- Склад шин + перетаскивание пальцем ---- */
.axsvg .wheel { cursor: grab; }
.axsvg .wheel.tsel rect { stroke: #22d3ee; stroke-width: 4; stroke-dasharray: none; filter: drop-shadow(0 0 4px rgba(34,211,238,.9)); }
.axsvg .wheel.drop-hover rect { stroke: var(--primary); stroke-width: 3; }
.storage-tray { border: 1.5px dashed var(--border-strong); border-radius: var(--r-md); padding: var(--sp-3); margin: 2px 0 12px; background: var(--surface-2); }
.storage-tray.drop-hover { border-color: var(--primary); background: var(--blue-50); }
.tray-head { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: var(--sp-2); }
.tray-head svg { width: 18px; height: 18px; color: var(--text-muted); }
.tray-count { font-weight: 700; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; min-width: 22px; text-align: center; padding: 0 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.tray-hint { color: var(--text-muted); font-size: 11.5px; margin-left: auto; }
.shelf-actions { margin-left: auto; display: inline-flex; gap: 6px; }
.shelf-add { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--primary); color: #fff; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.shelf-add:active { transform: scale(.97); }
.shelf-add.add2 { background: var(--surface); color: var(--primary); border: 1.5px solid var(--primary); }
.entry-only { display: none; }
.sm-entry .entry-only { display: inline-flex; }
.tire-warn { margin-top: 6px; padding: 8px 10px; border-radius: 10px; font-size: 12.5px; font-weight: 600; background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
/* Поле размера с «призраком»-примером: набранное чёрным поверх бледного шаблона. */
.size-wrap { position: relative; }
.size-ghost { position: absolute; inset: 0; z-index: 1; pointer-events: none; display: flex; align-items: center;
  padding: 0 var(--sp-4); border: 1.5px solid transparent; font-size: 16px; white-space: pre; overflow: hidden; letter-spacing: inherit; }
.size-ghost .gh-typed { color: transparent; }
.size-ghost .gh-rest { color: var(--slate-400); }
.tray-body { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.tray-empty { color: var(--text-muted); font-size: 13px; padding: 4px 0; }
.tire-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: 999px; padding: 7px 14px 7px 11px; cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.tire-chip.tsel { border-color: var(--amber-500); box-shadow: 0 0 0 3px var(--accent-ring); }
.tc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--slate-400); flex: none; }
.tc-main { display: flex; flex-direction: column; line-height: 1.2; }
.tc-main b { font-size: 13.5px; }
.tc-main span { font-size: 11px; color: var(--text-muted); }
/* Призрак под пальцем — колесо-«шайба» цвета износа */
.tire-ghost { position: fixed; left: 0; top: 0; z-index: 200; transform: translate(-50%, -50%); pointer-events: none; width: 42px; height: 62px; border-radius: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: var(--shadow-lg); opacity: .97; background: var(--primary); }
.tire-ghost span { width: 26px; height: 2px; background: rgba(255,255,255,.6); border-radius: 2px; }
.tire-ghost.wf-new { background: var(--green-600); } .tire-ghost.wf-mid { background: var(--amber-500); }
.tire-ghost.wf-worn { background: var(--red-600); } .tire-ghost.wf { background: var(--primary); }
/* Во время перетаскивания — только запрет выделения (без overflow:hidden, иначе страница «прыгает») */
body.tdnd, body.tdnd * { -webkit-user-select: none; user-select: none; }
/* «Поп» на переставленной шине */
@keyframes tirePop { 0% { transform: scale(1); } 42% { transform: scale(1.17); } 100% { transform: scale(1); } }
.axsvg .wheel.just-moved rect { transform-box: fill-box; transform-origin: center; animation: tirePop .34s cubic-bezier(.2,.8,.3,1); }
.stire.just-moved .stire-wheel { animation: tirePop .34s cubic-bezier(.2,.8,.3,1); }
@media (prefers-reduced-motion: reduce) { .tire-ghost { transition: none !important; } .axsvg .wheel.just-moved rect, .stire.just-moved .stire-wheel { animation: none; } }
.tire-selbar { position: sticky; bottom: 90px; z-index: 40; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--navy-900); color: #fff; border-radius: var(--r-md); padding: 11px 14px; margin: 10px 0; font-size: 13.5px; box-shadow: var(--shadow-md); }
@media (prefers-color-scheme: dark) { .tire-selbar { background: var(--blue-700); } }
.tire-selbar .selbar-hint { color: rgba(255,255,255,.7); font-size: 12px; }
.tire-selbar .selbar-acts { margin-left: auto; display: flex; gap: 6px; }
.mini-btn { appearance: none; border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: #fff; font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 8px; cursor: pointer; }
.mini-btn:active { transform: scale(.96); }
/* Всплывающее уведомление водителя */
.d-toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(10px); z-index: 300; background: var(--navy-900); color: #fff; font-size: 13.5px; font-weight: 500; padding: 11px 18px; border-radius: 999px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 90vw; text-align: center; }
.d-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-color-scheme: dark) { .d-toast { background: var(--blue-700); } }

/* ⓘ — «провалиться» в шину */
.tire-info { flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); cursor: pointer; }
.tire-info svg { width: 18px; height: 18px; }
.tire-info:active { transform: scale(.94); }
.tire-item .tire-info { margin-left: 2px; }

/* Лоток «На списании» */
.writeoff-tray { margin-top: 10px; border: 1.5px solid var(--amber-500); background: color-mix(in srgb, var(--amber-500) 8%, var(--surface)); border-radius: var(--r-md); padding: 12px; }
.tray-head.wo svg { color: var(--amber-700); }
.tire-chip.wo { border-color: var(--amber-500); cursor: default; touch-action: auto; }

/* Карточка шины (детали + история) */
.tire-card-grid { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; margin-bottom: 14px; }
.tcg-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-top: 1px solid var(--border); font-size: 13.5px; }
.tcg-row:first-child { border-top: 0; }
.tcg-row .k { color: var(--text-muted); flex: none; }
.tcg-row .v { font-weight: 600; text-align: right; }
.tcg-hist-title { font-weight: 700; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.tcg-hist { display: flex; flex-direction: column; gap: 2px; max-height: 190px; overflow-y: auto; }
.hist-row { display: flex; gap: 10px; padding: 7px 2px; align-items: flex-start; }
.hist-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; margin-top: 5px; }
.hist-row b { font-size: 13.5px; font-weight: 700; }
.hist-row span { display: block; color: var(--text-muted); font-size: 11.5px; margin-top: 1px; }
.tcg-acts { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.wo-wait { text-align: center; color: var(--amber-700); font-weight: 600; font-size: 13.5px; padding: 6px; }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); }

/* Фото-вложения */
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.photo-thumb { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); display: flex; align-items: center; justify-content: center; text-decoration: none; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-doc { font-size: 26px; }
.photo-del { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.photo-add { display: inline-flex; align-items: center; gap: 7px; padding: 10px 15px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-md); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; min-height: 46px; }
.photo-add svg { width: 19px; height: 19px; color: var(--primary); }
.photo-add:active { transform: scale(.98); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
