/* Riven Mail — phone-first layer (Batch 1). Safe-area, 44px targets, bottom nav, FAB. */
:root { --rm-safe-b: env(safe-area-inset-bottom, 0px); --rm-safe-t: env(safe-area-inset-top, 0px); }
@media (max-width: 760px) {
  body { padding-top: var(--rm-safe-t); }
  button, [role="button"], a.btn, .btn, .icon-btn, .toolbar button { min-height: 44px; min-width: 44px; }
  .undo-bar { bottom: calc(12px + var(--rm-safe-b)); }
  .toast-root { bottom: calc(74px + var(--rm-safe-b)); }
  #rm-bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000;
    display: flex; justify-content: space-around; align-items: stretch;
    padding: 4px 4px calc(4px + var(--rm-safe-b)); background: var(--surface, #F2F6F7);
    border-top: 1px solid rgba(22,33,38,.12); backdrop-filter: blur(8px);
  }
  #rm-bottom-nav button {
    flex: 1; background: transparent; border: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px; font: 11px/1.1 Satoshi, system-ui, sans-serif;
    color: var(--muted, #546064); min-height: 48px;
  }
  #rm-bottom-nav button[aria-current="page"] { color: var(--magenta, #EC008C); font-weight: 700; }
  body { padding-bottom: calc(58px + var(--rm-safe-b)); }
  #rm-fab {
    position: fixed; right: 16px; bottom: calc(70px + var(--rm-safe-b)); z-index: 9001;
    width: 56px; height: 56px; border-radius: 16px; border: 0; background: var(--magenta, #EC008C);
    color: #fff; font-size: 26px; line-height: 1; box-shadow: 0 6px 18px rgba(22,33,38,.25);
  }
}
@media (display-mode: standalone) { body { overscroll-behavior-y: contain; } }

/* Mobile: tenant/org switcher collapses under 640px; no fixed-width overflow. */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; max-width: 100vw; }
  #tenant-switcher-bar, .topbar-account { display: none !important; }
  .switcher-select, .mailbox-select { min-width: 0 !important; max-width: 100%; }
  .topbar-search { flex: 1 1 100%; min-width: 0; }
  .topbar-brand-titles, .topbar-wordmark { min-width: 0; }
  .app-shell, .main, .list-pane, .reading-pane { min-width: 0; max-width: 100%; }
  html, body { overflow-x: hidden; }
}
