/*
 * CNC LLP staff dashboard: phone and tablet layout.
 * Kept apart from brand.css on purpose: brand.css is the desktop design and is not changed;
 * everything for phones and tablets lives here, loaded after it (dashboard_base.html).
 * Helpers: static/dashboard/assets/js/mobile.js. A computer with a mouse never gets these rules,
 * whatever its window size, except the narrow-window layout below 768px.
 *
 * Three parts:
 *   1. Touch screens, any size: 16px text in fields (iPhones and iPads zoom into smaller text)
 *   2. Phones and touch tablets (<= 767px, or touch screens <= 1199px): card tables, folding
 *      filters, finger-sized tap targets, swipeable tabs; tablets get two cards per row
 *   3. Narrow screens only (<= 767px): spacing, full-screen form dialogs, top bar and menu drawer
 *      (tablets keep the theme's own collapsed sidebar)
 *
 * Card tables:  table.table-cards shows each row as a card. mobile.js copies each column heading
 *               into its cells' data-label, which is shown as the label.
 *               td.tc-title   the row's name: first, larger, no label
 *               td.tc-actions buttons: last, right-aligned, no label
 *               td.tc-hide    hidden in cards (row numbers)
 *               (empty "—" cells are hidden automatically; cells spanning columns get no label)
 * Filters:      form.filter-bar keeps search and the submit buttons visible; the other filters
 *               fold behind a "Filters" button (mobile.js). .fb-keep keeps a field visible.
 */

.topbar-brand,
.drawer-profile,
.drawer-footer,
.fb-sheet,
.fb-backdrop,
.users-table .user-avatar,
.users-table .user-more-groups,
.users-table .user-actions-menu,
.icon-tabs .tab-label-short {
  display: none;
}

/* ── 1. Touch screens ───────────────────────────────────────── */

@media (pointer: coarse), (max-width: 767.98px) {
  /* 16px text in fields, so iPhones don't zoom in when one is tapped */
  .form-control,
  .form-select,
  .input-group-text,
  .dataTables_wrapper .dataTables_filter input,
  .dataTables_wrapper .dataTables_length select {
    font-size: 16px;
  }
}

/* ── 2. Phones and touch tablets ───────────────────────────── */

