/*
  Kassa SRM trade shell adapter, candidate 4.0.4.19.
  One authoritative shell for browser, Windows and Android packaging.
*/

body.srm-page {
  --bg: var(--srm-canvas);
  --surface: var(--srm-surface-1);
  --surface-2: var(--srm-surface-2);
  --ink: var(--srm-text-primary);
  --text: var(--srm-text-primary);
  --text-strong: var(--srm-text-primary);
  --muted: var(--srm-text-secondary);
  --muted2: var(--srm-text-muted);
  --line: var(--srm-border-subtle);
  --primary: var(--srm-accent);
  --primary-2: var(--srm-accent-pressed);
  --accent: var(--srm-accent);
  --accent2: var(--srm-accent-hover);
  --accent-soft: var(--srm-accent-subtle);
  --danger: var(--srm-danger);
  --warn: var(--srm-warning);
  --ok: var(--srm-success);
  --sidebar-bg: var(--srm-sidebar-background);
  --workspace-bg: var(--srm-page-background);
  --button-gradient: linear-gradient(135deg, var(--srm-accent), var(--srm-accent-pressed));
  --logo-bg: var(--srm-surface-2);
  --shadow: var(--srm-shadow);
  --shadow-soft: var(--srm-shadow-sm);
  color-scheme: dark;
  background: var(--srm-canvas) !important;
}

body.srm-page #appRoot {
  position: relative;
  isolation: isolate;
  color: var(--srm-text-primary);
  background: var(--srm-canvas) !important;
}

body.srm-page #appRoot::before,
body.srm-page #appRoot::after {
  content: "";
  position: fixed;
  inset: -22vh -18vw;
  z-index: -1;
  pointer-events: none;
  opacity: 0.14;
  filter: blur(78px);
  will-change: opacity, transform;
  animation: trade-shell-ambient 18s var(--srm-ease-emphasized) infinite alternate;
}

body.srm-page #appRoot::before {
  background: radial-gradient(ellipse at 18% 32%, rgba(84, 95, 151, 0.24), transparent 47%);
}

body.srm-page #appRoot::after {
  background: radial-gradient(ellipse at 82% 68%, rgba(91, 79, 126, 0.2), transparent 49%);
  animation-delay: -9s;
}

@keyframes trade-shell-ambient {
  0% {
    opacity: 0.09;
    transform: translate3d(-1.5%, -1%, 0) scale(0.98);
  }
  55% {
    opacity: 0.17;
  }
  100% {
    opacity: 0.13;
    transform: translate3d(1.5%, 1%, 0) scale(1.025);
  }
}

body.srm-page :where(.sidebar, .main) {
  position: relative;
  z-index: 1;
}

body.srm-page .sidebar,
body.srm-page.android-shell .sidebar {
  color: var(--srm-text-primary) !important;
  border-color: var(--srm-border-subtle) !important;
  background: rgba(7, 9, 14, 0.91) !important;
  box-shadow:
    18px 0 54px rgba(0, 0, 0, 0.34),
    inset -1px 0 0 rgba(255, 255, 255, 0.018) !important;
  backdrop-filter: blur(26px) saturate(116%);
}

body.srm-page .main,
body.srm-page.android-shell .main {
  color: var(--srm-text-primary) !important;
  background: rgba(8, 11, 18, 0.5) !important;
}

body.srm-page .brand {
  min-width: 0;
  color: var(--srm-text-primary) !important;
}

body.srm-page .brand-mark {
  display: grid !important;
  place-items: center !important;
  border-color: var(--srm-border-subtle) !important;
  border-radius: var(--srm-radius-md) !important;
  background: var(--srm-surface-1) !important;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
}

body.srm-page .brand-mark img {
  display: block;
  width: 82%;
  height: 82%;
  margin: auto;
  object-fit: contain;
}

body.srm-page :where(.nav button, .mobile-nav-toggle) {
  min-width: 0;
  min-height: 44px;
  border: 1px solid transparent !important;
  border-radius: var(--srm-radius-sm) !important;
  color: var(--srm-text-secondary) !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.srm-page .nav button:hover {
  color: var(--srm-text-primary) !important;
  border-color: var(--srm-border-subtle) !important;
  background: var(--srm-surface-hover) !important;
  transform: translateX(1px) !important;
}

body.srm-page .nav button.active {
  color: var(--srm-text-primary) !important;
  border-color: var(--srm-border-subtle) !important;
  background: var(--srm-surface-selected) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025) !important;
}

body.srm-page .nav-icon {
  display: grid !important;
  place-items: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border: 1px solid var(--srm-border-subtle) !important;
  border-radius: var(--srm-radius-sm) !important;
  color: var(--srm-text-secondary) !important;
  background: var(--srm-surface-1) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025) !important;
}

body.srm-page .nav button.active .nav-icon {
  color: var(--srm-accent-text) !important;
  border-color: var(--srm-border-interactive) !important;
  background: var(--srm-surface-2) !important;
}

body.srm-page .nav-icon::before,
body.srm-page .nav-icon::after {
  content: none !important;
  display: none !important;
}

body.srm-page .nav-icon svg {
  display: block !important;
  width: 19px !important;
  height: 19px !important;
  margin: auto !important;
  transform: none !important;
}

body.srm-page .integration-icon {
  display: grid !important;
  place-items: center !important;
  color: var(--srm-text-secondary) !important;
  border-color: var(--srm-border-subtle) !important;
  border-radius: var(--srm-radius-sm) !important;
  background: var(--srm-surface-2) !important;
}

body.srm-page .integration-icon svg {
  display: block !important;
  width: 19px !important;
  height: 19px !important;
  margin: auto !important;
}

body.srm-page :where(.dashboard-stat-icon, .dashboard-panel-icon) {
  display: grid !important;
  place-items: center !important;
  width: 34px !important;
  height: 34px !important;
  color: var(--srm-text-secondary) !important;
  border: 1px solid var(--srm-border-subtle) !important;
  border-radius: var(--srm-radius-sm) !important;
  background: var(--srm-surface-2) !important;
}

body.srm-page .dashboard-stat-icon {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
}

body.srm-page .dashboard-panel-icon {
  margin-left: auto !important;
}

body.srm-page :where(.dashboard-stat-icon, .dashboard-panel-icon) svg {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  margin: auto !important;
}

body.srm-page .quick-action-icon {
  display: inline-grid !important;
  place-items: center !important;
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 16px !important;
}

body.srm-page .quick-action-icon svg {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  margin: auto !important;
}

body.srm-page :where(.quick-support-button, .quick-sync-button)::before {
  content: none !important;
  display: none !important;
}

body.srm-page #view-dashboard :where(.dashboard-stats .stat, .quick-money-panel)::before {
  content: none !important;
  display: none !important;
}

body.srm-page :where(
  .stat strong,
  .badge,
  .money,
  .price,
  .amount,
  .total,
  .metric-value,
  .integration-metrics,
  table
) {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

body.srm-page :where(.topline, .panel, .stat, .settings-card, .section-card, .modal, .shift-box.as-nav-note) {
  color: var(--srm-text-primary) !important;
  border-color: var(--srm-border-subtle) !important;
  background: rgba(13, 17, 26, 0.82) !important;
  box-shadow:
    0 14px 38px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.022) !important;
  backdrop-filter: blur(22px) saturate(112%) !important;
}

