/* ==========================================================================
   Positions on a phone (2026-10-14) - styles for js/positions-mobile.js.
   Every rule is scoped to :root.phone (set by js/session-auth.js for an office
   user on a phone), so the desktop page never matches any of it. Colours come
   from the --pm-* tokens in css/mobile-shell.css (Harbor Blue light, navy dark).
   The app's light theme hardens bare elements with !important, hence the
   !important on colours / backgrounds / borders below.
   ========================================================================== */

/* desktop parts the phone does not show */
:root.phone .page-header,
:root.phone .filters-bar .filter-group,
:root.phone #searchSuggestions,
:root.phone .positions-table-container,
:root.phone #positionsListInfo,
:root.phone .stats-summary > .stat-mini:not(.pm-tile),
:root.phone .stats-summary .stat-mini .icon { display: none !important; }

:root.phone body { font-family: 'Space Grotesk', system-ui, sans-serif; }

/* ── tiles = status filters ──────────────────────────────────────────── */
:root.phone .stats-summary {
    display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px;
    padding: 10px 12px !important; margin: 0 !important;
    background: var(--pm-bg) !important; border: 0 !important;
}
:root.phone .stats-summary .stat-mini.pm-tile {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px;
    min-width: 0; min-height: 48px; padding: 7px 8px; margin: 0; box-sizing: border-box;
    background: var(--pm-tile) !important; border: 1px solid transparent !important; border-radius: 4px;
    box-shadow: none !important; cursor: pointer; text-align: left; font: inherit;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
:root.phone .stats-summary .stat-mini.pm-tile .value {
    font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.05rem; line-height: 1.2;
    color: var(--pm-navy-ink) !important; white-space: nowrap;
}
:root.phone .stats-summary .stat-mini.pm-tile .label {
    font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.05em;
    text-transform: uppercase; white-space: nowrap; color: var(--pm-muted) !important;
}
:root.phone .stats-summary .stat-mini.pm-tile[aria-pressed="true"] {
    background: #0a5989 !important; border-color: #0a5989 !important;
}
:root.phone .stats-summary .stat-mini.pm-tile[aria-pressed="true"] .value,
:root.phone .stats-summary .stat-mini.pm-tile[aria-pressed="true"] .label { color: #ffffff !important; }
/* dispatched view: the status tiles do not apply */
:root.phone .stats-summary .stat-mini.pm-tile.pm-dim { opacity: 0.45; cursor: default; }
:root.phone .stats-summary .stat-mini.pm-tile:focus-visible { outline: 2px solid var(--pm-teal); outline-offset: 2px; }

/* DISPATCHED THIS MONTH strip */
:root.phone .stats-summary .stat-mini.pm-tile.pm-disp {
    grid-column: 1 / -1; flex-direction: row !important; align-items: center !important; gap: 10px !important;
    min-height: 36px; padding: 6px 10px !important;
}
:root.phone .pm-disp .pm-disp-label {
    flex: none; font: 600 0.62rem 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--pm-muted) !important;
}
:root.phone .pm-disp .pm-disp-value {
    font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.05rem; color: var(--pm-navy-ink) !important; white-space: nowrap;
}
:root.phone .pm-disp .pm-unit { font-size: 0.62rem; font-weight: 600; margin-left: 3px; color: inherit !important; }
:root.phone .pm-disp .pm-cmp {
    margin-left: auto; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
    font: 700 0.62rem 'Plus Jakarta Sans', sans-serif; color: var(--pm-muted) !important;
}
:root.phone .pm-disp .pm-cmp i { font-size: 0.8rem; color: inherit !important; }
:root.phone .pm-disp .pm-cmp .pm-cmp-pct { color: inherit !important; }
:root.phone .pm-disp .pm-cmp .pm-cmp-note { font-weight: 500; color: var(--pm-muted) !important; margin-left: 2px; }
:root.phone .pm-disp .pm-cmp.up { color: var(--pm-green) !important; }
:root.phone .pm-disp .pm-cmp.dn { color: var(--pm-red) !important; }
:root.phone .pm-disp[aria-pressed="true"] .pm-disp-label,
:root.phone .pm-disp[aria-pressed="true"] .pm-disp-value,
:root.phone .pm-disp[aria-pressed="true"] .pm-cmp .pm-cmp-note { color: #ffffff !important; }
:root.phone .pm-disp[aria-pressed="true"] .pm-cmp.up { color: #8fe0b8 !important; }
:root.phone .pm-disp[aria-pressed="true"] .pm-cmp.dn { color: #ffb4ac !important; }

/* ── search bar (sticky under the top bar) + View selector ─────────────── */
:root.phone .filters-bar {
    position: sticky; top: var(--ms-top-h); z-index: 60;
    display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 8px 12px 9px !important; margin: 0 !important;
    background: var(--pm-bg) !important; border: 0 !important; border-bottom: 1px solid var(--pm-border) !important;
}
:root.phone .filters-bar .search-wrapper { position: relative; flex: 1 1 0; min-width: 0; }
:root.phone .filters-bar .search-wrapper .search-icon { left: 12px; font-size: 13px; color: var(--pm-muted) !important; }
:root.phone .filters-bar .search-input {
    display: block; width: 100%; height: 42px; box-sizing: border-box; padding: 0 38px 0 34px;
    border: 1px solid var(--pm-input-border) !important; border-radius: 6px;
    background: var(--pm-panel) !important; color: var(--pm-ink) !important; box-shadow: none !important;
    font: 400 16px 'Space Grotesk', system-ui, sans-serif;   /* 16px: no zoom on iOS */
    -webkit-appearance: none; appearance: none;
}
:root.phone .filters-bar .search-input::placeholder { color: var(--pm-placeholder) !important; font-size: 14px; }
:root.phone .filters-bar .search-input:focus { border-color: var(--pm-teal) !important; box-shadow: 0 0 0 3px var(--pm-ring) !important; outline: none; }
:root.phone .filters-bar .pm-clr {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; padding: 0;
    display: none; align-items: center; justify-content: center; border: 0 !important; border-radius: 50%;
    background: transparent !important; color: var(--pm-muted) !important; font-size: 14px; cursor: pointer;
}
:root.phone .filters-bar .pm-clr.on { display: flex; }
:root.phone .filters-bar .pm-clr i { color: inherit !important; }

:root.phone .filters-bar .pm-view {
    flex: none; width: 96px; height: 42px; box-sizing: border-box; display: flex; align-items: center; gap: 2px;
    padding: 0 2px 0 9px; border: 1px solid var(--pm-navy) !important; border-radius: 6px; background: var(--pm-panel) !important;
}
:root:not([data-theme="light"]).phone .filters-bar .pm-view { border-color: var(--pm-teal) !important; }
:root.phone .filters-bar .pm-view .pm-view-k {
    font: 700 0.6rem 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.07em; text-transform: uppercase; color: var(--pm-muted) !important;
}
:root.phone .filters-bar .pm-view select {
    flex: 1; min-width: 0; height: 38px; padding: 0 2px; border: 0 !important; background: transparent !important;
    color: var(--pm-navy-ink) !important; font: 700 16px 'Plus Jakarta Sans', sans-serif; box-shadow: none !important; cursor: pointer;
}
:root.phone .filters-bar .pm-view:focus-within { box-shadow: 0 0 0 3px var(--pm-ring); }
:root.phone .filters-bar .pm-view select:focus { outline: none; }

/* suggestions: full bar width (search + View) */
:root.phone .pm-sug {
    position: absolute; left: 0; right: -104px; top: calc(100% + 6px); z-index: 70; display: none; overflow: hidden;
    background: var(--pm-panel) !important; border: 1px solid var(--pm-border) !important; border-radius: 6px;
    box-shadow: var(--pm-shadow);
}
:root.phone .pm-sug.open { display: block; }
:root.phone .pm-sug .pm-sg {
    display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 12px; box-sizing: border-box; margin: 0;
    border: 0 !important; border-bottom: 1px solid var(--pm-border) !important; border-radius: 0;
    background: transparent !important; color: var(--pm-ink) !important; text-align: left; cursor: pointer; font: inherit;
}
:root.phone .pm-sug .pm-sg:last-child { border-bottom: 0 !important; }
:root.phone .pm-sug .pm-sg.active,
:root.phone .pm-sug .pm-sg:active { background: var(--pm-hover) !important; }
:root.phone .pm-sug .pm-sg-k {
    flex: none; width: 66px; font: 700 0.58rem 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.07em; text-transform: uppercase;
    color: var(--pm-muted) !important;
}
:root.phone .pm-sug .pm-sg-v {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.86rem; color: var(--pm-ink) !important;
}
:root.phone .pm-sug .pm-hit { font-weight: 700; color: var(--pm-ink) !important; }
:root.phone .pm-sug .pm-sg-x { color: var(--pm-muted) !important; }
:root.phone .pm-sug .pm-sg-c { flex: none; font: 600 0.68rem 'JetBrains Mono', monospace; color: var(--pm-ref) !important; }

/* removable filter tag */
:root.phone .pm-tags { display: none; flex-basis: 100%; }
:root.phone .pm-tags.on { display: flex; }
:root.phone .pm-tag {
    display: inline-flex; align-items: center; gap: 6px; height: 30px; max-width: 100%; box-sizing: border-box; padding: 0 3px 0 11px;
    border: 1px solid var(--pm-input-border) !important; border-radius: 15px; background: var(--pm-panel) !important;
    font-size: 0.8rem; color: var(--pm-ink) !important;
}
:root.phone .pm-tag .pm-tag-k { color: var(--pm-muted) !important; flex: none; }
:root.phone .pm-tag .pm-tag-v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--pm-ink) !important; }
:root.phone .pm-tag .pm-tag-x {
    flex: none; width: 24px; height: 24px; padding: 0; display: flex; align-items: center; justify-content: center;
    border: 0 !important; border-radius: 50%; background: var(--pm-tile) !important; color: var(--pm-ink2) !important; font-size: 11px; cursor: pointer;
}
:root.phone .pm-tag .pm-tag-x i { color: inherit !important; }

/* ── sort selector + Dispatched switch (above the count line) ───────── */
:root.phone .pm-ctl { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 0; }
:root.phone .pm-sort {
    flex: 0 1 auto; min-width: 0; height: 36px; box-sizing: border-box; display: inline-flex; align-items: center; gap: 4px;
    padding: 0 2px 0 9px; margin: 0; border: 1px solid var(--pm-navy) !important; border-radius: 6px;
    background: var(--pm-panel) !important; box-shadow: none !important; cursor: pointer;
}
:root:not([data-theme="light"]).phone .pm-sort { border-color: var(--pm-teal) !important; }
:root.phone .pm-sort .pm-sort-k {
    flex: none; font: 700 0.6rem 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.07em; text-transform: uppercase; color: var(--pm-muted) !important;
}
:root.phone .pm-sort select {
    min-width: 0; max-width: 190px; height: 34px; padding: 0 2px; border: 0 !important; background: transparent !important; box-shadow: none !important;
    color: var(--pm-navy-ink) !important; font: 700 16px 'Plus Jakarta Sans', sans-serif; cursor: pointer;   /* 16px: no zoom on iOS */
}
:root.phone .pm-sort select:focus { outline: none; }
:root.phone .pm-sort.pm-off { opacity: 0.6; border-color: var(--pm-border) !important; cursor: default; }
:root.phone .pm-sort.pm-off select { cursor: default; -webkit-appearance: none; appearance: none; color: var(--pm-ink2) !important; }
:root.phone .pm-sort:focus-within { box-shadow: 0 0 0 3px var(--pm-ring) !important; }
:root.phone .pm-sw {
    flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 2px 0 6px; margin: 0;
    border: 0 !important; background: transparent !important; box-shadow: none !important; cursor: pointer; touch-action: manipulation;
}
:root.phone .pm-sw .pm-sw-track {
    position: relative; width: 34px; height: 20px; border-radius: 10px; box-sizing: border-box;
    background: var(--pm-tile) !important; border: 1px solid var(--pm-input-border) !important; transition: background 0.15s;
}
:root.phone .pm-sw .pm-sw-knob {
    position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
    background: var(--pm-muted) !important; transition: transform 0.15s, background 0.15s;
}
:root.phone .pm-sw[aria-checked="true"] .pm-sw-track { background: #0a5989 !important; border-color: #0a5989 !important; }
:root.phone .pm-sw[aria-checked="true"] .pm-sw-knob { transform: translateX(14px); background: #ffffff !important; }
:root.phone .pm-sw .pm-sw-label {
    font: 700 0.62rem 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.07em; text-transform: uppercase; color: var(--pm-ink2) !important;
}
:root.phone .pm-sw:focus-visible { outline: 2px solid var(--pm-teal); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { :root.phone .pm-sw .pm-sw-knob, :root.phone .pm-sw .pm-sw-track { transition: none; } }

/* group header when grouped by customer */
:root.phone .pm-group {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 14px;
    background: var(--pm-tile) !important; border-bottom: 1px solid var(--pm-border);
    font: 700 0.66rem 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.06em; text-transform: uppercase;
}
:root.phone .pm-group .pm-group-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--pm-ink2) !important; }
:root.phone .pm-group .pm-group-c { flex: none; font-family: 'JetBrains Mono', monospace; color: var(--pm-ref) !important; }

/* ── list ─────────────────────────────────────────────────────────────── */
:root.phone .pm-head {
    display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 14px 5px;
    font-size: 11px; color: var(--pm-muted) !important;
}
:root.phone .pm-head .pm-count { color: var(--pm-muted) !important; }
:root.phone .pm-head .pm-count-n { font-weight: 700; color: var(--pm-ink2) !important; }
:root.phone .pm-head .pm-legend { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; white-space: nowrap; color: var(--pm-muted) !important; }
:root.phone .pm-head .pm-legend .pm-dot { margin-left: 4px; }
:root.phone .pm-head .pm-legend-k { margin-left: 6px; color: var(--pm-muted) !important; }
@media (max-width: 380px) { :root.phone .pm-head .pm-legend-k { display: none; } }

:root.phone .pm-list { border-top: 1px solid var(--pm-border); }
:root.phone .pm-row {
    display: flex; align-items: stretch; border-bottom: 1px solid var(--pm-border);
    background: var(--pm-bg) !important; touch-action: manipulation;
}
:root.phone .pm-row:nth-child(even) { background: var(--pm-row-alt) !important; }
:root.phone .pm-main {
    flex: 1; min-width: 0; padding: 8px 6px 8px 14px; cursor: pointer; background: transparent !important;
    -webkit-tap-highlight-color: transparent;
}
:root.phone .pm-main:active { background: var(--pm-hover) !important; }
:root.phone .pm-main:focus-visible { outline: 2px solid var(--pm-teal); outline-offset: -2px; }
:root.phone .pm-r1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 20px; }
:root.phone .pm-left { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
:root.phone .pm-ref {
    flex: none; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.01em; color: var(--pm-ref) !important;
}
:root.phone .pm-cust { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.82rem; color: var(--pm-ink2) !important; }
:root.phone .pm-row .pos-status-host { flex: none; display: inline-flex; align-items: center; gap: 4px; }
:root.phone .pm-row .status-badge,
:root.phone .pm-sheet .status-badge {
    font-size: 0.62rem; font-weight: 700; padding: 0.25rem 0.45rem; border-radius: 4px; line-height: 1.1;
    text-transform: uppercase; white-space: nowrap;
}
:root.phone .pm-r2 {
    margin-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-size: 0.72rem; color: var(--pm-muted) !important;
}
:root.phone .pm-r2 .pm-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--pm-muted) !important; }
:root.phone .pm-r2 .pm-m { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--pm-ink2) !important; }
:root.phone .pm-r2 .pm-prod,
:root.phone .pm-r2 .pm-qty { color: var(--pm-muted) !important; }
:root.phone .pm-sep { margin: 0 4px; color: var(--pm-muted) !important; }
:root.phone .pm-r2 .pm-r { flex: none; display: flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--pm-muted) !important; }
:root.phone .pm-r2 .pm-eta { margin-left: 2px; color: var(--pm-muted) !important; }
:root.phone .pm-r2 .pm-eta-v { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 0.7rem; color: var(--pm-ink) !important; }
:root.phone .pm-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; vertical-align: middle; }
:root.phone .pm-dot.ok { background: var(--pm-green) !important; }
:root.phone .pm-dot.miss { background: var(--pm-red) !important; }
:root.phone .pm-more {
    flex: none; width: 44px; margin: 0; padding: 0; border: 0 !important; border-left: 1px solid var(--pm-border) !important; border-radius: 0;
    background: transparent !important; color: var(--pm-muted) !important; font-size: 16px; cursor: pointer; touch-action: manipulation;
}
:root.phone .pm-more i { color: inherit !important; }
:root.phone .pm-more:active { background: var(--pm-hover) !important; color: var(--pm-navy-ink) !important; }
:root.phone .pm-empty { padding: 40px 20px; text-align: center; font-size: 0.85rem; color: var(--pm-muted) !important; }
:root.phone .pm-loading { color: var(--pm-muted) !important; }

