/* MAHIN GLOBAL UI SYSTEM v1 (component contracts, no page-wide resets)
   Ownership: reusable components and theme-level visual values.
   Module-specific layout and behavior remain in their module files.
   A change to a --mi-ui-* token applies to every component consuming it.
*/
:root {
  --mi-ui-ink: var(--text, #172b49);
  --mi-ui-muted: var(--muted, #65758f);
  --mi-ui-surface: var(--surface, #fff);
  --mi-ui-border: var(--border, #dae3ef);
  --mi-ui-accent: var(--mi-palette-accent, var(--primary, #2869dc));
  --mi-ui-radius-card: 15px;
  --mi-ui-radius-titlebar: 15px;
  --mi-ui-radius-control: 11px;
  --mi-ui-shadow-card: 0 3px 14px rgba(29, 63, 112, .06);
  --mi-ui-space-card: clamp(15px, 2vw, 24px);
  --mi-ui-space-page: clamp(12px, 2vw, 20px);
  --mi-ui-control-height: 38px;
  --mi-ui-focus: var(--focus-ring, #70a5ee);
}
html[data-theme="dark"], body[data-theme="dark"] {
  --mi-ui-shadow-card: 0 5px 18px rgba(0, 0, 0, .17);
}
/* Identity classes are reusable across all future modules.
   No element is restyled unless it opts in to the shared class. */
#appScreen :where(.mi-ui-titlebar) {
  box-sizing: border-box;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-block: 0 18px;
  color: var(--mi-ui-ink);
}
#appScreen :where(.mi-ui-titlebar) :is(h1, h2) {
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.3;
}
#appScreen :where(.mi-ui-titlebar--banner) {
  padding: var(--mi-ui-space-page);
  background: var(--mi-ui-surface);
  border: 1px solid var(--mi-ui-border);
  border-radius: var(--mi-ui-radius-titlebar);
  box-shadow: var(--mi-ui-shadow-card);
}
#appScreen :where(.mi-ui-titlebar--flush) {
  margin-block-end: 14px;
}
#appScreen :where(.mi-ui-card) {
  box-sizing: border-box;
  min-width: 0;
  color: var(--mi-ui-ink);
  border-color: var(--mi-ui-border);
  border-radius: var(--mi-ui-radius-card);
  background-color: var(--mi-ui-surface);
  box-shadow: var(--mi-ui-shadow-card);
}
#appScreen :where(.mi-ui-card--interactive) {
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
#appScreen :where(.mi-ui-card--interactive):focus-visible {
  outline: 2px solid var(--mi-ui-focus);
  outline-offset: 2px;
}
#appScreen :where(.mi-ui-card--plain) { box-shadow: none; }
#appScreen :where(.mi-ui-card-head) {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}
#appScreen :where(.mi-ui-button) {
  box-sizing: border-box;
  min-height: var(--mi-ui-control-height);
  border-radius: var(--mi-ui-radius-control);
  font: inherit;
  cursor: pointer;
}
#appScreen :where(.mi-ui-button):disabled {cursor: not-allowed;opacity: .6;}
#appScreen :where(.mi-ui-button):focus-visible {outline: 2px solid var(--mi-ui-focus);outline-offset: 2px;}
#appScreen :where(.mi-ui-search) {
  box-sizing: border-box;
  min-width: 0;
  border-color: var(--mi-ui-border);
  border-radius: var(--mi-ui-radius-control);
  background-color: var(--mi-ui-surface);
}
#appScreen :where(.mi-ui-search):focus-within {
  border-color: var(--mi-ui-accent);
  box-shadow: 0 0 0 3px rgba(var(--mi-palette-rgb, 40,105,220), .12);
}
#appScreen :where(.mi-ui-search-input) {
  min-width: 0;
  max-width: 100%;
  font: inherit;
}
#appScreen :where(.mi-ui-field) { min-width: 0; }
#appScreen :where(.mi-ui-field) :is(input, select, textarea) {
  box-sizing: border-box;
  max-width: 100%;
}
#appScreen :where(.mi-ui-table) {width:100%;border-collapse:collapse;}
#appScreen :where(.mi-ui-table) :is(th, td) {padding: 10px 12px;border-bottom:1px solid var(--mi-ui-border);text-align:start;}
#appScreen :where(.mi-ui-badge) {display:inline-flex;align-items:center;gap:5px;padding:4px 9px;border:1px solid var(--mi-ui-border);border-radius:999px;}
#appScreen :where(.mi-ui-tabs) {display:flex;align-items:center;gap:7px;min-width:0;overflow-x:auto;}
#appScreen :where(.mi-ui-modal) {max-width:min(560px,calc(100vw - 28px));border:1px solid var(--mi-ui-border);border-radius:var(--mi-ui-radius-card);background:var(--mi-ui-surface);color:var(--mi-ui-ink);}
@media (max-width: 700px) {
  #appScreen :where(.mi-ui-titlebar) {gap:10px;}
  #appScreen :where(.mi-ui-titlebar--banner) {padding:12px;}
  #appScreen :where(.mi-ui-card) {max-width:100%;}
}
@media (prefers-reduced-motion: reduce) {
  #appScreen :where(.mi-ui-card--interactive) {transition:none;}
}


/* =====================================================================
   MAHIN GLOBAL SETTINGS COMPONENTS v2
   One visual owner for Settings Overview, Appearance, and six categories.
   Applies only to elements explicitly opted in by their existing HTML/JS.
   Existing feature panel and overlay behavior still belongs to the feature.
   ===================================================================== */
:root {
  --mi-ui-settings-edge: rgba(var(--mi-palette-rgb,40,105,220), .28);
  --mi-ui-settings-symbol-bg: rgba(var(--mi-palette-rgb,40,105,220), .105);
  --mi-ui-settings-symbol-border: rgba(var(--mi-palette-rgb,40,105,220), .20);
  --mi-ui-settings-tint: linear-gradient(110deg, rgba(255,255,255,.94), rgba(var(--mi-palette-rgb,40,105,220),.13));
  --mi-ui-settings-card-bg: #fff;
  --mi-ui-settings-ink: #182b48;
  --mi-ui-settings-muted: #65738b;
  --mi-ui-settings-radius: 14px;
  --mi-ui-settings-gap: 12px;
  --mi-ui-settings-card-pad: 14px 16px;
  --mi-ui-settings-card-minheight: 80px;
}
html[data-mi-surface="glass"] {
  --mi-ui-settings-tint: linear-gradient(110deg, rgba(255,255,255,.72), rgba(var(--mi-palette-rgb,40,105,220),.20));
  --mi-ui-settings-card-bg: rgba(255,255,255,.77);
}
html[data-theme="dark"], body[data-theme="dark"] {
  --mi-ui-settings-ink: #edf4ff;
  --mi-ui-settings-muted: #b9c8df;
  --mi-ui-settings-card-bg: #21334c;
  --mi-ui-settings-tint: linear-gradient(110deg, #243650, rgba(var(--mi-palette-rgb,40,105,220),.24));
  --mi-ui-settings-edge: rgba(var(--mi-palette-rgb,40,105,220), .45);
  --mi-ui-settings-symbol-bg: rgba(var(--mi-palette-rgb,40,105,220), .25);
}

/* MAHIN_SHARED_PAGE_BANNER_V1 - one owner for Settings, Sales and future page banners. */
/* Shared titlebar: back-button, icon, title+description appear IN THAT ORDER,
   never scattered to opposite corners. No special Appearance title layout. */
html #appScreen .mi-ui-settings-banner {
  box-sizing:border-box !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  flex-wrap:nowrap !important;
  gap:12px !important;
  position:relative !important;
  isolation:isolate !important;
  min-height:82px !important;
  height:auto !important;
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
  margin:0 0 16px !important;
  padding:13px 16px !important;
  border:1px solid var(--mi-ui-settings-edge) !important;
  border-radius:var(--mi-ui-radius-titlebar,15px) !important;
  color:var(--mi-ui-settings-ink) !important;
  background:var(--mi-ui-settings-tint) !important;
  box-shadow:var(--mi-ui-shadow-card) !important;
  overflow:hidden !important;
}
html #appScreen .mi-ui-settings-banner::after {
  content:"";
  position:absolute;right:-38px;top:-48px;width:205px;height:155px;
  border:23px solid rgba(var(--mi-palette-rgb,40,105,220),.085);
  border-radius:50%;transform:rotate(-18deg);pointer-events:none;z-index:-1;
}
html #appScreen .mi-ui-settings-banner > * {position:relative;z-index:1;}
html #appScreen .mi-ui-settings-banner .mi-hub-heading-main {
  display:flex !important;align-items:center !important;justify-content:flex-start !important;
  flex:1 1 auto !important;gap:12px !important;min-width:0 !important;
  margin:0 !important;padding:0 !important;
}
html #appScreen .mi-ui-settings-banner .mi-ui-settings-copy {
  display:grid !important;align-content:center !important;justify-items:start !important;
  gap:3px !important;flex:1 1 auto !important;min-width:0 !important;
  width:auto !important;margin:0 !important;padding:0 !important;
  text-align:start !important;
}
html #appScreen .mi-ui-settings-banner .mi-ui-settings-copy :is(h1,h2) {
  font-size:clamp(19px,2.4vw,25px) !important;
  font-weight:750 !important;line-height:1.24 !important;
  margin:0 !important;padding:0 !important;
  white-space:normal !important;overflow-wrap:break-word !important;
  color:var(--mi-ui-settings-ink) !important;text-align:start !important;
}
html #appScreen .mi-ui-settings-banner .mi-ui-settings-copy :is(p,small) {
  display:block !important;font-size:12px !important;line-height:1.45 !important;
  margin:0 !important;padding:0 !important;
  color:var(--mi-ui-settings-muted) !important;opacity:1 !important;text-align:start !important;
}
html #appScreen .mi-ui-settings-banner .mi-hub-eyebrow {display:none !important;}

