/* public/css/phone_shell.css — the phone app (v5.118.0 app feel; v5.119 Theme B "Blue", owner's choice 2026-10-30).
   Linked by mobile.html ONLY, after ui.css — the desktop never loads it. Tokens only (the theme's four new values
   live in css/tokens.css, :root.ui-phone): no colour literal and no px font-size here, so the UI sweep stays at zero.
   Two shells, chosen once at boot by isIPhoneShell() (util/phone_shell.js), as a class on <html>:
     .shell-ios   iPhone / iPod / iPad: ☰ + side drawer, tabs Home · Sell · Expense · Customers, title centred
     (no class)   everything else, Android included: tabs + More, the avatar, the tab pill, title left.

   THE RULES OF THE LOOK (owner's ruling, Theme B — apply to every phone screen):
     · no boxed figures — content sits in WHITE SECTIONS, full width, no border, no radius, 8 px of page between
     · rows ≥ 50 px, a thin line between rows, none after the last
     · fields FILLED (--field), radius 12, no border, 44 px, 16 px text; a ring on focus only
     · one primary per screen: a 50 px pill in brand blue, in a fixed bar at the bottom for a form or the cart
     · chips are 34 px pills (in a 44 px target); selected = filled blue; the period choice is one segmented control
     · section headings 13 px, 600, muted, sentence case
   Inline styles in the screens' templates set borders and white backgrounds of their own; the few rules that
   must beat them say !important, and say why. */

/* ── App-like behaviour, both shells (v5.118.0) ─────────────────────────────── */
/* touch-action is not inherited (it intersects up to the nearest scroller), so it goes on every element.
   manipulation = pan and PINCH-ZOOM stay, double-tap zoom goes. The viewport keeps user scaling on. */
:root.ui-phone, :root.ui-phone * { touch-action: manipulation; }
:root.ui-phone, :root.ui-phone body, :root.ui-phone #app { overscroll-behavior: none; }
:root.ui-phone :is(#m-nav, #m-nav *, button, [role="button"], .m-drawer-row) { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
:root.ui-phone :is(.m-inv-row, .m-pick-row, .m-alert-row, .m-result-row, .m-tile, .m-cust-row, .m-frow, .m-row):active { background: var(--inset); }
:root.ui-phone :is(button, [role="button"], .m-nav-item):not([disabled]):active { opacity: .85; }
:root.ui-phone #m-content { padding-left: env(safe-area-inset-left, 0); padding-right: env(safe-area-inset-right, 0); background: var(--bg); }
:root.ui-phone #m-modal { padding-left: max(var(--space-4), env(safe-area-inset-left, 0)); padding-right: max(var(--space-4), env(safe-area-inset-right, 0)); }
:root.ui-phone #m-nav.ui-chrome { padding-left: max(var(--space-1), env(safe-area-inset-left, 0)); padding-right: max(var(--space-1), env(safe-area-inset-right, 0)); }

/* ── Header: the brand-blue bar ───────────────────────────────────────────────── */
/* Height = safe-area top (mobile.html) + a 44 px row on iPhone, + 52 px elsewhere. Title 18 px 700: left on
   Android, centred on iPhone (between ☰ and refresh). The shop's name (#m-store-name) is the title on Home and
   a hidden holder elsewhere (the WhatsApp fallback and the drawer read it); #m-title carries the screen's name. */
:root.ui-phone #m-header.ui-chrome { background: var(--brand); }
:root.ui-phone #m-header.ui-chrome #m-header-inner { min-height: 52px; padding: 2px var(--space-2) 2px var(--space-4); gap: var(--space-2);
  padding-left: max(var(--space-4), env(safe-area-inset-left, 0)); padding-right: max(var(--space-2), env(safe-area-inset-right, 0)); }
:root.ui-phone.shell-ios #m-header.ui-chrome #m-header-inner { min-height: 44px; padding-top: 0; padding-bottom: 0; padding-left: max(var(--space-1), env(safe-area-inset-left, 0)); }
:root.ui-phone #m-header.ui-chrome #m-header-title { flex: 1; min-width: 0; }
:root.ui-phone.shell-ios #m-header.ui-chrome #m-header-title { text-align: center; }
/* the right side holds 44 px even when empty (no refresh on the boards), so the centred title is centred */
:root.ui-phone.shell-ios #m-header.ui-chrome #m-header-right { min-width: var(--target-min); justify-content: flex-end; }
:root.ui-phone #m-header.ui-chrome #m-store-name { display: none; }
:root.ui-phone #m-header.ui-chrome #m-title { color: var(--on-brand); font-size: var(--text-page-title); font-weight: 700; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root.ui-phone #m-header.ui-chrome #m-subline { display: none; color: var(--on-brand-2); font-size: var(--text-meta); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* (the greeting · updated line is not drawn: board B·Home has none) */
/* Board B: the header carries no refresh button (the phone still refreshes itself every minute and on every screen
   change), and the avatar only on Home; the header runs straight into Home's blue hero, no line between. */
