/* The phone keeps the page first; the live workspace controls remain available in More. */
html.mobile-workspace-open {overflow:hidden}
#mobile-workspace-dialog:not([open]) {display:none}
#mobile-workspace-dialog {
  inset:0;width:min(480px,calc(100% - 24px));max-width:none;
  max-height:calc(100dvh - 32px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));
  margin:auto;padding:0;border:1px solid var(--erp-line,var(--line));border-radius:26px;
  background:var(--erp-mesh-quiet,var(--surface));color:var(--erp-ink,var(--ink));
  box-shadow:var(--erp-modal-shadow,0 20px 60px #0003);overflow:hidden;
}
#mobile-workspace-dialog[open] {display:flex;flex-direction:column}
#mobile-workspace-dialog::backdrop {background:var(--erp-backdrop,#10182080);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
#mobile-workspace-dialog .mobile-workspace-heading {display:flex;flex:none;align-items:center;justify-content:space-between;gap:12px;padding:18px 18px 14px;border-bottom:1px solid var(--erp-line,var(--line))}
#mobile-workspace-dialog .mobile-workspace-heading h2 {min-width:0;margin:0;font-size:21px;font-weight:600;line-height:1.25;letter-spacing:-.45px;overflow-wrap:anywhere}
#mobile-workspace-dialog [data-mobile-context-close] {display:grid;place-items:center;flex:none;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:1px solid var(--erp-control-line,var(--line));border-radius:50%;background:var(--erp-soft,var(--surface));color:inherit;cursor:pointer}
#mobile-workspace-dialog [data-mobile-context-close]>svg {width:20px;height:20px}
#mobile-workspace-dialog .mobile-workspace-body {min-height:0;padding:18px 18px max(22px,env(safe-area-inset-bottom,0px));overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
#mobile-workspace-dialog #header.site-header {
  position:static;inset:auto;display:block;width:100%;max-width:none;min-width:0;min-height:0;
  margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;
  -webkit-backdrop-filter:none;backdrop-filter:none;transform:none;
}
#mobile-workspace-dialog #header>:not(.identity),
#mobile-workspace-dialog #header .identity>:not(.warehouse-context) {display:none!important}
#mobile-workspace-dialog #header .identity {display:block;width:100%;min-width:0;margin:0;padding:0}
#mobile-workspace-dialog #header .warehouse-context,
#mobile-workspace-dialog #header .warehouse-context.is-simple {display:grid;grid-template-columns:minmax(0,1fr);gap:20px;width:100%;max-width:none;min-width:0;margin:0;padding:0;order:0}
#mobile-workspace-dialog #header :is(.warehouse-group-control,.warehouse-control,.cabinet-context-slot,.cabinet-control,.unit-picker) {display:block;grid-column:auto;width:100%;max-width:none;min-width:0}
#mobile-workspace-dialog #header .context-field-label {margin:0 12px 7px;color:var(--erp-muted,var(--muted));font-size:13px;line-height:1.3;letter-spacing:0}
#mobile-workspace-dialog #header .unit-trigger {
  display:flex;align-items:center;gap:10px;width:100%;min-width:0;max-width:none;min-height:48px;
  padding:11px 14px;border:1px solid var(--erp-control-line,var(--line));border-radius:18px;
  background:var(--erp-soft,var(--surface));color:var(--erp-ink,var(--ink));font-size:16px;line-height:1.4;
}
#mobile-workspace-dialog #header .cabinet-control .unit-trigger {background:var(--erp-accent,var(--accent));color:var(--erp-accent-ink,var(--ink))}
#mobile-workspace-dialog #header .unit-value {position:static;flex:1;min-width:0;width:auto;height:auto;margin:0;padding:0;clip-path:none;white-space:normal;overflow-wrap:anywhere}
#mobile-workspace-dialog #header :is(.warehouse-trigger-icon,.unit-chevron) {display:block;flex:none;width:18px;height:18px}
/* Inline lists cannot be clipped by the modal body or cover its close button. */
#mobile-workspace-dialog #header .unit-picker .unit-menu {
  position:static;inset:auto;width:100%;max-width:none;max-height:min(260px,40dvh);margin:8px 0 0;padding:6px;
  border:1px solid var(--erp-control-line,var(--line));border-radius:18px;background:var(--erp-surface,var(--surface));
  color:var(--erp-ink,var(--ink));box-shadow:none;transform:none;transition:opacity .15s ease;
}
#mobile-workspace-dialog #header .unit-menu[hidden] {display:none}
#mobile-workspace-dialog #header .unit-option {min-height:44px;padding:11px 12px;border-radius:12px;font-size:16px;line-height:1.4}
#mobile-workspace-dialog #header .unit-option[aria-selected="true"] {background:var(--erp-accent,var(--accent));color:var(--erp-accent-ink,var(--ink))}
#mobile-workspace-dialog #header .cabinet-context-links {display:flex;flex-wrap:wrap;justify-content:flex-start;gap:8px;margin-top:10px;padding:0}
#mobile-workspace-dialog #header .cabinet-context-links a,
#mobile-workspace-dialog #header .cabinet-context-links #cabinet-profile-link {display:flex;align-items:center;justify-content:center;min-height:44px;padding:9px 14px;border:1px solid var(--erp-control-line,var(--line));border-radius:999px;background:var(--erp-soft,var(--surface));color:var(--erp-ink,var(--ink));font-size:14px;line-height:1.4;text-decoration:none}
#mobile-workspace-dialog #header .cabinet-context-status {padding:8px 2px 0;color:var(--erp-muted,var(--muted));font-size:14px;line-height:1.5}
#mobile-workspace-dialog #header .cabinet-context-status button {min-height:44px;font-size:14px;color:var(--erp-accent-ink,var(--ink))}
#mobile-workspace-dialog :is(button,a,input,select):focus-visible {outline:2px solid var(--erp-focus,var(--focus));outline-offset:3px}

