/* MicroLink Non-Chat UI/UX Polish V2
 * Final opt-in presentation layer for application surfaces outside Chat.
 * SAFETY: every rule is scoped to :where(body.ml-uiux-polish-v2). Chat/widget chat
 * surfaces do not receive this class and therefore remain untouched.
 */
/* ========================================================================
 * V9 SAFE CASCADE + ALIGNMENT CONTRACT
 * The non-chat polish layer is intentionally ZERO-SPECIFICITY at its body
 * scope. Module/component selectors must always own display, visibility,
 * positioning and layout geometry. This prevents generic button alignment
 * from reviving desktop-hidden controls/backdrops (e.g. Connected Workspace).
 * ====================================================================== */


:where(body.ml-uiux-polish-v2){
  --ml-polish-control:40px;
  --ml-polish-touch:44px;
  --ml-polish-border:var(--ml-color-border,#dbe4f0);
  --ml-polish-text:var(--ml-color-text,#162238);
  --ml-polish-muted:var(--ml-color-muted,#64748b);
  --ml-polish-primary:var(--ml-color-primary,#1769ff);
  --ml-polish-surface:var(--ml-color-surface,#fff);
  --ml-polish-canvas:var(--ml-color-canvas,#f5f7fb);
  --ml-polish-radius:10px;
  --ml-polish-card-radius:14px;
  --ml-polish-focus:0 0 0 3px rgba(23,105,255,.16);
  min-height:100dvh;
  color:var(--ml-polish-text);
  font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
}

:where(body.ml-uiux-polish-v2) *,
:where(body.ml-uiux-polish-v2) *::before,
:where(body.ml-uiux-polish-v2) *::after{box-sizing:border-box}

:where(body.ml-uiux-polish-v2) :where(img,video,canvas,svg){max-width:100%}
:where(body.ml-uiux-polish-v2) :where(h1,h2,h3,h4,h5,h6,p){overflow-wrap:anywhere}
:where(body.ml-uiux-polish-v2) :where(button,input,select,textarea){font:inherit}
:where(body.ml-uiux-polish-v2) :where(button,a,input,select,textarea,[role="button"],[role="tab"]){-webkit-tap-highlight-color:transparent}

/* Controls: consistent X/Y alignment without forcing module-specific widths. */
:where(body.ml-uiux-polish-v2) :where(button,input[type="button"],input[type="submit"],input[type="reset"]){
  min-height:var(--ml-polish-control);
  line-height:1.2;
}
:where(body.ml-uiux-polish-v2) :where(button){
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  vertical-align:middle;
}
:where(body.ml-uiux-polish-v2) :where(button) > :where(svg,.ml-icon,img){flex:0 0 auto}

/* V3: every action link that visually behaves as a button uses the same true X/Y centering contract. */
:where(body.ml-uiux-polish-v2) :where(
  a[class*="-btn"],a[class*="-button"],a.btn,
  a.ws-primary,a.ws-secondary,a.ws-danger,
  a.ce-primary,a.ce-secondary,a.ce-danger,
  a.sd-primary,a.sd-secondary,a.sd-top-secondary,
  a.lp-primary,a.lp-secondary,a.lpb-primary,a.lpb-secondary,
  a.hcp-btn,a.fw-primary,a.fw-secondary,a.micro-dialog-btn
){
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  vertical-align:middle;
  line-height:1.2;
}
:where(body.ml-uiux-polish-v2) :where(button,a[class*="-btn"],a[class*="-button"],a.btn) > :where(span,strong,small){
  min-width:0;
}
:where(body.ml-uiux-polish-v2) :where(button,[role="button"],a[class*="-btn"],a.btn,a.btn-primary,a.btn-secondary){cursor:pointer}
:where(body.ml-uiux-polish-v2) :where(button,[role="button"]):disabled,
:where(body.ml-uiux-polish-v2) :where(button,[role="button"])[aria-disabled="true"]{cursor:not-allowed;opacity:.56}

:where(body.ml-uiux-polish-v2) :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="color"]),
  select
){min-height:var(--ml-polish-control)}
:where(body.ml-uiux-polish-v2) :where(input,select,textarea){max-width:100%}
:where(body.ml-uiux-polish-v2) :where(select,input[type="checkbox"],input[type="radio"]){cursor:pointer}
:where(body.ml-uiux-polish-v2) :where(input[type="checkbox"],input[type="radio"]){accent-color:var(--ml-polish-primary)}
:where(body.ml-uiux-polish-v2) :where(textarea){line-height:1.5;resize:vertical}
:where(body.ml-uiux-polish-v2) :where(input,textarea)::placeholder{color:#8796aa;opacity:1}
:where(body.ml-uiux-polish-v2) :where(input,select,textarea):disabled{cursor:not-allowed;opacity:.72}

/* Accessible, predictable keyboard focus. */
:where(body.ml-uiux-polish-v2) :where(button,a,input,select,textarea,[role="button"],[role="tab"],[tabindex]):focus-visible{
  outline:2px solid var(--ml-polish-primary);
  outline-offset:2px;
  box-shadow:var(--ml-polish-focus);
}

/* App-shell geometry and rhythm. No overflow is disabled: page X/Y scroll remains available. */
:where(body.ml-uiux-polish-v2.ml-app-shell-v1) :where(.ws-main,.ce-main,.po-main,.ba-main,.lpb-main,.hcp-main,.pa-content,.partner-main,.widget-main,.account-admin-main,.bl-main,.dfr-main,.sd-main){
  min-width:0;
  scroll-padding-top:calc(var(--ml-shell-topbar,64px) + 16px);
}
:where(body.ml-uiux-polish-v2.ml-app-shell-v1) :where(.ws-topbar,.ce-topbar,.po-module-header,.ba-topbar,.lpb-topbar,.hcp-topbar,.pa-top,.partner-topbar,.widget-topbar,.account-admin-topbar,.bl-top,.dfr-topbar,.sd-top){
  align-items:center;
}
:where(body.ml-uiux-polish-v2.ml-app-shell-v1) :where(.ws-top-actions,.ce-top-actions,.po-actions,.ba-top-actions,.lpb-top-actions,.hcp-actions,.pa-top-actions,.partner-top-actions,.widget-top-actions,.account-admin-actions,.bl-top-actions,.dfr-top-actions,.sd-top-actions){
  align-items:center;
}

/* Cards/panels: restrained visual hierarchy and consistent clipping. */
:where(body.ml-uiux-polish-v2) :where(.ml-card,.ml-panel),
:where(body.ml-uiux-polish-v2.ml-app-shell-v1) :where(.ws-card,.ce-card,.po-card,.ba-card,.hcp-card,.pa-card,.partner-card,.widget-card,.account-card,.bl-card,.dfr-card,.sd-card){
  border-radius:var(--ml-polish-card-radius);
}
:where(body.ml-uiux-polish-v2.ml-app-shell-v1) :where(.ws-card,.ce-card,.po-card,.ba-card,.hcp-card,.pa-card,.partner-card,.widget-card,.account-card,.bl-card,.dfr-card,.sd-card) > :first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}
:where(body.ml-uiux-polish-v2.ml-app-shell-v1) :where(.ws-card,.ce-card,.po-card,.ba-card,.hcp-card,.pa-card,.partner-card,.widget-card,.account-card,.bl-card,.dfr-card,.sd-card) > :last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}

/* Tables and dense data views. */
:where(body.ml-uiux-polish-v2) :where(.ml-table-wrap,.ce-table-wrap,.po-table-wrap,.ba-table-wrap,.pa-table-wrap,.partner-table-wrap,.account-table-wrap,.bl-table-wrap){
  max-width:100%;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}
:where(body.ml-uiux-polish-v2) :where(th,td){vertical-align:middle}
:where(body.ml-uiux-polish-v2) :where(th){line-height:1.25}
:where(body.ml-uiux-polish-v2) :where(td){line-height:1.4}
:where(body.ml-uiux-polish-v2) :where(td,th) :where(button,a[class*="-btn"],.btn){vertical-align:middle}

/* Toolbars, filters and action rows stay centered and wrap rather than collide. */
:where(body.ml-uiux-polish-v2) :where(
  .ws-actions,.ws-toolbar,.ce-toolbar,.ce-actions,.po-actions,.po-filters,.ba-toolbar,.ba-filters,
  .lpb-builder-toolbar,.lpb-builder-actions,.pa-toolbar,.pa-filters,.partner-actions,.widget-toolbar,
  .account-toolbar,.bl-filters,.dfr-top-actions,.sd-actions,.mas-toolbar,.fw-toolbar
){
  align-items:center;
  gap:8px;
  min-width:0;
  flex-wrap:wrap;
}
:where(body.ml-uiux-polish-v2) :where(
  .ws-actions,.ws-toolbar,.ce-toolbar,.ce-actions,.po-actions,.po-filters,.ba-toolbar,.ba-filters,
  .lpb-builder-toolbar,.lpb-builder-actions,.pa-toolbar,.pa-filters,.partner-actions,.widget-toolbar,
  .account-toolbar,.bl-filters,.dfr-top-actions,.sd-actions,.mas-toolbar,.fw-toolbar
) > *{max-width:100%}

/* Navigation targets remain comfortably clickable and vertically centered. */
:where(body.ml-uiux-polish-v2.ml-app-shell-v1) :where(
  .ws-nav button,.ws-nav a,.ce-nav button,.ce-nav a,.po-nav button,.po-nav a,.ba-nav button,.ba-nav a,
  .lpb-nav button,.lpb-nav a,.hcp-topics button,.hcp-topics a,.pa-sidebar-nav button,.pa-sidebar-nav a,
  .partner-tabs button,.widget-editor-tabs button,.ml-sidebar-section-toggle,.ml-sidebar-section-item
){
  min-height:40px;
  align-items:center;
}

/* Empty / loading / permission states: readable without turning them into oversized cards. */
:where(body.ml-uiux-polish-v2) :where(
  .ml-empty-state,.ml-loading-state,.ml-error-state,.ml-permission-state,
  .ws-empty,.ce-empty,.po-empty,.ba-empty,.hcp-empty,.pa-empty,.partner-empty,.widget-empty,
  .account-empty,.bl-empty,.dfr-empty,.lpb-empty-state,.mas-empty,.fw-empty
){
  text-align:center;
  align-content:center;
}
:where(body.ml-uiux-polish-v2) :where(
  .ml-empty-state,.ml-loading-state,.ml-error-state,.ml-permission-state,
  .ws-empty,.ce-empty,.po-empty,.ba-empty,.hcp-empty,.pa-empty,.partner-empty,.widget-empty,
  .account-empty,.bl-empty,.dfr-empty,.lpb-empty-state,.mas-empty,.fw-empty
) :where(h2,h3,strong,p){max-width:680px;margin-inline:auto}

/* Dialogs: always centered in both axes, independently scrollable, page scroll preserved. */
:where(body.ml-uiux-polish-v2) :where(.micro-dialog-layer){
  position:fixed;
  inset:0;
  display:grid;
  place-items:center;
  padding:20px;
  overflow:auto;
  overscroll-behavior:contain;
}
:where(body.ml-uiux-polish-v2) :where(.micro-dialog-card){
  max-width:calc(100vw - 40px);
  max-height:calc(100dvh - 40px);
  margin:auto;
  overflow:auto;
  border-radius:18px;
}
:where(body.ml-uiux-polish-v2) :where(.micro-dialog-actions){
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
:where(body.ml-uiux-polish-v2) :where(.micro-dialog-btn){min-height:40px;display:inline-flex;align-items:center;justify-content:center}

/* Native dialogs, when present, follow the same centered contract. */
:where(body.ml-uiux-polish-v2) :where(dialog){
  max-width:calc(100vw - 32px);
  max-height:calc(100dvh - 40px);
  border-radius:18px;
  border:1px solid var(--ml-polish-border);
}
:where(body.ml-uiux-polish-v2) :where(dialog)::backdrop{background:rgba(15,23,42,.48);backdrop-filter:blur(2px)}

/* Public MicroLink-owned surfaces: keep existing art direction, improve interaction only. */
:where(body.ml-uiux-polish-v2.ml-ui-public) :where(button,a[class*="btn"],a[class*="primary"],a[class*="secondary"]){
  min-height:40px;
  align-items:center;
  justify-content:center;
}

/* Share Screen is not Chat, but its controls must remain compact and centered. */
:where(body.ml-uiux-polish-v2) :where(.ssl-actions),
:where(body.ml-uiux-polish-v2) :where(.ssl-size-controls),
:where(body.ml-uiux-polish-v2) :where(.ssl-viewer-toolbar){align-items:center}
:where(body.ml-uiux-polish-v2) :where(.ssl-primary,.ssl-secondary,.ssl-danger,.ssl-tool-btn){min-height:40px}
:where(body.ml-uiux-polish-v2) :where(.ssl-icon-btn){min-width:40px;min-height:40px}

/* Mobile/touch ergonomics. */
@media (pointer:coarse){
  :where(body.ml-uiux-polish-v2) :where(button,a[class*="-btn"],a.btn,[role="button"]){min-height:var(--ml-polish-touch)}
}
@media (max-width:767px){
  :where(body.ml-uiux-polish-v2) :where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),select,textarea
  ){font-size:16px}
  :where(body.ml-uiux-polish-v2) :where(.micro-dialog-layer){padding:14px}
  :where(body.ml-uiux-polish-v2) :where(.micro-dialog-card){max-height:calc(100dvh - 28px);border-radius:16px}
  :where(body.ml-uiux-polish-v2) :where(.ws-top-actions,.ce-top-actions,.ba-top-actions,.lpb-top-actions,.hcp-actions,.pa-top-actions,.partner-top-actions,.widget-top-actions,.account-admin-actions,.bl-top-actions,.dfr-top-actions,.sd-top-actions){gap:8px}
}
@media (max-width:479px){
  :where(body.ml-uiux-polish-v2) :where(.micro-dialog-actions){display:grid;grid-template-columns:1fr;width:100%}
  :where(body.ml-uiux-polish-v2) :where(.micro-dialog-actions) > *{width:100%;min-width:0}
}

@media (prefers-reduced-motion:reduce){
  :where(body.ml-uiux-polish-v2) *,:where(body.ml-uiux-polish-v2) *::before,:where(body.ml-uiux-polish-v2) *::after{
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
  }
}

/* ========================================================================
 * V9 safe semantic alignment audit — NON-CHAT ONLY
 * Scope remains opt-in through :where(body.ml-uiux-polish-v2).
 * Horizontal alignment follows semantics: actions centered, navigation/menu
 * text left aligned, numeric/data alignment remains module-owned.
 * ====================================================================== */
:where(body.ml-uiux-polish-v2){
  --ml-polish-control-sm:36px;
  --ml-polish-icon-control:40px;
  --ml-polish-action-gap:8px;
}

/* Action controls: true X/Y alignment for text, icon, or icon+text. */
:where(body.ml-uiux-polish-v2) :where(
  button,
  input[type="button"],input[type="submit"],input[type="reset"],
  a.btn,a[class*="-btn"],a[class*="-button"],
  a.ws-primary,a.ws-secondary,a.ws-danger,
  a.ce-primary,a.ce-secondary,a.ce-danger,
  a.sd-primary,a.sd-secondary,a.sd-top-secondary,
  a.lp-primary,a.lp-secondary,a.lpb-primary,a.lpb-secondary,
  a.hcp-btn,a.fw-primary,a.fw-secondary,a.micro-dialog-btn
){
  align-items:center;
  justify-content:center;
  text-align:center;
  vertical-align:middle;
}
:where(body.ml-uiux-polish-v2) :where(
  button,
  a.btn,a[class*="-btn"],a[class*="-button"],
  a.ws-primary,a.ws-secondary,a.ws-danger,
  a.ce-primary,a.ce-secondary,a.ce-danger,
  a.sd-primary,a.sd-secondary,a.sd-top-secondary,
  a.lp-primary,a.lp-secondary,a.lpb-primary,a.lpb-secondary,
  a.hcp-btn,a.fw-primary,a.fw-secondary,a.micro-dialog-btn
){gap:var(--ml-polish-action-gap)}
:where(body.ml-uiux-polish-v2) :where(
  button,a.btn,a[class*="-btn"],a[class*="-button"],
  a.ws-primary,a.ws-secondary,a.ws-danger,a.ce-primary,a.ce-secondary,
  a.sd-primary,a.sd-secondary,a.lp-primary,a.lp-secondary,
  a.lpb-primary,a.lpb-secondary,a.hcp-btn,a.fw-primary,a.fw-secondary
) > :where(svg,img,.ml-icon,.ml-icon-outline){flex:0 0 auto;align-self:center}
:where(body.ml-uiux-polish-v2) :where(
  button,a.btn,a[class*="-btn"],a[class*="-button"],
  a.ws-primary,a.ws-secondary,a.ws-danger,a.ce-primary,a.ce-secondary,
  a.sd-primary,a.sd-secondary,a.lp-primary,a.lp-secondary,
  a.lpb-primary,a.lpb-secondary,a.hcp-btn,a.fw-primary,a.fw-secondary
) > :where(span,strong){align-self:center}

/* Icon-only actions: square hit target and exact center. */
:where(body.ml-uiux-polish-v2) :where(
  .ml-icon-button,.icon-close,.ce-icon-btn,.cw-icon-btn,.ws-icon-btn,
  .sd-x,.pa-dialog-x,.lp-feature-dialog-close,.mas-sidebar-toggle,
  .ce-mobile-menu,.ws-mobile-menu,.ba-mobile-menu,.fw-mobile-menu,
  .lpb-mobile-menu,.hcp-mobile,.po-mobile-menu,.po-sidebar-toggle,
  .lpb-layers-toggle,.ml-sidebar-collapse-toggle
){
  display:inline-grid;
  place-items:center;
  text-align:center;
  line-height:1;
  padding:0;
}
:where(body.ml-uiux-polish-v2) :where(
  .ml-icon-button,.icon-close,.ce-icon-btn,.cw-icon-btn,.ws-icon-btn,
  .sd-x,.pa-dialog-x,.lp-feature-dialog-close
){min-width:var(--ml-polish-icon-control);min-height:var(--ml-polish-icon-control)}

/* Pills / badges / state chips: text is centered inside the visual capsule. */
:where(body.ml-uiux-polish-v2) :where(
  .ml-badge,.ml-chip,.chip,.badge,
  .ce-status,.ba-nav-badge,.ba-scope-chip,.po-scope-chip,.fw-chip,
  .partner-status,.partner-code-chip,.lp-status,.lp-plan-badge,.lp-hero-badge,
  .lpb-status,.lpb-canvas-status,.mas-chip,.mas-env-badge,.bc-status,
  .am-chip,.am-hero-status,.connection-health
){
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  vertical-align:middle;
  line-height:1.2;
}

/* Navigation / menu / dropdown: center Y, preserve conventional left X. */
:where(body.ml-uiux-polish-v2) :where(
  .ws-nav button,.ws-nav a,.ce-nav button,.ce-nav a,
  .po-nav button,.po-nav a,.ba-nav button,.ba-nav a,
  .lpb-nav button,.lpb-nav a,.pa-sidebar-nav button,.pa-sidebar-nav a,
  .mas-main-nav button,.ml-sidebar-section-toggle,.ml-sidebar-section-item,
  .mlp-nav-dropdown-menu a,.mlp-nav-dropdown-menu button,
  .ml-dropdown-menu button,.po-action-menu-panel button
){
  align-items:center;
  justify-content:flex-start;
  text-align:left;
}
:where(body.ml-uiux-polish-v2) :where(
  .ml-dropdown-menu button,.po-action-menu-panel button,
  [role="menu"] [role="menuitem"],[role="menu"] button,[role="menu"] a
){min-height:40px}

/* Checkbox/radio/toggle rows: controls and labels share one visual center line. */
:where(body.ml-uiux-polish-v2) :where(
  .ce-check,.check-row,.ws-toggle-row,.widget-switch-row,.lpb-switch,
  .lpb-widget-toggle-row,.platform-role-option,.dfr-understand,.cw-status-filter
){align-items:center}
:where(body.ml-uiux-polish-v2) :where(
  .ce-check,.check-row,.ws-toggle-row,.widget-switch-row,.lpb-switch,
  .lpb-widget-toggle-row,.platform-role-option,.dfr-understand,.cw-status-filter
) :where(input[type="checkbox"],input[type="radio"]){flex:0 0 auto;margin-block:0}

/* Tabs, pagination, segmented controls, and view toggles. */
:where(body.ml-uiux-polish-v2) :where(
  .cc-tabs,.corr-tabs,.contact-filter-tabs,.cw-detail-tabs,.cw-view-toggle,
  .lpb-page-tabs,.mas-tabs,.partner-tabs,.pa-pagination,.lpb-device-switch
){align-items:center}
:where(body.ml-uiux-polish-v2) :where(
  .cc-tabs button,.corr-tabs button,.contact-filter-tabs button,
  .cw-detail-tabs button,.cw-view-toggle button,.lpb-page-tabs button,
  .mas-tabs button,.partner-tabs button,.pa-pagination button,.pa-pagination a,
  .lpb-device-switch button
){display:inline-flex;align-items:center;justify-content:center;text-align:center}

/* Toolbar/action groups: consistent vertical centering while retaining module X alignment. */
:where(body.ml-uiux-polish-v2) :where(
  .account-toolbar,.ba-head-actions,.ba-module-actions,.ba-top-actions,.ba-toolbar,
  .ce-toolbar,.ce-actions,.ce-top-actions,.ce-v6-asset-toolbar,.ce-v7-toolbar,
  .corr-toolbar-actions,.cw-bulk-toolbar,.cw-conflict-actions,.cw-detail-actions,
  .cw-editor-toolbar,.cw-knowledge-toolbar,.cw-knowledge-toolbar-row,.cw-toolbar,.cw-toolbar-actions,.cw-top-actions,
  .dfr-modal-actions,.dfr-top-actions,.fw-actions,.fw-toolbar,.hcp-actions,
  .lp-actions,.lp-feature-toolbar,.lp-hero-actions,.lpb-builder-actions,.lpb-builder-toolbar,.lpb-image-actions,.lpb-page-browser-actions,.lpb-top-actions,
  .mas-body-toolbar,.mas-inline-actions,.mas-top-actions,.mlp-actions,.pa-financial-actions,.pa-heading-actions,.pa-settings-actions,.pa-toolbar,.pa-top-actions,
  .partner-confirm-actions,.partner-share-actions,.po-actions,.po-modal-actions,.po-module-actions,.po-section-toolbar,
  .privacy-head-actions,.privacy-policy-modal-actions,.ws-actions,.ws-modal-actions,.ws-top-actions,.ws-toolbar
){align-items:center}

/* Form controls: stable vertical rhythm and readable multiline fields. */
:where(body.ml-uiux-polish-v2) :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="color"]),
  select
){line-height:1.2}
:where(body.ml-uiux-polish-v2) :where(textarea){min-height:88px}
:where(body.ml-uiux-polish-v2) :where(label,.field,.form-field,.cw-editor-field,.dfr-field) > :where(input,select,textarea){min-width:0}

