:root {
  --asteron-mobile-ink: #171912;
  --asteron-mobile-accent: #d7ff63;
  --asteron-mobile-paper: #f4f4ee;
}

/* Mobile route and order interaction fixes — v237. */
@media (max-width: 768px) {
  .asteron-mobile-nav a.is-pending {
    color: var(--asteron-mobile-ink);
    background: color-mix(in srgb, var(--asteron-mobile-accent) 58%, var(--bg-card, #fff));
  }

  .asteron-mobile-nav a.is-pending > span {
    animation: asteron-mobile-nav-pending 520ms ease-in-out infinite alternate;
  }

  .orders-page .orders-table-scroll
  :is(.orders-compact-table, .orders-lp-table)[data-asx-mobile-cards="true"] tbody td.orders-check-col {
    position: absolute !important;
    top: 4px !important;
    display: grid !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    place-items: center;
    touch-action: manipulation;
    z-index: 3;
  }

  .orders-page .orders-table-scroll
  .orders-compact-table[data-asx-mobile-cards="true"] tbody td.orders-check-col {
    right: auto !important;
    left: 4px !important;
  }

  .orders-page .orders-table-scroll
  .orders-lp-table[data-asx-mobile-cards="true"] tbody td.orders-check-col {
    right: 4px !important;
    left: auto !important;
  }

  .orders-page .orders-table-scroll
  :is(.orders-compact-table, .orders-lp-table) tbody td.orders-check-col input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    margin: 0 !important;
    accent-color: var(--primary, #7d9e37);
    touch-action: manipulation;
  }
}

@keyframes asteron-mobile-nav-pending {
  from { opacity: .54; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .asteron-mobile-nav a.is-pending > span {
    animation: none;
  }

  .orders-compact-table[data-asx-mobile-cards="true"] tbody tr,
  .orders-lp-table[data-asx-mobile-cards="true"] tbody tr {
    transition: none;
  }
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100%;
  overscroll-behavior-y: contain;
}

button,
a,
[role="button"] {
  touch-action: manipulation;
}

html.asteron-pwa body {
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
}

.asteron-pwa-install,
.asteron-pwa-status {
  position: fixed;
  z-index: 2147483000;
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  margin: 0 auto;
  width: min(460px, calc(100vw - 36px));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: var(--asteron-mobile-ink);
  color: #fff;
  box-shadow: 0 18px 52px rgba(23, 25, 18, 0.28);
  font: 600 14px/1.35 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.asteron-pwa-install {
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 12px;
}

.asteron-pwa-install__mark {
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--asteron-mobile-accent);
  color: var(--asteron-mobile-ink);
  font-size: 20px;
  font-weight: 900;
}

.asteron-pwa-install__copy {
  min-width: 0;
  flex: 1;
}

.asteron-pwa-install__copy strong,
.asteron-pwa-install__copy span {
  display: block;
}

.asteron-pwa-install__copy span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 500;
}

.asteron-pwa-install__action,
.asteron-pwa-install__close {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.asteron-pwa-install__action {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--asteron-mobile-accent);
  color: var(--asteron-mobile-ink);
  font-weight: 800;
  white-space: nowrap;
}

.asteron-pwa-install__close {
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.64);
  font-size: 20px;
}

.asteron-pwa-status {
  top: max(14px, env(safe-area-inset-top));
  padding: 12px 16px;
  text-align: center;
  transition: opacity 180ms ease, transform 180ms ease;
}

.asteron-pwa-status[data-tone="warning"] {
  background: #7a321f;
}

.asteron-pwa-status[data-tone="success"] {
  background: #315b1d;
}

.asteron-pwa-status.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
}