:root.ui-phone #m-header.ui-chrome { border-bottom: 0 !important; box-shadow: none !important; }
:root.ui-phone #m-header.ui-chrome #m-refresh-btn { display: none !important; }
:root.ui-phone #app:not([data-mtab="dashboard"]) #m-header.ui-chrome #m-avatar { display: none !important; }
:root.ui-phone #m-header.ui-chrome #m-back-btn { display: none; width: var(--target-min); height: var(--target-min); border: 0; background: transparent; color: var(--on-brand);
  align-items: center; justify-content: center; padding: 0; margin-left: calc(-1 * var(--space-2)); flex-shrink: 0; cursor: pointer; }
:root.ui-phone #app[data-pushed="1"] #m-header.ui-chrome #m-back-btn { display: inline-flex; }
:root.ui-phone.shell-ios #app[data-pushed="1"] #m-header.ui-chrome #m-menu-btn { display: none; }   /* iPhone: back replaces ☰ on a pushed screen */
:root.ui-phone #m-header.ui-chrome #m-greeting { color: inherit; font-size: inherit; margin: 0; }
:root.ui-phone #m-header.ui-chrome #m-header-right { gap: var(--space-1); flex-shrink: 0; }
:root.ui-phone #m-header.ui-chrome #m-refresh-btn { color: var(--on-brand); }
/* The initial on --brand-text, not a translucent white: measured, white on rgba(255,255,255,.22) over the blue is 3.48:1. */
:root.ui-phone #m-header.ui-chrome #m-avatar { background: var(--brand-text); color: var(--on-brand); }
:root.ui-phone #m-header.ui-chrome #m-menu-btn { width: var(--target-min); height: var(--target-min); border: 0; border-radius: var(--radius-card);
  background: transparent; color: var(--on-brand); display: none; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; padding: 0; }
:root.ui-phone.shell-ios #m-header.ui-chrome #m-menu-btn { display: inline-flex; }
:root.ui-phone.shell-ios #m-header.ui-chrome #m-avatar { display: none; }    /* iPhone: who you are lives in the drawer */

/* ── Tab bar: white; the active tab blue (Android: in a tint pill) ────────────── */
:root.ui-phone #m-nav.ui-chrome { background: var(--surface); }
:root.ui-phone #m-nav.ui-chrome .m-nav-icon .icon { width: 24px; height: 24px; }
:root.ui-phone:not(.shell-ios) #m-nav.ui-chrome .m-nav-icon { padding: 2px 16px; border-radius: var(--radius-chip); }
:root.ui-phone:not(.shell-ios) #m-nav.ui-chrome .m-nav-item.active .m-nav-icon { background: var(--brand-tint); }
:root.ui-phone #m-nav.ui-chrome .m-nav-item.active, :root.ui-phone #m-nav.ui-chrome .m-nav-item.active .m-nav-label { color: var(--brand); }

/* ── Sections, not cards ──────────────────────────────────────────────────────── */
/* .m-sec is the new white section; every older card class takes the same look so a screen that has not been
   rewritten still loses its boxes. Full width: the screens pad 16 px, so a section reaches back over it. */
:root.ui-phone :is(.m-sec, .m-card, .m-pick-card) { background: var(--surface); border: 0 !important; border-radius: 0 !important; box-shadow: none;
  margin-left: calc(-1 * var(--space-4)); margin-right: calc(-1 * var(--space-4)); margin-bottom: var(--space-2) !important; }
:root.ui-phone .m-sec { padding: 0 var(--space-4); }
:root.ui-phone :is(.m-card, .m-pick-card) { padding-left: var(--space-4) !important; padding-right: var(--space-4) !important; }
:root.ui-phone #m-modal :is(.m-sec, .m-card, .m-pick-card) { background: transparent; }
/* A run of figure tiles (.m-kpi-grid of .m-kpi) is ONE white section split by hairlines — never a box per value. */
:root.ui-phone .m-kpi-grid { gap: 0 !important; background: var(--surface); margin: 0 calc(-1 * var(--space-4)) var(--space-2) !important; }
:root.ui-phone #m-modal .m-kpi-grid { background: transparent; }
:root.ui-phone .m-kpi { background: transparent !important; border: 0 !important; border-radius: 0 !important; padding: 12px var(--space-4) !important;
  border-bottom: var(--border-width) solid var(--border) !important; }