/* ── pagination ───────────────────────────────────────────────────────── */
:root.phone .pm-pager { padding: 12px 12px 18px; }
:root.phone .pm-pager:empty { display: none; }
:root.phone .pm-pg-row { display: flex; align-items: center; gap: 8px; }
:root.phone .pm-range { flex: 1; min-width: 0; text-align: center; font-size: 11.5px; color: var(--pm-muted) !important; }
:root.phone .pm-pg {
    height: 44px; min-width: 44px; padding: 0 10px; margin: 0; box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid var(--pm-input-border) !important; border-radius: 6px;
    background: var(--pm-panel) !important; color: var(--pm-ink) !important; box-shadow: none !important;
    font: 700 12px 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.04em; cursor: pointer; touch-action: manipulation;
}
:root.phone .pm-pg i { font-size: 11px; color: inherit !important; }
:root.phone .pm-pg-step { flex: none; text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; }
:root.phone .pm-pg:disabled { opacity: 0.4; cursor: default; }
:root.phone .pm-pg:active:not(:disabled) { background: var(--pm-hover) !important; }
:root.phone .pm-pg-nums { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; margin-top: 8px; }
:root.phone .pm-pg-n { font-family: 'JetBrains Mono', monospace; font-size: 13px; padding: 0 6px; }
:root.phone .pm-pg-n.on { background: #0a5989 !important; border-color: #0a5989 !important; color: #ffffff !important; }
:root.phone .pm-pg-gap { min-width: 14px; text-align: center; color: var(--pm-muted) !important; }

/* ── bottom sheets (details card, actions) ───────────────────────────── */
:root.pm-locked body { position: fixed; left: 0; right: 0; overflow: hidden; }
:root.phone .pm-scrim { position: fixed; inset: 0; z-index: 2090; display: none; background: var(--pm-scrim) !important; }
:root.phone .pm-scrim.open { display: block; }
:root.phone .pm-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 2100; box-sizing: border-box;
    max-height: 84vh; max-height: 84dvh; overflow-y: auto; overscroll-behavior: contain;
    padding: 8px 14px calc(16px + var(--ms-safe-bottom));
    background: var(--pm-panel) !important; color: var(--pm-ink) !important;
    border-top: 1px solid var(--pm-border) !important; border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 24px rgba(10, 47, 89, 0.16);
    transform: translateY(105%); visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
}
:root.phone .pm-sheet.open { transform: none; visibility: visible; transition: transform 0.22s ease, visibility 0s; }
:root.phone .pm-grab { width: 36px; height: 4px; border-radius: 2px; margin: 0 auto 10px; background: var(--pm-border) !important; }
:root.phone .pm-sh-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 4px; }
:root.phone .pm-sh-id { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
:root.phone .pm-sh-id .pm-ref { font-size: 0.95rem; }
:root.phone .pm-sh-sub { font-size: 0.8rem; margin-bottom: 10px; color: var(--pm-muted) !important; }

/* Shipment Register chips: FREIGHT / RELEASE / QC (top right of the card) */
:root.phone .pm-regs { margin-left: auto; display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
:root.phone .pm-reg {
    display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 6px; box-sizing: border-box;
    border: 1px solid var(--pm-border) !important; border-radius: 3px; background: var(--pm-tile) !important;
    font: 700 0.58rem 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
}
:root.phone .pm-reg .pm-reg-k { color: var(--pm-muted) !important; }
:root.phone .pm-reg .pm-reg-v { font-family: 'JetBrains Mono', monospace; font-size: 0.66rem; letter-spacing: 0; color: var(--pm-ink) !important; }
:root.phone .pm-reg.blank .pm-reg-v { color: var(--pm-muted) !important; }
/* the register's .cell-warn look: yellow fill, red bold text */
:root.phone .pm-reg.warn { background: #fbff00 !important; border-color: #e3e600 !important; }
:root.phone .pm-reg.warn .pm-reg-k,
:root.phone .pm-reg.warn .pm-reg-v { color: #f12121 !important; font-weight: 800; }

/* label / value grid */
:root.phone .pm-kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px 12px; margin: 6px 0 4px; }
:root.phone .pm-kv-i { min-width: 0; }
:root.phone .pm-kv-wide { grid-column: 1 / -1; }
:root.phone .pm-kv-v.pm-notes { white-space: pre-line; overflow-wrap: anywhere; font-size: 0.82rem; line-height: 1.4; }
:root.phone .pm-kv-k {
    display: block; font: 600 0.6rem 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.05em; text-transform: uppercase; color: var(--pm-muted) !important;
}
:root.phone .pm-kv-v {
    display: block; margin-top: 2px; font-size: 0.85rem; line-height: 1.3; overflow-wrap: anywhere; color: var(--pm-ink) !important;
}
:root.phone .pm-kv-note { display: block; font-size: 0.68rem; margin-top: 1px; color: var(--pm-muted) !important; }
:root.phone .pm-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; }
:root.phone .pm-flag {
    display: inline-block; margin-left: 4px; padding: 1px 5px; border-radius: 3px; vertical-align: 1px;
    font: 700 0.58rem 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.05em; text-transform: uppercase;
    background: var(--pm-tile) !important; color: var(--pm-ink2) !important;
}

/* copyable value: tap = copy; the copy icon turns into a check that pops in */
:root.phone .pm-cv {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 28px; box-sizing: border-box;
    padding: 2px 6px; margin: -2px -6px; border-radius: 4px; cursor: copy;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation; color: var(--pm-ink) !important;
}
:root.phone .pm-cv.pm-mono .pm-t { color: var(--pm-ref) !important; font-weight: 600; }
:root.phone .pm-cv .pm-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit !important; }
:root.phone .pm-cv .pm-ci { flex: none; font-size: 0.68rem; color: var(--pm-muted) !important; }
:root.phone .pm-cv:active { background: var(--pm-hover) !important; }
:root.phone .pm-cv:focus-visible { outline: 2px solid var(--pm-teal); outline-offset: 1px; }
:root.phone .pm-cv.done { animation: pmPulse 1.2s ease-out; }
:root.phone .pm-cv.done .pm-ci { color: #2c8c62 !important; animation: pmPop 0.18s ease-out; }
@keyframes pmPop { from { transform: scale(0.4); } to { transform: scale(1); } }
@keyframes pmPulse { from { background: rgba(44, 140, 98, 0.14); } to { background: rgba(44, 140, 98, 0); } }

/* Shipment Register comments: the register's own .cell-comment-badge / .cell-comment-tooltip-portal /
   .cell-comment-editor-* (css/enhancements.css) and .fut-* thread (css/follow-up-tasks.css). Only the
   placement is set here: inline badges on the rows and the COMMENTS line, corner badges on card fields,
   the bubble and the editor as bottom sheets, 16 px text fields (no zoom on iOS). */
:root.phone .pm-r1r { flex: none; display: inline-flex; align-items: center; gap: 6px; }
:root.phone .pm-rb { display: inline-flex; align-items: center; gap: 5px; }
:root.phone .pm-rb:empty { display: none; }
:root.phone .pm-rb .cell-comment-badge,
:root.phone .pm-cm-item .cell-comment-badge,
:root.phone .pm-cm-add .cell-comment-badge { position: relative; top: auto; right: auto; flex: none; }
:root.phone .pm-rb-more { font: 700 0.62rem 'JetBrains Mono', monospace; color: var(--pm-muted) !important; }
:root.phone .pm-kv-i, :root.phone .pm-reg { position: relative; }
:root.phone .pm-cb:empty { display: none; }
:root.phone .pm-kv-i > .pm-kv-v > .pm-cb > .cell-comment-badge,
:root.phone .pm-kv-i > .pm-cb > .cell-comment-badge { top: 0; right: 0; }
:root.phone .pm-reg .pm-cb > .cell-comment-badge { top: -8px; right: -7px; }
:root.phone .pm-cm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 6px; }
:root.phone .pm-cm-item { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; }
:root.phone .pm-cm-lbl { font: 700 0.6rem 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pm-ink2) !important; }
:root.phone .pm-cm-none { font-size: 0.8rem; color: var(--pm-muted) !important; }
:root.phone .pm-cm-add {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 8px; margin: 0; border-radius: 6px;
    border: 1px dashed var(--pm-input-border) !important; background: transparent !important; box-shadow: none !important; cursor: pointer;
}
:root.phone .pm-cm-add .pm-cm-plus { cursor: pointer; }
:root.phone .pm-cm-scrim, :root.phone .pm-cce-scrim { position: fixed; inset: 0; display: none; background: var(--pm-scrim) !important; }
:root.phone .pm-cm-scrim { z-index: 2190; }
:root.phone .pm-cce-scrim { z-index: 2290; }
:root.phone .pm-cm-scrim.open, :root.phone .pm-cce-scrim.open { display: block; }
:root.phone #pmCommentPortal {
    top: auto !important; left: 0 !important; right: 0; bottom: 0; width: auto; min-width: 0; max-width: none;
    max-height: 70vh; overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box;
    padding: 10px 14px calc(14px + var(--ms-safe-bottom)); border-radius: 14px 14px 0 0;
}
:root.phone #pmCommentPortal .pm-portal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; background: transparent !important; }
:root.phone #pmCommentPortal .pm-portal-title { font: 700 0.66rem 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
:root.phone #pmCommentPortal .pm-portal-x {
    width: 36px; height: 36px; padding: 0; border-radius: 6px; border: 0 !important; background: transparent !important;
    color: inherit !important; font-size: 20px; line-height: 1; cursor: pointer;
}
:root.phone #pmCommentPortal .cct-btn { min-width: 32px; min-height: 32px; }
:root.phone #pmCommentPortal [data-fut-reply] { font-size: 16px; min-height: 36px; }
:root.phone #pmCommentEditor { z-index: 2300; }
:root.phone #pmCommentEditor .cell-comment-editor-panel {
    left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto; max-width: none; box-sizing: border-box;
    border-radius: 14px 14px 0 0; padding: 12px 14px calc(14px + var(--ms-safe-bottom)); max-height: 80vh; overflow-y: auto;
}
:root.phone #pmCommentEditor .cce-text { font-size: 16px; width: 100%; box-sizing: border-box; }
:root.phone #pmCommentEditor .pm-cce-col { margin-top: 8px; }
:root.phone #pmCommentEditor .pm-cce-col[hidden] { display: none; }
:root.phone #pmCommentEditor .pm-cce-col select {
    display: block; width: 100%; height: 40px; margin: 4px 0 8px; padding: 0 8px; box-sizing: border-box; border-radius: 6px;
    font: 400 16px 'Space Grotesk', system-ui, sans-serif;
}
:root.phone #pmCommentEditor .cce-footer .btn { min-height: 40px; min-width: 88px; }