/* Tables: headers and values align vertically; action controls do not sit on baseline. */
:where(body.ml-uiux-polish-v2) :where(table th,table td){vertical-align:middle}
:where(body.ml-uiux-polish-v2) :where(table th,table td) :where(button,a.btn,a[class*="-btn"],a[class*="-button"]){vertical-align:middle}
:where(body.ml-uiux-polish-v2) :where(.action-col,.ml-right){white-space:nowrap}

/* Empty/loading/error states: center only presentation states, never normal content. */
:where(body.ml-uiux-polish-v2) :where(
  .loading-cell,.empty-cell,.ml-empty,.lpb-empty-state,.onboarding-empty-actions
){text-align:center}

/* V9 safe modal fallback: preserve each module's modal geometry.
 * Only common dialog semantics are added; no !important layout override. */
:where(body.ml-uiux-polish-v2) :where(dialog[open]){margin:auto}
:where(body.ml-uiux-polish-v2) :where(.micro-dialog-actions,.dfr-modal-actions,.po-modal-actions,.ws-modal-actions,.pa-dialog-actions,.partner-confirm-actions,.privacy-policy-modal-actions){align-items:center;gap:8px;flex-wrap:wrap}

/* Prevent controls from looking vertically off-center because of inherited line-height. */
:where(body.ml-uiux-polish-v2) :where(
  button,a.btn,a[class*="-btn"],a[class*="-button"],
  .ml-icon-button,.ce-icon-btn,.cw-icon-btn,.ws-icon-btn,.sd-x,.pa-dialog-x
){line-height:1.2}
:where(body.ml-uiux-polish-v2) :where(.ml-icon-button,.ce-icon-btn,.cw-icon-btn,.ws-icon-btn,.sd-x,.pa-dialog-x){line-height:1}

