/* Phone workflow frame. Loaded last. Desktop remains governed by its screen styles. */
@media (max-width: 760px) {
  .shell { grid-template-rows: 56px minmax(0, 1fr); height: 100dvh; padding-block-end: var(--mobile-nav-height); box-sizing: border-box; }
  .shell-top { height: 56px; min-height: 56px; padding: 6px 12px; gap: 8px; flex-wrap: nowrap; }
  .shell-brand-group { gap: 6px; flex: 0 1 auto; min-width: 0; }
  .shell-wordmark { font-size: var(--t-13); }
  .shell-rule, .shell-shift-chip { display: none; }
  .shell-shop-name { font-size: var(--t-13); max-inline-size: 84px; min-block-size: 44px; }
  .shell-end { margin-inline-start: auto; flex: none; }
  .shell-user { min-block-size: 44px; padding-inline: 4px; border-radius: var(--r-2); }
  .pill-user { max-inline-size: 54px; }
  .shell-box-slot { order: 0; flex: 1 1 60px; min-inline-size: 44px; inline-size: auto; margin: 0; }
  .box-field { height: 44px; padding-inline: 8px; gap: 4px; }
  .box-field input { font-size: 16px; }
  .box-field .box-search-icon { display: block; }
  .box-clear { inline-size: 44px; block-size: 44px; }
  .shell.box-open .shell-box-slot { position: absolute; inset-inline: 8px; inset-block-start: 6px; z-index: 80; }
  .shell.box-open .box-field { height: 44px; background: var(--surface); }
  .shell.box-open .box-field input { font-size: 16px; }
  .box-results { width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 130px); }
  .box-row { height: auto; min-height: 48px; }
  .box-row-copy, .box-verb-name { white-space: normal; overflow-wrap: anywhere; }
  .shell-places { position: fixed; inset-block-end: 0; inset-inline: 0; z-index: 60; height: var(--mobile-nav-height); padding: 0 8px env(safe-area-inset-bottom, 0px); background: var(--surface); border-block-start: 1px solid var(--line); display: flex; gap: 4px; box-sizing: border-box; justify-content: space-around; }
  .shell-places .place { flex: 1 1 0; height: 48px; min-height: 48px; justify-content: center; gap: 6px; margin-block-start: 4px; font-size: var(--t-13); padding-inline: 8px; }
  .place[aria-current="page"]::after { inset-block-end: auto; inset-block-start: 0; }
  .shell-body { min-height: 0; }
  .shell-main { padding: 12px; overscroll-behavior-y: contain; }
  .shell-main:not(.screen-sell) { display: block; }
  .shell-main:has(> .goods-page) { padding: 0; }
  .shell-main:has(> .mgmt-page) { padding: 12px; }
  .shell-back:not([hidden]), .shell-body:has(> .shell-main > .bf > :is(.scr-actions, .bf-head):first-child) > .shell-back:not([hidden]) { position: static; padding: 0 12px; border: 0; background: var(--surface); }
  .shell-back:not([hidden])::after { display: none !important; }
  .shell-back .shell-back-link { inline-size: auto !important; min-block-size: 44px; block-size: 44px !important; padding-inline: 0 !important; }
  .shell-body:has(> .shell-main > .bf > :is(.scr-actions, .bf-head):first-child) > .shell-back:not([hidden]) ~ .shell-main > .bf > :is(.scr-actions, .bf-head):first-child { padding-inline-start: 0 !important; }
  .kbd, .nav-key, span.key:not(#multiplier-badge) { display: none !important; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; min-width: 0; max-width: 100%; }
  .btn, .segmented > button { min-height: 44px; }
  .scr-head, .bf-head, .bo-head { gap: 8px; }
  .scr-head-text h1, .bf-head h1, .bo-head h1 { font-size: var(--t-22); }
  .scr-actions { gap: 6px; flex-wrap: wrap; }
  .scr-actions .btn { min-height: 44px; white-space: normal; }
  .scr-filters, .scr-totals { flex-wrap: wrap; gap: 8px; }
  .scr-totals .total { padding-inline: 6px; }
  .scr-totals-note { flex-basis: 100%; max-inline-size: none; }
  .bf-main, .bf, .bo-page { min-inline-size: 0; }
  .card-h, .card-b { padding: 12px; }
  .card-h { flex-wrap: wrap; gap: 8px; }
  .table-wrap, .bo-scroll { max-inline-size: 100%; overflow-x: auto; }
  .dialog { max-inline-size: 100%; max-block-size: 100dvh; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog input, .dialog select, .dialog textarea { font-size: 16px; }

  /* Management is a directory, with owner-only KPIs kept in the original role gate. */
  .mgmt-page { gap: 20px; }
  .mgmt-head { display: block; }
  .mgmt-head-text p { margin-block: 6px 12px; }
  .mgmt-today { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; overflow: hidden; }
  .mgmt-today-cell { min-inline-size: 0 !important; padding: 12px; gap: 4px; border-block-end: 1px solid var(--line); }
  .mgmt-today-cell:nth-child(3), .mgmt-today-cell:nth-child(7) { border-inline-start: 1px solid var(--line); }
  .mgmt-today-label { white-space: normal; font-size: var(--t-12); }
  .mgmt-today-value { white-space: normal; overflow-wrap: anywhere; font-size: var(--t-18); }
  .mgmt-today-rule { display: none; }
  .mgmt-tiles { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 0; border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
  .mgmt-tile { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; min-block-size: 76px; padding: 12px; border: 0; border-radius: 0; border-block-end: 1px solid var(--line); overflow: visible; }
  .mgmt-tile:last-child { border-block-end: 0; }
  .mgmt-tile-top { display: contents; }
  .mgmt-tile-icon { grid-column: 1; grid-row: 1 / span 2; inline-size: 44px; block-size: 44px; }
  .mgmt-tile-label { grid-column: 2; grid-row: 1; margin: 0; font-size: var(--t-15); white-space: normal; overflow: visible; }
  .mgmt-tile-hint { grid-column: 2; grid-row: 2; white-space: normal; overflow: visible; font-size: var(--t-12); }
  .mgmt-tile-count, .mgmt-tile-alert, .mgmt-tile-pending { grid-column: 2; grid-row: 3; justify-self: start; height: auto; min-height: 24px; white-space: normal; }
}
.mobile-account-back { display: none; }
@media (max-width: 760px) {
  .mobile-account-root .scr-split, .mobile-account-root .cv-page .scr-split { display: block; min-height: 0; }
  .mobile-account-root[data-mobile-account-view="list"] .scr-split-detail { display: none; }
  .mobile-account-root[data-mobile-account-view="detail"] .scr-split-list { display: none; }
  .mobile-account-root .scr-split-list, .mobile-account-root .scr-split-detail { overflow: visible; width: 100%; }
  .mobile-account-root .mobile-account-back { display: inline-flex; margin-block-end: 8px; min-height: 44px; padding-inline: 0; }
  .mobile-account-root :is(.sv-page,.us-page,.cv-page,.dr-page,.bf-main,.sv-list,.sv-list-grid,.us-roster,.us-roster-grid,.dr-list,.dr-roster,.us-selected,.dr-account,.dr-overview) { height: auto; min-height: 0; overflow: visible; }
  .mobile-account-root :is(.sv-list-body,.us-roster-body,.dr-roster-body) { overflow: visible; }
  .mobile-account-root .bf-main { padding: 0; }
  .mobile-account-root :is(.sv-list-head,.us-roster-head,.cv-list-head,.dr-roster .bf-grid-head) { display: none; }
  .mobile-account-root :is(.sv-list-row,.us-row,.cv-customer-row,.dr-row) { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 6px 10px; height: auto; min-height: 92px; padding: 12px; width: 100%; align-items: center; border-block-end: 1px solid var(--line); }
  .mobile-account-root :is(.sv-list-cell,.us-row-cell,.cv-customer-row>span,.dr-row>span) { min-width: 0; padding: 0; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
  .mobile-account-root :is(.sv-list-name,.us-row-name,.cv-customer-row>span:first-child,.dr-name) { grid-column: 1 / -1; font-weight: 800; font-size: var(--t-15); }
  .mobile-account-root :is(.sv-search,.us-search,.cv-search,.bf-search) { width: 100%; max-width: 100%; min-height: 48px; }
  .mobile-account-root :is(.sv-search input,.us-search input,.cv-search input,.bf-search input) { font-size: 16px; min-height: 48px; }
  .mobile-account-root :is(.sv-list .segmented,.cv-filters .segmented,.bf-filters) { flex-wrap: wrap; gap: 6px; width: 100%; }
  .mobile-account-root .sv-list .seg { flex: 1 1 30%; min-height: 44px; height: auto; padding: 6px; white-space: normal; }
  .mobile-account-root[data-mobile-account-view="list"] .scr-actions .btn:not([data-cmd="suppliers.new"]):not([data-cmd="staff.new"]):not([data-cmd="customers.new"]):not([data-cmd="customers.opening"]):not([data-cmd="drivers.new"]) { display: none; }
  .mobile-account-root[data-mobile-account-view="list"] :is(.sv-cmd-target,.sv-pay-note,.us-cmd-note) { display: none; }
  .mobile-account-root .scr-actions { height: auto; padding: 0 0 10px; flex-wrap: wrap; }
  #goods-panel-suppliers.mobile-account-root .sv-page > .scr-actions { height: auto; padding: 8px 0; flex-wrap: wrap; }
  #goods-panel-suppliers.mobile-account-root .sv-page > .scr-actions .btn { height: auto; min-height: 44px; }
  .mobile-account-root :is(.sv-cmd-target,.sv-account-head,.sv-account-top,.sv-account-meta,.sv-account-totals,.sv-summary-totals,.sv-summary-row,.dr-account-head,.dr-account-name,.dr-custody,.dr-active-controls,.cv-statement-actions,.cv-before-after,.us-selected-head,.us-selected-meta,.us-section-head,.us-review,.us-confirm,.us-selection-warning) { flex-wrap: wrap; white-space: normal; gap: 8px; }
  .mobile-account-root :is(.sv-account-head h2,.us-selected-head h2,.dr-account-head h2,.cv-account h2) { overflow-wrap: anywhere; }
  .mobile-account-root :is(.dr-form-fields,.cv-form-fields,.us-form) { width: 100%; max-width: none; padding: 12px; }
  .mobile-account-root :is(.us-roles,.us-identity-fields) { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mobile-account-root .us-page .us-roles { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mobile-account-root .us-page .us-role-card { height: auto; min-height: 100px; }
  .mobile-account-root .us-switches { grid-template-columns: 1fr; }
  .mobile-account-root .us-page .us-switch { height: auto; min-height: 52px; padding: 10px; flex-wrap: wrap; }
  .mobile-account-root :is(.us-switch-label,.us-role-label,.us-role-hint) { white-space: normal; overflow-wrap: anywhere; }
  .mobile-account-root .us-form { overflow: visible; }
  .mobile-account-root :is(.dr-money-actions,.dr-form-actions,.spf-actions,.spf-source-row,.spf-pay-row) { flex-wrap: wrap; gap: 8px; }
  .mobile-account-root :is(.dr-money-actions,.spf-actions) .btn { min-height: 48px; height: auto; }
  .mobile-account-root :is(.sv-grid,.sv-open-grid,.sv-stm-grid,.dr-unsettled,.dr-history) { max-width: 100%; overflow-x: auto; }
  /* Supplier board's late-loaded desktop stylesheet has ID specificity. */
  .goods-page:has(#goods-panel-suppliers:not([hidden])) { height: auto; min-height: 100%; overflow: visible; }
  .goods-page:has(#goods-panel-suppliers:not([hidden])) .goods-panel { overflow: visible; }
  .goods-page:has(#goods-panel-suppliers:not([hidden])) #goods-panel-suppliers.mobile-account-root .sv-page { height: auto; }
}
.mobile-account-subject, .mobile-account-more > summary { display: none; }
.mobile-account-more, .mobile-account-more-content { display: contents; }
@media (min-width: 761px) {
  details.mobile-account-more:not([open]) > .mobile-account-more-content { display: contents; }
}
@media (max-width: 760px) {
  .mobile-account-root .mobile-account-subject { display: block; flex-basis: 100%; margin: 0 0 4px; font-size: var(--t-22); overflow-wrap: anywhere; }
  .mobile-account-root[data-mobile-account-view="list"] :is(.mobile-account-subject,.mobile-account-more) { display: none; }
  .mobile-account-root .mobile-account-more { display: block; position: relative; }
  .mobile-account-root .mobile-account-more > summary { display: flex; align-items: center; min-height: 44px; padding-inline: 12px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); cursor: pointer; }
  .mobile-account-root .mobile-account-more-content { display: flex; flex-direction: column; gap: 6px; padding-block: 8px; }
  .mobile-account-root details.mobile-account-more:not([open]) > .mobile-account-more-content { display: none; }
}
