/* ============================================================================
   Мобильная адаптация КЛИЕНТСКОГО КАБИНЕТА (portal).
   Действует только на body[data-mode="portal"] и только <= 768px.
   Десктоп (>768px) и /staff (data-mode="staff") не затрагиваются.
   ========================================================================== */

@media (max-width: 768px) {
  /* ---------- общий контейнер, запрет горизонтального скролла ---------- */
  html:has(body[data-mode="portal"]) { overflow-x: hidden; max-width: 100%; }
  body[data-mode="portal"] { overflow-x: hidden; width: 100%; max-width: 100%; }
  body[data-mode="portal"] #clientApp,
  body[data-mode="portal"] #loginScreen {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  body[data-mode="portal"] #clientApp {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
  }
  body[data-mode="portal"] .cp-body {
    padding: 10px 10px 18px;
    -webkit-overflow-scrolling: touch;
  }
  body[data-mode="portal"] .cp-wrap { max-width: 100%; gap: 10px; }

  /* ---------- шапка: 2 аккуратные строки ---------- */
  body[data-mode="portal"] .cp-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand user" "tabs tabs";
    align-items: center;
    gap: 6px 8px;
    padding: 8px 10px;
  }
  body[data-mode="portal"] .cp-brand { grid-area: brand; min-width: 0; gap: 8px; }
  body[data-mode="portal"] .cp-logo { width: 30px; height: 30px; border-radius: 8px; }
  body[data-mode="portal"] .cp-title {
    font-size: 12.5px; line-height: 1.2; max-width: 38vw;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  body[data-mode="portal"] .cp-sub { display: none; }
  body[data-mode="portal"] .cp-user {
    grid-area: user; min-width: 0; gap: 6px; justify-content: flex-end;
  }
  body[data-mode="portal"] .cp-user-txt {
    display: flex; flex-direction: column; align-items: flex-end;
    line-height: 1.1; min-width: 0;
  }
  body[data-mode="portal"] .cp-name { font-size: 11.5px; max-width: 22vw; }
  body[data-mode="portal"] .cp-phone {
    font-size: 9.5px; max-width: 22vw;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  body[data-mode="portal"] .cp-logout {
    height: 44px; padding: 0 10px; font-size: 11.5px; border-radius: 10px;
  }
  body[data-mode="portal"] .cp-tabs {
    grid-area: tabs; width: 100%; justify-content: flex-start;
    flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 2px 0 0;
    scrollbar-width: none;
  }
  body[data-mode="portal"] .cp-tabs::-webkit-scrollbar { display: none; }
  body[data-mode="portal"] .cp-tab {
    flex: 0 0 auto; height: 44px; padding: 0 14px;
    font-size: 13px; border-radius: 12px;
  }

  /* ---------- подсказки, карточки, боковые кнопки ---------- */
  body[data-mode="portal"] .cp-hintbar { padding: 8px 10px; font-size: 11px; line-height: 1.4; }
  body[data-mode="portal"] .cp-card { padding: 10px 12px 12px; border-radius: 10px; }
  body[data-mode="portal"] .cp-step { font-size: 13px; gap: 7px; }
  body[data-mode="portal"] .cp-side { grid-template-columns: 1fr 1fr; gap: 8px; }
  body[data-mode="portal"] .cp-garage-btn {
    min-height: 52px; padding: 10px 12px; font-size: 12.5px; gap: 8px;
  }
  body[data-mode="portal"] .cp-garage-ic { font-size: 18px; width: 22px; }
  body[data-mode="portal"] .cp-garage-n {
    min-width: 22px; height: 22px; font-size: 11px; line-height: 22px;
  }

  /* ---------- поля ввода: 16px и 44px (без зума на iPhone) ---------- */
  body[data-mode="portal"] input:not([type="checkbox"]):not([type="radio"]),
  body[data-mode="portal"] select,
  body[data-mode="portal"] textarea { font-size: 16px !important; }
  body[data-mode="portal"] .cp-field { font-size: 12.5px; gap: 5px; margin-top: 10px; }
  body[data-mode="portal"] .cp-field input,
  body[data-mode="portal"] .cp-field select {
    height: 44px; padding: 0 12px; border-radius: 10px;
  }
  body[data-mode="portal"] .cp-field textarea {
    min-height: 96px; padding: 10px 12px; border-radius: 10px;
  }
  body[data-mode="portal"] .cp-grid2 { grid-template-columns: 1fr; gap: 0; }
  body[data-mode="portal"] input[type="checkbox"],
  body[data-mode="portal"] input[type="radio"] {
    width: 20px; height: 20px; min-width: 20px; accent-color: #1d4ed8;
  }
  body[data-mode="portal"] .cp-vin-row {
    flex-direction: column; align-items: stretch; gap: 6px;
  }
  body[data-mode="portal"] .cp-vin {
    width: 100%; height: 48px; font-size: 16px; letter-spacing: 1px;
  }
  body[data-mode="portal"] .cp-counter {
    align-self: flex-start; min-width: 0; height: 32px; padding: 0 10px;
    font-size: 12px; line-height: 30px;
  }
  body[data-mode="portal"] .cp-qcat { height: 44px; line-height: 42px; font-size: 12.5px; }
  body[data-mode="portal"] .cp-qdrop {
    left: 0; right: 0; width: auto; max-width: 100%; max-height: 50vh;
  }
  body[data-mode="portal"] .cp-qitem { min-height: 44px; padding: 8px 10px; }
  body[data-mode="portal"] .cp-qset { min-height: 44px; }
  body[data-mode="portal"] .cp-hint { font-size: 10.5px; }
  body[data-mode="portal"] .cp-chips { gap: 6px; }
  body[data-mode="portal"] .cp-chip { height: 44px; padding: 0 12px; font-size: 12px; }
  /* ---------- строки запроса и кнопки ---------- */
  body[data-mode="portal"] .cp-items { gap: 8px; }
  body[data-mode="portal"] .cp-item-row {
    display: grid; grid-template-columns: 22px minmax(0, 1fr) 44px;
    gap: 6px; align-items: center;
  }
  body[data-mode="portal"] .cp-item-n { line-height: 44px; font-size: 12px; }
  body[data-mode="portal"] .cp-item-row input {
    height: 44px; padding: 0 12px; border-radius: 10px;
  }
  body[data-mode="portal"] .cp-item-del {
    width: 44px; height: 44px; border-radius: 10px; font-size: 14px;
  }
  body[data-mode="portal"] .cp-add { height: 44px; width: 100%; font-size: 13px; }
  body[data-mode="portal"] .cp-actions {
    flex-direction: column; align-items: stretch; gap: 8px; margin-top: 12px;
  }
  body[data-mode="portal"] .cp-submit {
    width: 100%; height: 48px; padding: 0 16px; font-size: 15px;
  }
  body[data-mode="portal"] .cp-note { font-size: 11.5px; text-align: center; }
  body[data-mode="portal"] .cp-prefs-head { gap: 6px; }
  body[data-mode="portal"] .cp-prefs-txt {
    flex: 1 1 100%; min-width: 0; font-size: 12px;
  }
  body[data-mode="portal"] .cp-prefs-btn {
    height: 44px; padding: 0 12px; font-size: 12px;
  }
  body[data-mode="portal"] .cg-opts { gap: 4px 10px; }
  body[data-mode="portal"] .cg-opt { min-height: 40px; font-size: 13px; }
  body[data-mode="portal"] .cg-chks .cg-opt { min-height: 44px; padding: 6px 10px; }
  body[data-mode="portal"] .cg-grid2 { grid-template-columns: 1fr; gap: 0; }

  /* ---------- «Мои запросы» и предложения менеджера ---------- */
  body[data-mode="portal"] .cp-list-head { flex-wrap: wrap; gap: 8px; }
  body[data-mode="portal"] .cp-req-row { padding: 10px; gap: 8px; align-items: flex-start; }
  body[data-mode="portal"] .cp-req-top { flex-wrap: wrap; gap: 6px; }
  body[data-mode="portal"] .cp-req-num { font-size: 12.5px; }
  body[data-mode="portal"] .cp-req-item { max-width: 100%; white-space: normal; }
  body[data-mode="portal"] .cp-req-cols { grid-template-columns: 1fr; gap: 6px; }
  body[data-mode="portal"] .cp-req-detail { padding: 10px; }
  body[data-mode="portal"] .cp-req-comment { font-size: 12px; }
  body[data-mode="portal"] .cp-offers { gap: 8px; }
  body[data-mode="portal"] .cp-offer-block { padding: 10px; }
  body[data-mode="portal"] .cp-offer-line {
    display: flex; flex-wrap: wrap; align-items: flex-start;
    gap: 6px 8px; font-size: 12.5px;
  }
  body[data-mode="portal"] .cp-offer-txt {
    flex: 1 1 calc(100% - 32px); min-width: 0;
  }
  body[data-mode="portal"] .cp-offer-qty {
    width: 72px; height: 44px; font-size: 16px; margin-left: 28px;
  }
  body[data-mode="portal"] .cp-cart-add { width: 100%; height: 48px; font-size: 14px; }
  body[data-mode="portal"] .cp-cart-actions-bar {
    flex-direction: column; align-items: stretch; gap: 6px;
  }
  body[data-mode="portal"] .cp-answer-wait,
  body[data-mode="portal"] .cp-manager-comment { font-size: 12px; }

  /* ---------- корзина ---------- */
  body[data-mode="portal"] .cp-cart-item {
    flex-wrap: wrap; gap: 6px 10px; padding: 10px;
  }
  body[data-mode="portal"] .cp-cart-main { flex: 1 1 100%; }
  body[data-mode="portal"] .cp-cart-name { font-size: 13px; }
  body[data-mode="portal"] .cp-cart-sub { font-size: 11px; }
  body[data-mode="portal"] .cp-cart-price { font-size: 13.5px; }
  body[data-mode="portal"] .cp-cart-qty {
    width: 72px; height: 44px; font-size: 16px;
  }
  body[data-mode="portal"] .cp-cart-del {
    width: 44px; height: 44px; font-size: 15px;
  }
  body[data-mode="portal"] .cp-cart-pay-opt { min-height: 44px; font-size: 13.5px; }
  body[data-mode="portal"] .cp-cart-total { font-size: 13.5px; }
  body[data-mode="portal"] .cp-cart-actions {
    flex-direction: column; align-items: stretch; gap: 8px;
  }
  body[data-mode="portal"] #cpCartOrderBtn {
    width: 100%; height: 48px; font-size: 15px;
  }

  /* ---------- модальные окна: 94% ширины, крупная кнопка закрытия ---------- */
  body[data-mode="portal"] .cp-modal { padding: 8px; align-items: center; }
  body[data-mode="portal"] .cp-modal-card {
    width: 94vw; max-width: 94vw; max-height: 92vh;
    padding: 12px; border-radius: 12px;
  }
  body[data-mode="portal"] .co-card {
    width: 94vw; max-width: 94vw; max-height: 92vh;
    padding: 0 10px 10px;
  }
  body[data-mode="portal"] .co-top {
    margin: 0 -10px; padding: 10px 10px 6px;
  }
  body[data-mode="portal"] .cp-modal-head { gap: 8px; margin-bottom: 10px; }
  body[data-mode="portal"] .cp-modal-title { font-size: 16px; }
  body[data-mode="portal"] .cp-modal-sub { font-size: 11px; }
  body[data-mode="portal"] .login-close {
    width: 44px; height: 44px; min-width: 44px;
    font-size: 18px; line-height: 42px; border-radius: 10px;
  }
  body[data-mode="portal"] .cp-info-card,
  body[data-mode="portal"] .co-info-card {
    width: 94vw; max-width: 94vw; max-height: 92vh;
  }
  body[data-mode="portal"] .cg-tab { height: 44px; line-height: 42px; font-size: 13px; }
  /* ---------- «Мои заказы»: таблица позиций -> вертикальные карточки ---------- */
  body[data-mode="portal"] #cpOrders .co-table {
    display: block; width: 100%; border-collapse: separate;
    border-spacing: 0; font-size: 12.5px;
  }
  body[data-mode="portal"] #cpOrders .co-table thead { display: none; }
  body[data-mode="portal"] #cpOrders .co-table tbody { display: block; }
  body[data-mode="portal"] #cpOrders .co-table tr {
    display: block; border: 1px solid #e2e8f0; border-radius: 10px;
    margin: 8px 0; padding: 4px 0; background: #fff;
  }
  body[data-mode="portal"] #cpOrders .co-table td {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 10px; width: auto; min-width: 0; padding: 7px 10px; border: 0;
    border-bottom: 1px dashed #eef2f7; text-align: left !important;
    white-space: normal !important; vertical-align: top; overflow-wrap: anywhere;
  }
  body[data-mode="portal"] #cpOrders .co-table td:last-child { border-bottom: 0; }
  body[data-mode="portal"] #cpOrders .co-table td::before {
    content: attr(data-label); flex: 0 0 40%; max-width: 40%;
    color: #64748b; font-size: 11px; font-weight: 600; line-height: 1.35;
  }
  body[data-mode="portal"] #cpOrders .co-table td[data-label=""]::before { display: none; }
  body[data-mode="portal"] #cpOrders .co-table td[data-label=""] { justify-content: flex-end; }
  body[data-mode="portal"] #cpOrders .co-table td.co-empty {
    display: block; text-align: center !important; color: #7c8ba1;
  }
  body[data-mode="portal"] #cpOrders .co-table td.co-empty::before { display: none; }
  body[data-mode="portal"] #cpOrders .co-table td[colspan] { display: block; }
  body[data-mode="portal"] #cpOrders .co-table td[colspan]::before { display: none; }
  body[data-mode="portal"] #cpOrders .co-table .co-code-cell { white-space: normal; }
  body[data-mode="portal"] .co-code {
    min-height: 44px; padding: 4px 6px; text-align: left; word-break: break-all;
  }
  body[data-mode="portal"] #cpOrders .co-add-row {
    min-height: 44px; height: auto; padding: 6px 10px;
  }
  body[data-mode="portal"] #cpOrders .co-st {
    height: auto; min-height: 20px; padding: 2px 8px; font-size: 10px; line-height: 16px;
  }
  body[data-mode="portal"] #cpOrders .co-head { padding: 8px 10px; gap: 6px; }
  body[data-mode="portal"] #cpOrders .co-title { font-size: 13px; }
  body[data-mode="portal"] #cpOrders .co-date { margin-left: 0; font-size: 11px; }
  body[data-mode="portal"] #cpOrders .co-meta {
    padding: 6px 10px; gap: 4px 10px; font-size: 11px;
  }
  body[data-mode="portal"] #cpOrders .co-foot {
    padding: 8px 10px; gap: 6px 12px; font-size: 11.5px;
  }
  body[data-mode="portal"] #cpOrders .co-actions { padding: 8px 10px; gap: 6px; }
  body[data-mode="portal"] #cpOrders .co-btn {
    width: 100%; height: 44px; justify-content: center; font-size: 12.5px;
  }
  body[data-mode="portal"] .co-cars { gap: 6px; }
  body[data-mode="portal"] .co-chip { height: 44px; font-size: 11.5px; }

  /* ---------- компактный фильтр авто в «Мои заказы» ---------- */
  body[data-mode="portal"] #cpOrders { overflow-x: hidden; }
  body[data-mode="portal"] #cpOrders .co-card { overflow-x: hidden; }
  body[data-mode="portal"] #cpOrders .co-cars {
    display: block; overflow: visible; gap: 0; margin: 8px 0 2px;
  }
  body[data-mode="portal"] #cpOrders .co-cars .co-chip { display: none !important; }
  body[data-mode="portal"] .co-mfilter { position: relative; width: 100%; }
  body[data-mode="portal"] .co-mfilter-bar { display: flex; gap: 6px; width: 100%; }
  body[data-mode="portal"] .co-mfilter-btn {
    flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 12px;
    border: 1px solid #cbd5e1; border-radius: 10px; background: #fff;
    color: #1f2937; font: 600 12.5px/42px "Segoe UI", Tahoma, sans-serif;
    text-align: left; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; cursor: pointer;
  }
  body[data-mode="portal"] .co-mfilter-btn:hover { background: #f8fafc; border-color: #93b8ff; }
  body[data-mode="portal"] .co-mfilter-reset {
    flex: 0 0 auto; height: 44px; padding: 0 12px;
    border: 1px solid #f2b8b8; border-radius: 10px; background: #fff5f5;
    color: #b91c1c; font: 600 12px/42px "Segoe UI", Tahoma, sans-serif;
    cursor: pointer; white-space: nowrap;
  }
  body[data-mode="portal"] .co-mfilter-reset.hidden { display: none !important; }
  body[data-mode="portal"] .co-mfilter-backdrop {
    position: fixed; inset: 0; z-index: 2598; background: rgba(15, 23, 42, .45);
  }
  body[data-mode="portal"] .co-mfilter-backdrop.hidden { display: none !important; }
  body[data-mode="portal"] .co-mfilter-pop {
    position: fixed; left: 4vw; right: 4vw; top: 8vh; z-index: 2599;
    display: flex; flex-direction: column; max-height: 78vh;
    background: #fff; border: 1px solid #dbe3ee; border-radius: 14px;
    box-shadow: 0 24px 60px rgba(2, 6, 23, .35); overflow: hidden;
  }
  body[data-mode="portal"] .co-mfilter-pop.hidden { display: none !important; }
  body[data-mode="portal"] .co-mfilter-head {
    padding: 12px 14px; border-bottom: 1px solid #e2e8f0;
    font-weight: 700; font-size: 14px; color: #0f172a; background: #f8fbff;
  }
  body[data-mode="portal"] .co-mfilter-list {
    overflow-y: auto; max-height: 55vh; padding: 4px 6px;
    -webkit-overflow-scrolling: touch;
  }
  body[data-mode="portal"] .co-mfilter-opt {
    display: flex; align-items: center; gap: 10px;
    min-height: 44px; padding: 6px 8px; border-bottom: 1px solid #f1f5f9;
    font-size: 13px; color: #1f2937; cursor: pointer;
  }
  body[data-mode="portal"] .co-mfilter-opt:last-child { border-bottom: 0; }
  body[data-mode="portal"] .co-mfilter-opt input {
    width: 20px; height: 20px; min-width: 20px; margin: 0; accent-color: #1d4ed8;
  }
  body[data-mode="portal"] .co-mfilter-opt span {
    flex: 1 1 auto; min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
  }
  body[data-mode="portal"] .co-mfilter-opt b {
    flex: 0 0 auto; min-width: 26px; text-align: right; color: #64748b; font-size: 11.5px;
  }
  body[data-mode="portal"] .co-mfilter-all { background: #f8fbff; font-weight: 600; }
  body[data-mode="portal"] .co-mfilter-foot {
    padding: 10px 12px; border-top: 1px solid #e2e8f0; background: #f8fafc;
  }
  body[data-mode="portal"] .co-mfilter-apply {
    width: 100%; height: 48px; padding: 0 14px;
    border: 0; border-radius: 10px; background: #1d4ed8; color: #fff;
    font: 700 14px/46px "Segoe UI", Tahoma, sans-serif; cursor: pointer;
  }
  body[data-mode="portal"] .co-mfilter-apply:hover { background: #1a45bd; }
  body[data-mode="portal"] .co-mfilter-empty { margin: 10px 0; }


  /* ---------- окно «Информация по заказу» ---------- */
  body[data-mode="portal"] .co-info-row { flex-direction: column; gap: 2px; font-size: 12px; }
  body[data-mode="portal"] .co-info-row span {
    flex: none; font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px;
  }
  body[data-mode="portal"] .co-info-row b { font-size: 13px; }
  body[data-mode="portal"] .co-info-actions { flex-direction: column; align-items: stretch; }
  body[data-mode="portal"] .co-info-actions .co-btn { width: 100%; height: 44px; }
  body[data-mode="portal"] .co-qr img { width: 130px; height: 130px; }
  /* ---------- профиль / гараж ---------- */
  body[data-mode="portal"] .cg-car { padding: 10px; gap: 8px; }
  body[data-mode="portal"] .cg-car-act {
    flex-direction: row; align-items: center; justify-content: space-between; gap: 6px;
  }
  body[data-mode="portal"] .cg-pick,
  body[data-mode="portal"] .cg-del { height: 44px; min-height: 44px; font-size: 12px; }
  body[data-mode="portal"] .cg-del { width: 44px; }
  body[data-mode="portal"] .cg-stats { grid-template-columns: 1fr 1fr; }
  body[data-mode="portal"] .lc-eye { width: 44px; height: 44px; right: 0; font-size: 16px; }
  body[data-mode="portal"] .lc-pass-wrap input { padding-right: 50px !important; }

  /* ---------- вход / регистрация / восстановление пароля ---------- */
  body[data-mode="portal"] #loginScreen {
    align-items: flex-start; overflow-y: auto;
    padding: 10px 8px 24px; -webkit-overflow-scrolling: touch;
  }
  body[data-mode="portal"] #loginScreen .portal-wrap {
    width: 100%; max-width: 100%; gap: 10px;
  }
  body[data-mode="portal"] #loginScreen .portal-brand { padding-top: 4px; gap: 5px; }
  body[data-mode="portal"] #loginScreen .portal-title { font-size: 22px; }
  body[data-mode="portal"] #loginScreen .portal-sub { font-size: 11px; text-align: center; }
  body[data-mode="portal"] #loginScreen .login-card {
    width: 100%; max-width: 100%; max-height: none; overflow: visible;
    padding: 14px 12px 16px; border-radius: 12px;
  }
  body[data-mode="portal"] #loginScreen .login-head { gap: 8px; margin-bottom: 12px; }
  body[data-mode="portal"] #loginScreen .login-title { font-size: 16px; }
  body[data-mode="portal"] #loginScreen .ls-btn,
  body[data-mode="portal"] #loginScreen .lc-btn {
    height: 44px; line-height: 42px; font-size: 13.5px;
  }
  body[data-mode="portal"] #loginScreen .ls-actions {
    flex-direction: column; align-items: stretch; gap: 8px; margin-top: 12px;
  }
  body[data-mode="portal"] #loginScreen .ls-actions .cp-submit { order: -1; }
  body[data-mode="portal"] #loginScreen .ls-actions .btn {
    width: 100%; height: 44px; margin: 0;
  }
  body[data-mode="portal"] #loginScreen .ls-msg { font-size: 12px; }
  body[data-mode="portal"] #loginScreen .lc-link { min-height: 44px; font-size: 12.5px; }
  body[data-mode="portal"] #loginScreen .portal-back { height: 44px; font-size: 12.5px; }
  body[data-mode="portal"] #loginScreen .lc-code { height: 48px; font-size: 20px; }
  body[data-mode="portal"] #loginScreen .portal-foot {
    flex-wrap: wrap; justify-content: center; gap: 4px 8px;
    font-size: 11px; text-align: center;
  }

  /* ---------- уведомление ---------- */
  body[data-mode="portal"] .cp-toast {
    left: 10px; right: 10px; bottom: 14px; max-width: none;
    transform: none; font-size: 12.5px;
  }
}

