/* mobile.css — the phone layout (reference: docs/mockups/mobile.html).
 *
 * Desktop is not affected: every rule that changes how a page looks sits inside the phone media query below
 * (narrow, or a touch screen held sideways — the same test as nbIsPhone() in nestbook.js). Outside it there are
 * only (a) phone-only elements kept hidden and (b) the bell's "Needs attention" list and the More page, which
 * are the same on every screen.
 */

/* ── Phone-only elements: hidden on desktop ─────────────────────────────── */
.m-titlebar, .m-fab, .m-only, .m-call-td, .m-lab, .m-back, .m-tile, .m-selhead, .m-empty { display: none; }

/* ── Bell: "Needs attention" (phone and desktop) ────────────────────────── */
.nb-attn { width: 340px; max-width: calc(100vw - 24px); border-radius: 14px; border: 1px solid var(--border);
           box-shadow: 0 6px 24px rgba(0,0,0,.12); padding: 6px 6px 8px; }
.nb-attn-h { font-size: .95rem; font-weight: 700; color: var(--text); padding: 8px 10px 6px; }
.nb-attn-g { font-size: .78rem; font-weight: 600; color: var(--text-muted); padding: 10px 10px 4px; }
.nb-attn-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; white-space: normal; }
.nb-attn-ic { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.nb-attn-ic.approval { background: var(--amber-light); color: var(--amber); }
.nb-attn-ic.overdue  { background: var(--red-light); color: var(--red); }
.nb-attn-tx { min-width: 0; display: flex; flex-direction: column; }
.nb-attn-tx b { font-size: .86rem; font-weight: 600; color: var(--text); }
.nb-attn-tx span { font-size: .78rem; color: var(--text-muted); }
.nb-attn-empty { font-size: .86rem; color: var(--text-2); padding: 10px 10px 8px; display: flex; align-items: center; gap: 8px; }
.nb-attn-empty i { color: var(--teal); font-size: 1.05rem; }

/* ── More page (a phone page, but it works on any screen) ───────────────── */
/* Phone: the content is hidden while the page is laid out (header.jsp sets m-pending, mobile.js clears it), then fades in.
   If mobile.js never runs, it shows anyway after 1.5s. */
html.m-pending .nb-content, html.m-pending .m-title-slot { opacity: 0; animation: mReveal 0s 1.5s forwards; }
@keyframes mReveal { to { opacity: 1; } }
.nb-content, .m-title-slot { transition: opacity .12s ease-out; }

/* "More" sheet from the bottom bar (mobile-more.jsp) */
.m-more-sheet .m-sheet-body { padding-top: 0; }
.more-h { font-size: .95rem; font-weight: 600; color: var(--text); margin: 16px 6px 8px; }
.more-h:first-child { margin-top: 4px; }
.more-grp { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 8px 6px; }
.more-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.more-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 2px; border-radius: 12px;
             font-size: .8rem; color: var(--text); text-align: center; text-decoration: none; line-height: 1.25; }
.more-tile:hover, .more-tile:focus-visible { background: var(--surface-2); color: var(--text); }
.more-ic { position: relative; width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
           background: var(--accent-light); color: var(--accent); font-size: 1.2rem; }
.more-n { position: absolute; top: -5px; right: -7px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 4px;
          background: var(--red); color: #fff; font-size: .66rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
          border: 2px solid var(--surface); }