/* Sidebar / navigation semantic contract.
 * Navigation is LEFT aligned on X and CENTERED on Y. The rule is zero-
 * specificity so each module still owns display/visibility/layout geometry. */
:where(body.ml-uiux-polish-v2) :where(
  .ws-nav,.ce-nav,.po-nav,.ba-nav,.fw-nav,.lpb-nav,.pa-sidebar-nav,.mas-main-nav,
  .am-nav,.hcp-topics,.cw-main-nav,[data-cw-files-nav],[data-cw-knowledge-nav],
  .ml-sidebar-section-content,.mlp-nav-dropdown-menu,.ml-dropdown-menu,[role="menu"]
) :where(a,button,[role="menuitem"]){
  align-items:center;
  justify-content:flex-start;
  text-align:left;
  vertical-align:middle;
}
:where(body.ml-uiux-polish-v2) :where(
  .ws-nav,.ce-nav,.po-nav,.ba-nav,.fw-nav,.lpb-nav,.pa-sidebar-nav,.mas-main-nav,
  .am-nav,.hcp-topics,.cw-main-nav,[data-cw-files-nav],[data-cw-knowledge-nav],
  .ml-sidebar-section-content
) :where(a,button) > :where(svg,.ml-icon,.ml-icon-outline,.cw-side-icon,.infra-nav-icon){
  flex:0 0 auto;
  align-self:center;
}
:where(body.ml-uiux-polish-v2) :where(.ml-sidebar-section-label,.cw-side-label,.cw-sidebar-label,.infra-nav-label){
  text-align:left;
  line-height:1.25;
}
:where(body.ml-uiux-polish-v2) :where(.ml-sidebar-section-icon,.ml-sidebar-section-chevron,.cw-side-icon){
  align-self:center;
}