body.srm-page .topline {
  min-height: 72px !important;
  border-radius: var(--srm-radius-lg) !important;
}

body.srm-page :where(.panel, .stat, .settings-card, .section-card) {
  border-radius: var(--srm-radius-lg) !important;
}

body.srm-page :where(.panel:hover, .stat:hover, .settings-card:hover, .section-card:hover) {
  border-color: var(--srm-border-interactive) !important;
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.028) !important;
}

body.srm-page :where(.panel-head, .modal-head) {
  color: var(--srm-text-primary) !important;
  border-color: var(--srm-divider) !important;
  background: rgba(18, 24, 36, 0.84) !important;
}

body.srm-page :where(.panel-body, .modal .panel-body) {
  color: var(--srm-text-primary) !important;
  background: rgba(10, 14, 22, 0.5) !important;
}

body.srm-page :where(.topline p, .panel-head span, .stat span, .muted, small, label) {
  color: var(--srm-text-muted) !important;
}

body.srm-page .tabs {
  border-color: var(--srm-border-subtle) !important;
  border-radius: var(--srm-radius-md) !important;
  background: rgba(8, 11, 18, 0.7) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018) !important;
}

body.srm-page .tabs button {
  min-height: 38px !important;
  border-radius: var(--srm-radius-sm) !important;
  color: var(--srm-text-secondary) !important;
  background: transparent !important;
}

body.srm-page .tabs button:hover {
  color: var(--srm-text-primary) !important;
  background: var(--srm-surface-hover) !important;
}

body.srm-page .tabs button.active {
  color: var(--srm-text-primary) !important;
  border-color: var(--srm-border-interactive) !important;
  background: var(--srm-surface-selected) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.028) !important;
}

body.srm-page :where(.btn, input, select, textarea) {
  border-radius: var(--srm-radius-sm) !important;
}

body.srm-page .btn.primary {
  color: #ffffff !important;
  border-color: var(--srm-accent-border) !important;
  background: linear-gradient(135deg, var(--srm-accent), var(--srm-accent-pressed)) !important;
  box-shadow: 0 10px 24px rgba(46, 42, 86, 0.3) !important;
}

body.srm-page :where(input, select, textarea) {
  color: var(--srm-text-primary) !important;
  border-color: var(--srm-border-default) !important;
  background: rgba(8, 11, 18, 0.88) !important;
}

body.srm-page :where(input, textarea)::placeholder {
  color: var(--srm-text-muted) !important;
}

body.srm-page .trade-onboarding-card .panel-body > p {
  color: var(--srm-text-secondary) !important;
  opacity: 1 !important;
}

body.srm-page :where(table, th, td) {
  border-color: var(--srm-border-subtle) !important;
}

body.srm-page table {
  color: var(--srm-text-primary) !important;
  background: var(--srm-surface-0) !important;
}

body.srm-page th {
  color: var(--srm-text-secondary) !important;
  background: var(--srm-surface-2) !important;
}

body.srm-page td,
body.srm-page tbody tr:nth-child(even) td {
  color: var(--srm-text-primary) !important;
  background: rgba(13, 17, 26, 0.88) !important;
}

body.srm-page tbody tr:hover td {
  background: var(--srm-surface-selected) !important;
}

.trade-bottom-nav,
.trade-nav-scrim,
.trade-drawer-section,
.trade-drawer-action {
  display: none;
}

@media (orientation: landscape) and (min-width: 721px) and (max-width: 1280px) {
  body.srm-page.android-shell #appRoot.app {
    grid-template-columns: clamp(236px, 20vw, 248px) minmax(0, 1fr) !important;
    column-gap: 8px !important;
  }

  body.srm-page.android-shell .sidebar {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  body.srm-page.android-shell .brand {
    min-width: 0 !important;
  }

  body.srm-page.android-shell .brand h1 {
    min-width: 0 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  body.srm-page.android-shell #appRoot .sidebar .shift-box.as-nav-note {
    grid-template-columns: 88px minmax(0, 1fr) !important;
  }

  body.srm-page.android-shell .shift-box.as-nav-note .quick-profile-button {
    gap: 3px !important;
    padding-inline: 3px !important;
  }

  body.srm-page.android-shell .shift-box.as-nav-note .shift-state-line {
    min-width: 0 !important;
    padding-inline: 5px !important;
  }

  body.srm-page.android-shell .shift-box.as-nav-note .shift-state-line strong {
    min-width: 0 !important;
    font-size: 10px !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  body.srm-page.android-shell .shift-box.as-nav-note .quick-profile-icon {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
  }

  html body.srm-page.android-shell #appRoot .sidebar .shift-box.as-nav-note .sidebar-actions-row {
    grid-template-columns: 92px minmax(0, 1fr) !important;
    gap: 4px !important;
  }

  html body.srm-page.android-shell #appRoot .sidebar .shift-box.as-nav-note .sidebar-actions-row > button {
    gap: 2px !important;
    padding-inline: 2px !important;
    font-size: 9px !important;
  }

  html body.srm-page.android-shell #appRoot .sidebar .shift-box.as-nav-note .sidebar-actions-row .quick-action-icon,
  html body.srm-page.android-shell #appRoot .sidebar .shift-box.as-nav-note .sidebar-actions-row .quick-action-icon svg {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
  }

  html body.srm-page.android-shell #appRoot .sidebar .shift-box.as-nav-note .sidebar-actions-row .quick-action-label {
    min-width: 0 !important;
    font-size: 9px !important;
    line-height: 1.1 !important;
  }

  html body.srm-page.android-shell #appRoot .sidebar .shift-box.as-nav-note .shift-state-line strong {
    min-height: 12px !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
  }

  html body.srm-page.android-shell #view-dashboard .dashboard-stats .stat > strong {
    min-height: 23px !important;
    line-height: 1.2 !important;
    overflow: visible !important;
  }

  body.srm-page.android-shell #appRoot.app > .main {
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }

  body.srm-page.android-shell #appRoot.app > .main .view:not(.hidden) {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding-bottom: 24px !important;
    overflow: visible !important;
  }

  body.srm-page.android-shell .topline-tools .btn {
    white-space: nowrap !important;
  }

  body.srm-page.android-shell #view-dashboard .dashboard-stats {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }

  body.srm-page.android-shell #view-dashboard .dashboard-stats :where(
    .mobile-stat-cash,
    .mobile-stat-revenue,
    .mobile-stat-period
  ) {
    grid-column: span 2 !important;
  }

  body.srm-page.android-shell #view-dashboard .dashboard-stats :where(
    .mobile-stat-sales,
    .mobile-stat-gifts
  ) {
    grid-column: span 3 !important;
  }

  body.srm-page.android-shell #view-dashboard .period-stat .mini-range {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 6px !important;
  }

  body.srm-page.android-shell #view-dashboard .period-stat .mini-date-field {
    grid-template-columns: 18px minmax(0, 1fr) 32px !important;
    gap: 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  body.srm-page.android-shell #view-dashboard .period-stat .mini-date-field > span {
    display: grid !important;
    place-items: center !important;
    align-self: stretch !important;
  }

  body.srm-page.android-shell #view-dashboard .period-stat .date-picker-button {
    position: static !important;
    width: 32px !important;
    min-width: 32px !important;
    height: 100% !important;
    margin: 0 !important;
  }
}