@media (max-width: 767.98px), (pointer: coarse) and (max-width: 1199.98px) {
  /* Pop-up text boxes (SweetAlert prompts, e.g. Change password) */
  .swal2-input,
  .swal2-textarea,
  .swal2-select {
    font-size: 16px !important;
  }

  /* Finger-sized tap targets */
  .btn-action {
    width: 40px;
    height: 40px;
  }

  /* Buttons and fields 44px tall (Apple's minimum for touch; Google asks for 48) */
  .btn:not(.btn-link):not(.btn-close):not(.btn-action),
  .form-control:not(textarea),
  .form-select,
  .dataTables_wrapper .dt-buttons .dt-button {
    min-height: 44px;
  }

  /* Small fields stay 16px (part 1); small buttons get readable 14px text, and icon-only ones
     (e.g. "Remove access" in Mail settings) are at least 40px wide */
  .btn-sm {
    min-width: 40px;
    font-size: 0.875rem;
  }

  /* Page numbers readable (the small pager's text is 11px), and a long pager wraps onto a second
     row instead of running past the card */
  .pagination .page-link {
    font-size: 0.875rem;
  }

  .pagination {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.4rem;
  }

  .table-footer {
    justify-content: center;
  }

  /* DataTables list controls: the "Show 10 entries" picker is hidden, and the search box spans the
     row with a placeholder instead of the "Search:" label (mobile.js adds the placeholder) */
  .dataTables_wrapper .dataTables_length {
    display: none;
  }

  .dataTables_wrapper .dataTables_filter label {
    font-size: 0;
  }

  .dataTables_wrapper .dataTables_filter input {
    font-size: 16px;
    width: 100%;
  }

  /* Activity timeline: company and record links */
  .timeline-meta a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }

  /* Mail settings: signature boxes ("html body" outranks the page's own <style>) */
  html body .mset-signature {
    font-size: 16px;
  }

  .count-pill {
    min-height: 36px;
  }

  .pagination .page-link {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .form-check-input,
  .custom-control-input,
  html body .register-groups .form-check input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
  }

  /* Small edit buttons inside detail lists (company page): "html body" outranks the page's own
     <style>, which comes later in the document */
  html body .detail-list dd .btn-action {
    width: 40px;
    height: 40px;
    font-size: 0.875rem;
  }

  /* Tick boxes: the whole row, label included, is the tap target */
  .form-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 40px;
    padding-left: 0;
  }

  .form-check .form-check-input,
  html body .register-groups .form-check input[type="checkbox"] {
    float: none;
    margin: 0;
    flex-shrink: 0;
  }

  .form-check .form-check-label {
    flex: 1;
    padding: 0.4rem 0;
  }

  /* Links people tap on a phone: call, email, back, and "View" links in detail lists */
  a[href^="tel:"],
  a[href^="mailto:"],
  .back-link,
  .detail-list dd a,
  .sales-name-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }

  /* Year-wise documents tree (company Documents tab): each file's Download and Delete icons */
  .year-tree-file {
    min-height: 40px;
  }

  .year-tree-file > a.ms-auto,
  .year-tree-file .delete-form .btn,
  .year-tree summary .ms-auto > a,
  .year-tree summary .delete-form .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    margin-left: 0 !important;
  }

  .year-tree summary .ms-auto.gap-2 {
    gap: 0 !important;
  }

  /* Documents tab: document and file names wrap instead of being cut off with "…"
     (the search script still finds them by the same classes) */
  #documents .text-truncate {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    min-width: 0;
  }

  .year-tree-file > a.text-truncate {
    flex: 1 1 auto;
  }

  .sales-name-link.sales-wrap {
    display: inline-block;
    min-height: 0;
    padding: 0.55rem 0;
  }

  /* The menu button is always three lines (the theme turns it into an arrow) */
  body:not(.vertical-sidebar-enable) .hamburger-icon.open {
    transform: none;
  }

  body:not(.vertical-sidebar-enable) .hamburger-icon.open span {
    left: 0;
    transform: none;
    transition-delay: 0s;
  }

  body:not(.vertical-sidebar-enable) .hamburger-icon.open span:nth-child(1) { top: 0; width: 80%; }
  body:not(.vertical-sidebar-enable) .hamburger-icon.open span:nth-child(2) { top: 6px; width: 100%; }
  body:not(.vertical-sidebar-enable) .hamburger-icon.open span:nth-child(3) { top: auto; bottom: 0; width: 60%; }

  /* Tabs stay on one row and scroll sideways */
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tabs .nav-item {
    flex: 0 0 auto;
    margin-left: 0 !important;
  }

  .nav-tabs .nav-link {
    white-space: nowrap;
  }

  /* Card tables */
  table.table-cards,
  table.table-cards > tbody {
    display: block;
    width: 100% !important;
  }

  table.table-cards > thead {
    display: none;
  }

  table.table-cards > tbody > tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 0.5rem;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    background: var(--brand-surface);
  }

  table.table-cards > tbody > tr[hidden] {
    display: none;
  }

  table.table-cards > tbody > tr > td {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: baseline;
    width: 100%;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0.3rem 0 !important;
    border: 0 !important;
    background: transparent !important;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  table.table-cards > tbody > tr > td::before {
    content: attr(data-label);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand-muted);
  }

  table.table-cards > tbody > tr > td > * {
    grid-column: 2;
    justify-self: start;
  }

  table.table-cards > tbody > tr > td > .tc-value {
    justify-self: stretch;
    min-width: 0;
  }

  /* A dropdown + button form inside a list row (e.g. "Assign CA" on Success and Document
     Verification): the dropdown takes the room left, the button keeps its label on one line, and
     they wrap if there isn't room for both. "html body" outranks the pages' own min-widths. */
  html body td form.d-flex:has(> .form-select) {
    flex-wrap: wrap;
  }

  html body td form.d-flex:has(> .form-select) > .form-select {
    flex: 1 1 8rem;
    width: auto;
    min-width: 0 !important;
  }

  html body td form.d-flex:has(> .form-select) > .btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  table.table-cards .tc-value > .status-pill,
  table.table-cards .tc-value > .count-pill {
    margin: 0 0.25rem 0.25rem 0;
  }

  table.table-cards > tbody > tr > td.tc-title {
    display: block;
    order: -1;
    font-size: 1rem;
    padding-bottom: 0.4rem !important;
  }

  table.table-cards > tbody > tr > td.tc-full,
  table.table-cards > tbody > tr > td.dataTables_empty {
    display: block;
  }

  table.table-cards > tbody > tr > td.dataTables_empty {
    text-align: center !important;
    color: var(--brand-muted);
  }

  table.table-cards > tbody > tr > td.dataTables_empty::before {
    content: none;
  }

  table.table-cards > tbody > tr > td.tc-actions {
    display: flex;
    order: 10;
    width: auto;
    gap: 0.5rem;
    justify-content: flex-end;
    padding-top: 0.6rem !important;
  }

  table.table-cards > tbody > tr > td.tc-actions:first-of-type,
  table.table-cards > tbody > tr > td:not(.tc-actions) + td.tc-actions {
    margin-left: auto;
  }

  table.table-cards > tbody > tr > td.tc-title::before,
  table.table-cards > tbody > tr > td.tc-full::before,
  table.table-cards > tbody > tr > td.tc-actions::before {
    content: none;
  }

  table.table-cards > tbody > tr > td.tc-hide,
  table.table-cards > tbody > tr > td.tc-empty {
    display: none;
  }

  /* Bootstrap's hover shading "sticks" after a tap on touch screens and greys out a card */
  table.table-cards > tbody > tr > td {
    box-shadow: none !important;
  }

  /* User Management: one short row per user, like a phone's contact list.
       (M) Name                ⋮
           email
           [first group] +N more
     The referral and the three actions are in the ⋮ menu. */
  table.table-cards.users-table > tbody {
    display: block;
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--brand-surface);
  }

  table.table-cards.users-table > tbody > tr {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    column-gap: 0.75rem;
    row-gap: 0.15rem;
    align-items: center;
    margin: 0;
    padding: 0.7rem 0.75rem 0.7rem 0.9rem;
    border: 0;
    border-bottom: 1px solid var(--brand-border);
    border-radius: 0;
  }

  table.table-cards.users-table > tbody > tr:last-child {
    border-bottom: 0;
  }

  table.table-cards.users-table > tbody > tr > td {
    display: block;
    width: auto;
    padding: 0 !important;
  }

  table.table-cards.users-table > tbody > tr > td::before,
  table.table-cards.users-table > tbody > tr > td.user-referral,
  table.table-cards.users-table > tbody > tr > td.tc-hide,
  table.table-cards.users-table > tbody > tr > td.tc-empty {
    content: none;
    display: none;
  }

  table.table-cards.users-table > tbody > tr > td.user-name-cell {
    grid-column: 1 / 3;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 !important;
    font-size: 0.95rem;
  }

  table.table-cards.users-table .user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: 700;
    background: var(--tone-info-bg);
    color: var(--tone-info-fg);
  }

  table.table-cards.users-table > tbody > tr > td.user-email {
    grid-column: 2;
    grid-row: 2;
    font-size: 0.8125rem;
    color: var(--brand-muted);
  }

  table.table-cards.users-table > tbody > tr > td.user-groups {
    grid-column: 2;
    grid-row: 3;
    margin-top: 0.2rem;
  }

  /* first group, then "+N more" */
  table.table-cards.users-table .user-groups .status-pill ~ .status-pill {
    display: none;
  }

  /* "+N more" is a button: tapping it shows every group in the row ("Show less" folds them again) */
  table.table-cards.users-table .user-more-groups {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin-left: 0.15rem;
    padding: 0 0.5rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  table.table-cards.users-table .user-groups.show-all-groups .status-pill ~ .status-pill {
    display: inline-flex;
  }

  table.table-cards.users-table .user-groups.show-all-groups .tc-value {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  table.table-cards.users-table .user-groups.show-all-groups .status-pill {
    margin: 0;
  }

  table.table-cards.users-table > tbody > tr > td.tc-actions {
    grid-column: 3;
    grid-row: 1 / span 3;
    align-self: center;
    margin: 0;
    padding: 0 !important;
  }

  table.table-cards.users-table .user-action-button {
    display: none !important;
  }

  table.table-cards.users-table .user-actions-menu {
    display: block;
  }

  table.table-cards.users-table .user-actions-menu .dropdown-item {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Engagements In Process: a compact work-queue card per engagement.
       GST Annual Return GSTR-9            Day 38
       DEMO - Sri Balaji Traders
       UQID · FY 25-26
       (B) bharath
       05 Oct 2026 → —           [💬 1 open] [👁] */
  table.wq-table,
  table.wq-table > tbody {
    display: block;
    width: 100% !important;
  }

  table.wq-table > thead {
    display: none;
  }

  table.wq-table > tbody > tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "main  main    days"
      "ca    ca      ca"
      "dates queries view";
    column-gap: 0.5rem;
    row-gap: 0.45rem;
    align-items: center;
    padding: 0.8rem 0.9rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    background: var(--brand-surface);
  }

  table.wq-table > tbody > tr[hidden] {
    display: none;
  }

  table.wq-table > tbody > tr > td {
    display: block;
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: left !important;
  }

  table.wq-table .wq-main { grid-area: main; align-self: start; overflow-wrap: anywhere; }
  table.wq-table .wq-days-cell { grid-area: days; align-self: start; text-align: right !important; }
  table.wq-table .wq-ca-cell { grid-area: ca; font-size: 0.875rem; }
  table.wq-table .wq-dates { grid-area: dates; font-size: 0.8125rem; white-space: normal; color: var(--brand-muted); }
  table.wq-table .wq-queries-cell { grid-area: queries; }
  table.wq-table .wq-view-cell { grid-area: view; }

  table.wq-table .wq-name {
    font-size: 1rem;
    line-height: 1.3;
  }

  table.wq-table .wq-days {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--tone-neutral-bg);
    font-size: 0.8125rem;
  }

  table.wq-table .wq-days.is-long {
    background: var(--tone-warning-bg);
  }

  table.wq-table .wq-dates br {
    display: none;
  }

  table.wq-table .wq-dates .status-pill {
    margin: 0 0 0 0.35rem;
  }

  table.wq-table .wq-query-btn,
  table.wq-table .btn-action {
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
  }

  html body .wq-search {
    max-width: none;
    margin-bottom: 0.75rem;
  }

  /* Filters, like a food-delivery app (mobile.js builds it):
       [🔍 Search ...              ]  slim search bar, no label, no grey box
       (⚙ Filters 2) (Clear)          chips
     "Filters" opens a bottom sheet with the other filters, "Clear all" and "Apply". */
  html body .filter-bar.fb-ready {
    background: none;
    border: 0;
    padding: 0;
    margin-bottom: 0.75rem !important;
    row-gap: 0.6rem;
  }

  .filter-bar.fb-ready > .fb-search-col,
  .filter-bar.fb-ready > .fb-kept-col,
  .filter-bar.fb-ready > .fb-chips {
    flex: 0 0 100%;
    max-width: 100%;
    margin-top: 0;
    padding: 0;
  }

  .filter-bar.fb-ready > .fb-submit-col {
    display: none !important;
  }

  .filter-bar.fb-ready .fb-search-col .form-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  /* the search bar: one rounded line, icon inside */
  .filter-bar.fb-ready .fb-search-col .input-group {
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    background: var(--brand-surface);
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
    overflow: hidden;
  }

  .filter-bar.fb-ready .fb-search-col .input-group-text,
  .filter-bar.fb-ready .fb-search-col .form-control {
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .filter-bar.fb-ready .fb-search-col .input-group-text {
    padding-right: 0.25rem;
  }

  .filter-bar.fb-ready .fb-search-col .input-group:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-tint);
  }

  /* buttons inside the search bar: × clears, → searches (mobile.js shows each only when it does something) */
  .fb-search-clear,
  .fb-search-go {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .fb-search-clear[hidden],
  .fb-search-go[hidden] {
    display: none;
  }

  .fb-search-clear {
    color: var(--brand-muted);
    font-size: 1rem;
  }

  .fb-search-go::before {
    content: "";
    position: absolute;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-primary);
  }

  .fb-search-go {
    position: relative;
    margin-right: 2px;
    color: #fff;
    font-size: 0.95rem;
  }

  .fb-search-go i {
    position: relative;
  }

  /* chips */
  /* chips wrap onto a second line rather than running off the screen (dates + Filters + Clear) */
  .fb-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }

  /* hints about the desktop table (column headers) mean nothing on a phone's cards */
  .desktop-hint {
    display: none;
  }

  /* every chip (button, link or dropdown) the same 44px pill on one line: a <label> chip brought
     Bootstrap's 8px bottom margin, which made the row taller and the chips uneven */
  .fb-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0 0.9rem;
    line-height: 1;
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    background: var(--brand-surface);
    color: var(--brand-heading);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
  }

  /* a chip that is a dropdown (a page with just one filter): the real select covers it, unseen */
  .fb-select-chip {
    position: relative;
    max-width: 100%;
    overflow: hidden;
  }

  .fb-select-chip > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .fb-select-chip .fb-caret {
    font-size: 0.7rem;
  }

  .fb-select-chip > select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    opacity: 0;
    font-size: 16px;   /* no zoom on iPhone */
    cursor: pointer;
  }

  .fb-chip.is-active {
    border-color: var(--brand-primary);
    background: var(--brand-primary-tint);
    color: var(--brand-primary);
  }

  .fb-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--brand-primary);
    color: #fff;
  }

  /* a page with this search bar doesn't need DataTables' second "Search this list" box as well */
  .card-body:has(.filter-bar.fb-ready .fb-search-col) .dataTables_filter {
    display: none;
  }

  .fb-sheet:focus {
    outline: none;
  }

  /* bottom sheet */
  /* margin/padding 0: the sheet and backdrop sit in a Bootstrap .row, whose ".row > *" gutters
     would otherwise leave an undimmed strip at the top that doesn't close the sheet */
  .fb-backdrop {
    position: fixed;
    inset: 0;
    margin: 0;
    padding: 0;
    touch-action: none;
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1055;
    background: rgba(16, 24, 40, 0.45);
  }

  .fb-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    z-index: 1056;
    flex-direction: column;
    max-height: 85vh;
    max-height: 85dvh;
    border-radius: 16px 16px 0 0;
    background: var(--brand-surface);
    color: var(--brand-text);
    box-shadow: 0 -8px 24px rgba(16, 24, 40, 0.18);
  }

  /* the sheet slides up from the bottom and back down; hidden (visibility) once it has slid away */
  .fb-sheet {
    display: flex;
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.28s;
  }

  .fb-sheet.is-open {
    transform: none;
    visibility: visible;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s;
  }

  .fb-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  /* the page behind an open sheet is pinned where it was (mobile.js sets top and restores the scroll) */
  body.fb-sheet-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
  }

  .fb-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.75rem 0.5rem 1.1rem;
    border-bottom: 1px solid var(--brand-border);
  }

  .fb-sheet-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand-heading);
  }

  .fb-sheet-close {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--brand-text);
    font-size: 1.1rem;
  }

  .fb-sheet-body {
    overflow-y: auto;
    overscroll-behavior: contain;   /* scrolling to the end of the sheet doesn't carry on into the page */
    padding: 1rem 1.1rem 0.25rem;
  }

  .fb-sheet-body > * {
    flex: none;
    width: 100%;
    max-width: 100%;
    margin: 0 0 1rem;
    padding: 0;
  }

  /* Dates sheet: quick ranges as tappable chips, then a custom From / To */
  .fb-ranges {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 1.1rem;
  }

  .fb-range {
    min-height: 44px;
    padding: 0 0.25rem;
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    background: var(--brand-surface);
    color: var(--brand-heading);
    font-size: 0.9rem;
    font-weight: 500;
  }

  .fb-range.is-active {
    border-color: var(--brand-primary);
    background: var(--brand-primary-tint);
    color: var(--brand-primary);
    font-weight: 600;
  }

  .fb-sheet-subtitle {
    margin-bottom: 0.6rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-muted);
  }

  /* range calendar (mobile.js rangeCalendar) */
  .fb-cal {
    margin-bottom: 0.5rem;
  }

  .fb-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
  }

  .fb-cal-nav {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--brand-heading);
  }

  .fb-cal-nav:disabled {
    opacity: 0.3;
  }

  .fb-cal-title {
    display: flex;
    gap: 0.25rem;
  }

  .fb-cal-title select {
    min-height: 40px;
    padding: 0 0.4rem;
    border: 0;
    background: transparent;
    color: var(--brand-heading);
    font-size: 16px;
    font-weight: 700;
  }

  .fb-cal-week,
  .fb-cal-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    text-align: center;
  }

  .fb-cal-week span {
    padding: 0.2rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand-muted);
  }

  .fb-day {
    height: 42px;
    border: 0;
    background: transparent;
    color: var(--brand-heading);
    font-size: 0.95rem;
  }

  .fb-day:disabled {
    color: var(--brand-muted);
    opacity: 0.35;
  }

  .fb-day.is-today {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  .fb-day.in-range {
    background: var(--brand-primary-tint);
    color: var(--brand-primary);
  }

  .fb-day.is-start,
  .fb-day.is-end {
    background: var(--brand-primary);
    color: #fff;
    font-weight: 700;
  }

  .fb-day.is-start { border-radius: 10px 0 0 10px; }
  .fb-day.is-end { border-radius: 0 10px 10px 0; }
  .fb-day.is-start.is-end { border-radius: 10px; }

  .fb-cal-picked {
    min-height: 1.4rem;
    margin-top: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brand-heading);
    text-align: center;
  }

  .fb-custom-range > * {
    flex: none;
    width: 100%;
    max-width: 100%;
    margin: 0 0 0.9rem;
    padding: 0;
  }

  .fb-chip .fb-chevron {
    font-size: 0.7rem;
    opacity: 0.7;
  }

  .fb-sheet-foot {
    display: flex;
    gap: 0.6rem;
    padding: 0.75rem 1.1rem calc(0.75rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--brand-border);
  }

  .fb-sheet-foot .btn {
    flex: 1 1 0;
  }
}

