/* ═══════════════════════════════════════════════════════════════
   KARETA.KZ — MOBILE MASTER STYLESHEET v2
   Полная адаптация под телефоны. Подключается последним.
   Breakpoints: 900px (tablet+), 600px (phone), 430px (small phone), 360px (mini)
═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────
   0. ГЛОБАЛ
───────────────────────────────────────── */
@media (max-width: 900px) {
  /* Блокируем iOS-zoom на фокусе */
  input:not([type=checkbox]):not([type=radio]),
  select, textarea {
    font-size: 16px !important;
    touch-action: manipulation;
  }

  /* Минимальные tap-цели */
  .btn, button, a.btn, [role=button] { min-height: 44px; }

  /* Убираем hover-состояния — на touch они «залипают» */
  .btn-primary:hover,
  .btn-outline:hover,
  .btn-ghost:hover { transform: none !important; box-shadow: none !important; }
  .card:hover,
  .rv-card:hover,
  .hv-card:hover,
  .st-card:hover,
  .part-card:hover,
  .svc-full-card:hover { transform: none !important; box-shadow: inherit !important; border-color: var(--line) !important; }

  /* Tap-активные состояния */
  .btn:active   { opacity: .74; transform: scale(.95) !important; transition: .07s ease !important; }
  .card:active  { transform: scale(.97) !important; transition: .07s ease !important; }
  .bnav-item:active { transform: scale(.90); transition: .07s ease; }
}

/* ─────────────────────────────────────────
   1. КОНТЕЙНЕР / СЕКЦИИ
───────────────────────────────────────── */
@media (max-width: 900px) {
  .container { padding: 0 16px; }
  section    { padding: 40px 0; }
}
@media (max-width: 430px) {
  .container { padding: 0 14px; }
  section    { padding: 32px 0; }
}

/* ─────────────────────────────────────────
   2. ТОП-НАВ И DRAWER
───────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --nav-h: 54px; }
  .nav-phone   { display: none; }
  .nav-logo-text { font-size: 16px; }
  .nav-logo-sub  { font-size: 8px; }
  .nav-avatar  { width: 34px; height: 34px; font-size: 14px; }

  /* Drawer — bottom sheet */
  #drawer-overlay { display: none; position: fixed; inset: 0; z-index: 798; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s; }
  #drawer-overlay.vis { display: block; opacity: 1; }
  #drawer {
    top: auto; bottom: 0; left: 0; right: 0; width: 100%;
    max-height: 82dvh; border-radius: 20px 20px 0 0;
    border-right: none; border-top: 1px solid rgba(255,255,255,.09);
    transform: translateY(100%); transition: transform .32s cubic-bezier(.16,1,.3,1);
    overflow-y: auto; padding-bottom: calc(var(--safe-b, 0px) + 16px); z-index: 800;
  }
  #drawer.open { transform: translateY(0); }
  .drawer-link { min-height: 52px; padding: 0 22px; font-size: 15px; gap: 14px; }
  .drawer-link:active { background: rgba(255,255,255,.055); }
}