/* MAHIN_SHARED_DETAIL_NAV_V1
   One reusable detail-title variant for present and future modules.
   Overview banners may retain their section eyebrow. */
html #appScreen#appScreen .mi-ui-page--detail .mi-ui-settings-banner .mi-hub-eyebrow {
    display: none !important;
}
/* One icon tile contract: distinct icons, matching size, border and palette. */
html #appScreen .mi-ui-settings-symbol {
  box-sizing:border-box !important;display:inline-grid !important;place-items:center !important;
  flex:0 0 39px !important;width:39px !important;height:39px !important;
  min-width:39px !important;min-height:39px !important;
  margin:0 !important;padding:0 !important;
  border:1px solid var(--mi-ui-settings-symbol-border) !important;
  border-radius:10px !important;background:var(--mi-ui-settings-symbol-bg) !important;
  color:var(--mi-palette-accent,#2869dc) !important;
  font-size:21px !important;line-height:1 !important;
}
html #appScreen .mi-ui-settings-symbol svg {
  width:21px !important;height:21px !important;stroke:currentColor !important;
}
html #appScreen .mi-ui-settings-card .mi-ui-settings-symbol {
  flex-basis:35px !important;width:35px !important;min-width:35px !important;
  min-height:35px !important;height:35px !important;font-size:18px !important;
}
html #appScreen .mi-ui-settings-card .mi-ui-settings-symbol svg {
  width:18px !important;height:18px !important;
}
/* The same original working 'All settings' button on every subpage. */
html #appScreen#appScreen .mi-ui-settings-back {
  box-sizing:border-box !important;display:inline-flex !important;align-items:center !important;
  justify-content:center !important;flex:0 0 auto !important;
  width:auto !important;max-width:45% !important;min-height:35px !important;
  margin:0 !important;padding:8px 12px !important;
  border:1px solid var(--mi-ui-settings-edge) !important;
  border-radius:10px !important;
  background:var(--mi-ui-settings-card-bg) !important;
  color:var(--mi-ui-settings-ink) !important;
  font-family:inherit !important;font-size:12px !important;font-weight:600 !important;line-height:1.35 !important;
  text-decoration:none !important;white-space:nowrap !important;
  box-shadow:0 2px 6px rgba(24,55,94,.035) !important;cursor:pointer !important;
}
html #appScreen#appScreen .mi-ui-settings-back:hover {
  border-color:var(--mi-palette-accent,#2869dc) !important;
  background:rgba(var(--mi-palette-rgb,40,105,220),.11) !important;
}
html #appScreen#appScreen :is(.mi-ui-settings-back,.mi-ui-settings-card--action):focus-visible {
  outline:2px solid var(--mi-palette-accent,#2869dc) !important;outline-offset:2px !important;
}
/* Same input frame on Overview, Appearance and the six other pages. */
html #appScreen #settingsHubView .mi-ui-settings-search {
  box-sizing:border-box !important;display:flex !important;align-items:center !important;
  gap:11px !important;width:100% !important;max-width:none !important;
  min-width:0 !important;height:50px !important;min-height:50px !important;
  margin:0 0 13px !important;padding:0 14px !important;
  border:1px solid var(--mi-ui-settings-edge) !important;
  border-radius:13px !important;
  background:var(--mi-ui-settings-tint) !important;
  box-shadow:none !important;
}
html #appScreen #settingsHubView .mi-ui-settings-search:focus-within {
  border-color:var(--mi-palette-accent,#2869dc) !important;
  box-shadow:0 0 0 3px rgba(var(--mi-palette-rgb,40,105,220),.13) !important;
}
html #appScreen #settingsHubView .mi-ui-settings-search .mi-hub-search-label {
  display:flex !important;flex:1 1 auto !important;align-items:center !important;
  gap:11px !important;height:100% !important;width:100% !important;
  min-width:0 !important;min-height:0 !important;
  border:0 !important;background:transparent !important;box-shadow:none !important;
  margin:0 !important;padding:0 !important;
}
html #appScreen #settingsHubView .mi-ui-settings-search input[type="search"] {
  box-sizing:border-box !important;display:block !important;flex:1 1 auto !important;
  width:100% !important;max-width:100% !important;min-width:0 !important;
  height:36px !important;min-height:0 !important;padding:0 !important;margin:0 !important;
  border:0 !important;border-radius:0 !important;outline:0 !important;
  background:transparent !important;box-shadow:none !important;
  color:var(--mi-ui-settings-ink) !important;
  font-size:13px !important;line-height:1.4 !important;
}
html #appScreen #settingsHubView .mi-ui-settings-search :is(.mi-hub-search-icon,.mi-pro-loupe,.mi-six-search-icon) {
  display:inline-grid !important;place-items:center !important;
  flex:0 0 20px !important;width:20px !important;height:20px !important;
  color:var(--mi-palette-accent,#2869dc) !important;
}
html #appScreen #settingsHubView .mi-ui-settings-search input[type="search"]:focus {outline:0 !important;}
html #appScreen #settingsHubView .mi-ui-settings-search :is(kbd,.mi-unified-search-hint) {
  flex:0 0 auto !important;margin-left:auto !important;
  border:1px solid var(--mi-ui-settings-edge) !important;
  border-radius:6px !important;padding:3px 6px !important;
  color:var(--mi-palette-accent,#2869dc) !important;
  background:var(--mi-ui-settings-symbol-bg) !important;
  font-family:inherit !important;font-size:12px !important;line-height:1.1 !important;
}
/* Grid and ALL collapsed card surfaces have one design. Keep open Appearance
   floating panels separate because their position/behavior is intentionally special. */
html #appScreen #settingsHubView .mi-ui-settings-grid {
  box-sizing:border-box !important;display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  align-items:stretch !important;gap:var(--mi-ui-settings-gap) !important;
  width:100% !important;min-width:0 !important;
  padding:0 !important;margin:0 !important;
  border:0 !important;background:transparent !important;
}
html #appScreen #settingsHubView .mi-ui-settings-card:not(.mi-v6-open) {
  box-sizing:border-box !important;
  min-width:0 !important;max-width:100% !important;
  min-height:var(--mi-ui-settings-card-minheight) !important;
  padding:var(--mi-ui-settings-card-pad) !important;
  margin:0 !important;
  border:1px solid var(--mi-ui-settings-edge) !important;
  border-radius:var(--mi-ui-settings-radius) !important;
  background:var(--mi-ui-settings-card-bg) !important;
  color:var(--mi-ui-settings-ink) !important;
  box-shadow:var(--mi-ui-shadow-card) !important;
  text-align:start !important;
}
/* The seven compact Appearance controls use the SAME white card, not a private skin. */
html #appScreen #settingsHubView #miV2SettingsPage_appearance
  .mi-pro-card.mi-ui-settings-card:not(.mi-v6-open) {
  min-height:var(--mi-ui-settings-card-minheight) !important;
  padding:var(--mi-ui-settings-card-pad) !important;
  border:1px solid var(--mi-ui-settings-edge) !important;
  border-radius:var(--mi-ui-settings-radius) !important;
  background:var(--mi-ui-settings-card-bg) !important;
  box-shadow:var(--mi-ui-shadow-card) !important;
}
html #appScreen #settingsHubView .mi-ui-settings-card--action {
  display:flex !important;align-items:center !important;gap:12px !important;
  width:100% !important;cursor:pointer !important;justify-content:flex-start !important;
}
html #appScreen #settingsHubView .mi-ui-settings-card--action > .mi-ui-settings-entry-symbol + * {
  flex:1 1 auto !important;min-width:0 !important;
}
html #appScreen #settingsHubView .mi-ui-settings-card--action > :last-child:not(:first-child) {
  flex:0 0 auto !important;margin-left:auto !important;
}
html #appScreen #settingsHubView .mi-ui-settings-card--pending {
  display:flex !important;align-items:center !important;
  cursor:default !important;color:var(--mi-ui-settings-muted) !important;
  font-size:12px !important;line-height:1.45 !important;
  opacity:1 !important;
}
html #appScreen #settingsHubView .mi-ui-settings-card--pending::before {
  content:"";display:inline-block;flex:0 0 10px;
  width:10px;height:10px;margin-right:10px;
  border:1px solid var(--mi-ui-settings-symbol-border);
  border-radius:50%;background:var(--mi-ui-settings-symbol-bg);
}
html #appScreen #settingsHubView .mi-ui-settings-module-list {
  grid-column:1/-1 !important;display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:var(--mi-ui-settings-gap) !important;
}
/* Module entries consume the EXACT shared settings-card size and padding. */
html #appScreen #settingsHubView .mi-ui-settings-module-list > .mi-ui-settings-card {
  min-height:var(--mi-ui-settings-card-minheight) !important;
  padding:var(--mi-ui-settings-card-pad) !important;
}
/* Existing secondary module-search element stays in DOM for its controller,
   but the single GLOBAL category search owns visible module filtering. */
