/* ============================================================================
   AU ONE ERP · mobile-responsive.css — CONSTRUCTION, PHONE PRESENTATION ONLY
   ----------------------------------------------------------------------------
   Owner, 2026-09-03: "Do not squeeze a desktop page into a phone. REFLOW
   desktop content into a real mobile composition. NO SIDEWAYS PAGE SCROLLING."

   SCOPE. Every rule lives inside `@media screen and (max-width:768px)` (with
   tighter tiers at 430px and 360px). Desktop and tablet are untouched, and
   `@media print` is never mentioned — the liquidation form, the weekly PDF and
   every official layout still print as the tables they are.

   NOT AN OVERFLOW BANDAGE. There is no `overflow-x:hidden` page fix, no zoom,
   no transform:scale, no 8px type, no ellipsis on a peso amount. Each rule
   removes the actual CAUSE: a forced `min-width:1000px`, a `width:max-content`,
   a 12-column grid on a 390px screen.

   THE ONE PATTERN, USED FIVE TIMES. A desktop table becomes a stack of cards
   with NO second copy of the DOM:

       table  → display:block                (drops its own min-width)
       thead  → display:none                 (labels move onto the cells)
       tr     → display:grid                 (the card)
       td     → display:block                (a labelled field in the card)
       td::before { content:attr(data-l) }   (the column name, as a label)

   `data-l` was added to the existing generated <td>s in petty-cash.js,
   billing.js and dashboards.js — ATTRIBUTES ONLY. No value, handler, id,
   class, colspan or event changed, so there is exactly ONE set of live inputs:
   no mobile clone, no duplicate ids, no double save, no second listener. Every
   field keeps its DOM identity, so the existing per-field autosave and the
   granular realtime patching still address the very same node — a mobile card
   is the same <input> in a different box. This file issues zero requests.

   WHY EVERY SELECTOR STARTS `html body`. Several Construction modules inject
   their stylesheet from JavaScript at render time (petty-cash.js,
   monthly-schedule.js, project-dashboard.js, tracker-modules.js,
   request-detail-fields.js …). Those <style> elements land in <head> AFTER
   this <link>, so at equal specificity they win — measured: the petty ledger
   came back to `min-width:980px` and the page overflowed by 602px. The prefix
   costs two element selectors and settles it by specificity rather than by
   load order. `!important` is used only on the load-bearing declarations —
   the ones that delete a forced width or rebuild a row — because a handful of
   injected rules carry an attribute selector and would otherwise still win.

   SECTIONS: 0 shell · 1 petty · 2 summary · 3 month-by-month · 4 CEO
             · 5 QPAD/DWB · 6 schedule · 7 type, targets, floating controls.
   ============================================================================ */