.asteron-pwa-install-shortcut {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 24px);
  min-height: 46px;
  margin: 0 12px 8px;
  padding: 8px 11px;
  border: 1px dashed color-mix(in srgb, var(--primary, #bff048) 58%, var(--border, #dfe2d8));
  border-radius: 13px;
  color: var(--text, #171914);
  background: color-mix(in srgb, var(--primary-soft, #eff7d4) 58%, var(--bg-card, #fff));
  font: 750 12px/1.25 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: left;
  cursor: pointer;
}

.asteron-pwa-install-shortcut > span {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: var(--asteron-mobile-ink);
  background: var(--asteron-mobile-accent);
  font-size: 17px;
}

.asteron-mobile-nav {
  display: none;
}

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

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

  button,
  a,
  [role="button"] {
    -webkit-tap-highlight-color: transparent;
  }

  .asteron-pwa-install {
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
  }

  .asteron-pwa-install__copy span {
    display: none;
  }

  .asteron-mobile-nav {
    position: fixed;
    z-index: 2147481000;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    width: auto;
    min-height: 62px;
    padding: 5px;
    border: 1px solid rgba(23, 25, 18, .10);
    border-radius: 19px;
    background: color-mix(in srgb, var(--bg-card, #fff) 94%, transparent);
    box-shadow: 0 16px 48px rgba(23, 25, 18, .18);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }

  html.asx-platform-route,
  html.asx-platform-route body {
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow: hidden !important;
  }

  html.asx-platform-route #asx-platform-root {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  html.asx-platform-route #asx-platform-root::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  html.asx-platform-route :is(.asx-auth-shell, .asx-auth-story, .asx-auth-panel, .asx-auth-card) {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }

  html.asx-platform-route .asx-auth-card :is(input, button, a) {
    max-width: 100%;
    box-sizing: border-box;
  }

  html.asx-platform-route .asteron-mobile-nav {
    display: none !important;
  }

  html.asteron-android-app .asteron-mobile-nav {
    right: 10px;
    bottom: 10px;
    left: 10px;
    contain: layout paint;
    background: var(--bg-card, #fff);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html.asteron-android-app.asx-platform-route .asx-auth-story {
    min-height: 230px;
    padding: 22px 20px 26px;
  }

  html.asteron-android-app.asx-platform-route .asx-auth-story-copy {
    margin-top: 36px;
  }

  html.asteron-android-app.asx-platform-route .asx-auth-story h1 {
    font-size: 35px;
  }

  html.asteron-android-app.asx-platform-route .asx-auth-story-copy > p {
    margin-top: 14px;
    line-height: 1.5;
  }

  html.asteron-android-app.asx-platform-route .asx-auth-panel {
    padding: 14px 10px 24px;
  }

  html.asteron-android-app.asx-platform-route .asx-auth-card {
    padding: 24px 19px;
  }

  .asteron-mobile-nav a,
  .asteron-mobile-nav button {
    display: grid;
    grid-template-rows: 23px 16px;
    align-content: center;
    justify-items: center;
    gap: 2px;
    min-width: 0;
    min-height: 52px;
    padding: 3px 2px;
    border: 0;
    border-radius: 14px;
    color: var(--text-muted, #777d72);
    background: transparent;
    font: 700 9px/1 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-decoration: none;
    cursor: pointer;
  }

  .asteron-mobile-nav a > span,
  .asteron-mobile-nav button > span {
    font-size: 20px;
    line-height: 22px;
  }

  .asteron-mobile-nav a > strong,
  .asteron-mobile-nav button > strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .asteron-mobile-nav a.active {
    color: var(--asteron-mobile-ink);
    background: var(--asteron-mobile-accent);
  }

  .asteron-mobile-nav .asteron-mobile-nav__new {
    position: relative;
    overflow: visible;
    color: var(--asteron-mobile-ink);
    font-weight: 850;
  }

  .asteron-mobile-nav .asteron-mobile-nav__new > span {
    display: grid;
    width: 42px;
    height: 42px;
    margin-top: -20px;
    place-items: center;
    border: 4px solid color-mix(in srgb, var(--bg-card, #fff) 96%, transparent);
    border-radius: 50%;
    background: var(--asteron-mobile-ink);
    color: var(--asteron-mobile-accent);
    box-shadow: 0 8px 22px rgba(23, 25, 18, .25);
    font-size: 28px;
    line-height: 1;
  }

  .asteron-mobile-nav .asteron-mobile-nav__new > strong {
    margin-top: 3px;
  }

  html.asteron-mobile-keyboard-open .asteron-mobile-nav,
  html.asteron-mobile-ui-obscured .asteron-mobile-nav {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 26px));
  }

  .asteron-mobile-nav {
    transition: opacity 160ms ease, transform 180ms ease;
  }

  .asteron-pwa-install {
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) and (max-height: 780px) {
  html.asx-platform-route .asx-auth-story {
    min-height: 220px;
    padding: 22px 20px 26px;
  }

  html.asx-platform-route .asx-auth-story-copy {
    margin-top: 34px;
  }

  html.asx-platform-route .asx-auth-story h1 {
    font-size: 34px;
  }

  html.asx-platform-route .asx-auth-story-copy > p {
    margin-top: 14px;
    line-height: 1.5;
  }

  html.asx-platform-route .asx-auth-panel {
    padding: 14px 10px 24px;
  }

  html.asx-platform-route .asx-auth-card {
    padding: 24px 19px;
  }
}

@media (max-width: 420px) {
  .asteron-pwa-install {
    gap: 8px;
  }

  .asteron-pwa-install__mark {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .asteron-pwa-install__action {
    padding-inline: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .asteron-pwa-status {
    transition: none;
  }
}

/* Mobile workspace polish — v233.
   These rules intentionally live in the last stylesheet so the card layouts
   cannot inherit desktop zebra backgrounds or desktop dropdown positioning. */
@media (max-width: 768px) {
  html.asteron-android-app .asteron-mobile-nav {
    contain: layout;
    overflow: visible;
  }

  .asteron-mobile-nav .asteron-mobile-nav__new > span {
    position: relative;
    z-index: 2;
  }

  .header {
    min-width: 0;
    gap: 8px;
    padding-inline: 12px;
  }

  .header .asx-workspace-switcher {
    grid-template-columns: 34px minmax(0, 1fr) 14px;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 46px;
    margin: 0;
    padding: 6px 8px;
    box-shadow: none;
  }

  .header .asx-workspace-logo {
    width: 34px;
    height: 34px;
  }

  .header .asx-workspace-copy {
    min-width: 0;
  }

  .header .asx-workspace-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header .asx-workspace-copy small {
    display: none;
  }

  /* Orders: paint a single card instead of a separate striped rectangle per cell. */
  .orders-lp-table[data-asx-mobile-cards="true"] tbody tr {
    grid-template-columns: minmax(0, 1fr) minmax(118px, 42%);
    overflow: hidden;
    border-radius: 18px !important;
    background: var(--bg-card, #fff) !important;
    box-shadow: 0 8px 24px rgba(28, 32, 23, .07) !important;
  }

  .orders-page .orders-table-scroll
  .orders-lp-table[data-asx-mobile-cards="true"] tbody tr > td {
    background: transparent !important;
    box-shadow: none !important;
  }

  .orders-compact-table[data-asx-mobile-cards="true"] tbody tr,
  .orders-lp-table[data-asx-mobile-cards="true"] tbody tr {
    transition: border-color 90ms ease, background-color 90ms ease, box-shadow 90ms ease;
  }

  .orders-compact-table[data-asx-mobile-cards="true"] tbody tr.row-checked,
  .orders-lp-table[data-asx-mobile-cards="true"] tbody tr.row-checked {
    border-color: color-mix(in srgb, var(--primary, #7d9e37) 42%, var(--border, #dfe2d8)) !important;
    background: color-mix(in srgb, var(--lime, #d7ff63) 7%, var(--bg-card, #fff)) !important;
    box-shadow: 0 9px 26px rgba(28, 32, 23, .09) !important;
  }

  .orders-page .orders-table-scroll
  .orders-compact-table[data-asx-mobile-cards="true"] tbody tr > td,
  .orders-page .orders-table-scroll
  .orders-lp-table[data-asx-mobile-cards="true"] tbody tr > td {
    background: transparent !important;
    box-shadow: none !important;
  }

  .orders-lp-table[data-asx-mobile-cards="true"] tbody td:nth-child(3),
  .orders-lp-table[data-asx-mobile-cards="true"] tbody td:nth-child(5) {
    min-width: 0;
    max-width: 100%;
  }

  .orders-lp-table[data-asx-mobile-cards="true"] tbody td:nth-child(6),
  .orders-lp-table[data-asx-mobile-cards="true"] tbody td:nth-child(7),
  .orders-lp-table[data-asx-mobile-cards="true"] tbody td:nth-child(9),
  .orders-lp-table[data-asx-mobile-cards="true"] tbody td:nth-child(10),
  .orders-lp-table[data-asx-mobile-cards="true"] tbody td:nth-child(11),
  .orders-lp-table[data-asx-mobile-cards="true"] tbody td:nth-child(12),
  .orders-lp-table[data-asx-mobile-cards="true"] tbody td:nth-child(13) {
    padding-top: 9px !important;
    border-top: 1px solid color-mix(in srgb, var(--border, #dfe2d8) 72%, transparent) !important;
  }

  .orders-lp-table .asx-mobile-phone-link {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding-inline: 8px;
    overflow: hidden;
    justify-content: center;
    font-size: clamp(11px, 3.45vw, 13px);
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .orders-lp-table .status-badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  @media (hover: none) {
    .orders-page .orders-table-scroll
    .orders-lp-table[data-asx-mobile-cards="true"] tbody tr:hover:not(.row-checked) > td {
      background: transparent !important;
    }
  }

  /* Products: keep the actions on-screen and turn every row into a structured card. */
  .asteron-products-page .page-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .asteron-products-page .page-actions {
    display: grid;
    grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
    gap: 10px;
    width: 100%;
  }

  .asteron-products-page .menu-wrap,
  .asteron-products-page .menu-wrap > .btn,
  .asteron-products-page .page-actions > .btn {
    width: 100%;
  }

  .asteron-products-page .menu-wrap > .dropdown-menu {
    right: auto !important;
    left: 0 !important;
    width: min(284px, calc(100vw - 24px));
    min-width: 0;
    max-height: min(420px, 60vh);
    overflow-y: auto;
  }

  .asteron-products-page .products-table[data-asx-mobile-cards="true"] tbody {
    gap: 14px;
  }

  .asteron-products-page .products-table[data-asx-mobile-cards="true"] tbody tr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 18px !important;
    opacity: 1 !important;
    background: var(--bg-card, #fff) !important;
    box-shadow: 0 8px 24px rgba(28, 32, 23, .07) !important;
  }

  .asteron-products-page .products-table[data-asx-mobile-cards="true"] tbody td {
    box-sizing: border-box;
    padding: 11px 13px !important;
    background: transparent !important;
  }

  .asteron-products-page .products-table tbody td:nth-child(1) {
    top: 10px;
    left: 11px;
  }

  .asteron-products-page .products-table tbody td:nth-child(2) {
    grid-column: 1 / -1;
    min-height: 52px;
    padding: 15px 70px 12px 54px !important;
    border-bottom: 1px solid var(--border, #dfe2d8) !important;
  }

  .asteron-products-page .products-table tbody td:nth-child(4) {
    grid-column: 1 / -1;
    padding-block: 15px !important;
    background: color-mix(in srgb, var(--bg-hover, #e8e8e1) 42%, var(--bg-card, #fff)) !important;
  }

  .asteron-products-page .products-table tbody td:nth-child(4) .fw-600 {
    font-size: 16px;
    line-height: 1.3;
  }

  .asteron-products-page .products-table tbody td:nth-child(5),
  .asteron-products-page .products-table tbody td:nth-child(10) {
    grid-column: 1 / -1;
    border-bottom: 1px solid var(--border, #dfe2d8) !important;
  }

  .asteron-products-page .products-table tbody td:nth-child(7),
  .asteron-products-page .products-table tbody td:nth-child(9),
  .asteron-products-page .products-table tbody td:nth-child(11),
  .asteron-products-page .products-table tbody td:nth-child(12) {
    min-height: 66px;
    border-bottom: 1px solid var(--border, #dfe2d8) !important;
  }

  .asteron-products-page .products-table tbody td:nth-child(7),
  .asteron-products-page .products-table tbody td:nth-child(11) {
    grid-column: 1;
    border-right: 1px solid var(--border, #dfe2d8) !important;
  }

  .asteron-products-page .products-table tbody td:nth-child(9),
  .asteron-products-page .products-table tbody td:nth-child(12) {
    grid-column: 2;
  }

  .asteron-products-page .products-table tbody td:nth-child(13) {
    grid-column: 1 / -1;
    padding: 10px !important;
  }

  .asteron-products-page .products-table tbody .action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .asteron-products-page .products-table tbody .action-row button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: auto;
    min-height: 44px;
  }

  .asteron-products-page .products-table tbody .action-row button::after {
    content: attr(aria-label);
    font-size: 12px;
    font-weight: 800;
  }

  .asteron-products-page .products-table tbody tr.asteron-product-selected {
    border-color: var(--primary, #171912) !important;
    background: color-mix(in srgb, var(--lime, #d7ff63) 18%, var(--bg-card, #fff)) !important;
    box-shadow: inset 4px 0 0 var(--primary, #171912), 0 10px 26px rgba(28, 32, 23, .10) !important;
  }

  .asteron-products-page .products-table tbody tr.asteron-product-inactive {
    border-style: dashed !important;
  }

  .asteron-product-state {
    position: absolute;
    top: 13px;
    right: 12px;
    z-index: 2;
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--text-muted, #777d72);
    background: var(--bg-hover, #e8e8e1);
    font-size: 9px;
    font-weight: 800;
  }

  .asteron-selection-count-hidden {
    display: none !important;
  }

  .asteron-products-selection-bar {
    position: sticky;
    top: 76px;
    z-index: 28;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 12px;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--primary, #171912) 30%, var(--border, #dfe2d8));
    border-radius: 14px;
    background: color-mix(in srgb, var(--lime, #d7ff63) 26%, var(--bg-card, #fff));
    box-shadow: 0 10px 30px rgba(28, 32, 23, .12);
  }

  .asteron-products-selection-bar[hidden] {
    display: none !important;
  }

  .asteron-products-selection-copy {
    display: grid;
    flex: 1 1 145px;
    gap: 2px;
    min-width: 0;
  }

  .asteron-products-selection-copy strong {
    font-size: 13px;
  }

  .asteron-products-selection-copy small {
    color: var(--text-muted, #777d72);
    font-size: 10px;
  }

  .asteron-products-selection-actions {
    display: flex;
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
  }

  .asteron-products-selection-actions button {
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid var(--border, #dfe2d8);
    border-radius: 10px;
    color: var(--text, #171914);
    background: var(--bg-card, #fff);
    font: 800 11px/1 Inter, system-ui, sans-serif;
  }

  .asteron-products-selection-actions button[data-primary="true"] {
    border-color: var(--primary, #171912);
    color: var(--bg-card, #fff);
    background: var(--primary, #171912);
  }

  /* Clients: a native mobile list mirrors the currently visible page of the desktop table. */
  .asteron-clients-page .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .asteron-clients-page .stat-card {
    display: grid;
    align-content: center;
    gap: 7px;
    min-height: 92px;
  }

  .asteron-clients-page .stat-label {
    display: block;
    line-height: 1.25;
  }

  .asteron-clients-page .stat-value {
    display: block;
    line-height: 1;
    white-space: nowrap;
  }

  .asteron-clients-page .filters > div {
    width: 100%;
    max-width: none !important;
  }

  .asteron-clients-source-table {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    pointer-events: none !important;
  }

  .asteron-mobile-client-list {
    display: grid;
    gap: 12px;
    padding: 10px;
  }

  .asteron-mobile-client-card {
    overflow: hidden;
    border: 1px solid var(--border, #dfe2d8);
    border-radius: 17px;
    background: var(--bg-card, #fff);
    box-shadow: 0 7px 22px rgba(28, 32, 23, .06);
  }

  .asteron-mobile-client-head {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-bottom: 1px solid var(--border, #dfe2d8);
    background: color-mix(in srgb, var(--bg-hover, #e8e8e1) 38%, var(--bg-card, #fff));
  }

  .asteron-mobile-client-head strong {
    font-size: 16px;
    line-height: 1.25;
  }

  .asteron-mobile-client-phone {
    width: max-content;
    max-width: 100%;
    padding: 7px 9px;
    overflow: hidden;
    border-radius: 9px;
    color: var(--text, #171914);
    background: var(--primary-soft, #eff7d4);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .asteron-mobile-client-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asteron-mobile-client-field {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 11px 13px;
    border-right: 1px solid var(--border, #dfe2d8);
    border-bottom: 1px solid var(--border, #dfe2d8);
  }

  .asteron-mobile-client-field:nth-child(2n) {
    border-right: 0;
  }

  .asteron-mobile-client-field span,
  .asteron-mobile-client-extra span {
    color: var(--text-muted, #777d72);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .asteron-mobile-client-field strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .asteron-mobile-client-extra {
    display: grid;
    gap: 5px;
    padding: 11px 13px;
    border-bottom: 1px solid var(--border, #dfe2d8);
  }

  .asteron-mobile-client-extra:last-child {
    border-bottom: 0;
  }

  .asteron-mobile-client-extra strong {
    font-size: 12px;
    line-height: 1.4;
  }

  .asteron-clients-page .lp-client-pagination {
    gap: 10px;
    padding: 12px;
  }

  .asteron-clients-page .lp-client-pagination__controls {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  /* Warehouse: readable cards, compact KPIs and stock before picking. */
  .warehouse-page .warehouse-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .warehouse-page .warehouse-kpis > div {
    min-height: 104px;
    border-right: 1px solid var(--border, #dfe2d8) !important;
    border-bottom: 1px solid var(--border, #dfe2d8);
  }

  .warehouse-page .warehouse-kpis > div:nth-child(2n) {
    border-right: 0 !important;
  }

  .warehouse-page .warehouse-workspace {
    display: flex;
    flex-direction: column;
  }

  .warehouse-page .warehouse-stock-card {
    order: 1;
  }

  .warehouse-page .warehouse-picking-card {
    order: 2;
  }

  .warehouse-page .warehouse-table-wrap {
    max-height: none;
    overflow: visible;
  }

  .warehouse-page .warehouse-location-tabs,
  .warehouse-page .warehouse-filter-tabs {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .warehouse-table[data-asteron-mobile-cards="warehouse"] {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .warehouse-table[data-asteron-mobile-cards="warehouse"] thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .warehouse-table[data-asteron-mobile-cards="warehouse"] tbody {
    display: grid;
    gap: 12px;
    padding: 10px;
  }

  .warehouse-table[data-asteron-mobile-cards="warehouse"] tbody tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--border, #dfe2d8);
    border-radius: 16px;
    background: var(--bg-card, #fff);
    box-shadow: 0 7px 22px rgba(28, 32, 23, .06);
  }

  .warehouse-table[data-asteron-mobile-cards="warehouse"] tbody td {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 10px !important;
    border: 0;
    border-right: 1px solid var(--border, #dfe2d8);
    border-bottom: 1px solid var(--border, #dfe2d8);
    background: transparent !important;
  }

  .warehouse-table[data-asteron-mobile-cards="warehouse"] tbody td::before {
    color: var(--text-muted, #777d72);
    content: attr(data-label);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .warehouse-table[data-asteron-mobile-cards="warehouse"] tbody td:nth-child(-n+3),
  .warehouse-table[data-asteron-mobile-cards="warehouse"] tbody td:nth-child(7),
  .warehouse-table[data-asteron-mobile-cards="warehouse"] tbody td:nth-child(8) {
    grid-column: 1 / -1;
    border-right: 0;
  }

  .warehouse-table[data-asteron-mobile-cards="warehouse"] tbody td:nth-child(6) {
    border-right: 0;
  }

  .warehouse-table[data-asteron-mobile-cards="warehouse"] tbody td:nth-child(8) {
    border-bottom: 0;
  }

  .warehouse-table[data-asteron-mobile-cards="warehouse"] .warehouse-row-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .warehouse-table[data-asteron-mobile-cards="warehouse"] .warehouse-row-actions button {
    min-height: 40px;
    height: auto;
  }

  .warehouse-table[data-asteron-mobile-cards="warehouse"] .warehouse-row-actions button span {
    display: inline !important;
  }

  /* Socials: opaque surfaces and one pane at a time instead of nested scrollers. */
  .socials-page {
    --card: var(--bg-card, #fff);
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  .socials-page .socials-layout {
    display: block;
    min-height: 0;
    margin-bottom: 0;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .socials-page .socials-list-pane,
  .socials-page .socials-chat-pane {
    max-height: none;
    overflow: hidden;
    border: 1px solid var(--border, #dfe2d8);
    border-radius: 16px;
    background: var(--bg-card, #fff);
  }

  .socials-page .socials-conv-list,
  .socials-page .socials-messages {
    min-height: 180px;
    max-height: none;
    overflow: visible;
  }

  .socials-page.asteron-socials-list-mode .socials-chat-pane,
  .socials-page.asteron-socials-list-mode .socials-side-pane,
  .socials-page.asteron-socials-chat-mode .socials-list-pane,
  .socials-page.asteron-socials-chat-mode .socials-side-pane,
  .socials-page.asteron-socials-empty .socials-chat-pane,
  .socials-page.asteron-socials-empty .socials-side-pane {
    display: none !important;
  }

  .socials-page .socials-empty-list {
    min-height: 190px;
    padding: 28px 20px;
  }

  .asteron-socials-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    margin: 10px 10px 0;
    padding: 0 12px;
    border: 1px solid var(--border, #dfe2d8);
    border-radius: 10px;
    color: var(--text, #171914);
    background: var(--bg-card, #fff);
    font: 800 11px/1 Inter, system-ui, sans-serif;
  }
}

@media (max-width: 380px) {
  .asteron-products-selection-actions {
    justify-content: flex-start;
  }

  .asteron-products-selection-actions button {
    flex: 1 1 auto;
  }
}

/* Mobile interaction polish — v235. */
@media (max-width: 768px) {
  :root {
    --asteron-mobile-nav-height: 72px;
  }

  html.asteron-android-app .header {
    background: var(--bg, #f4f4ee);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .asteron-mobile-nav {
    min-height: var(--asteron-mobile-nav-height);
  }

  .asteron-mobile-nav .asteron-mobile-nav__new {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-direction: column;
    overflow: visible;
    padding: 0 2px 7px;
  }

  .asteron-mobile-nav .asteron-mobile-nav__new > span {
    position: absolute;
    top: -18px;
    left: 50%;
    margin: 0;
    transform: translateX(-50%);
  }

  .asteron-mobile-nav .asteron-mobile-nav__new > strong {
    margin: 0;
  }

  .orders-lp-table[data-asx-mobile-cards="true"] tbody tr {
    overflow: visible;
    isolation: isolate;
  }

  .orders-lp-table[data-asx-mobile-cards="true"] tbody td:nth-child(5) {
    grid-column: 1 / -1 !important;
    justify-self: stretch !important;
  }

  .orders-lp-table .asx-mobile-phone-link {
    width: 100%;
    max-width: none;
    overflow: visible;
    justify-content: flex-start;
    font-size: 13px;
    letter-spacing: normal;
    text-overflow: clip;
    white-space: nowrap;
  }

  .orders-lp-table[data-asx-mobile-cards="true"] tbody td:nth-child(8) {
    position: static !important;
    order: 99;
    grid-column: 1 / -1 !important;
    display: flex !important;
    align-items: flex-end;
    justify-content: space-between;
    max-width: none !important;
    padding-top: 11px !important;
    border-top: 1px solid var(--border, #dfe2d8) !important;
  }

  .orders-lp-table[data-asx-mobile-cards="true"] tbody td:nth-child(9) {
    padding-right: 0 !important;
  }

  .asteron-products-selection-bar {
    box-sizing: border-box;
    width: 100%;
    flex: 1 0 100%;
  }

  .asteron-products-page .menu-wrap > .dropdown-menu {
    position: fixed !important;
    top: auto !important;
    right: 12px !important;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px !important;
    z-index: 2147480900;
    width: auto;
    max-height: min(52dvh, 480px);
    border-radius: 18px;
    box-shadow: 0 22px 64px rgba(23, 25, 18, .24);
  }

  .asx-inventory-sync-v211 {
    position: relative !important;
    bottom: auto !important;
    z-index: 8 !important;
  }

  .socials-page.asteron-socials-chat-mode {
    display: flex;
    height: calc(100dvh - var(--header-h, 72px) - env(safe-area-inset-bottom) - 16px);
    min-height: 420px;
    flex-direction: column;
    overflow: hidden;
  }

  .socials-page.asteron-socials-chat-mode > .page-header {
    flex: 0 0 auto;
  }

  .socials-page.asteron-socials-chat-mode .socials-layout,
  .socials-page.asteron-socials-chat-mode .socials-chat-pane {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
  }

  .socials-page.asteron-socials-chat-mode .socials-chat-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .socials-page.asteron-socials-chat-mode .socials-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .socials-page.asteron-socials-chat-mode .socials-composer,
  .socials-page.asteron-socials-chat-mode .asteron-socials-back {
    flex: 0 0 auto;
  }
}

/* Bottom navigation retired for Android, iOS and mobile browsers. */
.asteron-mobile-nav {
  display: none !important;
}

/* Mobile order cards grow to fit their field labels and values. */
@media (max-width: 768px) {
  .orders-page .orders-lp-table[data-asx-mobile-cards="true"] tbody td:not(.orders-check-col) {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

/* Hide the retired sidebar shortcut while older scripts refresh. */
.asteron-pwa-install-shortcut {
  display: none !important;
}

/* Give each chat filter enough room for its label and counter. */
.socials-page .socials-scope-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.socials-page .socials-scope-tabs > button {
  flex: 1 0 auto;
  white-space: nowrap;
}

.socials-page .socials-scope-tabs > button > strong {
  flex: 0 0 auto;
}

/* Product cards use their table identity, including after a viewport resize.
   DOM columns: check, SKU, ID, name, supplier, sale, cost, margin, stock,
   dimensions/weight, COD, warehouse, actions. Existing hidden columns stay hidden. */
@media (max-width: 768px) {
  .content table.products-table[data-asx-mobile-cards="true"] tbody { gap: 12px; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr {
    position: relative;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    width: 100%;
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid var(--border, #dfe2d8) !important;
    border-radius: 14px !important;
    background: var(--bg-card, #fff) !important;
    box-shadow: 0 2px 7px rgb(28 32 23 / 4%) !important;
    opacity: 1 !important;
  }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td {
    box-sizing: border-box;
    min-width: 0 !important;
    min-height: 0;
    padding: 7px 12px !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td[data-label]::before {
    margin: 0 0 3px;
    color: var(--text-muted, #707369);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
  }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(1) {
    position: absolute;
    top: 0;
    left: 4px;
    width: 44px !important;
    height: 44px;
    padding: 0 !important;
    place-items: center;
    z-index: 2;
  }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(1) input { width: 20px; height: 20px; margin: 0; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(2) {
    order: 1;
    grid-column: 1 / -1;
    min-height: 44px;
    padding: 12px 74px 9px 52px !important;
    font-size: 12px !important;
  }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(2)::before { display: inline; margin-right: 6px; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(2):empty::after { content: "—"; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(4) { order: 2; grid-column: 1 / -1; padding: 4px 12px 9px !important; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(4)::before { display: none; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(4) .fw-600 { font-size: 16px; line-height: 1.3; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(4) .text-xs {
    max-width: none;
    margin-top: 3px;
    overflow: visible;
    color: var(--text-muted, #707369);
    font-size: 13px;
    line-height: 1.35;
    white-space: normal !important;
    text-overflow: clip;
  }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(5) { order: 3; grid-column: 1 / -1; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(6) { order: 4; grid-column: 1; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(8) { order: 5; grid-column: 2; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(7) { order: 6; grid-column: 1; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(9) { order: 7; grid-column: 2; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(10) { order: 8; grid-column: 1 / -1; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(11) { order: 9; grid-column: 1; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(12) { order: 10; grid-column: 2; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(n+5) { border-top: 1px solid var(--border, #dfe2d8) !important; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(13) { order: 11; grid-column: 1 / -1; padding: 8px !important; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr > td:nth-child(13):not(:has(button)) { display: none !important; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody .action-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody .action-row button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: auto; min-height: 44px; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody .action-row button::after { content: attr(aria-label); font-size: 12px; font-weight: 700; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr.asteron-product-selected { border-color: var(--primary, #171912) !important; box-shadow: inset 3px 0 0 var(--primary, #171912) !important; }
  .content table.products-table[data-asx-mobile-cards="true"] tbody tr.asteron-product-inactive { border-style: dashed !important; }
}

/* The shortcuts occupy their own flex row, keeping content and the sidebar clear. */
.asteron-quick-nav-visible { --asteron-quick-nav-height: calc(68px + env(safe-area-inset-bottom, 0px)); }
.asteron-quick-nav-visible .app-shell .main-area { min-height: 0; }
.asteron-quick-nav-visible .app-shell .main-area > .content { min-height: 0; }
.asteron-quick-nav {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  flex: 0 0 auto; box-sizing: border-box; min-height: var(--asteron-quick-nav-height);
  padding: 7px 20px calc(7px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border, #e3e5dc); background: var(--bg-card, #fff);
  position: relative; z-index: 40;
}
.asteron-quick-nav[hidden], .asteron-quick-nav__link[hidden] { display: none !important; }
.asteron-quick-nav__link {
  display: flex; flex: 1 1 0; max-width: 200px; min-width: 0; min-height: 52px;
  align-items: center; justify-content: center; gap: 10px;
  border-radius: 12px; color: var(--text-muted, #7a8070); text-decoration: none;
  font-family: inherit; font-size: 13px; line-height: 1.2; font-weight: 600;
  transition: background-color .15s ease, color .15s ease; -webkit-tap-highlight-color: transparent;
}
.asteron-quick-nav__link svg { display: block; width: 22px; height: 22px; flex: 0 0 22px; }
.asteron-quick-nav__link:hover { color: var(--text, #283021); background: var(--bg-hover, #f4f5ef); }
.asteron-quick-nav__link[aria-current="page"] { color: var(--primary, #657b46); background: var(--primary-soft, #edf2e6); }
.asteron-quick-nav__link:focus-visible { outline: 2px solid var(--primary, #657b46); outline-offset: 2px; }
@media (max-width: 900px) {
  .asteron-quick-nav { gap: 4px; padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .asteron-quick-nav__link { max-width: none; flex-direction: column; gap: 4px; font-size: 11px; min-height: 52px; }
  .asteron-quick-keyboard { --asteron-quick-nav-height: 0px; }
  .asteron-quick-keyboard .asteron-quick-nav { display: none; }
  .asteron-quick-nav-visible .socials-page.asteron-socials-chat-mode {
    height: calc(100dvh - var(--header-h, 72px) - var(--asteron-quick-nav-height) - 16px);
    min-height: 0;
  }
  .asteron-quick-nav-visible .asteron-products-page .menu-wrap > .dropdown-menu,
  .asteron-quick-nav-visible .asteron-pwa-install { bottom: calc(var(--asteron-quick-nav-height) + 12px); }
}
@media (prefers-reduced-motion: reduce) { .asteron-quick-nav__link { transition: none; } }
@media print { .asteron-quick-nav { display: none !important; } }

/* The bottom shortcuts belong to the mobile layout (same breakpoint as the sidebar drawer). */
@media (min-width: 901px) {
  .asteron-quick-nav-visible { --asteron-quick-nav-height: 0px; }
  .asteron-quick-nav { display: none !important; }
}
