/* Phone layouts (designed 2026-11-05, canvas "Portal Phone Layouts"). Loaded on every page
   from Header_new.html. Built on home_new.css's theme tokens (--cp-*), so light/dark and the
   Coatings brand follow the user's settings, like customers.css.

   .m-only shows only at phone width (<= 720px) and .m-hide only above it: a page that keeps
   its desktop table carries a phone version beside it. The Product lookup (.pl-*) is one
   layout at every width. */

body.brand-paints.theme-light   { --m-link: #007DB3; --m-link-strong: #005F88; --m-fill: #01ACF1; --m-tint: #E8F3FA; --m-on-link: #fff; }
body.brand-paints.theme-dark    { --m-link: #5CC8F5; --m-link-strong: #8ED8F8; --m-fill: #01ACF1; --m-tint: #16384A; --m-on-link: #0f1923; }
body.brand-coatings.theme-light { --m-link: #3C7A1E; --m-link-strong: #2C5C16; --m-fill: #73BD42; --m-tint: #EDF6E6; --m-on-link: #fff; }
body.brand-coatings.theme-dark  { --m-link: #96D06C; --m-link-strong: #B4DE95; --m-fill: #73BD42; --m-tint: #233A18; --m-on-link: #141414; }
/* --m-muted is a little darker than --cp-text-muted, which is just under 4.5:1 on white. */
body.theme-light { --m-muted: #5b6a7c; --m-soft: #EEF2F6; --m-warn: #8A4B00; --m-warn-bg: #FFF1DC; --m-bad: #9B1C1C; --m-bad-bg: #FBE4E4; --m-off: #C9D2DC; }
body.theme-dark  { --m-muted: #94a7bd; --m-soft: #212F42; --m-warn: #F2B76A; --m-warn-bg: #3A2A12; --m-bad: #F19999; --m-bad-bg: #3D1C1C; --m-off: #2a3a50; }
body.brand-coatings.theme-light { --m-muted: #626262; --m-soft: #EFEFEF; }

.m-only { display: none !important; }
@media screen and (max-width: 720px) {
  .m-only { display: block !important; }
  .m-hide { display: none !important; }
}

/* ── Section menu: the page title opens a list of the section's pages ─────── */
.m-section { position: relative; z-index: 20; margin: 4px 0 16px; }
.m-section .m-eyebrow { display: block; font-size: 12px; font-weight: 700; color: var(--m-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; }
.m-section summary { list-style: none; display: inline-grid; grid-template-columns: auto auto; align-items: center; column-gap: 8px; margin-left: -4px; padding: 2px 8px 4px 4px; border-radius: 6px; cursor: pointer;
  color: var(--cp-text); }
.m-section summary .m-eyebrow { grid-column: 1 / -1; margin-bottom: 0; }
.m-section summary .m-title { font-size: 24px; font-weight: 900; line-height: 1.2; }
.m-section summary::-webkit-details-marker { display: none; }
.m-section summary svg { color: var(--m-link); transition: transform 0.15s; }
.m-section[open] summary svg { transform: rotate(180deg); }
.m-section summary:focus-visible { outline: 2px solid var(--m-link); outline-offset: 2px; }
.m-section ul { position: absolute; top: 100%; left: 0; right: 0; margin: 6px 0 0; padding: 6px; list-style: none; border-radius: 10px;
  background: var(--cp-surface); border: 1px solid var(--cp-border); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18); }
.m-section li a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border-radius: 6px; text-decoration: none;
  font-size: 16px; font-weight: 700; color: var(--cp-text); }
.m-section li a:hover { background: var(--m-soft); text-decoration: none; }
.m-section li a[aria-current="page"] { font-weight: 900; color: var(--m-link); background: var(--m-tint); }
.m-section li a span { flex: 1; }
.m-section .m-menu-body { position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px; padding: 6px; border-radius: 10px; max-height: 70vh; overflow-y: auto;
  background: var(--cp-surface); border: 1px solid var(--cp-border); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18); }
.m-section .m-menu-body ul { position: static; margin: 0; padding: 0; border: 0; box-shadow: none; background: none; }
.m-section .m-menu-body li a { min-height: 44px; }
.m-menu-group { padding: 10px 12px 4px; font-size: 12px; font-weight: 700; color: var(--m-muted); text-transform: uppercase; letter-spacing: 1px; }
.m-section li a span.m-count { flex: 0 0 auto; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; font-size: 12px; font-weight: 900; }
.m-count.mine { background: var(--m-warn-bg); color: var(--m-warn); }
.m-count.done { background: var(--m-tint); color: var(--m-link-strong); }

/* ── Building blocks ───────────────────────────────────────────────────── */
.m-page { display: flex; flex-direction: column; gap: 14px; padding-bottom: 96px; color: var(--cp-text); }
.m-page h1 { margin: 0; font-size: 24px; font-weight: 900; }
.m-page h2 { margin: 4px 0 0; font-size: 14px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: var(--m-muted); }
.m-label { font-size: 12px; font-weight: 700; color: var(--m-muted); text-transform: uppercase; letter-spacing: 1px; }
.m-muted { color: var(--m-muted); }
.m-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.m-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 8px 12px 14px; border-radius: 8px; background: var(--cp-surface); border: 1px solid var(--cp-border); }
.m-card .row1 { display: flex; align-items: center; gap: 8px; }
.m-card .row2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; color: var(--m-muted); padding-right: 6px; }
.m-card .big { margin-left: auto; font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.m-card .note { margin: 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.m-card form { margin: 0; }
.m-badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.m-badge.warn { background: var(--m-warn-bg); color: var(--m-warn); }
.m-badge.ok { background: var(--m-tint); color: var(--m-link-strong); }
.m-badge.soft { background: var(--m-soft); color: var(--m-muted); }
.m-icon-btn { width: 40px; height: 40px; border: 0; border-radius: 6px; background: transparent; color: var(--m-muted); display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.m-icon-btn.locked { color: var(--m-link); }
.m-icon-btn:hover { background: var(--m-soft); }

.m-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--m-link); border-radius: 8px; overflow: hidden; }
.m-tabs a { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 0 6px; font-size: 15px; font-weight: 700; line-height: 1.15;
  text-decoration: none; background: var(--cp-surface); color: var(--m-link); }
.m-tabs a + a { border-left: 1px solid var(--m-link); }
.m-tabs a[aria-current="page"] { background: var(--m-link); color: var(--m-on-link); }
.m-tabs a:hover { text-decoration: none; }

.m-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.m-tile { background: var(--cp-surface); border: 1px solid var(--cp-border); border-top: 4px solid var(--m-fill); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.m-tile .v { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.m-tile .v span { font-size: 14px; font-weight: 400; color: var(--m-muted); }

.m-banner { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 8px; background: var(--m-warn-bg); font-size: 14px; }
.m-banner b { color: var(--m-warn); }
.m-banner > span { flex: 1; }

.m-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--m-link);
  background: var(--cp-surface); color: var(--m-link); font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.m-btn:hover { text-decoration: none; color: var(--m-link-strong); }
.m-btn.text { border: 0; background: transparent; padding: 0 2px; min-height: 40px; }

.m-period { display: flex; align-items: center; gap: 8px; }
.m-period form { margin: 0; }
.m-period .m-icon-btn { width: 44px; height: 44px; border: 1px solid var(--cp-border); background: var(--cp-surface); color: var(--cp-text); }
.m-period .what { flex: 1; height: 44px; border-radius: 8px; border: 1px solid var(--cp-border); background: var(--cp-surface); font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px; }

/* The main action, pinned to the bottom of the screen. */
.m-fab { position: fixed; left: 16px; right: 16px; bottom: 18px; z-index: 50; height: 56px; border-radius: 28px; border: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--m-link); color: var(--m-on-link) !important; font: inherit; font-size: 17px; font-weight: 900; text-decoration: none !important; box-shadow: 0 4px 14px rgba(0, 61, 89, 0.35); cursor: pointer; }
.m-fab[disabled] { background: var(--m-off); color: var(--m-muted) !important; box-shadow: none; cursor: not-allowed; }

/* Forms */
.m-form { display: flex; flex-direction: column; gap: 18px; }
.m-form label, .m-form .field { display: flex; flex-direction: column; gap: 6px; margin: 0; font-size: 13px; font-weight: 700; color: var(--m-muted); }
.m-form input[type=date], .m-form input[type=time], .m-form input[type=text], .m-form input[type=number], .m-form select, .m-form textarea {
  width: 100%; box-sizing: border-box; min-width: 0; min-height: 48px; padding: 0 10px; border: 1px solid var(--cp-border); border-radius: 6px; font: inherit; font-size: 16px; font-weight: 400;
  color: var(--cp-text); background: var(--cp-surface); }
.m-form textarea { padding: 12px; min-height: 88px; resize: vertical; }
.m-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.m-pills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.m-pills label { position: relative; display: block; margin: 0; }
.m-pills input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.m-pills span { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 24px; border: 1px solid var(--cp-border); background: var(--cp-surface);
  color: var(--m-link); font-size: 15px; font-weight: 700; cursor: pointer; }
.m-pills input:checked + span { background: var(--m-link); border-color: var(--m-link); color: var(--m-on-link); }
.m-pills input:focus-visible + span { outline: 2px solid var(--m-link); outline-offset: 2px; }
.m-stepper { display: flex; align-items: center; border: 1px solid var(--cp-border); border-radius: 6px; background: var(--cp-surface); overflow: hidden; }
.m-stepper.bad { border-color: var(--m-bad); }
.m-stepper button { width: 56px; height: 48px; border: 0; background: transparent; color: var(--m-link); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.m-stepper button:first-child { border-right: 1px solid var(--cp-border); }
.m-stepper button:last-child { border-left: 1px solid var(--cp-border); }
.m-stepper output { flex: 1; text-align: center; font-size: 18px; font-weight: 700; color: var(--cp-text); font-variant-numeric: tabular-nums; }
.m-alert { padding: 10px 12px; border-radius: 6px; background: var(--m-bad-bg); color: var(--m-bad); font-size: 14px; font-weight: 700; }
.m-savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 12px 16px 18px; background: var(--cp-bg); border-top: 1px solid var(--cp-border); display: flex; align-items: center; gap: 14px; }
.m-savebar .m-fab { position: static; flex: 1; box-shadow: none; }
.m-savebar .v { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }

/* A page with a list and an add form: the form shows in place of the list (body.m-adding,
   set from the URL hash so the phone's back button closes it). */
.m-add { display: none; }
body.m-adding .m-add { display: flex; }
body.m-adding .m-browse { display: none; }

/* ── Product lookup (every width) ──────────────────────────────────────── */
.pl { max-width: 720px; display: flex; flex-direction: column; gap: 16px; padding-bottom: 32px; color: var(--cp-text); }
.pl h1 { margin: 0; font-size: 24px; font-weight: 900; }
.pl-search { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 6px 0 14px; border: 1.5px solid var(--m-link); border-radius: 8px; background: var(--cp-surface); }
.pl-search svg { color: var(--m-muted); flex-shrink: 0; }
.pl-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 17px; color: var(--cp-text); }
.pl-search input::-webkit-search-cancel-button { display: none; }
.pl-search button { width: 44px; height: 44px; border: 0; background: transparent; color: var(--m-muted); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.pl-count { font-size: 13px; color: var(--m-muted); }
.pl-results { display: flex; flex-direction: column; gap: 10px; }
.pl-result { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 12px 14px 16px; border-radius: 8px; border: 1px solid var(--cp-border);
  background: var(--cp-surface); color: var(--cp-text); font: inherit; cursor: pointer; }
.pl-result:hover { border-color: var(--m-link); }
.pl-result .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pl-result .code { font-size: 13px; font-weight: 700; color: var(--m-muted); font-variant-numeric: tabular-nums; letter-spacing: 0.3px; display: flex; align-items: center; gap: 8px; }
.pl-result .desc { font-size: 16px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.pl-result .brand { font-size: 13px; color: var(--m-muted); }
.pl-result > svg { color: var(--m-muted); flex-shrink: 0; }
.pl-empty { padding: 24px 16px; border-radius: 8px; text-align: center; color: var(--m-muted); font-size: 15px; line-height: 1.5; }
.pl-empty.box { background: var(--cp-surface); border: 1px dashed var(--cp-border); }
.pl-again { display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--cp-border); border-radius: 8px; background: var(--cp-surface);
  color: var(--m-muted); font: inherit; font-size: 15px; cursor: pointer; text-align: left; }
.pl-head { display: flex; flex-direction: column; gap: 6px; }
.pl-head .codeline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 700; color: var(--m-muted); font-variant-numeric: tabular-nums; }
.pl-head h2 { margin: 0; font-size: 22px; font-weight: 900; line-height: 1.25; overflow-wrap: anywhere; color: var(--cp-text); }
.pl-dg-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; background: var(--m-warn-bg); color: var(--m-warn); }
.pl-barcode { display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 16px; border-radius: 8px; background: var(--cp-surface); border: 1px solid var(--cp-border); }
.pl-barcode > div { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pl-barcode .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; overflow-wrap: anywhere; }
.pl-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border-radius: 8px; overflow: hidden; border: 1px solid var(--cp-border); background: var(--cp-border); }
.pl-facts > div { background: var(--cp-surface); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pl-facts > div.wide { grid-column: span 2; }
.pl-facts .v { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.pl-dg { display: flex; gap: 12px; padding: 14px 16px; border-radius: 8px; background: var(--m-warn-bg); color: var(--cp-text); font-size: 15px; }
.pl-dg svg { color: var(--m-warn); flex-shrink: 0; margin-top: 1px; }
.pl-dg > div { display: flex; flex-direction: column; gap: 4px; }
.pl-dg b { font-weight: 900; color: var(--m-warn); }
.pl-stock { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.pl-stock .title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pl-stock h3 { margin: 0; font-size: 18px; font-weight: 900; }
.pl-own { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 8px; background: var(--m-tint); border: 1px solid var(--cp-border); }
.pl-own > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pl-own .store { font-size: 17px; font-weight: 900; }
.pl-own .qty { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); column-gap: 16px; padding: 4px 14px; border-radius: 8px; background: var(--cp-surface); border: 1px solid var(--cp-border); }
.pl-grid > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--cp-border); font-size: 14px; min-width: 0; }
.pl-grid .store { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-grid .qty { font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-own .qty.negative, .pl-grid .qty.negative { color: var(--m-bad); }

/* ── Form lists (Forms section) ─────────────────────────────────────────
   Status colours, the portal's form palette (slate Open, orange Pending, blue Approved,
   green Completed, red Rejected); Coatings' Approved is a blue, its green being Completed's. */
body.theme-light { --s-open: #5F6B73; --s-open-bg: #EEF1F3; --s-pend: #B25E00; --s-pend-bg: #FFF1DC; --s-appr: #007DB3; --s-appr-bg: #E8F3FA;
  --s-done: #2E7D32; --s-done-bg: #E6F4E7; --s-rej: #9B1C1C; --s-rej-bg: #FBE4E4; --s-off: #D5DDE6; }
body.brand-coatings.theme-light { --s-appr: #1F6FA8; --s-appr-bg: #E6F0F8; }
body.theme-dark { --s-open: #A9B4BD; --s-open-bg: #26323D; --s-pend: #F2B76A; --s-pend-bg: #3A2A12; --s-appr: #5CC8F5; --s-appr-bg: #16384A;
  --s-done: #7ED389; --s-done-bg: #1E3A22; --s-rej: #F19999; --s-rej-bg: #3D1C1C; --s-off: #2a3a50; }
.m-badge.s-open { background: var(--s-open-bg); color: var(--s-open); }
.m-badge.s-pend { background: var(--s-pend-bg); color: var(--s-pend); }
.m-badge.s-appr { background: var(--s-appr-bg); color: var(--s-appr); }
.m-badge.s-done { background: var(--s-done-bg); color: var(--s-done); }
.m-badge.s-rej  { background: var(--s-rej-bg);  color: var(--s-rej); }

.m-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.m-filter { position: relative; flex: 1 1 160px; }
.m-filter summary { list-style: none; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; border: 1.5px solid var(--m-link); border-radius: 8px;
  background: var(--cp-surface); color: var(--cp-text); font-size: 15px; cursor: pointer; }
.m-filter summary::-webkit-details-marker { display: none; }
.m-filter summary .k { color: var(--m-muted); font-size: 13px; font-weight: 700; }
.m-filter summary .v { flex: 1; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-filter summary svg { color: var(--m-link); flex-shrink: 0; }
.m-filter[open] summary svg { transform: rotate(180deg); }
.m-filter ul { position: absolute; z-index: 30; top: 100%; left: 0; min-width: 100%; width: max-content; max-width: 86vw; max-height: 60vh; overflow-y: auto; margin: 6px 0 0; padding: 6px;
  list-style: none; border-radius: 10px; background: var(--cp-surface); border: 1px solid var(--cp-border); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18); }
.m-filter li a { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px; border-radius: 6px; text-decoration: none; font-size: 16px; font-weight: 700; color: var(--cp-text); }
.m-filter li a:hover { background: var(--m-soft); text-decoration: none; }
.m-filter li a[aria-current="true"] { font-weight: 900; color: var(--m-link); background: var(--m-tint); }
.m-find { display: flex; gap: 8px; margin: 0; }
.m-find label { flex: 1; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid var(--cp-border); border-radius: 8px; background: var(--cp-surface); margin: 0; }
.m-find input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 16px; color: var(--cp-text); }
.m-row-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--cp-border); background: var(--cp-surface);
  color: var(--cp-text) !important; text-decoration: none !important; }
.m-row-card:hover { border-color: var(--m-link); }
.m-row-card .top { display: flex; align-items: center; gap: 8px; }
.m-row-card .id { font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; }
.m-row-card .amt { margin-left: auto; font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }
.m-row-card .text { font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.m-row-card .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--m-muted); }
.m-row-card .meta .m-badge:last-child { margin-left: auto; }
.m-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--m-muted); }
.m-photo-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 72px; border-radius: 8px; border: 2px dashed var(--m-link);
  background: var(--m-tint); color: var(--m-link); font-size: 16px; font-weight: 900; text-align: center; padding: 0 12px; }
