/* @morghi/ui-foundation v1.4.0 · MORGHI_UNIVERSAL_DESIGN_SYSTEM */
/* Generated from tokens/morghi-ui.tokens.json. Do not edit directly. */
:root,
[data-m-theme="light"] {
  --m-color-canvas: #f5fafd;
  --m-color-surface: #ffffff;
  --m-color-surface-subtle: #e7f3ff;
  --m-color-surface-muted: #e7f3ff;
  --m-color-surface-strong: #b8dcfa;
  --m-color-text: #02070c;
  --m-color-text-muted: #082b5d;
  --m-color-text-tertiary: #0a438a;
  --m-color-text-link: #0b67d1;
  --m-color-border: #b8dcfa;
  --m-color-border-strong: #75b6f3;
  --m-color-primary: #20d5f3;
  --m-color-primary-hover: #08a9c5;
  --m-color-primary-contrast: #02070c;
  --m-color-secondary: #e7f3ff;
  --m-color-selection: #d9faff;
  --m-color-accent: #20d5f3;
  --m-color-navigation: #041a3a;
  --m-color-navigation-surface: #041a3a;
  --m-color-navigation-secondary-surface: #e7f3ff;
  --m-color-transactional-header: #082b5d;
  --m-color-navigation-text: #ffffff;
  --m-color-navigation-text-muted: #b8dcfa;
  --m-color-focus: #0b67d1;
  --m-color-success: #137a5a;
  --m-color-success-soft: #e7f7f0;
  --m-color-warning: #8a4b08;
  --m-color-warning-soft: #fff4d6;
  --m-color-danger: #b33a3a;
  --m-color-danger-soft: #fbe8e8;
  --m-color-info: #0b67d1;
  --m-color-info-soft: #e7f3ff;
  --morghi-color-canvas: #f5fafd;
  --morghi-color-surface: #ffffff;
  --morghi-color-surface-subtle: #e7f3ff;
  --morghi-color-surface-muted: #e7f3ff;
  --morghi-color-surface-strong: #b8dcfa;
  --morghi-color-text: #02070c;
  --morghi-color-text-muted: #082b5d;
  --morghi-color-text-tertiary: #0a438a;
  --morghi-color-text-link: #0b67d1;
  --morghi-color-border: #b8dcfa;
  --morghi-color-border-strong: #75b6f3;
  --morghi-color-primary: #20d5f3;
  --morghi-color-primary-hover: #08a9c5;
  --morghi-color-primary-contrast: #02070c;
  --morghi-color-secondary: #e7f3ff;
  --morghi-color-selection: #d9faff;
  --morghi-color-accent: #20d5f3;
  --morghi-color-navigation: #041a3a;
  --morghi-color-navigation-surface: #041a3a;
  --morghi-color-navigation-secondary-surface: #e7f3ff;
  --morghi-color-transactional-header: #082b5d;
  --morghi-color-navigation-text: #ffffff;
  --morghi-color-navigation-text-muted: #b8dcfa;
  --morghi-color-focus: #0b67d1;
  --morghi-color-success: #137a5a;
  --morghi-color-success-soft: #e7f7f0;
  --morghi-color-warning: #8a4b08;
  --morghi-color-warning-soft: #fff4d6;
  --morghi-color-danger: #b33a3a;
  --morghi-color-danger-soft: #fbe8e8;
  --morghi-color-info: #0b67d1;
  --morghi-color-info-soft: #e7f3ff;
  --m-space-1: 4px;
  --m-space-2: 8px;
  --m-space-3: 12px;
  --m-space-4: 16px;
  --m-space-5: 20px;
  --m-space-6: 24px;
  --m-space-8: 32px;
  --m-space-10: 40px;
  --m-space-12: 48px;
  --m-radius-sm: 6px;
  --m-radius-md: 10px;
  --m-radius-lg: 14px;
  --m-radius-pill: 999px;
  --m-shadow-sm: 0 2px 8px rgba(2, 7, 12, 0.06);
  --m-shadow-md: 0 8px 24px rgba(2, 7, 12, 0.08);
  --m-shadow-lg: 0 18px 44px rgba(2, 7, 12, 0.12);
  --m-type-family: Manrope, ui-sans-serif, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
  --m-type-size-xs: 12px;
  --m-type-size-sm: 14px;
  --m-type-size-md: 16px;
  --m-type-size-lg: 20px;
  --m-type-size-xl: 32px;
  --m-type-line-tight: 1.25;
  --m-type-line-normal: 1.5;
  --m-layout-rail: 72px;
  --m-layout-sidebar: 220px;
  --m-layout-topbar: 64px;
  --m-layout-contextbar: 72px;
  --m-layout-content-max: 1600px;
  --m-layout-module-launcher-max: 680px;
  --m-layout-context-panel: 400px;
  --m-layout-modal-max: 560px;
  --m-layout-control: 44px;
  --m-layout-control-sm: 44px;
  --m-motion-fast: 120ms;
  --m-motion-normal: 180ms;
  --m-motion-ease: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: light;
}