:root.ui-phone .m-kpi-grid > .m-kpi:nth-child(odd) { border-right: var(--border-width) solid var(--border) !important; }
:root.ui-phone .m-kpi-grid > .m-kpi:nth-last-child(-n+2):nth-child(odd), :root.ui-phone .m-kpi-grid > .m-kpi:last-child { border-bottom: 0 !important; }
/* Banners (alerts, payables, approvals, recurring) become full-width tinted rows. */
:root.ui-phone .m-banner { border: 0 !important; border-radius: 0 !important; min-height: 50px;
  margin-left: calc(-1 * var(--space-4)) !important; margin-right: calc(-1 * var(--space-4)) !important; margin-bottom: var(--space-2) !important; padding: 10px var(--space-4) !important; }
:root.ui-phone .m-error-box { border: 0 !important; border-radius: 0 !important; margin-left: calc(-1 * var(--space-4)) !important; margin-right: calc(-1 * var(--space-4)) !important; padding: 10px var(--space-4) !important; }
/* Section headings: 13 px, 600, muted, sentence case; a "See all" link at the right when a full list exists. */
:root.ui-phone .m-section-title { font-size: var(--text-meta) !important; font-weight: var(--weight-semibold); color: var(--muted); text-transform: none !important;
  letter-spacing: 0 !important; margin: var(--space-3) 0 var(--space-2) !important; }
:root.ui-phone .m-sec-head { display: flex; align-items: center; justify-content: space-between; }
:root.ui-phone .m-see-all { border: 0; background: transparent; color: var(--brand-text); font-family: inherit; font-size: var(--text-meta); font-weight: var(--weight-semibold);
  min-height: var(--target-min); padding: 0 0 0 var(--space-3); cursor: pointer; }

/* ── Rows ─────────────────────────────────────────────────────────────────────── */
:root.ui-phone :is(.m-inv-row, .m-alert-row, .m-pick-row, .m-report-row, .m-staff-row, .m-stock-row, .m-result-row, .m-row, .m-frow) {
  min-height: 50px; border-bottom: var(--border-width) solid var(--border) !important; box-sizing: border-box; }
:root.ui-phone :is(.m-inv-row, .m-alert-row, .m-pick-row, .m-report-row, .m-staff-row, .m-stock-row, .m-result-row, .m-row, .m-frow):last-child { border-bottom: 0 !important; }
:root.ui-phone .m-pl-row { min-height: 44px; border-bottom: var(--border-width) solid var(--border) !important; }
:root.ui-phone .m-report-row { font-size: var(--text-body); }
/* The AI chat bar (a pre-Ledger screen): the 44 px floor for its field and its send button. */
:root.ui-phone #m-ai-bar { background: var(--surface); border-top-color: var(--border); }
:root.ui-phone #m-ai-bar textarea { min-height: 44px; }
:root.ui-phone #m-ai-send { width: 44px; height: 44px; border-radius: 22px; background: var(--brand); color: var(--on-brand); }
:root.ui-phone .m-suggest-chips { gap: 0; }
:root.ui-phone .m-pl-row:last-child { border-bottom: 0 !important; }
:root.ui-phone .m-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-text); display: inline-flex; align-items: center;
  justify-content: center; font-weight: var(--weight-semibold); flex-shrink: 0; }
:root.ui-phone .m-row { display: flex; align-items: center; gap: var(--space-3); padding: 8px 0; }
:root.ui-phone .m-row-main { flex: 1; min-width: 0; }
:root.ui-phone .m-row-go { color: var(--brand-text); font-size: var(--text-meta); font-weight: var(--weight-semibold); white-space: nowrap; display: inline-flex; align-items: center; }

/* ── Fields: filled, radius 12, no border, 44 px, 16 px ───────────────────────── */
/* !important: the screens' templates write border/background inline on their inputs. */
:root.ui-phone :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not(.m-amount-input):not(.m-frow-input), select, textarea, .m-input:not(.m-frow-input)) {
  background: var(--field) !important; border: 0 !important; border-radius: 12px !important; min-height: 44px; color: var(--text);
  font-family: inherit; box-shadow: none; outline: none; }
:root.ui-phone :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) { font-size: var(--text-body); }
:root.ui-phone :is(input, textarea)::placeholder { color: var(--muted); opacity: 1; }
:root.ui-phone :is(input:not(.m-amount-input), select, textarea, .m-input):focus { box-shadow: 0 0 0 var(--focus-width) var(--brand) !important; }
:root.ui-phone .m-scan-row input:focus { border: 0 !important; }

/* ── Buttons: the primary is a 50 px pill ─────────────────────────────────────── */
:root.ui-phone :is(.m-save-primary, .m-tender-primary, #m-login-btn, .m-act-primary) { background: var(--brand) !important; color: var(--on-brand) !important;
  border: 0 !important; border-radius: 25px !important; min-height: 50px; font-weight: var(--weight-semibold); }
:root.ui-phone :is(.m-tender-outline, .m-btn-secondary, .m-tender-cancel) { border-radius: 25px !important; min-height: 50px; background: var(--surface);
  border: var(--border-width) solid var(--border) !important; color: var(--text); }