@media (max-width: 720px) {
  html,
  body.srm-page {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  body.srm-page {
    --trade-bottom-height: 72px;
    --trade-shell-gap: 8px;
    --trade-safe-bottom: max(8px, env(safe-area-inset-bottom));
  }

  body.srm-page #appRoot.app,
  body.srm-page.android-shell #appRoot.app {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body.srm-page.android-shell #appRoot.app {
    padding-top: var(--android-safe-top, env(safe-area-inset-top)) !important;
  }

  body.srm-page .sidebar,
  body.srm-page.android-shell .sidebar {
    position: relative !important;
    inset: auto !important;
    z-index: 70 !important;
    display: grid !important;
    grid-template-columns: minmax(120px, 1fr) auto !important;
    grid-template-rows: auto !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 62px !important;
    max-height: none !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    overflow: visible !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--srm-border-subtle) !important;
    background: rgba(7, 9, 14, 0.94) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: none !important;
    transform: none !important;
  }

  html body.srm-page.android-shell .sidebar {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 46px 40px !important;
    align-items: stretch !important;
    min-height: 102px !important;
    gap: 6px !important;
    padding: 7px 10px 8px !important;
    contain: none !important;
  }

  body.srm-page .dashboard-stat-icon {
    top: 16px !important;
    right: 16px !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: var(--srm-radius-md) !important;
  }

  body.srm-page .dashboard-stat-icon svg {
    width: 21px !important;
    height: 21px !important;
  }

  body.srm-page .brand,
  body.srm-page.android-shell .brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 46px !important;
    max-height: 50px !important;
    gap: 8px !important;
    padding: 5px 6px !important;
    overflow: hidden !important;
  }

  html body.srm-page.android-shell .sidebar .brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-height: 46px !important;
    max-height: 46px !important;
  }

  html body.srm-page.android-shell .sidebar .brand h1 {
    color: var(--srm-text-primary) !important;
    -webkit-text-fill-color: var(--srm-text-primary) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.9), 0 0 8px rgba(255, 255, 255, 0.12) !important;
  }

  html body.srm-page.android-shell .sidebar .brand span {
    color: var(--srm-text-secondary) !important;
    -webkit-text-fill-color: var(--srm-text-secondary) !important;
  }

  html body.srm-page.android-shell .sidebar .brand-mark img {
    filter: brightness(1.14) contrast(1.08) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.38)) !important;
  }

  body.srm-page .brand-mark,
  body.srm-page.android-shell .brand-mark {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 10px !important;
  }

  body.srm-page .brand h1,
  body.srm-page.android-shell .brand h1 {
    margin: 0 !important;
    font-size: 13px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.srm-page .brand span,
  body.srm-page.android-shell .brand span {
    display: block !important;
    color: var(--srm-text-muted) !important;
    font-size: 10px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.srm-page .app-exit-button,
  body.srm-page.android-shell .app-exit-button {
    display: none !important;
  }

  body.srm-page .mobile-nav-toggle,
  body.srm-page.android-shell .mobile-nav-toggle {
    display: none !important;
  }

  body.srm-page .shift-box.as-nav-note,
  body.srm-page.android-shell .shift-box.as-nav-note {
    position: relative !important;
    inset: auto !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: 36px minmax(68px, auto) minmax(48px, auto) !important;
    grid-template-rows: 38px !important;
    grid-template-areas: "profile shift state" !important;
    align-items: stretch !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: min(48vw, 178px) !important;
    min-height: 0 !important;
    max-height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 4px !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  html body.srm-page.android-shell .sidebar .shift-box.as-nav-note {
    grid-column: 1 !important;
    grid-row: 2 !important;
    grid-template-columns: 36px minmax(104px, 1fr) 40px minmax(68px, 0.72fr) minmax(56px, 0.62fr) !important;
    grid-template-rows: 36px !important;
    grid-template-areas: "profile contacts sync shift state" !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 36px !important;
    max-height: 36px !important;
    gap: 4px !important;
  }

  body.srm-page .shift-box.as-nav-note .quick-profile-button,
  body.srm-page.android-shell .shift-box.as-nav-note .quick-profile-button {
    grid-area: profile !important;
    display: grid !important;
    place-items: center !important;
    width: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border: 1px solid var(--srm-border-subtle) !important;
    border-radius: var(--srm-radius-sm) !important;
    background: var(--srm-surface-1) !important;
  }

  html body.srm-page.android-shell .sidebar .shift-box.as-nav-note .quick-profile-button {
    grid-area: profile !important;
    overflow: hidden !important;
  }

  html body.srm-page.android-shell .sidebar .shift-box.as-nav-note .quick-profile-button > :not(.quick-profile-icon) {
    display: none !important;
  }

  body.srm-page .quick-profile-icon {
    width: 18px !important;
    height: 18px !important;
  }

  body.srm-page .shift-box.as-nav-note .quick-profile-button > :not(.quick-profile-icon),
  body.srm-page.android-shell .shift-box.as-nav-note .quick-profile-button > :not(.quick-profile-icon) {
    display: none !important;
  }

  body.srm-page .shift-box.as-nav-note .shift-state-line,
  body.srm-page.android-shell .shift-box.as-nav-note .shift-state-line {
    grid-area: shift !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
    min-height: 36px !important;
    height: 36px !important;
    gap: 5px !important;
    padding: 0 7px !important;
    border: 1px solid var(--srm-border-subtle) !important;
    border-radius: var(--srm-radius-sm) !important;
    background: var(--srm-surface-1) !important;
  }

  body.srm-page .shift-box.as-nav-note .shift-state-line strong,
  body.srm-page.android-shell .shift-box.as-nav-note .shift-state-line strong {
    min-width: 0 !important;
    color: var(--srm-text-secondary) !important;
    font-size: 9px !important;
    line-height: 1.05 !important;
    white-space: normal !important;
    text-align: center !important;
  }

  body.srm-page .shift-box.as-nav-note #syncState,
  body.srm-page.android-shell .shift-box.as-nav-note #syncState {
    grid-area: state !important;
    display: grid !important;
    place-items: center !important;
    min-width: 48px !important;
    width: auto !important;
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 6px !important;
    border: 1px solid var(--srm-border-subtle) !important;
    border-radius: var(--srm-radius-sm) !important;
    background: var(--srm-surface-1) !important;
  }

  body.srm-page .shift-box.as-nav-note #syncState .sync-state-main > span,
  body.srm-page.android-shell .shift-box.as-nav-note #syncState .sync-state-main > span,
  body.srm-page .shift-box.as-nav-note #syncState .sync-state-icon {
    display: none !important;
  }

  body.srm-page .shift-box.as-nav-note #syncState strong,
  body.srm-page.android-shell .shift-box.as-nav-note #syncState strong {
    color: var(--srm-text-secondary) !important;
    font-size: 9px !important;
    line-height: 1.05 !important;
    white-space: normal !important;
    text-align: center !important;
  }

  body.srm-page .shift-box.as-nav-note :where(.sidebar-actions-row, #shiftMeta, #shiftEmail),
  body.srm-page.android-shell .shift-box.as-nav-note :where(.sidebar-actions-row, #shiftMeta, #shiftEmail) {
    display: none !important;
  }

  html body.srm-page.android-shell .sidebar .shift-box.as-nav-note .sidebar-actions-row {
    display: contents !important;
  }

  html body.srm-page.android-shell .sidebar .shift-box.as-nav-note .quick-support-button {
    grid-area: contacts !important;
  }

  html body.srm-page.android-shell .sidebar .shift-box.as-nav-note .quick-sync-button {
    grid-area: sync !important;
    min-width: 40px !important;
    width: 40px !important;
    padding: 0 !important;
    font-size: 0 !important;
  }

  html body.srm-page.android-shell .sidebar .shift-box.as-nav-note > .shift-state-line {
    grid-area: shift !important;
    grid-column: shift !important;
    grid-row: shift !important;
    width: auto !important;
    min-width: 0 !important;
  }

  html body.srm-page.android-shell .sidebar .shift-box.as-nav-note > #syncState {
    grid-area: state !important;
    grid-column: state !important;
    grid-row: state !important;
    width: auto !important;
    min-width: 0 !important;
  }

  html body.srm-page.android-shell .sidebar .shift-box.as-nav-note :where(.quick-support-button, .quick-sync-button) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 36px !important;
    height: 36px !important;
    gap: 5px !important;
    border: 1px solid var(--srm-border-subtle) !important;
    border-radius: var(--srm-radius-sm) !important;
    color: var(--srm-text-primary) !important;
    background: var(--srm-surface-1) !important;
  }

  html body.srm-page.android-shell .sidebar .shift-box.as-nav-note .quick-support-button {
    min-width: 0 !important;
    padding: 0 7px !important;
    font-size: 10px !important;
    white-space: nowrap !important;
  }

  html body.srm-page.android-shell .sidebar .shift-box.as-nav-note .quick-action-icon {
    width: 17px !important;
    height: 17px !important;
    min-width: 17px !important;
  }

  html body.srm-page.android-shell .sidebar .shift-box.as-nav-note .quick-action-icon svg {
    width: 17px !important;
    height: 17px !important;
  }

  html body.srm-page.android-shell .sidebar .shift-box.as-nav-note .quick-sync-button .quick-action-label {
    display: none !important;
  }

  html body.srm-page.android-shell .sidebar .shift-box.as-nav-note :where(#shiftMeta, #shiftEmail) {
    display: none !important;
  }

  body.srm-page #nav,
  body.srm-page.android-shell #nav {
    position: fixed !important;
    top: auto !important;
    left: 10px !important;
    right: 10px !important;
    bottom: calc(var(--trade-bottom-height) + var(--trade-safe-bottom) + 14px) !important;
    z-index: 82 !important;
    display: none !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-content: start !important;
    gap: 7px !important;
    width: auto !important;
    height: min(66dvh, 420px) !important;
    max-height: none !important;
    padding: 12px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    border: 1px solid var(--srm-border-default) !important;
    border-radius: var(--srm-radius-xl) !important;
    background: rgba(13, 17, 26, 0.97) !important;
    box-shadow: var(--srm-shadow-lg) !important;
    backdrop-filter: blur(30px) saturate(122%) !important;
    opacity: 0;
    transform: translateY(10px) scale(0.985);
    transform-origin: bottom center;
  }

  body.srm-page.nav-expanded #nav,
  body.srm-page.android-shell.nav-expanded #nav {
    display: grid !important;
    visibility: visible !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    animation: trade-drawer-in var(--srm-duration-normal) var(--srm-ease-emphasized) both;
  }

  @keyframes trade-drawer-in {
    from {
      opacity: 0;
      transform: translateY(10px) scale(0.985);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  body.srm-page #nav > button,
  body.srm-page.android-shell #nav > button {
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) auto !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 50px !important;
    height: auto !important;
    gap: 8px !important;
    padding: 7px 9px !important;
    text-align: left !important;
  }

  body.srm-page #nav > button > span:nth-child(2) {
    min-width: 0 !important;
    color: inherit !important;
    font-size: 11px !important;
    line-height: 1.15 !important;
    overflow-wrap: anywhere !important;
  }

  body.srm-page .trade-drawer-section,
  body.srm-page.android-shell .trade-drawer-section {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    min-height: 28px;
    margin-top: 3px;
    padding: 5px 4px 1px;
    color: var(--srm-text-muted);
    border-top: 1px solid var(--srm-divider);
    font-size: var(--srm-font-size-xs);
    font-weight: var(--srm-font-weight-semibold);
  }

  body.srm-page .trade-drawer-action,
  body.srm-page.android-shell .trade-drawer-action {
    display: grid !important;
  }

  body.srm-page .trade-nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 76;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--srm-overlay);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(8px);
    transition: opacity var(--srm-motion);
  }

  body.srm-page.nav-expanded .trade-nav-scrim {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  body.srm-page.nav-expanded .sidebar,
  body.srm-page.android-shell.nav-expanded .sidebar {
    z-index: 84 !important;
  }

  body.srm-page .trade-bottom-nav {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: var(--trade-safe-bottom);
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    min-height: var(--trade-bottom-height);
    padding: 6px;
    gap: 3px;
    border: 1px solid var(--srm-border-default);
    border-radius: var(--srm-radius-xl);
    background: rgba(13, 17, 26, 0.94);
    box-shadow:
      0 20px 58px rgba(0, 0, 0, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(28px) saturate(122%);
  }

  body.srm-page .trade-bottom-nav button {
    position: relative;
    display: grid;
    grid-template-rows: 27px 15px;
    place-items: center;
    min-width: 0;
    min-height: 58px;
    gap: 2px;
    padding: 4px 2px;
    border: 1px solid transparent;
    border-radius: var(--srm-radius-md);
    color: var(--srm-text-muted);
    background: transparent;
    box-shadow: none;
    font-weight: var(--srm-font-weight-semibold);
  }

  body.srm-page .trade-bottom-nav button:hover {
    color: var(--srm-text-primary);
    background: var(--srm-surface-hover);
  }

  body.srm-page .trade-bottom-nav button.active {
    color: var(--srm-text-primary);
    border-color: var(--srm-border-subtle);
    background: var(--srm-surface-selected);
  }

  body.srm-page .trade-bottom-nav button.active::before {
    content: "";
    position: absolute;
    top: 2px;
    width: 22px;
    height: 2px;
    border-radius: var(--srm-radius-pill);
    background: var(--srm-accent-hover);
  }

  body.srm-page .trade-bottom-nav svg {
    width: 20px;
    height: 20px;
  }

  body.srm-page .trade-bottom-nav span {
    display: block;
    max-width: 100%;
    color: inherit;
    font-size: 9.5px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.srm-page .main,
  body.srm-page.android-shell .main {
    position: relative !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 10px 10px calc(var(--trade-bottom-height) + var(--trade-safe-bottom) + 22px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-padding-bottom: calc(var(--trade-bottom-height) + var(--trade-safe-bottom) + 22px) !important;
    touch-action: pan-y !important;
  }

  body.srm-page .topline,
  body.srm-page.android-shell .topline {
    position: relative !important;
    top: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 58px !important;
    margin: 0 0 10px !important;
    padding: 9px 10px !important;
    gap: 8px !important;
  }

  html body.srm-page.android-shell .main > .topline {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: 36px 40px !important;
    min-height: 96px !important;
    padding: 9px 10px !important;
  }

  html body.srm-page.android-shell .main > .topline > div:first-child {
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: center !important;
    min-width: 0 !important;
  }

  html body.srm-page.android-shell .main > .topline .topline-tools {
    display: contents !important;
  }

  html body.srm-page.android-shell .main > .topline .top-interface-mode {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
  }

  html body.srm-page.android-shell .main > .topline .interface-mode-switch {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  html body.srm-page.android-shell .main > .topline .topline-tools > .actions {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: center !important;
    width: auto !important;
    min-width: 0 !important;
  }

  html body.srm-page.android-shell .main > .topline .help-context-button {
    min-width: 92px !important;
    min-height: 34px !important;
    padding: 6px 9px !important;
  }

  body.srm-page .topline h2,
  body.srm-page.android-shell .topline h2 {
    margin: 0 !important;
    min-height: 25px !important;
    font-size: 20px !important;
    line-height: 1.15 !important;
    overflow: visible !important;
  }

  html body.srm-page.android-shell #view-dashboard .dashboard-stats .stat > strong {
    min-height: 31px !important;
    line-height: 1.18 !important;
    overflow: visible !important;
  }

  html body.srm-page.android-shell #view-dashboard .quick-money-panel :where(h3, .money-fit) {
    min-height: 31px !important;
    line-height: 1.18 !important;
    overflow: visible !important;
  }

  body.srm-page .topline p,
  body.srm-page.android-shell .topline p {
    display: none !important;
  }

  body.srm-page .topline-tools,
  body.srm-page.android-shell .topline-tools {
    width: auto !important;
    min-width: 0 !important;
    gap: 5px !important;
  }

  body.srm-page .top-interface-mode > span,
  body.srm-page.android-shell .top-interface-mode > span {
    display: none !important;
  }

  body.srm-page .interface-mode-switch .btn,
  body.srm-page.android-shell .interface-mode-switch .btn {
    min-height: 34px !important;
    padding-inline: 8px !important;
    font-size: 10px !important;
  }

  body.srm-page .view:not(.hidden),
  body.srm-page.android-shell .view:not(.hidden) {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding-bottom: 18px !important;
    overflow: visible !important;
  }

  body.srm-page .tabs,
  body.srm-page.android-shell .tabs {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 10px !important;
    padding: 4px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
  }

  body.srm-page .tabs::-webkit-scrollbar {
    display: none !important;
  }

  body.srm-page .tabs button,
  body.srm-page.android-shell .tabs button {
    flex: 0 0 auto !important;
    min-width: 112px !important;
    min-height: 38px !important;
    padding: 7px 10px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }

  body.srm-page.nav-expanded .main {
    pointer-events: none;
  }

  /*
    The browser/compact Windows shell still carries the Stage 08 mobile
    selectors in the authoritative HTML. Keep this adapter more specific so
    the current single-scroller and fixed-drawer contract wins consistently.
  */
  body.srm-page.thin-trade-client:not(.android-shell) {
    height: 100% !important;
    min-height: 100% !important;
    overflow: hidden !important;
  }

  body.srm-page.thin-trade-client:not(.android-shell) .sidebar {
    display: grid !important;
    grid-template-columns: minmax(120px, 1fr) auto !important;
    grid-template-rows: auto !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 62px !important;
    max-height: none !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    overflow: visible !important;
    backdrop-filter: none !important;
    transform: none !important;
  }

  body.srm-page.thin-trade-client:not(.android-shell) .srm-shell-brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-height: 46px !important;
    max-height: 50px !important;
    padding: 5px 6px !important;
    overflow: hidden !important;
  }

  body.srm-page.thin-trade-client:not(.android-shell) .mobile-nav-toggle {
    display: none !important;
  }

  body.srm-page.thin-trade-client:not(.android-shell) .shift-box.as-nav-note {
    position: relative !important;
    inset: auto !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: 36px minmax(68px, auto) minmax(48px, auto) !important;
    grid-template-rows: 38px !important;
    grid-template-areas: "profile shift state" !important;
    align-items: stretch !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: min(48vw, 178px) !important;
    min-height: 0 !important;
    max-height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 4px !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.srm-page.thin-trade-client:not(.android-shell) .shift-box.as-nav-note :where(.sidebar-actions-row, #shiftMeta, #shiftEmail) {
    display: none !important;
  }

  body.srm-page.thin-trade-client:not(.android-shell) #nav {
    position: fixed !important;
    top: auto !important;
    left: 10px !important;
    right: 10px !important;
    bottom: calc(var(--trade-bottom-height) + var(--trade-safe-bottom) + 14px) !important;
    width: auto !important;
    height: min(66dvh, 420px) !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 12px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.srm-page.thin-trade-client:not(.android-shell) .main {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 10px 10px calc(var(--trade-bottom-height) + var(--trade-safe-bottom) + 22px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
}

@media (orientation: landscape) and (min-width: 721px) and (max-width: 1280px) {
  body.srm-page:not(.android-shell) .sidebar .quick-sync-button .quick-action-label {
    display: none !important;
  }

  body.srm-page:not(.android-shell) .sidebar .quick-sync-button::after {
    content: "Синхр.";
    font-size: 10px;
    line-height: 1;
  }
}

@media (max-width: 380px) {
  body.srm-page .sidebar,
  body.srm-page.android-shell .sidebar {
    grid-template-columns: minmax(106px, 1fr) auto !important;
    padding-inline: 8px !important;
  }

  body.srm-page .shift-box.as-nav-note,
  body.srm-page.android-shell .shift-box.as-nav-note {
    grid-template-columns: 34px minmax(58px, auto) minmax(44px, auto) !important;
    max-width: 154px !important;
  }

  body.srm-page .shift-box.as-nav-note .quick-profile-button {
    width: 34px !important;
    min-width: 34px !important;
  }

  body.srm-page .trade-bottom-nav {
    left: 6px;
    right: 6px;
    padding-inline: 4px;
  }

  body.srm-page .trade-bottom-nav span {
    font-size: 9px;
  }
}

@media (orientation: landscape) and (min-width: 721px) and (max-width: 1280px) {
  body.srm-page.android-shell .app {
    grid-template-columns: clamp(236px, 22vw, 252px) minmax(0, 1fr) !important;
    column-gap: 8px !important;
  }

  body.srm-page.android-shell .sidebar {
    padding: 9px 10px max(12px, calc(env(safe-area-inset-bottom) + 8px)) !important;
  }

  body.srm-page.android-shell .main {
    padding: 10px 12px max(18px, calc(env(safe-area-inset-bottom) + 12px)) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.srm-page #appRoot::before,
  body.srm-page #appRoot::after {
    animation: none !important;
    opacity: 0.1;
    transform: none;
  }

  body.srm-page.nav-expanded #nav {
    animation: none !important;
  }
}

/*
  Candidate 4.0.4.19: One UI-inspired icon geometry and compact shell cleanup.
  Keep the visual language original while using balanced 24 px outline geometry,
  neutral graphite containers and one predictable location for account actions.
*/
html body.srm-page #appRoot :is(.nav-icon, .quick-action-icon, .contact-icon-button, .device-website-card .panel-head > svg) {
  display: inline-grid !important;
  place-items: center !important;
  flex: 0 0 auto !important;
  padding: 0 !important;
  line-height: 1 !important;
  transform: none !important;
}

html body.srm-page #appRoot :is(.nav-icon, .quick-action-icon, .contact-icon-button) > svg,
html body.srm-page #appRoot .device-website-card .panel-head > svg {
  display: block !important;
  width: 19px !important;
  height: 19px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  transform: none !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  vector-effect: non-scaling-stroke;
}

html body.srm-page #appRoot .nav button > .nav-icon,
html body.srm-page.android-shell #appRoot .nav button > .nav-icon,
html body.srm-page #appRoot .trade-bottom-nav button > .nav-icon {
  display: grid !important;
  place-items: center !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--srm-text-secondary) !important;
  border: 1px solid var(--srm-border-subtle) !important;
  border-radius: 11px !important;
  background: linear-gradient(180deg, #171b21, #0d1014) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035), 0 5px 12px rgba(0, 0, 0, 0.2) !important;
}