[data-m-theme="dark"] {
  --m-color-canvas: #02070c;
  --m-color-surface: #041a3a;
  --m-color-surface-subtle: #082b5d;
  --m-color-surface-muted: #082b5d;
  --m-color-surface-strong: #0a438a;
  --m-color-text: #ffffff;
  --m-color-text-muted: #b8dcfa;
  --m-color-text-tertiary: #75b6f3;
  --m-color-text-link: #20d5f3;
  --m-color-border: #0a438a;
  --m-color-border-strong: #3b8ceb;
  --m-color-primary: #20d5f3;
  --m-color-primary-hover: #75b6f3;
  --m-color-primary-contrast: #02070c;
  --m-color-secondary: #082b5d;
  --m-color-selection: #0a438a;
  --m-color-accent: #20d5f3;
  --m-color-navigation: #041a3a;
  --m-color-navigation-surface: #041a3a;
  --m-color-navigation-secondary-surface: #082b5d;
  --m-color-transactional-header: #082b5d;
  --m-color-navigation-text: #ffffff;
  --m-color-navigation-text-muted: #b8dcfa;
  --m-color-focus: #20d5f3;
  --m-color-success: #75d5b3;
  --m-color-success-soft: #073d32;
  --m-color-warning: #ffd27a;
  --m-color-warning-soft: #4d2b06;
  --m-color-danger: #ff9b9b;
  --m-color-danger-soft: #541d1d;
  --m-color-info: #75b6f3;
  --m-color-info-soft: #082b5d;
  --morghi-color-canvas: #02070c;
  --morghi-color-surface: #041a3a;
  --morghi-color-surface-subtle: #082b5d;
  --morghi-color-surface-muted: #082b5d;
  --morghi-color-surface-strong: #0a438a;
  --morghi-color-text: #ffffff;
  --morghi-color-text-muted: #b8dcfa;
  --morghi-color-text-tertiary: #75b6f3;
  --morghi-color-text-link: #20d5f3;
  --morghi-color-border: #0a438a;
  --morghi-color-border-strong: #3b8ceb;
  --morghi-color-primary: #20d5f3;
  --morghi-color-primary-hover: #75b6f3;
  --morghi-color-primary-contrast: #02070c;
  --morghi-color-secondary: #082b5d;
  --morghi-color-selection: #0a438a;
  --morghi-color-accent: #20d5f3;
  --morghi-color-navigation: #041a3a;
  --morghi-color-navigation-surface: #041a3a;
  --morghi-color-navigation-secondary-surface: #082b5d;
  --morghi-color-transactional-header: #082b5d;
  --morghi-color-navigation-text: #ffffff;
  --morghi-color-navigation-text-muted: #b8dcfa;
  --morghi-color-focus: #20d5f3;
  --morghi-color-success: #75d5b3;
  --morghi-color-success-soft: #073d32;
  --morghi-color-warning: #ffd27a;
  --morghi-color-warning-soft: #4d2b06;
  --morghi-color-danger: #ff9b9b;
  --morghi-color-danger-soft: #541d1d;
  --morghi-color-info: #75b6f3;
  --morghi-color-info-soft: #082b5d;
  color-scheme: dark;
}

/* Morghi UI presentation contract. Functional authority remains in each application. */
*, *::before, *::after { box-sizing: border-box; }

