/* v3-home.css — «Главная» по design-canvas/Home.dc.html (1 в 1),
   тёмная — по DarkHome.dc.html. Цвета, которым нет токена в ките, — свои
   переменные ниже, со значениями для тёмной темы. */
.v3h { --v3h-track: rgba(60,66,78,.1); --v3h-sep: rgba(60,66,78,.08); --v3h-map: #e9ecef;
  --v3h-mapline: rgba(60,66,78,.1); --v3h-glass: rgba(255,255,255,.92); --v3h-base: #1c1c1e;
  --v3h-acc-line: rgba(10,95,208,.35);
  display: flex; flex-direction: column; gap: 14px; height: 100%; min-height: 0; line-height: normal; }
[data-theme="dark"] .v3h { --v3h-track: rgba(255,255,255,.08); --v3h-sep: rgba(255,255,255,.06); --v3h-map: #15171a;
  --v3h-mapline: rgba(255,255,255,.08); --v3h-glass: rgba(31,33,38,.92); --v3h-base: #3a3d45;
  --v3h-acc-line: rgba(77,163,255,.35); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .v3h { --v3h-track: rgba(255,255,255,.08); --v3h-sep: rgba(255,255,255,.06); --v3h-map: #15171a;
    --v3h-mapline: rgba(255,255,255,.08); --v3h-glass: rgba(31,33,38,.92); --v3h-base: #3a3d45;
    --v3h-acc-line: rgba(77,163,255,.35); }
}

/* ── Шапка ── */
.v3h-head { display: flex; align-items: center; gap: 14px; padding: 16px 16px 16px 24px; flex-shrink: 0; }
.v3h-head .v3-h1 { flex-shrink: 0; }
.v3h-date { font-size: 15px; font-weight: 600; color: var(--t-ink-3); white-space: nowrap; }
.v3h-live { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; border-radius: 12px;
  padding: 6px 11px; white-space: nowrap; color: var(--t-ok-ink); background: rgba(20,150,79,.1); }