html #appScreen #settingsHubView .mi-six-category-options > .mi-module-search[hidden] {display:none !important;}
html #appScreen #settingsHubView .mi-six-category-options > .mi-settings-unavailable:not(.mi-ui-settings-card) {grid-column:1/-1 !important;}
/* Same visual treatment for overview category cards, keeping their 3-part content. */
html #appScreen #settingsHubView .mi-v2-settings-card.mi-ui-settings-card {
  display:flex !important;align-items:center !important;gap:12px !important;
  min-height:92px !important;
  padding:14px 16px !important;
  background:var(--mi-ui-settings-card-bg) !important;
  border:1px solid var(--mi-ui-settings-edge) !important;
  border-radius:var(--mi-ui-settings-radius) !important;
  color:var(--mi-ui-settings-ink) !important;
  box-shadow:var(--mi-ui-shadow-card) !important;
}
html #appScreen #settingsHubView .mi-v2-settings-card.mi-ui-settings-card .mi-v2-cat-symbol {
  flex:0 0 39px !important;width:39px !important;height:39px !important;
  color:var(--mi-palette-accent,#2869dc) !important;
}
@media (hover:hover) and (pointer:fine) {
  html #appScreen #settingsHubView .mi-ui-settings-card--action:hover,
  html #appScreen #settingsHubView .mi-v2-settings-card.mi-ui-settings-card:hover,
  html #appScreen #settingsHubView .mi-pro-card.mi-ui-settings-card:not(.mi-v6-open):hover {
    border-color:var(--mi-palette-accent,#2869dc) !important;
    box-shadow:0 6px 18px rgba(var(--mi-palette-rgb,40,105,220),.12) !important;
    background:var(--mi-ui-settings-card-bg) !important;
  }
}
/* Uniform titlebar spacing across Settings, no negative top offsets. */
html #appScreen #settingsHubView .mi-v2-category-page {
  box-sizing:border-box !important;min-width:0 !important;max-width:none !important;
  width:100% !important;margin-top:0 !important;padding-top:0 !important;
}
html #appScreen #settingsHubView .mi-appearance-live-overview .mi-pro-card:not(.mi-v6-open) {
  grid-column:span 6 !important;
}

/* State logic must not be changed by generic card flex/grid selectors. */
html #appScreen #settingsHubView .mi-ui-settings-card[hidden],
html #appScreen #settingsHubView .mi-six-category-options > [hidden] {display:none !important;}
html #appScreen #settingsHubView.mi-v2-category-open .mi-hub-heading,
html #appScreen #settingsHubView.mi-v2-category-open .mi-hub-search-area {display:none !important;}
@media (max-width:760px) {
  html #appScreen #settingsHubView .mi-ui-settings-banner {
    gap:9px !important;min-height:75px !important;padding:11px 12px !important;
  }
  html #appScreen #settingsHubView .mi-ui-settings-banner .mi-ui-settings-copy :is(h1,h2) {
    font-size:clamp(17px,4.2vw,21px) !important;
  }
  html #appScreen #settingsHubView .mi-ui-settings-symbol {
    flex:0 0 35px !important;width:35px !important;height:35px !important;
    min-width:35px !important;min-height:35px !important;font-size:18px !important;
  }
  html #appScreen #settingsHubView .mi-ui-settings-banner .mi-ui-settings-copy :is(p,small) {font-size:11px !important;}
  html #appScreen #settingsHubView .mi-ui-settings-grid,
  html #appScreen #settingsHubView .mi-ui-settings-module-list {grid-template-columns:minmax(0,1fr) !important;}
  html #appScreen #settingsHubView .mi-ui-settings-card:not(.mi-v6-open) {min-height:74px !important;}
  html #appScreen #settingsHubView .mi-appearance-live-overview .mi-pro-card:not(.mi-v6-open) {
    grid-column:1/-1 !important;
  }
}
@media (max-width:420px) {
  html #appScreen #settingsHubView .mi-ui-settings-banner {
    flex-wrap:wrap !important;
  }
  html #appScreen#appScreen .mi-ui-settings-back {
    min-height:33px !important;padding:6px 9px !important;max-width:none !important;
  }
  html #appScreen #settingsHubView .mi-ui-settings-banner .mi-ui-settings-copy {flex:1 1 150px !important;}
}
@media (prefers-reduced-motion:reduce) {
  html #appScreen #settingsHubView .mi-ui-settings-card {transition:none !important;transform:none !important;}
}


/* =====================================================================
   MAHIN GLOBAL UI — V3 single-owner corrections
   Consolidates old per-page styling; NO old visual override blocks remain.
   Content and page-specific functional behaviors retain their original JS.
   ===================================================================== */
:root {
  --mi-ui-settings-page-offset: 0px;
  --mi-ui-settings-banner-gap: 16px;
  --mi-ui-settings-card-bg: #ffffff;
  --mi-ui-settings-gap: 12px;
}
html[data-mi-surface="glass"] {
  --mi-ui-settings-card-bg: rgba(255,255,255,.77);
}
html[data-theme="dark"],body[data-theme="dark"] {
  --mi-ui-settings-card-bg:#21334c;
}
/* Compatibility tokens are resolved HERE until the old search-result
   controller is migrated. This prevents undefined CSS variables after retiring
   the overview-only stylesheet, and keeps result cards palette-consistent. */
html #appScreen #settingsHubView {
  --mi-ov-ink:var(--mi-ui-settings-ink);
  --mi-ov-muted:var(--mi-ui-settings-muted);
  --mi-ov-border:var(--mi-ui-settings-edge);
  --mi-ov-strong:rgba(var(--mi-palette-rgb,40,105,220),.55);
  --mi-ov-card:var(--mi-ui-settings-card-bg);
  --mi-ov-hover:rgba(var(--mi-palette-rgb,40,105,220),.10);
  --mi-ov-shadow:var(--mi-ui-shadow-card);
}
/* All pages follow the exact same top-of-page layout contract. */
html #appScreen #settingsHubView.mi-v2-settings-ready {
  margin-top:0 !important;
  padding-top:0 !important;
}
html #appScreen #settingsHubView .mi-v2-settings-pages,
html #appScreen #settingsHubView .mi-v2-category-page {
  margin-top:0 !important;
  padding-top:var(--mi-ui-settings-page-offset) !important;
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
}
html #appScreen #settingsHubView .mi-ui-settings-banner {
  margin:0 0 var(--mi-ui-settings-banner-gap) !important;
}
/* In Appearance the search is INSIDE a grid cell. Unlike other pages it
   must not carry an extra 13px margin below itself: grid gap owns spacing. */