html body.srm-page #appRoot .nav button.active > .nav-icon,
html body.srm-page.android-shell #appRoot .nav button.active > .nav-icon,
html body.srm-page #appRoot .trade-bottom-nav button.active > .nav-icon {
  color: var(--srm-text-primary) !important;
  border-color: rgba(207, 214, 224, 0.3) !important;
  background: linear-gradient(180deg, #252a32, #14181e) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), 0 7px 16px rgba(0, 0, 0, 0.27) !important;
}

html body.srm-page #appRoot :is(.quick-profile-button, .quick-support-button, .quick-sync-button, .contact-icon-button) {
  color: var(--srm-text-primary) !important;
  border-color: var(--srm-border-subtle) !important;
  background: linear-gradient(180deg, #1b2027, #101318) !important;
}

html body.srm-page #appRoot .contact-icon-button > svg {
  width: 18px !important;
  height: 18px !important;
}

/* Keep icon geometry and labels in separate, non-overlapping columns. */
html body.srm-page #appRoot .nav > button {
  grid-template-columns: 34px minmax(0, 1fr) auto !important;
  column-gap: 10px !important;
}

html body.srm-page #appRoot :is(.quick-support-button, .quick-sync-button) {
  gap: 6px !important;
}

html body.srm-page #appRoot :is(.quick-support-button, .quick-sync-button) > .quick-action-icon {
  display: inline-grid !important;
  place-items: center !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
}

