/* ⚠ THE TWO INSETS, READ ONCE. env() cannot be overridden, so a rule written
   directly against it cannot be tested anywhere without a notch — which is every
   machine I can run. Read into a variable here, used as var(--sat)/var(--sab)
   below, a test can set them to a real iPhone's 59 and 34 and show what he would
   see. On a phone with no notch both are 0 and nothing changes.
   ⚠ ON :root, NOT ON body. env() resolves against the document, and a sheet that
   is moved to the body (every pop-up in this app is) would otherwise inherit a
   value from wherever it used to be. */
:root{
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

/* ══ THE PHONE DECK ═══════════════════════════════════════════════════════════
   Panes you swipe between, and a pill floating over them near your thumb. Two
   screens use it — Maintenance and Deliveries — and they share every rule here so
   the two cannot drift apart. Opening either on a phone answers one question: what
   is going on right now. Everything the laptop screens carry stays on the laptop.

   ⚠ EVERY CLASS IS PREFIXED mph-. The app already owns .chip, .who, .find and
   .rep, and borrowing one of those names is how white text ended up on white.
   ⚠ EVERY RULE IS INSIDE THE PHONE QUERY. Above 760px this file does nothing. */
@media(max-width:760px){

  /* The laptop screen's own body is not drawn here — the deck replaces all of it.
     Every child rather than a list of ids, so a section added to that screen later
     cannot appear on the phone by accident. */
  /* The laptop screen own body is not drawn here — the deck replaces all of it.
     ⚠ !important, because several of those blocks carry an inline display:flex and
     an inline style beats a stylesheet: without it the Section line stayed on screen,
     under the capsule, above a heading that already says Maintenance. */
  /* ⚠ THE HIDE IS STILL THE DEFAULT, NOT A CLASS THAT HAS TO BE ADDED. It used to wait
     for the deck to be built, which is one round of loading away — so the laptop screen
     flashed up first every single time, masthead, branch bar, Section picker and all.
     `body:not(.mph-desk)` keeps that: a page that has only just loaded carries no class,
     so the hide is already on before a line of JavaScript runs. The class only ever
     turns it OFF, and only after a deliberate tap.
     ⚠⚠ AND THAT IS THE BUG HE FOUND, 21 Sep 2026: "On the map", "Full board", "All" and
     Deliveries' "Full view" all take the deck down and ask the laptop screen to draw —
     and this rule, written against the screen width alone, hid the laptop screen too.
     Four buttons, one white page, no way back. */
  body:not(.mph-desk) #view-maintenance > *:not(#mphHost),
  body:not(.dph-desk) #view-shipment    > *:not(#dphHost),
  #view-customers   > *:not(#cphHost),
  #view-detail      > *:not(#cphOne),
  #view-meetings    > *:not(#mtpHost){display:none!important}
  #view-maintenance,#view-shipment,#view-customers,#view-detail,#view-meetings{
    padding:0!important;overflow:hidden}

  /* ── ONE LAPTOP VIEW ON A PHONE ───────────────────────────────────────────
     The three buttons ask for ONE thing — the map, the whole board, every report —
     so exactly one thing is drawn: the wrap that mode turns on, and a bar to come
     back with. The masthead, the branch bar, the Section picker, the View tabs and
     the category bar all stay off: they are how a laptop chooses between views, and
     the choice was already made by the button that got us here.
     ⚠ THE WRAPS ARE PICKED BY NAME (`[id$="Wrap"]`), because applyMaintMode already
     hides all but one of them. Listing them here would be a second list to keep in
     step with the first. */
  body.mph-desk #view-maintenance > *:not([id$="Wrap"]):not(#mphBack),
  body.dph-desk #view-shipment    > *:not(#shipContent):not(#mphBack){display:none!important}
  body.mph-desk #view-maintenance,body.dph-desk #view-shipment{
    overflow:auto!important;padding:52px 12px 24px!important}
  /* ⚠ THE FLOATING + GOES WITH THEM. These three views are for looking at, and the
     phone's own way to raise work is the "Log a job" button on the deck. */
  body.mph-desk #maintFab,body.dph-desk #maintFab{display:none!important}
  .mph-back{position:fixed;top:0;left:0;right:0;z-index:55;height:44px;display:flex;align-items:center;
    gap:6px;padding:0 12px;background:var(--surface);border-bottom:1px solid var(--rule)}
  .mph-back button{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 8px 0 0;
    border:0;background:none;font-family:'Inter',sans-serif;font-size:16px;font-weight:600;
    color:var(--ink);cursor:pointer}
  .mph-back svg{width:18px;height:18px;stroke:currentColor;stroke-width:2.2;fill:none;
    stroke-linecap:round;stroke-linejoin:round}
  /* ── THE DAY ROW ON THE BOARD ─────────────────────────────────────────────
     ⚠ HIS REPORT, 21 Sep 2026: "when there is today the button goes down like a retard".
     The title carries an inline min-width of 240px written for a laptop, and once the
     date says "Monday, September 21, 2026 · Today" there is no room left on the line —
     so the → arrow and the Today button drop below, one per row, and the car counters
     land on top of them. Three rows of chrome before the board.
     The day and its three controls are ONE line; the technician search and the car
     counters each get their own, because they are not part of choosing a day. */
  body.mph-desk #maintBoardWrap > div:first-child{gap:6px!important}
  body.mph-desk #boardTitle{min-width:0!important;flex:1;font-size:14px!important;text-align:left!important}
  body.mph-desk #maintBoardWrap .foot-link{margin-left:0!important}
  body.mph-desk #maintBoardWrap .m3s{flex-basis:100%;width:auto!important;order:5}
  body.mph-desk #boardCars{flex-basis:100%;order:6}

  /* ── THE REPORTS FILTER ───────────────────────────────────────────────────
     ⚠ HIS REPORT, 21 Sep 2026: "the filter itself ate more than half the screen" — a
     date range, a View pair and a Sort triple, six rows of controls above an empty list.
     A phone keeps the four date buttons and nothing else: the list is newest first, which
     is the order you want on a phone, and the search box above it is how you find one
     customer. The two typed date boxes, View and Sort stay on the laptop. */
  body.mph-desk #maintReportsWrap .msort ~ .msort{display:none!important}
  body.mph-desk #maintReportsWrap .msort > input[type="date"],
  body.mph-desk #maintReportsWrap .msort > .dfw,
  body.mph-desk #maintReportsWrap .msort > span:not(.l){display:none!important}
  body.mph-desk #maintReportsWrap .msort{flex-wrap:wrap}
  /* ⚠ THE DECK'S OWN SCREEN NEVER SHOWS THE LAPTOP'S "+ Add machine". His report,
     21 Sep 2026: "theres an add machine when i open archive". It is switched on by
     applyMaintMode the moment the mode is a list mode, and it floated over all four
     panes — a second red button beside "Log a job", pointing at a machine list the
     phone deck does not have. */
  body.mph #maintFab{display:none!important}
  /* the deck owns the screen: head at the top, panes taking whatever is left, and the
     top padding is what keeps the head clear of the capsule floating over it */
  /* ⚠ ONE BAR, NOT TWO. The capsule floated on its own line and the app head sat under
     it, so a phone spent about a hundred pixels on chrome before any content. They share
     one line now: the head runs under the capsule and keeps its right side clear of it.
     The width is measured from the capsule itself — a manager has a bell in hers and the
     owner does not, so it is never the same number twice. */
  #mphHost,#dphHost{display:flex;flex-direction:column;height:100vh;height:100dvh;padding-top:6px}

  /* ── MEETINGS ─────────────────────────────────────────────────────────────
     Writing one is the point of this screen on a phone, so it is the biggest
     thing on it and it sits above the list rather than under it. */
  #mtpHost{display:flex;flex-direction:column;height:100vh;height:100dvh;padding-top:6px}
  .mtp-top{padding:0 16px;flex-shrink:0}
  .mtp-write{width:100%;min-height:52px;border:0;border-radius:10px;background:var(--accent);color:var(--on-accent);
    font-family:'Inter',sans-serif;font-size:17px;font-weight:600;cursor:pointer}
  .mtp-scroll{flex:1;min-height:0;overflow-y:auto;padding:0 16px 96px}
  .mtp-scroll::-webkit-scrollbar{display:none}
  .mtp-search{padding:2px 20px 6px}

  /* ── CUSTOMERS ────────────────────────────────────────────────────────────
     The list borrows the wall row: the same icon, name, one line, chevron. */
  #cphHost,#cphOne{display:flex;flex-direction:column;height:100vh;height:100dvh;padding-top:6px}
  .cph-find{padding:0 16px;flex-shrink:0}
  .cph-scroll{flex:1;min-height:0;overflow-y:auto;padding:0 16px 96px}
  .cph-scroll::-webkit-scrollbar{display:none}
  .cph-row .ic img{display:none}
  /* the star in the head reads as pressed rather than as a button that did nothing */
  #cphStar{font-size:19px;color:var(--rule);padding:0 12px}
  #cphStar.on{color:var(--star)}
  /* ⚠ flex:1 AND min-width:0. The head pins its title with flex-shrink:0, which is right
     for the word Maintenance and wrong for a customer called HOP LUN INTERNATIONAL
     FASHION LTD. — it ran off the right of the screen and took the star with it. */
  #cphName{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:19px}
  /* a search box written 220px wide for a laptop column */
  body.cph-one .mph-pane .m3s{width:100%!important;max-width:none!important}
  /* a moved tab panel is shown by the pane it sits in, not by its own .on */
  body.cph-one .mph-pane > .tabpane{display:block!important}
  body.cph-one .mph-pane > #custSide{display:block!important;width:auto;position:static;margin-bottom:18px}
  body.cph-one .mph-pane .tabbar{display:none}

  /* ⚠ THE CAPSULE FLOATS OVER THE TOP-RIGHT OF EVERY SCREEN, so every screen that puts
     words up there has to keep that width clear. The wall ran its greeting under it, the
     board ran its date and its branch buttons under it, and Review ran a button under it.
     The width is the measured one, so it is right for a manager (who has a bell in hers)
     and for the owner (who has not). */
  .masthead,.bd-top{padding-right:calc(var(--capw,150px) + 20px)}
  .bd-top{flex-wrap:wrap}

  /* ── THE WALL ─────────────────────────────────────────────────────────────
     A list, because a row has room to say what an app is doing right now and a
     tile only has room for its name. The laptop keeps its grid. */
  .wall-grp{font-size:13px;color:var(--ink-faint);font-weight:600;letter-spacing:.03em;
    text-transform:uppercase;padding:24px 0 2px}
  .wall-row{display:flex;gap:13px;align-items:center;padding:14px 0;width:100%;
    border:0;border-bottom:1px solid var(--rule-soft);background:none;text-align:left;
    cursor:pointer;font-family:'Inter',sans-serif;min-height:70px}
  .wall-row:last-child{border-bottom:none}
  .wall-row:active{background:var(--paper)}
  .wall-row .ic{width:44px;height:44px;border-radius:11px;background:var(--band-fill);flex-shrink:0;
    display:flex;align-items:center;justify-content:center}
  .wall-row .ic img{width:26px;height:26px}
  .wall-row .m{flex:1;min-width:0;display:block}
  .wall-row .t{display:block;font-size:17px;font-weight:600;letter-spacing:-.01em;color:var(--ink)}
  /* it wraps rather than trims: "5 out · 1 waiting on a part · 1 with nobody on it"
     was being cut at "1 with …", which loses the one fact he has to act on */
  .wall-row .s{display:block;font-size:14px;color:var(--ink-faint);margin-top:2px;line-height:1.35}
  /* amber, and only when something is actually waiting on him */
  .wall-row .w{width:9px;height:9px;background:var(--star);flex-shrink:0}
  .wall-row .ar{color:var(--rule-strong);font-size:20px;flex-shrink:0;line-height:1}
  .wall-none{padding:26px 0;color:var(--ink-faint);font-size:15px}

  /* ── the head: where you are, which branch, and the way into Manage ──────── */
  .mph-hd{display:flex;align-items:center;gap:8px;min-height:48px;
    padding:0 calc(var(--capw,150px) + 16px) 0 14px}
  /* 18, not 19: a manager's capsule carries a bell and is 136px wide against the
     owner's 92, and at 19 her "Maintenance" was cut to "Mainten…". */
  .mph-hd .t{font-size:18px}
  /* ⚠ THE TITLE GIVES WAY, not the gap. Pinned at flex-shrink:0 it pushed Manage until
     it was touching the capsule — two pixels apart on Maintenance. It shrinks first now. */
  .mph-hd .t{font-weight:600;letter-spacing:-.02em;flex:0 1 auto;min-width:0;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mph-hd .br{display:inline-flex;align-items:center;gap:5px;font-size:15px;color:var(--ink-soft);white-space:nowrap;
    background:none;border:0;padding:4px 2px;min-height:44px;cursor:pointer;font-family:'Inter',sans-serif}
  .mph-hd .br .c{font-size:11px;color:var(--ink-faint)}
  /* 44, not 38: it is the only button on this line and a thumb has to land on it */
  .mph-hd .mg{margin-left:auto;flex-shrink:0;min-height:44px;display:flex;align-items:center;
    border:1px solid var(--rule);border-radius:999px;padding:0 11px;background:var(--surface);
    font-size:14px;font-weight:500;font-family:'Inter',sans-serif;color:var(--ink);cursor:pointer}

  /* ── the deck ──────────────────────────────────────────────────────────────
     ⚠ scroll-behavior stays AUTO here. Smooth on the deck itself fights the
     finger; the tap handler asks for smooth on that one call instead. */
  .mph-deck{flex:1;min-height:0;display:flex;overflow-x:auto;overflow-y:hidden;
    scroll-snap-type:x mandatory;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  .mph-deck::-webkit-scrollbar{display:none}
  .mph-deck{scrollbar-width:none}
  .mph-pane{flex:0 0 100%;scroll-snap-align:start;overflow-y:auto;padding:0 16px 96px}
  .mph-pane::-webkit-scrollbar{display:none}

  /* ── the pill ──────────────────────────────────────────────────────────────
     ⚠ NO COUNTS ON IT. A number on a switcher answers nothing while sitting
     between you and the word you are reading, and unequal labels make the thumb
     change size as it slides. */
  /* ══ THE PILL ═════════════════════════════════════════════════════════════
     ⚠⚠ HIS REPORT, 21 Sep 2026: "the machine text is cut" and the slide "is so bad".
     Both were real and both were measured:

     1. EVERY BUTTON WAS width:70px. "Machines" does not fit in 70 pixels, and the
        button centres its label with flex — so the glyphs simply spilled past the
        edge and were covered by the pill's rounded end. Buttons size to their own
        label now; the pill is as wide as its four words and no wider.
     2. THE THUMB SAT 4px RIGHT OF ITS BUTTON, on every tab. The pill has 4px of
        padding, so a button's offsetLeft already includes it — and the thumb ALSO
        carried left:4px. The 4px was counted twice. On the last tab that pushed the
        thumb's right edge onto the pill's outer edge, which is what made the word
        under it look cut off. The thumb starts at left:0 now and the transform
        carries the whole offset.

     ⚠ THE SQUEEZE AND THE SLIDE SHARE ONE transform, so neither may be written to
     `style.transform` — the script sets --tx and --sq and this rule composes them.
     Writing transform inline would beat this rule and kill the transition with it. */
  .mph-pill{position:fixed;left:50%;bottom:calc(18px + var(--sab));
    z-index:60;display:flex;padding:4px;border-radius:999px;background:rgba(var(--panel-rgb),.9);
    box-shadow:0 6px 22px -6px rgba(var(--shade-rgb),.5);backdrop-filter:saturate(1.4) blur(8px);
    max-width:calc(100vw - 32px);translate:-50% 0}
  .mph-pill .mph-thumb{position:absolute;top:4px;bottom:4px;left:0;border-radius:999px;background:var(--surface);
    box-shadow:0 1px 3px rgba(var(--shade-rgb),.28);
    transform:translateX(var(--tx,0px)) scaleX(var(--sq,1));transform-origin:center;
    /* ⚠ 90ms, NOT ZERO. The thumb is placed from the deck's scroll position once per
       animation frame, and with no transition at all that reads as a row of steps
       rather than a slide. 90ms is under the threshold where it feels like lag and
       is exactly what smooths the sampling. A TAP gets .snap instead. */
    transition:transform .09s linear,width .09s linear}
  .mph-pill .mph-thumb.snap{
    /* the iOS curve: leaves fast, arrives without a bounce */
    transition:transform .38s cubic-bezier(.32,.72,0,1),width .38s cubic-bezier(.32,.72,0,1)}
  .mph-pill button{position:relative;z-index:1;border:0;background:none;cursor:pointer;
    font-family:'Inter',sans-serif;font-size:13px;font-weight:600;color:rgba(var(--lift-rgb),.72);
    width:auto;min-width:0;padding:0 15px;height:44px;white-space:nowrap;
    display:flex;align-items:center;justify-content:center;
    transition:color .18s ease}
  .mph-pill button.on{color:var(--ink)}
  /* the hairline between two unselected segments, the way iOS draws it — and it
     disappears on both sides of the thumb rather than running under it */
  .mph-pill button + button::before{content:'';position:absolute;left:0;top:12px;bottom:12px;width:1px;
    background:rgba(var(--lift-rgb),.2);transition:opacity .18s ease}
  .mph-pill button.on::before,.mph-pill button.on + button::before{opacity:0}
  @media (prefers-reduced-motion:reduce){
    .mph-pill button{transition:none}
    .mph-pill .mph-thumb,.mph-pill .mph-thumb.snap{transition:none}}

  /* the line above each pane — what you are looking at, and the way to all of it */
  .mph-r{display:flex;align-items:baseline;padding:13px 0 2px}
  .mph-r .h{font-size:13px;font-weight:600;color:var(--ink-soft);letter-spacing:.03em;text-transform:uppercase}
  .mph-r .go{margin-left:auto;font-size:13px;font-weight:500;color:var(--ink-faint);
    background:none;border:0;font-family:'Inter',sans-serif;cursor:pointer;
    min-height:44px;display:inline-flex;align-items:center;padding:0 0 0 12px}
  .mph-empty{padding:26px 0;font-size:15px;color:var(--ink-faint)}

  /* ── field: who is on what ─────────────────────────────────────────────── */
  .mph-who{display:flex;gap:12px;align-items:flex-start;padding:14px 0;border-bottom:1px solid var(--rule-soft);cursor:pointer}
  .mph-who .av{width:40px;height:40px;border-radius:50%;color:var(--on-dark);font-size:15px;font-weight:600;flex-shrink:0;
    display:flex;align-items:center;justify-content:center}
  .mph-who .m{flex:1;min-width:0}
  .mph-who .n{font-size:17px;font-weight:600;letter-spacing:-.01em}
  .mph-who .c{font-size:15px;color:var(--ink-soft);margin-top:1px;line-height:1.25;
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .mph-who .st{font-size:14px;margin-top:6px;display:inline-flex;align-items:center;gap:7px;color:var(--ink-soft)}
  .mph-who .st::before{content:'';width:9px;height:9px;background:var(--rule-strong);flex-shrink:0}
  .mph-who .st.on{color:var(--ok)} .mph-who .st.on::before{background:var(--ok)}
  .mph-who .st.stop{color:var(--star)} .mph-who .st.stop::before{background:var(--star)}
  .mph-who .r{font-size:13px;color:var(--ink-soft);font-family:var(--num);font-variant-numeric:tabular-nums;flex-shrink:0}
  .mph-who:last-child{border-bottom:none}

  /* ── board: the day, one lane per man ──────────────────────────────────── */
  .mph-bd{border-top:1px solid var(--ink);margin-top:6px}
  .mph-row{display:flex;border-bottom:1px solid var(--rule-soft);min-height:58px}
  .mph-row .nm{width:90px;flex-shrink:0;padding:13px 10px 13px 0;font-size:15px;font-weight:600;border-right:1px solid var(--rule-soft)}
  .mph-row .slots{flex:1;min-width:0;display:flex;align-items:flex-start;gap:7px;padding:10px 16px 10px 11px;overflow-x:auto}
  .mph-row .slots::-webkit-scrollbar{display:none}
  .mph-job{flex-shrink:0;border:1px solid var(--rule);border-left:3px solid var(--rule-strong);border-radius:4px;
    padding:7px 11px;min-width:124px;background:var(--surface);cursor:pointer}
  .mph-job .c{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:150px}
  .mph-job .s{font-size:13px;color:var(--ink-faint);margin-top:2px}
 /* ⚠ mph- ON THE STATUS TOO. .prog is the app's 4px progress bar; a chip that borrowed
      that name took its height and its overflow:hidden and showed half a customer name. */
  .mph-job.mph-prog{border-left-color:var(--ok);background:var(--good-bg)} .mph-job.mph-prog .s{color:var(--ok)}
  .mph-job.mph-wait{border-left-color:var(--star)} .mph-job.mph-wait .s{color:var(--star)}
  .mph-job.mph-done{border-left-color:var(--rule-strong);background:var(--paper)}
  .mph-job.mph-done .c{color:var(--ink-faint);text-decoration:line-through;text-decoration-color:var(--rule-strong)}
  .mph-row .free{padding:19px 0 0 11px;font-size:14px;color:var(--rule-strong)}
  .mph-row.none .nm{color:var(--star)}

  /* ── reports ───────────────────────────────────────────────────────────── */
  .mph-rep{display:flex;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid var(--rule-soft);cursor:pointer}
  .mph-rep .th{width:54px;height:54px;border-radius:5px;background:var(--rule);flex-shrink:0;
    background-size:cover;background-position:center}
  .mph-rep .m{flex:1;min-width:0}
  /* ⚠ TWO LINES FOR A COMPANY NAME. Measured at 375px: "PT. OLENO GARMENT
     INTERNATIONAL" lost its last 15px and read "…INTERNATIONA", which is the kind of
     cut that makes two customers look like the same one. The line under it keeps its
     ellipsis on purpose — a serial cut short is still recognisable, a name is not. */
  .mph-rep .t{font-size:16px;font-weight:600;letter-spacing:-.01em;line-height:1.25;
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .mph-rep .s{font-size:14px;color:var(--ink-faint);margin-top:2px;font-variant-numeric:tabular-nums}
  .mph-rep .a{font-size:14px;font-weight:500;color:var(--ink-soft);flex-shrink:0;text-decoration:none}
  .mph-day{font-size:13px;color:var(--ink-faint);padding:15px 0 3px;font-weight:600;letter-spacing:.02em;text-transform:uppercase}

  /* ── archive ───────────────────────────────────────────────────────────── */
  .mph-find{display:flex;align-items:center;gap:9px;margin:13px 0 2px;padding:0 13px;height:46px;
    border:1px solid var(--rule);border-radius:8px;background:var(--paper)}
  .mph-find svg{width:17px;height:17px;stroke:var(--ink-faint);fill:none;stroke-width:2;flex-shrink:0}
  .mph-find input{flex:1;min-width:0;border:0;background:none;font-family:'Inter',sans-serif;font-size:15px;
    color:var(--ink);outline:none;height:100%}
  .mph-arow{display:flex;gap:12px;align-items:baseline;padding:13px 0;border-bottom:1px solid var(--rule-soft);cursor:pointer}
  .mph-arow .m{flex:1;min-width:0}
  .mph-arow .t{font-size:16px;font-weight:600;letter-spacing:-.01em;line-height:1.25;
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .mph-arow .s{font-size:14px;color:var(--ink-faint);margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mph-arow .d{font-size:13px;color:var(--ink-soft);font-family:var(--num);font-variant-numeric:tabular-nums;flex-shrink:0}
  /* ⚠ :first-of-type MATCHES BY TAG, NOT CLASS — that is how the doubled line
     survived last time. The month heading carries no rule of its own: the space
     above it and its uppercase label separate it, and every row below already
     has a hairline. */
  .mph-mth{display:flex;align-items:baseline;padding:24px 0 4px}
  .mph-mth .t{font-size:13px;font-weight:600;color:var(--ink-soft);letter-spacing:.02em;text-transform:uppercase}
  .mph-arow:last-child{border-bottom:none}
  /* ── THE LAPTOP'S MACHINE LIST, LIVING IN THE FOURTH PANE ─────────────────
     ⚠ IT IS THE REAL #maintListWrap, MOVED. Being inside #mphHost is what takes it
     out of the blanket hide above — that rule only reaches direct children of
     #view-maintenance, and while it is mounted it is not one.
     ⚠ AND applyMaintMode PUTS .hidden BACK ON IT whenever the mode is not 'list',
     which on the deck it never is. This outranks that, and only while it is mounted. */
  body.mph-list #mphHost #maintListWrap{display:block!important}
  body.mph-list #mphHost #maintListWrap.hidden{display:block!important}
  /* ⚠ THREE LINES, NOT FOUR. Left alone the toolbar spends about 530px before the
     first customer — the title takes a whole line to itself (app.css gives .mhead-t
     width:100% on a phone), then the search, then the two filters, then the add
     button. That is the fault he named on Reports: "the filter itself ate more than
     half the screen". Title and Add share a line, the search takes one, the two
     filters share one. The order is set here, not by where the button is appended. */
  body.mph-list #maintListToolbar{padding-top:13px;gap:10px}
  body.mph-list #maintListToolbar .mhead-t{width:auto!important;margin-right:auto!important;order:1}
  body.mph-list #mphAddMachine{order:2}
  body.mph-list #maintListToolbar .m3s{order:3;flex-basis:100%;max-width:none!important}
  body.mph-list #maintCatSlot{order:4}
  body.mph-list #maintFilterHost{order:5}
  .mph-addmc{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 14px;
    border:1px solid var(--rule);border-radius:22px;background:var(--surface);color:var(--ink);
    font-family:'Inter',sans-serif;font-size:15px;font-weight:600;cursor:pointer}
  .mph-addmc svg{width:16px;height:16px;stroke:currentColor;stroke-width:2.5;fill:none;stroke-linecap:round}
  .mph-addmc:active{transform:translateY(1px)}

  /* the delivery form is a full-screen sheet on a phone, so the pill must not float over it */
  body.mph-sheet .mph-pill,body.dph-sheet .mph-pill{display:none}
}

/* ══ WHAT A FINGER CAN ACTUALLY HIT ═══════════════════════════════════════════
   Measured, not guessed: every visible control on every screen was hit-tested at
   375px and these came back under 44px tall. They are the controls a previous pass
   missed — the A–Z and Most spent links on Customers, the currency switch on
   Figures, the meeting chips, the small buttons on Boards and Review.
   ⚠ PHONE ONLY. The laptop keeps its compact controls; nothing here applies above
   760px, and none of it changes a colour, a weight or a size — only the height of
   the box your thumb has to land in. */
@media(max-width:760px){
  .seglink,.mm-link,.mtg-chip,.btn-primary,.btn-line,.foot-link,.star,.back,
  .figv,.mtg-del,.bd-acts button,.mseg button,.mtools button{
    min-height:44px;display:inline-flex;align-items:center;justify-content:center}
  /* ⚠ THE COMPACT-ROW RULE WINS ON SPECIFICITY. m3.css pins a button inside a list row
     to 28px with two class names, so a single-class rule above never reached it — the
     Review buttons stayed 29px tall through the whole first pass. Matched here. */
  .mrow .btn-line,.mrow .btn-primary,.rvrow .btn-line,.rvrow .btn-primary,
  .dirrow .btn-line,.dirrow .btn-primary,.mlrow .btn-line,.mlrow .btn-primary,
  .ov-frow .btn-line,.ov-frow .btn-primary,.ii-row .btn-line,.ii-row .btn-primary,
  .rlacts > *,.mtg-seg button{min-height:44px}
  .bd-acts button{width:44px}
  /* ⚠ ADDED 18 Sep 2026, hit-tested at 375px the same way, and every selector below
     was taken from the element the test actually named rather than from the one the
     markup looked like it would be — the first attempt guessed four of them wrong and
     changed nothing.
     ⚠ TOO NARROW COUNTS. A rule that only sets a height leaves a 16px-wide target that
     is 44px tall, which is just as hard to land on as a short one. */
  .seglink,.mtg-del,.dfb,.hr-arw,.tbl-r .rowmore,.vs-arrow,.figv{min-width:44px}
  .dfb,.hr-arw,.vs-arrow,.crumb{min-height:44px}
  /* ⚠ THE VISITS MENUS SET THEIR OWN SIZE in visits.css — 46px, full width, one to
     a line. Leaving them out of the list below keeps that in one place. */
  /* the chip that ties a board to a project — the board card shrinks its own type and
     the chip came down with it */
  /* ⚠ AND display, or the height does nothing. An inline element ignores a height,
     so the empty "Attach to a project" chip stayed 19px however tall it was told to be. */
  .bd-card .pin-chip{display:inline-flex;align-items:center;font-size:13px;padding:8px 12px;min-height:44px}
  /* the branch switch on the Maintenance Dashboard: it is the only control left on
     that screen once the wall ones go, so it may as well be a comfortable one */
  .bd-seg button{min-height:44px}
  /* the marks somebody taps on the attendance sheet, and its legend */
  /* a name on the attendance sheet is what you press to mark somebody, and it was
     a 16px line of text */
  .hr-leg button,.hr-mark button,button.who{min-height:44px}
  /* the capsule is on every screen, so it is the one that matters most */
  #cap{height:44px}
  #cap button,#capBell .nbell,#capMe{height:44px}
  #cap .capsep{height:22px}
}
/* ══ THE HANDLE ON THE APP'S OWN SHEETS ══════════════════════════════════════
   Settings, Manage team, the manage screens, the password box — every one of the
   app's dialogs becomes a sheet from the bottom under 600px, each with a real drag
   handle that m3.js puts at the top. That handle sat inside the scrolling content:
   scroll a long one — Settings is very long — and the handle and the ✕ go off the
   top, leaving nothing to grab and nothing to press.

   ⚠ I FIXED THE WRONG FOUR SHEETS FIRST. The account sheet, Manage, the branch
   picker and an open delivery are ones I built; these are the app's own, a different
   family, and he was still losing the handle on the ones he actually opens.

   The handle is pinned to the top of the sheet. Only the handle. */
@media (max-width:600px){
  .modal > .m3-grab{position:sticky;top:0;z-index:6;background:var(--surface);
    border-radius:28px 28px 0 0;
    /* ⚠ THE STRIP ABOVE IT HAS TO BE PAINTED TOO. These sheets carry their own padding,
       and content scrolls up INTO that padding and stays visible — so rows slid past the
       bar and sat above it, half-cut, inside the rounded top. The shadow is a solid block
       of the sheet colour reaching up to the edge; the sheet clips it there. */
    box-shadow:0 -40px 0 40px var(--surface)}   /* the spread covers the side padding too */
  /* ⚠ THE BAR AND NOTHING ELSE. Pinning the row under it as well stuck the day
     picker across the top of the job sheet, over the title and outside the card.
     He asked for the handle to stay; the handle is what stays. */
}

/* ══ LOGGING A JOB FROM A PHONE ═══════════════════════════════════════════════
   "we cannot log a job from phone" — 18 Sep 2026. The way in is a pill above the
   deck's own pill, the two steps are the app's own bottom sheet, and the form
   that opens is the REAL job form with its long half hidden.

   ⚠ THE FORM IS NOT A COPY. Everything below only HIDES fields; not one of them
   is emptied, so the form still saves exactly what it would have saved from a
   laptop with those fields left alone. The moment this stops being true, a job
   raised on a phone and a job raised at a desk stop being the same thing.
   ⚠ AND ONLY UNDER body.mph-shortjob. Opening the same form to EDIT a job on a
   phone must still show all of it, or the edit quietly drops what it cannot see. */
@media(max-width:760px){

  /* ── the way in ──────────────────────────────────────────────────────────
     ⚠ ABOVE THE DECK'S PILL, not beside it. The pill is centred at the bottom and
     is how you move between the four panes; a second round thing on the same line
     reads as a fifth pane. This sits clear above it, on the right, where the app's
     other floating button already sits. */
  /* ⚠ 88px, NOT 140. "too high of a button placement", 18 Sep 2026 — it was sitting
     a finger's width above the pill instead of just clear of it. The pill's own
     bottom is 18px plus the home-bar inset and it is 44 tall, so 88 leaves about
     26px of air between the two and nothing else in between. */
  .mph-add{position:fixed;right:16px;bottom:calc(88px + var(--sab));z-index:60;
    display:inline-flex;align-items:center;gap:7px;
    min-height:44px;padding:0 18px 0 15px;border:0;border-radius:24px;
    background:var(--accent);color:var(--on-accent);cursor:pointer;
    font-family:'Inter',sans-serif;font-size:15px;font-weight:600;
    box-shadow:0 4px 14px rgba(var(--shade-rgb),.2)}
  .mph-add svg{width:16px;height:16px;stroke:currentColor;stroke-width:2.5;fill:none;stroke-linecap:round}
  .mph-add:active{transform:translateY(1px)}

  /* ── the two steps, in the app's own sheet ───────────────────────────────
     .mesheet brings the veil, the card and the 54px rows with it; these are only
     the parts it has no opinion about. */
  .mph-sheet-h{font-family:'Inter',sans-serif;font-size:13px;font-weight:600;
    color:var(--ink-faint);letter-spacing:.02em;text-transform:uppercase;
    padding:6px 20px 8px}
  /* a choice with a line of explanation under it, in the sheet's own row */
  .mesheet .mph-kind{width:100%;border:0;background:none;text-align:left;
    font-family:'Inter',sans-serif;align-items:flex-start;padding-top:11px;padding-bottom:11px}
  .mesheet .mph-kind .t{display:block}
  .mesheet .mph-kind .s{display:block;font-size:13px;color:var(--ink-faint);margin-top:2px;line-height:1.3}

  /* the machine search, and its list */
  .mph-find-sheet{margin:2px 20px 8px;padding:0 13px}
  .mph-mlist{max-height:46vh;overflow-y:auto;padding-bottom:8px}
  .mph-mrow{display:block;width:100%;text-align:left;border:0;background:none;
    font-family:'Inter',sans-serif;cursor:pointer;
    padding:11px 20px;min-height:54px;border-top:1px solid var(--rule-soft)}
  .mph-mrow:active{background:var(--field)}
  /* ⚠ THE COMPANY IS THE LINE HE READS. Two customers can share a machine model,
     so the model alone is not an answer — and two records can share a name, which
     is why the serial stays on the line under it. */
  .mph-mrow b{display:block;font-size:16px;font-weight:600;color:var(--ink);line-height:1.25}
  .mph-mrow span{display:block;font-size:14px;color:var(--ink-faint);margin-top:2px;line-height:1.25}

  /* ── the short form ──────────────────────────────────────────────────────
     What stays: the machine it is for, what kind, what is wrong (or when it is
     next due), and the day he goes. What goes: who goes, the car, the parts, the
     skill ranking and the fold of rarely-touched fields. */
  body.mph-shortjob #m-maint-record .jf-sechead{display:none}
  body.mph-shortjob #m-maint-record #mrTechSel,
  body.mph-shortjob #m-maint-record #mrTechQ,
  body.mph-shortjob #m-maint-record #mrTechs,
  body.mph-shortjob #m-maint-record #mrTechsEmpty{display:none}
  /* the Technicians block is the .jf-q holding the picker — hidden by its label too,
     so the word does not sit above nothing */
  body.mph-shortjob #m-maint-record .jf-q:has(#mrTechSel){display:none}
  /* Skill needed is the second half of the two-up row; Scheduled date is the first
     and stays, so the row itself must not be hidden */
  body.mph-shortjob #m-maint-record .jf-two .jf-q:has(#mrSkillArea){display:none}
  body.mph-shortjob #m-maint-record .jf-two{display:block}
  body.mph-shortjob #m-maint-record #mrMore{display:none}
  /* the title says what this is, rather than the laptop's "Log job" over a form
     that is now half the length */
  body.mph-shortjob #m-maint-record .jf-body{padding-bottom:18px}
}

/* ══ BACK LEFT, FORWARD RIGHT, THE LABEL IN THE MIDDLE ════════════════════════
   His instruction, 18 Sep 2026, on seeing the two arrows huddled together at the
   left of the Sales visits date with the date stranded beside them: "why not left
   arrow to the most left, right arrow to the most right and the text are in the
   middle, put this hierarchy for every single arrow on mobile view".

   On a phone the row is the width of the screen either way, so the two arrows
   together waste the width AND put both targets under the same thumb. Pushed to
   the edges they are a thumb's reach apart, and the thing they change sits between
   them where the eye already is.

   ⚠ ONLY THE PAIRS A PHONE CAN REACH. Maintenance's calendar, day board, week and
   map carry the same arrows and are marked PC only — the phone deck replaces that
   screen — so they keep the laptop shape. The photo and file lightboxes already
   pin their arrows to the edges another way.
   ⚠ AND ONLY BELOW 760px. On a laptop these rows sit inside a toolbar with other
   things beside them, and stretching them edge to edge there would pull them apart
   for no reason. */
@media(max-width:760px){
  #vsWhen,.hr-per,.scal-head{
    display:flex;align-items:center;justify-content:space-between;
    gap:8px;width:100%;flex-wrap:wrap}

  /* the middle: takes whatever is left, and centres itself in it */
  #vsWhen .vs-range,.hr-per #hrTitle,.scal-head .t{
    order:2;flex:1 1 auto;min-width:0;text-align:center}

  /* ⚠ THE ARROWS ARE PLACED BY ORDER, NOT BY MARGIN. margin-left:auto on the second
     one would work until something else is added to the row, and then it would push
     that instead. Order says which end each belongs at, whatever else arrives. */
  #vsWhen .vs-arrow:nth-of-type(1),
  .hr-per .hr-arw:first-of-type,
  .scal-head button:nth-of-type(1){order:1;flex:0 0 auto}
  #vsWhen .vs-arrow:nth-of-type(2),
  .hr-per .hr-arw:last-of-type,
  .scal-head button:nth-of-type(2){order:3;flex:0 0 auto}

  /* whatever else shares the line — "Today", "This week", the run count — goes
     underneath it rather than squeezing the three things that matter */
  #vsWhen .vs-today,.scal-head .mrlink,.scal-head .tot{
    order:4;flex:1 1 100%;text-align:center;margin-left:0}

  /* the month on Attendance is an h1 and was sized for a laptop masthead */
  .hr-per #hrTitle{font-size:19px}
}

/* ══ THE PAGE IS THE SCREEN, AND THE HEAD IS ONE PIECE ════════════════════════
   See the note above — two complaints, one cause. The grey bands top and bottom
   are the page ground showing where the white content does not reach, and the
   capsule stayed put while everything beside it scrolled away because it was the
   only thing ever fixed up there.

   ⚠ EVERY RULE IS INSIDE THE PHONE QUERY. On a laptop the grey ground is the
   point — the app is a card on a desk — and the mastheads scroll as they always
   have. */
@media(max-width:760px){

  /* ── no grey bands ──────────────────────────────────────────────────────
     ⚠ html AS WELL AS body. The colour iOS paints behind the status bar and the
     home bar is the CANVAS colour, and the canvas takes its colour from html —
     falling back to body only when html has none. Setting body alone left the
     bands exactly as they were. */
  html,body{background:var(--surface)}
  /* and the app fills the screen rather than floating on it */
  body > .app{background:var(--surface)}

  /* ── the head, as one piece ─────────────────────────────────────────────
     ⚠ THE PADDING IS ON THE STICKY THING, NOT ABOVE IT. Space above the header
     would scroll away and leave the status bar sitting on the content; padding
     inside it means the header's own background reaches the top of the screen and
     stays there. This is the whole trick Google's uses. */
  .wrap > .masthead,
  #mphHost > .mph-hd,
  #dphHost > .mph-hd{
    position:sticky;
    top:0;
    z-index:310;
    background:var(--surface);
    margin-top:calc(-1 * var(--sat));
    padding-top:calc(var(--sat) + 8px);
    padding-bottom:10px;
  }
  /* ⚠ THE CAPSULE JOINS THE GROUP rather than floating over it. It was fixed to the
     window, which is why it was the one thing that stayed — and why it sat on top
     of the Dashboard's title. Fixed is still right (it must clear the status bar on
     every screen, including the ones with no masthead) but it now sits at the same
     height as the header it belongs to. */
  #cap{top:calc(6px + var(--sat))}
  /* the clearance the first line needed is the header's job now */
  .wrap{padding-top:calc(var(--sat) + 6px)!important}

  /* ── the bottom ────────────────────────────────────────────────────────
     the last row must clear the home bar, and the ground must not show under it */
  body:not(.role-tech):not(.role-driver) .wrap{
    padding-bottom:calc(26px + var(--sab))!important}
  body.role-tech .wrap,body.role-driver .wrap{
    padding-bottom:calc(16px + var(--sab))!important}

  /* ⚠ THE TECHNICIAN'S OWN HEADER IS HIS OWN. He has no capsule and no masthead —
     his header carries the bell and his name — so it is the thing that has to stick
     and to reach the top of the screen. */
  body.role-tech .tv-top,body.role-driver .tv-top{
    position:sticky;top:0;z-index:310;background:var(--surface);
    margin-top:calc(-1 * var(--sat));
    padding-top:calc(var(--sat) + 10px)}
}

/* ══ NO BAR ACROSS THE TOP OF A SHEET ═════════════════════════════════════════
   "ios one is so smooth, doesnt have a top header", 18 Sep 2026. A sheet in his
   picture is the grabber, then the title, then the content — no strip, no rule, no
   label repeated above a heading that already says it.

   ⚠ THE WAY OUT STAYS. Tapping the grey does not close a form here (his rule, and
   older than this work), so Back cannot go with the bar or a half-filled form would
   have no exit but a drag nobody was told about. What goes is the bar's border, its
   fill and its middle label. What stays is Back, and the Draft/Saved flag, sitting
   over the content rather than in a box above it. */
@media(max-width:760px){
  .ov > .modal > form > .jf-bar,
  .ov > .modal .jf-bar{
    border-bottom:0;
    background:none;
    padding:2px 14px 0;
    min-height:0;
  }
  /* the label in the middle goes: the form's own heading is the title */
  .jf-bar .jf-title{display:none}
  .jf-bar .back{margin-left:-6px}
  /* and the body starts straight underneath, with the room the bar used to take */
  .jf-body{padding-top:10px}

  /* the same for the sheets built in code: their heading is the content's, not a
     strip above it */
  .mesheet .card > .mph-sheet-h{
    padding:2px 20px 10px;
    font-size:20px;
    font-weight:600;
    letter-spacing:-.02em;
    text-transform:none;
    color:var(--ink);
  }
  /* Settings and the rest: the app's own dialog head loses its rule on a phone */
  .ov > .modal > .m3-grab + .ui > .mhead,
  .ov > .modal .mhead{border-bottom:0;padding-bottom:6px}
}

/* ══ THE PAGE BEHIND A SHEET HOLDS STILL ═════════════════════════════════════
   "why is it when i drag the draggable the page behind it also drags?"

   ⚠ I CANNOT REPRODUCE THIS HERE AND HE SHOULD KNOW THAT. Measured on a desktop
   test browser: while the sheet is dragged 112px the page behind it does not move
   a pixel — its scroll stays where it was. So this is iOS, where a fixed overlay
   does NOT stop Safari panning the document underneath it. touch-action:none on
   the grabber stops the browser panning FROM the grabber; it says nothing about
   the page, which is a different element and still perfectly scrollable.

   So while a sheet is up, the thing behind it is told plainly that it does not
   take touches and does not scroll. body.m3-sheeted is already set and cleared by
   m3.js for the push-back, so there is one switch, not two.

   ⚠ THE SHEETS ARE NOT INSIDE .app — checked at run time, not read off the markup,
   because in the file they look as though they are. If that ever changes, this rule
   would freeze the sheet along with the page. */
@media (max-width:760px){
  body.m3-sheeted > .app{touch-action:none;overflow:hidden}
  /* and the rubber band at the very top and bottom of the document with it */
  body.m3-sheeted,html:has(body.m3-sheeted){overscroll-behavior:none}
}