/* action list */
:root.phone .pm-sh-list { margin-top: 10px; border-top: 1px solid var(--pm-border); }
:root.phone .pm-sh-item {
    display: flex; align-items: center; gap: 14px; width: 100%; height: 50px; padding: 0 2px; margin: 0; box-sizing: border-box;
    border: 0 !important; border-bottom: 1px solid var(--pm-border) !important; border-radius: 0;
    background: transparent !important; color: var(--pm-ink) !important; box-shadow: none !important;
    font: 600 12px 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.06em; text-transform: uppercase; text-align: left; cursor: pointer;
}
:root.phone .pm-sh-item span { color: inherit !important; }
:root.phone .pm-sh-item i { width: 20px; text-align: center; font-size: 15px; color: var(--pm-muted) !important; }
:root.phone .pm-sh-item:active { background: var(--pm-hover) !important; }
:root.phone .pm-sh-item .pm-miss { margin-left: auto; font-size: 0.6rem; color: var(--pm-red) !important; }
:root.phone .pm-sh-item.pm-danger,
:root.phone .pm-sh-item.pm-danger i { color: var(--pm-red) !important; }
:root.phone .pm-sh-close {
    display: block; width: 100%; height: 44px; margin-top: 12px; border-radius: 6px;
    border: 1px solid var(--pm-border) !important; background: var(--pm-tile) !important; color: var(--pm-ink) !important;
    font: 700 11px 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    :root.phone .pm-cv.done,
    :root.phone .pm-cv.done .pm-ci { animation: none; }
    :root.phone .pm-sheet,
    :root.phone .pm-sheet.open { transition: none; }
}
