@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@400;600;700&family=Sora:wght@600;700&display=swap");

:root {
  --bg: #eef2f5;
  --bg-accent: #e2e8ef;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #d5dde6;
  --accent: #0f766e;
  --accent-hover: #0d9488;
  --asphalt: #0b1620;
  --asphalt-2: #142433;
  --signal: #2dd4bf;
  --danger: #be123c;
  --ok: #047857;
  --warn: #b45309;
  --radius: 12px;
  --shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.07);
  --font: "Figtree", "Segoe UI", sans-serif;
  --display: "Sora", "Figtree", sans-serif;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1000px 420px at 8% -8%, rgba(45, 212, 191, 0.14), transparent 55%),
    radial-gradient(800px 380px at 100% 0%, rgba(15, 118, 110, 0.08), transparent 50%),
    var(--bg);
  color: var(--ink);
  line-height: 1.45;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  -webkit-tap-highlight-color: rgba(15, 118, 110, 0.12);
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
}
.page-head h1 { margin: 0; }
.tabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.cars-mobile { display: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.top {
  background: linear-gradient(180deg, var(--asphalt-2), var(--asphalt));
  color: #fff;
  padding: 10px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 3px solid var(--signal);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; color: #fff; }
.brand img,
.brand-logo {
  height: 36px;
  width: auto;
  display: block;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: block;
  flex-shrink: 0;
}
.brand-text { color: #f8fafc; }
.brand-text span { color: var(--signal); margin-left: 2px; font-weight: 600; font-size: .72rem; letter-spacing: .14em; vertical-align: 2px; }

.top-page { display: none; }
.nav-toggle { display: none; }
.nav-scrim { display: none; }
.nav-head { display: none; }

.nav { display: flex; flex-wrap: wrap; gap: 4px 4px; align-items: center; }
.nav a {
  color: rgba(255,255,255,.78);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  padding: 7px 11px;
  border-radius: 8px;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.is-on {
  color: var(--asphalt);
  background: var(--signal);
}
.nav-logout { opacity: .85; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 20px 16px 40px; }

h1, h2 { font-family: var(--display); letter-spacing: -0.02em; }
h1 { font-size: 1.55rem; margin: 0 0 16px; font-weight: 700; }
h2 { font-size: 1.12rem; margin: 0 0 10px; font-weight: 650; }

.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 16px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 15px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--signal);
}
.stat .lbl {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.stat .val {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: -0.02em;
}
.stat.debt .val { color: var(--danger); }
.stat.cash .val { color: var(--ok); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  font-weight: 700;
  background: rgba(226, 232, 239, 0.55);
}
tr:hover td { background: rgba(45, 212, 191, 0.07); }

.badge {
  display: inline-block;
  font-size: .74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-accent);
  color: var(--ink);
}
.badge.free { background: #d1fae5; color: var(--ok); }
.badge.rented { background: #ccfbf1; color: #0f766e; }
.badge.repair { background: #ffedd5; color: #9a3412; }
.badge.seized { background: #ffe4e6; color: var(--danger); }

.btn {
  display: inline-block;
  border: 0;
  border-radius: 9px;
  padding: 9px 15px;
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.btn:hover { background: var(--accent-hover); text-decoration: none; color: #fff; }
.btn.secondary {
  background: var(--bg-accent);
  color: var(--ink);
  box-shadow: none;
}
.btn.secondary:hover { background: #cdd6e1; color: var(--ink); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #9f1239; color: #fff; }

.danger-zone {
  margin-top: 18px;
  border-color: rgba(190, 18, 60, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 228, 230, 0.45), #fff 48%);
}
.danger-zone h2 {
  color: var(--danger);
  margin-bottom: 6px;
}
.danger-zone__form {
  margin-top: 12px;
  max-width: 420px;
}
.btn.block { width: 100%; text-align: center; }
.btn.sm { padding: 6px 11px; font-size: .82rem; }

.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; align-items: center; }

label { display: block; font-size: .84rem; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field { margin-bottom: 12px; }
input, select, textarea {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  font-size: 16px; /* iOS: без автозума при фокусе */
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.28);
  border-color: var(--accent);
}
textarea { min-height: 80px; resize: vertical; }
.form-grid {
  display: grid;
  gap: 10px 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.flash {
  padding: 11px 13px;
  border-radius: 9px;
  margin-bottom: 12px;
  font-size: .92rem;
  font-weight: 600;
}
.flash.ok { background: #d1fae5; color: var(--ok); }
.flash.err { background: #ffe4e6; color: var(--danger); }

/* —— login —— */
.guest-page {
  margin: 0;
  min-height: 100vh;
  background: #071018;
}

.login-stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  overflow: hidden;
}

.login-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(20, 184, 166, 0.28), transparent 55%),
    radial-gradient(700px 420px at 90% 80%, rgba(15, 118, 110, 0.22), transparent 50%),
    linear-gradient(165deg, #071018 0%, #0c1c28 48%, #08141c 100%);
}

.login-grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(700px) rotateX(58deg) translateY(-12%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 72%);
  animation: gridDrift 18s linear infinite;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: .55;
  animation: orbFloat 9s ease-in-out infinite;
}
.orb-a {
  width: 280px; height: 280px;
  left: -60px; top: 12%;
  background: rgba(45, 212, 191, 0.35);
}
.orb-b {
  width: 220px; height: 220px;
  right: -40px; bottom: 18%;
  background: rgba(14, 116, 144, 0.4);
  animation-delay: -3s;
}
.orb-c {
  width: 160px; height: 160px;
  left: 42%; bottom: 8%;
  background: rgba(94, 234, 212, 0.22);
  animation-delay: -5.5s;
}

.login-intro {
  position: absolute;
  z-index: 3;
  text-align: center;
  color: #ecfdf5;
  transition: opacity .55s ease, transform .7s cubic-bezier(.22, 1, .36, 1);
}
.intro-mark-wrap {
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.intro-mark {
  opacity: 0;
  transform: scale(.72) rotate(-8deg);
  filter: drop-shadow(0 18px 40px rgba(15, 118, 110, 0.45));
  animation: markIn .9s cubic-bezier(.22, 1, .36, 1) .15s forwards;
}
.intro-mark-glyph {
  opacity: 0;
  animation: glyphIn .55s ease .55s forwards;
}
.intro-word {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -.04em;
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp .7s ease .55s forwards;
}
.intro-tag {
  margin: 8px 0 0;
  font-size: .85rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(153, 246, 228, 0.75);
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp .65s ease .8s forwards;
}

.guest-box--login {
  position: relative;
  z-index: 4;
  width: min(400px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  padding: 26px 24px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 24px 60px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(28px) scale(.96);
  pointer-events: none;
  transition: opacity .55s ease, transform .7s cubic-bezier(.22, 1, .36, 1);
}
.guest-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.guest-logo img { height: 44px; width: auto; }
.guest-box h1 {
  margin-bottom: 6px;
  text-align: center;
  font-size: 1.35rem;
}
.guest-box .sub {
  color: var(--muted);
  margin-bottom: 18px;
  font-size: .92rem;
  text-align: center;
}

.login-stage.is-settled .login-intro {
  opacity: 0;
  transform: translateY(-24px) scale(.92);
  pointer-events: none;
}
.login-stage.is-settled .guest-box--login {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

@keyframes markIn {
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes glyphIn {
  to { opacity: 1; }
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(18px, -22px); }
}
@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 48px, 48px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .login-grid,
  .orb,
  .intro-mark,
  .intro-mark-glyph,
  .intro-word,
  .intro-tag {
    animation: none !important;
  }
  .login-intro { display: none; }
  .guest-box--login {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    transition: none;
  }
}

.muted { color: var(--muted); }
.right { text-align: right; }
.debt-amt { color: var(--danger); font-weight: 700; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.media-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}
.media-item img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--bg-accent);
}
.doc-tile {
  display: grid;
  place-items: center;
  height: 140px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--accent);
  background: var(--bg-accent);
  text-decoration: none;
}
.media-meta {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .82rem;
}
.upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.alert-card {
  border-color: #5eead4;
  background: linear-gradient(180deg, #f0fdfa, var(--card));
}
tr.row-warn td { background: #fffbeb; }
tr.row-danger td { background: #fff1f2; }

.report-bar-row { margin-bottom: 12px; }
.report-bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .9rem;
  margin-bottom: 5px;
}
.report-bar-meta span { color: var(--muted); white-space: nowrap; }
.report-bar {
  height: 8px;
  background: var(--bg-accent);
  border-radius: 999px;
  overflow: hidden;
}
.report-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--signal));
  border-radius: 999px;
  min-width: 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88em;
  background: var(--bg-accent);
  padding: 1px 6px;
  border-radius: 5px;
}


/* лось после логина */
.igor-moose-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: #071018;
  overflow: hidden;
}
.igor-moose {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 12px max(20px, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  background:
    radial-gradient(900px 500px at 50% 80%, rgba(20, 184, 166, 0.2), transparent 55%),
    #071018;
}
.igor-moose[hidden] {
  display: none !important;
}
.igor-moose__flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 70%, rgba(255, 255, 255, 0.2), transparent 50%);
  opacity: 0;
}
.igor-moose.is-yelling .igor-moose__flash {
  animation: mooseFlash .55s ease .2s 2;
}
.igor-moose__runner {
  position: relative;
  width: min(420px, 70vw);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: moosePopIn 2.2s cubic-bezier(.2, .75, .25, 1) forwards;
}
.igor-moose.is-gate .igor-moose__runner {
  animation-duration: 2s;
}
.igor-moose__svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(46vh, 360px);
  filter: drop-shadow(0 20px 28px rgba(15, 23, 42, .4));
  animation: mooseBob .22s ease-in-out infinite alternate;
  transform-origin: 50% 90%;
}
.igor-moose.is-yelling .igor-moose__svg {
  animation: mooseScream .18s ease-in-out infinite alternate;
}
.igor-moose.is-yelling .igor-moose__mouth {
  transform-box: fill-box;
  transform-origin: center;
  animation: mooseMouth .14s ease-in-out infinite alternate;
}
.igor-moose__bubble {
  position: relative;
  z-index: 2;
  margin-bottom: -6px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.6rem, 6vw, 3.2rem);
  letter-spacing: -.04em;
  line-height: 1;
  color: #0f172a;
  background: #fff;
  border: 4px solid #0f766e;
  border-radius: 18px;
  padding: 10px 16px 12px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .28);
  opacity: 0;
  transform: scale(.55) translateY(18px);
  animation: mooseYell .35s cubic-bezier(.2, 1.4, .3, 1) .15s forwards;
}
.igor-moose.is-yelling .igor-moose__bubble {
  animation: mooseYell .35s cubic-bezier(.2, 1.4, .3, 1) .15s forwards, mooseYellPulse .32s ease .5s infinite;
}
.igor-moose__bubble::after {
  content: "";
  position: absolute;
  left: 58%;
  bottom: -11px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-right: 4px solid #0f766e;
  border-bottom: 4px solid #0f766e;
  transform: translateX(-50%) rotate(45deg);
}

@keyframes moosePopIn {
  0% { transform: translateX(-24vw) scale(.88); opacity: 0; }
  18% { transform: translateX(0) scale(1); opacity: 1; }
  72% { transform: translateX(0) scale(1); opacity: 1; }
  100% { transform: translateX(22vw) scale(.94); opacity: 0; }
}
@keyframes mooseBob {
  from { transform: translateY(0) rotate(-1.5deg); }
  to { transform: translateY(-8px) rotate(2deg); }
}
@keyframes mooseScream {
  from { transform: translateY(0) scale(1) rotate(-2deg); }
  to { transform: translateY(-12px) scale(1.04) rotate(3deg); }
}
@keyframes mooseMouth {
  from { transform: scaleY(1); }
  to { transform: scaleY(1.4); }
}
@keyframes mooseYell {
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes mooseYellPulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.08) rotate(-1.5deg); }
}
@keyframes mooseFlash {
  0%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .igor-moose__runner { animation: none; opacity: 1; transform: none; }
  .igor-moose__svg,
  .igor-moose.is-yelling .igor-moose__svg,
  .igor-moose.is-yelling .igor-moose__mouth { animation: none; }
  .igor-moose__bubble,
  .igor-moose.is-yelling .igor-moose__bubble {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .igor-moose__flash { display: none; }
}

/* телефон: весь лось в кадре */
@media (max-width: 900px) {
  .igor-moose {
    align-items: center;
    justify-content: center;
    padding: 16px 20px max(28px, env(safe-area-inset-bottom, 0px));
  }
  .igor-moose__runner,
  .igor-moose.is-gate .igor-moose__runner {
    width: min(200px, 55vw) !important;
    max-width: 200px !important;
    animation: moosePopMobile 1.9s ease forwards !important;
  }
  .igor-moose__svg {
    width: 100% !important;
    max-height: min(26vh, 160px) !important;
  }
  .igor-moose.is-yelling .igor-moose__svg {
    animation: mooseScreamMobile .18s ease-in-out infinite alternate !important;
  }
  .igor-moose__bubble {
    font-size: clamp(1.2rem, 6vw, 1.65rem) !important;
    border-width: 3px;
    border-radius: 14px;
    padding: 6px 10px 8px;
    margin-bottom: 0;
  }
  .igor-moose__bubble::after {
    width: 11px;
    height: 11px;
    bottom: -6px;
    border-right-width: 3px;
    border-bottom-width: 3px;
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 12px 12px max(28px, env(safe-area-inset-bottom, 0px));
  }
  th, td { padding: 8px 6px; }
  .brand-logo { height: 30px; }

  h1 { font-size: 1.28rem; }
  .page-head { margin-bottom: 12px; }
  .page-head .btn { min-height: 44px; padding-inline: 16px; }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat { padding: 12px; }
  .stat .val { font-size: 1.15rem; }

  .row-actions { gap: 8px; }
  .row-actions .btn,
  .tabs-row .btn {
    min-height: 40px;
  }

  .card {
    padding: 12px 14px;
    margin-bottom: 12px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    margin-inline: -2px;
    -webkit-overflow-scrolling: touch;
  }

  /* таблицы → карточки */
  .stack-table thead { display: none; }
  .stack-table,
  .stack-table tbody {
    display: block;
    width: 100%;
  }
  .stack-table tr {
    display: block;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
  }
  .stack-table tr:hover td { background: transparent; }
  .stack-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(213, 221, 230, 0.9);
    text-align: right;
  }
  .stack-table td:last-child { border-bottom: 0; }
  .stack-table td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    max-width: 42%;
    text-align: left;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.35;
  }
  .stack-table td[data-label=""] {
    justify-content: flex-end;
    padding-top: 10px;
  }
  .stack-table td[data-label=""]::before { display: none; }
  .card.table-wrap:has(.stack-table) {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  /* авто: плитки вместо таблицы */
  .cars-desktop { display: none; }
  .cars-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .car-tile {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 12px;
    align-items: start;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    box-shadow: var(--shadow);
  }
  .car-tile__media {
    display: block;
    width: 76px;
    height: 76px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #e2e8f0;
  }
  .car-tile__media img,
  .car-tile__media .cars-thumb--empty {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .car-tile__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .car-tile__plate {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink);
    text-decoration: none;
  }
  .car-tile__plate:hover { color: var(--accent); }
  .car-tile__model {
    color: var(--muted);
    font-size: .9rem;
    margin: 4px 0 8px;
  }
  .car-tile__meta { margin-bottom: 10px; }
  .car-tile__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .car-tile__actions .btn {
    min-height: 40px;
    flex: 1 1 auto;
    text-align: center;
  }
  .gps-pin {
    width: 40px;
    height: 40px;
  }
  .gps-pin--wide {
    width: auto;
    height: auto;
    border-radius: 9px;
    color: inherit;
  }

  .map-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .map-toolbar .row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .map-toolbar .row-actions .btn,
  .map-toolbar .row-actions form {
    width: 100%;
  }
  .map-toolbar .row-actions .btn {
    width: 100%;
    min-height: 42px;
    text-align: center;
  }
  .map-toolbar .row-actions form:last-of-type,
  .map-toolbar .row-actions #mapSetupToggle {
    grid-column: 1 / -1;
  }

  .map-frame-wrap,
  .map-frame {
    min-height: calc(100dvh - 210px);
    height: calc(100dvh - 210px);
    border-radius: 12px;
  }

  .gps-modal__head {
    padding-top: max(12px, env(safe-area-inset-top, 0px));
  }
  .gps-modal__close {
    width: 44px;
    height: 44px;
  }
}