html #appScreen #settingsHubView #miV2SettingsPage_appearance .mi-appearance-live-container {
  margin-top:0 !important;padding-top:0 !important;
}
html #appScreen #settingsHubView #miV2SettingsPage_appearance .mi-appearance-live-overview.mi-v5-layout {
  column-gap:var(--mi-ui-settings-gap) !important;
  row-gap:var(--mi-ui-settings-gap) !important;
}
html #appScreen #settingsHubView #miV2SettingsPage_appearance .mi-ui-settings-search {
  margin-bottom:0 !important;
}
/* Do not create a duplicate search surface around the real Overview bar. */
html #appScreen #settingsHubView:not(.mi-v2-category-open) .mi-hub-search-area {
  box-sizing:border-box !important;
  display:block !important;
  width:100% !important;height:auto !important;min-height:0 !important;
  margin:0 !important;padding:0 !important;
  border:0 !important;border-radius:0 !important;
  background:transparent !important;background-image:none !important;
  box-shadow:none !important;
}
/* The only search bar surface is the actual inner searchbar. */
html #appScreen #settingsHubView:not(.mi-v2-category-open) .mi-hub-searchbar.mi-ui-settings-search {
  margin-bottom:13px !important;
}
/* Remove legacy nested search input borders while retaining the live events. */
html #appScreen #settingsHubView .mi-ui-settings-search input[type="search"],
html #appScreen #settingsHubView .mi-ui-settings-search input[type="search"]:focus-visible {
  appearance:none !important;-webkit-appearance:none !important;
  outline:none !important;border:0 !important;border-radius:0 !important;
  background:transparent !important;background-image:none !important;
  box-shadow:none !important;
}
html #appScreen #settingsHubView .mi-ui-settings-search :is(.mi-hub-search-clear,.mi-six-category-clear) {
  flex:0 0 28px;display:inline-flex;align-items:center;justify-content:center;
  width:28px;height:28px;border:0;border-radius:8px;
  background:transparent;color:var(--mi-palette-accent,#2869dc);cursor:pointer;
}
html #appScreen #settingsHubView .mi-ui-settings-search :is(.mi-hub-search-clear,.mi-six-category-clear)[hidden] {
  display:none !important;
}
html #appScreen #settingsHubView .mi-ui-settings-search .mi-unified-search-hint {
  display:inline-grid !important;place-items:center !important;
  width:24px !important;height:24px !important;flex:0 0 24px !important;
  padding:0 !important;
}
html #appScreen #settingsHubView .mi-ui-settings-search:has(input:not(:placeholder-shown)) .mi-unified-search-hint {
  display:none !important;
}
/* The overview deck and all seven inner grids use the same card gap. */
html #appScreen #settingsHubView.mi-v2-settings-ready:not(.mi-v2-category-open) .mi-v2-settings-deck {
  display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:var(--mi-ui-settings-gap) !important;margin:0 0 20px !important;
  align-items:stretch !important;
}
/* One card: never allow a legacy overview gradient to override solid cards. */
html #appScreen #settingsHubView .mi-v2-settings-card.mi-ui-settings-card,
html #appScreen #settingsHubView .mi-ui-settings-card:not(.mi-v6-open) {
  background:var(--mi-ui-settings-card-bg) !important;
  background-image:none !important;
  border:1px solid var(--mi-ui-settings-edge) !important;
  color:var(--mi-ui-settings-ink) !important;
  box-shadow:var(--mi-ui-shadow-card) !important;
}
html #appScreen #settingsHubView .mi-ui-settings-card:not(.mi-v6-open) :is(strong,h3,.mi-pro-card-title) {
  color:var(--mi-ui-settings-ink) !important;
}
html #appScreen #settingsHubView .mi-ui-settings-card:not(.mi-v6-open) :is(small,.mi-v2-card-text small) {
  color:var(--mi-ui-settings-muted) !important;
}
html #appScreen #settingsHubView .mi-ui-settings-card:not(.mi-v6-open) .mi-ui-settings-symbol {
  background:var(--mi-ui-settings-symbol-bg) !important;
  border:1px solid var(--mi-ui-settings-symbol-border) !important;
  color:var(--mi-palette-accent,#2869dc) !important;
}
html #appScreen #settingsHubView .mi-ui-settings-card:not(.mi-v6-open) .mi-pro-card-title {
  font-size:14px !important;line-height:1.35 !important;margin:0 !important;font-weight:750 !important;
}
/* The real All Settings back button uses shared button behavior without rebuilding nodes. */
html #appScreen#appScreen .mi-ui-settings-back {background:var(--mi-ui-settings-card-bg) !important;}
/* Header nav uses the same palette/shape/focus tokens, and only ONE selected item. */
html #appScreen :is(#miSettingsHeaderTabs,#miSalesHeaderTabs) .mi-v2-header-link {
  box-sizing:border-box;display:inline-flex;align-items:center;
  flex:0 0 auto;gap:6px;min-height:32px;padding:6px 9px;
  border:1px solid transparent;border-radius:9px;
  color:var(--mi-ui-ink);background:transparent;
  font:inherit;font-size:12px;white-space:nowrap;cursor:pointer;
  transition:background-color .18s ease,border-color .18s ease,color .18s ease;
}
html #appScreen :is(#miSettingsHeaderTabs,#miSalesHeaderTabs) .mi-v2-header-link.mi-v2-current {
  background:rgba(var(--mi-palette-rgb,40,105,220),.15) !important;
  border-color:rgba(var(--mi-palette-rgb,40,105,220),.42) !important;
  color:var(--mi-palette-accent,#2869dc) !important;
}
@media(hover:hover) and (pointer:fine) {
  html #appScreen :is(#miSettingsHeaderTabs,#miSalesHeaderTabs) .mi-v2-header-link:not(.mi-v2-current):not(:disabled):hover {
    background:rgba(var(--mi-palette-rgb,40,105,220),.065) !important;
    border-color:rgba(var(--mi-palette-rgb,40,105,220),.13) !important;
    transform:none !important;
  }
  html #appScreen #settingsHubView .mi-ui-settings-card:not(.mi-v6-open):hover {
    background:var(--mi-ui-settings-card-bg) !important;
  }
}
html #appScreen :is(#miSettingsHeaderTabs,#miSalesHeaderTabs) .mi-v2-header-link:focus-visible {
  outline:2px solid var(--mi-palette-accent,#2869dc) !important;outline-offset:2px !important;
}
html[data-theme="dark"] #appScreen :is(#miSettingsHeaderTabs,#miSalesHeaderTabs) .mi-v2-header-link,
html body[data-theme="dark"] #appScreen :is(#miSettingsHeaderTabs,#miSalesHeaderTabs) .mi-v2-header-link {
  color:var(--mi-ui-settings-ink);
}
/* State preservation once bespoke visual skins have been removed. */
html #appScreen #settingsHubView.mi-v2-category-open .mi-hub-search-area,
html #appScreen #settingsHubView.mi-v2-category-open .mi-hub-heading,
html #appScreen #settingsHubView.mi-v2-category-open .mi-hub-section-heading,
html #appScreen #settingsHubView.mi-v2-settings-ready:not(.mi-v2-category-open) .mi-hub-section-heading,
html #appScreen #settingsHubView .mi-ui-settings-card[hidden],
html #appScreen #settingsHubView .mi-v2-category-page[hidden] {
  display:none !important;
}
@media(max-width:800px) {
  html #appScreen :is(#miSettingsHeaderTabs,#miSalesHeaderTabs) .mi-v2-header-link {font-size:11px;padding-inline:8px;}
}
@media(max-width:760px) {
  html #appScreen #settingsHubView.mi-v2-settings-ready:not(.mi-v2-category-open) .mi-v2-settings-deck {
    grid-template-columns:minmax(0,1fr) !important;
  }
  html #appScreen #settingsHubView .mi-appearance-live-overview.mi-v5-layout .mi-pro-card:not(.mi-v6-open) {
    grid-column:1/-1 !important;
  }
}
@media(prefers-reduced-motion:reduce) {
  html #appScreen :is(#miSettingsHeaderTabs,#miSalesHeaderTabs) .mi-v2-header-link {transition:none !important;transform:none !important;}
}