/* ─────────────────────────────────────────
   3. НИЖНЯЯ НАВИГАЦИЯ
───────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --bnav-bar: 60px; --bnav-h: calc(60px + var(--safe-b, 0px)); }
  #bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 900;
    background: rgba(13,13,15,.96); backdrop-filter: blur(28px) saturate(1.6);
    -webkit-backdrop-filter: blur(28px) saturate(1.6);
    border-top: 1px solid rgba(255,255,255,.07);
    box-shadow: 0 -4px 30px rgba(0,0,0,.5);
    padding-bottom: var(--safe-b, 0px);
  }
  .bnav-inner { height: var(--bnav-bar); display: flex; align-items: center; width: 100%; padding: 0 4px; gap: 2px; }
  .bnav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 6px 4px 7px; min-height: var(--bnav-bar);
    border-radius: 10px; color: rgba(140,140,150,.65); cursor: pointer;
    transition: color .15s; -webkit-user-select: none; user-select: none;
  }
  .bnav-item.active { color: var(--orange); }
  .bnav-item.active .bnav-icon-wrap { background: rgba(255,107,0,.15); border-radius: 9px; }
  .bnav-icon-wrap { width: 40px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 9px; position: relative; transition: background .15s; }
  .bnav-icon { font-size: 20px; line-height: 1; transition: transform .22s cubic-bezier(.34,1.56,.64,1); }
  .bnav-item.active .bnav-icon { transform: scale(1.18) translateY(-1px); }
  .bnav-label { font-size: 9.5px; font-weight: 700; letter-spacing: .3px; line-height: 1; text-align: center; }
  .bnav-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; background: var(--orange); color: #fff; font-size: 8px; font-weight: 800; border-radius: 99px; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(13,13,15,.95); }
  #app { padding-bottom: var(--bnav-h, 60px) !important; }
  footer { display: none; }
  #notifs-fab { right: 14px; bottom: calc(var(--bnav-h, 60px) + 12px); width: 52px; height: 52px; }
  #scroll-top { bottom: calc(var(--bnav-h, 60px) + 12px); right: 12px; width: 42px; height: 42px; font-size: 16px; }
}
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  :root { --bnav-bar: 50px; }
  .bnav-icon { font-size: 18px; }
  .bnav-label { font-size: 9px; }
}

/* ─────────────────────────────────────────
   4. АВТОРИЗАЦИЯ — bottom sheet
───────────────────────────────────────── */
@media (max-width: 900px) {
  #auth-overlay { align-items: flex-end !important; padding: 0 !important; }
  .auth-modal {
    border-radius: 24px 24px 0 0 !important;
    border: none !important;
    border-top: 1px solid rgba(255,255,255,.09) !important;
    max-height: 92dvh !important;
    overflow-y: auto;
    padding: 8px 20px calc(var(--safe-b, 0px) + 28px) !important;
    width: 100% !important;
    margin: 20px;
    box-shadow: 2px 0px 20px 6px #333333;
    max-width: 100% !important;
    animation: sheetUp .32s cubic-bezier(.16,1,.3,1) both;
  }
  @keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
  /* Ручка */
  .auth-modal::before {
    content: ''; display: block; width: 36px; height: 4px;
    background: rgba(255,255,255,.2); border-radius: 99px;
    margin: 8px auto 20px;
  }
  .auth-btn { min-height: 52px; border-radius: 12px; font-size: 15px; width: 100%; justify-content: center; }
  .otp-box  { width: 60px !important; height: 64px !important; font-size: 26px !important; border-radius: 14px !important; }
  .otp-row  { gap: 10px; justify-content: center; }
}