.m-photo-btn.done { border-style: solid; }
.m-photo input:focus-visible + .m-photo-btn, .m-photo:focus-within .m-photo-btn { outline: 2px solid var(--m-link); outline-offset: 2px; }
.m-progress { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.m-progress li { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--m-muted); }
.m-progress li span { height: 6px; border-radius: 3px; background: var(--s-off); }
.m-progress li[aria-current] { font-weight: 900; }
.m-progress li.s-open { color: var(--s-open); } .m-progress li.s-open span { background: var(--s-open); }
.m-progress li.s-pend { color: var(--s-pend); } .m-progress li.s-pend span { background: var(--s-pend); }
.m-progress li.s-appr { color: var(--s-appr); } .m-progress li.s-appr span { background: var(--s-appr); }
.m-progress li.s-done { color: var(--s-done); } .m-progress li.s-done span { background: var(--s-done); }

/* Cards built by mobile.js from a list page's table ([data-m-list]). */
.m-listview .m-row-card.mine { border-color: var(--s-pend); border-width: 2px; }
.m-row-card .badges { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.m-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.m-kv > div { display: flex; flex-direction: column; min-width: 0; }
.m-kv .k { font-size: 11px; font-weight: 700; color: var(--m-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.m-kv .v { font-size: 14px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.m-row-card .lines { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--m-muted); }
.m-row-card .lines:empty { display: none; }
.m-btn.on { background: var(--m-link); color: var(--m-on-link); }
.m-find-copy { display: flex; gap: 8px; align-items: center; margin: 0; }
.m-find-copy input:not([type=hidden]):not([type=submit]) { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--cp-border); border-radius: 8px;
  background: var(--cp-surface); color: var(--cp-text); font: inherit; font-size: 16px; width: auto !important; }
.m-find-copy .button, .m-find-copy input[type=submit], .m-find-copy button { min-height: 44px; border-radius: 8px; }
.m-find-copy select { height: 44px; border: 1px solid var(--cp-border); border-radius: 8px; font-size: 15px; background: var(--cp-surface); color: var(--cp-text); }

/* New Product request (NewProd_Form.html): already one column on a phone; make the fields
   thumb-sized (16px text stops iOS zooming on focus) and pin the submit button. */
@media screen and (max-width: 720px) {
  .np-page { margin-top: 0; padding-bottom: 96px; }
  .np-page .form-control, .np-page select, .np-page input[type=text], .np-page input[type=number], .np-page textarea {
    font-size: 16px !important; min-height: 48px; }
  .np-page textarea { min-height: 88px; }
  .np-page .select2-container .select2-selection--single { min-height: 48px; display: flex; align-items: center; }
  .np-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0; padding: 12px 16px 18px; background: var(--cp-bg); border-top: 1px solid var(--cp-border); }
  .np-actions .button { flex: 1; height: 56px; border-radius: 28px; font-size: 17px; font-weight: 900; }
  .np-actions .np-step-help { display: none; }
}
.m-card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 2px 0; }
.m-card-actions form { margin: 0; }
.m-card-actions .btn, .m-card-actions button, .m-card-actions a { min-height: 40px; display: inline-flex; align-items: center; }