.m-ui {
  margin: 0;
  color: var(--m-color-text);
  background: var(--m-color-canvas);
  font-family: var(--m-type-family);
  font-size: var(--m-type-size-sm);
  line-height: var(--m-type-line-normal);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.m-ui button, .m-ui input, .m-ui select, .m-ui textarea { font: inherit; }
.m-ui button, .m-ui a { -webkit-tap-highlight-color: transparent; }
.m-ui :focus-visible { outline: 3px solid color-mix(in srgb, var(--m-color-focus) 52%, transparent); outline-offset: 2px; }
.m-visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.m-app-shell { min-height: 100dvh; display: flex; flex-direction: column; background: var(--m-color-canvas); }
.m-topbar { min-width: 0; min-height: var(--m-layout-topbar); padding: 0 var(--m-space-6); display: flex; align-items: center; gap: var(--m-space-4); color: var(--m-color-navigation-text); background: var(--m-color-navigation); z-index: 20; }
.m-brand { min-width: 0; height: 100%; padding: 0 var(--m-space-4); display: flex; align-items: center; gap: var(--m-space-3); color: var(--m-color-text); text-decoration: none; }
.m-brand__mark { width: 8px; height: 28px; display: block; flex: none; border-radius: var(--m-radius-sm); background: var(--m-color-primary); box-shadow: 0 0 18px color-mix(in srgb, var(--m-color-primary) 42%, transparent); }
.m-brand__text { min-width: 0; display: grid; line-height: 1.15; }
.m-brand__text strong { overflow: hidden; color: var(--m-color-text); font-size: var(--m-type-size-sm); text-overflow: ellipsis; white-space: nowrap; }
.m-brand__text small { overflow: hidden; color: var(--m-color-text-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.m-topbar .m-brand { padding: 0; color: var(--m-color-navigation-text); }.m-topbar .m-brand__text strong { color: var(--m-color-navigation-text); }.m-topbar .m-brand__text small { color: var(--m-color-navigation-text-muted); }
.m-context { min-width: 0; display: flex; align-items: center; gap: var(--m-space-3); }
.m-context__label { color: var(--m-color-text-muted); font-size: 11px; }
.m-context__value { min-width: 0; border: 0; color: var(--m-color-text); background: transparent; font-weight: 750; cursor: pointer; }
.m-topbar__spacer { flex: 1; }.m-topbar__actions { display: flex; align-items: center; gap: var(--m-space-2); }
.m-avatar { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: none; border-radius: 50%; color: var(--m-color-primary); background: color-mix(in srgb, var(--m-color-primary) 12%, var(--m-color-surface)); font-size: 11px; font-weight: 850; }
.m-topbar .m-avatar { color: var(--m-color-primary-contrast); background: var(--m-color-primary); }.m-topbar .m-button--quiet { color: var(--m-color-navigation-text); }

/* Canonical v1.4 global navigation. Content and authorization remain backend/metadata driven. */
.m-module-trigger { min-height: var(--m-layout-control); padding: 0 var(--m-space-4); display: inline-flex; align-items: center; justify-content: center; gap: var(--m-space-2); flex: none; border: 1px solid var(--m-color-primary); border-radius: var(--m-radius-md); color: var(--m-color-primary-contrast); background: var(--m-color-primary); font-weight: 750; cursor: pointer; }
.m-module-trigger:hover { border-color: var(--m-color-primary-hover); background: var(--m-color-primary-hover); }
.m-global-search { width: min(34vw, 420px); min-width: 220px; height: var(--m-layout-control); padding: 0 var(--m-space-4); display: flex; align-items: center; gap: var(--m-space-2); border: 1px solid color-mix(in srgb, var(--m-color-navigation-text-muted) 28%, transparent); border-radius: var(--m-radius-pill); color: var(--m-color-navigation-text); background: color-mix(in srgb, var(--m-color-navigation-text) 7%, var(--m-color-navigation)); }
.m-global-search input { width: 100%; border: 0; outline: 0; color: inherit; background: transparent; }
.m-global-search input::placeholder { color: var(--m-color-navigation-text-muted); }
.m-module-launcher-backdrop { position: fixed; inset: var(--m-layout-topbar) 0 0; z-index: 80; background: color-mix(in srgb, var(--m-color-text) 32%, transparent); }
.m-module-launcher { width: min(calc(100vw - 48px), var(--m-layout-module-launcher-max)); max-height: calc(100dvh - var(--m-layout-topbar) - 48px); padding: var(--m-space-6); position: fixed; top: calc(var(--m-layout-topbar) + var(--m-space-6)); left: 50%; z-index: 81; display: grid; gap: var(--m-space-4); overflow: auto; transform: translateX(-50%); border: 1px solid var(--m-color-border); border-radius: var(--m-radius-lg); color: var(--m-color-text); background: var(--m-color-surface); box-shadow: var(--m-shadow-lg); }
.m-module-launcher[hidden],.m-module-launcher-backdrop[hidden],.m-context-panel[hidden],.m-context-panel-backdrop[hidden],.m-modal[hidden],.m-modal-backdrop[hidden] { display: none !important; }
.m-module-launcher__header { display: flex; align-items: center; justify-content: space-between; gap: var(--m-space-4); }
.m-module-launcher__header h2 { margin: 0; font-size: var(--m-type-size-lg); }
.m-module-launcher__search { height: var(--m-layout-control); padding: 0 var(--m-space-3); border: 1px solid var(--m-color-border); border-radius: var(--m-radius-md); color: var(--m-color-text); background: var(--m-color-canvas); }
.m-module-launcher__hint { margin: 0; color: var(--m-color-text-muted); font-size: var(--m-type-size-xs); }
.m-module-launcher__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--m-space-3); }
.m-module-item { min-height: 76px; padding: var(--m-space-4); display: grid; align-content: center; gap: var(--m-space-1); border: 1px solid var(--m-color-border); border-radius: var(--m-radius-md); color: var(--m-color-text); background: var(--m-color-surface); text-align: left; cursor: pointer; }
.m-module-item:hover,.m-module-item:focus-visible { border-color: var(--m-color-focus); background: var(--m-color-selection); }
.m-module-item strong { font-size: var(--m-type-size-sm); }.m-module-item small { color: var(--m-color-text-muted); font-size: var(--m-type-size-xs); }
.m-local-tabs { min-width: 0; display: flex; gap: var(--m-space-2); overflow-x: auto; border-bottom: 1px solid var(--m-color-border); }
.m-local-tab { min-width: 112px; min-height: var(--m-layout-control); padding: 0 var(--m-space-4); position: relative; flex: none; border: 0; color: var(--m-color-text-muted); background: transparent; font-weight: 650; cursor: pointer; }
.m-local-tab:hover { color: var(--m-color-text); }.m-local-tab[aria-selected="true"],.m-local-tab[aria-current="page"] { color: var(--m-color-text-link); }
.m-local-tab[aria-selected="true"]::after,.m-local-tab[aria-current="page"]::after { content: ""; height: 3px; position: absolute; right: var(--m-space-3); bottom: 0; left: var(--m-space-3); border-radius: var(--m-radius-pill); background: var(--m-color-primary); }

.m-context-bar { min-height: var(--m-layout-contextbar); padding: var(--m-space-3) var(--m-space-6); display: flex; align-items: center; justify-content: space-between; gap: var(--m-space-4); border-bottom: 1px solid var(--m-color-border); background: var(--m-color-surface); }
.m-context-bar__copy { min-width: 0; display: grid; gap: var(--m-space-1); }.m-context-bar__eyebrow { color: var(--m-color-text-link); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.m-shell-workspace { min-width: 0; min-height: 0; flex: 1; display: grid; grid-template-columns: var(--m-layout-rail) var(--m-layout-sidebar) minmax(0, 1fr); }
.m-shell-workspace--hybrid { display: block; }
.m-shell-workspace--empty { grid-template-columns: minmax(0,1fr); }
/* Deprecated v1.3 compatibility: rail and secondary navigation are no longer canonical. */
.m-navigation-stack { min-height: 0; display: contents; }
.m-global-rail { min-height: 0; padding: var(--m-space-4) 10px; display: flex; flex-direction: column; align-items: center; gap: var(--m-space-2); overflow-y: auto; background: var(--m-color-navigation); color: var(--m-color-navigation-text); }
.m-rail-item { width: 52px; min-width: 52px; min-height: 44px; padding: 0; display: grid; place-items: center; border: 0; border-radius: var(--m-radius-md); color: var(--m-color-navigation-text); background: transparent; cursor: pointer; }
.m-rail-item:hover { background: color-mix(in srgb, var(--m-color-primary) 14%, transparent); }.m-rail-item[aria-current="page"] { color: var(--m-color-primary-contrast); background: var(--m-color-primary); }
.m-rail-item__icon { width: 20px; height: 20px; display: grid; place-items: center; overflow: hidden; font-size: 13px; font-weight: 750; }
.m-secondary-nav { min-height: 0; padding: var(--m-space-4) var(--m-space-2); display: flex; flex-direction: column; gap: var(--m-space-2); overflow-y: auto; border-right: 1px solid var(--m-color-border); background: var(--m-color-navigation-secondary-surface); }
.m-nav-label { margin: 0 var(--m-space-3) var(--m-space-1); color: var(--m-color-text); font-size: 14px; font-weight: 650; }
.m-nav { display: grid; gap: var(--m-space-1); }
.m-nav__item { min-height: 44px; padding: 0 var(--m-space-3); display: flex; align-items: center; gap: var(--m-space-3); border: 0; border-radius: var(--m-radius-md); color: var(--m-color-text-muted); background: transparent; text-align: left; text-decoration: none; font-size: 13px; font-weight: 560; cursor: pointer; transition: color var(--m-motion-fast) var(--m-motion-ease), background var(--m-motion-fast) var(--m-motion-ease); }
.m-nav__item:hover { color: var(--m-color-text); background: color-mix(in srgb, var(--m-color-selection) 58%, transparent); }
.m-nav__item[aria-current="page"] { color: var(--m-color-text-link); background: var(--m-color-selection); }
.m-nav__icon { width: 18px; height: 18px; display: inline-grid; place-items: center; flex: none; color: currentColor; font-size: 14px; }

.m-main { min-width: 0; min-height: 0; padding: var(--m-space-6); overflow: auto; }
.m-page { width: min(100%, var(--m-layout-content-max)); margin: 0 auto; }
.m-page-header { margin-bottom: var(--m-space-5); display: flex; align-items: end; justify-content: space-between; gap: var(--m-space-5); }
.m-breadcrumb { margin-bottom: var(--m-space-2); display: flex; align-items: center; gap: var(--m-space-2); color: var(--m-color-text-muted); font-size: 11px; }
.m-page-title { margin: 0; color: var(--m-color-text); font-size: var(--m-type-size-xl); line-height: var(--m-type-line-tight); letter-spacing: -.035em; }
.m-page-description { max-width: 720px; margin: var(--m-space-1) 0 0; color: var(--m-color-text-muted); font-size: 13px; }
.m-page-actions { display: flex; align-items: center; gap: var(--m-space-2); }

.m-button { min-height: var(--m-layout-control); padding: 0 var(--m-space-4); display: inline-flex; align-items: center; justify-content: center; gap: var(--m-space-2); border: 1px solid var(--m-color-border); border-radius: var(--m-radius-md); color: var(--m-color-text); background: var(--m-color-surface); font-weight: 750; text-decoration: none; cursor: pointer; transition: transform var(--m-motion-fast) var(--m-motion-ease), border-color var(--m-motion-fast) var(--m-motion-ease), background var(--m-motion-fast) var(--m-motion-ease); }
.m-button:hover { border-color: var(--m-color-border-strong); background: var(--m-color-surface-subtle); }
.m-button:active { transform: translateY(1px); }
.m-button:disabled, .m-button[aria-disabled="true"] { opacity: .48; cursor: not-allowed; transform: none; }
.m-button--primary { border-color: var(--m-color-primary); color: var(--m-color-primary-contrast); background: var(--m-color-primary); box-shadow: var(--m-shadow-sm); }
.m-button--primary:hover { border-color: var(--m-color-primary-hover); background: var(--m-color-primary-hover); }
.m-button--quiet { border-color: transparent; background: transparent; }
.m-button--danger { border-color: color-mix(in srgb, var(--m-color-danger) 36%, var(--m-color-border)); color: var(--m-color-danger); background: color-mix(in srgb, var(--m-color-danger) 7%, var(--m-color-surface)); }
.m-button--sm { min-height: var(--m-layout-control-sm); padding: 0 var(--m-space-3); border-radius: var(--m-radius-sm); font-size: 12px; }
.m-icon-button { width: var(--m-layout-control); min-width: var(--m-layout-control); padding: 0; }

.m-grid { display: grid; gap: var(--m-space-4); }.m-grid--metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }.m-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }.m-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.m-card { min-width: 0; border: 1px solid var(--m-color-border); border-radius: var(--m-radius-lg); background: var(--m-color-surface); box-shadow: var(--m-shadow-sm); }
.m-card__header { min-height: 66px; padding: var(--m-space-4); display: flex; align-items: center; justify-content: space-between; gap: var(--m-space-4); border-bottom: 1px solid var(--m-color-border); }
.m-card__header h2, .m-card__header h3 { margin: 0; color: var(--m-color-text); font-size: var(--m-type-size-sm); }.m-card__header p { margin: 2px 0 0; color: var(--m-color-text-muted); font-size: 11px; }
.m-card__body { padding: var(--m-space-4); }
.m-metric { min-height: 98px; padding: var(--m-space-4); display: grid; grid-template-columns: 1fr auto; align-items: start; }
.m-metric__label { color: var(--m-color-text-muted); font-size: 12px; font-weight: 680; }
.m-metric__value { grid-row: span 2; color: var(--m-color-text); font-size: 30px; line-height: 1; letter-spacing: -.045em; }
.m-metric__meta { align-self: end; color: var(--m-color-text-muted); font-size: 10px; }.m-metric__meta::before { content: ""; width: 6px; height: 6px; margin-right: 6px; display: inline-block; border-radius: 50%; background: var(--m-color-primary); }