/* MAHIN_UI_SEARCH_AND_MODULE_CONTRACT_V4
   One shared search appearance, all pages. Old Appearance-only rules retired.
   One card surface/min-height/spacing for module options.
*/
:root {
  --mi-ui-search-height:50px;
  --mi-ui-search-radius:15px;
  --mi-ui-search-bg:rgba(255,255,255,.76);
  --mi-ui-search-bg-hover:rgba(255,255,255,.88);
  --mi-ui-search-bg-focus:rgba(255,255,255,.94);
  --mi-ui-search-text:#24538e;
  --mi-ui-search-placeholder:#7790ae;
}
html[data-theme="dark"],body[data-theme="dark"] {
  --mi-ui-search-bg:rgba(30,48,74,.82);
  --mi-ui-search-bg-hover:rgba(35,56,86,.89);
  --mi-ui-search-bg-focus:rgba(35,58,91,.94);
  --mi-ui-search-text:#edf5ff;
  --mi-ui-search-placeholder:#9db2cc;
}
html[data-mi-surface="glass"] {
  --mi-ui-search-bg:rgba(255,255,255,.40);
  --mi-ui-search-bg-hover:rgba(255,255,255,.56);
  --mi-ui-search-bg-focus:rgba(255,255,255,.67);
}
html[data-mi-surface="glass"][data-theme="dark"],
html[data-mi-surface="glass"] body[data-theme="dark"] {
  --mi-ui-search-bg:rgba(35,56,87,.48);
  --mi-ui-search-bg-hover:rgba(35,56,87,.68);
  --mi-ui-search-bg-focus:rgba(35,58,91,.78);
}
html #appScreen #settingsHubView .mi-ui-settings-search {
  display:flex !important;align-items:center !important;
  gap:12px !important;width:100% !important;min-width:0 !important;
  height:var(--mi-ui-search-height) !important;
  min-height:var(--mi-ui-search-height) !important;
  padding:5px 15px !important;
  border:1px solid rgba(var(--mi-palette-rgb,40,105,220),.42) !important;
  border-radius:var(--mi-ui-search-radius) !important;
  background:var(--mi-ui-search-bg) !important;
  background-image:none !important;
  color:var(--mi-ui-search-text) !important;
  box-shadow:0 3px 12px rgba(24,66,130,.055),inset 0 1px 0 rgba(255,255,255,.45) !important;
  transition:border-color .18s ease,background-color .18s ease,box-shadow .18s ease !important;
}
@media(hover:hover) and (pointer:fine) {
  html #appScreen #settingsHubView .mi-ui-settings-search:hover {
    border-color:rgba(var(--mi-palette-rgb,40,105,220),.68) !important;
    background:var(--mi-ui-search-bg-hover) !important;
    box-shadow:0 7px 22px rgba(var(--mi-palette-rgb,40,105,220),.10) !important;
  }
}
html #appScreen #settingsHubView .mi-ui-settings-search:focus-within {
  border-color:var(--mi-palette-accent,#2869dc) !important;
  background:var(--mi-ui-search-bg-focus) !important;
  box-shadow:0 0 0 3px rgba(var(--mi-palette-rgb,40,105,220),.15),0 5px 14px rgba(var(--mi-palette-rgb,40,105,220),.075) !important;
}
html #appScreen #settingsHubView .mi-ui-settings-search input[type="search"] {
  color:var(--mi-ui-search-text) !important;
  font:inherit !important;font-size:14px !important;
}
html #appScreen #settingsHubView .mi-ui-settings-search input[type="search"]::placeholder {
  color:var(--mi-ui-search-placeholder) !important;opacity:1 !important;
}
/* Real magnifier SVG; prevent the black filled-circle bug. */
html #appScreen #settingsHubView .mi-ui-settings-search .mi-ui-search-icon {
  display:inline-grid !important;place-items:center !important;
  flex:0 0 20px !important;width:20px !important;height:20px !important;
  color:var(--mi-palette-accent,#2869dc) !important;
  font-size:0 !important;line-height:0 !important;
}
html #appScreen #settingsHubView .mi-ui-settings-search .mi-ui-search-icon svg {
  display:block !important;width:19px !important;height:19px !important;
  fill:none !important;stroke:currentColor !important;
  stroke-width:1.8 !important;stroke-linecap:round !important;
  stroke-linejoin:round !important;
}
html #appScreen #settingsHubView .mi-ui-settings-search .mi-ui-search-icon svg * {
  fill:none !important;stroke:inherit !important;
}
/* The overview input is inside its existing label, not a new search widget. */
html #appScreen #settingsHubView .mi-ui-settings-search .mi-hub-search-label {
  flex:1 1 auto !important;min-width:0 !important;
}
/* Preserve the same compact shortcut hint across the three search implementations. */
html #appScreen #settingsHubView .mi-ui-settings-search .mi-unified-search-hint {
  flex:0 0 24px !important;display:grid !important;place-items:center !important;
  width:24px !important;height:24px !important;
  margin-left:auto !important;
  color:var(--mi-palette-accent,#2869dc) !important;
}
/* Global clear buttons keep existing handlers. */
html #appScreen #settingsHubView .mi-ui-settings-search :is(.mi-pro-clear,.mi-hub-search-clear,.mi-six-category-clear) {
  display:inline-grid !important;place-items:center !important;
  flex:0 0 28px !important;width:28px !important;height:28px !important;
  padding:0 !important;margin-left:0 !important;
  border:0 !important;border-radius:8px !important;
  background:transparent !important;color:var(--mi-palette-accent,#2869dc) !important;
  font-size:20px !important;cursor:pointer !important;
}
html #appScreen #settingsHubView .mi-ui-settings-search :is(.mi-pro-clear,.mi-hub-search-clear,.mi-six-category-clear)[hidden] {display:none !important;}
html #appScreen #settingsHubView .mi-ui-settings-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance:none;appearance:none;display:none;
}
/* All module placeholders are genuine shared Settings cards, not small pill rows. */
html #appScreen #settingsHubView .mi-ui-settings-module-list > .mi-ui-settings-module-item {
  box-sizing:border-box !important;
  display:flex !important;align-items:center !important;gap:12px !important;
  min-height:var(--mi-ui-settings-card-minheight) !important;
  padding:var(--mi-ui-settings-card-pad) !important;
  border-radius:var(--mi-ui-settings-radius) !important;
  background:var(--mi-ui-settings-card-bg) !important;
  font-size:13px !important;line-height:1.4 !important;
  color:var(--mi-ui-settings-ink) !important;
}
html #appScreen #settingsHubView .mi-ui-settings-module-list > .mi-ui-settings-module-item::before,
html #appScreen #settingsHubView .mi-ui-settings-card--pending.mi-module-settings-note::before {
  content:none !important;display:none !important;
}
html #appScreen #settingsHubView .mi-ui-settings-module-list .mi-ui-settings-symbol,
html #appScreen #settingsHubView .mi-module-settings-note .mi-ui-settings-symbol {
  flex:0 0 35px !important;width:35px !important;height:35px !important;
}
html #appScreen #settingsHubView .mi-ui-settings-module-list > .mi-ui-settings-module-item[hidden] {
  display:none !important;
}
html #appScreen #settingsHubView .mi-module-settings-note {
  grid-column:1/-1 !important;min-height:70px !important;
}
@media(max-width:600px) {
  html #appScreen #settingsHubView .mi-ui-settings-search {
    --mi-ui-search-height:46px;--mi-ui-search-radius:12px;
    gap:9px !important;padding-inline:12px !important;
  }
  html #appScreen #settingsHubView .mi-ui-settings-module-list > .mi-ui-settings-module-item {
    min-height:74px !important;
  }
}
@media(prefers-reduced-motion:reduce) {
  html #appScreen #settingsHubView .mi-ui-settings-search {transition:none !important;}
}
/* MAHIN_UI_SEARCH_AND_MODULE_CONTRACT_V4_END */

/* ===================================================================
   SINGLE GLOBAL VISUAL OWNER
   Theme / palette / surface / preset -> shared components and pages.
   Local feature styles above this contract may manage content/animation,
   but not define a second palette or a second shared card/search design.
   =================================================================== */