/* HTML hidden is authoritative. This prevents helper controls/backdrops from
 * becoming layout children because of generic action alignment rules. */
:where(body.ml-uiux-polish-v2) :where([hidden]){display:none!important}

@media(max-width:767px){
  :where(body.ml-uiux-polish-v2) :where(.micro-dialog-actions,.dfr-modal-actions,.po-modal-actions,.ws-modal-actions,.pa-dialog-actions,.partner-confirm-actions,.privacy-policy-modal-actions) > :where(button,a[class*="-btn"],a.btn){min-height:44px}
}

/* MICROLINK_F30_MOBILE_MODAL_UI_V1
 * Shared non-chat mobile modal contract. Scoped to polished MicroLink pages so
 * module desktop geometry and business behavior remain owned by each module. */
@media(max-width:767px){
  :where(body.ml-uiux-polish-v2) :where(
    .ws-modal-backdrop,.fw-modal-backdrop,.aw-modal-backdrop,.admin-modal-backdrop,
    .po-modal-backdrop,.pa-dialog-backdrop,.lpb-modal-backdrop,.dfr-modal-backdrop,
    .mloc-modal-backdrop,.ce-modal-backdrop,.ce-growth-modal-backdrop,.ce-ops-modal-backdrop,
    .modal-backdrop,.ml-modal__backdrop
  ){
    align-items:flex-end!important;justify-content:center!important;place-items:end center!important;
    padding:max(12px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))!important;
    overflow:hidden!important;
    background:rgba(15,23,42,.46)!important;
    backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
  }

  :where(body.ml-uiux-polish-v2) :where(
    .ws-modal,.fw-modal,.aw-modal,.admin-modal,.pa-dialog,.lpb-modal,.mloc-dialog,
    .dfr-modal-card,.po-modal-card,.ce-modal,.ce-growth-modal,.ce-ops-modal,
    .modal-card,.ml-modal__panel,.mlstm23-modal
  ){
    width:100%!important;max-width:680px!important;
    max-height:calc(100dvh - max(24px,env(safe-area-inset-top)) - max(20px,env(safe-area-inset-bottom)))!important;
    margin:0 auto!important;
    border-radius:22px!important;
    border:1px solid rgba(221,229,239,.9)!important;
    box-shadow:0 24px 72px rgba(15,23,42,.28),0 2px 8px rgba(15,23,42,.08)!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch;
  }

  :where(body.ml-uiux-polish-v2) :where(.corr-modal){
    align-items:flex-end!important;place-items:end center!important;
    padding:max(12px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))!important;
    backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
  }
  :where(body.ml-uiux-polish-v2) .corr-modal>div{
    width:100%!important;max-width:680px!important;
    max-height:calc(100dvh - max(24px,env(safe-area-inset-top)) - max(20px,env(safe-area-inset-bottom)))!important;
    margin:0 auto!important;border-radius:22px!important;
    box-shadow:0 24px 72px rgba(15,23,42,.28)!important;
  }

  :where(body.ml-uiux-polish-v2) :where(dialog[open]){
    width:min(680px,calc(100vw - 20px));
    max-width:calc(100vw - 20px);
    max-height:calc(100dvh - max(24px,env(safe-area-inset-top)) - max(20px,env(safe-area-inset-bottom)));
    margin:auto auto max(10px,env(safe-area-inset-bottom));
    border-radius:22px;
    box-shadow:0 24px 72px rgba(15,23,42,.28);
  }

  /* Modal chrome stays reachable while only modal content scrolls. */
  :where(body.ml-uiux-polish-v2) :where(
    .ws-modal>header,.fw-modal>header,.aw-modal>header,.admin-modal>header,
    .pa-dialog-head,.lpb-modal>header,.mloc-dialog-head,.po-modal-head,
    .ce-modal>header,.ce-growth-modal>header,.ce-ops-modal>header,
    .modal-head,.mlstm23-modal-head,.corr-modal header
  ){
    position:sticky!important;top:0;z-index:4;
    min-height:56px;
    background:rgba(255,255,255,.97)!important;
    backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  }

  :where(body.ml-uiux-polish-v2) :where(
    .ws-modal-actions,.fw-form-actions,.aw-modal-actions,.admin-modal-actions,
    .pa-dialog-actions,.lpb-modal-actions,.mloc-dialog-actions,.po-modal-actions,
    .ce-modal-actions,.ce-v7-modal-actions,.dfr-modal-actions,.modal-actions,
    .privacy-policy-modal-actions,.partner-confirm-actions,.corr-modal footer
  ){
    position:sticky;bottom:0;z-index:4;
    gap:8px!important;
    padding-bottom:max(12px,env(safe-area-inset-bottom))!important;
    background:rgba(255,255,255,.97)!important;
    backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  }

  :where(body.ml-uiux-polish-v2) :where(
    .ws-modal,.fw-modal,.aw-modal,.admin-modal,.pa-dialog,.lpb-modal,.mloc-dialog,
    .dfr-modal-card,.po-modal-card,.ce-modal,.ce-growth-modal,.ce-ops-modal,
    .modal-card,.ml-modal__panel,.mlstm23-modal,.corr-modal>div,dialog[open]
  ) :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){font-size:16px!important}

  :where(body.ml-uiux-polish-v2) :where(
    .ws-modal,.fw-modal,.aw-modal,.admin-modal,.pa-dialog,.lpb-modal,.mloc-dialog,
    .dfr-modal-card,.po-modal-card,.ce-modal,.ce-growth-modal,.ce-ops-modal,
    .modal-card,.ml-modal__panel,.mlstm23-modal,.corr-modal>div,dialog[open]
  ) :where(button,a[role="button"],a.btn,a[class*="-btn"]){min-height:44px}

  :where(body.ml-uiux-polish-v2) :where(
    .ws-modal>header button,.fw-modal>header button,.aw-modal>header button,
    .pa-dialog-x,.lpb-modal>header button,.po-modal-head button,
    .modal-head .ml-icon-button,.modal-head .icon-close,.corr-modal header button
  ){
    min-width:44px!important;min-height:44px!important;
    display:inline-grid;place-items:center;
  }
}

@media(max-width:430px){
  :where(body.ml-uiux-polish-v2) :where(
    .ws-modal-actions,.fw-form-actions,.aw-modal-actions,.admin-modal-actions,
    .pa-dialog-actions,.lpb-modal-actions,.mloc-dialog-actions,.po-modal-actions,
    .ce-modal-actions,.ce-v7-modal-actions,.dfr-modal-actions,.modal-actions,
    .privacy-policy-modal-actions,.partner-confirm-actions,.corr-modal footer
  ){
    display:grid!important;grid-template-columns:1fr!important;
  }
  :where(body.ml-uiux-polish-v2) :where(
    .ws-modal-actions,.fw-form-actions,.aw-modal-actions,.admin-modal-actions,
    .pa-dialog-actions,.lpb-modal-actions,.mloc-dialog-actions,.po-modal-actions,
    .ce-modal-actions,.ce-v7-modal-actions,.dfr-modal-actions,.modal-actions,
    .privacy-policy-modal-actions,.partner-confirm-actions,.corr-modal footer
  ) > :where(button,a){width:100%!important;margin-inline:0!important}
}