@media (max-width: 480px) {
  body[data-mode="portal"] .cp-title { max-width: 34vw; font-size: 12px; }
  body[data-mode="portal"] .cp-name { max-width: 20vw; }
  body[data-mode="portal"] .cp-phone { max-width: 20vw; }
  body[data-mode="portal"] .cp-logout { padding: 0 8px; font-size: 11px; }
  body[data-mode="portal"] #cpOrders .co-table td::before {
    flex-basis: 38%; max-width: 38%;
  }
  body[data-mode="portal"] .cp-garage-btn { padding: 9px 10px; font-size: 12px; }
  body[data-mode="portal"] .cp-garage-txt {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
}

/* ============================================================================
   ПК-версия клиентского кабинета: тот же компактный мультифильтр авто.
   Действует только на body[data-mode="portal"] и только > 768px.
   /staff (data-mode="staff") не затрагивается.
   ========================================================================== */
@media (min-width: 769px) {
  body[data-mode="portal"] #cpOrders { overflow-x: hidden; }
  body[data-mode="portal"] #cpOrders .co-card { overflow-x: hidden; }
  body[data-mode="portal"] #cpOrders .co-cars {
    display: block; overflow: visible; gap: 0; margin: 8px 0 2px;
  }
  body[data-mode="portal"] #cpOrders .co-cars .co-chip { display: none !important; }
  body[data-mode="portal"] .co-mfilter { position: relative; width: 100%; }
  body[data-mode="portal"] .co-mfilter-bar { display: flex; gap: 6px; width: 100%; }
  body[data-mode="portal"] .co-mfilter-btn {
    flex: 1 1 auto; min-width: 0; height: 32px; padding: 0 10px;
    border: 1px solid #cbd5e1; border-radius: 8px; background: #fff;
    color: #1f2937; font: 600 12px/30px "Segoe UI", Tahoma, sans-serif;
    text-align: left; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; cursor: pointer;
  }
  body[data-mode="portal"] .co-mfilter-btn:hover { background: #f8fafc; border-color: #93b8ff; }
  body[data-mode="portal"] .co-mfilter-reset {
    flex: 0 0 auto; height: 32px; padding: 0 10px;
    border: 1px solid #f2b8b8; border-radius: 8px; background: #fff5f5;
    color: #b91c1c; font: 600 11.5px/30px "Segoe UI", Tahoma, sans-serif;
    cursor: pointer; white-space: nowrap;
  }
  body[data-mode="portal"] .co-mfilter-reset.hidden { display: none !important; }
  body[data-mode="portal"] .co-mfilter-backdrop {
    position: fixed; inset: 0; z-index: 2598; background: rgba(15, 23, 42, .35);
  }
  body[data-mode="portal"] .co-mfilter-backdrop.hidden { display: none !important; }
  body[data-mode="portal"] .co-mfilter-pop {
    position: fixed; left: 50%; top: 16vh; transform: translateX(-50%);
    z-index: 2599; display: flex; flex-direction: column;
    width: 420px; max-width: calc(100vw - 40px); max-height: 70vh;
    background: #fff; border: 1px solid #dbe3ee; border-radius: 12px;
    box-shadow: 0 24px 60px rgba(2, 6, 23, .35); overflow: hidden;
  }
  body[data-mode="portal"] .co-mfilter-pop.hidden { display: none !important; }
  body[data-mode="portal"] .co-mfilter-head {
    padding: 10px 12px; border-bottom: 1px solid #e2e8f0;
    font-weight: 700; font-size: 13px; color: #0f172a; background: #f8fbff;
  }
  body[data-mode="portal"] .co-mfilter-list {
    overflow-y: auto; max-height: 55vh; padding: 4px 6px;
  }
  body[data-mode="portal"] .co-mfilter-opt {
    display: flex; align-items: center; gap: 9px;
    min-height: 36px; padding: 5px 8px; border-bottom: 1px solid #f1f5f9;
    font-size: 12.5px; color: #1f2937; cursor: pointer;
  }
  body[data-mode="portal"] .co-mfilter-opt:last-child { border-bottom: 0; }
  body[data-mode="portal"] .co-mfilter-opt input {
    width: 18px; height: 18px; min-width: 18px; margin: 0; accent-color: #1d4ed8;
  }
  body[data-mode="portal"] .co-mfilter-opt span {
    flex: 1 1 auto; min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
  }
  body[data-mode="portal"] .co-mfilter-opt b {
    flex: 0 0 auto; min-width: 24px; text-align: right; color: #64748b; font-size: 11px;
  }
  body[data-mode="portal"] .co-mfilter-all { background: #f8fbff; font-weight: 600; }
  body[data-mode="portal"] .co-mfilter-foot {
    padding: 10px 12px; border-top: 1px solid #e2e8f0; background: #f8fafc;
  }
  body[data-mode="portal"] .co-mfilter-apply {
    width: 100%; height: 40px; padding: 0 14px;
    border: 0; border-radius: 8px; background: #1d4ed8; color: #fff;
    font: 700 13px/38px "Segoe UI", Tahoma, sans-serif; cursor: pointer;
  }
  body[data-mode="portal"] .co-mfilter-apply:hover { background: #1a45bd; }
  body[data-mode="portal"] .co-mfilter-empty { margin: 10px 0; }
}