.m-toolbar { min-height: 54px; padding: var(--m-space-2) var(--m-space-3); display: flex; align-items: center; gap: var(--m-space-2); border-bottom: 1px solid var(--m-color-border); background: var(--m-color-surface-subtle); }
.m-toolbar__search { min-width: 220px; height: var(--m-layout-control-sm); padding: 0 var(--m-space-3); display: flex; align-items: center; gap: var(--m-space-2); border: 1px solid var(--m-color-border); border-radius: var(--m-radius-md); background: var(--m-color-surface); }
.m-toolbar__search input { width: 100%; border: 0; outline: 0; color: var(--m-color-text); background: transparent; font-size: 12px; }.m-toolbar__search input::placeholder { color: var(--m-color-text-muted); }
.m-toolbar__spacer { flex: 1; }

.m-table-wrap { width: 100%; overflow-x: auto; }
.m-table { width: 100%; min-width: 720px; border-collapse: collapse; color: var(--m-color-text); background: var(--m-color-surface); }
.m-table th { height: 36px; padding: 0 var(--m-space-4); color: var(--m-color-text-muted); background: var(--m-color-surface-subtle); font-size: 10px; font-weight: 780; text-align: left; }
.m-table td { height: 58px; padding: var(--m-space-2) var(--m-space-4); border-top: 1px solid var(--m-color-border); font-size: 12px; vertical-align: middle; }
.m-table tbody tr { transition: background var(--m-motion-fast) var(--m-motion-ease); }.m-table tbody tr:hover { background: color-mix(in srgb, var(--m-color-primary) 4%, var(--m-color-surface)); }.m-table tbody tr[aria-selected="true"] { background: color-mix(in srgb, var(--m-color-primary) 6%, var(--m-color-surface)); box-shadow: inset 3px 0 var(--m-color-primary); }
.m-entity { display: flex; align-items: center; gap: var(--m-space-3); }.m-entity__icon { width: 32px; height: 32px; display: grid; place-items: center; flex: none; border-radius: var(--m-radius-sm); color: var(--m-color-primary); background: color-mix(in srgb, var(--m-color-primary) 10%, var(--m-color-surface)); font-weight: 850; }.m-entity__copy { min-width: 0; display: grid; }.m-entity__copy strong,.m-entity__copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.m-entity__copy small { color: var(--m-color-text-muted); font-size: 10px; }