:root {
  --mi-global-accent:var(--mi-palette-accent,#2869dc);
  --mi-global-accent-rgb:var(--mi-palette-rgb,40,105,220);
  --mi-global-foreground:var(--text,#172b49);
  --mi-global-subtle:var(--muted,#65758f);
  --mi-global-card:var(--surface,#ffffff);
  --mi-global-line:color-mix(in srgb,var(--border,#d4ddec) 72%,var(--mi-global-accent) 28%);
  --mi-global-radius:15px;
  --mi-global-control-radius:12px;
  --mi-global-shadow:0 4px 16px rgba(23,57,103,.065);
  --mi-global-blur:none;
  --mi-global-background:var(--mi-global-card);
  --mi-global-search-height:50px;
  --mi-global-tile:rgba(var(--mi-global-accent-rgb),.105);
  --mi-ui-radius-card:var(--mi-global-radius);
  --mi-ui-radius-titlebar:var(--mi-global-radius);
  --mi-ui-radius-control:var(--mi-global-control-radius);
  --mi-ui-shadow-card:var(--mi-global-shadow);
  --mi-ui-accent:var(--mi-global-accent);
  --mi-ui-surface:var(--mi-global-background);
  --mi-ui-border:var(--mi-global-line);
}
html[data-theme="dark"] {
  --mi-global-card:#1e3048;
  --mi-global-foreground:#eaf2ff;
  --mi-global-subtle:#bbcae0;
  --mi-global-line:rgba(146,170,202,.34);
  --mi-global-shadow:0 8px 24px rgba(3,12,28,.22);
  --mi-global-tile:rgba(var(--mi-global-accent-rgb),.23);
}
/* Independent design presets. None is deliberately low-decoration, not broken layout. */
html[data-mi-design="minimal"] {
  --mi-global-radius:9px;
  --mi-global-control-radius:8px;
  --mi-global-shadow:none;
}
html[data-mi-design="classic"] {
  --mi-global-radius:5px;
  --mi-global-control-radius:5px;
  --mi-global-shadow:0 2px 5px rgba(24,47,81,.08);
}
html[data-mi-design="none"] {
  --mi-global-radius:0px;
  --mi-global-control-radius:0px;
  --mi-global-shadow:none;
  --mi-global-tile:transparent;
}
/* Solid, frosted glass and transparent are independently selectable. */
html[data-mi-surface="solid"] {--mi-global-background:var(--mi-global-card);--mi-global-blur:none;}
html[data-mi-surface="glass"] {
  --mi-global-background:rgba(244,249,255,.65);
  --mi-global-blur:blur(18px) saturate(150%);
}
html[data-theme="dark"][data-mi-surface="glass"] {
  --mi-global-background:rgba(25,43,69,.70);
}
html[data-mi-surface="transparent"] {
  --mi-global-background:rgba(240,247,255,.18);
  --mi-global-blur:none;
}
html[data-theme="dark"][data-mi-surface="transparent"] {
  --mi-global-background:rgba(18,34,56,.24);
}
/* Same visual token for Settings overview, appearance and all categories. */
html #appScreen :is(.mi-ui-settings-card,.mi-ui-card,.mi-pro-card,.mi-hub-card,.mi-six-category-card,.mi-v2-settings-card) {
  border:1px solid var(--mi-global-line) !important;
  border-radius:var(--mi-global-radius) !important;
  background:var(--mi-global-background) !important;
  color:var(--mi-global-foreground) !important;
  box-shadow:var(--mi-global-shadow) !important;
  -webkit-backdrop-filter:var(--mi-global-blur);
  backdrop-filter:var(--mi-global-blur);
}
html #appScreen :is(.mi-ui-settings-banner,.mi-ui-titlebar--banner,.mi-v5-intro,.mi-six-category-banner,.mi-hub-hero) {
  border-color:var(--mi-global-line) !important;
  border-radius:var(--mi-ui-radius-titlebar) !important;
  background:var(--mi-global-background) !important;
  color:var(--mi-global-foreground) !important;
  box-shadow:var(--mi-global-shadow) !important;
  -webkit-backdrop-filter:var(--mi-global-blur);
  backdrop-filter:var(--mi-global-blur);
}
html #appScreen :is(.mi-ui-settings-symbol,.mi-pro-icon,.mi-hub-card-icon,.mi-six-category-icon) {
  color:var(--mi-global-accent) !important;
  background-color:var(--mi-global-tile) !important;
  border-color:rgba(var(--mi-global-accent-rgb),.22) !important;
}
html #appScreen :is(.mi-ui-search,.mi-ui-settings-search,.mi-pro-searchbar,.mi-hub-searchbar,.mi-six-category-search) {
  box-sizing:border-box !important;
  min-height:var(--mi-global-search-height) !important;
  border:1px solid var(--mi-global-line) !important;
  border-radius:var(--mi-global-control-radius) !important;
  background:var(--mi-global-background) !important;
  color:var(--mi-global-foreground) !important;
  -webkit-backdrop-filter:var(--mi-global-blur);
  backdrop-filter:var(--mi-global-blur);
}
html #appScreen :is(.mi-ui-search,.mi-ui-settings-search,.mi-pro-searchbar,.mi-hub-searchbar,.mi-six-category-search):focus-within {
  border-color:var(--mi-global-accent) !important;
  box-shadow:0 0 0 3px rgba(var(--mi-global-accent-rgb),.12) !important;
}
html #appScreen :is(.mi-pro-loupe,.mi-hub-search-icon,.mi-six-search-icon) svg,
html #appScreen :is(.mi-pro-loupe,.mi-hub-search-icon,.mi-six-search-icon) {
  color:var(--mi-global-accent) !important;
}
html #appScreen :is(.mi-hub-search-icon,.mi-six-search-icon) svg {
  fill:none !important;
  stroke:currentColor !important;
  stroke-width:1.8px !important;
  stroke-linecap:round !important;
  stroke-linejoin:round !important;
}
html #appScreen :is(.mi-ui-button,.mi-ui-settings-back,.mi-ui-settings-button,.mi-nav-parent,.mi-settings-home-trigger) {
  border-radius:var(--mi-global-control-radius) !important;
}
html #appScreen :is(.mi-ui-settings-back,.mi-ui-settings-button,.mi-settings-home-trigger) {
  color:var(--mi-global-accent) !important;
  border-color:var(--mi-global-line) !important;
}
html #appScreen :is(.mi-ui-settings-back,.mi-ui-settings-button,.mi-settings-home-trigger):hover {
  background:var(--mi-global-tile) !important;
}
/* Global color affects active navigation, icon tiles, buttons and focus. */
html[data-mi-palette] #appScreen :is(#sidebar,.topbar) :is(.active,[aria-current="page"],button:focus-visible) {
  --focus-ring:var(--mi-global-accent);
}
html #appScreen :is(.mi-hub-card,.mi-pro-card,.mi-v2-settings-card,.mi-six-category-card,.mi-ui-settings-card):focus-visible {
  outline:2px solid var(--mi-global-accent) !important;
  outline-offset:2px;
}
html #appScreen :is(.mi-surface-option,.mi-palette-choice,.mi-design-choice):focus-visible {
  outline:2px solid var(--mi-global-accent) !important;
  outline-offset:2px;
}
/* New controls live IN the current Color Theme card, not in a duplicate panel. */
#appScreen #miUiDesignControls {
  margin-top:16px;
  border-top:1px solid var(--mi-global-line);
  padding-top:15px;
  color:var(--mi-global-foreground);
}
#appScreen .mi-design-heading {display:flex;flex-wrap:wrap;gap:4px 12px;justify-content:space-between;align-items:baseline;margin-bottom:10px;}
#appScreen .mi-design-heading strong {font-size:14px;}
#appScreen .mi-design-heading small {font-size:12px;color:var(--mi-global-subtle);}
#appScreen .mi-design-presets {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;}
#appScreen .mi-design-choice {display:flex;justify-content:center;align-items:center;min-height:44px;padding:9px 8px;min-width:0;border:1px solid var(--mi-global-line);border-radius:var(--mi-global-control-radius);background:var(--mi-global-background);color:var(--mi-global-foreground);font:inherit;font-size:12px;font-weight:650;cursor:pointer;}
#appScreen .mi-design-choice[aria-pressed="true"] {border-color:var(--mi-global-accent);box-shadow:inset 0 0 0 1px var(--mi-global-accent);color:var(--mi-global-accent);}
#appScreen .mi-design-color-row {display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:14px;}
#appScreen .mi-design-color-row label {font-size:13px;font-weight:650;}
#appScreen .mi-design-color-input {width:48px;height:39px;min-width:48px;padding:3px;border:1px solid var(--mi-global-line);border-radius:var(--mi-global-control-radius);background:var(--mi-global-background);cursor:pointer;}
#appScreen .mi-design-color-hex {width:118px;max-width:36vw;min-height:39px;border:1px solid var(--mi-global-line);border-radius:var(--mi-global-control-radius);padding:8px 9px;background:var(--mi-global-background);color:var(--mi-global-foreground);font:inherit;}
#appScreen .mi-design-color-reset {min-height:39px;padding:7px 12px;border:1px solid var(--mi-global-line);border-radius:var(--mi-global-control-radius);background:var(--mi-global-background);color:var(--mi-global-accent);font:inherit;cursor:pointer;}
#appScreen .mi-design-hint {display:block;color:var(--mi-global-subtle);font-size:11px;line-height:1.5;margin-top:8px;}
#appScreen .mi-surface-options {grid-template-columns:repeat(3,minmax(0,1fr));}
#appScreen .mi-surface-option {min-width:0;padding:10px 8px;border-radius:var(--mi-global-control-radius);}
#appScreen .mi-surface-option strong {font-size:12px;}
#appScreen .mi-surface-option small {font-size:11px;}
#appScreen .mi-surface-option[data-mode="transparent"] .mi-surface-preview {
  background:repeating-linear-gradient(45deg,#c9d5e5 0 5px,#f9fbff 5px 10px);box-shadow:inset 0 0 0 5px rgba(255,255,255,.13);
}
#appScreen .mi-login-language-actions {display:flex;justify-content:flex-end;margin:12px 0;}
@media(max-width:700px) {
  #appScreen .mi-design-presets {grid-template-columns:repeat(2,minmax(0,1fr));}
  #appScreen .mi-surface-options {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:420px) {
  #appScreen .mi-design-color-row {gap:8px;}
  #appScreen .mi-design-color-hex {width:108px;}
}
@media(prefers-reduced-motion:reduce) {
  #appScreen :is(.mi-ui-card,.mi-design-choice,.mi-surface-option) {transition:none !important;animation:none !important;}
}