/* ─────────────────────────────────────────
   5. HERO — главная
───────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-section { min-height: 82svh; padding: 76px 0 44px; }
  .hero-badge   { font-size: 11px; padding: 6px 12px; }
  .hero-title   { font-size: clamp(32px, 10vw, 50px) !important; margin-bottom: 14px; }
  .hero-desc    { font-size: 14px; line-height: 1.7; max-width: 100%; }
  .hero-btns    { flex-direction: column; gap: 10px; width: 100%; margin-top: 24px; }
  .hero-btns .btn { width: 100%; justify-content: center; min-height: 52px; font-size: 15px; }
  .hero-stats   { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; overflow: hidden; }
  .hero-stats > div { padding: 12px 6px; text-align: center; }
  .stat-num     { font-size: 16px; }
  .stat-lbl     { font-size: 9px; }
  .hero-glow2   { display: none; }
}
@media (max-width: 600px) {
  .hv-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hv-card { padding: 14px 12px; }
  .hv-ico  { font-size: 20px; }
  .hv-title { font-size: 13px; }
}
@media (max-width: 430px) {
  .hero-title { font-size: clamp(28px, 11vw, 40px) !important; }
  .hero-stats > div { padding: 10px 4px; }
  .stat-num { font-size: 14px; }
}

/* ─────────────────────────────────────────
   6. СЕРВИСЫ НА ГЛАВНОЙ
───────────────────────────────────────── */
@media (max-width: 600px) {
  .st-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .st-card { padding: 14px 12px; }
  .st-emoji { font-size: 22px; }
}
@media (max-width: 360px) {
  .st-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────
   7. CTA-ПОЛОСА
───────────────────────────────────────── */
@media (max-width: 900px) {
  .cta-strip  { padding: 40px 0; }
  .cta-t      { font-size: clamp(20px, 6vw, 26px); }
  .cta-s      { font-size: 13px; max-width: 100%; }
  .cta-phone  { font-size: clamp(22px, 7vw, 30px); }
  .cta-meta   { flex-direction: column; gap: 5px; font-size: 12px; align-items: center; }
  .cta-inner  { flex-direction: column; text-align: center; gap: 16px; align-items: center; }
  .cta-btns   { flex-direction: column; gap: 10px; width: 100%; }
  .cta-btns .btn { width: 100%; justify-content: center; min-height: 50px; }
}

/* ─────────────────────────────────────────
   8. ОТЗЫВЫ
───────────────────────────────────────── */
@media (max-width: 900px) {
  .rv-grid { grid-template-columns: 1fr; gap: 12px; }
  .rv-card { padding: 18px 16px; }
  .rv-text { font-size: 13px; }
  .rv-add-card { padding: 20px 16px; }
  .rv-stars-pick { font-size: 34px; gap: 8px; }
}
@media (min-width: 540px) and (max-width: 900px) {
  .rv-grid { grid-template-columns: 1fr 1fr; }
}

/* ─────────────────────────────────────────
   9. ПРАЙС
───────────────────────────────────────── */
@media (max-width: 900px) {
  .ptabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; gap: 6px; }
  .ptabs::-webkit-scrollbar { display: none; }
  .ptab  { flex-shrink: 0; min-height: 44px; padding: 0 16px; font-size: 13px; white-space: nowrap; }
  .ptbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
  .ptbl  { min-width: 340px; }
  .ptbl th, .ptbl td { padding: 10px 12px; font-size: 13px; }
  .ptbl-book-btn { opacity: 1 !important; transform: none !important; font-size: 11px; padding: 5px 10px; white-space: nowrap; }
  .p-note { font-size: 12px; padding: 10px 14px; }
}
@media (max-width: 480px) {
  /* Скрываем колонку «Время» — экономим место */
  .ptbl th:nth-child(2),
  .ptbl td:nth-child(2) { display: none; }
}

