/* ===== ТКасимов — мини-приложение ===== */

:root {
  --teal-900: #0b4f4a;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-400: #2dd4bf;
  --teal-200: #99f6e4;
  --accent: #f5912b;
  --accent-600: #e07d12;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e6e9ef;
  --bg-card: #ffffff;
  --green: #16a34a;
  --red: #dc2626;
  --radius: 24px;
  --shadow: 0 18px 45px rgba(8, 47, 44, 0.18);
  --shadow-sm: 0 8px 22px rgba(8, 47, 44, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(125% 70% at 50% -8%, #1ec3ad 0%, transparent 55%),
    radial-gradient(80% 50% at 102% 2%, rgba(245,145,43,0.28) 0%, transparent 52%),
    linear-gradient(180deg, var(--teal-700) 0%, var(--teal-900) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

body.view-home {
  overflow: hidden;
  height: 100dvh;
}

.app {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding:
    calc(12px + env(safe-area-inset-top)) 16px
    calc(24px + env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.view-home .app {
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

body.has-install-panel.view-home .app {
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}

body.has-install-panel:not(.view-home) .app {
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

/* home fills the screen so there's no dead zone at the bottom */
#homeView {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 4px 0;
  min-height: 0;
  overflow: hidden;
}

body.view-home .topbar { padding-bottom: 10px; flex: none; }
body.view-home .lead {
  margin-top: auto;
  margin-bottom: 14px;
  font-size: 16px;
  flex: none;
}
body.view-home .home-actions {
  gap: 10px;
  flex: none;
}
body.view-home .action-tile { padding: 16px 18px; border-radius: 18px; gap: 14px; }
body.view-home .action-tile .ico {
  width: 46px; height: 46px; border-radius: 14px;
}
body.view-home .action-tile .ico svg { width: 22px; height: 22px; }
body.view-home .action-tile .tt { font-size: 16px; }
body.view-home .offline-bar {
  margin-top: auto;
  margin-bottom: 2px;
  flex: none;
}
body.view-home footer {
  padding-top: 10px;
  padding-bottom: 0;
  flex: none;
  font-size: 12px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  animation: cardIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.hidden { display: none !important; }

/* ---------- Hero / brand ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: transparent;
  display: block;
  object-fit: contain;
  box-shadow: 0 8px 20px rgba(245,145,43,0.4);
  flex-shrink: 0;
}

.brand-name {
  color: #fff;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1;
}

.brand-sub {
  color: rgba(255,255,255,0.72);
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 3px;
}

.pill-link {
  color: #fff;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.22);
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.85);
  font-size: 12.5px;
  font-weight: 700;
}
.conn .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--teal-200);
  box-shadow: 0 0 0 4px rgba(153,246,228,0.25);
  animation: pulseDot 1.6s ease-in-out infinite;
}
@keyframes pulseDot { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ---------- Typography ---------- */
h1 { margin: 0; font-size: 26px; }
h2 { margin: 0 0 14px; font-size: 20px; letter-spacing: -0.01em; }
h3 { margin: 0 0 10px; font-size: 16px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
.center { text-align: center; }

.lead {
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 2px 20px;
  letter-spacing: -0.01em;
  opacity: 0.95;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ---------- Buttons ---------- */
.btn {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: default; }

.btn.primary { background: linear-gradient(135deg, var(--teal-600), var(--teal-700)); color: #fff; box-shadow: 0 10px 24px rgba(13,148,136,0.35); }
.btn.accent { background: linear-gradient(135deg, var(--accent), var(--accent-600)); color: #fff; box-shadow: 0 10px 24px rgba(245,145,43,0.4); }
.btn.secondary { background: #f1f5f9; color: var(--teal-700); }
.btn.ghost { background: transparent; color: var(--teal-700); border: 1.5px solid var(--line); }
.btn.danger { background: #fee2e2; color: var(--red); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.sm { padding: 11px 14px; font-size: 14px; border-radius: 13px; width: auto; }
.btn.block { width: 100%; }
.mt { margin-top: 10px; }
.mt-lg { margin-top: 18px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 0; min-width: 120px; }

/* big home actions */
.home-actions { display: grid; gap: 14px; }
.action-tile {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  border: none;
  cursor: pointer;
  background: var(--bg-card);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.action-tile:active { transform: scale(0.98); }
.action-tile .ico {
  width: 54px; height: 54px; border-radius: 16px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.action-tile .ico svg {
  width: 26px;
  height: 26px;
  display: block;
}
.action-tile.go {
  background:
    linear-gradient(135deg, rgba(232, 255, 250, 1) 0%, #fff 55%),
    var(--bg-card);
  border: 1.5px solid rgba(13, 148, 136, 0.4);
  box-shadow:
    0 10px 26px rgba(13, 148, 136, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}
.action-tile.go .ico {
  background: linear-gradient(145deg, #14b8a6, #0f766e);
  color: #fff;
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.35);
}
.action-tile.go .tt { color: #0f5f59; }
.action-tile.go .chev { color: var(--teal-700); font-weight: 700; }
.action-tile.call {
  background:
    linear-gradient(135deg, rgba(255, 248, 237, 1) 0%, #fff 55%),
    var(--bg-card);
  border: 1.5px solid rgba(245, 145, 43, 0.45);
  box-shadow:
    0 10px 26px rgba(245, 145, 43, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}
.action-tile.call .ico {
  background: linear-gradient(145deg, #f5a84a, #e07d12);
  color: #fff;
  box-shadow: 0 6px 14px rgba(224, 125, 18, 0.35);
  animation: callPulse 2.4s ease-in-out infinite;
}
.action-tile.call .tt { color: #9a4d0a; }
.action-tile.call .phone-num {
  color: var(--accent-600);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.01em;
  margin-top: 4px;
}
.action-tile.call .chev { color: var(--accent-600); font-weight: 700; }
.action-tile.drv .ico {
  background: linear-gradient(145deg, #475569, #0f172a);
  color: #fff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.28);
}
.action-tile .tx { flex: 1 1 auto; min-width: 0; }
.action-tile .tt { display: block; font-weight: 900; font-size: 17px; line-height: 1.25; }
.action-tile .ds { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.35; margin-top: 3px; }
.action-tile .chev { flex: none; margin-left: 8px; color: var(--muted); font-size: 20px; }

@keyframes callPulse {
  0%, 100% { box-shadow: 0 6px 14px rgba(224, 125, 18, 0.35); transform: scale(1); }
  50% { box-shadow: 0 8px 18px rgba(224, 125, 18, 0.5); transform: scale(1.04); }
}

/* ---------- Offline fallback ---------- */
.offline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.offline-bar-label {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.offline-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.offline-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1;
  transition: transform 0.12s ease, background 0.12s ease;
}
.offline-chip svg {
  width: 14px;
  height: 14px;
  display: block;
}
.offline-chip:active { transform: scale(0.97); }
.offline-chip.max {
  background: rgba(255, 255, 255, 0.92);
  color: var(--teal-700);
}
.offline-chip.phone {
  background: rgba(245, 145, 43, 0.95);
  color: #fff;
}
@media (max-width: 380px) {
  .offline-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .offline-bar-actions { justify-content: stretch; }
  .offline-chip { flex: 1; justify-content: center; }
}

/* ---------- Forms ---------- */
form { display: flex; flex-direction: column; gap: 14px; }
label { display: block; font-size: 14px; font-weight: 800; color: #334155; }
input, textarea, select {
  width: 100%;
  margin-top: 7px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  font-size: 16px;
  outline: none;
  background: #f8fafc;
  font-family: var(--font);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  border-color: var(--teal-400);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(45,212,191,0.18);
}
input[type="file"] { padding: 11px; background: #fff; }

/* ---------- Live order panel ---------- */
.live { overflow: hidden; }
.live-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px;
}
.order-tag {
  font-size: 13px; font-weight: 800; color: var(--teal-700);
  background: rgba(13,148,136,0.1); padding: 5px 11px; border-radius: 999px;
}

.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 800; padding: 6px 12px; border-radius: 999px;
}
.status-pill .led { width: 8px; height: 8px; border-radius: 50%; }
.sp-new { background: rgba(245,145,43,0.14); color: var(--accent-600); }
.sp-new .led { background: var(--accent); animation: blink 1s infinite; }
.sp-taken { background: rgba(13,148,136,0.12); color: var(--teal-700); }
.sp-taken .led { background: var(--teal-600); }
.sp-arrived { background: rgba(22,163,74,0.14); color: var(--green); }
.sp-arrived .led { background: var(--green); animation: blink 0.9s infinite; }
.sp-done { background: rgba(22,163,74,0.14); color: var(--green); }
.sp-done .led { background: var(--green); }
.sp-cancel { background: rgba(220,38,38,0.12); color: var(--red); }
.sp-cancel .led { background: var(--red); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* --- searching radar --- */
.stage {
  position: relative;
  height: 180px;
  margin: 14px 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.radar {
  position: relative; width: 150px; height: 150px;
  display: flex; align-items: center; justify-content: center;
}
.radar .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--teal-400);
  opacity: 0; animation: radar 2.4s ease-out infinite;
}
.radar .ring:nth-child(2) { animation-delay: 0.8s; }
.radar .ring:nth-child(3) { animation-delay: 1.6s; }
@keyframes radar {
  0% { transform: scale(0.3); opacity: 0.9; }
  100% { transform: scale(1); opacity: 0; }
}
.radar .core {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-700));
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; z-index: 2;
  box-shadow: 0 10px 24px rgba(13,148,136,0.45);
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-7px)} }

/* --- en-route road --- */
.road {
  position: relative; width: 100%; max-width: 320px; height: 120px;
  align-self: center; overflow: hidden;
}
.road .lane {
  position: absolute; left: 0; right: 0; bottom: 34px; height: 8px;
  background: #e2e8f0; border-radius: 8px; overflow: hidden;
}
.road .lane::after {
  content: ""; position: absolute; top: 50%; left: 0; width: 200%; height: 2px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, var(--muted) 0 16px, transparent 16px 34px);
  animation: dash 0.7s linear infinite;
}
@keyframes dash { from { transform: translate(0,-50%);} to { transform: translate(-50px,-50%);} }
.road .car {
  position: absolute; bottom: 40px; left: 8px; font-size: 40px;
  animation: drive 2.6s ease-in-out infinite;
}
@keyframes drive {
  0% { left: 6%; }
  50% { left: 64%; }
  50.01% { left: 64%; }
  100% { left: 6%; }
}
.road .pin {
  position: absolute; bottom: 40px; right: 6px; font-size: 34px;
  animation: bob 1.6s ease-in-out infinite;
}

/* --- arrived --- */
.arrived-art {
  font-size: 64px; text-align: center;
  animation: pop 0.6s cubic-bezier(0.18,1.4,0.4,1) both;
}
@keyframes pop { from { transform: scale(0.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* --- success check --- */
.check-wrap { display: flex; justify-content: center; margin: 10px 0; }
.check {
  width: 92px; height: 92px; border-radius: 50%;
  background: rgba(22,163,74,0.12);
  display: flex; align-items: center; justify-content: center;
}
.check svg { width: 52px; height: 52px; }
.check svg path {
  stroke: var(--green); stroke-width: 7; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 80; stroke-dashoffset: 80;
  animation: draw 0.6s 0.15s ease forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.stage-title { text-align: center; font-weight: 900; font-size: 20px; margin: 4px 0 2px; }
.stage-sub { text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ---------- Stepper ---------- */
.stepper { display: flex; align-items: center; margin: 18px 2px 6px; }
.stepper .step { flex: 1; text-align: center; position: relative; }
.stepper .step .bub {
  width: 30px; height: 30px; border-radius: 50%; margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center;
  background: #eef2f7; color: var(--muted); font-size: 14px; font-weight: 900;
  border: 2px solid #eef2f7; transition: all 0.3s ease;
}
.stepper .step .lbl { font-size: 11px; color: var(--muted); font-weight: 700; }
.stepper .bar { height: 3px; flex: 0 0 14px; background: #eef2f7; border-radius: 3px; transition: background 0.3s ease; }
.stepper .step.done .bub, .stepper .step.active .bub {
  background: var(--teal-600); color: #fff; border-color: var(--teal-600);
  box-shadow: 0 6px 14px rgba(13,148,136,0.35);
}
.stepper .step.active .bub { animation: bub 1.4s ease-in-out infinite; }
@keyframes bub { 0%,100%{box-shadow:0 0 0 0 rgba(13,148,136,0.35)} 50%{box-shadow:0 0 0 8px rgba(13,148,136,0)} }
.stepper .step.done .lbl, .stepper .step.active .lbl { color: var(--teal-700); }
.stepper .bar.fill { background: var(--teal-500, var(--teal-600)); }

/* ---------- Driver mini-card on passenger side ---------- */
.driver-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border-radius: 18px; margin-top: 14px;
  background: linear-gradient(135deg, rgba(13,148,136,0.08), rgba(245,145,43,0.06));
  border: 1px solid rgba(13,148,136,0.16);
  animation: cardIn 0.4s ease both;
}
.driver-card .av {
  width: 52px; height: 52px; border-radius: 14px; flex: none;
  background: var(--teal-700); color: #fff; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
}
.driver-card .nm { font-weight: 900; font-size: 16px; }
.driver-card .ca { color: var(--muted); font-size: 13px; margin-top: 2px; }
.driver-card .call {
  margin-left: auto; width: 46px; height: 46px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 20px; text-decoration: none;
  display: flex; align-items: center; justify-content: center; flex: none;
  box-shadow: 0 8px 18px rgba(22,163,74,0.4);
}

.eta-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(13,148,136,0.1); color: var(--teal-700);
  font-weight: 800; font-size: 14px; padding: 8px 14px; border-radius: 999px;
  margin: 12px auto 0;
}

.notice {
  padding: 13px 15px; border-radius: 15px; margin-top: 14px; font-size: 14px; line-height: 1.5;
}
.notice.warn { background: rgba(245,145,43,0.12); color: var(--accent-600); border: 1px solid rgba(245,145,43,0.25); }
.notice.danger { background: rgba(220,38,38,0.1); color: #991b1b; border: 1px solid rgba(220,38,38,0.22); }
.notice.ok { background: rgba(22,163,74,0.1); color: #166534; border: 1px solid rgba(22,163,74,0.22); }

/* ---------- Driver cabinet ---------- */
.profile-row { display: flex; align-items: center; gap: 14px; }
.profile-row .pav {
  width: 56px; height: 56px; border-radius: 16px; flex: none;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-700)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 900;
}
.profile-row .pnm { font-weight: 900; font-size: 18px; }
.profile-row .pca { color: var(--muted); font-size: 13px; margin-top: 2px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px; margin-top: 6px; }
.badge.ok { background: rgba(22,163,74,0.12); color: var(--green); }
.badge.wait { background: rgba(245,145,43,0.14); color: var(--accent-600); }
.badge.no { background: rgba(220,38,38,0.12); color: var(--red); }

/* online toggle */
.line-toggle {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: #f8fafc; border: 1px solid var(--line);
}
.line-toggle .lt-txt { font-weight: 800; font-size: 15px; }
.line-toggle .lt-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.switch { position: relative; width: 58px; height: 32px; flex: none; }
.switch input { display: none; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: #cbd5e1; cursor: pointer;
  transition: background 0.25s ease;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.25); transition: transform 0.25s cubic-bezier(0.3,1.4,0.5,1);
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(26px); }

/* stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.stat { padding: 12px 8px; border-radius: 14px; background: #f8fafc; border: 1px solid var(--line); text-align: center; }
.stat .v { font-size: 22px; font-weight: 900; color: var(--teal-700); }
.stat .k { font-size: 11.5px; color: var(--muted); font-weight: 700; margin-top: 2px; }

/* order feed */
.orders-list { display: flex; flex-direction: column; gap: 12px; }
.empty-text { color: var(--muted); text-align: center; padding: 18px 0; }
.order-item {
  border: 1.5px solid var(--line); border-radius: 18px; padding: 15px;
  background: #fff; animation: cardIn 0.35s ease both;
}
.order-item.is-new { border-color: rgba(245,145,43,0.4); background: linear-gradient(180deg, rgba(245,145,43,0.06), #fff); }
.order-item.is-mine { border-color: rgba(13,148,136,0.4); }
.order-item.is-cancel { opacity: 0.72; }
.order-item .oi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.order-item .oi-num { font-weight: 900; color: var(--teal-700); }
.order-item .oi-msg { white-space: pre-line; line-height: 1.5; font-size: 15px; margin: 4px 0 10px; }
.order-item .oi-meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.order-item .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.order-item .actions .btn { flex: 1 1 calc(50% - 4px); min-width: 0; }
.eta-group { display: flex; gap: 8px; width: 100%; }
.eta-group .btn { flex: 1; }

/* ---------- Chat dock ---------- */
.chat-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: #fff; border-radius: 22px 22px 0 0;
  box-shadow: 0 -16px 40px rgba(0,0,0,0.25);
  max-width: 560px; margin: 0 auto;
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
  display: flex; flex-direction: column; max-height: 72vh;
}
.chat-dock.open { transform: translateY(0); }
.chat-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-top b { font-size: 16px; }
.chat-close { background: none; border: none; font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.chat-message { max-width: 80%; padding: 9px 13px; border-radius: 15px; font-size: 14.5px; line-height: 1.4; }
.chat-message.other { align-self: flex-start; background: #f1f5f9; border-bottom-left-radius: 5px; }
.chat-message.own { align-self: flex-end; background: linear-gradient(135deg, var(--teal-600), var(--teal-700)); color: #fff; border-bottom-right-radius: 5px; }
.chat-message small { display: block; font-size: 10.5px; opacity: 0.7; margin-top: 3px; }
.chat-form { display: flex; gap: 8px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.chat-form input { margin: 0; flex: 1; }
.chat-form .btn { width: auto; padding: 14px 18px; }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 60; background: rgba(8,15,30,0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.modal-back.open { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff; border-radius: 22px; padding: 22px; max-width: 380px; width: 100%;
  transform: scale(0.92); transition: transform 0.22s cubic-bezier(0.18,1.2,0.4,1); text-align: center;
}
.modal-back.open .modal { transform: scale(1); }
.modal h3 { font-size: 19px; margin-bottom: 8px; }
.modal p { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin: 0 0 18px; }
.modal .modal-actions { display: flex; gap: 10px; }
.modal .modal-actions .btn { flex: 1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 14px; font-weight: 700; font-size: 14px;
  z-index: 80; opacity: 0; transition: all 0.25s ease; max-width: 90%; text-align: center;
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Кружок «Поделиться» ---------- */
.share-eco {
  position: fixed;
  right: max(0.85rem, env(safe-area-inset-right));
  bottom: 5.2rem;
  z-index: 45;
  animation: share-eco-in 0.7s ease-out;
}
body.has-install-panel .share-eco {
  bottom: calc(5.6rem + env(safe-area-inset-bottom));
}
.share-eco.hidden { display: none; }
.share-eco-dismiss {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  z-index: 1;
  width: 1.2rem;
  height: 1.2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(11, 31, 42, 0.14);
}
.share-eco-cloud {
  display: block;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  animation: share-eco-float 3.6s ease-in-out infinite;
  box-shadow: 0 10px 22px rgba(8, 47, 44, 0.28);
}
.share-eco-cloud img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: contain;
  background: transparent;
  display: block;
}
@keyframes share-eco-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes share-eco-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

footer { text-align: center; color: rgba(255,255,255,0.7); font-size: 13px; padding: 16px 0 6px; }

/* ---------- Панель «Установить приложение» ---------- */
.install-panel {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(420px, calc(100% - 28px));
  padding: 6px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 10px 28px rgba(8, 47, 44, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.45);
  animation: install-panel-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.install-panel.hidden { display: none; }

.install-panel-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 8px 12px 8px 8px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
}
.install-panel-main:active {
  background: rgba(13, 148, 136, 0.08);
}

.install-panel-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: contain;
  flex: none;
  background: transparent;
  box-shadow: 0 4px 12px rgba(245, 145, 43, 0.28);
}

.install-panel-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
}
.install-panel-text strong {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.install-panel-text span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.install-panel-cta {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 145, 43, 0.14);
  color: var(--accent-600);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
}

.install-panel-close {
  flex: none;
  width: 36px;
  height: 36px;
  margin: 0 2px 0 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.install-panel-close:active {
  background: rgba(15, 23, 42, 0.06);
  color: var(--ink);
}

.install-help-list {
  margin: 0 0 18px;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}
.install-help-list li { margin-bottom: 6px; }
.install-help-list b { color: var(--ink); }
@keyframes install-panel-in {
  from { opacity: 0; transform: translateX(-50%) translateY(110%); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- После поездки: установка ---------- */
.post-install {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.16);
}
.post-install-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
  flex: none;
  background: transparent;
}
.post-install-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
}
.post-install-text strong {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
}
.post-install-text span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.post-install-btn {
  flex: none;
  border: 0;
  border-radius: 12px;
  padding: 8px 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-600));
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
}
.post-install-btn:active { transform: scale(0.97); }

@media (max-width: 380px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .order-item .actions .btn { flex: 1 1 100%; }
  .install-panel { width: calc(100% - 20px); }
  .install-panel-text strong { font-size: 13px; }
  .post-install { gap: 8px; padding: 9px 10px; }
  .post-install-btn { padding: 7px 10px; font-size: 12px; }
}