/* MAHIN_SHARED_SIDEBAR_ALIGNMENT_V1_START */
/* Shared compact navigation alignment. No login, database or routing changes. */
@media (min-width: 751px) {
  html[data-mi-palette] #appScreen.mi-settings-compact-mode:not(.mi-nav-expanded) #sidebar .mi-settings-parent-row {
    position: relative !important;
    display: block !important;
  }
  /* Remove old right padding that displaced the centered gear. */
  html[data-mi-palette] #appScreen.mi-settings-compact-mode:not(.mi-nav-expanded) #sidebar .mi-settings-parent-row > #settingsHomeNav {
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
  }
  html[data-mi-palette] #appScreen.mi-settings-compact-mode:not(.mi-nav-expanded) #sidebar #settingsHomeNav > .mi-polished-icon {
    display: block !important;
    flex: 0 0 19px !important;
    width: 19px !important;
    height: 19px !important;
    margin: 0 !important;
    transform: none !important;
  }
  /* Inactive sections must not display an expansion arrow. */
  html[data-mi-palette] #appScreen.mi-settings-compact-mode:not(.mi-nav-expanded) #sidebar .mi-settings-parent-row > #settingsGroupToggle:not([data-mi-context-active="1"]) {
    display: none !important;
  }
  /* Small independent arrow control; does not consume icon layout width. */
  html[data-mi-palette] #appScreen.mi-settings-compact-mode:not(.mi-nav-expanded) #sidebar .mi-settings-parent-row > #settingsGroupToggle[data-mi-context-active="1"] {
    box-sizing: border-box !important;
    display: grid !important;
    place-items: center !important;
    position: absolute !important;
    top: 50% !important;
    right: 2px !important;
    bottom: auto !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    width: 17px !important;
    min-width: 17px !important;
    height: 17px !important;
    min-height: 17px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent) !important;
    border-radius: 50% !important;
    background: var(--mi-zone-card, #fff) !important;
    color: inherit !important;
    box-shadow: 0 1px 3px rgba(20, 36, 72, .10) !important;
    z-index: 5 !important;
  }
  html[data-mi-palette] #appScreen.mi-settings-compact-mode:not(.mi-nav-expanded) #sidebar .mi-settings-parent-row > #settingsGroupToggle[data-mi-context-active="1"]::after {
    content: "" !important;
    display: block !important;
    width: 5px !important;
    height: 5px !important;
    margin-top: -2px !important;
    border: 0 !important;
    border-right: 1.5px solid currentColor !important;
    border-bottom: 1.5px solid currentColor !important;
    transform: rotate(45deg) !important;
  }
  html[data-mi-palette] #appScreen.mi-settings-compact-mode:not(.mi-nav-expanded) #sidebar .mi-settings-parent-row > #settingsGroupToggle[data-mi-context-active="1"][aria-expanded="true"]::after {
    margin-top: 2px !important;
    transform: rotate(225deg) !important;
  }
}
/* MAHIN_SHARED_SIDEBAR_ALIGNMENT_V1_END */

/* MAHIN_GLOBAL_SCROLLBAR_START */

:root {
    --mi-scroll-size: 7px;
    --mi-scroll-thumb:
        rgba(var(--mi-palette-rgb, 40, 105, 220), .55);
    --mi-scroll-hover:
        rgba(var(--mi-palette-rgb, 40, 105, 220), .85);
}

/* All scrollable elements */
html,
body,
body * {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

/* Visible only during actual scrolling */
html.mi-is-scrolling,
body.mi-is-scrolling,
body .mi-is-scrolling {
    scrollbar-color:
        var(--mi-scroll-thumb) transparent;
}

/* Chromium and Safari */
::-webkit-scrollbar {
    width: var(--mi-scroll-size);
    height: var(--mi-scroll-size);
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 999px;
}

.mi-is-scrolling::-webkit-scrollbar-thumb {
    background: var(--mi-scroll-thumb);
    border-radius: 999px;
}

.mi-is-scrolling::-webkit-scrollbar-thumb:hover {
    background: var(--mi-scroll-hover);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Preserve intentionally hidden horizontal tabs */
#appScreen .mi-mobile-shortcuts-row,
#appScreen :is(#miSettingsHeaderTabs,#miSalesHeaderTabs) {
    scrollbar-width: none;
}

#appScreen .mi-mobile-shortcuts-row::-webkit-scrollbar,
#appScreen :is(#miSettingsHeaderTabs,#miSalesHeaderTabs)::-webkit-scrollbar {
    display: none;
}

/* MAHIN_GLOBAL_SCROLLBAR_END */

/* MAHIN_SHARED_LOOK_SECTION_STYLE_START */
/* Reusable section heading for Look & Feel controls. */

#appScreen .mi-look-section-intro {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0 0 14px;
    padding: 0;
    color: inherit;
}

#appScreen .mi-look-section-title {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 700;
    color: inherit;
}

#appScreen .mi-look-section-description {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--mi-global-subtle, #64748b);
}

@media (max-width: 750px) {
    #appScreen .mi-look-section-intro {
        margin-bottom: 12px;
    }
}
/* MAHIN_SHARED_LOOK_SECTION_STYLE_END */

/* Global palette + semantic color responsibilities moved to
   css/design/global-design-system.css and js/app/global-design-engine.js.
   This file now retains reusable layout/geometry and component contracts. */



/* MAHIN_CORNER_BANNER_GLOBAL_V1
   Shared component geometry, independent of color and surface mode.
   Circles/avatar/swatches keep their intentional round shape. */
:root {
  --mi-corner-card:var(--mi-global-radius,15px);
  --mi-corner-control:var(--mi-global-control-radius,12px);
  --mi-corner-banner:var(--mi-global-radius,15px);
}
html[data-mi-design] #appScreen :is(
  .mi-ui-settings-banner,.mi-ui-titlebar--banner,.mi-v5-intro,.mi-six-category-banner,.mi-hub-hero,
  .mi-ui-settings-card,.mi-ui-card,.mi-pro-card,.mi-hub-card,.mi-six-category-card,
  .mi-v2-settings-card,.mi-v2-settings-tile,.mi-v6-card,.mi-pro-dashboard,
  .mi-settings-parent-row,.mi-navigation-group,.mi-sidebar-footer
) {border-radius:var(--mi-corner-card)!important;}
html[data-mi-design] #appScreen :is(
  .mi-ui-settings-banner,.mi-ui-titlebar--banner,.mi-v5-intro,.mi-six-category-banner,.mi-hub-hero
) {border-radius:var(--mi-corner-banner)!important;}
html[data-mi-design] #appScreen :is(
  .mi-design-choice,.mi-surface-option,.mi-banner-style-choice,.mi-palette-choice,
  .mi-v2-settings-card,.mi-v2-settings-tile,
  .mi-ui-settings-button,.mi-ui-settings-back,
  .mi-ui-search,.mi-ui-settings-search,.mi-pro-searchbar,.mi-hub-searchbar,.mi-six-category-search,
  .mi-design-color-hex,.mi-design-color-input,.mi-design-color-reset,
  .nav-item,.mi-nav-parent,.mi-v2-sidebar-link,#settingsHomeNav,
  #settingsSubmenu button,#settingsSubmenu a,
  .mi-ui-button,.button,
  button:not([class*="avatar"]):not([class*="icon"]):not([class*="toggle"]):not([class*="circle"]):not([class*="round"]):not(.mi-palette-dropdown):not(.mi-global-shortcut-toggle):not(.mi-settings-chevron)
):not(.mi-avatar):not(.mi-polished-icon):not(.mi-palette-color):not(.mi-palette-dropdown) {
  border-radius:var(--mi-corner-control)!important;
}
html[data-mi-design] #appScreen :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),select,textarea) {
  border-radius:var(--mi-corner-control)!important;
}
/* Let the selected shape reach the nested shared settings layout. */
html[data-mi-design] #appScreen #settingsHubView .mi-ui-settings-banner {
  border-radius:var(--mi-corner-banner)!important;
}
/* Banner styles control decoration without altering transparency settings.
   The solid banner backgrounds use opaque colors; glass/transparent retain their surface contract. */
