@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  body {
    background: #f4f4f7;
  }

  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }

  .nav {
    height: auto;
  }

  .nav-inner {
    min-height: 56px;
    height: auto;
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav-logo {
    margin-right: 4px;
  }

  .nav-logo img {
    height: 36px;
  }

  .nav-right {
    margin-left: auto;
    gap: 6px;
    min-width: 0;
  }

  .nav-tabs {
    order: 3;
    width: 100%;
    gap: 4px;
    padding: 3px;
    border: 0.5px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, .74);
  }

  .nav-tab {
    flex: 1 0 auto;
    min-width: max-content;
    padding: 8px 10px;
    text-align: center;
    font-size: 13px;
    border-radius: 13px;
  }

  .nav-telegram {
    width: 34px;
    height: 34px;
    max-width: 34px;
    justify-content: center;
    border: 0.5px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    font-size: 0;
  }

  .nav-telegram img {
    width: 18px;
    height: 18px;
  }

  .nav-ticket-btn,
  .nav-logout-btn {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .nav-avatar {
    width: 34px;
    height: 34px;
  }

  .nav-balance {
    max-width: 136px;
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .mkt-frame {
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .mkt-layout {
    min-height: 0;
  }

  .mkt-main {
    padding: 12px 12px 22px;
  }

  .mkt-aside {
    padding: 12px;
    background: transparent;
  }

  .top-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .sub-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .sub-tab {
    flex: 1 0 auto;
    padding: 8px 12px;
    font-size: 13px;
  }

  .table-tools {
    width: 100%;
    justify-content: space-between;
  }

  .cookie-consent {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    transform: none;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .cookie-consent-btn {
    width: 100%;
  }

  .view-toggle {
    flex-shrink: 0;
  }

  #listView {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .leads-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .lead-card {
    padding: 13px;
    border-radius: 15px;
  }

  .card-name,
  .card-region {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .btn-mini {
    min-width: 46px;
    height: 30px;
  }

  .pager {
    justify-content: center;
    padding-top: 12px;
  }

  .pager-info {
    width: 100%;
    text-align: center;
  }

  .pager-controls {
    max-width: 100%;
    justify-content: center;
  }

  .filter-card {
    border-radius: 16px;
  }

  .fc-head {
    padding: 12px 13px;
  }

  .fc-body {
    padding: 12px;
  }

  .frow {
    gap: 8px;
  }

  .btn-apply,
  .btn-reset,
  .btn-auto {
    min-height: 42px;
  }
}

@media (max-width: 640px) {
  .prof-layout,
  .purch-layout,
  .tkt-layout {
    margin: 12px auto 28px;
    padding: 0 12px;
  }

  .prof-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .prof-left,
  .prof-right {
    gap: 12px;
  }

  .sec-card,
  .purch-stat,
  .tkt-card {
    border-radius: 16px;
  }

  .bal-value {
    font-size: 28px;
  }

  .amount-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .amount-chip {
    min-height: 42px;
    padding: 10px 6px;
  }

  .topup-custom-row,
  .promo-apply-row {
    flex-wrap: wrap;
  }

  .topup-custom-row .fc-inp,
  .promo-apply-row #promoInput {
    flex: 1 1 100% !important;
    height: 42px !important;
  }

  .promo-apply-row #promoBtn {
    width: 100%;
    height: 42px !important;
  }

  .prof-stats,
  .purch-stat-grid {
    grid-template-columns: 1fr;
  }

  .intg-row,
  .tx-item {
    align-items: flex-start;
  }

  .intg-row {
    flex-direction: column;
  }

  .intg-nm,
  .intg-ds,
  .tx-nm,
  .tx-dt,
  .prof-stat-lbl,
  .prof-stat-val,
  .user-nm,
  .user-em {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .tx-val {
    max-width: 42%;
    text-align: right;
  }

  .purch-title,
  .tkt-title {
    font-size: 19px;
  }

  .purch-tools {
    flex-direction: column;
  }

  .purch-tools .fc-inp,
  .purch-tools .btn-reset {
    width: 100%;
    flex: auto;
    min-height: 42px;
  }

  .purch-table-card {
    background: transparent;
    border: 0;
    overflow: visible;
  }

  .purch-table-card table,
  .purch-table-card thead,
  .purch-table-card tbody,
  .purch-table-card tr,
  .purch-table-card td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .purch-table-card table {
    min-width: 0;
  }

  .purch-table-card thead,
  .purch-table-card colgroup {
    display: none;
  }

  .purch-table-card tr {
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, .04);
  }

  .purch-table-card td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 0.5px solid var(--border);
    white-space: normal;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .purch-table-card td:last-child {
    border-bottom: 0;
  }

  .purch-table-card td::before {
    flex-shrink: 0;
    color: var(--text3);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: left;
  }

  .purch-table-card td:nth-child(1)::before { content: "Имя"; }
  .purch-table-card td:nth-child(2)::before { content: "Телефон"; }
  .purch-table-card td:nth-child(3)::before { content: "Регион"; }
  .purch-table-card td:nth-child(4)::before { content: "Статус"; }
  .purch-table-card td:nth-child(5)::before { content: "Покупка"; }
  .purch-table-card td:nth-child(6)::before { content: "Цена"; }
  .purch-table-card td:nth-child(7)::before { content: "Обращение"; }

  .copy-phone {
    white-space: normal;
    text-align: right;
  }

  .tkt-topbar {
    align-items: stretch;
  }

  .tkt-topbar .btn-apply {
    width: 100% !important;
  }

  .tkt-card {
    padding: 13px;
  }

  .tkt-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .tkt-id,
  .tkt-subj,
  .tkt-preview {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .modal-backdrop,
  .contact-modal-backdrop {
    padding: 12px;
  }

  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
  }

  .modal-title {
    white-space: normal;
  }

  .modal-body {
    overflow-y: auto;
  }

  .modal-stat-grid {
    grid-template-columns: 1fr;
  }

  .modal-foot {
    flex-direction: column;
  }

  .btn-cancel,
  .btn-confirm {
    width: 100%;
    flex: auto;
    min-height: 42px;
  }

  .contact-card {
    width: 100%;
    max-width: calc(100vw - 24px);
    border-radius: 20px;
  }

  .contact-hero {
    align-items: flex-start;
    padding-right: 28px;
  }

  .contact-price {
    font-size: 15px;
    padding: 7px 9px;
  }

  .contact-actions {
    flex-direction: column;
  }

  .contact-action {
    min-height: 42px;
  }

  .contact-name,
  .contact-meta {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .contact-paid-grid {
    grid-template-columns: 1fr;
  }

  .ios-row {
    align-items: flex-start;
  }

  .ios-val {
    text-align: right;
  }

  .tkt-modal-dialog {
    width: 100%;
  }

  .tkt-modal-body {
    padding: 14px;
  }
}

@media (max-width: 420px) {
  .nav-inner {
    padding: 7px 10px;
  }

  .nav-logo img {
    height: 32px;
  }

  .nav-right {
    width: 100%;
    order: 2;
    justify-content: space-between;
  }

  .nav-tabs {
    order: 3;
  }

  .nav-balance {
    flex: 1;
    max-width: none;
    text-align: center;
  }

  .nav-ticket-btn {
    min-width: 74px;
  }

  .nav-avatar {
    display: none;
  }

  .mkt-main {
    padding: 10px;
  }

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

  .bid-row {
    flex-direction: column;
  }

  .bid-go {
    width: 100%;
    max-width: none;
  }

  .buy-full {
    white-space: normal;
  }

  .modal-head,
  .modal-body,
  .modal-foot {
    padding-left: 14px;
    padding-right: 14px;
  }

  .toast-wrap {
    left: 12px;
    right: 12px;
    bottom: 12px;
    align-items: stretch;
  }

  .toast {
    width: 100%;
  }
}
