/* Термо Декор — mobile-first, поверх Tailwind CDN */

:root {
  --td-radius: 1rem;
  --td-radius-lg: 1.25rem;
  --td-touch: 2.75rem;
  --color-brand: #008ec0;
  --color-ink: #0f172a;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Контейнер страницы: отступы сначала под узкий экран */
.td-main {
  width: 100%;
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  padding-top: 1.25rem;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
}

@media (min-width: 640px) {
  .td-main {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: 1.75rem;
    padding-bottom: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .td-main {
    padding-top: 2.25rem;
  }
}

.td-main--narrow {
  max-width: 48rem;
}

/* Модалка выбора товара (/admin/sale, /crm/sale): категория со стрелкой внутри поля */
.td-sale-modal-category-select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.05rem center;
  background-size: 1rem 1rem;
  padding-right: 1.4rem;
}

.td-sale-modal-table .td-sale-modal-thumb,
.td-sale-cart-table .td-sale-cart-thumb,
.td-product-list-thumb,
.td-wh-product-thumb {
  width: 5rem;
  height: 5rem;
  min-width: 5rem;
  min-height: 5rem;
}

.td-sale-cart-stock-mobile,
.td-sale-cart-sum-mobile {
  display: none;
}

@media (max-width: 767px) {
  .td-page-title {
    font-size: 2rem;
    line-height: 2.25rem;
  }

  .td-main .td-card {
    border-color: rgb(207 216 228);
    box-shadow: none;
  }

  .td-main .td-card:hover {
    box-shadow: none;
  }

  .td-main {
    padding-left: max(0.625rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.625rem, env(safe-area-inset-right, 0px));
    padding-top: 0.5rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  }

  .td-main .td-card {
    padding: 0.75rem !important;
    border-radius: 0.875rem;
  }

  .td-mobile-sticky-submit {
    position: fixed;
    left: max(0.5rem, env(safe-area-inset-left, 0px));
    right: max(0.5rem, env(safe-area-inset-right, 0px));
    bottom: max(0.55rem, env(safe-area-inset-bottom, 0px));
    z-index: 80;
    padding: 0.35rem;
    border-radius: 0.9rem;
    background: color-mix(in srgb, #ffffff 88%, transparent);
    backdrop-filter: blur(4px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  }

  #expenseForm {
    padding-bottom: 4.9rem;
  }

  .td-table-wrap {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow: visible;
  }

  .td-table-wrap .overflow-x-auto {
    overflow-x: visible !important;
  }

  .td-table-wrap table {
    min-width: 0 !important;
    width: 100% !important;
  }

  .td-table-wrap table.td-table-mobile-ready thead {
    display: none;
  }

  .td-table-wrap table.td-table-mobile-ready tbody,
  .td-table-wrap table.td-table-mobile-ready tr,
  .td-table-wrap table.td-table-mobile-ready td {
    display: block;
    width: 100%;
  }

  .td-table-wrap table.td-table-mobile-ready tbody tr {
    margin-bottom: 0.625rem;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.75rem;
    background: #fff;
    padding: 0.5rem 0.625rem;
  }

  .td-table-wrap table.td-table-mobile-ready tbody tr:last-child {
    margin-bottom: 0;
  }

  .td-table-wrap table.td-table-mobile-ready tbody td {
    border: 0 !important;
    padding: 0.25rem 0 !important;
    text-align: left !important;
    white-space: normal !important;
    word-break: break-word;
  }

  .td-table-wrap table.td-table-mobile-ready tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.125rem;
    font-size: 0.67rem;
    line-height: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: rgb(100 116 139);
  }

  /* Заказы: карточка без текстовых подписей колонок — иконки в ячейках */
  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody td::before {
    content: none !important;
    display: none !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr {
    display: grid !important;
    grid-template-columns: 2.1rem minmax(0, 1fr);
    column-gap: 0.45rem;
    row-gap: 0.16rem;
    border-color: rgb(224 231 241);
    border-radius: 0.9rem;
    background: #ffffff;
    padding: 0.48rem 0.55rem !important;
    box-shadow: 0 1px 0 rgb(241 245 249);
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr > td:nth-child(1) {
    display: none !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr > td:nth-child(2) {
    grid-row: 1 / span 4;
    grid-column: 1;
    border-right: 1px solid rgb(222 231 242);
    padding-right: 0.4rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr > td:nth-child(2) .td-mo-body {
    font-size: 1.95rem;
    line-height: 1;
    font-weight: 400;
    color: rgb(71 85 105);
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr > td:nth-child(3),
  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr > td:nth-child(4),
  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr > td:nth-child(5),
  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr > td:nth-child(6) {
    grid-column: 2;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr > td:nth-child(6) {
    grid-row: 1;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr > td:nth-child(5) {
    grid-row: 1;
    text-align: right !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr > td:nth-child(3) {
    grid-row: 2;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr > td:nth-child(4) {
    grid-row: 3;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr > td:nth-child(6) .td-mo-body {
    font-size: 0.83rem;
    font-weight: 500;
    color: rgb(107 114 128);
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr > td:nth-child(5) .td-mo-body {
    font-size: 1.8rem;
    font-weight: 700;
    color: rgb(51 65 85);
    letter-spacing: -0.02em;
    line-height: 1.1;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact .td-mhint {
    display: none !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact .td-mo-row {
    gap: 0 !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr > td:nth-child(3) .td-mo-body,
  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr > td:nth-child(4) .td-mo-body {
    color: rgb(100 116 139);
    font-size: 0.95rem;
    line-height: 1.22rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody tr > td:nth-child(4) .td-mo-body {
    color: rgb(51 65 85);
    font-weight: 600;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody td {
    width: auto !important;
    padding-top: 0.125rem !important;
    padding-bottom: 0.125rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody td.td-mo-span {
    grid-column: 1 / -1;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody td.td-mo-span .td-mo-row {
    align-items: center;
    min-height: 2rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody td:nth-child(7) .td-mo-body {
    display: flex;
    align-items: center;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody td:nth-child(7) .td-mo-body > span {
    min-height: 1.5rem;
    line-height: 1.1;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody td:nth-child(7) {
    padding-top: 0.22rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody td:nth-child(8) {
    padding-top: 0.08rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody td .td-mo-row {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    width: 100%;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody td .td-mo-body {
    min-width: 0;
    flex: 1 1 auto;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody td .td-mo-actions {
    flex-wrap: nowrap;
    gap: 0.16rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody td .td-mo-actions > a,
  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody td .td-mo-actions > button {
    border-radius: 0.55rem;
    color: rgb(75 85 99);
    border: 1px solid rgb(229 236 245);
    background: #f8fafc;
  }

  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody td .td-mo-actions > a,
  .td-table-wrap table.td-table-mobile-ready.td-order-mcompact tbody td .td-mo-actions > button {
    width: 2.15rem;
    height: 2.15rem;
    min-width: 2.15rem;
    min-height: 2.15rem;
  }

  /* CRM /crm/orders: карточка строки как у админских заказов (6 колонок) */
  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody td::before {
    content: none !important;
    display: none !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody tr {
    display: grid !important;
    grid-template-columns: 2.1rem minmax(0, 1fr);
    column-gap: 0.45rem;
    row-gap: 0.16rem;
    border-color: rgb(224 231 241);
    border-radius: 0.9rem;
    background: #ffffff;
    padding: 0.48rem 0.55rem !important;
    box-shadow: 0 1px 0 rgb(241 245 249);
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody tr > td:nth-child(1) {
    grid-row: 1 / span 3;
    grid-column: 1;
    border-right: 1px solid rgb(222 231 242);
    padding-right: 0.4rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody tr > td:nth-child(1) .td-mo-body {
    font-size: 1.95rem;
    line-height: 1;
    font-weight: 400;
    color: rgb(71 85 105);
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody tr > td:nth-child(2) {
    grid-column: 2;
    grid-row: 2;
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody tr > td:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
    text-align: right !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody tr > td:nth-child(3) .td-mo-body {
    font-size: 1.8rem;
    font-weight: 700;
    color: rgb(51 65 85);
    letter-spacing: -0.02em;
    line-height: 1.1;
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody tr > td:nth-child(4) {
    grid-column: 1 / -1;
    grid-row: 4;
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody tr > td:nth-child(4) .td-mo-body {
    justify-content: flex-start !important;
    text-align: left !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody tr > td:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody tr > td:nth-child(5) .td-mo-body {
    font-size: 0.83rem;
    font-weight: 500;
    color: rgb(107 114 128);
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody tr > td:nth-child(6) {
    grid-column: 1 / -1;
    grid-row: 5;
    padding-top: 0.12rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact .td-mhint {
    display: none !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact .td-mo-row {
    gap: 0 !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody tr > td:nth-child(2) .td-mo-body {
    color: rgb(51 65 85);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.22rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody td {
    width: auto !important;
    padding-top: 0.125rem !important;
    padding-bottom: 0.125rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody td .td-mo-row {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    width: 100%;
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody td .td-mo-body {
    min-width: 0;
    flex: 1 1 auto;
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody td .td-mo-actions {
    flex-wrap: nowrap;
    gap: 0.16rem;
    justify-content: flex-end;
  }

  .td-table-wrap table.td-table-mobile-ready.td-cp-order-mcompact tbody td .td-mo-actions > a {
    border-radius: 0.55rem;
    color: rgb(75 85 99);
    border: 1px solid rgb(229 236 245);
    background: #f8fafc;
    width: 2.15rem;
    height: 2.15rem;
    min-width: 2.15rem;
    min-height: 2.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .td-orders-filter .td-orders-filter-btn {
    background: #ea580c !important;
    border: 1px solid #ea580c !important;
    color: #fff !important;
  }

  .td-orders-filter .td-orders-filter-btn:hover {
    background: #c2410c !important;
    border-color: #c2410c !important;
  }

  .td-orders-filter .td-orders-reset-btn {
    background: #f8fafc !important;
    border-color: rgb(226 232 240) !important;
    color: rgb(100 116 139) !important;
  }

  /* Покупки: мобильный вид похожий на заказы */
  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody td::before {
    content: none !important;
    display: none !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody tr {
    display: grid !important;
    grid-template-columns: 2.1rem minmax(0, 1fr);
    column-gap: 0.45rem;
    row-gap: 0.14rem;
    border-color: rgb(224 231 241);
    border-radius: 0.9rem;
    background: #ffffff;
    padding: 0.48rem 0.55rem !important;
    box-shadow: 0 1px 0 rgb(241 245 249);
  }

  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody tr > td:nth-child(1) {
    grid-row: 1 / span 4;
    grid-column: 1;
    border-right: 1px solid rgb(214 224 236);
    padding-right: 0.4rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody tr > td:nth-child(1) .td-mo-body {
    font-size: 1.95rem;
    line-height: 1;
    font-weight: 400;
    color: rgb(71 85 105);
  }

  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody tr > td:nth-child(2),
  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody tr > td:nth-child(3),
  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody tr > td:nth-child(4),
  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody tr > td:nth-child(5),
  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody tr > td:nth-child(6) {
    grid-column: 2;
  }

  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody tr > td:nth-child(2) {
    grid-row: 1;
  }

  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody tr > td:nth-child(5) {
    grid-row: 1;
    text-align: right !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody tr > td:nth-child(2) .td-mo-body {
    font-size: 0.83rem;
    font-weight: 500;
    color: rgb(107 114 128);
  }

  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody tr > td:nth-child(5) .td-mo-body {
    font-size: 1.45rem;
    font-weight: 700;
    color: rgb(51 65 85);
    letter-spacing: -0.02em;
    line-height: 1.1;
  }

  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody tr > td:nth-child(3) .td-mo-body,
  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody tr > td:nth-child(4) .td-mo-body,
  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody tr > td:nth-child(6) .td-mo-body {
    color: rgb(100 116 139);
    font-size: 0.92rem;
    line-height: 1.2rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody tr > td:nth-child(4) .td-mo-body {
    color: rgb(51 65 85);
    font-weight: 600;
  }

  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody td {
    width: auto !important;
    padding-top: 0.125rem !important;
    padding-bottom: 0.125rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody td.td-mo-span {
    grid-column: 1 / -1;
  }

  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody td .td-mo-row {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    width: 100%;
  }

  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody td .td-mo-body {
    min-width: 0;
    flex: 1 1 auto;
  }

  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody td .td-mo-actions {
    flex-wrap: nowrap;
    gap: 0.16rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody td .td-mo-actions > a,
  .td-table-wrap table.td-table-mobile-ready.td-purchase-mcompact tbody td .td-mo-actions > button {
    border-radius: 0.55rem;
    color: rgb(75 85 99);
    border: 1px solid rgb(229 236 245);
    background: #f8fafc;
    width: 2.15rem;
    height: 2.15rem;
    min-width: 2.15rem;
    min-height: 2.15rem;
  }

  /* Клиенты: мобильный вид в стиле карточек заказов */
  .td-table-wrap table.td-table-mobile-ready.td-client-mcompact tbody td::before {
    content: none !important;
    display: none !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-client-mcompact tbody tr {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.16rem;
    border-color: rgb(224 231 241);
    border-radius: 0.9rem;
    background: #ffffff;
    padding: 0.52rem 0.58rem !important;
    box-shadow: 0 1px 0 rgb(241 245 249);
  }

  .td-table-wrap table.td-table-mobile-ready.td-client-mcompact tbody td {
    width: auto !important;
    padding-top: 0.125rem !important;
    padding-bottom: 0.125rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-client-mcompact tbody tr > td:nth-child(1) .td-mo-body {
    font-size: 1rem;
    font-weight: 700;
    color: rgb(51 65 85);
  }

  .td-table-wrap table.td-table-mobile-ready.td-client-mcompact tbody tr > td:nth-child(2) .td-mo-body,
  .td-table-wrap table.td-table-mobile-ready.td-client-mcompact tbody tr > td:nth-child(3) .td-mo-body,
  .td-table-wrap table.td-table-mobile-ready.td-client-mcompact tbody tr > td:nth-child(4) .td-mo-body {
    color: rgb(100 116 139);
    font-size: 0.92rem;
    line-height: 1.22rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-client-mcompact tbody tr > td:nth-child(5) .td-mo-body {
    color: rgb(100 116 139);
    font-size: 0.76rem;
    line-height: 1.1rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-client-mcompact tbody td.td-mo-span {
    grid-column: 1 / -1;
    padding-top: 0.22rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-client-mcompact tbody td .td-mo-row {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    width: 100%;
  }

  .td-table-wrap table.td-table-mobile-ready.td-client-mcompact tbody td .td-mo-body {
    min-width: 0;
    flex: 1 1 auto;
  }

  .td-table-wrap table.td-table-mobile-ready.td-client-mcompact tbody td .td-mo-actions {
    flex-wrap: nowrap;
    gap: 0.16rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-client-mcompact tbody td .td-mo-actions > a,
  .td-table-wrap table.td-table-mobile-ready.td-client-mcompact tbody td .td-mo-actions > button {
    border-radius: 0.55rem;
    color: rgb(75 85 99);
    border: 1px solid rgb(229 236 245);
    background: #f8fafc;
    width: 2.15rem;
    height: 2.15rem;
    min-width: 2.15rem;
    min-height: 2.15rem;
  }

  .td-orders-filter select[name="counterparty"] {
    max-width: 36%;
  }

  .td-purchase-form-card {
    border-color: rgb(210 218 228) !important;
    background: #f7f9fc !important;
    box-shadow: none !important;
  }

  .td-purchase-form-card label > span {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: rgb(100 116 139);
  }

  .td-purchase-form-card input,
  .td-purchase-form-card select,
  .td-purchase-form-card textarea {
    min-height: 2.45rem !important;
  }

  /* Списки: одноколоночные карточки (без 2-колоночного дробления) */
  .td-table-wrap table.td-table-mobile-ready.td-mobile-2col tbody tr {
    display: block !important;
    row-gap: 0 !important;
    column-gap: 0 !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-mobile-2col tbody td {
    width: 100% !important;
    padding-top: 0.2rem !important;
    padding-bottom: 0.2rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-mobile-2col tbody td:last-child {
    grid-column: auto;
  }

  .td-table-wrap table.td-table-mobile-ready.td-mobile-2col tbody td::before {
    display: block !important;
    margin-right: 0;
    margin-bottom: 0.12rem;
    vertical-align: baseline;
    font-size: 0.62rem;
    max-width: none;
  }

  /* Простые справочники: ближе к ритму списка заказов */
  .td-table-wrap table.td-table-mobile-ready.td-entity-mcompact tbody tr {
    background: #ffffff;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.9rem;
    margin-bottom: 0.44rem;
    padding: 0.52rem 0.58rem !important;
    box-shadow: 0 1px 0 rgb(241 245 249);
  }

  .td-table-wrap table.td-table-mobile-ready.td-entity-mcompact tbody td {
    padding-top: 0.14rem !important;
    padding-bottom: 0.14rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-entity-mcompact tbody td:nth-child(1) {
    font-size: 1rem;
    line-height: 1.3rem;
    font-weight: 700;
    color: rgb(51 65 85);
  }

  .td-table-wrap table.td-table-mobile-ready.td-entity-mcompact tbody td:nth-child(2),
  .td-table-wrap table.td-table-mobile-ready.td-entity-mcompact tbody td:nth-child(3),
  .td-table-wrap table.td-table-mobile-ready.td-entity-mcompact tbody td:nth-child(4) {
    color: rgb(100 116 139);
    font-size: 0.9rem;
    line-height: 1.2rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-entity-mcompact tbody td:last-child {
    padding-top: 0.26rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-entity-mcompact tbody td .td-mo-actions > a,
  .td-table-wrap table.td-table-mobile-ready.td-entity-mcompact tbody td .td-mo-actions > button {
    border-radius: 0.58rem;
    color: rgb(75 85 99);
    border: 1px solid rgb(229 236 245);
    background: #f8fafc;
    width: 2.1rem;
    height: 2.1rem;
    min-width: 2.1rem;
    min-height: 2.1rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact tbody tr {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    margin-bottom: 0.65rem;
    padding: 0.62rem 0.7rem;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact tbody td:last-child {
    grid-column: 1 / -1;
  }

  .td-wh-op-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    width: 100%;
  }

  .td-wh-op-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .td-wh-op-form input,
  .td-wh-op-form button {
    width: 100%;
  }

  .td-wh-op-form button > span {
    display: none !important;
  }

  /* Склад на мобильных: без двухколоночного дробления текста */
  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact tbody tr {
    display: block !important;
    padding: 0.6rem 0.65rem !important;
    row-gap: 0 !important;
    column-gap: 0 !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact tbody td {
    width: 100% !important;
    padding-top: 0.14rem !important;
    padding-bottom: 0.14rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact tbody td::before {
    content: none !important;
    display: none !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact tbody td:nth-child(1) {
    padding-bottom: 0.28rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact tbody td:nth-child(1) .td-wh-product-name {
    font-size: 0.97rem;
    font-weight: 700;
    color: rgb(15 23 42);
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact .td-wh-product-sku {
    font-size: 0.78rem;
    color: rgb(100 116 139);
  }

  .td-wh-stock-inline {
    display: inline-flex;
    align-items: baseline;
    gap: 0.28rem;
  }

  .td-wh-stock-icon {
    width: 1.08rem;
    height: 1.08rem;
    color: rgb(15 23 42);
    transform: translateY(0.07rem);
    flex-shrink: 0;
  }

  .td-wh-stock-unit {
    font-size: 0.88rem;
    color: rgb(71 85 105);
    white-space: nowrap;
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact tbody td:nth-child(2) .js-stock-qty {
    font-size: 2rem;
    line-height: 1;
    color: rgb(3 105 161);
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact .td-wh-op-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    align-items: center;
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact .td-wh-op-form[data-op="receive"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.35rem;
    gap: 0.35rem;
    align-items: center;
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact .td-wh-op-form[data-op="writeoff"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.35rem;
    gap: 0.35rem;
    align-items: center;
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact .td-wh-op-form[data-op="writeoff"] .td-wh-reason {
    display: none !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact .td-wh-op-btn {
    width: 2.35rem !important;
    min-width: 2.35rem !important;
    min-height: 2.35rem !important;
    padding: 0 !important;
    line-height: 1;
    border-radius: 0.7rem !important;
    box-shadow: none !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact .td-wh-op-btn > span {
    display: inline !important;
    font-size: 1.15rem;
    transform: translateY(-0.02em);
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact .td-wh-op-btn-admin {
    background: rgb(226 232 240) !important;
    color: rgb(51 65 85) !important;
    border: 1px solid rgb(203 213 225) !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact .td-wh-qty {
    min-height: 2.2rem;
    border-radius: 0.6rem;
    font-size: 1rem;
    text-align: center;
    background: #fff;
  }

  .td-warehouse-mobile-shell .td-wh-filter-box {
    background: #f3f4f6 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 1rem !important;
    padding: 0.72rem !important;
  }

  .td-warehouse-mobile-shell .td-wh-search-btn {
    border-radius: 0.8rem !important;
    width: 2.8rem !important;
    min-width: 2.8rem !important;
    min-height: 2.5rem !important;
    background: #0f2240 !important;
  }

  .td-warehouse-mobile-shell .td-wh-filter-box select,
  .td-warehouse-mobile-shell .td-wh-filter-box .js-wh-search-input {
    border-color: #dbe1ea !important;
    border-radius: 0.78rem !important;
    min-height: 2.6rem !important;
    font-size: 0.98rem !important;
  }

  .td-warehouse-mobile-shell .td-wh-filter-box .js-wh-search-input {
    padding-right: 2.45rem !important;
  }

  .td-warehouse-mobile-shell .td-wh-filter-box .js-wh-clear-search {
    color: #dc2626 !important;
  }

  .td-warehouse-mobile-shell .td-mobile-hero {
    margin-bottom: 0.7rem !important;
    gap: 0.6rem !important;
  }

  .td-warehouse-mobile-shell .td-mobile-hero .td-page-title {
    font-size: 2.15rem !important;
    line-height: 1.15 !important;
  }

  /* Продажа: модалка товаров и корзина без горизонтального скролла */
  .td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody tr,
  .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody tr {
    row-gap: 0.28rem;
    padding: 0.6rem 0.7rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    margin-bottom: 0.65rem;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  }

  /* Модалка «Добавить товар»: белые карточки вместо серых строк общего правила */
  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody tr {
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }

  .td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody tr.td-filter-hidden {
    display: none !important;
  }

  /* Выше специфичность, чем у .td-add-product-modal … tbody tr { display: grid }, иначе фильтр не скрывает строки */
  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody tr.td-filter-hidden {
    display: none !important;
  }

  /* Fallback for sale modal filters when responsive helper class is absent. */
  .td-sale-modal-table tbody tr.td-filter-hidden {
    display: none !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td,
  .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td {
    padding-top: 0.12rem !important;
    padding-bottom: 0.12rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td::before,
  .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td::before {
    font-size: 0.61rem;
    letter-spacing: 0.02em;
    color: rgb(100 116 139);
  }

  .td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td::before {
    content: none !important;
    display: none !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td::before {
    content: none !important;
    display: none !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td input,
  .td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td select,
  .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td input,
  .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 2.2rem;
    border-radius: 0.6rem;
    background: #fff;
  }

  .td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:last-child,
  .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td:last-child {
    grid-column: 1 / -1;
    text-align: right !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:last-child .js-add-cart,
  .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td:last-child .js-cart-remove {
    min-height: 2.25rem;
    border-radius: 0.7rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:first-child,
  .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td:first-child {
    grid-column: 1 / -1;
  }

  .td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:first-child .td-sale-modal-thumb,
  .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td:first-child .td-sale-cart-thumb {
    width: 5rem !important;
    height: 5rem !important;
    min-width: 5rem !important;
    min-height: 5rem !important;
  }

  .td-sale-modal-table .td-sale-modal-thumb,
  .td-sale-cart-table .td-sale-cart-thumb {
    width: 5rem;
    height: 5rem;
    min-width: 5rem;
    min-height: 5rem;
  }

  .td-sale-stock-inline {
    display: inline-flex;
    align-items: baseline;
    gap: 0.28rem;
  }

  .td-sale-stock-icon {
    width: 1.05rem;
    height: 1.05rem;
    color: rgb(15 23 42);
    transform: translateY(0.07rem);
    flex-shrink: 0;
  }

  .td-sale-stock-qty {
    font-size: 1.5rem;
    line-height: 1;
    font-weight: 800;
    color: rgb(3 105 161);
  }

  .td-sale-stock-unit {
    font-size: 0.86rem;
    color: rgb(71 85 105);
    white-space: nowrap;
  }

  .td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:first-child {
    grid-column: 1 / -1;
    padding-bottom: 0.2rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(2) {
    grid-column: 1 / -1;
  }

  .td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(3),
  .td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(4) {
    width: 100% !important;
  }

  .td-sale-product-cell {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
  }

  .td-sale-product-name {
    font-size: 0.98rem;
    line-height: 1.2;
    color: rgb(15 23 42);
  }

  .td-sale-product-sku {
    font-size: 0.78rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  }

  .td-sale-product-meta {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    color: rgb(51 65 85);
  }

  .td-sale-meta-label {
    font-weight: 700;
    color: rgb(100 116 139);
  }

  .td-sale-input-inline {
    display: flex;
    align-items: center;
    gap: 0.36rem;
  }

  .td-sale-input-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgb(71 85 105);
    white-space: nowrap;
  }

  /* Модалка «Добавить товар»: карточка — блок информации сверху, снизу ряд кол-во | цена | кнопка справа */
  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap {
    padding-left: max(0.65rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.65rem, env(safe-area-inset-right, 0px));
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom, 0px));
  }

  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table {
    min-width: 0 !important;
  }

  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table thead {
    display: none;
  }

  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody tr {
    display: grid !important;
    grid-template-columns: 5rem auto auto minmax(0, 1fr) max-content;
    grid-template-rows: auto auto;
    column-gap: 1rem;
    row-gap: 0.5rem;
    align-items: center;
    padding: 0.75rem !important;
    margin-bottom: 0.65rem !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.875rem !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }

  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    padding-top: 0.05rem !important;
    padding-bottom: 0.05rem !important;
  }

  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    padding-top: 0.12rem !important;
    padding-right: 0.85rem !important;
  }

  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(2) {
    grid-column: 2 / -1;
    grid-row: 1;
    min-width: 0;
    align-self: start;
    padding-left: 0.75rem !important;
  }

  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(1) button,
  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(1) .td-sale-modal-thumb {
    width: 5rem;
    height: 5rem;
    min-width: 5rem;
    min-height: 5rem;
    border-radius: 0.75rem;
  }

  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(1) button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }

  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(4) {
    grid-column: 3;
    grid-row: 2;
    justify-self: start;
  }

  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(5) {
    grid-column: 5;
    grid-row: 2;
    justify-self: end;
    align-self: center;
    text-align: right !important;
    padding-top: 0 !important;
  }

  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(5) .js-add-cart {
    width: auto !important;
    min-width: 2.75rem;
    min-height: 2.5rem !important;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    font-size: 0.8rem;
    font-weight: 800;
    border-radius: 0.65rem;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
  }

  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(3) .td-sale-input-inline,
  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(4) .td-sale-input-inline {
    flex-wrap: nowrap;
    gap: 0.35rem;
  }

  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(3) .js-p-qty,
  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(4) .js-p-price {
    width: 4rem !important;
    min-width: 3.25rem !important;
    max-width: 26vw !important;
    flex: 0 0 auto !important;
    min-height: 2.45rem !important;
    font-size: 0.92rem !important;
  }

  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(3) input,
  .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(4) input {
    width: 4rem !important;
    min-width: 3.25rem !important;
    max-width: 26vw !important;
  }

  .td-add-product-modal .td-sale-product-name {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.25;
  }

  .td-add-product-modal .td-sale-stock-qty {
    color: var(--color-brand);
  }

  @media (max-width: 360px) {
    .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody tr {
      grid-template-columns: 5rem auto auto minmax(0, 1fr) max-content;
      column-gap: 0.75rem;
      padding: 0.62rem !important;
    }

    .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(1) {
      padding-right: 0.65rem !important;
    }

    .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(2) {
      padding-left: 0.55rem !important;
    }

    .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(1) button,
    .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(1) .td-sale-modal-thumb {
      width: 5rem;
      height: 5rem;
      min-width: 5rem;
      min-height: 5rem;
    }

    .td-add-product-modal .td-sale-modal-list-wrap.td-table-wrap table.td-table-mobile-ready.td-sale-modal-table tbody td:nth-child(5) .js-add-cart {
      font-size: 0.72rem;
      padding-left: 0.45rem;
      padding-right: 0.45rem;
      min-height: 2.35rem !important;
    }
  }

  /* Склад: аккуратная карточка товара и остаток */
  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact tbody td:nth-child(1) .td-wh-product-inner {
    align-items: flex-start;
    gap: 0.65rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact tbody td:nth-child(1) .td-wh-product-name {
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact tbody td:nth-child(2) .td-wh-stock-inline {
    flex-wrap: wrap;
    row-gap: 0.15rem;
    padding: 0.38rem 0.48rem;
    border-radius: 0.65rem;
    background: #fff;
    border: 1px solid rgb(226 232 240);
    width: fit-content;
    max-width: 100%;
  }

  .td-table-wrap table.td-table-mobile-ready.td-warehouse-mcompact .td-wh-stock-label {
    width: 100%;
    flex-basis: 100%;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgb(100 116 139);
  }

  /* Производство: карточка строки очереди на мобильных */
  .td-production-mobile-shell .td-mobile-hero {
    gap: 0.85rem;
  }

  .td-prod-mob-label {
    display: block;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgb(100 116 139);
    margin-bottom: 0.08rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody tr {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem 0.45rem;
    padding: 0.62rem 0.66rem !important;
    margin-bottom: 0.58rem;
    align-items: start;
    background: #fff;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.95rem;
    box-shadow: 0 1px 0 rgb(241 245 249);
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td {
    width: auto !important;
    padding-top: 0.1rem !important;
    padding-bottom: 0.1rem !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td::before {
    content: none !important;
    display: none !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(2) {
    grid-column: 2 / span 2;
    grid-row: 1;
    justify-self: end;
    font-size: 0.72rem;
    color: rgb(100 116 139);
    white-space: nowrap;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(3) {
    grid-column: 1 / span 3;
    grid-row: 2;
    font-size: 0.78rem;
    color: rgb(71 85 105);
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(4) {
    grid-column: 1 / span 3;
    grid-row: 3;
    font-size: 0.84rem;
    font-weight: 600;
    color: rgb(51 65 85);
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(5) {
    grid-column: 1 / span 3;
    grid-row: 4;
    padding-top: 0.15rem !important;
    border-top: 1px dashed rgb(226 232 240);
    margin-top: 0.08rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(5) .td-prod-name {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(5) .td-prod-info > .flex {
    align-items: flex-start;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(6),
  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(7),
  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(8) {
    grid-row: 5;
    text-align: center !important;
    padding: 0.32rem 0.2rem !important;
    border-radius: 0.55rem;
    background: rgb(248 250 252);
    border: 1px solid rgb(226 232 240);
    font-size: 0.78rem;
    line-height: 1.15;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(6) {
    grid-column: 1;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(6)::before {
    content: 'Заказано';
    display: block !important;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgb(100 116 139);
    margin-bottom: 0.06rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(7) {
    grid-column: 2;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(7)::before {
    content: 'Готово';
    display: block !important;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgb(100 116 139);
    margin-bottom: 0.06rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(8) {
    grid-column: 3;
    text-align: center !important;
    background: rgb(255 251 235);
    border-color: rgb(253 230 138);
    color: rgb(146 64 14);
    font-weight: 700;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(8)::before {
    content: 'Осталось';
    display: block !important;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgb(180 83 9);
    margin-bottom: 0.06rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(9) {
    grid-column: 1 / span 3;
    grid-row: 6;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(10) {
    grid-column: 1 / span 3;
    grid-row: 7;
    padding-top: 0.22rem !important;
    border-top: 1px solid rgb(241 245 249);
    margin-top: 0.12rem;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(10) .td-prod-receive-form {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.45rem !important;
    width: 100%;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(10) .td-prod-qty-input {
    width: 100% !important;
    min-height: 2.65rem !important;
    font-size: 1rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-production-queue-table tbody td:nth-child(10) .td-prod-receive-btn {
    width: 100% !important;
    min-height: 2.65rem !important;
    font-size: 0.9rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-product-mcompact tbody tr {
    display: block !important;
    padding: 0.58rem 0.66rem;
    border: 1px solid rgb(226 232 240);
    border-radius: 1rem;
    margin-bottom: 0.58rem;
    background: #fff;
    box-shadow: 0 1px 0 rgb(241 245 249);
  }

  .td-table-wrap table.td-table-mobile-ready.td-product-mcompact tbody td {
    width: 100% !important;
    padding-top: 0.12rem !important;
    padding-bottom: 0.12rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-product-mcompact tbody td::before {
    content: none !important;
    display: none !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-product-mcompact tbody td:first-child {
    grid-column: 1 / -1;
    padding-bottom: 0.2rem !important;
  }

  .td-table-wrap table.td-table-mobile-ready.td-product-mcompact tbody td:nth-child(2) {
    grid-column: 1 / -1;
  }

  .td-table-wrap table.td-table-mobile-ready.td-product-mcompact tbody td:last-child {
    grid-column: 1 / -1;
  }

  .td-prod-info {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
  }

  .td-prod-name {
    font-size: 0.98rem;
    line-height: 1.2;
    color: rgb(15 23 42);
  }

  .td-prod-sku {
    font-size: 0.76rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  }

  .td-prod-meta {
    display: flex;
    flex-direction: column;
    gap: 0.06rem;
    color: rgb(51 65 85);
    font-size: 0.79rem;
  }

  .td-prod-meta-label {
    font-weight: 700;
    color: rgb(100 116 139);
  }

  @media (max-width: 375px) {
    .td-sale-product-name {
      font-size: 0.91rem;
    }

    .td-sale-product-sku {
      font-size: 0.72rem;
    }

    .td-sale-product-meta {
      gap: 0.04rem;
      font-size: 0.77rem;
    }

    .td-sale-stock-qty {
      font-size: 1.24rem;
    }

    .td-sale-stock-unit,
    .td-sale-input-label {
      font-size: 0.74rem;
    }

    .td-sale-input-inline {
      gap: 0.28rem;
    }

    .td-table-wrap table.td-table-mobile-ready.td-product-mcompact tbody tr {
      padding: 0.46rem 0.5rem;
      margin-bottom: 0.48rem;
      border-radius: 0.82rem;
    }

    .td-table-wrap table.td-table-mobile-ready.td-product-mcompact tbody td {
      padding-top: 0.07rem !important;
      padding-bottom: 0.07rem !important;
    }

    .td-table-wrap table.td-table-mobile-ready.td-product-mcompact tbody td:first-child .td-product-list-thumb {
      width: 5rem !important;
      height: 5rem !important;
      min-width: 5rem !important;
      min-height: 5rem !important;
    }

    .td-prod-name {
      font-size: 0.9rem;
    }

    .td-prod-sku {
      font-size: 0.7rem;
    }

    .td-prod-meta {
      font-size: 0.73rem;
      gap: 0.04rem;
    }
  }

  /* Только админский список (8 колонок): здесь классы на ячейках не должны ломать крупный №/сумму в td-cp-order-mcompact */
  @media (max-width: 767px) {
    .td-table-wrap table.td-table-mobile-ready.td-order-mcompact .td-orders-id-mobile,
    .td-table-wrap table.td-table-mobile-ready.td-order-mcompact .td-orders-sum-mobile {
      font-size: 1.2rem !important;
      line-height: 1.2 !important;
    }
  }

  .td-order-mobile-shell .td-sale-cart-table .js-cart-remove {
    background: var(--color-brand, #008ec0);
    color: #fff;
    border: 0;
    width: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.5rem;
    border-radius: 0.65rem;
    font-size: 1.35rem;
    line-height: 1;
  }

  /* Корзина заказа: мобильная карточка — фото и название сверху, ряд кол-во | цена | удалить */
  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table thead {
    display: none;
  }

  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody tr {
    display: grid !important;
    grid-template-columns: 5rem auto auto minmax(0, 1fr) max-content;
    grid-template-rows: auto auto;
    column-gap: 0.65rem;
    row-gap: 0.5rem;
    align-items: center;
    padding: 0.75rem !important;
    margin-bottom: 0.65rem !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.875rem !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }

  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    padding-top: 0.05rem !important;
    padding-bottom: 0.05rem !important;
  }

  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td.td-sale-cart-product {
    grid-column: 1 / -1;
    grid-row: 1;
    padding-bottom: 0.2rem !important;
  }

  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table .td-sale-cart-product-wrap {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr);
    column-gap: 0.65rem;
    align-items: start;
  }

  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table .td-sale-cart-thumb-slot {
    grid-column: 1;
    grid-row: 1;
  }

  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table .td-sale-cart-detail {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td.td-sale-cart-qty {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }

  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td.td-sale-cart-unit,
  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td.td-sale-cart-stock-col,
  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td.td-sale-cart-sum-col {
    display: none !important;
  }

  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td.td-sale-cart-price {
    grid-column: 3;
    grid-row: 2;
    justify-self: start;
  }

  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td.td-sale-cart-actions-col {
    display: contents !important;
  }

  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td.td-sale-cart-actions-col .js-cart-remove {
    grid-column: 5;
    grid-row: 2;
    justify-self: end;
    align-self: center;
  }

  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table .td-sale-cart-qty .td-sale-input-inline,
  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table .td-sale-cart-price .td-sale-input-inline {
    flex-wrap: nowrap;
    gap: 0.35rem;
  }

  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table .js-cart-qty,
  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table .js-cart-price {
    width: 4rem !important;
    min-width: 3.25rem !important;
    max-width: 26vw !important;
    flex: 0 0 auto !important;
    min-height: 2.45rem !important;
    font-size: 0.92rem !important;
  }

  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table tbody td:last-child {
    grid-column: auto;
    text-align: inherit !important;
  }

  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table .td-sale-cart-stock-mobile,
  .td-order-mobile-shell .td-table-wrap table.td-table-mobile-ready.td-sale-cart-table .td-sale-cart-sum-mobile {
    display: block;
  }

  /* Модалка добавления товара: фильтры и safe area на узком экране */
  .td-order-mobile-shell .td-add-product-modal .shrink-0.space-y-3 {
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }

  /* Продажа: компактный покупатель + карта */
  .td-sale-client-card {
    padding: 0.75rem !important;
    gap: 0.5rem !important;
  }

  .td-sale-client-card h2 {
    font-size: 1rem;
    line-height: 1.35rem;
    margin: 0;
  }

  .td-sale-client-card .relative.space-y-2 {
    gap: 0.4rem !important;
  }

  .td-sale-client-card input,
  .td-sale-client-card textarea {
    min-height: 2.5rem !important;
    border-radius: 0.7rem !important;
    font-size: 0.95rem !important;
  }

  .td-sale-client-card textarea {
    min-height: 4.4rem !important;
    line-height: 1.25rem;
  }

  .td-sale-map-card #map {
    height: 12rem !important;
  }

  .td-sale-map-card #map-address-search {
    min-height: 2.5rem !important;
    font-size: 0.9rem !important;
  }

  .td-sale-map-card #map-address-search-btn {
    min-height: 2.5rem !important;
    min-width: 2.5rem !important;
    padding-left: 0.7rem !important;
    padding-right: 0.7rem !important;
  }

  .td-mobile-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.625rem !important;
  }

  /* Кабинеты: заголовок и подзаголовки столбиком — иначе .td-lead уезжает вправо и «ломается» по буквам */
  .td-mobile-hero.td-cabinet-mobile {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.35rem;
  }

  .td-mobile-hero .td-page-title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 2rem;
    line-height: 2.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
  }

  .td-mobile-hero .td-page-title svg {
    width: 1.4rem;
    height: 1.4rem;
    stroke-width: 1.9;
  }

  .td-mobile-hero .td-lead,
  .td-mobile-hero p.text-xs {
    display: none;
  }

  /* Кабинеты ролей: на телефоне оставляем подпись раздела и краткое описание */
  .td-mobile-hero.td-cabinet-mobile .td-lead {
    display: block !important;
    font-size: 0.8125rem;
    line-height: 1.4rem;
    max-width: 100%;
    margin-top: 0.375rem !important;
    color: rgb(100 116 139);
  }

  .td-mobile-hero.td-cabinet-mobile > p.text-xs,
  .td-mobile-hero.td-cabinet-mobile .min-w-0 > p.mb-1.text-xs {
    display: block !important;
  }

  /* Склад (складчик): подпись раздела после общего скрытия p.text-xs */
  .td-warehouse-mobile-shell .td-mobile-hero.td-wh-mobile-header .min-w-0 > p.mb-1.text-xs {
    display: block !important;
  }

  .td-warehouse-mobile-shell .td-mobile-hero.td-wh-mobile-header .td-lead {
    display: block !important;
    font-size: 0.75rem;
    line-height: 1.35rem;
    margin-top: 0.35rem !important;
    color: rgb(100 116 139);
  }

  .td-mobile-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.7rem;
    padding: 0;
  }

  .td-mobile-action-btn > span {
    display: none !important;
  }

  .td-mobile-action-btn > svg {
    width: 1.2rem;
    height: 1.2rem;
    stroke-width: 2;
  }

  .td-mobile-inline-icon-btn > span {
    display: none !important;
  }

  .td-mobile-inline-icon-btn {
    width: 2.2rem;
    height: 2.2rem;
    min-width: 2.2rem;
    min-height: 2.2rem;
    padding: 0 !important;
    border-radius: 0.55rem;
  }

  .td-mobile-inline-icon-btn > svg {
    width: 1.1rem;
    height: 1.1rem;
    stroke-width: 2;
  }

  .td-mobile-action-unified {
    min-height: 2.5rem !important;
    border-radius: 0.7rem !important;
  }

  .td-mobile-action-unified > svg {
    width: 1.1rem;
    height: 1.1rem;
    stroke-width: 2;
  }

  .td-mobile-icon-link {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    border: 1px solid rgb(226 232 240);
    background: rgb(248 250 252);
    color: rgb(71 85 105);
  }

  .td-mobile-icon-link:hover {
    border-color: rgb(203 213 225);
    background: rgb(241 245 249);
  }

  .td-mobile-icon-link > span {
    display: none !important;
  }

  .td-mobile-soft-card {
    background: #f7f9fc !important;
    border-color: rgb(210 218 228) !important;
    box-shadow: none !important;
  }

  /* Единый вертикальный ритм мобильной админки */
  .td-main > .td-mobile-soft-card,
  .td-main > .td-card,
  .td-main > .td-table-wrap,
  .td-main > form,
  .td-main > section,
  .td-main > .grid,
  .td-main > header,
  .td-main > div {
    margin-bottom: 0.625rem !important;
  }

  .td-main > *:last-child {
    margin-bottom: 0 !important;
  }

  /* Розничный заказ: блок «Состав» */
  .td-retail-order-line {
    background: #fff;
  }

  .td-retail-order-line-media .h-20 {
    height: 5rem;
    width: 5rem;
  }

  .td-retail-order-line .td-prod-name {
    font-size: 0.9375rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .td-retail-order-line-sum {
    align-self: flex-start;
    padding-top: 0.1rem;
  }

  .td-retail-order-line-badges span {
    line-height: 1.35;
  }
}

@media (min-width: 768px) {
  .td-mobile-sticky-submit {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
  }

  #expenseForm {
    padding-bottom: 0;
  }
}

/* Склад (админ / складчик): десктоп — одна строка как на макете */
@media (min-width: 1024px) {
  .td-table-wrap table.td-wh-table {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
  }

  .td-table-wrap table.td-wh-table thead.td-wh-thead th {
    vertical-align: bottom;
    font-weight: 700;
  }

  .td-table-wrap table.td-wh-table tbody td {
    vertical-align: middle;
  }

  .td-table-wrap table.td-wh-table .td-wh-th-product {
    width: 46%;
  }

  .td-table-wrap table.td-wh-table .td-wh-th-sku {
    width: 14%;
  }

  .td-table-wrap table.td-wh-table .td-wh-th-stock {
    width: 10%;
    white-space: nowrap;
  }

  .td-table-wrap table.td-wh-table .td-wh-th-ops {
    width: 30%;
  }

  .td-table-wrap table.td-wh-table .td-wh-row td {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    border-top: 1px solid rgb(241 245 249);
  }

  .td-table-wrap table.td-wh-table .td-wh-product-inner {
    gap: 0.65rem;
  }

  .td-table-wrap table.td-wh-table .td-wh-sku {
    font-size: 0.8125rem;
  }

  .td-table-wrap table.td-wh-table .td-wh-ops {
    padding-left: 0.5rem;
  }

  .td-table-wrap table.td-wh-table .td-wh-qty,
  .td-table-wrap table.td-wh-table .td-wh-reason {
    min-height: 2.25rem;
    border-radius: 0.5rem;
    padding: 0.2rem 0.45rem;
    font-size: 0.8125rem;
    line-height: 1.25;
  }

  .td-wh-op-grid {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.45rem;
    width: 100%;
    margin-left: 0;
  }

  .td-wh-op-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.3rem;
    width: auto;
    flex-shrink: 0;
  }

  .td-wh-op-form input,
  .td-wh-op-form button {
    width: auto;
  }

  .td-wh-op-form .td-wh-qty {
    width: 3.35rem;
    min-width: 3.35rem;
    text-align: center;
  }

  .td-wh-op-form[data-op="receive"] .td-wh-qty-receive-admin {
    width: calc(3.35rem + 10px);
    min-width: calc(3.35rem + 10px);
  }

  .td-wh-op-form .td-wh-reason {
    width: 7.25rem;
    min-width: 7.25rem;
    max-width: 10rem;
  }

  .td-wh-op-btn {
    width: 2.25rem !important;
    min-width: 2.25rem !important;
    min-height: 2.25rem !important;
    padding: 0 !important;
    line-height: 1;
    border-radius: 0.5rem !important;
  }

  .td-wh-op-btn > span {
    display: inline !important;
    font-size: 1.05rem;
    transform: translateY(-0.02em);
  }
}

@media (min-width: 1366px) {
  .td-wh-op-grid {
    gap: 0.4rem;
  }

  .td-wh-op-form {
    gap: 0.28rem;
  }

  .td-wh-op-form .td-wh-qty {
    width: 3.15rem;
    min-width: 3.15rem;
  }

  .td-wh-op-form[data-op="receive"] .td-wh-qty-receive-admin {
    width: calc(3.15rem + 10px);
    min-width: calc(3.15rem + 10px);
  }

  .td-wh-op-form .td-wh-reason {
    width: 6.75rem;
    min-width: 6.75rem;
  }

  .td-wh-op-btn {
    width: 2.15rem !important;
    min-width: 2.15rem !important;
    min-height: 2.15rem !important;
  }
}

/* Производство: десктоп и планшет (таблица без лишней прокрутки) */
@media (min-width: 768px) {
  .td-prod-mob-label {
    display: none;
  }

  /* На планшете/узком десктопе дата в карточке заказа — в заголовке строки */
  .td-table-wrap table.td-production-queue-table:not(.td-table-mobile-ready) .td-prod-th-date,
  .td-table-wrap table.td-production-queue-table:not(.td-table-mobile-ready) .td-prod-date {
    display: none;
  }
}

@media (min-width: 1280px) {
  .td-table-wrap table.td-production-queue-table .td-prod-th-date,
  .td-table-wrap table.td-production-queue-table .td-prod-date {
    display: table-cell;
  }
}

@media (min-width: 1024px) {
  .td-production-mobile-shell {
    max-width: none;
  }

  .td-production-table-scroll {
    overflow-x: visible;
  }

  .td-table-wrap table.td-production-queue-table {
    table-layout: fixed;
    width: 100%;
  }

  .td-table-wrap table.td-production-queue-table thead.td-prod-thead th {
    vertical-align: bottom;
    font-size: 0.65rem;
    line-height: 1.1;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  .td-table-wrap table.td-production-queue-table .td-prod-th-order {
    width: 5.5%;
  }

  .td-table-wrap table.td-production-queue-table .td-prod-th-date {
    width: 9%;
  }

  .td-table-wrap table.td-production-queue-table .td-prod-th-dealer {
    width: 11%;
  }

  .td-table-wrap table.td-production-queue-table .td-prod-th-client {
    width: 11%;
  }

  .td-table-wrap table.td-production-queue-table .td-prod-th-product {
    width: 26%;
  }

  .td-table-wrap table.td-production-queue-table .td-prod-th-qty,
  .td-table-wrap table.td-production-queue-table .td-prod-th-ready,
  .td-table-wrap table.td-production-queue-table .td-prod-th-left {
    width: 6.5%;
  }

  .td-table-wrap table.td-production-queue-table .td-prod-th-status {
    width: 10%;
  }

  .td-table-wrap table.td-production-queue-table .td-prod-th-receive {
    width: 12%;
  }

  .td-table-wrap table.td-production-queue-table tbody .td-prod-row td {
    vertical-align: middle;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    border-top: 1px solid rgb(241 245 249);
  }

  .td-table-wrap table.td-production-queue-table .td-prod-dealer,
  .td-table-wrap table.td-production-queue-table .td-prod-client {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
  }

  .td-table-wrap table.td-production-queue-table .td-prod-product .td-prod-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.25;
    font-size: 0.875rem;
  }

  .td-table-wrap table.td-production-queue-table .td-prod-product .td-prod-sku,
  .td-table-wrap table.td-production-queue-table .td-prod-product .td-prod-meta {
    font-size: 0.72rem;
  }

  .td-table-wrap table.td-production-queue-table .td-prod-status span {
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }

  .td-table-wrap table.td-production-queue-table .td-prod-receive-form {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    width: auto;
    margin-left: auto;
  }

  .td-table-wrap table.td-production-queue-table .td-prod-qty-input {
    width: 3.25rem;
    min-width: 3.25rem;
    min-height: 2.15rem;
    padding: 0.2rem 0.35rem;
    font-size: 0.8125rem;
  }

  .td-table-wrap table.td-production-queue-table .td-prod-receive-btn {
    min-height: 2.15rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }
}

@media (min-width: 1280px) {
  .td-table-wrap table.td-production-queue-table thead.td-prod-thead th {
    font-size: 0.68rem;
  }

  .td-table-wrap table.td-production-queue-table .td-prod-product .td-prod-name {
    -webkit-line-clamp: 3;
  }

  .td-table-wrap table.td-production-queue-table .td-prod-qty-input {
    width: 3.5rem;
    min-width: 3.5rem;
  }
}

/* Заголовки страниц: сначала компактно на телефоне */
.td-page-title {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--color-ink);
}

@media (min-width: 640px) {
  .td-retail-order-line .td-prod-name {
    font-size: 1rem;
  }

  .td-retail-order-line-badges {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
  }

  .td-retail-order-line-badges > p {
    margin: 0;
  }

  .td-mobile-icon-link {
    width: auto;
    height: auto;
    border-radius: 0;
    border: 0;
    background: transparent;
    color: inherit;
  }

  .td-mobile-icon-link > svg {
    display: none !important;
  }

  .td-mobile-icon-link > span {
    display: inline !important;
  }

  .td-page-title {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
}

@media (min-width: 1024px) {
  .td-page-title {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
}

.td-lead {
  font-size: 0.9375rem;
  line-height: 1.5rem;
  color: rgb(71 85 105);
}

.td-square-icon-btn {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
}

@media (min-width: 640px) {
  .td-lead {
    font-size: 1.125rem;
    line-height: 1.75rem;
  }
}

/* Карточка интерфейса */
.td-card {
  border-radius: var(--td-radius-lg);
  border: 1px solid rgb(226 232 240 / 0.9);
  background-color: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.td-card:hover {
  border-color: rgb(232 93 4 / 0.35);
  box-shadow:
    0 4px 6px -1px rgb(15 23 42 / 0.06),
    0 2px 4px -2px rgb(15 23 42 / 0.04);
}

.td-card--interactive {
  display: block;
  text-decoration: none;
  color: inherit;
}

.td-card--interactive:active {
  transform: scale(0.995);
}

/* Кнопки и зоны нажатия */
.td-focus:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.pb-safe {
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
}

/* Карты Leaflet */
#map,
#dmap,
#smap,
#tmap,
#staff-map {
  min-height: 14rem;
  border-radius: var(--td-radius);
  overflow: hidden;
}

@media (min-width: 640px) {
  #map,
  #dmap,
#tmap,
  #staff-map {
    min-height: 18rem;
  }
}

.leaflet-container {
  font-family:
    Inter,
    system-ui,
    sans-serif;
}

/* Таблицы: на узком экране чуть выходим в стороны под padding контента (px-2) */
.td-table-wrap {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 639px) {
  .td-table-wrap {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

@media (min-width: 640px) {
  .td-table-wrap {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }
}

/* Публичная витрина: иконка корзины в шапке */
.td-shop-cart-link--empty #shop-cart-count {
  background-color: #94a3b8;
}
.td-shop-cart-link--empty #shop-cart-sum {
  color: #64748b;
  font-weight: 600;
}
