/* Phone fit for the classic TECHSAVE pages (loaded from pwa_head.html). */
@media (max-width: 760px) {
  /* Two-column report grids collapse to one; wide tables scroll inside their card, not the page. */
  .grid2, .analytics-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .grid2 > *, .analytics-grid > *, .ts-split > * { min-width: 0; }
  .accounting-table-section, .report-table-section, .app-content .ts-card:has(> table), .app-content .ts-table-card, .table-wrap {
    max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .app-content { overflow-x: hidden; }
}

/* Installed app (home-screen icon): clear the status bar and add the app tab bar. */
html.ts-standalone .app-topbar { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
html.ts-standalone .sidebar { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
html.ts-standalone body:not(:has(.app-topbar)) { padding-top: env(safe-area-inset-top); }
html.ts-standalone.ts-has-tabs body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

.ts-apptabs { display: none; }
html.ts-standalone .ts-apptabs {
  position: fixed; left: 0; right: 0; bottom: calc(-1 * var(--ts-gap, 0px)); z-index: 1200;
  display: flex; justify-content: space-around; align-items: flex-start;
  padding: 6px 6px max(8px, calc(env(safe-area-inset-bottom) - 10px));
  background: #121418; -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid rgba(255, 255, 255, .08);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}
.ts-apptabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; color: #7b828d; font-size: 10.5px; font-weight: 600; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.ts-apptabs a:active { transform: scale(.92); }
.ts-apptabs svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ts-apptabs .sell { color: #f2f4f7; }
.ts-apptabs .sell b { display: grid; place-items: center; width: 44px; height: 30px; border-radius: 12px; background: #7c6cff; color: #fff; margin-bottom: -1px; }
.ts-apptabs .sell b svg { width: 20px; height: 20px; stroke-width: 2.6; }
.ts-apptabs a.on { color: #a99fff; }

.ts-apptabs a { justify-content: flex-start; height: 50px; padding: 4px 0 0; line-height: 14px; }
.ts-apptabs svg { margin: 2.5px 0; flex: none; }
.ts-apptabs .sell b { margin: 0; flex: none; }
.ts-apptabs .sell b svg { margin: 0; }
.ts-apptabs a:active { transform: none; opacity: .6; }

/* Pre-Orders & Bookings: the phone card layout needs rows to grow (a global 39px row height clipped them). */
@media (max-width: 960px) {
  #app-content .preorder-table-card .preorder-table, .preorder-table-card .preorder-table { overflow: visible !important; height: auto !important; }
  #app-content .preorder-table-card .preorder-table tr, .preorder-table-card .preorder-table tr { height: auto !important; }
}