html body.srm-page #appRoot :is(.quick-support-button, .quick-sync-button) > .quick-action-icon > svg {
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  transform: none !important;
}

/*
  Fit the complete payment workflow into common 768-900 px desktop/tablet
  heights without shrinking touch targets below the usable minimum.
*/
@media (min-width: 900px) and (max-height: 900px) {
  html body.srm-page:not(.android-shell) #view-pos .pos-payment-panel .panel-head {
    min-height: 48px !important;
    padding: 10px 14px !important;
  }

  html body.srm-page:not(.android-shell) #view-pos .pos-payment-panel .panel-body {
    gap: 9px !important;
    padding: 12px 14px !important;
  }

  html body.srm-page:not(.android-shell) #view-pos .payment-counterparty-card {
    min-height: 56px !important;
    padding: 9px 10px !important;
  }

  html body.srm-page:not(.android-shell) #view-pos .pos-loyalty-card {
    gap: 8px !important;
    padding: 10px !important;
  }

  html body.srm-page:not(.android-shell) #view-pos .pos-loyalty-card :is(input, button) {
    min-height: 34px !important;
    height: 34px !important;
  }

  html body.srm-page:not(.android-shell) #view-pos .pos-payment-panel > .panel-body > label {
    gap: 4px !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
  }

  html body.srm-page:not(.android-shell) #view-pos .pos-payment-panel > .panel-body > label > :is(input, select, textarea) {
    min-height: 36px !important;
    height: 36px !important;
    padding-block: 7px !important;
  }

  html body.srm-page:not(.android-shell) #view-pos .pos-payment-panel .total-box {
    gap: 6px !important;
    padding: 10px 12px !important;
  }
}