:root.ui-phone .m-tender-btn { height: 50px; }
:root.ui-phone :is(.m-stepper, .m-step-back, .m-cam-btn, .m-toggle) { border: 0 !important; background: var(--field) !important; border-radius: 12px !important; color: var(--text); }
:root.ui-phone .m-cam-btn { color: var(--brand-text); }
/* The fixed bottom bar of a form or the cart: white, full width, a line on top, sticky above the tabs. */
:root.ui-phone :is(.m-actionbar, .m-tender-dock) { position: sticky; bottom: 0; z-index: 6; background: var(--surface) !important; border: 0 !important;
  border-top: var(--border-width) solid var(--border) !important; border-radius: 0 !important; box-shadow: 0 -4px 12px rgba(27, 39, 51, .06) !important;
  margin: var(--space-2) calc(-1 * var(--space-4)) 0 !important; padding: 10px var(--space-4) !important; }
:root.ui-phone .m-bar-total { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
:root.ui-phone .m-bar-total .m-bar-sum { min-width: 0; }
:root.ui-phone .m-bar-total .m-bar-sum .m-dock-total { font-size: var(--text-money-cta); }
:root.ui-phone .m-bar-total .m-tender-btn { flex: 1; max-width: 62%; }

/* ── Chips: a 34 px pill in a 44 px target; selected = filled blue ───────────── */
/* The 5 px transparent border keeps the tap target at 44 px while the pill reads 34 (background-clip). */
:root.ui-phone :is(.chip, .m-chip, .m-period-tab, .m-suggest-chip, .m-shortcut) { min-height: 44px; border: 5px solid transparent !important; background-clip: padding-box !important;
  border-radius: 22px !important; background-color: var(--surface) !important; box-shadow: inset 0 0 0 1px var(--border); color: var(--text) !important;
  padding: 0 14px !important; display: inline-flex; align-items: center; font-family: inherit; font-size: var(--text-body) !important; font-weight: var(--weight-medium); cursor: pointer; }
:root.ui-phone :is(.chip, .m-chip, .m-period-tab, .m-suggest-chip, .m-shortcut).active { background-color: var(--brand) !important; color: var(--on-brand) !important; box-shadow: none; }
/* One segmented control for a period choice (Today · 7 days · Month · Year). */
:root.ui-phone .m-seg { display: flex; background: var(--field); border-radius: 12px; padding: 3px; margin: var(--space-3) 0; }
:root.ui-phone .m-seg button { flex: 1; min-height: var(--target-min); border: 0; border-radius: 10px; background: transparent; color: var(--text);
  font-family: inherit; font-size: var(--text-body); font-weight: var(--weight-medium); cursor: pointer; }
:root.ui-phone .m-seg button.active { background: var(--surface); color: var(--brand-text); font-weight: var(--weight-semibold); box-shadow: 0 1px 3px rgba(27, 39, 51, .12); }

/* ── Sheets ──────────────────────────────────────────────────────────────────── */
:root.ui-phone #m-modal { border-radius: 22px 22px 0 0 !important; background: var(--surface); }

/* Row text: the boards draw names, items, amounts and P&L lines at 15 px (fields and buttons stay 16). */
:root.ui-phone :is(.m-inv-name, .m-inv-amount, .m-line-name, .m-line-total, .m-pl-row, .m-frow-val, .m-alert-title, .m-report-row) { font-size: var(--text-row) !important; }
:root.ui-phone .m-inv-amount, :root.ui-phone .m-line-total { font-weight: 700; }
/* The pre-Ledger 11 px grey (mobile.html's own style block) reaches screens outside _M_UI_TABS (Alerts, Staff):
   every secondary line on the phone is the 13 px muted meta. And a toast is read at a glance: row size. */
:root.ui-phone :is(.m-inv-meta, .m-alert-detail, .m-alert-time, .m-staff-meta) { font-size: var(--text-meta) !important; color: var(--muted); }
:root.ui-phone #m-toast { font-size: var(--text-row) !important; }

/* ── SIGN-IN — Home's blue hero and white sheet, before there is a header ───────── */
:root.ui-phone #auth-screen { background: var(--brand); align-items: stretch; justify-content: flex-start; }
:root.ui-phone .m-auth-hero { padding: calc(env(safe-area-inset-top, 0px) + 48px) var(--space-4) 52px; color: var(--on-brand); flex-shrink: 0; }
:root.ui-phone .m-auth-mark { display: block; height: 44px; width: auto; margin-bottom: var(--space-4); }
:root.ui-phone .m-auth-title { font-size: var(--text-total); font-weight: 700; line-height: 1.15; }
:root.ui-phone .m-auth-sub { color: var(--on-brand-2); font-size: var(--text-body); margin-top: var(--space-1); }
:root.ui-phone .m-auth-sheet { background: var(--surface); border-radius: 22px 22px 0 0; margin-top: -20px; flex: 1 0 auto; position: relative;
  padding: var(--space-6) var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom, 0px)); }