/* Tablets: two cards per row */
@media (pointer: coarse) and (min-width: 768px) and (max-width: 1199.98px) {
  table.table-cards > tbody {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  table.table-cards > tbody > tr {
    margin-bottom: 0;
    align-content: start;
  }

  table.table-cards > tbody > tr.log-detail,
  table.table-cards > tbody > tr > td.dataTables_empty {
    grid-column: 1 / -1;
  }

  table.wq-table > tbody {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  table.wq-table > tbody > tr {
    margin-bottom: 0;
    align-content: start;
  }
}

/* ── 3. Narrow screens ──────────────────────────────────────── */

@media (max-width: 767.98px) {
  /* Room for content: one even 12px gutter instead of three nested paddings */
  .page-content {
    padding-left: 0;
    padding-right: 0;
  }

  .page-content .card {
    --vz-card-spacer-x: 1rem;
    --vz-card-spacer-y: 1rem;
    --vz-card-cap-padding-x: 1rem;
  }

  .card > .card-header.page-header {
    padding: 1rem;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .filter-bar.row {
    padding: 0 0.25rem 0.75rem;
  }


  .form-section {
    padding: 0.9rem 0.9rem 0.25rem;
  }

  /* Engagement Details: Cancel / Update stay at the bottom of the screen while the long form
     scrolls, and settle in place at the end of the form */
  .engagement-edit-form .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    flex-wrap: nowrap;
    margin: 0 -1rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    background: var(--brand-surface);
    box-shadow: 0 -6px 14px rgba(16, 24, 40, 0.08);
  }

  .engagement-edit-form .form-actions .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .engagement-edit-form .form-actions .btn-primary {
    flex: 1 1 auto;
  }

  /* Status History: a timeline instead of a table cut off at the side
       ● In Process
       │ 05 Oct 2026, 3:22 p.m. · by admin
       ● Upload Documents
       │ ... */
  .status-history .table-responsive {
    overflow: visible;
  }

  table.status-timeline,
  table.status-timeline > tbody {
    display: block;
    width: 100% !important;
  }

  table.status-timeline > thead {
    display: none;
  }

  table.status-timeline > tbody > tr {
    position: relative;
    display: block;
    padding: 0 0 1rem 1.5rem;
  }

  /* the line joining one change to the next */
  table.status-timeline > tbody > tr::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 0.9rem;
    bottom: 0;
    width: 2px;
    background: var(--brand-border);
  }

  table.status-timeline > tbody > tr:last-child::before {
    display: none;
  }

  /* the dot */
  table.status-timeline > tbody > tr::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--brand-surface);
    border: 2px solid var(--brand-primary);
  }

  table.status-timeline > tbody > tr:first-child::after {
    background: var(--brand-primary);
  }

  table.status-timeline > tbody > tr > td {
    display: inline;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    white-space: normal !important;
    font-size: 0.8125rem;
    color: var(--brand-muted);
  }

  table.status-timeline > tbody > tr > td.st-status {
    display: block;
    margin-bottom: 0.3rem;
  }

  table.status-timeline > tbody > tr > td.st-by::before {
    content: " · by ";
  }

  table.status-timeline > tbody > tr > td.dataTables_empty {
    display: block;
  }

  /* a handful of rows: no search box, count or one-page pager */
  .status-history .dataTables_filter,
  .status-history .dataTables_info {
    display: none !important;
  }

  /* Summary tiles (Success page collections, Recycle Bin counts): one compact row each, label left,
     figure right, so the list below starts on the first screen */
  .stat-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }

  .stat-tile {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
  }

  .stat-value {
    font-size: 1.125rem;
    margin-top: 0;
    text-align: right;
  }

  /* Long form dialogs (Edit company, Edit UDIN, ...) fill the screen; title and buttons stay in
     place while the form scrolls. Short dialogs (confirmations) stay centred. */
  .modal-dialog:has(.form-section),
  .modal-dialog.modal-lg,
  .modal-dialog.modal-xl {
    max-width: none;
    width: 100%;
    min-height: 100%;
    margin: 0;
  }

  .modal-dialog:has(.form-section) > .modal-content,
  .modal-dialog.modal-lg > .modal-content,
  .modal-dialog.modal-xl > .modal-content {
    min-height: 100vh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .modal-dialog:has(.form-section) .modal-header,
  .modal-dialog.modal-lg .modal-header,
  .modal-dialog.modal-xl .modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--brand-surface);
  }

  .modal-dialog:has(.form-section) .modal-footer,
  .modal-dialog.modal-lg .modal-footer,
  .modal-dialog.modal-xl .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: var(--brand-surface);
    box-shadow: 0 -4px 12px rgba(16, 24, 40, 0.06);
  }

  .modal-footer .btn {
    flex: 1 1 0;
  }

  /* Detail lists (company page details, engagement and query details): one line per field, label on
     the left, value on the right, a thin line between rows, like a phone's Settings screen. Long
     values wrap on the value side. */
  .detail-list {
    display: block;
  }

  .detail-list > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--brand-border);
  }

  .detail-list > div:last-child {
    border-bottom: 0;
  }

  .detail-list dt {
    flex: 0 0 auto;
    max-width: 45%;
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--brand-muted);
  }

  .detail-list dd {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    text-align: right;
    overflow-wrap: anywhere;
  }

  /* links and edit buttons inside a value keep to the right without making the row tall */
  .detail-list dd a[href^="tel:"],
  .detail-list dd a[href^="mailto:"],
  .detail-list dd a {
    min-height: 0;
    display: inline-block;
    padding: 0.6rem 0;       /* a 40px tap area ... */
    margin: -0.6rem 0;       /* ... without making the row taller */
  }

  /* Activity Log: its date picker and Filters panel open as bottom sheets, like the other list pages'
     sheets, and its toolbar buttons look like the same chips. ("html body" outranks the page's own
     <style>; its script still opens and closes them.) */
  html body .filter-toolbar .ops-dp-modal:not([hidden]),
  html body .filters-panel:not([hidden]) {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1056;
    width: auto;
    max-width: none;
    max-height: 85vh;
    max-height: 85dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 0 0 100vmax rgba(16, 24, 40, 0.45), 0 -8px 24px rgba(16, 24, 40, 0.18);
  }

  html body .filter-toolbar .toolbar-btn {
    min-height: 40px;
    border-radius: 999px;
  }

  /* Sales / Success page cards: the same label-left, value-right rows as the detail lists, instead of
     each label above its value. ("html body" outranks the pages' own <style>, which comes later.) */
  html body .sales-table td {
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.1rem 0.75rem;     /* tight between a value's lines, roomy between label and value */
    align-items: baseline;
    padding: 0.5rem 0;
  }

  html body .sales-table td::before {
    grid-row: 1;
    justify-self: start;
    text-align: left;
  }

  html body .sales-table td .cell-sub {
    margin-top: 0;
  }

  /* the client's phone link and the engagement name keep a 40px tap area without making the row taller */
  html body .sales-table td .sales-name-link.sales-wrap,
  html body .sales-table td .cell-sub a {
    min-height: 0;
    display: inline-block;
    padding: 0.6rem 0;
    margin: -0.6rem 0;
  }

  html body .sales-table td + td {
    border-top: 1px dashed var(--brand-border);
  }

  html body .sales-table td::before {
    padding-top: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
  }

  /* values start on one line under each other (long engagement names wrap neatly) */
  html body .sales-table td > * {
    grid-column: 2;
    justify-self: start;
  }

  html body .sales-table .sales-pills {
    align-items: flex-start;
  }

  /* an empty second line (e.g. no FY) takes no space */
  html body .sales-table td .cell-sub:empty {
    display: none;
  }

  /* the Assign CA form (Success page) still spans the value side */
  html body .sales-table td > form {
    justify-self: stretch;
  }

  html body .sales-table .sales-actions {
    border-top: 1px dashed var(--brand-border);
    padding-top: 0.6rem;
  }

  /* Tab strips (.icon-tabs: company page, engagement page): one row, every tab visible, icon above a
     short label (Profile, UDIN, Docs, History, Bin / Overview, Follow-ups, History, Queries), like an
     app's tab bar; counts become a small badge on the icon. The full label stays for screen readers. */
  .icon-tabs {
    flex-wrap: nowrap;
    overflow: visible;
  }

  .icon-tabs .nav-item {
    flex: 1 1 0;
    min-width: 0;
    margin-left: 0 !important;
  }

  .icon-tabs .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-height: 56px;
    padding: 0.55rem 0.15rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
  }

  .icon-tabs .nav-link i {
    margin: 0 !important;
    font-size: 1.15rem;
  }

  .icon-tabs .tab-label-long {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .icon-tabs .tab-label-short {
    display: inline;
  }

  .icon-tabs .nav-link {
    position: relative;
  }

  .icon-tabs .tab-count {
    position: absolute;
    top: 0.3rem;
    left: calc(50% + 0.4rem);
    min-height: 0;
    height: 1.1rem;
    min-width: 1.1rem;
    margin: 0 !important;
    padding: 0 0.3rem;
    justify-content: center;
    font-size: 0.75rem;
    line-height: 1;
  }

  /* Header buttons share the row instead of wrapping one per line */
  .page-header .page-actions .btn,
  .page-header > .d-flex.flex-wrap > .btn {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Top bar: the firm's name next to the menu button */
  .topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    color: var(--brand-logo-text);
    white-space: nowrap;
  }

  .topbar-brand img {
    height: 28px;
    width: auto;
  }

  /* Menu drawer: a wide white panel with a rounded corner, who is signed in on top, then plain
     icon rows. The firm's logo is already in the top bar, so the drawer doesn't repeat it. */
  :root[data-layout] .app-menu.navbar-menu {
    display: flex;
    flex-direction: column;
    width: min(84vw, 320px);
    height: 100vh;
    height: 100dvh;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0 20px 20px 0;
    background: var(--brand-surface);
    box-shadow: 8px 0 24px rgba(16, 24, 40, 0.18);
  }

  :root[data-layout] .app-menu .navbar-brand-box,
  .app-menu #vertical-hover {
    display: none;
  }

  .drawer-profile {
    display: flex;
    flex: none;
    align-items: center;
    gap: 0.9rem;
    padding: calc(1.25rem + env(safe-area-inset-top)) 1.25rem 1.1rem;
    border-bottom: 1px solid var(--brand-border);
  }

  .drawer-avatar {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-surface), 0 0 0 5px var(--brand-primary-tint);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
  }

  .drawer-who {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
  }

  .drawer-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-heading);
  }

  .drawer-role {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-primary);
  }

  .drawer-email {
    overflow: hidden;
    font-size: 0.8rem;
    color: var(--brand-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* The list scrolls inside the drawer (SimpleBar's wrapper is the scroller); the swipe never
     carries on into the page, and mobile.js pins the page while the drawer is open. */
  .app-menu #scrollbar {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .app-menu #scrollbar,
  .app-menu #scrollbar > .simplebar-wrapper > .simplebar-mask > .simplebar-offset > .simplebar-content-wrapper {
    overscroll-behavior: contain;
  }

  /* The theme also puts a second SimpleBar on the list inside this one. It never scrolls, but it
     caught the swipe, so the drawer couldn't scroll: on phones it is plain content. */
  .app-menu #navbar-nav .simplebar-wrapper,
  .app-menu #navbar-nav .simplebar-mask,
  .app-menu #navbar-nav .simplebar-offset,
  .app-menu #navbar-nav .simplebar-content-wrapper {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .app-menu #navbar-nav,
  .app-menu #navbar-nav .simplebar-content,
  .app-menu #navbar-nav .nav-item {
    width: 100%;
  }

  .app-menu #navbar-nav .simplebar-placeholder,
  .app-menu #navbar-nav .simplebar-track,
  .app-menu #navbar-nav .simplebar-height-auto-observer-wrapper {
    display: none !important;
  }

  .app-menu .navbar-nav {
    padding: 0.5rem 0;
  }

  /* account menu (the round initial in the top bar): rows big enough to tap */
  .topbar-user .dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .app-menu .navbar-nav .nav-link.menu-link,
  .app-menu .drawer-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 52px;
    margin: 0;
    padding: 0.75rem 1.25rem;
    border-radius: 0;
    color: var(--brand-text);
    font-size: 1rem;
    font-weight: 500;
  }

  .app-menu .navbar-nav .nav-link.menu-link i,
  .app-menu .drawer-link i {
    flex: none;
    width: 1.5rem;
    margin: 0;
    font-size: 1.3rem;
    text-align: center;
    color: var(--brand-muted);
  }

  .app-menu .navbar-nav .nav-link.menu-link.active {
    color: var(--brand-primary);
    font-weight: 600;
    background: var(--brand-primary-tint);
    box-shadow: inset 3px 0 0 var(--brand-primary);
  }

  .app-menu .navbar-nav .nav-link.menu-link.active i {
    color: var(--brand-primary);
  }

  .drawer-footer {
    display: block;
    margin-top: 0.25rem;
    padding: 0.5rem 0 1rem;
    border-top: 1px solid var(--brand-border);
  }

  .app-menu .drawer-link i {
    font-size: 1.1rem;
  }

  /* Opening and closing glide: the drawer slides (transform, which the phone animates smoothly)
     instead of the theme's 0.1s jump of margin-left, and the dimmed page fades in and out. */
  :root[data-layout] .app-menu.navbar-menu {
    margin-left: 0 !important;
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.28s;
    will-change: transform;
  }

  :root[data-layout] .vertical-sidebar-enable .app-menu.navbar-menu {
    transform: none;
    visibility: visible;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s;
  }

  .vertical-overlay {
    display: block;
    opacity: 0;
    pointer-events: none;
    touch-action: none;
    transition: opacity 0.28s ease;
  }

  .vertical-sidebar-enable .vertical-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  /* DataTables export buttons and search: one swipeable row, then a full-width search */
  .dataTables_wrapper > .dt-buttons,
  .dataTables_wrapper > .dataTables_filter,
  .dataTables_wrapper > .dataTables_info,
  .dataTables_wrapper > .dataTables_paginate {
    float: none;
    width: 100%;
    text-align: left;
  }

  .dataTables_wrapper > .dt-buttons {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .dataTables_wrapper .dt-buttons .dt-button {
    flex: 0 0 auto;
    margin: 0;
    min-height: 38px;
  }

  .dataTables_wrapper .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
  }

  .dataTables_wrapper > .row > [class*="col-"] {
    padding-left: 0;
    padding-right: 0;
  }

  /* Pagers: one row, "‹ Previous   Page 7 of 17   Next ›" (mobile.js marks the parts). The page
     number buttons are left out: on a phone they wrapped onto two rows of small squares. */
  .table-footer nav,
  .dataTables_wrapper .dataTables_paginate {
    width: 100%;
  }

  ul.pagination.pg-compact {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin: 0.25rem 0 0;
  }

  ul.pagination.pg-compact > li {
    display: none;
  }

  ul.pagination.pg-compact > li.pg-prev,
  ul.pagination.pg-compact > li.active,
  ul.pagination.pg-compact > li.pg-next {
    display: block;
  }

  ul.pagination.pg-compact > li.pg-prev { grid-column: 1; justify-self: start; }
  ul.pagination.pg-compact > li.active { grid-column: 2; }
  ul.pagination.pg-compact > li.pg-next { grid-column: 3; justify-self: end; }

  ul.pagination.pg-compact .pg-prev .page-link,
  ul.pagination.pg-compact .pg-next .page-link {
    display: inline-flex;
    gap: 0.45rem;
    padding: 0 0.95rem;
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    background: var(--brand-surface);
    color: var(--brand-primary);
    font-size: 0.9rem;
    font-weight: 600;
  }

  ul.pagination.pg-compact .pg-prev .page-link i,
  ul.pagination.pg-compact .pg-next .page-link i {
    font-size: 0.75rem;
  }

  ul.pagination.pg-compact .disabled .page-link {
    color: var(--brand-muted);
    opacity: 0.5;
  }

  ul.pagination.pg-compact .active .page-link {
    display: block;   /* not flex: flex drops the spaces in "Page 7 of 17" */
    min-width: 0;
    min-height: 0;    /* it is text, not a button: centred between the two buttons */
    line-height: 1.4;
    padding: 0;
    border: 0;
    background: transparent !important;
    color: var(--brand-heading) !important;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: none;
  }

  ul.pagination.pg-compact .active .page-link::before {
    content: "Page ";
    font-weight: 400;
    color: var(--brand-muted);
  }

  ul.pagination.pg-compact .active .page-link::after {
    content: " of " attr(data-of);
    font-weight: 400;
    color: var(--brand-muted);
  }

  .pg-repeat {
    display: none !important;   /* the footer's own "Page 5 of 16": the pager already says it */
  }

  ul.pagination.pg-single {
    display: none !important;
  }

  /* a list that fits on one page: no "Previous 1 Next" pager */
  .dataTables_paginate:not(:has(li:nth-child(4))) {
    display: none !important;
  }

  /* Mail: "Mailbox settings" under the folders */
  a.btn-link[href$="/mail/settings/"] {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .dataTables_wrapper .dataTables_filter input {
    flex: 1;
    margin: 0 !important;
  }
}

/* Phones set to reduce motion: drawer and sheets open and close at once */
@media (prefers-reduced-motion: reduce) {
  :root[data-layout] .app-menu.navbar-menu,
  .vertical-overlay,
  .fb-sheet,
  .fb-backdrop {
    transition: none !important;
  }
}