/* ═══════════════════════════════════════════════════════════════════════════
   PHONE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px), (hover: none) and (pointer: coarse) and (max-height: 500px) {

  /* ── Top bar: building on the left, bell + avatar on the right; the title has its own line ── */
  .nb-topbar { height: 52px; --topbar-h: 52px; padding: 0 12px; gap: 6px; border-bottom: 0; }
  .nb-topbar .btn-hamburger, .nb-topbar .topbar-left, .nb-topbar .nb-quick { display: none !important; }
  .topbar-actions { flex: 1; min-width: 0; gap: 4px; }
  .nb-prop-dd { margin-right: auto; min-width: 0; }
  /* the switcher is on the left on a phone: open its menu from the left edge, not off-screen to the left */
  .nb-prop-dd .dropdown-menu { inset: calc(100% + 4px) auto auto 0 !important; transform: none !important; }
  .nb-prop-switcher { max-width: 62vw; border: 0; background: var(--surface-2); border-radius: 999px; padding: 6px 12px 6px 10px; }
  .nb-prop-name { max-width: none; font-size: .84rem; font-weight: 500; }
  .nb-bell { display: block; }
  .nb-bell .topbar-icon-btn { display: flex !important; width: 40px; height: 40px; background: none; border: 0; color: var(--text-2); }
  .nb-bell .nb-bell-n { font-size: .66rem !important; padding: 2px 5px !important; transform: translate(-70%, -10%) !important; }
  .topbar-user-btn { border: 0 !important; padding: 0 !important; background: none !important; }
  .topbar-user-btn.dropdown-toggle::after { display: none; }
  .nb-attn { width: calc(100vw - 24px); }

  .m-titlebar { display: flex; align-items: center; gap: 10px; padding: 2px 12px 12px 13px; background: var(--surface);
                border-bottom: 1px solid var(--border); flex-shrink: 0; }
  .m-title { margin: 0; flex: 1; min-width: 0; font-size: 1.45rem; font-weight: 700; letter-spacing: -.4px; line-height: 1.2; color: var(--text); }
  .m-title-slot:empty { display: none; }

  /* ── Content: room at the bottom for the bottom bar and "+ New" ── */
  .nb-content { padding: 12px 12px calc(150px + env(safe-area-inset-bottom, 0px)); }

  /* ── Bottom bar: a floating, frosted pill with five items (owner, 26 Nov 2026, after Jira's phone app); the
        current page gets a full-height blue pill. Its top edge is 76px + safe area above the screen's bottom. ── */
  .nb-bottom-nav { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
                   height: 66px; padding: 5px; gap: 2px; border-radius: 33px;
                   background: rgba(255,255,255,.8); -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
                   border: 1px solid rgba(15,23,42,.08); box-shadow: 0 10px 30px rgba(15,23,42,.14), 0 1px 3px rgba(15,23,42,.08); }
  .nb-bnav-item { min-width: 0; min-height: 0; padding: 0 1px; gap: 4px; border-radius: 28px; color: #3C4043; transition: color .18s, background-color .18s; }
  .nb-bnav-item.active { background: var(--accent-light); color: var(--accent); }
  .nb-bnav-item.active::before { display: none; }
  .nb-bnav-label { font-size: .66rem; font-weight: 500; letter-spacing: -.1px; }
  .nb-bnav-item.active .nb-bnav-label { font-weight: 600; }

  /* ── "+" (New): a round button, no label ── */
  .m-fab { display: inline-flex; align-items: center; justify-content: center; position: fixed; z-index: 950;
           right: 16px; bottom: calc(76px + 14px + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px; padding: 0;
           background: var(--accent); color: #fff; border: 0; border-radius: 16px; box-shadow: 0 6px 16px rgba(2,89,200,.35); }
  .m-fab i { font-size: 1.4rem; }
  /* while typing, the keyboard needs the room: the bar and the button step aside */
  body.m-typing .m-fab, body.m-typing .nb-bottom-nav { display: none; }

  /* ── Bottom sheets ── */
  .m-sheet { height: auto !important; max-height: 88vh; border: 0 !important; border-radius: 22px 22px 0 0; }
  .m-sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 8px auto 2px; }
  .m-sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 6px 18px 6px 20px; }
  .m-sheet-h h2 { margin: 0; font-size: 1.1rem; font-weight: 700; }
  .m-sheet-body { padding: 4px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .m-grp { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
  .m-grp-h { font-size: .92rem; font-weight: 600; color: var(--text); padding: 14px 4px 8px; }
  .m-li { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; text-align: left;
          padding: 12px 14px; font: inherit; color: var(--text); min-height: 56px; }
  .m-li + .m-li { border-top: 1px solid var(--surface-3); }
  .m-li:active { background: var(--surface-2); }
  .m-li-ic { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; }
  .m-li-ic.blue  { background: var(--accent-light); color: var(--accent); }
  .m-li-ic.in    { background: var(--teal-light); color: var(--teal); }
  .m-li-ic.out   { background: var(--red-light); color: var(--red); }
  .m-li-ic.amber { background: var(--amber-light); color: #A14F00; }
  .m-li-ic.gray  { background: var(--surface-2); color: var(--text-2); }
  .m-li-tx { min-width: 0; }
  .m-li-tx b { display: block; font-weight: 500; font-size: .95rem; }
  .m-li-tx span { display: block; font-size: .78rem; color: var(--text-muted); margin-top: 1px; }

  /* ── Page tabs: one segmented bar, equal parts, never scrolling sideways ──
     Two markups: div.gm-tabs-bar > ul.gm-tabs-list > li (People, Vendors) and ul.gm-tabs-bar > li (Units, Staff). */
  .gm-tabs-bar { border: 0; background: transparent; border-radius: 0; flex-wrap: nowrap; overflow: visible; margin-bottom: 12px; padding: 0; }
  .gm-tabs-list, ul.gm-tabs-bar { flex: 1 1 100%; background: #E4E7EB; border-radius: 12px; padding: 3px; }
  /* (the tab items share the .nav-item class with the sidebar links — undo the sidebar's padding and hover) */
  .gm-tabs-list > .nav-item, ul.gm-tabs-bar > .nav-item { flex: 1 1 0; min-width: 0; padding: 0; margin: 0; background: none !important; display: block; }
  .gm-tabs-bar .nav-item > .gm-tab { width: 100%; }
  .gm-tab { justify-content: center; padding: 8px 4px; border: 0 !important; border-radius: 9px; margin: 0; font-size: .85rem; height: 100%; }
  .gm-tab i { display: none; }
  .gm-tab.active { background: var(--surface); color: var(--accent-dark); box-shadow: 0 1px 3px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.04); }
  .gm-tab-count { background: #D5D9DE; color: #3C4043; font-weight: 600; }
  .gm-tab.active .gm-tab-count { background: var(--accent-light); color: var(--accent); }
  .gm-tabs-spacer { display: none !important; }
  /* the page's own Add button moves into "+ New" */
  .gm-tabs-actions { display: none !important; }
  /* one tab only (nothing to switch): no bar */
  .gm-tabs-bar:not(:has(.nav-item + .nav-item)) { display: none; }
  .gm-tabs-content { border: 0; border-radius: 0; overflow: visible; }

  /* ── Lists: one toolbar row — search across the width, download as an icon; no "Show 25 entries" ── */
  div.dt-length { display: none !important; }
  .dt-top { padding: 0 0 12px !important; margin-bottom: 16px; border: 0 !important; background: transparent; }   /* the phone keeps its gap above the cards */
  /* the search row: [search] [filter] [download] — one toolbar: the two buttons are boxes like the search box
     (44px, the same corners, border and white), 8px apart */
  .dt-top-right { flex: 1 1 auto; min-width: 0; width: 100%; gap: 8px !important; }
  div.dt-search { flex: 1 1 auto; min-width: 0; }
  div.dt-search input { min-width: 0 !important; width: 100% !important; height: 44px; border-radius: 12px; font-size: .9rem; padding-left: 36px; margin: 0 !important; }
  .dt-buttons { flex: 0 0 auto !important; width: auto !important; }
  .btn-dt-download { font-size: 0 !important; width: 44px; height: 44px; padding: 0 !important; border-radius: 12px !important;
                     display: inline-flex !important; align-items: center; justify-content: center; flex-shrink: 0;
                     border: 1px solid var(--border) !important; background: var(--surface) !important; color: var(--text-2) !important; }
  .btn-dt-download:active, .btn-dt-download[aria-expanded="true"] { border-color: var(--accent) !important; background: var(--accent-light) !important; color: var(--accent) !important; }
  .btn-dt-download i { font-size: 1.05rem; margin: 0 !important; }

  /* ── Phone-only bits inside pages; desktop-only bits hidden ── */
  .m-only { display: inline; }
  .m-no { display: none !important; }
  table.m-cards td.m-desk-hide { display: block; }

  /* ═══ List cards ═══════════════════════════════════════════════════════════
     A table marked .m-cards shows each row as a card (one DOM, so search, sort and download keep working).
     Cells say what they are: .m-c-main (name + avatar), .m-c-line (a line under the name), .m-c-chips (unit chips,
     labels), .m-c-hide (desktop only). The row's actions column is hidden: tapping the card opens it (mobile.js),
     and a phone number in data-m-tel gets a round Call button. */
  .nb-card:has(table.m-cards), .gm-tabs-content .nb-card:has(table.m-cards) { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .table-wrap:has(table.m-cards) { overflow: visible; }
  .dt-container:has(table.m-cards) .dt-foot { display: none; }
  table.m-cards { display: block; width: 100% !important; border: 0; }
  table.m-cards thead { display: none; }
  table.m-cards tbody { display: flex; flex-direction: column; gap: 12px; }
  table.m-cards tbody tr { display: flex; flex-wrap: wrap; align-items: center; column-gap: 14px; row-gap: 4px; position: relative;
                           background: var(--surface) !important; border: 1px solid var(--border); border-radius: 14px; padding: 16px 14px 16px 16px; cursor: pointer; }
  table.m-cards tbody tr:active { background: #F6F8FB !important; }
  table.m-cards tbody tr > td { display: block; border: 0 !important; padding: 0 !important; background: none !important; min-width: 0; box-shadow: none !important; }
  table.m-cards tbody tr > td:last-child, table.m-cards .m-c-hide { display: none !important; }
  table.m-cards tbody tr > td.m-call-td { display: block !important; position: absolute; right: 14px; top: 16px; }
  table.m-cards tbody tr:has(> td.m-call-td) > td.m-c-main { padding-right: 52px !important; }
  table.m-cards .m-c-main { order: 1; flex: 1 1 0; }
  table.m-cards .m-c-line { order: 3; flex: 0 0 100%; padding-left: 54px !important; font-size: .84rem; color: var(--text-2); line-height: 1.45; }
  table.m-cards .m-c-chips { order: 4; flex: 0 0 auto; display: flex !important; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: .8rem; color: var(--text-muted); }
  table.m-cards .m-c-chips:first-of-type, table.m-cards .m-c-line + .m-c-chips { padding-left: 54px !important; }
  table.m-cards .m-c-chips:empty { display: none !important; }
  table.m-cards .person-avatar { width: 40px; height: 40px; font-size: .95rem; flex-shrink: 0; position: absolute; left: 16px; top: 16px; }
  table.m-cards tbody tr:has(.person-avatar) { min-height: 72px; }
  table.m-cards .m-c-main:has(.person-avatar) { padding-left: 54px !important; align-self: center; }
  table.m-cards .m-c-line { margin-top: -2px; }
  table.m-cards .m-c-main > .d-flex { gap: 14px !important; }
  table.m-cards .person-name { font-size: .95rem; font-weight: 600; line-height: 1.35; }
  table.m-cards td.dt-empty, table.m-cards td.dataTables_empty { display: block !important; flex: 1 1 100%; text-align: center; color: var(--text-muted); }
  .m-call { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
            background: var(--accent-light); color: var(--accent); font-size: 1.05rem; text-decoration: none; position: relative; }
  .m-call::after { content: ''; position: absolute; inset: -2px; }   /* 44px to tap */
  .m-lab { display: inline-block; width: 66px; flex-shrink: 0; font-size: .66rem; font-weight: 500; letter-spacing: .5px; text-transform: uppercase; color: #5F6368; }

  /* Owners & Tenants: "· On portal" / "· Invited" after the unit chips (words drawn here, so desktop search and downloads don't see them) */
  table.m-cards td.m-portal > * { display: none !important; }
  table.m-cards td.m-portal:not(.m-portal-on):not(.m-portal-inv) { display: none !important; }
  table.m-cards td.m-portal-on::after  { content: '· On portal'; }
  table.m-cards td.m-portal-inv::after { content: '· Invited'; }
  /* Owners & Tenants: the name on its own line, then the phone number and the flat chips on one line under it
     (two chips at most, then "+N" from data-m-more); a tenant's "since …" stays in the form */
  :is(#tblOwners, #tblTenants) .m-c-main { flex-basis: 100%; }
  :is(#tblOwners, #tblTenants) .m-c-line { flex: 0 0 auto; margin-top: 0; }
  :is(#tblOwners, #tblTenants) .m-c-line + .m-c-chips { padding-left: 0 !important; margin-top: 0; flex-wrap: nowrap; gap: 4px; }
  :is(#tblOwners, #tblTenants) .m-c-chips .nb-badge { margin: 0 !important; }
  #tblTenants td.m-c-chips > div { display: contents; }
  #tblTenants td.m-c-chips .text-muted.small { display: none; }
  table.m-cards .m-x { display: none !important; }
  table.m-cards td[data-m-more]::after { content: attr(data-m-more); display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px;
                                         border: 1px solid #C9D7F2; color: var(--accent); background: var(--surface); font-size: .72rem; font-weight: 600; line-height: 1.3; }

  /* Units: [A2]  RESIDENT name / OWNER name, and "৳… due" top right */
  #tblUnits tbody tr { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-areas: "tile res due" "tile own due";
                       column-gap: 14px; row-gap: 4px; align-items: center; }
  #tblUnits td.m-u-tile { grid-area: tile; }
  #tblUnits td.m-u-tile .nb-badge { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
                                     font-size: 1rem; font-weight: 700; padding: 0; }
  #tblUnits td.m-u-res { grid-area: res; }
  #tblUnits td.m-u-own { grid-area: own; }
  #tblUnits td.m-u-res, #tblUnits td.m-u-own { display: flex !important; align-items: baseline; min-width: 0; white-space: nowrap; overflow: hidden; }
  #tblUnits td.m-u-res::before, #tblUnits td.m-u-own::before { display: inline-block; width: 66px; flex-shrink: 0; font-size: .66rem; font-weight: 500;
                                     letter-spacing: .5px; text-transform: uppercase; color: #5F6368; }
  #tblUnits td.m-u-res::before { content: 'Resident'; }
  #tblUnits td.m-u-own::before { content: 'Owner'; }
  #tblUnits td.m-u-res strong { font-size: .95rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
  #tblUnits td.m-u-own strong { font-weight: 400; font-size: .88rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
  #tblUnits td.m-u-res > div, #tblUnits td.m-u-own > div { display: none; }        /* the date ranges */
  #tblUnits td.m-u-vacant > * { display: none !important; }
  #tblUnits td.m-u-vacant::after { content: 'Vacant'; color: var(--text-muted); font-size: .95rem; }
  #tblUnits td.m-u-due { grid-area: due; align-self: start; }
  #tblUnits td.m-u-due > * { display: none !important; }
  #tblUnits td.m-u-due[data-m-due]::after { content: attr(data-m-due); font-size: .8rem; font-weight: 600; color: var(--red); white-space: nowrap; }
  #tblUnits tbody tr > td:nth-child(5) { display: none !important; }              /* meters: in the unit's Meters tab */

  /* Staff / Vendors: the job role or service as plain words under the name */
  table.m-cards td.m-st-role .nb-badge { background: none !important; padding: 0; font-size: .84rem; font-weight: 400; color: var(--text-2) !important; }
  /* Staff / Vendors: two lines — name, then "job role · number" (the start date, contact person etc. are inside the card) */
  #tblStaff .m-c-main .person-name ~ *, #tblVendors .m-c-main .person-name ~ * { display: none !important; }
  table.m-cards td.m-st-role { margin-top: -2px; }
  table.m-cards td.m-st-role[data-m-tel]:not([data-m-tel=""])::after { content: ' · ' attr(data-m-tel); color: var(--text-2); }

  /* ═══ Collections and Utility Bills: one card each (mock-up, 20 Nov 2026) ═══
     [tile]  Service Charge ………………… ৳4,000
             Paid 01 Oct · Cash ……………… (Paid)        an unpaid one has [Record] instead of the status
     The tile is the flat (Collections) or the bill's kind (Utility). Checkboxes only after "Select" (mobile.js). */
  .nb-card:has(#tblSc) { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .table-wrap:has(#tblSc) { overflow: visible; }
  #tblSc tbody, #tblUtility tbody { display: flex !important; flex-direction: column; gap: 10px; }
  #tblSc tbody tr.sc-row, #tblUtility tbody tr {
    display: grid !important; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title amt" "sub st";
    column-gap: 12px; row-gap: 4px; align-items: center; position: relative; min-height: 78px;
    padding: 14px 14px 14px 76px !important; background: var(--surface) !important; border: 1px solid var(--border) !important;
    border-radius: 14px; cursor: pointer; }
  #tblSc tbody tr > td, #tblUtility tbody tr > td { display: none !important; }
  .m-tile { display: flex; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 12px;
            background: var(--accent-light); color: var(--accent-dark); align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; }
  .m-tile[data-t]::before { content: attr(data-t); }
  .m-tile .bi { font-size: 1.25rem; }
  /* line 1: what it is · the amount */
  #tblSc td.sc-c-charge, #tblUtility tbody tr > td:nth-child(2) { display: block !important; grid-area: title; min-width: 0; }
  #tblSc td.sc-c-charge > div, #tblUtility tbody tr > td:nth-child(2) .fw-600 { font-size: .98rem !important; font-weight: 600 !important; color: var(--text);
                                                                                overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  #tblSc td.sc-c-amount, #tblUtility tbody tr > td:nth-child(4) { display: block !important; grid-area: amt; text-align: right; font-size: 1rem !important;
                                                                    font-weight: 700 !important; font-family: var(--font) !important; color: var(--text); white-space: nowrap; }
  #tblSc td.sc-c-amount .text-muted { display: none; }                                  /* "/ ৳4,000": the second line says it */
  /* line 2: what happened (data-m-sub) · the status, or Record when there's money to record */
  #tblSc td.sc-c-paid, #tblUtility td.ut-c-paid { display: block !important; grid-area: sub; min-width: 0; font-size: .86rem !important;
                                                  font-family: var(--font) !important; color: var(--text-2) !important; }
  #tblSc td.sc-c-paid > *, #tblUtility td.ut-c-paid > * { display: none !important; }
  #tblSc td.sc-c-paid { font-size: 0 !important; } #tblUtility td.ut-c-paid { font-size: 0 !important; }
  #tblSc td.sc-c-paid::after, #tblUtility td.ut-c-paid::after { content: attr(data-m-sub); font-size: .86rem; overflow: hidden; text-overflow: ellipsis;
                                                                white-space: nowrap; display: block; }
  #tblSc td.m-sub-red::after, #tblUtility td.m-sub-red::after { color: var(--red); font-weight: 500; }
  #tblSc tr:not(.m-to-collect) td.sc-c-status, #tblUtility tr.m-bill-paid > td:nth-child(6) { display: block !important; grid-area: st; justify-self: end; }
  #tblSc tr.m-to-collect td.sc-c-action, #tblUtility tr:not(.m-bill-paid) > td:last-child { display: flex !important; grid-area: st; justify-self: end; }
  #tblSc .sc-c-action > *, #tblUtility tbody tr > td:last-child > * { display: none !important; }
  #tblSc .sc-c-action > [title="Record payment"], #tblUtility tbody tr > td:last-child > [title="Record payment"] {
      display: inline-flex !important; align-items: center; width: auto !important; height: 40px !important; padding: 0 14px; margin: 0 !important;
      border-radius: 999px; border: 1.5px solid var(--accent); background: var(--accent-light); color: var(--accent-dark); font-size: 0 !important; position: relative; }
  #tblSc .sc-c-action > [title="Record payment"] i, #tblUtility tbody tr > td:last-child > [title="Record payment"] i { display: none; }
  #tblSc .sc-c-action > [title="Record payment"]::before, #tblUtility tbody tr > td:last-child > [title="Record payment"]::before { content: 'Record'; font-size: .82rem; font-weight: 600; }
  #tblSc .sc-c-action > [title="Record payment"]::after, #tblUtility tbody tr > td:last-child > [title="Record payment"]::after { content: ''; position: absolute; inset: -4px -2px; }   /* 48px to tap */

  /* An empty tab or search (mobile.js emptyNote): one message in place of the list. A tab with nothing: no search
     row, no "Select" row, no "0 of 0". A search or filter that finds nothing: the search row stays to change it. */
  .dt-container.m-empty-tab > .dt-top, .dt-container:is(.m-empty-tab, .m-empty-search) .dt-foot,
  .dt-container:is(.m-empty-tab, .m-empty-search) table, .dt-container:is(.m-empty-tab, .m-empty-search) .m-selhead { display: none !important; }
  /* the message is the standard empty screen (.empty-state), in a white card like the month screens */
  .dt-container:is(.m-empty-tab, .m-empty-search) .m-empty { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
  .m-empty .empty-icon.ok { background: #E6F4EA; color: #188038; }
  /* Collections lists every card on one page on a phone: no "1–24 of 24" under it */
  .dt-container:has(#tblSc) .dt-foot { display: none !important; }

  /* "24 payments · Select" above the cards; while selecting: "2 selected · Select all · Cancel" */
  .m-selhead { display: flex; align-items: center; gap: 4px; padding: 2px 4px 8px; font-size: .9rem; color: var(--text-2); }
  .m-selhead .m-sel-n { flex: 1 1 auto; }
  .m-selhead button { border: 0; background: none; padding: 10px 8px; font: 600 .95rem var(--font); color: var(--accent); }
  .m-selhead button.m-sel-cancel { color: var(--text); }
  .m-selhead:not(.on) .m-sel-all, .m-selhead:not(.on) .m-sel-cancel, .m-selhead.on .m-sel-start { display: none; }
  .m-selhead.on .m-sel-n { color: var(--text); font-weight: 600; }
  /* selecting: a round tick where the tile was; the chosen cards get a blue edge; the cards' Record step aside */
  :is(#tblSc, #tblUtility).m-selecting .m-tile { visibility: hidden; }
  #tblSc.m-selecting td.sc-c-check, #tblUtility.m-selecting tbody tr > td:first-child { display: flex !important; position: absolute; left: 25px; top: 50%;
                                                                                         transform: translateY(-50%); }
  :is(#tblSc, #tblUtility).m-selecting :is(.sc-row-cb, .ut-row-cb) { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; margin: 0;
      border-radius: 50%; border: 2px solid #A8ADB4; background: var(--surface); display: grid; place-content: center; cursor: pointer; }
  :is(#tblSc, #tblUtility).m-selecting :is(.sc-row-cb, .ut-row-cb):checked { background: var(--accent); border-color: var(--accent); }
  :is(#tblSc, #tblUtility).m-selecting :is(.sc-row-cb, .ut-row-cb):checked::after { content: ''; width: 11px; height: 6px; border: 2.5px solid #fff;
      border-top: 0; border-right: 0; transform: translate(0, -1px) rotate(-45deg); }
  :is(#tblSc, #tblUtility).m-selecting tbody tr:has(:is(.sc-row-cb, .ut-row-cb):checked) { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent); }
  #tblSc.m-selecting tr.m-to-collect td.sc-c-action, #tblUtility.m-selecting tr:not(.m-bill-paid) > td:last-child { display: none !important; }
  #tblSc.m-selecting tr.m-to-collect td.sc-c-status, #tblUtility.m-selecting tr:not(.m-bill-paid) > td:nth-child(6) { display: block !important; grid-area: st; justify-self: end; }

  /* ═══ Money pages: month beside the title, totals in one strip, filters behind an icon ═══ */
  .m-title-slot .m-month { display: flex; align-items: center; background: var(--surface-2); border-radius: 999px; height: 36px; flex-shrink: 0; position: relative; }
  .m-title-slot .m-month .tx-nav-arrow { width: 36px; height: 36px; border: 0 !important; background: none !important; border-radius: 50%; padding: 0;
                                          display: flex; align-items: center; justify-content: center; color: var(--text-2); position: relative; }
  .m-title-slot .m-month .tx-nav-arrow::after { content: ''; position: absolute; inset: -4px 0; }       /* 44px to tap */
  .m-title-slot .m-month .tx-nav-label { border: 0 !important; background: none !important; height: 36px; padding: 0 2px; font-size: .88rem;
                                          font-weight: 600; color: var(--text); white-space: nowrap; box-shadow: none !important; }
  .m-titlebar:has(.m-month) .m-title { font-size: 1.3rem; }
  /* the date picker opens under the title, inside the screen */
  .m-title-slot .m-month .tx-date-picker { position: fixed !important; left: 8px !important; right: 8px !important; top: 104px !important; width: auto !important;
                                            max-width: none !important; z-index: 1060; }
  .m-title-slot .m-month .txdp-body { flex-direction: column; }

  /* the filter box: only its folded filters, shown when "Filters" is tapped */
  .m-money form[data-mobile-filters] { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; }
  .m-money form[data-mobile-filters] > .ms-auto { display: none !important; }        /* Add / Generate / Export: in "+ New" and the download icon */
  .m-money form.nb-mf:not(.nb-mf-open) { display: none !important; }
  .m-money form.nb-mf.nb-mf-open { display: flex !important; background: var(--surface) !important; border: 1px solid var(--border) !important;
                                   border-radius: 14px; padding: 12px !important; margin-bottom: 12px !important; }
  /* Filters: a box like Download and the search field (Transactions, Collections, Utility Bills); blue while its panel is
     open, a count badge on its corner when filters are on. No focus ring after a tap: only for the keyboard. */
  .dt-top-right .m-filter-btn { width: 44px; height: 44px; flex-shrink: 0; padding: 0 !important; border-radius: 50% !important; font-size: 0 !important;
                                display: inline-flex !important; align-items: center; justify-content: center; position: relative;
                                background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: 12px !important;
                                box-shadow: none !important; color: var(--text-2) !important; }
  .dt-top-right .m-filter-btn i { font-size: 1.05rem; margin: 0 !important; }      /* centred: the computer's "Filters" label had a gap */
  .dt-top-right .m-filter-btn .nb-mf-count { position: absolute; top: -7px; right: -7px; font-size: .66rem; min-width: 18px; height: 18px; border-radius: 9px;
                                             background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
  .dt-top-right .m-filter-btn[aria-expanded="true"] { background: var(--accent-light) !important; border-color: var(--accent) !important; color: var(--accent) !important; }
  .dt-top-right .m-filter-btn:focus:not(:focus-visible) { outline: none; box-shadow: none !important; }
  .dt-top-right .m-filter-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  /* totals: one card, three columns (Income · Expense · Net; Expected · Collected · Outstanding; Billed · Unpaid · Overdue) */
  .tx-kpi-strip { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 0 !important; border-radius: 14px;
                           background: var(--surface); border: 1px solid var(--border); box-shadow: none; }
  .tx-kpi-strip > .tx-kpi-divider, .tx-kpi-icon { display: none !important; }
  .tx-kpi-strip > .tx-kpi-item { padding: 12px 10px 12px 14px; min-width: 0; flex: none !important; }
  .tx-kpi-strip > .tx-kpi-item + .tx-kpi-item { border-left: 1px solid var(--surface-3); }
  .tx-kpi-strip > .tx-kpi-item ~ .tx-kpi-item ~ .tx-kpi-item ~ .tx-kpi-item { display: none !important; }   /* a 4th box (rate, count) */
  .tx-kpi-label { font-size: .72rem; text-transform: none; letter-spacing: 0; white-space: nowrap; }
  .tx-kpi-amount { font-size: 1rem; white-space: nowrap; }

  /* Dashboard: the month beside the title; no greeting line or "This month" button */
  .dsh-head { display: none !important; }
  .m-title-slot .m-month .bi-calendar3 { display: none; }
  .m-title-slot .m-month .tx-nav-arrow:disabled { opacity: .35; }
  .m-title-slot #kpiBmPanel { right: 0 !important; }

  /* the search row: everything on one line, centred */
  .dt-top, .dt-top-right { align-items: center !important; }
  .dt-top-right > * { margin: 0 !important; }

  /* Transactions / Collections cards: tap to open (mobile.js); no ✎ / bin on the card */
  #tblTx tbody tr, #tblSc tbody tr { cursor: pointer; }
  #tblTx .tx-c-action [title="Edit"], #tblTx .tx-c-action [title="Delete"] { display: none !important; }

  /* ═══ Sub-screens: a round ‹ in front of the title; the building switcher stays in the top row ═══ */
  .m-back { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; margin: 0 0 0 -6px;
            border-radius: 50%; color: var(--text); text-decoration: none; position: relative; }
  .m-back:hover, .m-back:active { background: var(--surface-2); color: var(--text); }
  .m-back::after { content: ''; position: absolute; inset: -4px; }                  /* 44px to tap */
  .m-back .bi { font-size: 1.2rem; }
  .m-titlebar:has(.m-back) { gap: 4px; }
  body:not(.m-rpt-open) .m-rpt-back { display: none !important; }

  /* Settings: the menu first (two groups: Your account · the building), each section on its own screen */
  .pf-wrap { flex-direction: column; gap: 0 !important; min-height: 0 !important; }
  .pf-wrap.pf-menu-mode .profile-content { display: none !important; }
  .pf-wrap.pf-section-mode .profile-vnav { display: none !important; }
  .pf-wrap.pf-menu-mode .profile-vnav { display: block; width: 100% !important; background: none; border: 0; border-radius: 0; overflow: visible; }
  .pf-wrap .pnav-h { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
                     color: var(--text-muted); margin: 18px 6px 8px; }
  .pf-wrap .pnav-h:first-child { margin-top: 4px; }
  .pf-wrap .pnav-h .bi { color: var(--accent); }
  .pf-wrap .pnav-list { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
  .pf-wrap.pf-menu-mode .profile-vnav-item { padding: 14px 16px; min-height: 52px; border-left: 0 !important; background: none !important; }
  .pf-wrap.pf-menu-mode .profile-vnav-item .pnav-name { color: var(--text) !important; font-size: .95rem; font-weight: 500; }
  .pf-wrap.pf-menu-mode .profile-vnav-item .pnav-icon { color: var(--accent) !important; }
  .pf-wrap.pf-menu-mode .profile-vnav-item::after { content: '\203A'; margin-left: auto; color: #BDC1C6; font-size: 1.3rem; line-height: 1; }

  /* Settings sections: the title bar names the section (no in-page title); cards stack, one column, big fields */
  .pf-wrap .profile-content { width: 100%; min-width: 0; padding: 0 !important; gap: 12px; }
  .pf-wrap .st-ph-row { justify-content: stretch; }
  .pf-wrap .st-ph-row .btn { flex: 1; min-height: 46px; border-radius: 999px; }
  .pf-wrap .st-hero { padding: 14px 16px; }
  .pf-wrap .st-card { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; }   /* minmax: a wide child must not widen the card past the screen */
  .pf-wrap .st-fields, .pf-wrap .st-fields.st-one { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .pf-wrap .st-lbl { font-size: .84rem; }
  .pf-wrap .st-card .form-control, .pf-wrap .st-card .form-select { min-height: 48px; font-size: 16px !important; border-radius: 12px; padding-left: 14px; padding-right: 14px; }
  .pf-wrap .st-card .form-select { padding-right: 38px; }
  .pf-wrap .st-card .input-group > .form-control, .pf-wrap .st-card .input-group > .input-group-text { min-height: 48px; font-size: 16px; }
  .pf-wrap .st-card .input-group > .input-group-text { border-radius: 12px 0 0 12px; }
  .pf-wrap .st-card .input-group > .form-control { border-radius: 0 12px 12px 0; }
  .pf-wrap .st-ut { grid-template-columns: 1fr; gap: 10px; }
  .pf-wrap .st-unit { flex-wrap: wrap; }
  .pf-wrap .m-save { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 48px; border-radius: 999px; font-size: .95rem; }
  /* sticky bottom is measured inside .nb-content's bottom padding (150px + safe area): the bar reaches the screen's
     bottom edge; while stuck there (.m-stuck, mobile.js) the floating bottom bar (76px + safe area) sits on its lower part */
  .pf-wrap .st-savebar { bottom: calc(-150px - env(safe-area-inset-bottom, 0px)); border-radius: 0; margin: 0 -12px; border-left: 0; border-right: 0;
                         padding: 10px 16px 12px; flex-wrap: wrap; background: var(--surface); }
  .pf-wrap .st-savebar.m-stuck { padding-bottom: calc(12px + 76px + env(safe-area-inset-bottom, 0px)); }
  body.m-typing .pf-wrap .st-savebar.m-stuck { padding-bottom: 12px; }
  .pf-wrap .st-savebar .st-sv-msg { flex: 1 1 100%; font-size: .8rem; }
  .pf-wrap .st-savebar .btn { flex: 1; min-height: 46px; border-radius: 999px; }
  /* users: each person a card — name and e-mail, role and status below, ··· in the corner */
  .pf-wrap .st-lh { display: none; }
  .pf-wrap .st-lr { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "who more" "role status"; row-gap: 6px; padding: 14px 12px 14px 16px; }
  .pf-wrap .st-lr .st-who { grid-area: who; }
  .pf-wrap .st-lr .st-role { grid-area: role; padding-left: 46px; font-size: .84rem; }
  .pf-wrap .st-lr > div:nth-child(3) { grid-area: status; justify-self: end; }
  .pf-wrap .st-lr .st-more { grid-area: more; }
  .pf-wrap .st-inv { grid-template-areas: "who who" "role acts"; }
  .pf-wrap .st-inv .st-inv-acts { grid-area: acts; }
  .pf-wrap .st-tlink { min-height: 40px; }
  .pf-wrap .dc-more { width: 44px; height: 44px; }
  .modal .st-opts2 { grid-template-columns: 1fr; }

  /* Settings › Categories: the phone's own block (.m-cat; the computer keeps .d-cat) — a list with Income / Expense tabs;
     a category opens as a screen of its own (‹ back to the list); Add is in "+ New" */
  .pf-wrap .d-cat { display: none; }
  .pf-wrap .m-cat { display: block; }
  .m-cat .cat-tabs { display: flex; background: #E4E7EB; border-radius: 12px; padding: 3px; margin-bottom: 12px; }
  .m-cat .cat-tabs button { flex: 1 1 0; border: 0; background: none; border-radius: 9px; padding: 8px 4px; font-size: .86rem; color: var(--text-2); }
  .m-cat .cat-tabs button.on { background: var(--surface); color: var(--accent-dark); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
  .m-cat .cat-tabs .n { color: var(--text-muted); font-weight: 500; margin-left: 4px; }
  .m-cat .cat-tbl { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
  .m-cat .cat-tbl[hidden], .m-cat .cat-panel[hidden] { display: none; }
  .m-cat .cat-r { display: flex; align-items: center; gap: 14px; padding: 0 14px 0 16px; min-height: 54px; font-size: .95rem;
                  border-top: 1px solid var(--border); cursor: pointer; }
  .m-cat .cat-r:first-child { border-top: 0; }
  .m-cat .cat-r:active, .m-cat .cp-sub:active { background: #F6F8FB; }
  .m-cat .cat-nm { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; font-weight: 500; color: var(--text); }
  .m-cat .cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-cat .cat-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
  .m-cat .cat-m { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
  .m-cat .cat-off .cat-name { color: #9AA0A6; }
  .m-cat .cat-off .cat-dot { opacity: .45; }
  .m-cat .cat-off .cat-m, .m-cat .cp-off { background: var(--surface-2); padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: .75rem; color: var(--text-muted); }
  .m-cat .cat-r::after, .m-cat .cp-sub::after { content: '\203A'; color: #BDC1C6; font-size: 1.25rem; line-height: 1; }
  .m-cat .cat-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: .85rem; }
  .m-cat .cat-builtin-note { padding: 12px 4px; line-height: 1.5; }
  body.cat-panel-open .m-cat .cat-tabs, body.cat-panel-open .m-cat .cat-tbl, body.cat-panel-open .m-cat .cat-builtin-note,
  body.cat-panel-open .m-fab { display: none !important; }
  .m-cat .cp-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
  .m-cat .cp-card .nb-label { display: block; margin: 14px 0 6px; font-size: .84rem; font-weight: 600; color: var(--text-2); }
  .m-cat .cp-card .nb-label:first-child { margin-top: 0; }
  .m-cat .cp-card .form-control { min-height: 48px; font-size: 16px !important; border-radius: 12px; padding: 0 14px; }
  .m-cat .cp-type { display: flex; background: #E4E7EB; border-radius: 12px; padding: 3px; }
  .m-cat .cp-type label { flex: 1 1 0; position: relative; display: flex; justify-content: center; margin: 0; padding: 9px 4px; border-radius: 9px;
                          font-size: .9rem; color: var(--text-2); cursor: pointer; }
  .m-cat .cp-type label:has(input:checked) { background: var(--surface); color: var(--accent-dark); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
  .m-cat .cp-type input { position: absolute; opacity: 0; pointer-events: none; }
  .m-cat .cp-coll { margin-top: 12px; }
  .m-cat .cp-coll .form-check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding-left: 0; }
  .m-cat .cp-coll .form-check-input { width: 22px; height: 22px; margin: 0; float: none; flex-shrink: 0; }
  .m-cat .cp-coll small { display: block; color: var(--text-muted); font-size: .76rem; }
  .m-cat .cp-on { display: flex; align-items: center; gap: 12px; margin: 16px -16px -16px; padding: 4px 16px; min-height: 56px; border-top: 1px solid var(--border); }
  .m-cat .cp-on label { flex: 1; font-size: .95rem; font-weight: 500; }
  .m-cat .cp-on small { display: block; font-size: .76rem; color: var(--text-muted); font-weight: 400; margin-top: 2px; }
  .m-cat .cp-on .form-check-input { width: 2.6em; height: 1.4em; }
  .m-cat .cp-sub-h { margin: 20px 4px 8px; font-size: .74rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-muted); }
  .m-cat .cp-sub-list { background: var(--surface); border: 1px solid var(--border); border-radius: 14px 14px 0 0; overflow: hidden; }
  .m-cat .cp-sub-list:empty { display: none; }
  .m-cat .cp-sub { display: flex; align-items: center; gap: 8px; min-height: 54px; padding: 0 14px 0 16px; font-size: .95rem; border-top: 1px solid var(--border); cursor: pointer; }
  .m-cat .cp-sub:first-child { border-top: 0; }
  .m-cat .cp-sub-nm { flex: 1; min-width: 0; }
  .m-cat .cp-sub-off .cp-sub-nm { color: #9AA0A6; }
  .m-cat .cp-sub .btn-tbl-action { display: none; }
  .m-cat .cp-add-sub { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 0 16px; background: var(--surface);
                       border: 1px solid var(--border); border-top: 0; border-radius: 0 0 14px 14px; color: var(--accent); font-weight: 600; font-size: .95rem; }
  .m-cat .cp-sub-list:empty + .cp-add-sub { border-top: 1px solid var(--border); border-radius: 14px; }
  .m-cat .cp-del { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; border: 0; background: none; color: #C5221F;
                   font-weight: 600; font-size: .92rem; padding: 20px 0 6px; }
  .m-cat .cat-panel.cp-new .cp-del, .m-cat .cat-panel.cp-new #mCatSubs, .m-cat .cat-panel.cp-new #mCatOnRow { display: none !important; }
  /* sticky bottom is measured inside .nb-content's bottom padding (150px + safe area): the footer reaches the screen's
     bottom edge; while stuck there (.m-stuck, mobile.js) the floating bottom bar (76px + safe area) sits on its lower part */
  .m-cat .cp-f { position: sticky; bottom: calc(-150px - env(safe-area-inset-bottom, 0px)); z-index: 3; display: flex; margin: 16px -12px 0;
                 padding: 10px 16px 12px; background: var(--surface); border-top: 1px solid var(--surface-3); }
  .m-cat .cp-f.m-stuck { padding-bottom: calc(12px + 76px + env(safe-area-inset-bottom, 0px)); }
  body.m-typing .m-cat .cp-f.m-stuck { padding-bottom: 12px; }
  .m-cat .cp-f .btn-primary { flex: 1; min-height: 48px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
  /* a subcategory: a small sheet (name only — the category is the screen it was opened from) */
  body.cat-panel-open #subParentRow { display: none; }
  #subcategoryModal .modal-footer [data-bs-dismiss] { display: none !important; }
  #subcategoryModal .modal-footer .btn-primary { flex: 1 1 auto; }

  /* Reports: the list first, a report full width */
  .rpt-layout.m-rpt-menu .rpt-main { display: none !important; }
  .rpt-layout:not(.m-rpt-menu) .rpt-sidebar { display: none !important; }
  .rpt-layout .rpt-sidebar { border-radius: 14px; }
  .rpt-layout.m-rpt-menu .rpt-nav-item { min-height: 56px; }
  .rpt-layout.m-rpt-menu .rpt-nav-item.active { background: none; border-left-color: transparent; }
  .rpt-layout.m-rpt-menu .rpt-nav-item.active .rpt-nav-name { color: var(--text); }
  /* the phone's menu: every report alike — a blue icon and a blue subtitle under a dark title (nothing looks "chosen") */
  .rpt-layout.m-rpt-menu .rpt-nav-icon { color: var(--accent) !important; }
  .rpt-layout.m-rpt-menu .rpt-nav-desc { color: var(--accent-hover) !important; }

  .tx-kpi-strip .tx-kpi-body > div:not(.tx-kpi-label):not(.tx-kpi-amount) { display: none; }   /* "All accounts combined" */

  /* Accounts: one line per account — name, "Bank · ****4321", balance; the page's Add is in "+ New" */
  .acc-row { padding: 14px 14px !important; gap: 12px !important; }
  .acc-row .nb-badge, .acc-row a[href*="/transactions?account="], .acc-row a[href*="/transactions?account="] ~ *, .acc-row span[style*="color:var(--border)"] { display: none !important; }
  .acc-row .text-end > div:nth-child(2) { display: none; }                          /* "Current balance" */
  .pf-wrap [data-bs-target="#addAccountModal"] { display: none !important; }

  /* Approvals: segmented tabs; Reject and Approve as two wide buttons */
  .drawer-tabs { background: #E4E7EB; border-radius: 12px; padding: 3px; display: flex; flex-wrap: nowrap; }
  .drawer-tabs .nav-item { flex: 1 1 0; padding: 0 !important; margin: 0; background: none !important; }
  .drawer-tabs .drawer-tab-link { display: block; width: 100%; text-align: center; border: 0 !important; border-radius: 9px; padding: 8px 4px; font-size: .85rem; color: var(--text-2); }
  .drawer-tabs .drawer-tab-link.active { background: var(--surface); color: var(--accent-dark); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
  div:has(> .drawer-tabs) { border-bottom: 0 !important; }
  .approval-item { flex-wrap: wrap; }
  .approval-item > .d-flex.flex-column { flex: 1 1 100%; flex-direction: row-reverse !important; gap: 8px !important; margin-top: 10px; }
  .approval-item > .d-flex.flex-column > .btn { flex: 1 1 0; height: 44px; border-radius: 999px; font-weight: 600; }

  /* ═══ Forms full screen (small confirmations stay small); Save stays above the keyboard ═══ */
  .modal-dialog:not(.modal-sm) { margin: 0 !important; max-width: none !important; width: 100% !important; min-height: 100%; height: 100%; }
  .modal-dialog:not(.modal-sm) > .modal-content { min-height: 100%; height: 100%; border: 0; border-radius: 0; }
  .modal-dialog:not(.modal-sm) .modal-body { flex: 1 1 auto; overflow-y: auto; }
  .modal-dialog:not(.modal-sm) .modal-footer { position: sticky; bottom: 0; background: var(--surface); padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .modal-footer .m-del-btn { margin-right: auto; color: var(--red); border: 1.5px solid #F2B8B5; background: var(--surface); border-radius: 999px; font-weight: 600; }

  /* ═══ The unit popup: full screen, segmented tabs ═══ */
  .up-wrap { padding: 0 !important; }
  .up-dlg { width: 100% !important; max-width: none !important; height: 100%; max-height: none !important; border-radius: 0 !important; }
  .up-head { padding: 10px 12px 0 16px !important; }
  .up-tabs { margin: 10px 12px 0; padding: 3px !important; border: 0 !important; background: #E4E7EB; border-radius: 12px; overflow: visible; }
  .up-tab { flex: 1 1 0; text-align: center; justify-content: center; border: 0 !important; border-radius: 9px; padding: 8px 4px !important; margin: 0 !important; }
  .up-tab.on { background: var(--surface); color: var(--accent-dark); box-shadow: 0 1px 3px rgba(0,0,0,.18); }

  /* a segmented bar made by mobile.js (Collections: To collect · Paid · All) */
  .m-seg { display: flex; background: #E4E7EB; border-radius: 12px; padding: 3px; margin-bottom: 12px; }
  .m-seg button { flex: 1 1 0; min-width: 0; border: 0; background: none; border-radius: 9px; padding: 8px 4px; font-size: .85rem; font-weight: 500;
                  color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
  .m-seg button.on { background: var(--surface); color: var(--accent-dark); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
  .m-seg-n { font-size: .72rem; font-weight: 600; background: #D5D9DE; color: #3C4043; border-radius: 999px; padding: 1px 7px; }
  .m-seg button.on .m-seg-n { background: var(--accent-light); color: var(--accent); }

  /* Transactions grouped by day: the date once above the day's cards, not on every card */
  #tblTx tbody tr.m-day { display: block; padding: 14px 4px 6px !important; border: 0 !important; background: none !important; cursor: default; }
  #tblTx tbody tr.m-day > td { display: block !important; font-size: .8rem; font-weight: 700; color: var(--text-2); }
  #tblTx.m-days .tx-c-date { display: none !important; }

  /* the search row stays at the top while the list scrolls (the totals scroll away) */
  .dt-container > .dt-top { position: sticky; top: -12px; z-index: 6; background: var(--bg) !important; padding-top: 12px !important; margin: -12px 0 0 !important; }
  /* …inside a white card (Transactions, Collections, Utility): the card's own white, and room on both sides — the search
     box and the filter button touched the card's edges over a grey band */
  /* the totals strip's "this month / overall" tag sits under its label on a phone (it ran past the edge on Utility) */
  .tx-kpi-label .kpi-scope:not([hidden]) { display: table; margin: 3px 0 0; }
  .nb-card:not(:has(table.m-cards, #tblSc)) .dt-container > .dt-top { background: var(--surface) !important; top: 0; margin: 0 !important;
    padding: 12px 12px 12px !important; border-radius: inherit; }

  /* unit popup header on a phone: "‹ Units" · "‹ A2 ›" · ⋯ */
  .up-head { display: grid !important; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: 2px; padding: 8px 8px 0 !important; }
  .up-head .up-tools { display: contents; }
  .up-head #up-chip, .up-head #up-sub, .up-head #up-viewonly { display: none; }
  .up-head #up-close { grid-column: 1; grid-row: 1; justify-self: start; width: auto; border-radius: 8px; padding: 0 8px; color: var(--accent); font-size: .92rem;
                       font-weight: 500; display: flex; align-items: center; gap: 4px; }
  .up-head #up-close i { display: none; }
  .up-head #up-close::before { font-family: bootstrap-icons; content: "\f284"; font-size: .9rem; }
  .up-head #up-close::after { content: 'Units'; }
  .up-head #up-prev { grid-column: 2; grid-row: 1; }
  .up-head h2 { grid-column: 3; grid-row: 1; font-size: 1.15rem !important; font-weight: 700; padding: 0 6px; }
  .up-head #up-next { grid-column: 4; grid-row: 1; }
  .up-head #up-more { grid-column: 5; grid-row: 1; justify-self: end; }
  .up-head #up-prev i, .up-head #up-next i { display: none; }
  .up-head #up-prev::before { font-family: bootstrap-icons; content: "\f284"; }
  .up-head #up-next::before { font-family: bootstrap-icons; content: "\f285"; }
  .up-head #up-prev, .up-head #up-next { background: var(--surface-2); }
  /* money owed: a red dot on the Collections tab instead of the long label */
  .up-tab .up-badge:not([hidden]) { font-size: 0 !important; width: 7px; height: 7px; padding: 0 !important; border-radius: 50%; background: var(--red) !important;
                                     display: inline-block; vertical-align: top; margin-left: -2px; }
  .up-tab i { display: none; }
  .up-people { grid-template-columns: 1fr !important; }
  /* advances held is money kept, not a warning: a blue dot */
  .up-tab .up-badge.adv:not([hidden]) { background: var(--accent) !important; }
  /* Overview: the three figures as compact rows (label and note left, amount right) */
  .up-tiles.ov { gap: 6px !important; }
  .up-tiles.ov .up-tile { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "k v" "h v"; align-items: center; padding: 10px 14px; }
  .up-tiles.ov .up-tile .k { grid-area: k; }
  .up-tiles.ov .up-tile .h { grid-area: h; margin-top: 0; }
  .up-tiles.ov .up-tile .v { grid-area: v; font-size: 18px; margin: 0; }
  .up-fin { gap: 6px !important; }
  .up-fin-i { display: grid !important; grid-template-columns: 1fr auto; grid-template-areas: "k v" "h v" "a a"; align-items: center; text-align: left !important; }
  .up-fin-i .up-fin-act { grid-area: a; padding-top: 10px; }
  .up-fin-i .k { grid-area: k; } .up-fin-i .h { grid-area: h; } .up-fin-i .v { grid-area: v; font-size: 18px; margin: 0; }
  .up-ov-acts [data-goto="coll"] { display: none; }     /* the Payments tab is right above */

  /* Vendors: Current · Past only (search finds anyone; "All" is not needed on a phone) */
  .gm-tabs-list > li:has(> a.gm-tab[href*="show=all"]) { display: none !important; }

  /* the bell: a light outline like the bottom bar's icons, not a heavy solid one */
  .nb-bell .bi-bell-fill::before { content: "\f18a"; }
  .nb-bell .topbar-icon-btn { color: var(--text-2); }

  /* a report on a phone: titled with its name; filters in one compact row (month · account · PDF); full width */
  .rpt-main { width: 100%; min-width: 0; }
  /* Annual Summary: all five columns on the screen — "Jan … Dec" (the year is in the period picker), tighter cells; if a
     building's amounts are very large it scrolls sideways inside its card instead of being cut off */
  .rpt-annual-card { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  /* the short month is drawn from data-m-short, so the page's text (and anything reading it) keeps "January 2026" only */
  .rpt-annual-card td.rpt-month[data-m-short]::before { content: attr(data-m-short); }
  .rpt-annual-card .stmt-table th, .rpt-annual-card .stmt-table td { padding: 10px 6px !important; font-size: .82rem !important; white-space: nowrap; }
  .rpt-annual-card .stmt-table :is(th, td[colspan], td:first-child) { white-space: normal !important; }   /* headings and labels may wrap; amounts don't */
  .rpt-annual-card .stmt-table :is(th, td):first-child { padding-left: 12px !important; }
  .rpt-annual-card .stmt-table :is(th, td):last-child { padding-right: 12px !important; }
  @media (max-width: 375px) {                                                         /* narrow phones (360px) */
    .rpt-annual-card .stmt-table th, .rpt-annual-card .stmt-table td { padding: 9px 4px !important; font-size: .76rem !important; }
    .rpt-annual-card .stmt-table :is(th, td):first-child { padding-left: 10px !important; }
    .rpt-annual-card .stmt-table :is(th, td):last-child { padding-right: 10px !important; }
  }
  .rpt-view-header { display: none !important; }
  #rptFilterBar form { flex-direction: row !important; flex-wrap: nowrap !important; align-items: center !important; gap: 8px !important; margin-bottom: 12px !important; }
  #rptFilterBar .tx-nav-label { padding: 0 !important; min-width: 0; }
  #rptFilterBar .nb-label { display: none !important; }
  #rptFilterBar form > div { min-width: 0; flex: 0 0 auto !important; width: auto !important; margin: 0 !important; }
  #rptFilterBar form > div:has(#rptAccountSelect) { flex: 1 1 0 !important; }
  #rptFilterBar #rptAccountSelect { width: 100% !important; }
  #rptFilterBar #rptAccountSelect { height: 40px; border-radius: 12px; font-size: .84rem; padding-left: 10px; padding-right: 26px; background-position: right 8px center; }
  #rptFilterBar form > a.btn { display: none !important; }                          /* Reset */
  #rptFilterBar form > button.btn { width: 44px; height: 44px; min-height: 44px; padding: 0 !important; font-size: 0 !important; border-radius: 50%; margin: 0 !important; flex-shrink: 0; }
  #rptFilterBar form > button.btn i { font-size: 1.1rem; }
  /* the report's Download menu: the same box as the list pages' (rounded square, white, thin border), always last in the row */
  .rpt-dl-moved, #rptFilterBar form > .rpt-dl-moved, .rpt-controls > .rpt-dl-moved { margin-left: auto !important; flex-shrink: 0; }
  .rpt-dl-moved .rpt-dl { width: 44px; height: 44px; min-height: 44px; padding: 0 !important; font-size: 0 !important; border-radius: 12px !important;
                          border: 1px solid var(--border) !important; background: var(--surface) !important; color: var(--text-2) !important; box-shadow: none !important; }
  .rpt-dl-moved .rpt-dl[aria-expanded="true"] { border-color: var(--accent) !important; background: var(--accent-light) !important; color: var(--accent) !important; }
  /* Annual Summary and Outstanding Dues: their own row, built the same — the year in the grey pill (no "Period" label) */
  .rpt-controls { display: flex !important; align-items: center !important; gap: 8px !important; margin-bottom: 12px !important; }
  .rpt-controls:empty { display: none !important; }                                 /* Outstanding with nothing to download */
  .rpt-controls .nb-label { display: none !important; }
  .rpt-controls .tx-date-nav { display: flex; align-items: center; background: var(--surface-2); border-radius: 999px; height: 40px; gap: 0; }
  .rpt-controls .tx-nav-arrow { width: 34px; height: 40px; border: 0 !important; background: none !important; padding: 0; display: flex; align-items: center; justify-content: center; }
  .rpt-controls .tx-nav-label { border: 0 !important; background: none !important; font-size: .86rem; font-weight: 600; white-space: nowrap; padding: 0 6px; min-width: 0; }
  .rpt-dl-moved .rpt-dl i { font-size: 1.1rem; margin: 0 !important; }
  .rpt-dl-moved .rpt-dl.dropdown-toggle::after { display: none; }
  #rptFilterBar .tx-date-nav { display: flex; align-items: center; background: var(--surface-2); border-radius: 999px; height: 40px; }
  #rptFilterBar .tx-nav-arrow { width: 34px; height: 40px; border: 0 !important; background: none !important; padding: 0; }
  #rptFilterBar .tx-nav-label { border: 0 !important; background: none !important; font-size: .86rem; font-weight: 600; white-space: nowrap; padding: 0 2px; }
  #rptFilterBar .tx-date-picker { position: fixed !important; left: 8px !important; right: 8px !important; top: 150px !important; width: auto !important; z-index: 1060; }

  /* ═══ Forms on a phone (every dialog): one column, big fields, Save at the bottom ═══════════════════
     Header: title + ✕, fixed at the top. Body: one column. Fields: 48px tall, 16px text (smaller text makes an
     iPhone zoom in when you tap the field). Footer: fixed at the bottom; the main button wide; Cancel goes (✕ does it). */
  .modal-dialog:not(.modal-sm) .modal-header { position: sticky; top: 0; z-index: 4; background: var(--surface); min-height: 56px;
                                               padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--surface-3); }
  .modal-dialog:not(.modal-sm) .modal-title { font-size: 1.05rem !important; font-weight: 700 !important; color: var(--text); }
  .modal-dialog:not(.modal-sm) .modal-title > i.bi:first-child { display: none; }       /* decorative icon */
  .modal-dialog:not(.modal-sm) .modal-header .btn-close { width: 44px; height: 44px; padding: 0; margin: 0 0 0 auto; border-radius: 50%; background-size: 14px; }
  .modal-dialog:not(.modal-sm) .modal-body { padding-bottom: 24px; }

  /* one column: Bootstrap grid columns and side-by-side field rows stack */
  .modal .row > [class*="col"] { flex: 0 0 100%; max-width: 100%; }
  .modal .row { --bs-gutter-x: 0; row-gap: 14px; }
  .modal .pf-form-row { grid-template-columns: 1fr !important; }

  /* fields */
  .modal .form-control, .modal .form-select, .modal textarea,
  .modal input[type="text"], .modal input[type="number"], .modal input[type="email"], .modal input[type="tel"],
  .modal input[type="password"], .modal input[type="date"], .modal input[type="search"], .modal select {
      min-height: 48px; font-size: 16px !important; border-radius: 12px; padding-left: 14px; padding-right: 14px; }
  .modal textarea { min-height: 88px; padding-top: 12px; }
  .modal .form-select, .modal select.form-select { padding-right: 38px; background-position: right 14px center; }
  .modal .input-group > .form-control, .modal .input-group > .input-group-text { min-height: 48px; }
  .modal .input-group-text { font-size: 16px; border-radius: 12px; }
  .modal .form-label, .modal .nb-label, .modal label.small, .modal .x-small.form-label { font-size: .84rem !important; font-weight: 600; color: var(--text-2) !important; margin-bottom: 6px; }
  .modal .form-check-input { width: 22px; height: 22px; margin-top: 0; }
  .modal .form-check { display: flex; align-items: center; gap: 10px; min-height: 44px; padding-left: 0; }
  .modal .form-check .form-check-input { margin-left: 0; float: none; flex-shrink: 0; }
  .modal .modal-body .btn-sm { min-height: 44px; padding-left: 16px; padding-right: 16px; font-size: .9rem; }

  /* footer: the main button wide; Cancel hidden when there's a main button (✕ closes) */
  .modal-dialog:not(.modal-sm) .modal-footer { display: flex; flex-wrap: nowrap; gap: 10px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
                                               border-top: 1px solid var(--surface-3); box-shadow: 0 -4px 12px rgba(0,0,0,.04); }
  .modal-dialog:not(.modal-sm) .modal-footer > * { margin: 0 !important; }
  .modal-dialog:not(.modal-sm) .modal-footer:has(.btn-primary, .btn-success, .btn-danger:not(.m-del-btn)) > [data-bs-dismiss="modal"]:not(.btn-primary) { display: none !important; }
  .modal-dialog:not(.modal-sm) .modal-footer .btn { min-height: 48px; border-radius: 999px; font-size: .95rem; font-weight: 600; padding: 0 20px; }
  .modal-dialog:not(.modal-sm) .modal-footer .btn-primary, .modal-dialog:not(.modal-sm) .modal-footer .btn-success,
  .modal-dialog:not(.modal-sm) .modal-footer .btn-danger:not(.m-del-btn) { flex: 1 1 auto; }

  /* forms are full screens, not the old bottom sheet (no grab handle, no height cap) */
  .modal-dialog:not(.modal-sm) { position: fixed !important; inset: 0 !important; height: 100% !important; }
  .modal-dialog:not(.modal-sm) > .modal-content { border-radius: 0 !important; box-shadow: none !important; padding-bottom: 0; }
  .modal-dialog:not(.modal-sm) .modal-header::before { display: none !important; }
  .modal-dialog:not(.modal-sm) .modal-header { flex-direction: row !important; }
  .modal-dialog:not(.modal-sm) .modal-header .btn-close { position: static !important; }
  .modal-dialog:not(.modal-sm) .modal-body { max-height: none !important; }
  .modal-footer .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.2; }
  .modal-footer .btn > i { margin: 0 !important; }
  .modal-dialog:not(.modal-sm) .modal-footer:has(.btn-primary, .btn-success) .btn-outline-secondary[data-bs-dismiss="modal"] { display: none !important; }
  /* a footer that wraps its buttons in a group (Add New Units): the group takes the width */
  .modal-dialog:not(.modal-sm) .modal-footer > .d-flex { flex: 1 1 auto; }
  .modal-dialog:not(.modal-sm) .modal-footer > .d-flex > .btn-primary { flex: 1 1 auto; }
  .modal-dialog:not(.modal-sm) .modal-footer > div:empty { display: none; }

  /* small confirmations stay a bottom sheet, with thumb-size buttons */
  .modal-dialog.modal-sm .modal-footer .btn { min-height: 44px; border-radius: 999px; flex: 1 1 0; font-weight: 600; }

  /* Pay salaries: one card per person — [☐] name / role, then Salary and Bonus side by side, then status */
  #psTable { display: block; width: 100% !important; }
  #psTable thead { display: none; }
  #psTable tbody { display: flex; flex-direction: column; gap: 10px; }
  #psTable tbody tr { display: grid; grid-template-columns: 28px 1fr 1fr; column-gap: 10px; row-gap: 8px; align-items: center;
                      background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
  #psTable tbody td { display: block; border: 0 !important; padding: 0 !important; min-width: 0; }
  #psTable tbody td[colspan] { grid-column: 1 / -1; }
  #psTable tbody td:nth-child(1) { grid-column: 1; grid-row: 1; }
  #psTable tbody td:nth-child(2) { grid-column: 2 / 4; grid-row: 1; font-weight: 600; }
  #psTable tbody td:nth-child(3) { grid-column: 2; grid-row: 2; }
  #psTable tbody td:nth-child(4) { grid-column: 3; grid-row: 2; }
  #psTable tbody td:nth-child(5) { grid-column: 2 / 4; grid-row: 3; }
  #psTable tbody td:nth-child(3)::before { content: 'Salary'; display: block; font-size: .78rem; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
  #psTable tbody td:nth-child(4)::before { content: 'Bonus'; display: block; font-size: .78rem; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
  #psTable .ps-pick { width: 22px; height: 22px; }
  #psTable .form-control { text-align: left !important; }
  #psTable tbody td.num { text-align: left !important; }

  /* Add New Units: per unit — name across the width, then size and charge side by side; ✕ top right */
  #addUnitModal .unit-row-header, #addUnitModal .unit-entry-row { display: grid !important; grid-template-columns: 1fr 1fr 44px; gap: 8px; }
  #addUnitModal .ucol-name { grid-column: 1 / 3; grid-row: 1; }
  #addUnitModal .ucol-del  { grid-column: 3; grid-row: 1; }
  #addUnitModal .ucol-num  { grid-row: 2; }
  #addUnitModal .ucol-num ~ .ucol-num ~ .ucol-num { grid-row: 3; }
  #addUnitModal .unit-entry-row { padding: 12px 0; }
  #addUnitModal .btn-del-row { width: 44px; height: 48px; }   /* 44px to tap, the button standard */

  /* the unit popup's own dialogs (change owner / resident, record payment, meters, rename): full screen like every form */
  .up-swrap { padding: 0 !important; background: var(--surface); }
  .up-sdlg, .up-sdlg.narrow { width: 100% !important; max-width: none; height: 100%; max-height: none !important; border-radius: 0 !important; box-shadow: none;
                              display: flex; flex-direction: column; overflow: hidden; }
  .up-s-head { position: sticky; top: 0; min-height: 56px; padding: 8px 8px 8px 16px !important; border-bottom: 1px solid var(--surface-3); background: var(--surface); flex-shrink: 0; }
  .up-s-head h3 { font-size: 1.05rem !important; font-weight: 700 !important; }
  .up-s-head .up-ib { width: 40px; height: 40px; }
  .up-s-body { flex: 1 1 auto; overflow-y: auto; padding: 16px !important; }
  .up-s-body input:not([type=checkbox]):not([type=radio]), .up-s-body select, .up-s-body textarea {
      min-height: 48px; font-size: 16px !important; border-radius: 12px; width: 100%; }
  .up-s-body label, .up-s-body .lbl { font-size: .84rem; font-weight: 600; color: var(--text-2); }
  .up-s-foot { flex-shrink: 0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)) !important; border-top: 1px solid var(--surface-3);
               box-shadow: 0 -4px 12px rgba(0,0,0,.04); background: var(--surface); }
  .up-s-foot .up-btn { min-height: 48px; border-radius: 999px; font-size: .95rem; font-weight: 600; padding: 0 20px; }
  .up-s-foot .up-btn-primary, .up-s-foot .up-btn-danger { flex: 1 1 auto; justify-content: center; }
  .up-s-foot:has(.up-btn-primary, .up-btn-danger) [data-close] { display: none; }        /* ✕ closes */

  .up-input { height: 48px !important; font-size: 16px !important; border-radius: 12px; }
  .up-date { max-width: none !important; }
  .up-date .up-input { border-radius: 12px 0 0 12px; }
  .up-date button { border-radius: 0 12px 12px 0; min-width: 48px; }
  .up-money .up-input { border-radius: 0 12px 12px 0; }
}

/* ═══ Buttons on a phone (the button standard, docs/audits/buttons.html): nothing smaller than 44px to tap ═══ */
@media (max-width: 768px), (hover: none) and (pointer: coarse) and (max-height: 500px) {
  .btn, .btn-sm, .btn-dt-download, .nb-btn-outline, .nb-btn-ghost, .btn-add-row, .txdp-btn-apply, .txdp-btn-cancel { min-height: 44px; }
  .btn-sm { --bs-btn-padding-x: 16px; --bs-btn-font-size: 14px; }
  .input-group > .btn { min-height: 0; }
  .up-btn, .up-btn-sm { height: 44px; padding: 0 18px; font-size: 14px; }
  .up-ib { width: 44px; height: 44px; }
  .up-mrow .up-ib, .up-picked .up-ib { width: 44px; height: 44px; }
  .btn-tbl-action, .dc-more, .btn-del-row { width: 44px; height: 44px; font-size: 17px; }
  .btn-tbl-slot { width: 44px; height: 44px; }
  .btn-close { width: 44px; height: 44px; background-size: 14px; }
  .m-sheet-h .btn-close { margin-right: -10px; }
  .nb-pw-btn { width: 40px !important; height: 40px !important; }
  .btn-kpi-nav { width: 44px; height: 44px; }
}

/* Small phones (320–340px): the title beside a month picker was cut ("Dashboar", "Collection") — release audit UI-03 */
@media (max-width: 340px) {
  .m-titlebar:has(.m-month) { gap: 6px; }
  .m-titlebar:has(.m-month) .m-title { font-size: 1.08rem; letter-spacing: -.2px; }
  .m-title-slot .m-month .tx-nav-arrow { width: 30px; }
  .m-title-slot .m-month .tx-nav-label { font-size: .82rem; }
}
@media (max-width: 768px), (hover: none) and (pointer: coarse) and (max-height: 500px) {
  .up-ov-acts [data-goto="coll"] { display: none; }     /* the Payments tab is right above */
}

/* ═══ Form controls on a phone, from the phone audit of every form (QA 27 Nov 2026): 44px to tap ═══ */
@media (max-width: 768px), (hover: none) and (pointer: coarse) and (max-height: 500px) {
  .sc-status-chip { min-height: 44px; padding: 0 16px; font-size: 14px; display: inline-flex; align-items: center; }   /* status: Paid · Pending … */
  .sc-status-chips { gap: 8px; }
  .tx-type-btn { min-height: 44px; }                                                     /* Expense · Income · Transfer */
  .modal .btn-add-row { min-height: 44px; }                                              /* Add unit: "Add another unit" */
  /* (the settings page's own styles come after this file: .pf-wrap makes these win) */
  .pf-wrap .rc-colors { gap: 14px; }
  .pf-wrap .rc-colors button { width: 40px; height: 40px; }                              /* Receipts: colour */
  .pf-wrap .rc-sw { min-height: 52px; }
  .pf-wrap .st-ug-add { min-height: 44px; }                                              /* Building details: Add meter */
  .pf-wrap .st-ug-tog { width: 44px; height: 44px; }
}