:root.ui-phone .m-auth-field { margin-bottom: var(--space-4); }
:root.ui-phone .m-auth-label { display: block; color: var(--muted); font-size: var(--text-secondary); font-weight: var(--weight-semibold); margin-bottom: var(--space-1); }
:root.ui-phone #auth-screen input { display: block; width: 100%; box-sizing: border-box; padding: 0 var(--space-4); }
:root.ui-phone #m-login-btn { display: block; width: 100%; font-size: var(--text-body); font-family: inherit; cursor: pointer; }
:root.ui-phone #m-login-btn:disabled { opacity: .7; }
:root.ui-phone #auth-err:not(:empty) { margin-top: var(--space-3); }
:root.ui-phone .m-auth-err { background: var(--danger-tint); color: var(--danger); border-radius: 12px; padding: 10px var(--space-3); font-size: var(--text-secondary); }

/* ── HOME — a blue hero continuing the header, a white sheet over it ─────────── */
:root.ui-phone .m-hero-figs { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--on-brand-2); margin: 6px 0 2px; }
/* .meta is muted grey everywhere else (ui.css); on the blue hero it is the light secondary, and the tiles' labels dark. */
:root.ui-phone .m-hero :is(.meta, .m-hero-label, .m-hero-sub, .m-hero-figs) { color: var(--on-brand-2) !important; }
:root.ui-phone .m-act .meta { color: var(--text) !important; }
:root.ui-phone .m-act.m-act-primary .meta { color: var(--on-brand) !important; }
:root.ui-phone :is(.m-row-go, .m-link-btn, .m-see-all) { color: var(--brand-text) !important; }
:root.ui-phone .m-more-row .m-row-go { color: var(--muted) !important; }
:root.ui-phone .m-hero-figs b { color: var(--on-brand); font-weight: 700; }
:root.ui-phone .m-home-sheet { margin-bottom: var(--space-2); }
:root.ui-phone .m-sec-head-in { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
:root.ui-phone .m-sec-h { font-size: var(--text-body); font-weight: 700; color: var(--text); }
:root.ui-phone .m-home-sales .m-inv-row { min-height: 58px; }
:root.ui-phone .m-month-row { border-top: var(--border-width) solid var(--border) !important; }
:root.ui-phone .m-month-row b { font-weight: 700; }
/* -1px up: the header and the hero are one blue; at a fractional device pixel ratio the seam could let the grey page show. */
:root.ui-phone .m-hero { background: var(--brand); color: var(--on-brand); margin: -1px calc(-1 * var(--space-4)) 0; padding: calc(var(--space-2) + 1px) var(--space-4) 36px; position: relative; }
:root.ui-phone .m-hero-label { color: var(--on-brand-2); font-size: var(--text-meta); font-weight: var(--weight-medium); }
:root.ui-phone .m-hero-val { color: var(--on-brand); font-size: var(--text-hero); font-weight: 700; line-height: 1.15; margin: 2px 0 4px; overflow-wrap: anywhere; }
:root.ui-phone .m-hero-sub { color: var(--on-brand-2); font-size: var(--text-meta); line-height: 1.5; }
:root.ui-phone .m-hero-line { color: var(--on-brand); font-size: var(--text-secondary); line-height: 1.5; margin-top: var(--space-1); }
:root.ui-phone .m-home-sheet { background: var(--surface); border-radius: 22px 22px 0 0; margin: -20px calc(-1 * var(--space-4)) 0; padding: var(--space-4) var(--space-4) var(--space-2); position: relative; }
:root.ui-phone .m-home-sheet.flat { margin-top: 0; }
:root.ui-phone .m-home-sheet :is(.m-sec, .m-card) { margin-left: calc(-1 * var(--space-4)); margin-right: calc(-1 * var(--space-4)); }
:root.ui-phone .m-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); margin-bottom: var(--space-3); }
:root.ui-phone .m-act { min-height: 76px; border: 0; border-radius: 16px; background: var(--field); color: var(--text); font-family: inherit;
  font-size: var(--text-meta); font-weight: var(--weight-medium); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 2px; cursor: pointer; position: relative; }
:root.ui-phone .m-act .icon { color: var(--brand-text); }
:root.ui-phone .m-act.m-act-primary { background: var(--brand); color: var(--on-brand); border-radius: 16px !important; min-height: 76px; }
:root.ui-phone .m-act.m-act-primary .icon { color: var(--on-brand); }
:root.ui-phone .m-act-badge { position: absolute; top: 6px; right: 8px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--danger); color: var(--on-brand);
  font-size: var(--text-meta); line-height: 20px; padding: 0 5px; }