.v3h-live[hidden] { display: none; }
.v3h-live i { width: 7px; height: 7px; border-radius: 4px; background: #14964f; }
.v3h-live.warn { color: var(--t-warn-ink); background: rgba(232,137,12,.14); }
.v3h-live.warn i { background: #e8890c; }
.v3h-live.off { color: var(--t-ink-3); background: var(--t-nested); }
.v3h-live.off i { background: var(--t-ink-4); }
.v3h-new { padding: 0 20px 0 16px; font-size: 14.5px; }

/* ── Плитки ── */
.v3h-tiles { display: flex; gap: 14px; flex-shrink: 0; }
.v3h-tile { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px;
  border-radius: 26px; color: var(--t-ink); background: var(--t-surface); border: 1px solid var(--t-line);
  box-shadow: var(--sh-panel); box-sizing: border-box; font: inherit; text-align: left; cursor: pointer; }
.v3h-tile:hover { border-color: var(--t-line-2); }
.v3h-tile.bad { background: rgba(224,49,63,.07); border: 1.5px solid rgba(224,49,63,.3); box-shadow: none; }
.v3h-tile.acc { background: var(--t-blue-tint); border: 1.5px solid var(--v3h-acc-line); box-shadow: none; }
.v3h-tk { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--t-ink-3); }
.v3h-tile.bad .v3h-tk { color: var(--t-bad-ink); }
.v3h-tile.acc .v3h-tk { color: var(--t-blue-ink); }
.v3h-tv { font-size: 30px; font-weight: 760; letter-spacing: -.03em; white-space: nowrap; font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; }
.v3h-ts { font-size: 13px; color: var(--t-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v3h-tb { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--v3h-track); margin-top: 2px; }

/* ── Низ: дела и лента | машины ── */
.v3h-body { flex-grow: 1; min-height: 0; display: flex; gap: 14px; }
.v3h-main { display: flex; flex-direction: column; overflow: hidden; flex-grow: 1; min-width: 0; }
.v3h-sh { display: flex; align-items: baseline; gap: 10px; }
.v3h-sh h3 { margin: 0; font-size: 18px; font-weight: 750; letter-spacing: -.015em; flex-grow: 1; }
.v3h-sh a { font-size: 13.5px; font-weight: 650; color: var(--t-blue); text-decoration: none; white-space: nowrap; }
.v3h-sh a:hover { color: var(--t-blue-ink); }
.v3h-shn { font-size: 13px; color: var(--t-ink-3); white-space: nowrap; }
.v3h-muted { color: var(--t-ink-3); font-size: 13.5px; padding: 6px 0; }

.v3h-needs { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.v3h-nlist { display: flex; flex-direction: column; gap: 10px; }
.v3h-badge { min-width: 22px; height: 22px; padding: 0 7px; box-sizing: border-box; border-radius: 11px; font-size: 12px;
  font-weight: 750; display: flex; align-items: center; justify-content: center; background: #e0313f; color: #fff; }
.v3h-badge[hidden] { display: none; }
.v3h-nrow { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 20px;
  border: 1px solid var(--t-line); background: var(--t-surface); }
.v3h-ndot { width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; }
.v3h-ndot.bad { background: #e0313f; box-shadow: 0 0 0 3px rgba(224,49,63,.12); }
.v3h-ndot.warn { background: #e8890c; box-shadow: 0 0 0 3px rgba(232,137,12,.16); }
.v3h-ndot.info { background: #0a5fd0; box-shadow: 0 0 0 3px rgba(10,95,208,.1); }
.v3h-ntx { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.v3h-n1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.v3h-tag { font-size: 11.5px; font-weight: 750; padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.v3h-tag.bad { background: rgba(224,49,63,.12); color: var(--t-bad-ink); }
.v3h-tag.warn { background: rgba(232,137,12,.16); color: var(--t-warn-ink); }
.v3h-tag.info { background: rgba(10,95,208,.1); color: var(--t-blue-ink); }
.v3h-nt { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v3h-n2 { font-size: 13px; color: var(--t-ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v3h-nbtn { flex-shrink: 0; white-space: nowrap; height: 34px; display: flex; align-items: center; padding: 0 14px;
  border-radius: 17px; border: 1px solid var(--t-line); background: var(--t-surface); color: var(--t-ink); font: inherit;
  font-weight: 650; font-size: 13.5px; box-shadow: 0 1px 2px rgba(22,26,36,.06); cursor: pointer; }
.v3h-nbtn:hover { background: var(--t-row); }
.v3h-nbtn:disabled { opacity: .5; cursor: default; }

.v3h-feedbox { padding: 4px 22px 18px; display: flex; flex-direction: column; flex-grow: 1; min-height: 0; }
.v3h-feed { margin-top: 6px; min-height: 0; overflow: auto; scrollbar-width: none; }
.v3h-feed::-webkit-scrollbar { display: none; }
.v3h-frow { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--v3h-sep); }
.v3h-frow[onclick] { cursor: pointer; }
.v3h-frow[onclick]:hover .v3h-fx { color: var(--t-blue-ink); }
.v3h-ft { width: 44px; flex-shrink: 0; font-size: 13px; font-weight: 650; color: var(--t-ink-3); font-variant-numeric: tabular-nums; }
.v3h-fd { width: 8px; height: 8px; border-radius: 4px; margin-top: 6px; flex-shrink: 0; }
.v3h-fx { flex-grow: 1; min-width: 0; font-size: 13.5px; }
.v3h-fw { font-size: 12.5px; color: var(--t-ink-3); white-space: nowrap; }

/* ── Машины сейчас ── */
.v3h-fleet { width: 400px; flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden; }
.v3h-fin { padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; min-height: 0; flex-grow: 1; }
.v3h-map { position: relative; height: 220px; flex-shrink: 0; border-radius: 22px; overflow: hidden;
  background: var(--v3h-map); border: 1px solid var(--v3h-mapline); isolation: isolate; }
.v3h-leaf { position: absolute; inset: 0; }
.v3h-leaf.leaflet-container { background: var(--v3h-map); font: inherit; }
.v3h-bigmap { position: absolute; right: 10px; bottom: 10px; z-index: 1000; height: 32px; display: flex; align-items: center;
  gap: 6px; padding: 0 12px; border-radius: 16px; background: var(--v3h-glass); color: var(--t-ink); font: inherit;
  font-size: 13px; font-weight: 650; border: 1px solid var(--t-line); cursor: pointer; }
/* машины и база на карте — .pm-* в v3-fleet.css (как в полуручном) */

.v3h-mrows { display: flex; flex-direction: column; min-height: 0; overflow: auto; scrollbar-width: none; }
.v3h-mrows::-webkit-scrollbar { display: none; }
.v3h-mrow { flex-shrink: 0; width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 4px; border: 0;
  border-bottom: 1px solid var(--v3h-sep); background: none; font: inherit; color: var(--t-ink); text-align: left; cursor: pointer; }
.v3h-mrow:hover { background: var(--t-row); }
.v3h-md { width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; }
.v3h-mc { width: 44px; flex-shrink: 0; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v3h-mi { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.v3h-ms { font-size: 13.5px; font-weight: 650; color: var(--t-blue-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v3h-ms.ok { color: #14964f; }
.v3h-ms.bad { color: var(--t-bad-ink); }
.v3h-ms.idle { color: var(--t-ink-3); }
.v3h-mp { font-size: 12.5px; color: var(--t-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v3h-mb { width: 56px; height: 5px; flex-shrink: 0; border-radius: 3px; background: var(--v3h-track); display: flex; overflow: hidden; }
.v3h-mb i { background: #0a4fa8; }
.v3h-mb.ok i { background: #14964f; }

/* ── Телефон: MobHome.dc.html ──
   Свои классы .v3hm-*, чтобы не задеть компьютер. Плитки носят те же id,
   что компьютерные (v3h-t-*), — их наполняет общий код. */
@media (max-width: 860px) {
  .v3hm { font-size: 15px; line-height: normal; color: var(--t-ink); }
  .v3hm-top { padding: 16px 16px 10px; display: flex; flex-direction: column; gap: 8px; }
  .v3hm-bar { display: flex; align-items: center; gap: 10px; min-height: 40px; }
  .v3hm-date { font-size: 14px; font-weight: 650; color: var(--t-ink-3); flex-grow: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* круглые 40, как в макете; касание — 44 за счёт невидимого поля вокруг */
  .v3hm-ic { position: relative; flex-shrink: 0; width: 40px; height: 40px; padding: 0; border-radius: 20px; border: 0;
    background: var(--t-surface); color: var(--t-ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
  .v3hm-ic::after { content: ''; position: absolute; inset: -2px; }
  .v3hm-ic.pri { background: var(--t-blue-grad); color: #fff; box-shadow: var(--sh-pri); }
  .v3hm-title { margin: 0; font-size: 30px; font-weight: 760; letter-spacing: -.03em; line-height: 1.1; }

  .v3hm-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
  .v3hm-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .v3hm-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 13px 14px; box-sizing: border-box;
    border-radius: 20px; background: var(--t-surface); border: 1px solid var(--t-line); color: var(--t-ink);
    font: inherit; text-align: left; cursor: pointer; }
  .v3hm-tile.bad { background: rgba(224,49,63,.07); border: 1.5px solid rgba(224,49,63,.3); }
  .v3hm-tile.acc { background: var(--t-blue-tint); border: 1.5px solid var(--v3hm-acc-line, rgba(10,95,208,.35)); }
  .v3hm-tk { font-size: 13px; font-weight: 700; color: var(--t-ink-3); }
  .v3hm-tile.bad .v3hm-tk { color: var(--t-bad-ink); }
  .v3hm-tile.acc .v3hm-tk { color: var(--t-blue-ink); }
  .v3hm-tv { font-size: 24px; font-weight: 760; letter-spacing: -.03em; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
  .v3hm-ts { font-size: 12.5px; color: var(--t-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .v3hm-sh { display: flex; align-items: baseline; gap: 8px; padding: 6px 4px 0; }
  /* карта машин на телефоне: карточка во всю ширину, позиции ТИС — плашкой поверх */
  .v3hm-map { position: relative; height: clamp(230px, 38vh, 340px); border-radius: 22px; overflow: hidden;
    background: var(--t-nested); box-shadow: 0 1px 2px rgba(22,26,36,.06); isolation: isolate; }
  .v3hm-map .v3h-leaf { position: absolute; inset: 0; }
  .v3hm-live { position: absolute; left: 10px; top: 10px; z-index: 500; }
  .v3hm-sh h2 { margin: 0; font-size: 18px; font-weight: 750; flex-grow: 1; color: var(--t-ink); }
  .v3hm-sh a { font-size: 15px; font-weight: 650; color: var(--t-blue); text-decoration: none; padding: 12px 4px; margin: -12px -4px; }
  .v3hm-sh a[hidden] { display: none; }
  .v3hm-list { display: flex; flex-direction: column; gap: 10px; }
  .v3hm-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; box-sizing: border-box;
    border-radius: 20px; border: 0; background: var(--t-surface); color: var(--t-ink); font: inherit; text-align: left; cursor: pointer; }
  .v3hm-dot { width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; background: #0a5fd0; }
  .v3hm-dot.bad { background: #e0313f; }
  .v3hm-dot.warn { background: #e8890c; }
  .v3hm-rtx { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
  .v3hm-r1 { display: flex; align-items: center; gap: 7px; min-width: 0; }
  .v3hm-tag { flex-shrink: 0; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 9px; white-space: nowrap;
    background: rgba(10,95,208,.1); color: #0a4fa8; }
  .v3hm-tag.bad { background: rgba(224,49,63,.12); color: #b3202e; }
  .v3hm-tag.warn { background: rgba(232,137,12,.16); color: #8a4b00; }
  .v3hm-rt { font-size: 15.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .v3hm-r2 { font-size: 13.5px; color: var(--t-ink-3); }
  .v3hm-chev { flex-shrink: 0; color: var(--t-ink-4); }
  .v3hm-muted { padding: 6px 4px; color: var(--t-ink-3); }

  /* тёмная: светлые тона макета — оттенком */
  [data-theme="dark"] .v3hm { --v3hm-acc-line: rgba(77,163,255,.35); }
  [data-theme="dark"] .v3hm-tile.bad { background: rgba(255,90,100,.1); border-color: rgba(255,90,100,.3); }
  [data-theme="dark"] .v3hm-tag { background: rgba(77,163,255,.16); color: var(--t-blue-ink); }
  [data-theme="dark"] .v3hm-tag.bad { background: rgba(255,90,100,.18); color: var(--t-bad-ink); }
  [data-theme="dark"] .v3hm-tag.warn { background: rgba(255,178,60,.18); color: #ffcf85; }
}
@media (max-width: 860px) and (prefers-color-scheme: dark) {
  :root:not([data-theme]) .v3hm { --v3hm-acc-line: rgba(77,163,255,.35); }
  :root:not([data-theme]) .v3hm-tile.bad { background: rgba(255,90,100,.1); border-color: rgba(255,90,100,.3); }
  :root:not([data-theme]) .v3hm-tag { background: rgba(77,163,255,.16); color: var(--t-blue-ink); }
  :root:not([data-theme]) .v3hm-tag.bad { background: rgba(255,90,100,.18); color: var(--t-bad-ink); }
  :root:not([data-theme]) .v3hm-tag.warn { background: rgba(255,178,60,.18); color: #ffcf85; }
}

/* ── Раскладка с большой картой (26.09.2026, просьба Тимура: «нужна большая
   карта», как на прежней главной). Карта — всё, что слева; справа дела/лента
   вкладками и список машин. ── */
@media (min-width: 861px) {
  .v3h-mappanel { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 18px 16px 16px; overflow: hidden; }
  .v3h-mappanel .v3h-sh { padding: 0 4px; }
  .v3h-mappanel .v3h-map { flex-grow: 1; height: auto; min-height: 260px; }
  .v3h-side { width: 420px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
  .v3h-side .v3h-main { flex: 1.25 1 0; min-height: 0; }
  .v3h-side .v3h-fleet { width: auto; flex: 1 1 0; min-height: 0; }
  .v3h-tabs { display: flex; gap: 3px; padding: 3px; margin: 14px 14px 0; border-radius: 17px; background: var(--t-nested);
    border: 1px solid var(--t-line); flex-shrink: 0; }
  .v3h-tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px;
    border: 0; border-radius: 14px; background: none; font: 650 13.5px var(--t-font); color: var(--t-ink-2); cursor: pointer; }
  .v3h-tabs button.on { background: var(--t-surface); color: var(--t-blue-ink); box-shadow: 0 1px 3px rgba(22,26,36,.16); }
  .v3h-side .v3h-needs { padding: 12px 14px 14px; flex-grow: 1; min-height: 0; overflow: auto; scrollbar-width: none; }
  .v3h-side .v3h-needs::-webkit-scrollbar { display: none; }
  .v3h-side .v3h-nrow { flex-wrap: wrap; }
  .v3h-side .v3h-nbtn { margin-left: 22px; }
  .v3h-side .v3h-feedbox { padding: 8px 18px 14px; }
  .v3h-side .v3h-feedbox[hidden], .v3h-side .v3h-needs[hidden] { display: none; }
  .v3h-all { align-self: flex-start; margin-top: 8px; font-size: 13.5px; font-weight: 650; color: var(--t-blue); text-decoration: none; }
}
@media (min-width: 861px) {
  /* узкая колонка: точка | текст, кнопка — под текстом, а не отдельной строкой с точкой */
  .v3h-side .v3h-nrow { display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: 12px; row-gap: 8px;
    align-items: center; flex-wrap: nowrap; }
  .v3h-side .v3h-nbtn { grid-column: 2; justify-self: start; margin-left: 0; }
}

/* ── Любая ширина (320–1920+). Плитки и колонки подстраиваются под свою
   ширину (контейнерные запросы): при 1440 с меню 236 и на телефоне 390 —
   как в макете. Главное число плитки не режется — шрифт мельчает (cqi). ── */
.v3h { container: v3h / inline-size; }
.v3h-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.v3h-tile { container-type: inline-size; }
.v3h-tv { font-size: clamp(22px, 17cqi, 30px); }
@container v3h (max-width: 860px) {
  .v3h-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 861px) {
  @container v3h (max-width: 900px) { .v3h-side { width: 360px; } }
  @container v3h (min-width: 1500px) { .v3h-side { width: 460px; } }
}
@media (max-width: 860px) {
  .v3hm-body { container: v3hmt / inline-size; }
  .v3hm-tile { container-type: inline-size; }
  .v3hm-tv { font-size: clamp(18px, 18cqi, 24px); }
  /* 600–860: не растянутый телефон — плитки в ряд, дела в две колонки */
  @container v3hmt (min-width: 600px) {
    .v3hm-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .v3hm-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .v3hm-list > :not(.v3hm-row) { grid-column: 1 / -1; }
  }
}

/* вкладки «Нужно решить / Лента дня»: скрытая панель не показывается (display:flex её перебивал) */
.v3h-needs[hidden], .v3h-feedbox[hidden] { display: none !important; }
