/* Compact Pro (≤1100): overflow tabs go to More so the top bar stays one row.
   Phone Pro (≤700) also pins that five-slot bar to the bottom. */
@media (max-width: 1100px) {
  body.pro #tab-b2b,
  body.pro #tab-mailings,
  body.pro #tab-settings,
  body.pro #tab-platform,
  body.pro #tab-docs { display: none !important; }
  body.pro #tab-more { display: inline-flex !important; }
}
@media (max-width: 700px) {
  body.pro #tabs {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    gap: 0;
    margin: 0;
    flex-wrap: nowrap;
    overflow: visible;
    background: var(--tg-theme-bg-color, #fff);
    border-top: 1px solid var(--app-border, var(--tg-theme-hint-color, #e2e2e2));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: 0 -8px 24px rgba(18, 31, 53, .08);
    padding: 5px max(4px, env(safe-area-inset-left))
      calc(5px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-right));
  }
  body.pro #tabs .tab,
  body.pro.focus-workspace #tabs .tab {
    flex: 1 1 0;
    width: auto;
    min-width: 54px;
    max-width: none;
    min-height: 48px;
    flex-direction: column;
    gap: 2px;
    padding: 5px 2px;
    border-radius: 8px;
    background: none;
    color: var(--ui-muted-strong, #3f4b5a);
    font-size: 10px;
    line-height: 1.15;
    font-weight: 500;
    white-space: normal;
    overflow: visible;
  }
  body.pro #tabs .tab .ti { font-size: 21px; }
  body.pro #tabs .tab .tl {
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    font-size: 10px;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
  }
  body.pro #tabs .tab.active {
    background: none;
    font-weight: 600;
    color: var(--tg-theme-link-color, #3390ec);
    box-shadow: none;
  }
  body.pro #tab-deals { order: 1; }
  body.pro #tab-ledger { order: 2; }
  body.pro #tab-dash { order: 3; }
  body.pro #tab-refs { order: 4; }
  body.pro #tab-more { order: 5; }
  body.pro #tab-dash .ti {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #fff);
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    min-width: 34px;
    min-height: 34px;
    overflow: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -6px;
    box-shadow: 0 2px 6px rgba(51, 144, 236, .35);
    font-size: 18px;
  }
  body.pro #tab-dash .ti .ph-icon { width: 18px; height: 18px; }
  body.pro #tab-dash.active .ti { box-shadow: 0 2px 9px rgba(51, 144, 236, .55); }
  body.pro {
    scroll-padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }
  body.pro:not([data-view="dash"]),
  body.pro.cabinet-nav {
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }
  body.pro #more-sheet,
  body.pro #choice-sheet {
    bottom: calc(86px + env(safe-area-inset-bottom));
  }
  body.pro.deal-form-open #tabs {
    visibility: hidden;
    pointer-events: none;
  }
}
@media (min-width: 701px) {
  body.pro #more-sheet,
  body.pro #choice-sheet { bottom: env(safe-area-inset-bottom); }
}
@media (min-width: 1101px) {
  body.pro #tab-more { display: none !important; }
}
body.cabinet-nav #tab-dash,
body.cabinet-nav #tab-deals,
body.cabinet-nav #tab-ledger,
body.cabinet-nav #tab-refs,
body.cabinet-nav #tab-b2b,
body.cabinet-nav #tab-mailings,
body.cabinet-nav #tab-settings,
body.cabinet-nav #tab-platform,
body.cabinet-nav #tab-docs,
body.cabinet-nav #tab-more { display: none !important; }
body.cabinet-nav .personal-tabs { display: none !important; }
body.cabinet-nav #tabs [data-cabinet-tab] { order: 0; }
#more-sheet .ms-chrome {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--app-border, var(--tg-theme-hint-color, #e2e2e2));
}
#more-sheet .ms-chrome-label {
  font-size: 12px;
  color: var(--ui-muted-strong, #4a5560);
}
#more-sheet .ms-chrome .help-q {
  min-width: 44px;
  min-height: 44px;
}