:root.ui-phone .m-paid-word { font-size: var(--text-meta); font-weight: var(--weight-medium); margin-top: 2px; }
:root.ui-phone .m-paid-word.paid { color: var(--ok); }
:root.ui-phone .m-paid-word.due { color: var(--warn); }
:root.ui-phone .m-paid-word.draft { color: var(--muted); }

/* Rows sit flush in their section: the section already pads 16 px, so a row's own side padding goes. */
:root.ui-phone :is(.m-sec, .m-card) > :is(.m-inv-row, .m-alert-row, .m-report-row, .m-staff-row, .m-stock-row, .m-result-row) { padding-left: 0 !important; padding-right: 0 !important; }

/* ── REPORTS (the P&L) ───────────────────────────────────────────────────────── */
:root.ui-phone .m-pl-hero { padding-top: var(--space-4); padding-bottom: var(--space-4); }
:root.ui-phone .m-pl-hero .m-kpi-val { font-size: var(--text-hero); font-weight: 700; line-height: 1.15; margin: 4px 0; }
:root.ui-phone .m-sec .m-pl-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 8px 0; }

/* ── SELL (the owner's reference, 2026-10-31) ─────────────────────────────────── */
/* The header on Sell: "New sale" and the customer pill — refresh and the avatar step aside. */
:root.ui-phone :is(#m-hdr-cust, #m-hdr-add) { display: none; }
/* owner, 1 Nov 2026 — Add product / Add purchase (2 Nov: Add employee / Add user) take the Walk-in pill's exact look, on their own lists only. */
:root.ui-phone :is(#app[data-mtab="sell"] #m-header.ui-chrome #m-hdr-cust,
  #app:is([data-mtab="products"], [data-mtab="purchases"], [data-mtab="employees"], [data-mtab="users"]) #m-header.ui-chrome #m-hdr-add[data-can="1"]) { display: inline-flex; align-items: center; gap: 4px; min-height: var(--target-min);
  max-width: 46vw; border: 4px solid transparent; background: transparent; background-clip: padding-box; border-radius: 22px;
  box-shadow: inset 0 0 0 1px var(--on-brand-2); color: var(--on-brand); font-family: inherit; font-size: var(--text-meta); padding: 0 12px; cursor: pointer; }
:root.ui-phone :is(#m-hdr-cust, #m-hdr-add) span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root.ui-phone #app[data-mtab="sell"] #m-header.ui-chrome :is(#m-refresh-btn, #m-avatar) { display: none !important; }
/* The search: a magnifier inside the filled field, the scan button inside at its right. */
:root.ui-phone #msell-step1 > .m-step-head { background: var(--surface); margin: 0 calc(-1 * var(--space-4)) var(--space-2); padding: 10px var(--space-4) !important; }
:root.ui-phone .m-search-field { position: relative; }
:root.ui-phone .m-search-ic { position: absolute; left: 12px; top: 22px; transform: translateY(-50%); color: var(--muted); pointer-events: none; z-index: 1; display: inline-flex; }
:root.ui-phone .m-search-field input { padding-left: 40px !important; padding-right: 52px !important; }
:root.ui-phone .m-search-field .m-cam-btn { position: absolute; right: 0; top: 0; width: 44px; height: 44px; background: var(--brand-tint) !important; color: var(--brand-text); border-radius: 12px !important; }
/* The −/qty/+ as ONE pill. */
:root.ui-phone .m-qty-pill { display: flex; align-items: center; background: var(--field); border-radius: 22px; flex-shrink: 0; }
:root.ui-phone .m-qty-pill .m-stepper { background: transparent !important; border-radius: 22px !important; color: var(--brand-text); }
:root.ui-phone .m-qty-pill .m-line-qty { min-width: 24px; text-decoration: none; }
/* Under the lines: items, includes GST, + Discount — quiet rows, no lines between. */
:root.ui-phone .m-sell-sum { padding-top: 6px; padding-bottom: 6px; }
:root.ui-phone .m-sell-sum .m-pl-row { min-height: 24px; border-bottom: 0 !important; padding: 1px 0; line-height: 1.3; }
:root.ui-phone .m-sell-sum .m-pl-row[role="button"] { min-height: var(--target-min); }
:root.ui-phone .m-link-btn { border: 0; background: transparent; color: var(--brand-text); font-family: inherit; font-size: var(--text-body); font-weight: var(--weight-semibold);
  min-height: var(--target-min); padding: 0; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
:root.ui-phone .m-billdisc-box { padding: 4px 0 10px; }
:root.ui-phone .m-sell-sum .m-link-btn { font-size: var(--text-meta); }
/* The reference pins the bar to the bottom, above the tabs, with the page between: step 1 fills the screen, the
   footer takes the rest of it, and the bar goes to the footer's end. The summary joins the lines (one white area). */
:root.ui-phone .m-screen:has(> #msell-step1) { min-height: 100%; display: flex; flex-direction: column; padding-bottom: 0; }
:root.ui-phone #msell-step1 { flex: 1; display: flex; flex-direction: column; }
:root.ui-phone #msell-footer { flex: 1; display: flex; flex-direction: column; margin-top: 0 !important; }
:root.ui-phone #msell-footer > .m-tender-dock { margin-top: auto !important; }
:root.ui-phone #msell-cart:has(.m-cart-line) { margin-bottom: 0; }
:root.ui-phone #msell-cart:has(.m-cart-line) + #msell-footer > .m-sell-sum { border-top: var(--border-width) solid var(--border); }
:root.ui-phone #msell-cart { background: var(--surface); margin: 0 calc(-1 * var(--space-4)) var(--space-2); padding: 0 var(--space-4); }
:root.ui-phone #msell-cart:has(.m-empty-cart) { background: transparent; }
:root.ui-phone .m-cart-line { background: transparent !important; border: 0 !important; border-radius: 0 !important; margin: 0 !important; padding: 10px 0 !important;
  min-height: 60px; border-bottom: var(--border-width) solid var(--border) !important; }
:root.ui-phone .m-cart-line:last-child { border-bottom: 0 !important; }

/* ── ADD EXPENSE ─────────────────────────────────────────────────────────────── */
:root.ui-phone .m-exp-amount { text-align: center; padding: var(--space-4) 0 var(--space-3); }
:root.ui-phone .m-exp-amount .m-amount-input { width: 70%; border: 0 !important; border-bottom: 2px solid var(--border) !important; border-radius: 0 !important;
  background: transparent !important; font-size: var(--text-hero) !important; font-weight: 700; text-align: center; color: var(--text); padding: 4px 0; min-height: 52px; }
:root.ui-phone .m-exp-amount .m-amount-input:focus { border-bottom-color: var(--brand) !important; box-shadow: none !important; }
:root.ui-phone .m-frow { display: flex; align-items: center; gap: var(--space-3); padding: 4px 0; cursor: pointer; }
:root.ui-phone .m-frow-label { width: 92px; flex-shrink: 0; color: var(--muted); font-size: var(--text-secondary); min-height: 44px; display: inline-flex; align-items: center; }
:root.ui-phone .m-frow-val { flex: 1; min-width: 0; text-align: right; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root.ui-phone .m-frow input { flex: 1; min-width: 0; }
:root.ui-phone .m-frow .icon { color: var(--muted); flex-shrink: 0; }
:root.ui-phone .m-shortcuts { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-1); margin: 0 0 var(--space-2); }
:root.ui-phone .m-shortcuts[hidden] { display: none; }
/* "Recent: Rent · Salary & Wages · Electricity" — text links (board B·Add expense), still 44 px targets. */
:root.ui-phone .m-shortcuts .m-shortcut { border: 0 !important; box-shadow: none; background: transparent !important; color: var(--brand-text) !important;
  padding: 0 4px !important; font-size: var(--text-meta) !important; }
/* The amount: a white band, "₹" and the figure on a brand-blue underline. */
:root.ui-phone .m-exp-amount { background: var(--surface); margin: 0 calc(-1 * var(--space-4)) var(--space-2); }
:root.ui-phone .m-exp-amount .m-amount-input { border-bottom-color: var(--brand) !important; }
/* "For": typed straight into the row, no filled box (board). */
:root.ui-phone .m-frow .m-frow-input { background: transparent !important; padding: 0 !important; box-shadow: none !important; border: 0 !important; border-radius: 0 !important; }
:root.ui-phone .m-frow .m-frow-input:focus { box-shadow: none !important; }
:root.ui-phone .m-frow-label { width: 100px; }
/* A form's Save bar sits at the bottom of the screen, above the tabs (board B·Add expense). */
:root.ui-phone .m-screen:has(> .m-actionbar) { min-height: 100%; display: flex; flex-direction: column; padding-bottom: 0; }
:root.ui-phone .m-screen > .m-actionbar { margin-top: auto !important; }
/* Customers: the search on a white band with its magnifier (board B·Customers). */
:root.ui-phone .m-cust-search { background: var(--surface); margin: 0 calc(-1 * var(--space-4)) var(--space-2); padding: 10px var(--space-4) !important; }
:root.ui-phone #mexp-paidfrom-wrap .m-frow { border-bottom: var(--border-width) solid var(--border) !important; }
/* The GST panel is a section too (its template writes a border and a radius inline). */
:root.ui-phone #mexp-gst { border: 0 !important; border-radius: 0 !important; background: var(--surface) !important;
  margin: 0 calc(-1 * var(--space-4)) var(--space-2) !important; padding: 0 var(--space-4) !important; }

/* ── The iPhone side drawer: white rows under a blue strip with the shop's name ── */
#m-drawer-root { position: fixed; inset: 0; z-index: 150; }
#m-drawer-root[hidden] { display: none; }
#m-drawer-dim { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; margin: 0; background: var(--scrim);
  opacity: 0; transition: opacity .2s ease-out; cursor: pointer; }
#m-drawer { position: absolute; top: 0; bottom: 0; left: 0; width: min(304px, 80%); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-modal); transform: translateX(-100%); transition: transform .22s ease-out; display: flex; flex-direction: column;
  padding: 0 0 env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0); overflow-y: auto; overscroll-behavior: contain; outline: none; }