.mobile-page-actions {display:none}
@media screen and (max-width:720px) {
  body.mobile-shell-ready>#header.site-header {display:none!important}
  html[data-theme] .mobile-page-actions {display:flex;align-items:center;justify-content:space-between;gap:16px;min-width:0;min-height:48px;margin:0 0 16px;padding:2px 0;color:var(--erp-ink);animation:none}
  html[data-theme] .mobile-page-actions :is(.mobile-page-identity,.mobile-page-utilities) {display:flex;align-items:center;gap:8px;min-width:0}
  html[data-theme] .mobile-page-actions .mobile-page-utilities {margin-left:auto}
  html[data-theme] .mobile-page-actions :is(.mobile-page-action,.mobile-page-account,.mobile-page-back) {position:relative;display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-width:44px;min-height:44px;margin:0;padding:0;border:1px solid var(--erp-control-line);border-radius:50%;background:var(--erp-mesh-quiet);color:var(--erp-ink);box-shadow:inset 0 1px 0 #ffffff12;line-height:1;text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background-color .15s ease,border-color .15s ease}
  html[data-theme] .mobile-page-actions .mobile-page-back {font-size:0;gap:0}
  html[data-theme] .mobile-page-actions :is(.mobile-page-action,.mobile-page-back)>svg {width:20px;height:20px;flex:none}
  html[data-theme] .mobile-page-actions .mobile-page-account {padding:3px;border-color:var(--erp-summary-line);background:var(--erp-summary-mesh)}
  html[data-theme] .mobile-page-actions .mobile-page-avatar {position:relative;display:grid;place-items:center;width:100%;height:100%;overflow:hidden;border-radius:50%;background:var(--erp-accent);color:var(--erp-accent-ink)}
  html[data-theme] .mobile-page-actions .person-avatar-initials {font-size:13px;font-weight:500;line-height:1}
  html[data-theme] .mobile-page-actions .person-avatar-photo {position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
  html[data-theme] .mobile-page-actions .person-avatar-photo[hidden] {display:none}
  html[data-theme] .mobile-page-actions .notification-badge {position:absolute;top:-2px;right:-2px;display:grid;place-items:center;min-width:17px;height:17px;margin:0;padding:0 4px;border:1px solid var(--erp-surface);border-radius:999px;background:var(--erp-danger);color:var(--erp-surface);font-size:10px;font-weight:600;line-height:1}
  html[data-theme] .mobile-page-actions .notification-badge[hidden] {display:none!important}
  html[data-theme] .mobile-page-actions :is(button,a):focus-visible {outline:2px solid var(--erp-focus);outline-offset:3px}
  html[data-theme] .mobile-page-actions :is(button,a):active {background:var(--erp-accent);border-color:var(--erp-focus)}
  html[data-theme] .mobile-page-actions[data-mode="inventory"] {gap:8px;margin-bottom:12px;padding:0;min-height:44px}
  html[data-theme] .mobile-page-actions[data-mode="inventory"] :is(.mobile-page-identity,.mobile-page-utilities) {gap:4px}
  html[data-theme] .mobile-page-actions[data-mode="inventory"] .mobile-inventory-title {min-width:0;font-size:16px;font-weight:500;line-height:1.3;letter-spacing:-.4px;color:var(--erp-ink)}
  html[data-theme] .mobile-page-actions[data-mode="inventory"] :is(.mobile-page-action,.mobile-page-back) {background:transparent;border-color:transparent;box-shadow:none}
  html[data-theme] .mobile-page-actions[data-mode="inventory"] .mobile-page-account {background:transparent;border-color:var(--erp-line);box-shadow:none}
  html[data-theme] .mobile-page-actions[data-mode="inventory"] :is(button,a):active {background:var(--erp-soft);border-color:var(--erp-line)}
}
@media screen and (min-width:721px) {
  #navigation [data-mobile-context-open] {display:none}
}
/* A hidden phone header must not hide the manager's unread notifications. */
#navigation .notification-badge[hidden] {display:none!important}
#navigation .nav-more>summary .nav-notification-dot {
  top:8px;right:12px;width:8px;min-width:8px;height:8px;padding:0;border:0;
  background:#d95a52;box-shadow:0 0 0 2px var(--dock-surface,var(--erp-surface));font-size:0;
}
#navigation .nav-more-link .nav-notification-count {
  position:static;flex:none;min-width:22px;height:22px;margin-left:auto;padding:0 6px;border:0;
  background:var(--erp-danger-surface);color:var(--erp-danger);font-size:12px;font-weight:600;
}
@media screen and (max-width:360px) {
  #mobile-workspace-dialog .mobile-workspace-heading {padding:14px 14px 12px}
  #mobile-workspace-dialog .mobile-workspace-heading h2 {font-size:19px}
  #mobile-workspace-dialog .mobile-workspace-body {padding-inline:14px}
}
@media (prefers-reduced-motion:reduce) {
  #mobile-workspace-dialog #header .unit-picker .unit-menu {transition:none}
  html[data-theme] .mobile-page-actions :is(button,a) {transition:none}
}