html[data-mi-banner-style] #appScreen :is(.mi-ui-settings-banner,.mi-ui-titlebar--banner,.mi-v5-intro,.mi-six-category-banner,.mi-hub-hero) {
  isolation:isolate!important;
  overflow:hidden!important;
}
html[data-mi-banner-style="plain"] #appScreen :is(.mi-ui-settings-banner,.mi-ui-titlebar--banner,.mi-v5-intro,.mi-six-category-banner,.mi-hub-hero)::after,
html[data-mi-banner-style="plain"] #appScreen :is(.mi-ui-settings-banner,.mi-ui-titlebar--banner,.mi-v5-intro,.mi-six-category-banner,.mi-hub-hero)::before {
  content:none!important;display:none!important;
}
html[data-mi-banner-style="glow"] #appScreen :is(.mi-ui-settings-banner,.mi-ui-titlebar--banner,.mi-v5-intro,.mi-six-category-banner,.mi-hub-hero)::after {
  content:""!important;display:block!important;position:absolute!important;
  width:35%;height:190%;top:-45%;right:-3%!important;left:auto!important;
  border:0!important;border-radius:50%!important;pointer-events:none!important;
  background:radial-gradient(ellipse,rgba(var(--mi-global-accent-rgb,40,105,220),.21),transparent 72%)!important;
  transform:none!important;z-index:0!important;
}
html[data-mi-banner-style="edge"] #appScreen :is(.mi-ui-settings-banner,.mi-ui-titlebar--banner,.mi-v5-intro,.mi-six-category-banner,.mi-hub-hero)::after {
  content:""!important;display:block!important;position:absolute!important;
  right:0!important;left:auto!important;top:0!important;bottom:0!important;
  width:6px!important;height:100%!important;border:0!important;
  border-radius:0!important;transform:none!important;
  background:var(--mi-global-accent,#2869dc)!important;pointer-events:none!important;z-index:0!important;
}
html[data-mi-banner-style="arc"] #appScreen :is(.mi-ui-settings-banner,.mi-ui-titlebar--banner,.mi-v5-intro,.mi-six-category-banner,.mi-hub-hero)::after {
  content:""!important;display:block!important;
  position:absolute!important;right:-38px!important;left:auto!important;
  top:-48px!important;width:205px!important;height:155px!important;
  border:23px solid rgba(var(--mi-global-accent-rgb,40,105,220),.09)!important;
  border-radius:50%!important;background:none!important;
  transform:rotate(-18deg)!important;pointer-events:none!important;z-index:0!important;
}
html[data-mi-banner-style] #appScreen :is(.mi-ui-settings-banner,.mi-ui-titlebar--banner,.mi-v5-intro,.mi-six-category-banner,.mi-hub-hero) > * {
  position:relative;z-index:1;
}
#appScreen .mi-banner-style-section {
  margin-top:16px;padding-top:16px;border-top:1px solid var(--mi-global-line,#d4ddec);
}
#appScreen .mi-banner-style-title {margin:0 0 4px;font-size:14px;font-weight:700;color:var(--mi-global-foreground,#172b49);}
#appScreen .mi-banner-style-help {margin:0 0 12px;font-size:12px;color:var(--mi-global-subtle,#65758f);}
#appScreen .mi-banner-style-options {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;}
#appScreen .mi-banner-style-choice {
  min-width:0;display:flex;flex-direction:column;align-items:stretch;gap:7px;
  padding:8px;border:1px solid var(--mi-global-line,#d4ddec);
  background:var(--mi-global-background,#fff);color:var(--mi-global-foreground,#172b49);
  font:inherit;font-size:12px;font-weight:600;cursor:pointer;
}
#appScreen .mi-banner-style-choice[aria-pressed="true"] {
  border-color:var(--mi-global-accent,#2869dc);outline:1px solid var(--mi-global-accent,#2869dc);
}
#appScreen .mi-banner-style-preview {
  position:relative;display:block;overflow:hidden;height:38px;
  border:1px solid var(--mi-global-line,#d4ddec);border-radius:var(--mi-corner-banner);
  background:var(--mi-global-card,#fff);
}
#appScreen .mi-banner-style-preview::after {content:"";position:absolute;pointer-events:none;}
#appScreen [data-banner-style="arc"] .mi-banner-style-preview::after {
  width:50px;height:46px;right:-12px;top:-14px;border:7px solid var(--mi-global-accent,#2869dc);border-radius:50%;opacity:.35;
}
#appScreen [data-banner-style="glow"] .mi-banner-style-preview::after {
  inset:0;background:radial-gradient(circle at 80% 30%,rgba(var(--mi-global-accent-rgb,40,105,220),.4),transparent 60%);
}
#appScreen [data-banner-style="edge"] .mi-banner-style-preview::after {right:0;top:0;width:5px;height:100%;background:var(--mi-global-accent,#2869dc);}
#appScreen .mi-banner-style-name {text-align:center;}
@media(max-width:580px){#appScreen .mi-banner-style-options{grid-template-columns:repeat(2,minmax(0,1fr));}}




/* MAHIN GLOBAL SETTINGS COMPONENT CONTRACT v2
   Single visual component contract shared by Business Profile, Settings panels,
   data lists, profile summaries and record dialogs. Component-specific CSS owns
   geometry only, never a second palette/surface/corner/contrast policy. */
#appScreen {
  --mi-settings-card-fill: var(--mi-ds-card-fill, var(--mi-ui-surface, var(--surface)));
  --mi-settings-card-ink: var(--mi-ds-card-ink, var(--mi-ui-ink, var(--text)));
  --mi-settings-card-edge: var(--mi-ds-edge, var(--mi-ui-border, var(--border)));
  --mi-settings-muted: var(--mi-ds-muted, var(--mi-ui-muted, var(--muted)));
  --mi-settings-control-fill: var(--mi-ds-input-fill, var(--surface));
  --mi-settings-control-radius: var(--mi-global-control-radius, var(--mi-ui-radius-control, 10px));
  --mi-settings-card-radius: var(--mi-global-radius, var(--mi-ui-radius-card, 14px));
  --mi-settings-gap: clamp(14px,1.8vw,20px);
}
#appScreen :is(.mi-ui-settings-surface,.branding-settings-card) {
  box-sizing:border-box;
  min-width:0;
  padding:clamp(19px,2.2vw,26px);
  border:1px solid var(--mi-settings-card-edge);
  border-radius:var(--mi-settings-card-radius);
  background:var(--mi-settings-card-fill);
  color:var(--mi-settings-card-ink);
  box-shadow:var(--mi-ui-shadow-card, var(--mi-ds-shadow,none));
}
#appScreen :is(.mi-ui-settings-surface,.branding-settings-card) :is(.muted,.mi-settings-muted) {
  color:var(--mi-settings-muted);
}
#appScreen :is(.mi-ui-settings-surface,.branding-settings-card) :is(h2,h3):first-child,
#appScreen .mi-ui-settings-surface .mi-record-head h3,
#appScreen .mi-ui-settings-surface .mi-settings-card-title {
  font-size:17px;
  line-height:1.35;
  margin:0 0 7px;
  font-weight:650;
}
#appScreen :is(.mi-ui-settings-fields,.mi-record-form-grid,.branding-settings-card) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea) {
  box-sizing:border-box;
  width:100%;
  min-height:42px;
  padding:10px 13px;
  border:1px solid var(--mi-settings-card-edge);
  border-radius:var(--mi-settings-control-radius);
  color:var(--mi-settings-card-ink);
  background:var(--mi-settings-control-fill);
  font:inherit;
  font-size:14px;
  line-height:1.5;
}
#appScreen :is(.mi-ui-settings-fields,.mi-record-form-grid) label:not(.mi-manage-check):not(.mi-record-check) {
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:0;
  font-size:13px;
  font-weight:600;
}
#appScreen :is(.mi-ui-settings-fields,.mi-record-form-grid,.branding-settings-card) :is(input,select,textarea,button):focus-visible {
  outline:2px solid var(--mi-ds-focus, var(--mi-ui-focus,var(--focus-ring)));
  outline-offset:2px;
}
#appScreen :is(.mi-ui-settings-fields,.mi-record-form-grid) :is(input,select,textarea):disabled {opacity:.65;cursor:not-allowed}
#appScreen :is(.mi-ui-settings-fields,.mi-record-form-grid) textarea {resize:vertical}
#appScreen :is(.mi-record-item,.mi-settings-fact) {
  background:var(--mi-settings-control-fill);
  border:1px solid var(--mi-settings-card-edge);
  color:var(--mi-settings-card-ink);
  border-radius:var(--mi-settings-card-radius);
}
#appScreen :is(.mi-record-item,.mi-settings-fact) :is(small,dt,.mi-record-meta) {color:var(--mi-settings-muted);opacity:1}
#appScreen :is(.mi-record-action,.mi-record-role-select,.mi-record-search input,.mi-record-filter select) {
  background:var(--mi-settings-control-fill);
  border:1px solid var(--mi-settings-card-edge);
  color:var(--mi-settings-card-ink);
  border-radius:var(--mi-settings-control-radius);
}
#appScreen :is(.mi-record-fields,.mi-record-field,.mi-record-badge) {border-color:var(--mi-settings-card-edge)}
#appScreen :is(.mi-record-item):hover {border-color:var(--mi-ds-accent,var(--mi-ui-accent,var(--mi-settings-card-edge)))}
@media(max-width:600px){#appScreen :is(.mi-ui-settings-surface,.branding-settings-card){padding:19px}}