#m-drawer-root.open #m-drawer { transform: none; }
#m-drawer-root.open #m-drawer-dim { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #m-drawer, #m-drawer-dim { transition: none; } }
#m-drawer-head { display: flex; align-items: center; gap: var(--space-3); background: var(--brand); color: var(--on-brand);
  padding: calc(env(safe-area-inset-top, 0) + var(--space-5)) var(--space-4) var(--space-4); }
#m-drawer-avatar { width: var(--target-min); height: var(--target-min); border-radius: 50%; background: var(--brand-text); color: var(--on-brand);
  display: flex; align-items: center; justify-content: center; font-size: var(--text-body); font-weight: var(--weight-semibold); flex-shrink: 0; }
#m-drawer-who { min-width: 0; }
#m-drawer-shop { color: var(--on-brand); font-size: var(--text-body); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#m-drawer-role { color: var(--on-brand-2); font-size: var(--text-meta); }
#m-drawer-list { padding: 0 0 var(--space-2); flex: 1; background: var(--bg); }
#m-drawer-foot { padding: var(--space-2) 0 var(--space-3); background: var(--surface); border-top: var(--border-width) solid var(--border); }
.m-drawer-group { color: var(--muted); font-size: var(--text-meta); font-weight: var(--weight-semibold); padding: var(--space-3) var(--space-4) var(--space-1); }
.m-drawer-sec { background: var(--surface); }
.m-drawer-row { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 50px; padding: 0 var(--space-4); border: 0;
  border-bottom: var(--border-width) solid var(--border); background: var(--surface); color: var(--text); font-family: inherit; font-size: var(--text-body); text-align: left; cursor: pointer; }