html body.srm-page #appRoot::before {
  opacity: 0.16 !important;
  filter: blur(34px) saturate(0.78) !important;
}

html body.srm-page #appRoot::after {
  opacity: 0.1 !important;
  filter: blur(48px) saturate(0.72) !important;
}

@media (max-width: 720px) {
  html body.srm-page #appRoot .sidebar,
  html body.srm-page.android-shell #appRoot .sidebar {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 46px !important;
    min-height: 62px !important;
  }

  html body.srm-page #appRoot .sidebar .shift-box.as-nav-note,
  html body.srm-page.android-shell #appRoot .sidebar .shift-box.as-nav-note {
    display: none !important;
  }

  html body.srm-page #appRoot #nav .nav-compact-account-actions,
  html body.srm-page.android-shell #appRoot #nav .nav-compact-account-actions {
    display: grid !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body.srm-page #appRoot::before,
  html body.srm-page #appRoot::after {
    animation: none !important;
  }
}

/*
  Candidate 4.0.4.19: graphite content flow.
  The workspace owns vertical scrolling. Reports and simplified trade views
  stay in normal document flow so cards, tables and controls cannot trap the
  mouse wheel or hide the final section.
*/
body.srm-page {
  --srm-accent: #aeb5c0;
  --srm-accent-hover: #c1c7d0;
  --srm-accent-pressed: #8f98a5;
  --srm-accent-subtle: rgba(174, 181, 192, 0.11);
  --srm-accent-border: rgba(190, 197, 207, 0.32);
  --srm-accent-text: #f2f4f7;
  --srm-border-interactive: rgba(190, 197, 207, 0.34);
  --primary: #aeb5c0 !important;
  --primary-2: #8f98a5 !important;
  --accent: #aeb5c0 !important;
  --accent2: #c1c7d0 !important;
  --accent-soft: rgba(174, 181, 192, 0.11) !important;
  --srm-blue: #aeb5c0 !important;
  --srm-cyan: #c1c7d0 !important;
  --button-gradient: linear-gradient(180deg, #2a2f37, #181c22) !important;
}

body.srm-page :where(
  .nav-icon,
  .dashboard-stat-icon,
  .dashboard-panel-icon,
  .integration-icon,
  .overview-card-icon
) {
  color: var(--srm-text-secondary) !important;
  border-color: var(--srm-border-subtle) !important;
  background: linear-gradient(180deg, #171b22, #0e1116) !important;
}

body.srm-page :where(
  .nav button.active .nav-icon,
  .trade-bottom-nav button.active .nav-icon,
  .overview-card-action:hover .overview-card-icon,
  .overview-card-action:focus-visible .overview-card-icon
) {
  color: var(--srm-text-primary) !important;
  border-color: var(--srm-border-interactive) !important;
  background: linear-gradient(180deg, #20252d, #14181e) !important;
}

body.srm-page :where(
  table thead th,
  .table-head,
  .simple-pos-cart-columns,
  .simple-pos-receipt-number
) {
  color: var(--srm-text-secondary) !important;
  -webkit-text-fill-color: var(--srm-text-secondary) !important;
}

body.srm-page .simple-pos-receipt-number {
  color: var(--srm-text-primary) !important;
  -webkit-text-fill-color: var(--srm-text-primary) !important;
  font-weight: var(--srm-font-weight-semibold);
}

body.srm-page .simple-pos-cart-columns {
  border-color: var(--srm-border-subtle) !important;
  background: #11151a !important;
}

body.srm-page .main .simple-pos-cart-columns > span {
  color: var(--srm-text-secondary) !important;
  -webkit-text-fill-color: var(--srm-text-secondary) !important;
}

/*
  The legacy inline theme used warm low-contrast colors on generic panel
  descendants. Keep semantic status markers intact while restoring readable
  typography throughout the active workspace.
*/
body.srm-page .main :is(.panel, .settings-card, .section-card) :is(p, span, small, label),
body.srm-page .main :is(.muted, .empty),
body.srm-page .main table :is(td, th) {
  color: var(--srm-text-secondary) !important;
  -webkit-text-fill-color: var(--srm-text-secondary) !important;
}

body.srm-page .main :is(h1, h2, h3, h4, strong, .title) {
  color: var(--srm-text-primary) !important;
  -webkit-text-fill-color: var(--srm-text-primary) !important;
}

html body.srm-page #appRoot .main :is(input, select, textarea),
html body.srm-page #appRoot .main .simple-pos-payment-fields :is(input, select),
html body.srm-page #appRoot .main .simple-return-filters :is(input, select) {
  color: var(--srm-text-primary) !important;
  -webkit-text-fill-color: var(--srm-text-primary) !important;
  border-color: var(--srm-border-subtle) !important;
  background: linear-gradient(180deg, #14181e, #0d1014) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025) !important;
}

body.srm-page.simple-trade-mode :is(
  .simple-pos-checkout,
  .simple-pos-summary,
  .simple-pos-customer,
  .simple-pos-empty,
  .simple-return-sales
) {
  border-color: var(--srm-border-subtle) !important;
  background: linear-gradient(180deg, #11151a, #0a0d11) !important;
}

html body.srm-page #appRoot :is(.btn.primary, button.primary, .simple-pos-pay) {
  color: var(--srm-text-primary) !important;
  -webkit-text-fill-color: var(--srm-text-primary) !important;
  border-color: var(--srm-border-interactive) !important;
  background: var(--button-gradient) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3), inset 0 1px rgba(255, 255, 255, 0.055) !important;
}

body.srm-page :where(
  .tag:not(.red):not(.gold),
  .badge:not(.danger):not(.warning),
  .pill:not(.danger):not(.warning),
  .status-badge:not(.danger):not(.warning)
) {
  color: var(--srm-text-secondary) !important;
  border-color: var(--srm-border-subtle) !important;
  background: var(--srm-surface-2) !important;
}

body.srm-page .main {
  overscroll-behavior-y: contain !important;
  scrollbar-gutter: stable;
  touch-action: pan-y;
}

body.srm-page.thin-trade-client #appRoot.app > .main {
  display: grid !important;
  grid-template-rows: auto !important;
  grid-auto-rows: max-content !important;
  align-content: start !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

body.srm-page .main:focus {
  outline: none;
}

body.srm-page .main:focus-visible {
  box-shadow: inset 0 0 0 2px var(--srm-border-interactive);
}

body.srm-page.simple-trade-mode .view:not(.hidden),
body.srm-page #view-reports:not(.hidden) {
  display: grid !important;
  align-content: start !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  contain: none !important;
  padding-bottom: max(34px, calc(var(--android-safe-bottom, 0px) + 24px)) !important;
}

body.srm-page #view-reports > .panel,
body.srm-page #view-reports > .panel > .report-scroll-body,
body.srm-page #view-reports > .panel > .panel-body,
body.srm-page #view-reports .report-scroll-body > .panel,
body.srm-page #view-reports .report-scroll-body > .report-payment-panel,
body.srm-page #view-reports .report-scroll-body > .panel > .panel-body,
body.srm-page #view-reports .report-payment-panel > .panel-body {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

body.srm-page #view-reports > .panel {
  display: block !important;
  height: max-content !important;
  min-height: max-content !important;
}