/* мобильное меню */
@media (max-width: 860px) {
  .top {
    flex-wrap: nowrap;
    gap: 10px;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    min-height: 56px;
  }
  .brand-text { display: none; }
  .brand-mark { width: 32px; height: 32px; }
  .top-page {
    display: block;
    flex: 1;
    min-width: 0;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: rgba(255,255,255,.1);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
  }
  .nav-toggle:hover,
  .nav-toggle:focus-visible {
    background: rgba(255,255,255,.16);
    outline: none;
  }
  .nav-toggle__bars,
  .nav-toggle__bars::before,
  .nav-toggle__bars::after {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    position: relative;
    transition: transform .2s ease, opacity .2s ease;
  }
  .nav-toggle__bars::before,
  .nav-toggle__bars::after {
    content: "";
    position: absolute;
    left: 0;
  }
  .nav-toggle__bars::before { top: -6px; }
  .nav-toggle__bars::after { top: 6px; }
  body.nav-open .nav-toggle__bars { background: transparent; }
  body.nav-open .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
  body.nav-open .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

  .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(7, 16, 24, .55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  body.nav-open .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .nav-scrim[hidden] { display: none !important; }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    width: min(320px, 86vw);
    margin: 0;
    padding: 12px 12px max(20px, env(safe-area-inset-bottom, 0px));
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 4px;
    background: #0b1620;
    border-left: 3px solid var(--signal);
    box-shadow: -16px 0 40px rgba(0,0,0,.35);
    transform: translateX(105%);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.nav-open .nav { transform: translateX(0); }
  body.nav-open { overflow: hidden; }

  .nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 6px 14px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,.1);
  }
  .nav-head__title {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.05rem;
  }
  .nav-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: rgba(255,255,255,.08);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
  }

  .nav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 14px;
    font-size: 1.05rem;
    border-radius: 12px;
  }
  .nav a.is-on {
    color: var(--asphalt);
    background: var(--signal);
    font-weight: 700;
  }
  .nav-logout {
    margin-top: 10px;
    border-top: 1px solid rgba(255,255,255,.1);
    border-radius: 12px 12px 0 0;
    color: #fecaca !important;
  }
  .nav-logout:hover {
    background: rgba(190, 18, 60, .18) !important;
    color: #fff !important;
  }
}