.m-badge { min-height: 24px; padding: 0 var(--m-space-2); display: inline-flex; align-items: center; gap: 6px; border-radius: var(--m-radius-pill); color: var(--m-color-text-muted); background: var(--m-color-surface-subtle); font-size: 10px; font-weight: 780; white-space: nowrap; }
.m-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.m-badge--success { color: var(--m-color-success); background: color-mix(in srgb, var(--m-color-success) 10%, var(--m-color-surface)); }.m-badge--warning { color: var(--m-color-warning); background: color-mix(in srgb, var(--m-color-warning) 11%, var(--m-color-surface)); }.m-badge--danger { color: var(--m-color-danger); background: color-mix(in srgb, var(--m-color-danger) 10%, var(--m-color-surface)); }.m-badge--info { color: var(--m-color-info); background: color-mix(in srgb, var(--m-color-info) 10%, var(--m-color-surface)); }

.m-form { display: grid; gap: var(--m-space-4); }.m-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--m-space-4); }
.m-field { min-width: 0; display: grid; gap: 6px; }.m-field__label { display: flex; align-items: center; justify-content: space-between; gap: var(--m-space-2); color: var(--m-color-text); font-size: 12px; font-weight: 750; }.m-field__optional { color: var(--m-color-text-muted); font-size: 10px; font-weight: 500; }
.m-input, .m-select, .m-textarea { width: 100%; border: 1px solid var(--m-color-border); border-radius: var(--m-radius-md); color: var(--m-color-text); background: var(--m-color-surface); transition: border-color var(--m-motion-fast) var(--m-motion-ease), box-shadow var(--m-motion-fast) var(--m-motion-ease); }
.m-input, .m-select { height: var(--m-layout-control); padding: 0 var(--m-space-3); }.m-textarea { min-height: 96px; padding: var(--m-space-3); resize: vertical; }
.m-input::placeholder, .m-textarea::placeholder { color: var(--m-color-text-muted); }.m-input:hover, .m-select:hover, .m-textarea:hover { border-color: var(--m-color-border-strong); }.m-input:focus, .m-select:focus, .m-textarea:focus { border-color: var(--m-color-focus); outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--m-color-focus) 18%, transparent); }
.m-field__help { color: var(--m-color-text-muted); font-size: 10px; }.m-field--error .m-input,.m-field--error .m-select,.m-field--error .m-textarea { border-color: var(--m-color-danger); }.m-field--error .m-field__help { color: var(--m-color-danger); }
.m-check { display: flex; align-items: flex-start; gap: var(--m-space-2); color: var(--m-color-text); font-size: 12px; cursor: pointer; }.m-check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--m-color-primary); }
.m-form-actions { padding-top: var(--m-space-3); display: flex; justify-content: flex-end; gap: var(--m-space-2); border-top: 1px solid var(--m-color-border); }