.m-drawer-sec .m-drawer-row:last-child { border-bottom: 0; }
.m-drawer-row .icon { width: var(--icon-nav); height: var(--icon-nav); flex-shrink: 0; color: var(--brand-text); }
.m-drawer-row.active { background: var(--brand-tint); color: var(--brand-text); font-weight: var(--weight-semibold); }
.m-drawer-row:active { background: var(--inset); }
.m-drawer-row .m-drawer-sub { color: var(--muted); font-size: var(--text-meta); margin-left: auto; }
.m-drawer-row.danger { width: calc(100% - 2 * var(--space-4)); margin: var(--space-2) var(--space-4) 0; border-radius: 25px; border-bottom: 0;
  background: var(--danger-tint); color: var(--danger); font-weight: var(--weight-semibold); }
.m-drawer-row.danger .icon { color: var(--danger); }
.m-drawer-row:focus-visible, #m-menu-btn:focus-visible { outline: var(--focus-width) solid var(--brand); outline-offset: -2px; }

/* ── MORE (board B·More): a screen — the account row, then the groups ────────── */
:root.ui-phone .m-more-top { margin-top: var(--space-2); }
:root.ui-phone .m-more-account { display: flex; align-items: center; gap: var(--space-3); min-height: 72px; cursor: pointer; }
:root.ui-phone .m-avatar-brand { width: 48px; height: 48px; background: var(--brand); color: var(--on-brand); font-size: var(--text-body); }
:root.ui-phone .m-more-group { color: var(--muted); font-size: var(--text-meta); font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: .04em;
  padding: var(--space-3) 0 var(--space-1); }
:root.ui-phone .m-more-row { position: relative; border-bottom: 0 !important; min-height: 52px; }
:root.ui-phone .m-more-row:not(:last-child)::after { content: ''; position: absolute; left: 52px; right: 0; bottom: 0; height: 1px; background: var(--border); }
:root.ui-phone .m-more-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-tint); color: var(--brand-text); display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0; }
:root.ui-phone .m-more-ic .icon { width: 20px; height: 20px; }
:root.ui-phone .m-more-row .m-row-go { color: var(--muted); }

/* ── REPORTS: the hero figure with its margin beside it; plain P&L rows ─────── */
:root.ui-phone .m-pl-hero-fig { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
:root.ui-phone .m-pl-hero-fig .m-kpi-sub { font-weight: var(--weight-semibold); }
:root.ui-phone .m-pl-strong { font-weight: 700; }
:root.ui-phone .m-pl-full { padding: 0 0 var(--space-2); }