@keyframes moosePopMobile {
  0% { transform: translateY(18%) scale(.72); opacity: 0; }
  18% { transform: translateY(0) scale(1); opacity: 1; }
  78% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(4%) scale(.97); opacity: 0; }
}
@keyframes mooseScreamMobile {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-5px) scale(1.03); }
}

.igor-moose__tap {
  position: absolute;
  left: 50%;
  bottom: 16%;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: auto;
  white-space: nowrap;
}

/* карта парка */
.map-page { margin: -4px 0 0; }
.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
}
.map-toolbar h1 { margin: 0; }
.map-toolbar__sub { margin: 4px 0 0; }
.map-frame-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b1620;
  box-shadow: var(--shadow);
  min-height: min(72vh, 720px);
}
.map-frame {
  display: block;
  width: 100%;
  height: min(72vh, 720px);
  border: 0;
  background: #0b1620;
}
.map-setup { margin-top: 14px; }
.map-setup.is-collapsed { display: none; }
.map-steps {
  margin: 0 0 14px;
  padding-left: 1.2em;
  line-height: 1.55;
}
@media (max-width: 640px) {
  .map-frame-wrap,
  .map-frame {
    min-height: calc(100dvh - 180px);
    height: calc(100dvh - 180px);
  }
}

/* карта одного авто */
.car-gps__meta { margin: 0 0 10px; }
.car-map-frame-wrap,
.car-map-frame {
  min-height: min(52vh, 480px);
  height: min(52vh, 480px);
}
@media (max-width: 640px) {
  .car-map-frame-wrap,
  .car-map-frame {
    min-height: min(58vh, 420px);
    height: min(58vh, 420px);
  }
}