body.srm-page #view-reports > .panel > .report-scroll-body {
  display: grid !important;
  gap: 14px !important;
  padding-bottom: 24px !important;
  scroll-padding-bottom: 24px !important;
}

body.srm-page #view-reports :where(.table-wrap, .table-scroll) {
  max-height: none !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  overscroll-behavior-y: auto !important;
}

@media (max-width: 720px) {
  body.srm-page #appRoot.app > .main,
  body.srm-page.android-shell #appRoot.app > .main,
  body.srm-page.thin-trade-client:not(.android-shell) #appRoot.app > .main {
    grid-template-rows: auto minmax(0, 1fr) !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body.srm-page.simple-trade-mode .simple-pos-shell,
  body.srm-page.simple-trade-mode .simple-pos-workspace,
  body.srm-page.simple-trade-mode .simple-pos-cart,
  body.srm-page.simple-trade-mode .simple-pos-checkout {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: visible !important;
  }

  body.srm-page .topline {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    height: auto !important;
    min-height: 0 !important;
    gap: 8px !important;
  }

  body.srm-page .topline-tools {
    width: 100% !important;
    height: auto !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
  }

  body.srm-page .top-interface-mode {
    width: auto !important;
    flex: 1 1 auto !important;
  }

  body.srm-page .top-interface-mode > span {
    display: none !important;
  }

  body.srm-page .topline-tools .actions {
    width: auto !important;
    flex: 0 0 auto !important;
  }
}

/*
  Mobile web flow: the workspace is the only page scroller. Views and their
  panels contribute their natural height so the fixed navigation never hides
  the last controls.
*/
body.srm-page .browser-scanner-modal {
  width: min(92vw, 520px) !important;
  max-width: 520px !important;
}

body.srm-page .browser-scanner-body {
  display: grid !important;
  gap: 12px !important;
}

body.srm-page .browser-scanner-viewport {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--srm-border-default);
  border-radius: var(--srm-radius-lg);
  background: #050608;
}