/* ─────────────────────────────────────────
   10. УСЛУГИ
───────────────────────────────────────── */
@media (max-width: 900px) {
  .svc-full-grid { gap: 20px; }
  .svc-full-card { padding: 20px 16px; border-radius: 14px; }
  .sfc-head  { flex-wrap: wrap; gap: 10px; }
  .sfc-ico   { width: 44px; height: 44px; font-size: 20px; border-radius: 10px; }
  .sfc-title { font-size: 18px; }
  .sfc-badge-wrap { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .sfc-body  { grid-template-columns: 1fr; gap: 14px; }
  .sfc-actions { flex-direction: column; gap: 8px; }
  .sfc-actions .btn { width: 100%; justify-content: center; min-height: 48px; }
  .faq-q { font-size: 13px; padding: 14px 16px; min-height: 52px; }
  .faq-a { padding: 0 16px; font-size: 13px; }
  .faq-item.open .faq-a { padding: 0 16px 14px; }
}

/* ─────────────────────────────────────────
   11. ЗАПЧАСТИ
───────────────────────────────────────── */
@media (max-width: 900px) {
  /* Герой */
  .parts-hero      { padding: 40px 0 32px; }
  .parts-hero-sub  { font-size: 13px; margin-bottom: 16px; }
  .parts-hero-stats { max-width: 100%; padding: 12px 16px; gap: 0; }
  .phs-sep  { width: 1px; height: 28px; }
  .phs-item { padding: 0 12px 0 0; }
  .phs-num  { font-size: 20px; }
  .phs-lbl  { font-size: 9px; }

  /* Форма заказа СВЕРХУ каталога */
  .parts-layout    { grid-template-columns: 1fr; padding-top: 20px; gap: 24px; }
  .parts-form-col  { order: -1; position: static !important; }
  .parts-order-form { position: static !important; top: auto; }

  /* Поиск */
  .parts-search-input { min-height: 48px; padding-left: 44px; }

  /* Фильтр — горизонтальный скролл */
  .parts-filter-row {
    overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; padding-bottom: 4px; margin-bottom: 16px;
  }
  .parts-filter-row::-webkit-scrollbar { display: none; }
  .parts-cat { flex-shrink: 0; padding: 7px 14px; }

  /* Карточки — 2 колонки */
  .parts-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .part-card  { padding: 12px 12px; }
  .part-name  { font-size: 12px; line-height: 1.3; }
  .part-sku   { font-size: 8px; }
  .part-note  { font-size: 10px; }
  .part-price { font-size: 13px; }
  .part-order-btn { font-size: 10px; padding: 5px 9px; }
  .part-footer { padding-top: 8px; }

  /* Форма */
  .pof-header  { padding: 18px 16px 14px; }
  .pof-title   { font-size: 16px; }
  .pof-fields  { padding: 14px 16px 0; gap: 12px; }
  .pof-submit  { margin: 14px 16px 0; width: calc(100% - 32px); min-height: 52px; font-size: 15px; }
  .pof-hint    { padding: 8px 16px 16px; font-size: 10px; }
  .pof-toast   { margin: 0 16px 16px; }
  .pof-selected { margin: 12px 16px 0; }

  /* Блок «Почему» */
  .parts-why-card { padding: 16px; margin-top: 12px; }
  .pwy-ico { width: 32px; height: 32px; font-size: 15px; }
  .pwy-t   { font-size: 13px; }
  .pwy-s   { font-size: 11px; }
}
@media (max-width: 430px) {
  .parts-hero-stats { flex-wrap: wrap; row-gap: 10px; }
  .phs-sep   { display: none; }
  .phs-item  { min-width: 45%; flex: none; padding: 0; }
}
@media (max-width: 360px) {
  .parts-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────
   12. О КОМПАНИИ
───────────────────────────────────────── */
@media (max-width: 900px) {
  .about-intro-grid  { grid-template-columns: 1fr; gap: 20px; }
  .about-facts-grid  { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .about-fact        { padding: 14px 10px; }
  .about-fact-num    { font-size: 20px; }
  .about-fact-lbl    { font-size: 9px; }
  .vals-grid         { grid-template-columns: 1fr 1fr; gap: 10px; }
  .val-card          { padding: 14px 12px; }
  .val-ico           { font-size: 22px; margin-bottom: 8px; }
  .val-t             { font-size: 12px; }
  .val-d             { font-size: 11px; }
  .team-grid         { grid-template-columns: 1fr 1fr; gap: 12px; }
  .team-card         { padding: 18px 12px; }
  .team-av           { width: 52px; height: 52px; font-size: 20px; }
  .team-name         { font-size: 13px; }
  .team-role         { font-size: 11px; }
}
@media (max-width: 430px) {
  .about-facts-grid  { grid-template-columns: 1fr 1fr; }
  .vals-grid         { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────
   13. КОНТАКТЫ
───────────────────────────────────────── */
@media (max-width: 900px) {
  .ct-grid     { grid-template-columns: 1fr; gap: 20px; }
  .map-frame-wrap { height: 240px; border-radius: 10px; overflow: hidden; }
  .map-links   { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .map-link-btn { flex: 1; min-width: 130px; justify-content: center; min-height: 44px; }
  .ct-cta-row  { flex-direction: column; gap: 8px; }
  .ct-cta-row .btn { width: 100%; justify-content: center; min-height: 50px; }
  .hours-wrap  { border-radius: 10px; }
  .hr-row      { padding: 10px 14px; font-size: 13px; }
  .ci-card     { padding: 14px 16px; }
  .ct-open-badge { font-size: 12px; padding: 5px 10px; }
}

/* ─────────────────────────────────────────
   14. ЗАПИСЬ (BOOKING)
───────────────────────────────────────── */
@media (max-width: 900px) {
  .booking-hero   { padding: 40px 0 28px; }
  .booking-layout { grid-template-columns: 1fr; }
  .booking-summary { display: none; }
  .bform-card     { padding: 18px 16px; border-radius: 14px; }
  .bform-row      { grid-template-columns: 1fr; gap: 12px; }

  .service-chips  { gap: 8px; }
  .svc-chip {
    flex: 1; min-width: calc(50% - 4px); min-height: 52px;
    justify-content: center; border-radius: 12px; font-size: 13px;
  }
  .svc-chip:active { transform: scale(.93); transition: .07s; }

  .date-grid {
    overflow-x: auto; flex-wrap: nowrap; gap: 8px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 4px;
  }
  .date-grid::-webkit-scrollbar { display: none; }
  .date-btn {
    flex-shrink: 0; min-width: 62px; min-height: 62px;
    flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  }
  .date-btn:active { transform: scale(.90); transition: .07s; }
  .date-num { font-size: 16px; font-weight: 700; }
  .date-day { font-size: 10px; }

  .time-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .time-btn  { min-height: 44px; font-size: 13px; border-radius: 10px; }
  .time-btn:active { transform: scale(.90); transition: .07s; }

  .booking-steps  { padding: 14px 16px 10px; gap: 0; overflow: hidden; }
  .bstep-num      { width: 22px; height: 22px; font-size: 9px; flex-shrink: 0; }
  .bstep-label    { font-size: 9px; white-space: nowrap; }
  .bstep-line     { min-width: 10px; }

  .bform-nav { flex-direction: row; gap: 10px; margin-top: 20px; }
  .bform-nav .btn { flex: 1; justify-content: center; min-height: 50px; }

  .booking-success { padding: 32px 16px; }
  .bs-icon  { width: 60px; height: 60px; font-size: 24px; }
  .bs-title { font-size: 20px; }
  .bs-sub   { font-size: 13px; }
  .bs-detail-row { font-size: 13px; padding: 8px 0; }
}
@media (max-width: 430px) {
  .time-grid { grid-template-columns: repeat(3, 1fr); }
  .svc-chip  { min-width: calc(50% - 4px); font-size: 12px; }
}

/* ─────────────────────────────────────────
   15. ЛИЧНЫЙ КАБИНЕТ
───────────────────────────────────────── */
@media (max-width: 900px) {
  /* Hero */
  .cab-hero         { padding: 24px 0 0; }
  .cab-profile-row  { padding: 0 16px; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
  .cab-avatar       { width: 52px; height: 52px; font-size: 20px; flex-shrink: 0; }
  .cab-name         { font-size: 20px; }
  .cab-phone-chip,
  .cab-car-chip     { font-size: 11px; padding: 4px 10px; }
  .cab-profile-actions { flex-direction: row; flex-wrap: wrap; gap: 8px; margin-left: 0; width: 100%; }
  .logout-btn, .cab-role-btn { flex: 1; justify-content: center; min-height: 40px; font-size: 12px; }

  /* Мини-статистика */
  .cab-mini-stats   { padding: 12px 16px; margin: 0 0 16px; border-radius: 10px; gap: 0; }
  .cab-ms-sep       { display: none; }
  .cab-ms-item      { flex: 1; min-width: 0; }
  .cab-ms-num       { font-size: 18px; }
  .cab-ms-lbl       { font-size: 9px; }

  /* Вкладки */
  .cab-tabs {
    display: flex; overflow-x: auto; scrollbar-width: none;
    padding: 0 8px; border-bottom: 1px solid var(--line);
    -webkit-overflow-scrolling: touch;
  }
  .cab-tabs::-webkit-scrollbar { display: none; }
  .cab-tab { min-height: 48px; padding: 0 16px; white-space: nowrap; flex-shrink: 0; font-size: 13px; }
  .cab-tab:active { opacity: .7; }

  /* Профиль — колонка */
  .cab-pane-layout  { grid-template-columns: 1fr; gap: 16px; }
  .profile-form-card { padding: 18px 16px; }
  .pfc-title        { font-size: 13px; margin-bottom: 14px; }
  .cab-side-cards   { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .cab-quick-card   { padding: 14px 12px; }
  .cqc-ico          { font-size: 20px; width: 36px; height: 36px; border-radius: 8px; }
  .cqc-title        { font-size: 12px; }
  .cqc-sub          { font-size: 11px; }

  /* История */
  .hist-item   { flex-direction: column; gap: 8px; padding: 14px 16px; }
  .hist-price  { align-self: flex-start; }
  .hist-title  { font-size: 13px; }
  .hist-meta   { font-size: 11px; flex-wrap: wrap; }
  .hist-actions { flex-wrap: wrap; gap: 8px; }
  .hist-actions .btn { flex: 1; min-width: 110px; justify-content: center; min-height: 40px; font-size: 12px; }

  /* Лояльность */
  .loyalty-hero   { padding: 24px 16px; border-radius: 14px; }
  .loy-pts        { font-size: 44px; }
  .loy-pts-sub    { font-size: 12px; }
  .loy-levels     { grid-template-columns: 1fr 1fr; gap: 10px; }
  .loy-lvl-card   { padding: 12px 12px; }
  .loy-lvl-name   { font-size: 12px; }

  /* Автомобиль */
  .car-tip { padding: 14px 16px; font-size: 12px; }

  /* Push-баннер */
  .push-banner { flex-wrap: wrap; gap: 10px; }
  .push-banner .btn { width: 100%; justify-content: center; }
}
@media (max-width: 430px) {
  .cab-mini-stats   { flex-wrap: wrap; row-gap: 10px; }
  .cab-ms-item      { min-width: 45%; }
  .cab-side-cards   { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────
   16. МОИ ЗАЯВКИ
───────────────────────────────────────── */
@media (max-width: 900px) {
  .mo-header   { flex-wrap: wrap; gap: 10px; padding: 16px 16px 12px; }
  .mo-add-btn  { width: 100%; justify-content: center; min-height: 44px; }
  .mo-filters  {
    overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; padding: 0 16px 4px; gap: 6px;
  }
  .mo-filters::-webkit-scrollbar { display: none; }
  .mo-filter   { flex-shrink: 0; min-height: 38px; padding: 6px 14px; }
  .mo-card     { padding: 14px 16px; margin-bottom: 10px; border-radius: 12px; }
  .mo-card-header { flex-wrap: wrap; gap: 8px; }
  .mo-card-title  { font-size: 14px; }
  .mo-card-meta   { flex-wrap: wrap; gap: 6px; }
  .mo-card-meta-item { font-size: 11px; }
  .mo-card-actions { flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  .mo-card-actions .btn,
  .mo-card-actions a { flex: 1; min-width: 110px; justify-content: center; min-height: 44px; font-size: 12px; }
  .mo-empty    { padding: 48px 16px; }
  .mo-stat-bar { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 14px 16px; }
  .mo-stat-num { font-size: 20px; }
  .mo-stat-lbl { font-size: 10px; }
}
@media (max-width: 430px) {
  .mo-stat-bar { grid-template-columns: repeat(2, 1fr); }
}

/* ─────────────────────────────────────────
   17. МЕССЕНДЖЕР
───────────────────────────────────────── */
@media (max-width: 900px) {
  #messenger-panel  { border-radius: 20px 20px 0 0; }
  .msng-messages    { padding: 10px 12px; }
  .msng-bubble      { font-size: 14px; padding: 9px 13px; max-width: 86vw; }
  .msng-textarea    { font-size: 16px !important; min-height: 44px; }
  .msng-send-btn    { width: 44px; height: 44px; flex-shrink: 0; }
  .msng-qa-btn      { min-height: 36px; padding: 5px 11px; font-size: 11px; }
  .msng-item        { padding: 12px 14px; min-height: 72px; }
  .msng-item-name   { font-size: 13px; }
  .msng-item-preview { font-size: 12px; }
  .msng-chat-name   { font-size: 14px; }
  .msng-chat-meta   { font-size: 11px; }
  .msng-subpanel    { border-radius: 16px 16px 0 0; }
  .msng-stage-row   { padding: 12px 14px; min-height: 56px; }
  .msng-stage-row-label { font-size: 13px; }
  .msng-stage-row-desc  { font-size: 11px; }
  .msng-report-input    { font-size: 16px !important; }
  .msng-search      { font-size: 16px !important; min-height: 44px; }
  .msng-tracker     { padding: 10px 14px; }
  .msng-track-label { font-size: 9px; }
}

/* ─────────────────────────────────────────
   18. ОНБОРДИНГ — bottom sheet
───────────────────────────────────────── */
@media (max-width: 900px) {
  #onboarding-overlay { align-items: flex-end; padding: 0; }
  #onboarding-overlay .onb-box {
    border-radius: 24px 24px 0 0; max-width: 100%;
    padding: 10px 20px calc(var(--safe-b, 0px) + 28px);
    transform: translateY(100%); max-height: 92dvh; overflow-y: auto;
  }
  #onboarding-overlay.open .onb-box { transform: translateY(0); }
  /* Ручка */
  #onboarding-overlay .onb-box::before {
    content: ''; display: block; width: 36px; height: 4px;
    background: rgba(255,255,255,.2); border-radius: 99px;
    margin: 4px auto 14px;
  }
  .onb-logo    { font-size: 36px; margin-bottom: 8px; }
  .onb-hi      { font-size: 20px; }
  .onb-sub     { font-size: 12px; margin-bottom: 16px; }
  .onb-features { gap: 8px; margin-bottom: 20px; }
  .onb-feat    { padding: 10px 12px; gap: 10px; }
  .onb-feat-ico { width: 34px; height: 34px; font-size: 16px; border-radius: 8px; flex-shrink: 0; }
  .onb-feat-t  { font-size: 12px; }
  .onb-feat-s  { font-size: 11px; }
  .onb-actions { gap: 8px; }
  .onb-btn     { min-height: 52px; font-size: 14px; }
}

/* ─────────────────────────────────────────
   19. ADMIN / MASTER / OWNER
───────────────────────────────────────── */
@media (max-width: 900px) {
  /* Admin — горизонтальный сайдбар */
  .admin-layout   { flex-direction: column; min-height: auto; }
  .admin-sidebar  {
    position: sticky; top: var(--nav-h, 54px); z-index: 50;
    width: 100%; height: auto; flex-direction: row;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    padding: 6px 8px; border-right: none;
    border-bottom: 1px solid var(--line); gap: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .admin-sidebar::-webkit-scrollbar { display: none; }
  .admin-sidebar > div:last-child { display: none; }
  .admin-nav-item {
    flex-direction: column; gap: 3px; padding: 6px 10px;
    border-left: none !important; border-bottom: 2.5px solid transparent !important;
    border-radius: 8px; white-space: nowrap; font-size: 10px;
    min-width: 44px; min-height: 44px; justify-content: center; flex-shrink: 0;
  }
  .admin-nav-item.active { border-bottom-color: var(--orange) !important; background: var(--orange-dim); color: var(--orange); }
  .admin-nav-icon { font-size: 18px; }
  .admin-nav-label { display: none; }
  .admin-content  { padding: 16px; }
  .admin-stats-grid    { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .admin-quick-actions { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .admin-search   { width: 100%; font-size: 16px !important; min-height: 44px; }
  .admin-filters  { flex-wrap: wrap; gap: 6px; }
  .admin-filter-btn { min-height: 38px; padding: 6px 12px; }

  /* Calendar — горизонтальный скролл */
  .a-cal-week  { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .a-cal-grid  { min-width: 600px; }

  /* Master */
  .mast-stats   { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
  .mast-stat    { padding: 12px 10px; }
  .mast-stat-num { font-size: 18px; }
  .sched-slot   { padding: 12px 14px; gap: 8px 12px; }
  .sched-btn    { min-height: 40px; font-size: 12px; }

  /* Owner */
  .kpi-grid     { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-card     { padding: 14px 14px; }
  .kpi-num      { font-size: 20px; }
  .owner-tabs   { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; padding: 0 8px; -webkit-overflow-scrolling: touch; }
  .owner-tabs::-webkit-scrollbar { display: none; }
  .owner-tab    { min-height: 44px; padding: 0 14px; flex-shrink: 0; white-space: nowrap; font-size: 11px; }
  .bar-label    { min-width: 90px; font-size: 11px; }
  .staff-tbl th, .staff-tbl td { padding: 9px 10px; font-size: 12px; }
  .perm-tbl th,  .perm-tbl td  { padding: 7px 8px; font-size: 11px; }
}
@media (max-width: 430px) {
  .admin-stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-grid         { grid-template-columns: 1fr 1fr; }
  .mast-stats       { grid-template-columns: 1fr 1fr 1fr; }
}

/* ─────────────────────────────────────────
   20. СКЕЛЕТОН-ЗАГРУЗКА
───────────────────────────────────────── */
@media (max-width: 900px) {
  .page-skeleton { padding: 28px 0 20px; }
  .sk-hero  { height: 44px; }
  .sk-card  { height: 90px; }
  .sk-title { height: 24px; }
}

/* ─────────────────────────────────────────
   21. ULTRA SMALL (≤ 360px)
───────────────────────────────────────── */
@media (max-width: 360px) {
  .container      { padding: 0 12px; }
  .hero-title     { font-size: 28px !important; }
  .hv-grid        { grid-template-columns: 1fr; }
  .st-grid        { grid-template-columns: 1fr; }
  .svc-chip       { min-width: 100%; }
  .time-grid      { grid-template-columns: repeat(3, 1fr); }
  .otp-box        { width: 52px !important; height: 56px !important; font-size: 22px !important; }
  .parts-grid     { grid-template-columns: 1fr; }
  .cab-mini-stats { flex-wrap: wrap; row-gap: 8px; }
  .cab-side-cards { grid-template-columns: 1fr; }
  .loy-levels     { grid-template-columns: 1fr; }
  .hist-actions .btn { min-width: 0; }
}

/* ─────────────────────────────────────────
   22. PWA STANDALONE + LANDSCAPE
───────────────────────────────────────── */
@media (display-mode: standalone) {
  #nav { padding-top: var(--safe-t, 0px); height: calc(var(--nav-h, 54px) + var(--safe-t, 0px)); }
  #app { padding-top: calc(var(--nav-h, 54px) + var(--safe-t, 0px)) !important; }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  :root { --bnav-bar: 50px; }
  .bnav-icon  { font-size: 18px; }
  .bnav-label { font-size: 9px; }
  .hero-section { min-height: auto; padding: 56px 0 32px; }
  .booking-hero { padding: 28px 0 18px; }
  #messenger-panel { max-height: 96dvh; }
  .onb-box { max-height: 90dvh; }
  section  { padding: 24px 0; }
}


/* PATCH 2026-03-11 — parts mobile hardening */
@media (max-width: 900px) {
  .parts-hero,
  .parts-layout,
  .parts-catalogue,
  .parts-form-col,
  .parts-order-form,
  .parts-search-wrap,
  .parts-grid,
  .part-card,
  .part-head,
  .part-footer,
  .pof-selected,
  .pof-sel-row,
  .pof-fields,
  .pof-group,
  .pof-input,
  .pof-textarea {
    min-width: 0;
    box-sizing: border-box;
  }

  .page,
  .parts-hero,
  .parts-layout,
  .parts-catalogue,
  .parts-form-col,
  .parts-order-form {
    max-width: 100%;
  }

  .parts-layout {
    overflow-x: clip;
  }

  .parts-grid {
    align-items: stretch;
  }

  .part-head,
  .part-footer,
  .pof-sel-row {
    flex-wrap: wrap;
  }

  .part-stock,
  .part-price,
  .part-order-btn,
  .pof-sel-sku,
  .pof-sel-price {
    white-space: normal;
    word-break: break-word;
  }

  .part-order-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    min-height: 40px;
  }

  .part-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .part-price {
    width: 100%;
  }

  .pof-sel-clear {
    position: static;
    margin-top: 10px;
    display: inline-flex;
    align-self: flex-start;
  }

  .pof-input,
  .pof-textarea,
  .pof-submit {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .parts-hero .container,
  .parts-layout,
  .parts-catalogue,
  .parts-form-col {
    min-width: 0;
  }

  .parts-hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .phs-sep {
    display: none;
  }

  .phs-item {
    min-width: 0;
    padding: 0;
  }

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

  .part-card {
    padding: 14px;
  }

  .parts-filter-row {
    margin-right: -4px;
    padding-right: 4px;
  }
}

@media (max-width: 380px) {
  .parts-hero-stats {
    grid-template-columns: 1fr;
  }
}