@media screen and (max-width:768px){

  /* ══ 0 · SHELL ═══════════════════════════════════════════════════════════ */
  html body{ max-width:100%; }
  html body main{
    padding-left:14px; padding-right:14px;
    max-width:100%; box-sizing:border-box;
    padding-bottom:104px;             /* somewhere to scroll past the FABs */
  }
  /* long names/emails/notes wrap instead of setting the page width */
  html body .view p, html body .view li,
  html body .plsite, html body .plgrpn, html body .mssubn,
  html body .rctext, html body .poc-text,
  html body .cdash-tbl td, html body .ctsum td,
  html body .pltbl td, html body .wbrow td{ overflow-wrap:anywhere; }

  /* THE HEADER — the title wins the width, the subtitle yields. */
  html body .au-shellbar{ max-width:100%; }
  html body .au-shellbar .au-sh-title{ min-width:0; }
  html body .au-shellbar .au-sh-app{
    font-size:15px; line-height:1.15;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  html body .au-shellbar .au-sh-mod{
    font-size:9.5px; max-width:100%;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }

  /* FLATTEN THE NESTING — band → month → week → site each added its own inset;
     six levels of 12px left the form ~60% of the screen. One inset up top,
     hairlines and background for hierarchy below. */
  html body .dwb2 .wbbandbody, html body .dwb2 .wbmonbody,
  html body .dwb2 .wbwkbody,   html body .dwb2 .wbsite{
    padding-left:0 !important; padding-right:0 !important;
  }
  html body .dwb2 .wbmon{ padding:6px 0 !important; }
  html body .dwb2 .wbsitehd{ padding-left:10px !important; padding-right:10px !important; }

  /* ══ THE SHARED TABLE→CARD RECIPE ════════════════════════════════════════ */
  html body .pltbl, html body .pltbl.pltblfit,
  html body .ctsum, html body .cdash-tbl, html body .dwb2 .wbtbl{
    display:block !important; width:100% !important; max-width:100% !important;
    min-width:0 !important; table-layout:auto !important;
    border-collapse:separate; border-spacing:0;
  }
  html body .pltbl > thead, html body .ctsum > thead,
  html body .cdash-tbl > thead, html body .dwb2 .wbtbl > thead,
  html body .pltbl > colgroup{ display:none !important; }
  html body .pltbl > tbody, html body .ctsum > tbody,
  html body .cdash-tbl > tbody{ display:block !important; }

  /* the card */
  html body .pltbl > tbody > tr,
  html body .ctsum > tbody > tr,
  html body .cdash-tbl > tbody > tr,
  html body .dwb2 .wbreq{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px 12px; align-items:start;
    margin:0 0 10px; padding:12px;
    border:1px solid var(--line); border-radius:14px; background:var(--paper2);
  }
  /* a labelled field inside it */
  html body .pltbl > tbody > tr > td,
  html body .ctsum > tbody > tr > td,
  html body .cdash-tbl > tbody > tr > td,
  html body .dwb2 .wbreq > tr > td{
    display:block !important; width:auto !important; min-width:0 !important;
    padding:0 !important; border:0 !important; background:transparent;
    text-align:left !important; white-space:normal !important; vertical-align:top;
  }
  html body .pltbl > tbody > tr > td::before,
  html body .ctsum > tbody > tr > td::before,
  html body .cdash-tbl > tbody > tr > td::before,
  html body .dwb2 .wbreq > tr > td::before{
    content:attr(data-l); display:block; margin-bottom:4px;
    font:800 10px/1.2 system-ui,sans-serif; letter-spacing:.05em;
    text-transform:uppercase; color:var(--muted);
  }
  /* a cell with no column name (the actions cell) prints no label */
  html body .pltbl > tbody > tr > td:not([data-l])::before,
  html body .ctsum > tbody > tr > td:not([data-l])::before,
  html body .cdash-tbl > tbody > tr > td:not([data-l])::before,
  html body .dwb2 .wbreq > tr > td:not([data-l])::before,
  html body .pltbl > tbody > tr > td[data-l=""]::before,
  html body .dwb2 .wbreq > tr > td[data-l=""]::before{ content:none !important; }

  /* Every control inside a card takes the card's width — except a checkbox or
     radio, which is a fixed-size glyph. Without the exclusion the Summary
     card's SEEN tick stretched to 44px and pushed its own label out of view. */
  html body .pltbl .plin, html body .dwb2 .wbreq .wbin,
  html body .cdash-tbl input:not([type=checkbox]):not([type=radio]),
  html body .ctsum input:not([type=checkbox]):not([type=radio]){
    width:100% !important; max-width:100% !important; min-width:0 !important;
    box-sizing:border-box;
  }
  html body .ctsum .seenchk, html body .cdash-tbl .seenchk{
    flex:0 0 auto; white-space:nowrap;
  }
  html body .ctsum .seenchk input, html body .cdash-tbl .seenchk input{
    width:18px !important; min-height:18px;
  }

  /* ══ 1 · PETTY CASH ══════════════════════════════════════════════════════ */

  /* 1a · TOP CONTROLS — primary pair on one row, secondary and dangerous
     actions full width beneath. No oversized desktop toolbar. */
  html body .pettyview .plwk{
    display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:8px; align-items:center;
  }
  html body .pettyview .plwkl{ grid-column:1/-1 !important; font-size:11.5px; }
  html body .pettyview .plwksel{
    grid-column:1/-1 !important; width:100% !important; min-width:0 !important; min-height:44px;
  }
  html body .pettyview .plwk .pstartdate{
    grid-column:1/-1 !important; display:flex !important; align-items:center; gap:8px;
    font-size:12px; color:var(--muted);
  }
  html body .pettyview .plwk .pstartdate input{ flex:1; min-width:0 !important; min-height:44px; }
  html body .pettyview .plwk .hpbtn{ width:100% !important; min-height:44px; margin:0 !important; }
  /* DOM order is: label, select, Start new, "or date", Refresh, Print, Delete.
     Left alone, "or date" lands between the two primary buttons and strands
     Refresh in the second column of its own row. `order` pairs the two primary
     actions first, then lets the rest fall full width in priority order —
     primary, then the date alternative, then secondary, then the dangerous
     one. Nothing is removed and no button changes what it does. */
  html body .pettyview .plwk .plwkl    { order:1; }
  html body .pettyview .plwk .plwksel  { order:2; }
  html body .pettyview .plwk .pstartnew{ order:3; grid-column:1; }
  html body .pettyview .plwk .prefresh { order:4; grid-column:2; }
  html body .pettyview .plwk .pstartdate{ order:5; }
  html body .pettyview .plwk .plprint  { order:6; grid-column:1/-1 !important; margin-left:0 !important; }
  html body .pettyview .plwk .pdelsheet{ order:7; grid-column:1/-1 !important; margin-left:0 !important; }
  html body .pettyview .plwk .tag{ order:2; grid-column:1/-1 !important; justify-self:start; }
  html body .pledhd .plname{ font-size:19px; line-height:1.2; overflow-wrap:anywhere; }
  html body .pledhd .plrmp{ font-size:12px; overflow-wrap:anywhere; }

  /* 1b · KPI CARDS — two up, money never clipped, closing figure full width. */
  html body .pettyview .trkkpis, html body .pettyview .plkpis{
    display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:9px; margin-left:0 !important; margin-right:0 !important;
  }
  html body .pettyview .trkkpi{ min-width:0 !important; padding:11px 12px; }
  html body .pettyview .trkkpi .tkv{
    font-size:19px; white-space:normal !important; overflow-wrap:anywhere;
    font-variant-numeric:tabular-nums;
  }
  html body .pettyview .trkkpi .tkv input{ width:100% !important; min-width:0 !important; min-height:44px; }
  html body .pettyview .trkkpis > .trkkpi:last-child{ grid-column:1/-1; }

  /* 1c · THE LEDGER — min-width:1000px AND width:max-content both deleted. */
  html body .pettyview .pltblwrap{ overflow:visible !important; border:0; background:transparent; }
  html body .pltbl > tbody > tr{ position:relative; }
  /* reading order: which site → who was paid → how much → when → what */
  html body .pltbl > tbody > tr > td:nth-child(8){ order:1; grid-column:1/-1; }  /* Site/Project */
  html body .pltbl > tbody > tr > td:nth-child(2){ order:2; grid-column:1/-1; }  /* Payee        */
  html body .pltbl > tbody > tr > td:nth-child(9){ order:3; grid-column:1/-1; }  /* Total        */
  html body .pltbl > tbody > tr > td:nth-child(1){ order:4; }                    /* Date         */
  html body .pltbl > tbody > tr > td:nth-child(4){ order:5; }                    /* Time         */
  html body .pltbl > tbody > tr > td:nth-child(7){ order:6; grid-column:1/-1; }  /* Particulars  */
  html body .pltbl > tbody > tr > td:nth-child(5){ order:7; grid-column:1/-1; }  /* Address      */
  html body .pltbl > tbody > tr > td:nth-child(3){ order:8; }                    /* TIN          */
  html body .pltbl > tbody > tr > td:nth-child(6){ order:9; }                    /* Invoice #    */
  html body .pltbl > tbody > tr > td.plchkc{ order:10; display:flex !important;
                                              align-items:center; gap:9px; }
  html body .pltbl > tbody > tr > td.plchkc::before{ margin-bottom:0; }
  html body .pltbl > tbody > tr > td.plactc{ order:11; grid-column:1/-1;
                                              display:flex !important; gap:8px;
                                              align-items:center; justify-content:flex-end; }
  html body .pltbl .pltotin{
    font-size:20px !important; font-weight:800; text-align:left !important;
    font-variant-numeric:tabular-nums;
  }
  html body .pltbl .plsite{ font-size:14px; font-weight:800; color:var(--olive-d); }
  html body .pltbl .plmovewk{ min-height:40px; min-width:0 !important; max-width:100%; }
  html body .pltbl .plin.plw, html body .pltbl .plin.plxs,
  html body .pltbl .plin.pldate{ min-width:0 !important; }

  /* rows that are not records: group header, subtotal, total, empty state */
  html body .pltbl > tbody > tr.plgrp,
  html body .pltbl > tbody > tr.plsubt,
  html body .pltbl > tbody > tr.pltotrow{
    display:block !important; padding:11px 13px; margin:0 0 10px;
    border-radius:12px; background:var(--paper3); border:1px solid var(--line2);
  }
  html body .pltbl > tbody > tr.plgrp > td,
  html body .pltbl > tbody > tr.plsubt > td,
  html body .pltbl > tbody > tr.pltotrow > td{ display:block !important; }
  html body .pltbl > tbody > tr.plgrp > td::before,
  html body .pltbl > tbody > tr.plsubt > td::before,
  html body .pltbl > tbody > tr.pltotrow > td::before{ content:none !important; }
  html body .pltbl .plgrpn{ display:block; font-size:14px; font-weight:800; }
  html body .pltbl .plgrpt{ display:block; margin-top:4px; font-size:12px; line-height:1.6; }
  html body .pltbl > tbody > tr.plsubt > td:first-child,
  html body .pltbl > tbody > tr.pltotrow > td:first-child{
    font-size:11px; font-weight:800; text-transform:uppercase;
    letter-spacing:.05em; color:var(--muted);
  }
  html body .pltbl > tbody > tr.plsubt > td.pltot,
  html body .pltbl > tbody > tr.pltotrow > td.pltot{
    font-size:22px; font-weight:800; color:var(--ink); margin-top:3px;
    text-align:left !important; white-space:normal !important;
    font-variant-numeric:tabular-nums;
  }
  html body .pltbl > tbody > tr.pltotrow{ background:var(--olive-soft); border-color:var(--olive); }
  html body .pltbl > tbody > tr > td.plempty{ display:block !important; padding:16px 4px; text-align:center !important; }

  /* 1d · ADD A LINE FOR — wraps, never scrolls; Manage is a clear secondary. */
  html body .pettyview .pladd{
    display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:8px; padding:12px 0;
  }
  html body .pettyview .pladd .pll{ grid-column:1/-1; font-size:11.5px; }
  html body .pettyview .pladd .pladdbtn{
    width:100% !important; min-height:44px; margin:0 !important; overflow-wrap:anywhere;
  }
  html body .pettyview .pladd .pmgrbtn{
    grid-column:1/-1; width:100% !important; min-height:44px; margin:0 !important;
  }
  /* the fund-picker overview table carries an inline min-width */
  html body .view .hscroll > table[style*="min-width"]{ min-width:0 !important; }

  /* ══ 2 · SUMMARY · ALL SITES ═════════════════════════════════════════════ */
  html body .ctscroll{ overflow:visible !important; border:0; background:transparent; box-shadow:none; }
  /* a sticky first column has nothing to stick to once the row is a card */
  html body table.ctsum th.sumname, html body table.ctsum td.sumname{ position:static !important; }
  html body .ctsum > tbody > tr > td.sumname{
    grid-column:1/-1; font-size:17px; font-weight:800; color:var(--ink);
    display:flex !important; align-items:center; gap:8px; flex-wrap:wrap;
    padding-bottom:8px !important; border-bottom:1px solid var(--line2) !important;
  }
  html body .ctsum > tbody > tr > td.sumname::before{ content:none !important; }
  html body .ctsum .seenchk, html body .ctsum .trkrowdel{ flex:0 0 auto; }
  /* progress and the money a phone actually needs first */
  html body .ctsum > tbody > tr > td:nth-child(5){
    order:1; grid-column:1/-1; font-size:20px; font-weight:800;
  }
  html body .ctsum > tbody > tr > td:nth-child(2){ order:2; }
  html body .ctsum > tbody > tr > td:nth-child(3){ order:3; }
  html body .ctsum > tbody > tr > td:nth-child(4){ order:4; }
  html body .ctsum > tbody > tr > td:nth-child(17){ order:5; }
  html body .ctsum > tbody > tr > td:nth-child(18){ order:6; }
  html body .ctsum > tbody > tr > td:nth-child(6){ order:7; }
  html body .ctsum > tbody > tr > td:nth-child(7){ order:8; }
  html body .ctsum > tbody > tr > td:nth-child(8){ order:9; }
  html body .ctsum > tbody > tr > td:nth-child(9){ order:10; }
  html body .ctsum > tbody > tr > td:nth-child(10){ order:11; }
  html body .ctsum > tbody > tr > td:nth-child(11){ order:12; }
  html body .ctsum > tbody > tr > td:nth-child(12){ order:13; }
  html body .ctsum > tbody > tr > td:nth-child(13){ order:14; }
  html body .ctsum > tbody > tr > td:nth-child(14){ order:15; }
  html body .ctsum > tbody > tr > td:nth-child(15){ order:16; }
  html body .ctsum > tbody > tr > td:nth-child(16){ order:17; }
  html body .ctsum > tbody > tr > td:nth-child(19){ order:18; }
  html body .ctsum > tbody > tr > td{
    font-size:14px; font-weight:700; font-variant-numeric:tabular-nums;
  }

  /* ══ 3 · MONTH BY MONTH ══════════════════════════════════════════════════
     Already a CSS grid — it only has to stop being five columns and start
     naming its own numbers. No money is ever ellipsized again. */
  html body .pdsort{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
  html body .pdsort .pdchip{ min-height:38px; }
  html body .pdmhd, html body .pdwhd{ display:none !important; }
  html body .pdmtbl{ border:0; overflow:visible; }
  html body .pdmrow{
    border:1px solid var(--line2); border-radius:12px;
    background:var(--paper2); margin:0 0 9px; overflow:hidden;
  }
  html body .pdmsum, html body .pdmrow.total{
    display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:9px 12px; padding:12px;
  }
  html body .pdmsum .pdmn, html body .pdmrow.total .pdmn{
    grid-column:1/-1; font-size:15px; font-weight:800; letter-spacing:.02em;
    text-transform:uppercase; color:var(--ink);
    padding-bottom:7px; border-bottom:1px solid var(--line2);
  }
  html body .pdmsum .pdmv, html body .pdmrow.total .pdmv{
    text-align:left !important; font-size:16px; font-weight:800;
    white-space:normal !important; overflow-wrap:anywhere;
    font-variant-numeric:tabular-nums;
  }
  /* the column names the hidden header used to carry */
  html body .pdmsum .pdmv::before, html body .pdmrow.total .pdmv::before{
    display:block; margin-bottom:3px;
    font:800 10px/1.2 system-ui,sans-serif; letter-spacing:.05em;
    text-transform:uppercase; color:var(--muted);
  }
  /* :nth-child, NOT :nth-of-type — the month name is a <span> too, so counting
     by type numbered every label one column early (Expenses read "Received"). */
  html body .pdmsum .pdmv:nth-child(2)::before,
  html body .pdmrow.total .pdmv:nth-child(2)::before{ content:"Expenses"; }
  html body .pdmsum .pdmv:nth-child(3)::before,
  html body .pdmrow.total .pdmv:nth-child(3)::before{ content:"Received"; }
  html body .pdmsum .pdmv:nth-child(4)::before,
  html body .pdmrow.total .pdmv:nth-child(4)::before{ content:"Payables due"; }
  html body .pdmsum .pdmv:nth-child(5)::before,
  html body .pdmrow.total .pdmv:nth-child(5)::before{ content:"Progress"; }
  html body .pdmrow.total{ background:var(--olive-soft); border-color:var(--olive); }
  /* the weekly breakdown inside an open month carried min-width:520px */
  html body .pdwtbl{ overflow:visible !important; }
  html body .pdwrow{
    display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:7px 10px; min-width:0 !important; padding:11px;
  }
  html body .pdwrow > span, html body .pdwrow > b{
    text-align:left !important; overflow-wrap:anywhere;
  }
  html body .pdwrow .pdwk{ grid-column:1/-1; font-weight:800; color:var(--olive-d); }
  html body .pdwrow > span:not(.pdwk)::before, html body .pdwrow > b::before{
    display:block; margin-bottom:2px;
    font:800 9.5px/1.2 system-ui,sans-serif; letter-spacing:.05em;
    text-transform:uppercase; color:var(--muted);
  }
  html body .pdwrow > span:nth-child(2)::before{ content:"Hardware"; }
  html body .pdwrow > span:nth-child(3)::before{ content:"Outsource"; }
  html body .pdwrow > span:nth-child(4)::before{ content:"Labor"; }
  html body .pdwrow > span:nth-child(5)::before{ content:"Sub-con"; }
  html body .pdwrow > span:nth-child(6)::before{ content:"Petty"; }
  html body .pdwrow > b::before{ content:"Total"; }

  /* ══ 4 · CEO / PROJECT PRIORITY ══════════════════════════════════════════ */
  html body .trkscroll:has(> .cdash-tbl){
    overflow:visible !important; border:0; background:transparent;
  }
  html body .cdash-tbl{ border:0; }
  html body .cdash-tbl > tbody > tr > td:nth-child(1){
    grid-column:1/-1; font-size:17px; font-weight:800;
    padding-bottom:8px !important; border-bottom:1px solid var(--line2) !important;
  }
  html body .cdash-tbl > tbody > tr > td:nth-child(1)::before{ content:none !important; }
  html body .cdash-tbl > tbody > tr > td:nth-child(2){ order:1; }
  html body .cdash-tbl > tbody > tr > td:nth-child(3){ order:2; grid-column:1/-1; }
  html body .cdash-tbl > tbody > tr > td:nth-child(4){ order:3; }
  html body .cdash-tbl > tbody > tr > td:nth-child(5){ order:4; }
  html body .cdash-tbl > tbody > tr > td:nth-child(6){ order:5; }
  html body .cdash-tbl > tbody > tr > td:nth-child(7){ order:6; }
  html body .cdash-tbl > tbody > tr > td:nth-child(8){ order:7; }
  html body .cdash-tbl > tbody > tr > td:nth-child(9){ order:8; grid-column:1/-1; }
  html body .cdash-tbl > tbody > tr > td.num{
    text-align:left !important; font-size:15px; font-weight:800;
    white-space:normal !important; overflow-wrap:anywhere;
    font-variant-numeric:tabular-nums;
  }
  html body .cdash-tbl .cmwrap{ display:block; }
  html body .cdash-tbl .cmval{ font-size:20px; font-weight:800; }
  html body .cdash-tbl .cmbar{ width:100%; margin-top:6px; }
  html body .cdash-tbl > tbody > tr.ceotot{ background:var(--olive-soft); border-color:var(--olive); }
  /* empty cells would leave holes in the card grid */
  html body .cdash-tbl > tbody > tr > td:empty{ display:none !important; }
  html body .cdash-tbl .cfresh{ display:flex; flex-wrap:wrap; gap:6px; min-width:0 !important; }

  /* ══ 5 · DETAILED WEEKLY BUDGET · REQUEST → QPAD → COMMENTS ══════════════
     The desktop three-column card collapses to one column, and the request
     stops being a 1080px sheet: min-width is DELETED, so the QPAD panel is
     never again rendered inside a horizontal scroller. */
  html body .dwb2 .trkscroll, html body .dwb2 .wbscroll{
    overflow:visible !important; border:0; background:transparent;
  }
  html body .dwb2 .wbreq{
    grid-template-columns:minmax(0,1fr) !important;   /* Request / QPAD / Comments stack */
    padding:12px; margin:0 0 12px;
  }
  html body .dwb2 .wbreq > tr{ display:block !important; }
  html body .dwb2 .wbreq > tr.wbrow{
    display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px 12px;
  }
  /* who → how much → when → where → how it is paid → the decision */
  html body .dwb2 .wbrow > td:nth-child(1) { order:1;  grid-column:1/-1; }  /* Supplier    */
  html body .dwb2 .wbrow > td:nth-child(4) { order:2;  grid-column:1/-1; }  /* Amount      */
  html body .dwb2 .wbrow > td:nth-child(11){ order:3; }                     /* Paid amount */
  html body .dwb2 .wbrow > td:nth-child(5) { order:4; }                     /* Date needed */
  html body .dwb2 .wbrow > td:nth-child(6) { order:5; }                     /* Due date    */
  html body .dwb2 .wbrow > td:nth-child(3) { order:6;  grid-column:1/-1; }  /* Address     */
  html body .dwb2 .wbrow > td:nth-child(2) { order:7; }                     /* TIN         */
  html body .dwb2 .wbrow > td:nth-child(7) { order:8; }                     /* Mode        */
  html body .dwb2 .wbrow > td:nth-child(8) { order:9; }                     /* Bank        */
  html body .dwb2 .wbrow > td:nth-child(9) { order:10; }                    /* Account #   */
  html body .dwb2 .wbrow > td:nth-child(10){ order:11; grid-column:1/-1; }  /* Status      */
  html body .dwb2 .wbrow > td:nth-child(12){ order:12; grid-column:1/-1;
                                              display:flex !important;
                                              justify-content:flex-end; gap:8px; }
  html body .dwb2 .wbrow .wbamt{ text-align:left !important; font-size:20px; min-width:0 !important; }
  html body .dwb2 .wbrow .wbsup, html body .dwb2 .wbrow .wbacct{ min-width:0 !important; }
  html body .dwb2 .wbrow .wbstat2{ min-height:44px; }
  html body .dwb2 .wbapprove{ min-height:44px; margin-top:7px; }
  html body .dwb2 .wbcmtrow, html body .dwb2 .wbrdfrow{ display:block !important; }
  html body .dwb2 .wbcmtrow > td, html body .dwb2 .wbrdfrow > td{
    display:block !important; width:auto !important;
    padding:0 !important; border:0 !important;
  }
  html body .dwb2 .wbrdfrow{ margin-top:12px; }
  html body .dwb2 .wbreq .rdfpanel{ margin:0; }
  html body .dwb2 .wbwktools .wbbtn{ width:100%; min-height:44px; }

  /* the QPAD sheet: one column, full-width controls, 16px inputs */
  html body .rdfbody{ padding:11px; }
  html body .rdfgrid{ grid-template-columns:minmax(0,1fr) !important; }
  html body .rdfsplit{ grid-template-columns:minmax(0,1fr) !important; }
  html body .rdfin, html body .rdfta, html body .rdfcur{
    width:100% !important; max-width:100% !important; min-width:0 !important;
    box-sizing:border-box;
  }
  html body .rdfin{ font-size:16px !important; min-height:44px; }
  html body .rdfta{ min-height:112px; }   /* a purpose note is 3-4 lines on a phone */
  html body .rdfpay{ flex-direction:column !important; align-items:stretch; gap:7px; }
  html body .rdfpaybtn{ justify-content:center; min-height:46px; }
  /* FILE INPUTS — upload behaviour untouched; only the native control is given
     a shape that fits 320px and a filename that wraps. */
  html body .rdfupload, html body .rdffile{ min-width:0 !important; max-width:100% !important; }
  html body .rdfupload input[type=file], html body .rdffilerepl input[type=file]{
    max-width:100% !important; font-size:12px !important;
  }
  html body .rdfupload input[type=file]::file-selector-button{
    padding:9px 12px; margin-right:9px; border-radius:9px;
    border:1px solid var(--line); background:var(--paper3); color:var(--ink);
    font:700 12px/1 system-ui,sans-serif;
  }
  html body .rdffilename, html body .rdffilesize,
  html body .rdfphotoname, html body .rdfhelp{ overflow-wrap:anywhere; }
  /* comments — image, list and composer all inside the phone's width */
  html body .rcwrap, html body .poc-wrap{ min-width:0 !important; max-width:100% !important; }
  html body .rcimgbtn, html body .poc-imgbtn{ max-width:100% !important; }
  html body .rcimgbtn img, html body .poc-imgbtn img,
  html body .rdfphotobtn img, html body .rclbimg, html body .poc-lbimg{
    max-width:100% !important; height:auto; object-fit:contain;
  }
  html body .rcin, html body .poc-in{ font-size:16px !important; min-width:0 !important; }
  html body .rcsend, html body .poc-send{ min-height:44px; }
  html body .rdfsplitside .rclist{ max-height:320px; }

  /* ══ 6 · MONTHLY SCHEDULE · WEEK, TRADE, TASK ════════════════════════════ */
  /* WEEK HEADER — four honest rows instead of one impossible line. */
  html body .msweek > .msweeksum{
    display:grid !important; grid-template-columns:minmax(0,1fr) !important;
    gap:9px; padding:12px;
  }
  html body .msweeksum .msweekn{
    display:flex !important; flex-wrap:wrap; align-items:center; gap:7px;
    font-size:15px; line-height:1.25; min-width:0 !important;
  }
  html body .msweeksum .msweekr{
    display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:8px; align-items:center; min-width:0 !important;
  }
  html body .msweeksum .msweekr > .msbar,
  html body .msweeksum .msweekr > .msprog{ grid-column:1/-1; }
  html body .msweeksum .mswkbtn, html body .msweeksum .msprintbtn{
    width:100% !important; min-height:42px; margin:0 !important; font-size:12px !important;
  }
  html body .msapprovebar{
    display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:8px;
  }
  html body .msbtn{ width:100%; min-height:46px; }

  /* TRADE CARD — the title gets the room; the icons stop stealing it. */
  html body .mstaskhd{
    display:grid !important; grid-template-columns:minmax(0,1fr) !important; gap:8px;
  }
  html body .mstaskn{ font-size:16px; line-height:1.3; min-width:0 !important; overflow-wrap:anywhere; }
  html body .mschips{ display:flex !important; flex-wrap:wrap; gap:6px; }
  html body .mschip{
    min-height:40px; min-width:40px;
    display:inline-flex !important; align-items:center; justify-content:center;
  }

  /* TASK ROW — the title on its own line, the controls beneath it. */
  html body .mssub{ display:block !important; padding:10px 4px; }
  html body .mssubmain{
    display:grid !important; grid-template-columns:minmax(0,1fr) !important;
    gap:8px; width:100%;
  }
  html body .mssubck{ display:flex !important; align-items:flex-start; gap:9px; min-width:0 !important; }
  html body .mssubn{ font-size:15px; line-height:1.4; min-width:0 !important; overflow-wrap:anywhere; }
  html body .mssubact{
    display:flex !important; flex-wrap:wrap; align-items:center; gap:7px;
    justify-content:flex-start;
  }
  html body .mssubdaysel{ flex:1 1 140px; min-width:0 !important; min-height:42px; }
  /* TASK DETAILS — a clean vertical form */
  html body .mssubdet{
    grid-template-columns:minmax(0,1fr) !important;
    margin-left:0 !important; gap:9px;
  }
  html body .mssubmeta{ margin-left:0 !important; }
  html body .mssubfld{
    font-size:16px !important; min-height:44px; width:100% !important;
    min-width:0 !important; box-sizing:border-box;
  }
  html body .mssubinp, html body .msaddinp, html body .msaddpick{
    flex:1 1 100%; min-width:0 !important; font-size:16px !important; min-height:44px;
  }
  html body .msmini{ grid-template-columns:minmax(0,1fr) !important; }
  html body .msyeargrid{ grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  /* the Gantt is a genuine chart: it keeps its own scroller, but it may not
     make the PAGE scroll — the wrapper clips it to the card instead */
  html body .msgantt, html body .msgwrapouter{ max-width:100% !important; overflow-x:auto; }

  /* ══ 7 · TYPE, TARGETS, FLOATING CONTROLS ════════════════════════════════ */
  /* 16px on real inputs is what stops iOS zooming the page on focus — which is
     itself a cause of "the page moved sideways". */
  html body .view input[type=text], html body .view input[type=number],
  html body .view input[type=date], html body .view input[type=email],
  html body .view input[type=tel],  html body .view select,
  html body .view textarea{ font-size:16px !important; }
  html body .view input, html body .view select{ min-height:44px; }
  html body .view .plin, html body .view .wbin{ min-height:44px; }
  /* small icon actions keep a comfortable touch area without growing visually */
  html body .trkrowdel, html body .wbdel, html body .wbflagbtn{
    min-width:40px; min-height:40px;
    display:inline-flex !important; align-items:center; justify-content:center;
  }

  /* FLOATING HELP + PLUS — same actions, out of the content's way. */
  html body .helpfab{
    width:46px; height:46px; font-size:20px !important;
    left:calc(12px + env(safe-area-inset-left,0px));
    bottom:calc(14px + env(safe-area-inset-bottom,0px));
  }
  html body .au-fab{
    right:calc(12px + env(safe-area-inset-right,0px));
    bottom:calc(14px + env(safe-area-inset-bottom,0px));
  }
  /* nothing floats over the row being typed into */
  html body.au-kbd .helpfab, html body.au-kbd .au-fab{ opacity:0; pointer-events:none; }
}

/* ══ TIGHTER · 430px and below ═════════════════════════════════════════════ */
@media screen and (max-width:430px){
  html body main{ padding-left:12px; padding-right:12px; }
  html body .pettyview .trkkpi .tkv{ font-size:18px; }
  html body .pltbl > tbody > tr,
  html body .ctsum > tbody > tr,
  html body .cdash-tbl > tbody > tr{ padding:11px; }
}

/* ══ TIGHTER STILL · 360px — two columns stop being comfortable ════════════ */
@media screen and (max-width:360px){
  html body main{ padding-left:10px; padding-right:10px; }
  html body .pettyview .trkkpis, html body .pettyview .plkpis,
  html body .pettyview .pladd,
  html body .pltbl > tbody > tr,
  html body .ctsum > tbody > tr,
  html body .cdash-tbl > tbody > tr,
  html body .pdmsum, html body .pdmrow.total, html body .pdwrow,
  html body .dwb2 .wbreq > tr.wbrow,
  html body .msweeksum .msweekr,
  html body .msapprovebar,
  html body .msyeargrid{ grid-template-columns:minmax(0,1fr) !important; }
  html body .pettyview .plwk .pstartnew,
  html body .pettyview .plwk .prefresh{ grid-column:1/-1; }
}
