.mobile-bar,
.mobile-menu-toggle,
.mobile-menu-close,
.mobile-menu-backdrop {
  display: none;
}

@media (min-width: 900px) {
  .nav .mobile-menu-close {
    display: none !important;
  }
}
@media (max-width: 899px), (max-width: 1100px) and (max-height: 600px) {
  html {
    scroll-padding-top: 80px;
    -webkit-text-size-adjust: 100%;
  }

  body {
    min-width: 0;
  }

  body.mobile-menu-open,
  body.mobile-modal-open {
    overflow: hidden;
  }

  .content {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px calc(92px + env(safe-area-inset-bottom));
  }

  .content > div {
    min-width: 0;
  }

  .top {
    padding: 12px 0;
    gap: 9px;
    margin-bottom: 16px;
    min-height: 68px;
    top: 0;
    padding-top: max(12px, env(safe-area-inset-top));
    backdrop-filter: blur(16px);
  }

  .top h1 {
    font-size: 24px;
    line-height: 1.2;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .top .online {
    font-size: 10px;
    padding: 6px 8px;
    white-space: nowrap;
  }

  .top .logout {
    display: none;
  }

  .mobile-menu-toggle,
  .mobile-menu-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border: 1px solid #dbe3f2;
    border-radius: 13px;
    background: #fff;
    color: #405a92;
  }

  .mobile-menu-toggle svg,
  .mobile-menu-close svg {
    width: 22px;
    height: 22px;
  }

  #notificationPanel {
    position: fixed;
    top: 76px;
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 180px);
    overflow: auto;
  }

  .mobile-bar {
    position: fixed;
    z-index: 16;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid #dce4f2;
    background: #fffffff5;
    backdrop-filter: blur(18px);
    box-shadow: 0 -5px 24px #152b5007;
  }

  .mobile-bar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    min-height: 52px;
    padding: 6px 2px;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #65738a;
    box-shadow: none;
  }

  .mobile-bar svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-bar button.active {
    background: #eaf0ff;
    color: #245cd8;
  }

  #app .nav {
    display: none;
  }

  #app .nav-account {
    display: none;
  }

  .mobile-menu-open #app .nav {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(340px, calc(100% - 32px));
    height: 100dvh;
    z-index: 42;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex-direction: column;
    justify-content: flex-start;
    gap: 5px;
    padding: calc(84px + env(safe-area-inset-top)) 16px calc(102px + env(safe-area-inset-bottom));
    background: #101b2e;
    border: 0;
    box-shadow: 12px 0 50px #0b17333d;
  }

  .mobile-menu-open .nav .mobile-menu-close {
    display: grid !important;
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    right: 16px;
    min-width: 44px;
    color: #c7d4ef;
    background: #1d2c44;
    border: 0;
  }

  .mobile-menu-open .nav-brand {
    position: absolute;
    top: max(20px, env(safe-area-inset-top));
    left: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
  }

  .mobile-menu-open .nav-brand img {
    width: 36px;
    height: 36px;
    object-fit: contain;
  }

  .mobile-menu-open .nav-brand span,
  .mobile-menu-open .nav-brand b,
  .mobile-menu-open .nav-brand small {
    display: block;
    width: auto;
    text-align: left;
  }

  .mobile-menu-open .nav-brand b {
    font-size: 18px;
    line-height: 1.2;
  }

  .mobile-menu-open .nav-brand small {
    font-size: 10px;
    color: #aab9d2;
    margin-top: 3px;
  }

  .mobile-menu-open .nav-section-label {
    display: block;
    color: #8b9bb5;
    font-size: 10px;
    letter-spacing: 1px;
    margin: 2px 12px 7px;
  }

  .mobile-menu-open #app .nav > button[data-page] {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;
    gap: 13px;
    min-height: 47px;
    width: 100%;
    margin: 0;
    padding: 12px 14px;
    background: #1b293e;
    border: 0;
    border-radius: 12px;
    color: #d2ddf0;
    font-size: 14px;
    text-align: left;
    line-height: 1.3;
  }

  .mobile-menu-open #app .nav > button.active {
    background: #2d67e8;
    color: #fff;
  }

  .mobile-menu-open .nav > button[data-page] > span {
    display: grid;
    place-items: center;
    width: 22px;
  }

  .mobile-menu-open .nav .nav-icon {
    width: 20px;
    height: 20px;
  }

  .mobile-menu-open #app .nav-settings {
    margin-top: 10px !important;
  }

  .mobile-menu-open #app:not(.admin) .nav-settings {
    display: none !important;
  }

  .mobile-menu-open #app .nav-account {
    display: grid;
    position: fixed;
    z-index: 43;
    left: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: min(316px, calc(100% - 56px));
    grid-template-columns: 38px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #1c2b43;
    border: 1px solid #30415e;
    border-radius: 14px;
    color: #fff;
  }

  .mobile-menu-open .nav-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #2d67e8;
    font-weight: 800;
  }

  .mobile-menu-open .nav-user-copy {
    min-width: 0;
  }

  .mobile-menu-open .nav-user-copy b,
  .mobile-menu-open .nav-user-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-menu-open .nav-user-copy b {
    font-size: 14px;
  }

  .mobile-menu-open .nav-user-copy small {
    margin-top: 4px;
    color: #aab9d2;
    font-size: 11px;
  }

  .mobile-menu-open .nav-logout {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: #263954;
    border: 0;
    border-radius: 12px;
    color: #c7d4ef;
  }

  .mobile-menu-open .nav-logout svg {
    width: 21px;
    height: 21px;
  }
}
@media (max-width: 899px), (max-width: 1100px) and (max-height: 600px) {
  .mobile-menu-open .mobile-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 41;
    background: #0c173c85;
    backdrop-filter: blur(3px);
  }

  button,
  input,
  textarea,
  select {
    -webkit-tap-highlight-color: transparent;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  textarea,
  select {
    font-size: 16px !important;
    max-width: 100%;
    min-width: 0;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
  }

  button {
    touch-action: manipulation;
  }

  .primary,
  .secondary,
  .danger,
  .segment button,
  .tabs button {
    min-height: 44px;
  }

  .field {
    min-width: 0;
  }

  .field label {
    font-size: 11px;
    line-height: 1.5;
  }

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

  .panel {
    padding: 18px;
    border-radius: 18px;
  }

  .between,
  .toolbar {
    gap: 12px;
    flex-wrap: wrap;
  }

  .section {
    margin-top: 20px;
  }

  .error,
  .empty,
  .ship-empty {
    overflow-wrap: anywhere;
    line-height: 1.5;
  }

  .overlay {
    padding: 12px;
    align-items: center;
    overscroll-behavior: contain;
  }

  .overlay .modal {
    max-width: 100%;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px;
    border-radius: 22px;
  }

  .modal-head {
    align-items: center;
    gap: 12px;
  }

  .modal-head > span,
  .modal-head > div {
    min-width: 0;
  }

  .modal-head h2,
  .modal h2 {
    font-size: 21px;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  .modal-head > button {
    flex: none;
    min-width: 44px;
    min-height: 44px;
  }

  .modal-head small {
    display: block;
    font-size: 12px;
    line-height: 1.5;
    margin-top: 4px;
  }

  .actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  .actions > button {
    flex: 1;
    min-width: 0;
    min-height: 46px;
  }

  .counter {
    display: grid;
    grid-template-columns: 44px minmax(48px, 1fr) 44px;
    align-items: center;
    gap: 8px;
    max-width: 220px;
  }

  .counter button,
  .counter .plus {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
  }

  .counter input {
    width: 100%;
    height: 44px;
    min-width: 0;
  }

  .suggestions {
    max-width: 100%;
    max-height: 240px;
    overflow: auto;
  }

  .suggestion {
    gap: 12px;
    white-space: normal;
    padding: 12px;
    min-height: 48px;
  }

  .suggestion > span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .suggestion small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.4;
  }

  .pretty-select {
    min-width: 0;
    max-width: 100%;
  }

  .pretty-select-menu {
    min-width: 0;
    width: max(100%, 230px);
    max-width: calc(100vw - 32px);
  }

  #productsPage .toolbar {
    display: flex;
    align-items: stretch;
  }

  #productsPage .catalog-head {
    display: none;
  }

  #productsPage .catalog-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 20px;
    gap: 12px;
    width: 100%;
    padding: 14px;
    text-align: left;
    border-radius: 17px;
    min-width: 0;
  }

  #productsPage .catalog-row .desktop-col {
    display: none;
  }

  #productsPage .catalog-row .icon {
    width: 64px;
    height: 76px;
    border-radius: 12px;
    align-self: start;
    overflow: hidden;
  }

  #productsPage .catalog-row .icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  #productsPage .mobile-main {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  #productsPage .mobile-main > b {
    font-size: 16px;
    line-height: 1.4;
  }

  #productsPage .mobile-main small {
    font-size: 12px;
    line-height: 1.55;
    margin-top: 6px;
  }

  #productsPage .chevron {
    color: #7189b3;
    align-self: center;
  }

  .detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .detail-layout > div {
    min-width: 0;
  }

  .detail-photo {
    width: 100%;
    height: 260px;
    min-height: 0;
    max-height: 35dvh;
    object-fit: contain;
  }

  .product-description-grid.has-admin {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-description-panel,
  .product-admin-panel {
    padding: 16px;
    min-height: 0;
    overflow-wrap: anywhere;
  }

  .inventory-box strong,
  .inventory-box small {
    display: block;
    line-height: 1.5;
  }

  .inventory-box br {
    display: none;
  }

  .inventory-box strong {
    margin: 5px 0;
  }

  .price-grid {
    grid-template-columns: 42px repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .price-grid > div {
    min-width: 0;
    padding: 10px 7px;
  }

  .price-grid b {
    font-size: 12px;
    overflow-wrap: anywhere;
    line-height: 1.4;
  }

  .purchase-cost-card {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
    min-width: 0;
  }

  .purchase-cost-card > * {
    min-width: 0;
  }

  .purchase-cost-card b {
    overflow-wrap: anywhere;
  }
}
@media (max-width: 899px), (max-width: 1100px) and (max-height: 600px) {
  .shipping-hero,
  .reserve-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
  }

  .shipping-hero .hero-copy,
  .reserve-hero > div {
    min-width: 0;
    flex: 1 1 180px;
  }

  .shipping-hero > button,
  .reserve-hero > button {
    width: 100%;
  }

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

  .ship-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    padding: 13px 10px;
    gap: 10px;
  }

  .ship-stat > span {
    min-width: 0;
    max-width: 100%;
  }

  .ship-stat .ship-stat-icon {
    width: 34px;
    height: 34px;
    flex: none;
  }

  .ship-stat b,
  .ship-stat strong {
    font-size: 17px;
    overflow-wrap: anywhere;
  }

  .ship-stat small {
    display: block;
    font-size: 11px;
    line-height: 1.4;
    margin-top: 4px;
  }

  .ship-add-grid,
  .reserve-add-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  .ship-add-grid > .suggest-wrap,
  .reserve-add-grid > .suggest-wrap {
    grid-column: 1/-1;
  }

  .ship-add-grid > button,
  .reserve-add-grid > button {
    grid-column: 1/-1;
    width: 100%;
  }

  .ship-add-grid .segment,
  .reserve-add-grid .segment {
    align-self: end;
    width: 100%;
  }

  .ship-add-grid .segment button,
  .reserve-add-grid .segment button {
    padding: 10px 6px;
    font-size: 12px;
  }

  .ship-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  .ship-box > span:first-child {
    justify-self: start;
    text-align: left;
  }

  .ship-box > span:last-child {
    grid-column: 1/-1;
    text-align: right;
  }

  .ship-box .segment {
    width: 100%;
    min-width: 0;
  }

  .ship-line {
    padding: 14px;
  }

  .ship-line-main {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
    position: relative;
  }

  .ship-line-main > span:first-child {
    grid-column: 1/-1;
    padding-right: 48px;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .ship-line-main > .remove-line {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
  }

  .ship-line-main .counter {
    max-width: none;
  }

  .ship-line-main .counter {
    grid-template-columns: 38px minmax(32px, 1fr) 38px;
    gap: 5px;
  }

  .ship-line-main .counter button {
    width: 38px;
  }

  .ship-price-control,
  .ship-quantity-control {
    min-width: 0;
  }

  .ship-line-total {
    padding-bottom: 10px;
    overflow-wrap: anywhere;
    font-size: 14px;
  }

  .ship-line-tax {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    padding-top: 14px;
  }

  .ship-line-tax > small {
    width: 100%;
  }

  .ship-line-tax .segment {
    flex: 1;
    min-width: 0;
  }

  .ship-line-tax .segment button {
    flex: 1;
    padding: 10px;
    font-size: 13px;
  }

  .receipt-head {
    display: none !important;
  }

  .receipt-row,
  #historyPage .receipt-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px 0;
    align-items: start;
  }

  .receipt-row > span,
  #historyPage .receipt-row > span {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start !important;
    text-align: left !important;
    gap: 4px;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .receipt-row > span:first-child,
  #historyPage .receipt-row > span:first-child {
    grid-column: 1/-1;
  }

  .receipt-row > span:nth-child(2)::before {
    content: "Количество";
    color: #66758e;
    font-size: 11px;
    font-weight: 500;
  }

  .receipt-row > span:nth-child(3)::before {
    content: "Цена за штуку";
    color: #66758e;
    font-size: 11px;
    font-weight: 500;
  }

  .receipt-row > span:nth-child(4)::before {
    content: "Сумма";
    color: #66758e;
    font-size: 11px;
    font-weight: 500;
  }

  #shippingReceipt .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #shippingReceipt .actions > button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 12px 8px;
    font-size: 14px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #shippingReceipt .actions > .primary {
    grid-column: 1/-1;
  }

  .reserve-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 12px;
  }

  .reserve-line > span:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }

  .reserve-line > button {
    grid-column: 2;
    grid-row: 1/3;
    min-width: 44px;
    align-self: center;
  }

  .reserve-line b,
  .reserve-line small {
    display: block;
    overflow-wrap: anywhere;
    margin-bottom: 5px;
  }

  .reservation-head {
    grid-template-columns: 44px minmax(0, 1fr) 22px;
    gap: 12px;
  }

  .reservation-head .reservation-state {
    grid-column: 2;
  }

  .reservation-product {
    grid-template-columns: minmax(0, 1fr) 80px;
    gap: 12px;
  }

  #returnModal .return-form-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  #returnModal .return-form-row > .suggest-wrap {
    grid-column: auto;
  }

  #returnModal .counter {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    max-width: 220px;
  }

  #returnModal .counter button {
    width: 44px;
    height: 44px;
  }

  #returnProductSuggestions .suggestion {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  #qrPage .qr-toolbar {
    display: flex;
    gap: 8px;
    max-width: 100%;
  }
}
@media (max-width: 899px), (max-width: 1100px) and (max-height: 600px) {
  #qrPage .qr-toolbar button {
    flex: 1;
    min-width: 0;
    padding: 10px;
    font-size: 13px;
  }

  #qrPage .qr-description.qr-desktop,
  #qrPage .qr-desktop {
    display: none;
  }

  #qrPage .qr-table-head {
    display: none;
  }

  #qrPage .qr-list-row {
    grid-template-columns: 62px minmax(0, 1fr) 30px;
  }

  #qrPage .qr-mobile {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  #qrPage .qr-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  #qrPage .qr-card {
    min-width: 0;
    padding: 12px;
    grid-template-rows: auto auto minmax(62px, 1fr) auto;
    gap: 10px;
  }

  #qrPage .qr-card .qr-image {
    width: min(130px, 100%);
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
    justify-self: center;
  }

  #qrPage .qr-card b {
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  #qrPage .qr-card small {
    font-size: 12px;
    line-height: 1.5;
  }

  .qr-detail .qr-image {
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
  }

  #scanPage .scanner-panel {
    padding: 20px 16px;
  }

  #scanPage .scanner-placeholder {
    min-height: 260px;
    padding: 20px 12px;
  }

  #scanPage .scanner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  #scanPage .scanner-actions > button {
    flex: 1 1 180px;
  }

  #reader {
    max-width: 100%;
    overflow: hidden;
    border-radius: 16px;
  }

  #reader video {
    max-width: 100%;
  }

  #historyPage > .tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    padding: 6px;
  }

  #historyPage > .tabs button {
    justify-content: flex-start;
    gap: 7px;
    padding: 10px 8px;
    font-size: 11px;
    white-space: normal;
    text-align: left;
  }

  #historyPage .history-head {
    grid-template-columns: 38px minmax(0, 1fr) 20px;
    padding: 16px;
    gap: 10px;
  }

  #historyPage .history-amount {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    font-size: 16px;
  }

  #historyPage .history-head > svg:last-child {
    grid-column: 3;
    grid-row: 1/3;
  }

  #historyPage .history-head-copy small {
    font-size: 12px;
    gap: 4px;
  }

  #historyPage .history-designation {
    border: 0;
    padding: 0;
    width: 100%;
  }

  #historyPage .history-detail {
    padding: 0 16px 16px;
  }

  #historyPage .history-time {
    justify-self: start;
    white-space: normal;
    font-size: 12px;
  }

  #historyPage .return-history-row,
  #historyPage .reservation-history-row,
  #historyPage .audit-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 16px;
  }

  #historyPage .return-history-row > *:nth-child(n + 3),
  #historyPage .reservation-history-row > *:nth-child(n + 3),
  #historyPage .audit-row > *:nth-child(n + 3) {
    grid-column: 2;
    justify-self: start;
    text-align: left;
    align-items: flex-start;
  }

  #historyPage .audit-row > * {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  #historyPage .audit-copy {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  #historyPage .audit-copy b,
  #historyPage .audit-copy small {
    display: block;
    line-height: 1.5;
  }

  #historyPage .audit-copy small,
  #historyPage .audit-time {
    font-size: 12px;
  }

  #historyPage .calendar {
    padding: 16px 12px;
  }

  #historyPage .calendar-days,
  #historyPage .calendar-week {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  #historyPage .calendar-day {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    height: auto;
    aspect-ratio: 1;
    padding: 0;
    font-size: 12px;
  }

  #historyPage .calendar-legend {
    font-size: 11px;
    gap: 10px;
  }

  #historyPage .report-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  #historyPage .report-title {
    flex-wrap: wrap;
  }

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

  #historyPage .weekly-profit-strip {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  #historyPage .weekly-metric {
    padding: 12px;
    min-height: 70px;
  }

  #historyPage .weekly-metric > b {
    font-size: 17px;
  }

  #historyPage .report-section {
    padding: 14px;
  }

  #historyPage .report-line {
    gap: 10px;
  }

  #historyPage .report-line > b {
    font-size: 13px;
  }

  #historyPage .report-buyer-toggle {
    align-items: center;
  }

  #historyPage .report-buyer-summary {
    gap: 8px;
  }

  #historyPage .report-buyer-detail {
    padding-bottom: 12px;
  }

  #historyPage .report-buyer-order {
    padding: 12px;
  }

  #historyPage .report-buyer-order-head,
  #historyPage .report-buyer-product {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
  }

  #historyPage .report-buyer-product > b:last-child {
    grid-column: 2;
  }

  #historyPage .audit-notice {
    align-items: flex-start;
    padding: 12px;
    font-size: 12px;
  }

  #historyPage .audit-notice svg {
    flex: none;
  }

  #settingsPage .settings-panel {
    padding: 18px;
  }

  #settingsPage .settings-title {
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
  }

  #settingsPage .settings-title > button {
    width: 100%;
    margin: 0;
  }

  #settingsPage .settings-actions {
    gap: 12px;
  }

  #settingsPage .settings-actions .field {
    width: 100% !important;
  }

  #settingsPage .settings-actions > button,
  #settingsPage .settings-actions > a {
    flex: 1 1 140px;
    min-width: 140px;
    text-align: center;
    justify-content: center;
  }

  #settingsPage .exchange-rate-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  #settingsPage .exchange-rate-grid .primary {
    width: 100%;
  }

  #settingsPage .settings-description {
    font-size: 13px;
    line-height: 1.6;
  }

  #settingsPage .user-row {
    gap: 12px;
    padding: 12px;
  }

  #settingsPage .user-row > span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  #settingsPage .user-row > button {
    flex: none;
    min-width: 44px;
  }
}
@media (max-width: 899px), (max-width: 1100px) and (max-height: 600px) {
  #containerPage .container-upload {
    padding: 22px 18px;
    border-radius: 20px;
    background: #fff;
    text-align: left;
  }

  #containerPage .container-upload-subtitle {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.6;
  }

  #containerPage .container-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 22px 14px;
    border: 2px dashed #c4d3ef;
    border-radius: 16px;
    background: #f7f9fd;
    text-align: center;
    min-width: 0;
  }

  #containerPage .container-dropzone.selected {
    border-color: #8acfb6;
    background: #f0fdf7;
  }

  #containerPage .container-dropzone h3 {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 16px;
    margin: 5px 0;
  }

  #containerPage .container-dropzone p {
    margin: 0;
  }

  #containerPage .container-upload .container-file-button {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  #containerPage .container-file-button svg {
    width: 20px;
    height: 20px;
    color: inherit;
  }

  #containerPage .container-progress {
    width: 100%;
    height: 8px;
    border-radius: 20px;
    background: #dfe7f3;
    overflow: hidden;
  }

  #containerPage .container-progress span {
    display: block;
    height: 100%;
    background: #426cd3;
  }

  #containerPage .container-error {
    margin-top: 12px;
    padding: 14px;
    border-radius: 12px;
    background: #fff1f2;
    color: #b42318;
    overflow-wrap: anywhere;
  }

  #containerPage .container-upload svg {
    width: 38px;
    height: 38px;
    color: #426cd3;
  }

  #containerPage .container-upload h2 {
    font-size: 20px;
    margin: 0;
  }

  #containerPage .container-upload p {
    font-size: 13px;
    line-height: 1.6;
  }

  #containerPage .container-upload button {
    width: 100%;
  }

  #containerPage .container-result {
    margin-top: 20px;
  }

  #containerPage .container-result-head {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
  }

  #containerPage .container-result-head h2 {
    font-size: 20px;
    margin: 0 0 6px;
  }

  #containerPage .container-result-head small {
    display: block;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  #containerPage .container-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
  }

  #containerPage .container-summary-card {
    padding: 14px;
    background: #fff;
    border: 1px solid #dce4f0;
    border-radius: 14px;
    min-width: 0;
  }

  #containerPage .container-summary-card small {
    display: block;
    font-size: 11px;
    line-height: 1.5;
  }

  #containerPage .container-summary-card b {
    display: block;
    margin-top: 6px;
    font-size: 17px;
    overflow-wrap: anywhere;
  }

  #containerPage .container-list-head {
    display: none;
  }

  #containerPage .container-product {
    background: #fff;
    border: 1px solid #dce4f0;
    border-radius: 18px;
    margin-bottom: 14px;
    overflow: hidden;
  }

  #containerPage .container-product-main {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 44px;
    gap: 12px;
    align-items: center;
    padding: 16px;
  }

  #containerPage .container-product-main > * {
    min-width: 0;
  }

  #containerPage .container-photo,
  #containerPage .container-photo-empty {
    width: 64px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
    background: #eef3fb;
    grid-column: 1;
    grid-row: 1/3;
    display: grid;
    place-items: center;
  }

  #containerPage .container-photo-empty svg {
    width: 26px;
    height: 26px;
  }

  #containerPage .container-product-copy {
    grid-column: 2/4;
    grid-row: 1;
    display: block;
  }

  #containerPage .container-product-copy b {
    display: block;
    font-size: 14px;
    overflow-wrap: anywhere;
  }

  #containerPage .container-product-copy small {
    display: block;
    margin-top: 4px;
    line-height: 1.5;
    font-size: 12px;
  }

  #containerPage .container-code {
    grid-column: 2/4;
    grid-row: 2;
    display: block;
    font-size: 15px;
    font-weight: 800;
    overflow-wrap: anywhere;
  }

  #containerPage .container-price {
    grid-column: 1/3;
    grid-row: 3;
    display: block;
  }

  #containerPage .container-places {
    grid-column: 1/3;
    grid-row: 4;
    display: block;
  }

  #containerPage .container-price b,
  #containerPage .container-places b,
  #containerPage .container-pln b {
    display: block;
    font-size: 14px;
  }

  #containerPage .container-price small,
  #containerPage .container-places small,
  #containerPage .container-pln small {
    display: block;
    margin-top: 4px;
    font-size: 11px;
  }

  #containerPage .container-pln {
    grid-column: 1/3;
    grid-row: 5;
    display: block;
  }

  #containerPage .container-more {
    grid-column: 3;
    grid-row: 3/6;
    width: 44px;
    height: 44px;
    padding: 0;
    display: grid;
    place-items: center;
  }

  #containerPage .container-more svg {
    width: 20px;
    height: 20px;
  }

  #containerPage .container-receive {
    grid-column: 1/-1;
    grid-row: 6;
    display: block;
    border: 1px solid #e5c574;
    background: #fffbeb;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
  }

  #containerPage .container-receive-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    align-items: center;
  }

  #containerPage .container-receive-controls button {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid #cad7ed;
    border-radius: 50%;
    background: #fff;
    color: #385782;
    font-size: 21px;
  }

  #containerPage .container-receive-controls input {
    width: 80px;
    height: 44px;
    text-align: center;
    border: 1px solid #cad7ed;
    border-radius: 10px;
    font-weight: 800;
  }

  #containerPage .container-receive strong {
    display: block;
    margin-top: 10px;
    font-size: 15px;
  }

  #containerPage .container-receive small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
  }

  #containerPage .container-receive.complete {
    background: #ecfdf5;
    border-color: #86d8b8;
  }

  #containerPage .container-receive.extra {
    background: #fff1f2;
    border-color: #f5a3aa;
  }
}
@media (max-width: 899px), (max-width: 1100px) and (max-height: 600px) {
  #containerPage .container-details {
    display: none;
    padding: 16px;
    border-top: 1px solid #e6ecf5;
    background: #f8fafc;
  }

  #containerPage .container-product.open .container-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #containerPage .container-detail {
    padding: 12px;
    background: white;
    border: 1px solid #e0e7f0;
    border-radius: 12px;
    min-width: 0;
  }

  #containerPage .container-detail small {
    display: block;
    font-size: 11px;
    line-height: 1.5;
  }

  #containerPage .container-detail b {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  #containerPage .container-source-name {
    grid-column: 1/-1;
  }

  #containerPage .container-warehouse-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    margin-top: 18px;
    border: 1px solid #dce4f0;
    border-radius: 18px;
    background: #fff;
  }

  #containerPage .container-warehouse-actions small {
    display: block;
    margin-top: 7px;
    line-height: 1.6;
  }

  #containerPage .container-warehouse-actions button {
    width: 100%;
    min-width: 0;
  }

  #containerPage .container-warehouse-actions svg {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 6px;
  }

  #containerPage .container-result-head {
    align-items: stretch;
  }

  #containerPage .container-number-field {
    display: block;
    padding: 12px;
    border: 1px solid #cdd9ec;
    border-radius: 13px;
    background: #fff;
  }

  #containerPage .container-number-field span {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  #containerPage .container-number-field input {
    width: 100%;
    border: 0;
    padding: 5px;
    font-size: 18px;
    font-weight: 900;
  }

  #containerPage .container-history {
    margin-top: 18px;
  }

  #containerPage .container-history-head,
  #containerPage .container-history-empty,
  #containerPage .container-report-card {
    padding: 16px;
    border: 1px solid #dce4f0;
    border-radius: 16px;
    background: #fff;
  }

  #containerPage .container-history-head {
    margin-bottom: 11px;
  }

  #containerPage .container-history-head h2 {
    margin: 0 0 5px;
  }

  #containerPage .container-report-card {
    margin-bottom: 12px;
  }

  #containerPage .container-report-card > header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
  }

  #containerPage .container-report-card > header > strong {
    grid-column: 1 / -1;
    color: #087f5b;
  }

  #containerPage .container-report-number {
    padding: 10px;
    border-radius: 11px;
    background: #eaf1ff;
    color: #2f6fed;
    font-weight: 900;
  }

  #containerPage .container-report-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 13px;
  }

  #containerPage .container-report-metrics > span {
    padding: 10px;
    border-radius: 11px;
    background: #f7f9fd;
  }

  #containerPage .container-report-metrics small,
  #containerPage .container-report-metrics b,
  #containerPage .container-report-product small,
  #containerPage .container-report-product b {
    display: block;
  }

  #containerPage .container-report-card details {
    margin-top: 12px;
  }

  #containerPage .container-report-product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid #edf0f5;
  }

  .toast {
    max-width: calc(100vw - 32px);
    left: 16px;
    right: 16px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    top: auto;
    overflow-wrap: anywhere;
  }

  .login-card {
    width: 100%;
    max-width: 420px;
    padding: 24px;
  }
}
@media (max-width: 600px) {
  .grid.two {
    grid-template-columns: minmax(0, 1fr);
  }
  .overlay {
    padding: 0;
  }
  .overlay > .modal:not(.confirm-modal) {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
    padding: 20px 16px max(24px, env(safe-area-inset-bottom));
  }
  #formModal.new-product-form .modal,
  #returnModal .return-dialog {
    padding: 20px 16px max(24px, env(safe-area-inset-bottom));
  }
  #formModal.new-product-form .new-product-basics {
    grid-template-columns: minmax(0, 1fr);
  }
  #formModal.new-product-form .new-product-prices {
    gap: 8px;
  }
  #formModal.new-product-form .new-product-prices input {
    padding: 12px 8px;
  }
  #formModal.new-product-form .new-product-media {
    grid-template-columns: minmax(0, 1fr);
  }
  #formModal.new-product-form .actions {
    bottom: -20px;
    padding: 14px 0 max(14px, env(safe-area-inset-bottom));
  }
  .overlay > .confirm-modal {
    width: calc(100% - 28px);
    padding: 22px;
    max-height: calc(100dvh - 28px);
    border-radius: 22px;
  }
  .confirm-modal .actions button {
    min-width: 0;
  }
  .ship-add-grid,
  .reserve-add-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ship-add-grid > .suggest-wrap,
  .reserve-add-grid > .suggest-wrap,
  .ship-add-grid > button,
  .reserve-add-grid > button {
    grid-column: auto;
  }
  .ship-add-grid .counter,
  .reserve-add-grid .counter {
    max-width: none;
  }
  .ship-box .counter {
    grid-template-columns: 34px minmax(30px, 1fr) 34px;
    gap: 4px;
  }
  .ship-box .counter button {
    width: 34px;
  }
  .ship-box .segment {
    grid-column: 1/-1;
  }
  .work-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 359px) {
  .content {
    padding-left: 12px;
    padding-right: 12px;
  }
  .top {
    gap: 7px;
  }
  .top h1 {
    font-size: 21px;
  }
  .top .online {
    display: none;
  }
  #productsPage .catalog-row {
    grid-template-columns: 54px minmax(0, 1fr) 14px;
    gap: 10px;
    padding: 12px;
  }
  #productsPage .catalog-row .icon {
    width: 54px;
    height: 64px;
  }
  #qrPage .qr-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  #qrPage .qr-card {
    padding: 16px;
  }
  #qrPage .qr-card .qr-image {
    width: 180px;
    max-width: 100%;
  }
  .ship-line-main {
    grid-template-columns: minmax(0, 1fr);
  }
  .ship-line-main .counter {
    grid-template-columns: 44px minmax(48px, 1fr) 44px;
  }
  .ship-line-main .counter button {
    width: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-bar *,
  .nav * {
    transition: none !important;
    animation: none !important;
  }
}