.m-alert { padding: var(--m-space-3) var(--m-space-4); display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: var(--m-space-3); border: 1px solid var(--m-color-border); border-radius: var(--m-radius-md); color: var(--m-color-text); background: var(--m-color-surface); }
.m-alert__icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--m-color-primary); background: color-mix(in srgb, var(--m-color-primary) 10%, var(--m-color-surface)); font-weight: 850; }.m-alert__copy { display: grid; }.m-alert__copy strong { font-size: 12px; }.m-alert__copy span { color: var(--m-color-text-muted); font-size: 11px; }.m-alert--success { border-color: color-mix(in srgb, var(--m-color-success) 28%, var(--m-color-border)); }.m-alert--warning { border-color: color-mix(in srgb, var(--m-color-warning) 32%, var(--m-color-border)); }.m-alert--danger { border-color: color-mix(in srgb, var(--m-color-danger) 30%, var(--m-color-border)); }

.m-panel { border: 1px solid var(--m-color-border); border-radius: var(--m-radius-lg); background: var(--m-color-surface); box-shadow: var(--m-shadow-md); }.m-panel__header { padding: var(--m-space-4); display: flex; align-items: start; justify-content: space-between; gap: var(--m-space-3); border-bottom: 1px solid var(--m-color-border); }.m-panel__header h2 { margin: 0; font-size: var(--m-type-size-md); }.m-panel__header p { margin: 3px 0 0; color: var(--m-color-text-muted); font-size: 11px; }.m-panel__body { padding: var(--m-space-4); }.m-panel__footer { padding: var(--m-space-3) var(--m-space-4); display: flex; justify-content: flex-end; gap: var(--m-space-2); border-top: 1px solid var(--m-color-border); }
.m-context-panel-backdrop,.m-modal-backdrop { position: fixed; inset: 0; z-index: 90; background: color-mix(in srgb, var(--m-color-text) 34%, transparent); }
.m-context-panel { width: min(100%, var(--m-layout-context-panel)); height: 100dvh; position: fixed; top: 0; right: 0; z-index: 91; display: flex; flex-direction: column; border-left: 1px solid var(--m-color-border); color: var(--m-color-text); background: var(--m-color-surface); box-shadow: var(--m-shadow-lg); }
.m-context-panel .m-panel__body { min-height: 0; flex: 1; overflow: auto; }
.m-modal { width: min(calc(100vw - 32px), var(--m-layout-modal-max)); max-height: calc(100dvh - 32px); position: fixed; top: 50%; left: 50%; z-index: 91; overflow: auto; transform: translate(-50%, -50%); border: 1px solid var(--m-color-border); border-radius: var(--m-radius-lg); color: var(--m-color-text); background: var(--m-color-surface); box-shadow: var(--m-shadow-lg); }
.m-progress { display: grid; gap: 7px; }.m-progress__meta { display: flex; justify-content: space-between; color: var(--m-color-text-muted); font-size: 11px; }.m-progress__track { height: 7px; overflow: hidden; border-radius: var(--m-radius-pill); background: var(--m-color-surface-subtle); }.m-progress__value { height: 100%; border-radius: inherit; background: var(--m-color-primary); }
.m-empty { min-height: 260px; padding: var(--m-space-8); display: grid; place-items: center; text-align: center; }.m-empty__content { max-width: 360px; display: grid; justify-items: center; gap: var(--m-space-3); }.m-empty__icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; color: var(--m-color-primary); background: color-mix(in srgb, var(--m-color-primary) 10%, var(--m-color-surface)); font-size: 20px; }.m-empty h3,.m-empty p { margin: 0; }.m-empty p { color: var(--m-color-text-muted); font-size: 12px; }

.m-skeleton { position: relative; overflow: hidden; border-radius: var(--m-radius-sm); background: var(--m-color-surface-subtle); }.m-skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg,transparent,color-mix(in srgb,var(--m-color-surface) 72%,transparent),transparent); animation: m-shimmer 1.4s infinite; }@keyframes m-shimmer { to { transform: translateX(100%); } }

/* Universal patterns: applications provide data and behavior; Morghi UI provides presentation. */
.m-product-context { padding: var(--m-space-4) var(--m-space-6); display: flex; align-items: center; justify-content: space-between; gap: var(--m-space-4); color: var(--m-color-navigation-text); background: var(--m-color-navigation); }
.m-product-context__identity { min-width: 0; display: grid; gap: var(--m-space-1); }
.m-product-context__product { color: var(--m-color-navigation-text); font-size: var(--m-type-size-md); font-weight: 700; }
.m-product-context__tenant { overflow: hidden; color: var(--m-color-navigation-text-muted); font-size: var(--m-type-size-sm); text-overflow: ellipsis; white-space: nowrap; }