/* пин в списке авто */
.gps-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  color: var(--accent);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.gps-pin:hover,
.gps-pin:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  outline: none;
}

/* попап карты */
body.gps-modal-open { overflow: hidden; }
.gps-modal[hidden] { display: none !important; }
.gps-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
}
.gps-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  border: 0;
  cursor: pointer;
}
.gps-modal__panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(90dvh, 820px);
  display: flex;
  flex-direction: column;
  background: var(--card, #fff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.gps-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.gps-modal__head h2 {
  margin: 0;
  font-size: 1.05rem;
}
.gps-modal__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text, #0f172a);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.gps-modal__close:hover { background: rgba(15, 23, 42, .06); }
.gps-modal__frame-wrap {
  flex: 1;
  min-height: min(70dvh, 640px);
  background: #0b1620;
}
.gps-modal__frame {
  display: block;
  width: 100%;
  height: min(70dvh, 640px);
  border: 0;
  background: #0b1620;
}
@media (max-width: 640px) {
  .gps-modal { padding: 0; }
  .gps-modal__panel {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }
  .gps-modal__frame-wrap,
  .gps-modal__frame {
    min-height: calc(100dvh - 58px);
    height: calc(100dvh - 58px);
  }
}

/* миниатюры авто в списке */
.cars-thumb-cell { width: 56px; }
.cars-thumb {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e2e8f0;
}
.cars-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cars-thumb--empty {
  background:
    linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
}

.car-gps-bind {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.car-gps-bind__preview {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #e2e8f0;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: .78rem;
  text-align: center;
  padding: 6px;
}
.car-gps-bind__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.check-row {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 500;
  cursor: pointer;
}
.check-row input { width: auto; margin: 0; }
@media (max-width: 640px) {
  .car-gps-bind { flex-direction: column; }
}