/* ── Every Forms page on a phone (body.m-app, set by forms_home.html) ─────────────────
   The forms without a hand-built phone layout share these rules: thumb-sized fields (16px
   text stops iOS zooming on focus), stacked inline forms, buttons big enough to tap, and
   wide tables that scroll sideways inside the page rather than widening it. */
@media screen and (max-width: 720px) {
  body.m-app .container { padding-left: 12px; padding-right: 12px; }
  body.m-app .form-control,
  body.m-app input[type=text], body.m-app input[type=number], body.m-app input[type=date], body.m-app input[type=email],
  body.m-app input[type=tel], body.m-app input[type=search], body.m-app input[type=time], body.m-app input[type=password],
  body.m-app select, body.m-app textarea { font-size: 16px !important; min-height: 44px; max-width: 100%; box-sizing: border-box; }
  body.m-app textarea { min-height: 88px; }
  body.m-app input[type=checkbox], body.m-app input[type=radio] { min-height: 0; width: 20px; height: 20px; }
  body.m-app input[type=file] { font-size: 15px !important; min-height: 44px; width: 100%; }
  body.m-app .form-group { margin-bottom: 14px; }
  body.m-app .form-inline { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
  body.m-app .form-inline > * { width: 100%; }
  body.m-app .button, body.m-app button.button, body.m-app input[type=submit] { min-height: 48px; font-size: 16px; }
  body.m-app .btn, body.m-app .tf-btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  body.m-app .panel { max-width: none !important; margin-left: 0; margin-right: 0; }
  body.m-app .panel-body { padding: 12px; }
  body.m-app img { max-width: 100%; height: auto; }
  body.m-app table:not(.m-hide) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  body.m-app table:not(.m-hide) td, body.m-app table:not(.m-hide) th { min-width: 72px; }
  body.m-app .dropdown-content { columns: 1 !important; width: auto !important; min-width: 200px; max-width: 86vw; max-height: 60vh; overflow-y: auto; }
  body.m-app h4 { font-size: 20px; }
}

/* "Open ... (PDF)" in place of an embedded PDF frame (mobile.js frameButtons). */
.m-pdf-open { display: none; }
@media screen and (max-width: 720px) {
  .m-pdf-open[href] { display: inline-flex; margin: 8px 0; min-height: 48px; font-size: 16px; }
}

/* Rep tab bar (Header_new.html, level 30 on Home / Customers / Products at phone width). */
.m-tabbar { display: none; }
@media screen and (max-width: 720px) {
  body.m-has-tabbar { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .m-tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: calc(68px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box;
    background: var(--cp-surface); border-top: 1px solid var(--cp-border); box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06); }
  .m-tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 100%; font-size: 12px; font-weight: 700;
    color: var(--m-muted); text-decoration: none; }
  .m-tabbar a[aria-current="page"] { color: var(--m-link); font-weight: 900; }
  .m-tabbar .m-tab-log span { width: 44px; height: 44px; border-radius: 22px; display: flex; align-items: center; justify-content: center; margin-top: -6px;
    background: var(--m-link); color: var(--m-on-link); box-shadow: 0 3px 10px rgba(0, 61, 89, 0.3); }
  /* Anything else pinned to the bottom sits above the bar. */
  body.m-has-tabbar .m-fab, body.m-has-tabbar .crm-fab { bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
  body.m-has-tabbar .m-savebar { bottom: calc(68px + env(safe-area-inset-bottom)); }
  body.m-has-tabbar .crm-form .crm-submit { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