.m-public-transaction { min-height: 100dvh; color: var(--m-color-text); background: var(--m-color-canvas); }
.m-public-transaction__main { width: min(100%, 760px); margin: 0 auto; padding: clamp(var(--m-space-6), 7vw, var(--m-space-12)) var(--m-space-5); }
.m-guided-form { display: grid; gap: var(--m-space-6); }
.m-guided-form__progress { min-height: 24px; color: var(--m-color-text-tertiary); font-size: var(--m-type-size-sm); font-weight: 600; }
.m-guided-form__step { min-height: 440px; display: flex; flex-direction: column; gap: var(--m-space-5); }
.m-guided-form__step h1, .m-guided-form__step h2, .m-guided-form__step h3 { max-width: 24ch; margin: 0; color: var(--m-color-text); font-size: clamp(26px, 5vw, 32px); line-height: 1.25; letter-spacing: -.02em; }
.m-guided-form__step > p { max-width: 62ch; margin: 0; color: var(--m-color-text-muted); }
.m-guided-form__actions { margin-top: auto; padding-top: var(--m-space-6); display: flex; justify-content: flex-end; gap: var(--m-space-3); }
.m-choice { min-height: var(--m-layout-control); padding: var(--m-space-3) var(--m-space-4); display: flex; align-items: center; gap: var(--m-space-3); border: 1px solid var(--m-color-border); border-radius: var(--m-radius-md); color: var(--m-color-text); background: var(--m-color-surface); cursor: pointer; }
.m-choice:has(input:checked) { border-color: var(--m-color-primary); background: var(--m-color-selection); }
.m-choice input { width: 18px; height: 18px; accent-color: var(--m-color-primary); }

.m-operational-inbox { display: grid; gap: var(--m-space-5); }
.m-operational-inbox__tools { padding: var(--m-space-3); display: flex; align-items: end; gap: var(--m-space-3); border-bottom: 1px solid var(--m-color-border); background: var(--m-color-surface-subtle); }
.m-operational-inbox__table { border: 1px solid var(--m-color-border); border-radius: var(--m-radius-md); overflow: hidden; background: var(--m-color-surface); }
.m-operational-inbox tbody tr:hover { background: var(--m-color-selection); }

.m-case-detail { display: grid; gap: var(--m-space-5); }
.m-case-detail__summary { padding: var(--m-space-5); display: grid; gap: var(--m-space-4); border: 1px solid var(--m-color-border); border-radius: var(--m-radius-md); background: var(--m-color-surface); }
.m-case-detail__section { padding-top: var(--m-space-5); border-top: 1px solid var(--m-color-border); }
.m-case-detail__actions { display: flex; flex-wrap: wrap; gap: var(--m-space-3); }
.m-timeline { display: grid; gap: var(--m-space-4); }
.m-timeline__item { padding-left: var(--m-space-5); position: relative; color: var(--m-color-text-muted); }
.m-timeline__item::before { content: ""; width: 9px; height: 9px; position: absolute; top: 6px; left: 0; border-radius: 50%; background: var(--m-color-primary); }

/* Reusable transactional components. Applications own data and behavior. */
.m-filter-chip { min-height: var(--m-layout-control); padding: var(--m-space-2) var(--m-space-4); flex: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--m-space-2); border: 1px solid var(--m-color-border); border-radius: var(--m-radius-md); color: var(--m-color-text); background: var(--m-color-surface); font-weight: 650; cursor: pointer; transition: border-color var(--m-motion-fast) var(--m-motion-ease), background var(--m-motion-fast) var(--m-motion-ease); }
.m-filter-chip:hover { border-color: var(--m-color-border-strong); }.m-filter-chip[aria-pressed="true"],.m-filter-chip.is-active { background: var(--m-color-selection); }.m-filter-chip:disabled { opacity: .48; cursor: not-allowed; }

.m-offer-card { min-width: 0; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--m-color-border); border-radius: var(--m-radius-lg); background: var(--m-color-surface); transition: border-color var(--m-motion-fast) var(--m-motion-ease), transform var(--m-motion-fast) var(--m-motion-ease); }
.m-offer-card:hover { border-color: var(--m-color-border-strong); transform: translateY(-2px); }.m-offer-card[aria-selected="true"] { border-color: var(--m-color-focus); }.m-offer-card[aria-disabled="true"] { opacity: .48; }
.m-offer-card__media { width: 100%; position: relative; aspect-ratio: 5 / 4; overflow: hidden; background: var(--m-color-surface-strong); }
.m-offer-card__visual { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; color: var(--m-color-text-muted); background: var(--m-color-surface-strong); font-size: 28px; font-weight: 750; }.m-offer-card__visual img { width: 100%; height: 100%; object-fit: cover; }
.m-offer-card__add { width: var(--m-layout-control); height: var(--m-layout-control); position: absolute; right: var(--m-space-3); bottom: var(--m-space-3); display: grid; place-items: center; border: 0; border-radius: var(--m-radius-md); color: var(--m-color-primary-contrast); background: var(--m-color-primary); box-shadow: 0 0 0 3px var(--m-color-surface), var(--m-shadow-sm); font-size: 27px; font-weight: 650; line-height: 1; cursor: pointer; }.m-offer-card__add:hover { background: var(--m-color-primary-hover); }.m-offer-card__add:disabled { color: var(--m-color-text-muted); background: var(--m-color-surface-subtle); cursor: not-allowed; }
.m-offer-card__body { min-height: 116px; padding: var(--m-space-4); display: grid; align-content: start; gap: var(--m-space-3); }.m-offer-card__body header { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: var(--m-space-3); }.m-offer-card__body h3 { margin: 0; color: var(--m-color-text); font-size: var(--m-type-size-md); line-height: 22px; }.m-offer-card__body header > strong { color: var(--m-color-text); white-space: nowrap; }
.m-offer-card__description { margin: 0; overflow: hidden; display: -webkit-box; color: var(--m-color-text-muted); font-size: var(--m-type-size-xs); line-height: 18px; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }

.m-quantity-control { display: inline-grid; grid-template-columns: var(--m-layout-control) minmax(44px,auto) var(--m-layout-control); align-items: center; border: 1px solid var(--m-color-border); border-radius: var(--m-radius-md); overflow: hidden; background: var(--m-color-surface); }.m-quantity-control__action { min-width: var(--m-layout-control); min-height: var(--m-layout-control); border: 0; color: var(--m-color-text); background: var(--m-color-surface-subtle); cursor: pointer; }.m-quantity-control__value { min-width: 44px; padding: 0 var(--m-space-2); text-align: center; font-weight: 700; }.m-quantity-control__action:disabled { opacity: .48; cursor: not-allowed; }
.m-sticky-summary { overflow: hidden; border: 1px solid var(--m-color-border); border-radius: var(--m-radius-lg); background: var(--m-color-surface); box-shadow: var(--m-shadow-md); }
.m-catalog-entry { display: grid; gap: var(--m-space-6); }.m-campaign-product-focus { display: grid; grid-template-columns: minmax(0,1fr) minmax(320px,1fr); gap: var(--m-space-8); align-items: center; }

@media (max-width: 1080px) {
  .m-shell-workspace { grid-template-columns: var(--m-layout-rail) 190px minmax(0,1fr); }.m-shell-workspace--empty { grid-template-columns: minmax(0,1fr); }.m-grid--metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }.m-grid--3 { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 720px) {
  .m-topbar { min-height: 58px; padding: 0 var(--m-space-3); gap: var(--m-space-2); }.m-topbar .m-brand { max-width: 148px; }.m-topbar__actions .m-icon-button { display: none; }.m-module-trigger { min-width: 76px; padding-inline: var(--m-space-3); }.m-global-search { display: none; }.m-module-launcher-backdrop { inset: 58px 0 0; }.m-module-launcher { width: calc(100vw - 24px); max-height: calc(100dvh - 82px); padding: var(--m-space-4); top: 70px; }.m-module-launcher__grid { grid-template-columns: 1fr; }.m-context-bar { min-height: 92px; padding: var(--m-space-3) var(--m-space-4); align-items: stretch; flex-direction: column; }.m-context-bar .m-context { width: 100%; }.m-context-bar .m-context__value { width: 100%; max-width: none; }
  .m-shell-workspace,.m-shell-workspace--empty { min-height: 0; display: block; }.m-navigation-stack { width: min(88vw,340px); position: fixed; inset: 0 auto 0 0; z-index: 90; display: grid; grid-template-columns: var(--m-layout-rail) minmax(0,1fr); background: var(--m-color-navigation-secondary-surface); box-shadow: var(--m-shadow-lg); transform: translateX(-105%); transition: transform var(--m-motion-normal) var(--m-motion-ease); }.m-navigation-stack.is-open { transform: translateX(0); }.m-global-rail,.m-secondary-nav { height: 100%; }.m-secondary-nav { padding-top: 72px; }.m-nav__item { min-height: 48px; }
  .m-main { padding: var(--m-space-5) var(--m-space-3); overflow: visible; }.m-page-header { align-items: start; }.m-page-title { font-size: 24px; }.m-page-description { font-size: 12px; }.m-page-actions .m-button:not(.m-button--primary) { display: none; }.m-page-actions .m-button--primary { width: 44px; padding: 0; font-size: 0; }.m-page-actions .m-button--primary::before { content: "+"; font-size: 18px; }
  .m-grid--metrics,.m-grid--2,.m-grid--3,.m-form-row { grid-template-columns: 1fr; }.m-metric { min-height: 82px; }.m-toolbar { overflow-x: auto; }.m-toolbar__search { min-width: 180px; }.m-toolbar__spacer { display: none; }.m-card__header { min-height: 58px; }.m-table { min-width: 560px; }.m-alert { grid-template-columns: 28px minmax(0,1fr); }.m-alert > .m-button { grid-column: 2; justify-self: start; }
  .m-product-context { padding: var(--m-space-3) var(--m-space-4); }.m-public-transaction__main { padding: var(--m-space-6) var(--m-space-4); }.m-guided-form__step { min-height: calc(100dvh - 210px); }.m-guided-form__actions { display: grid; grid-template-columns: minmax(96px, 1fr) minmax(0, 2fr); }.m-guided-form__actions > :only-child { grid-column: 2; }.m-operational-inbox__tools { align-items: stretch; flex-direction: column; }.m-case-detail__actions { display: grid; grid-template-columns: 1fr; }
  .m-context-panel { width: 100%; }.m-modal { width: calc(100vw - 24px); }.m-local-tab { min-width: 104px; padding-inline: var(--m-space-3); }
  .m-offer-card { display: grid; grid-template-columns: minmax(132px,180px) minmax(0,1fr); }.m-offer-card__media { height: 100%; min-height: 180px; aspect-ratio: auto; }.m-offer-card__body { min-height: 180px; }.m-campaign-product-focus { grid-template-columns: minmax(0,1fr); gap: var(--m-space-5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }.m-offer-card:hover { transform: none; }
}

@media (forced-colors: active) {
  .m-button,.m-card,.m-panel,.m-alert,.m-input,.m-select,.m-textarea { border: 1px solid CanvasText; }.m-nav__item[aria-current="page"] { outline: 2px solid Highlight; }
}