body.srm-page .browser-scanner-viewport video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.srm-page .browser-scanner-frame {
  position: absolute;
  inset: 18%;
  pointer-events: none;
  border: 2px solid rgba(237, 240, 245, 0.86);
  border-radius: var(--srm-radius-md);
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.18);
}

body.srm-page .browser-scanner-status {
  min-height: 20px;
  margin: 0;
  color: var(--srm-text-secondary) !important;
  text-align: center;
}

body.srm-page #view-pos .universal-scan-button {
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
}

body.srm-page #view-pos .universal-scan-button svg {
  width: 18px !important;
  height: 18px !important;
}

body.srm-page #view-pos .simple-pos-commandbar {
  grid-template-columns: minmax(260px, 1fr) 42px auto auto !important;
}

@media (max-width: 720px) {
  html body.srm-page #appRoot.app > .main,
  html body.srm-page.android-shell #appRoot.app > .main,
  html body.srm-page.thin-trade-client:not(.android-shell) #appRoot.app > .main {
    display: block !important;
    box-sizing: border-box !important;
    align-self: start !important;
    height: calc(100% - var(--trade-bottom-height) - var(--trade-safe-bottom) - 12px) !important;
    min-height: 0 !important;
    max-height: calc(100% - var(--trade-bottom-height) - var(--trade-safe-bottom) - 12px) !important;
    padding-bottom: 30px !important;
    scroll-padding-bottom: 30px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch;
  }

  html body.srm-page #appRoot.app > .main > .topline {
    margin-bottom: 10px !important;
  }

  html body.srm-page #appRoot.app > .main > .view:not(.hidden),
  html body.srm-page #view-dashboard:not(.hidden),
  html body.srm-page #view-stock:not(.hidden),
  html body.srm-page #view-reports:not(.hidden) {
    display: grid !important;
    align-content: start !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding-bottom: 24px !important;
    overflow: visible !important;
    contain: none !important;
  }

  html body.srm-page :is(#view-dashboard, #view-stock, #view-reports) :where(
    .panel,
    .panel-body,
    .grid,
    .dashboard-grid,
    .report-scroll-body,
    .report-payment-panel,
    .stock-shell-panel,
    .acceptance-shell-panel
  ) {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: visible !important;
  }

  html body.srm-page :is(#view-dashboard, #view-stock, #view-reports) :where(.table-wrap, .table-scroll) {
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
  }

  html body.srm-page #view-reports > .panel > .report-scroll-body {
    padding-bottom: 36px !important;
    scroll-padding-bottom: 36px !important;
  }

  html body.srm-page #nav,
  html body.srm-page.android-shell #nav,
  html body.srm-page.thin-trade-client:not(.android-shell) #nav {
    top: max(76px, calc(env(safe-area-inset-top, 0px) + 66px)) !important;
    bottom: calc(var(--trade-bottom-height) + var(--trade-safe-bottom) + 12px) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding-bottom: 18px !important;
  }

  html body.srm-page.android-shell #nav {
    top: max(112px, calc(env(safe-area-inset-top, 0px) + 104px)) !important;
  }

  html body.srm-page #view-pos .pos-loyalty-head {
    align-items: center !important;
    gap: 8px !important;
  }

  html body.srm-page #view-pos .universal-scan-button {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
  }

  html body.srm-page #view-pos .universal-scan-button svg {
    width: 17px !important;
    height: 17px !important;
  }

  html body.srm-page #view-pos .simple-pos-commandbar {
    grid-template-columns: minmax(0, 1fr) 38px !important;
  }

  html body.srm-page #view-pos .simple-pos-commandbar > [data-action="open-customer-display"],
  html body.srm-page #view-pos .simple-pos-commandbar > .simple-pos-receipt-number {
    grid-column: 1 / -1 !important;
  }
}
/* Price-label editor shell; the printable card itself is owned by the WYSIWYG module. */
.label-editor-layout {
  align-items: start;
  grid-template-columns: minmax(320px, .8fr) minmax(360px, 1.2fr);
}

.label-editor-toolbar,
.label-batch-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.label-batch-banner {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(167, 181, 197, .24);
  border-radius: 8px;
  background: rgba(22, 27, 34, .92);
}

.label-batch-banner strong {
  display: block;
  color: #f7f9fb;
}

.label-batch-banner span {
  color: #b7c0ca;
}

.label-preview-viewport {
  width: 100%;
  max-height: min(70vh, 760px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(167, 181, 197, .18);
  border-radius: 8px;
  background: #0b0d10;
}

.saved-label-item {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.saved-label-item .label-preview-viewport {
  max-height: 420px;
}

.label-unit-hint {
  color: #9fa9b4;
  font-size: 12px;
}

@media (max-width: 900px) {
  .label-editor-layout {
    grid-template-columns: 1fr;
  }
}

/* Keep the mobile trade header readable after all shell compatibility rules. */
@media (max-width: 720px) {
  html body.srm-page.android-shell #appRoot.app > .main > .topline {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    min-height: 0 !important;
  }

  html body.srm-page.android-shell #appRoot.app > .main > .topline > div:first-child {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  html body.srm-page.android-shell #appRoot.app > .main > .topline .topline-tools {
    grid-column: 1 !important;
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    gap: 6px !important;
  }

  html body.srm-page.android-shell #appRoot.app > .main > .topline .top-interface-mode {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 5px !important;
  }

  html body.srm-page.android-shell #appRoot.app > .main > .topline .interface-mode-switch {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  html body.srm-page.android-shell #appRoot.app > .main > .topline .interface-mode-switch .btn {
    width: 100% !important;
    min-width: 0 !important;
    padding: 6px 5px !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    writing-mode: horizontal-tb !important;
  }

  html body.srm-page.android-shell #appRoot.app > .main > .topline .topline-tools > .actions {
    grid-column: 1 !important;
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 6px !important;
  }

  html body.srm-page.android-shell #appRoot.app > .main > .topline .topline-tools > .actions .btn {
    width: 100% !important;
    min-width: 0 !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 720px) {
  html body.srm-page #appRoot.app > .main > .topline {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    min-height: 0 !important;
  }

  html body.srm-page #appRoot.app > .main > .topline .topline-tools {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 6px !important;
  }

  html body.srm-page #appRoot.app > .main > .topline .top-interface-mode {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 5px !important;
  }

  html body.srm-page #appRoot.app > .main > .topline .interface-mode-switch {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
  }

  html body.srm-page #appRoot.app > .main > .topline .interface-mode-switch .btn {
    width: 100% !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    writing-mode: horizontal-tb !important;
  }

  html body.srm-page #appRoot.app > .main > .topline .topline-tools > .actions {
    grid-column: 1 !important;
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 6px !important;
  }

  html body.srm-page #appRoot.app > .main > .topline .topline-tools.actions-before-mode {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    width: 100% !important;
  }

  html body.srm-page #appRoot.app > .main > .topline .topline-tools.actions-before-mode > .top-interface-mode {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
  }

  html body.srm-page #appRoot.app > .main > .topline .topline-tools.actions-before-mode > .actions {
    grid-column: 1 !important;
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
  }
}
