/* Mahin Inventory V2 — authoritative global presentation contract.
 * Color values are generated by global-design-engine.js, independent from
 * Light/Dark, palette, surface, visual motif and corner selections.
 * This file owns shared paint; existing component files own layout/behavior.
 * Every future component uses a base class plus optional semantic behavior.
 */
html[data-mi-ds-ready="true"] #appScreen#appScreen {
  --mi-ui-ink:var(--mi-ds-page-ink);
  --mi-ui-muted:var(--mi-ds-muted);
  --mi-ui-surface:var(--mi-ds-card-fill);
  --mi-ui-border:var(--mi-ds-edge);
  --mi-ui-accent:var(--mi-ds-accent);
  --mi-ui-shadow-card:var(--mi-ds-shadow);
  color:var(--mi-ds-page-ink);
}

/* Base components: visual properties inherited by composition, not copied to variants. */
html[data-mi-ds-ready] #appScreen#appScreen :is(.mi-ui-card,.ui-card) {
  box-sizing:border-box;
  background-color:var(--mi-ds-card-fill)!important;
  color:var(--mi-ds-card-ink)!important;
  border-color:var(--mi-ds-edge)!important;
  box-shadow:var(--mi-ds-shadow);
  -webkit-backdrop-filter:blur(var(--mi-ds-card-blur));
  backdrop-filter:blur(var(--mi-ds-card-blur));
  border-radius:var(--mi-global-radius,12px);
}
/* Reusable behaviors inherit .ui-card appearance; no second paint definition. */
#appScreen#appScreen :is(.ui-details-card,.mi-ui-details-card)[role="button"] {
  cursor:pointer;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
}
#appScreen#appScreen :is(.ui-details-card,.mi-ui-details-card)[role="button"]:focus-visible,
#appScreen#appScreen :is(.ui-collapsible-card,.mi-ui-collapsible-card)>summary:focus-visible {
  outline:2px solid var(--mi-ds-accent);outline-offset:2px;
}
#appScreen#appScreen :is(.ui-collapsible-card,.mi-ui-collapsible-card)>summary{cursor:pointer;}

html[data-mi-ds-ready] #appScreen#appScreen :is(.ui-button,.mi-ui-button) {
  background-color:var(--mi-ds-button-fill)!important;
  color:var(--mi-ds-page-ink)!important;
  border-color:var(--mi-ds-edge)!important;
  border-radius:var(--mi-global-control-radius,9px);
}
html[data-mi-ds-ready] #appScreen#appScreen :is(.ui-button,.mi-ui-button):hover {
  background-image:linear-gradient(var(--mi-ds-hover),var(--mi-ds-hover))!important;
}
html[data-mi-ds-ready] #appScreen#appScreen :is(.ui-search,.mi-ui-search,.ui-input,.mi-ui-input) {
  background-color:var(--mi-ds-input-fill)!important;
  color:var(--mi-ds-page-ink)!important;
  border-color:var(--mi-ds-edge)!important;
  border-radius:var(--mi-global-control-radius,9px);
}

/* Existing application components map to roles ONCE. They do not define palette/effect combinations. */
/*
 * MAHIN GLOBAL PAGE SURFACE
 * One continuous background across the whole workspace.
 * All modules share the same generated page color.
 */

html[data-mi-ds-ready] #appScreen#appScreen .main {
    background-color: var(--mi-ds-page, #f5f8fe) !important;
    background-image: var(--mi-ds-ornament-page, none) !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    color: var(--mi-ds-page-ink) !important;

    min-height: 100vh;
    min-height: 100dvh;
}

/*
 * Content and page containers no longer paint
 * separate rectangular background layers.
 */

html[data-mi-ds-ready] #appScreen#appScreen .main > .content,
html[data-mi-ds-ready] #appScreen#appScreen
.main > .content > :is(
    .mi-dashboard-screen,
    .mi-settings-workspace,
    .mi-module-page
) {
    background-color: transparent !important;
    background-image: none !important;
    color: var(--mi-ds-page-ink) !important;
}
html[data-mi-ds-ready] #appScreen#appScreen #sidebar {
  background-color:var(--mi-ds-sidebar-fill)!important;
  background-image:var(--mi-ds-ornament-sidebar,none)!important;
  color:var(--mi-ds-sidebar-ink)!important;
  -webkit-backdrop-filter:blur(var(--mi-ds-sidebar-blur))!important;
  backdrop-filter:blur(var(--mi-ds-sidebar-blur))!important;
}
html[data-mi-ds-ready] #appScreen#appScreen #sidebar :is(.nav-label,.mi-footer-label,.mi-sidebar-user-role) {
  color:var(--mi-ds-sidebar-ink)!important;
  opacity:.8;
}
html[data-mi-ds-ready] #appScreen#appScreen #sidebar :is(.nav-item,.mi-settings-home-trigger,.mi-nav-parent,.mi-v2-sidebar-link,.mi-footer-brand,.mi-footer-about) {
  color:var(--mi-ds-sidebar-ink)!important;
  border-color:var(--mi-ds-edge)!important;
  background-color:rgb(255 255 255 / .035)!important;
  background-image:none!important;
}
html[data-mi-ds-ready] #appScreen#appScreen #sidebar :is(.nav-item,.mi-settings-home-trigger,.mi-nav-parent,.mi-v2-sidebar-link,.mi-footer-about):is(:hover,.active,.mi-v2-current,[aria-current="page"]){
  background-color:var(--mi-ds-hover)!important;
  background-image:none!important;
  box-shadow:none!important;
}
html[data-mi-ds-ready] #appScreen#appScreen #sidebar :is(.mi-sidebar-footer) {
  background-color:var(--mi-ds-footer-fill)!important;
  background-image:none!important;
  -webkit-backdrop-filter:blur(var(--mi-ds-footer-blur))!important;
  backdrop-filter:blur(var(--mi-ds-footer-blur))!important;
}
html[data-mi-ds-ready] #appScreen#appScreen #topbar,
html[data-mi-ds-ready] #appScreen#appScreen .mi-topbar-shell {
  background-color:var(--mi-ds-header-fill)!important;
  background-image:var(--mi-ds-ornament-header,none)!important;
  color:var(--mi-ds-header-ink)!important;
  -webkit-backdrop-filter:blur(var(--mi-ds-header-blur))!important;
  backdrop-filter:blur(var(--mi-ds-header-blur))!important;
}
html[data-mi-ds-ready] #appScreen#appScreen #topbar :is(#headerBusiness,.mi-topbar-brand) {
  color:var(--mi-ds-header-ink)!important;
}
html[data-mi-ds-ready] #appScreen#appScreen #topbar :is(button,.button,[role="button"]),
html[data-mi-ds-ready] #appScreen#appScreen .mi-topbar-shell :is(button,.button,[role="button"]) {
  background-color:var(--mi-ds-header-button-fill)!important;
  background-image:none!important;
  color:var(--mi-ds-header-button-ink)!important;
  border-color:var(--mi-ds-header-button-border)!important;
  -webkit-backdrop-filter:blur(var(--mi-ds-button-blur))!important;
  backdrop-filter:blur(var(--mi-ds-button-blur))!important;
}
html[data-mi-ds-ready] #appScreen#appScreen #topbar :is(button,.button):hover,
html[data-mi-ds-ready] #appScreen#appScreen .mi-topbar-shell :is(button,.button):hover {
  background-image:linear-gradient(var(--mi-ds-hover),var(--mi-ds-hover))!important;
}
html[data-mi-ds-ready] #appScreen#appScreen #moduleTabs :is(button,.button,.active,[aria-selected="true"]) {
  border-color:var(--mi-ds-edge)!important;
}

/* Header & title banners are different visual roles, even if both are rectangular. */
html[data-mi-ds-ready] #appScreen#appScreen :is(.mi-ui-settings-banner,.mi-ui-titlebar--banner,.mi-v5-intro,.mi-six-category-banner,.mi-hub-hero,.mi-v2-page-banner) {
  background-color:var(--mi-ds-banner-fill)!important;
  background-image:var(--mi-ds-ornament-banner,none)!important;
  color:var(--mi-ds-page-ink)!important;
  border-color:var(--mi-ds-edge)!important;
  -webkit-backdrop-filter:blur(var(--mi-ds-banner-blur))!important;
  backdrop-filter:blur(var(--mi-ds-banner-blur))!important;
}
/* A single decorative pseudo-layer is owned by the motif engine. */
html[data-mi-ds-ready] #appScreen#appScreen :is(.mi-ui-settings-banner,.mi-ui-titlebar--banner,.mi-v5-intro,.mi-six-category-banner,.mi-hub-hero,.mi-v2-page-banner)::after {
  content:none!important;
}
html[data-mi-ds-ready] #appScreen#appScreen :is(
  .mi-pro-card,.mi-ui-settings-card,.mi-v2-settings-card,.mi-v2-settings-tile,
  .mi-ui-card,.mi-hub-card,.mi-six-category-card,.mi-v6-card,
  .mi-dashboard-widget,.mi-dashboard-stat,.stat,.panel
) {
  background-color:var(--mi-ds-card-fill)!important;
  background-image:var(--mi-ds-ornament-card,none)!important;
  color:var(--mi-ds-card-ink)!important;
  border-color:var(--mi-ds-edge)!important;
  -webkit-backdrop-filter:blur(var(--mi-ds-card-blur))!important;
  backdrop-filter:blur(var(--mi-ds-card-blur))!important;
}
html[data-mi-ds-ready] #appScreen#appScreen :is(
  .mi-pro-searchbar,.mi-hub-searchbar,.mi-ui-search,.mi-ui-settings-search,
  .mi-six-category-search,.mi-design-color-hex,.mi-design-color-input
) {
  background-color:var(--mi-ds-input-fill)!important;
  color:var(--mi-ds-card-ink)!important;
  border-color:var(--mi-ds-edge)!important;
  -webkit-backdrop-filter:blur(var(--mi-ds-input-blur))!important;
  backdrop-filter:blur(var(--mi-ds-input-blur))!important;
}
html[data-mi-ds-ready] #appScreen#appScreen :is(.mi-pro-card,.mi-hub-card,.mi-v2-settings-card,.mi-dashboard-widget,.mi-ui-card) :is(h1,h2,h3,h4,strong,label){
  color:var(--mi-ds-card-ink)!important;
}
html[data-mi-ds-ready] #appScreen#appScreen :is(.mi-pro-card,.mi-hub-card,.mi-v2-settings-card,.mi-dashboard-widget) :is(p,small,.muted){
  color:var(--mi-ds-muted)!important;
}
/* Preserve semantic color on icon badges and primary controls instead of forcing all icons blue. */
html[data-mi-ds-ready] #appScreen#appScreen :is(.mi-pro-icon,.mi-ui-settings-symbol) {
  background-color:var(--mi-ds-hover)!important;
  color:var(--mi-ds-accent-strong)!important;
}

/* MAHIN_SHARED_ICON_CONTRAST_START */
/* One semantic dark icon treatment; palette, surface and visual style stay independent. */
html[data-mi-ds-ready="true"][data-mi-ds-theme="dark"] #appScreen#appScreen {
    --mi-ds-icon-ink: color-mix(in srgb, var(--mi-ds-card-ink, #f3f8ff) 82%, var(--mi-ds-accent-strong, #a6e2d7) 18%);
    --mi-ds-icon-tile: color-mix(in srgb, var(--mi-ds-accent, #22b7ae) 16%, var(--mi-ds-card-fill, #192d3e));
}
/* Icon glyphs: banner, overview cards, setting cards and search controls. */
html[data-mi-ds-ready="true"][data-mi-ds-theme="dark"] #appScreen#appScreen :is(
    .mi-ui-settings-symbol, .mi-hub-heading-icon, .mi-hub-card-icon,
    .mi-six-category-icon, .mi-pro-icon, .mi-v2-settings-card-icon,
    .mi-pro-loupe, .mi-hub-search-icon, .mi-six-search-icon
) {
    color: var(--mi-ds-icon-ink) !important;
}
/* Background for icon tiles only: do not paint the search icon container. */
html[data-mi-ds-ready="true"][data-mi-ds-theme="dark"] #appScreen#appScreen :is(
    .mi-ui-settings-symbol, .mi-hub-heading-icon, .mi-hub-card-icon,
    .mi-six-category-icon, .mi-pro-icon, .mi-v2-settings-card-icon
) {
    background-color: var(--mi-ds-icon-tile) !important;
}
/* SVG-based icons inherit the same color without changing their geometry. */
html[data-mi-ds-ready="true"][data-mi-ds-theme="dark"] #appScreen#appScreen :is(
    .mi-ui-settings-symbol, .mi-hub-heading-icon, .mi-hub-card-icon,
    .mi-six-category-icon, .mi-pro-icon, .mi-v2-settings-card-icon,
    .mi-pro-loupe, .mi-hub-search-icon, .mi-six-search-icon
) svg {
    color: inherit !important;
}
/* MAHIN_SHARED_ICON_CONTRAST_END */
html[data-mi-ds-ready] #appScreen#appScreen :is(.mi-v2-settings-card,.mi-pro-card,.mi-ui-card) :is(button,.button,[role="button"]):not(.mi-visual-choice):not(.mi-ds-reset){
  border-color:var(--mi-ds-edge)!important;
}
html[data-mi-ds-ready] #appScreen#appScreen :is(input,textarea,select,button,a):focus-visible {
  outline-color:var(--mi-ds-accent)!important;
}

/* Standalone global surface controls: per role percentages + per role blur. */
#appScreen#appScreen .mi-ds-surface-controls {
  margin-top:14px;padding:12px 14px;border:1px solid var(--mi-ds-edge);
  border-radius:var(--mi-global-radius,12px);background:var(--mi-ds-card-fill);
  color:var(--mi-ds-card-ink);
}
#appScreen#appScreen .mi-ds-surface-controls summary {cursor:pointer;font-weight:700;line-height:1.4;}
#appScreen#appScreen .mi-ds-control-tip {margin:8px 0;color:var(--mi-ds-muted);font-size:12px;}
#appScreen#appScreen .mi-ds-surface-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 20px;}
#appScreen#appScreen .mi-ds-surface-row {display:grid;grid-template-columns:1fr auto;gap:5px 8px;align-items:center;min-width:0;padding:8px 0;border-bottom:1px solid var(--mi-ds-edge);font-size:12px;}
#appScreen#appScreen .mi-ds-surface-row label{font-weight:600;}
#appScreen#appScreen .mi-ds-surface-row input[type="range"]{grid-column:1/-1;width:100%;min-width:0;accent-color:var(--mi-ds-accent);}
#appScreen#appScreen .mi-ds-surface-row :is(.mi-ds-alpha-value,.mi-ds-blur-value){font-variant-numeric:tabular-nums;color:var(--mi-ds-muted);}
#appScreen#appScreen .mi-ds-surface-row .mi-ds-blur-label{margin-top:5px;}
#appScreen#appScreen .mi-ds-reset {margin-top:12px;padding:8px 12px;background:var(--mi-ds-button-fill);border:1px solid var(--mi-ds-edge);border-radius:var(--mi-global-control-radius,9px);color:var(--mi-ds-card-ink);cursor:pointer;}
#appScreen#appScreen .mi-ds-reset:hover{background-image:linear-gradient(var(--mi-ds-hover),var(--mi-ds-hover));}
@media(max-width:680px){#appScreen#appScreen .mi-ds-surface-grid{grid-template-columns:1fr;}}
@media(prefers-reduced-motion:reduce){#appScreen#appScreen :is(.ui-card,.ui-button,.mi-ui-card,.mi-ui-button){transition:none!important;animation:none!important;}}

/* Role-oriented extension point for every future module.
 * Example: <a class="ui-card ui-details-card" data-mi-surface-role="card" href="...">
 * or <details class="ui-card ui-collapsible-card" data-mi-surface-role="card">.
 * Only behavior varies; every visual property comes from shared tokens.
 */
html[data-mi-ds-ready] #appScreen#appScreen [data-mi-surface-role] {
  background-color:var(--mi-role-fill)!important;
  color:var(--mi-role-ink,var(--mi-ds-page-ink))!important;
  border-color:var(--mi-ds-edge)!important;
  -webkit-backdrop-filter:blur(var(--mi-role-blur));
  backdrop-filter:blur(var(--mi-role-blur));
}
html[data-mi-ds-ready] #appScreen#appScreen [data-mi-surface-role="card"]{--mi-role-fill:var(--mi-ds-card-fill);--mi-role-ink:var(--mi-ds-card-ink);--mi-role-blur:var(--mi-ds-card-blur);}
html[data-mi-ds-ready] #appScreen#appScreen [data-mi-surface-role="header"]{--mi-role-fill:var(--mi-ds-header-fill);--mi-role-ink:var(--mi-ds-header-ink);--mi-role-blur:var(--mi-ds-header-blur);}
html[data-mi-ds-ready] #appScreen#appScreen [data-mi-surface-role="sidebar"]{--mi-role-fill:var(--mi-ds-sidebar-fill);--mi-role-ink:var(--mi-ds-sidebar-ink);--mi-role-blur:var(--mi-ds-sidebar-blur);}
html[data-mi-ds-ready] #appScreen#appScreen [data-mi-surface-role="button"]{--mi-role-fill:var(--mi-ds-button-fill);--mi-role-blur:var(--mi-ds-button-blur);}
html[data-mi-ds-ready] #appScreen#appScreen [data-mi-surface-role="banner"]{--mi-role-fill:var(--mi-ds-banner-fill);--mi-role-blur:var(--mi-ds-banner-blur);}
html[data-mi-ds-ready] #appScreen#appScreen [data-mi-surface-role="footer"]{--mi-role-fill:var(--mi-ds-footer-fill);--mi-role-ink:var(--mi-ds-sidebar-ink);--mi-role-blur:var(--mi-ds-footer-blur);}
html[data-mi-ds-ready] #appScreen#appScreen [data-mi-surface-role="input"]{--mi-role-fill:var(--mi-ds-input-fill);--mi-role-blur:var(--mi-ds-input-blur);}
html[data-mi-ds-ready] #appScreen#appScreen [data-mi-surface-role="modal"]{--mi-role-fill:var(--mi-ds-modal-fill);--mi-role-blur:var(--mi-ds-modal-blur);}


/* MAHIN_PALETTE_GRID_EDITOR_V2: all choices share one grid; editor is on demand. */
#miV2SettingsPage_appearance #miPaletteChoices .mi-palette-list {
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;align-items:stretch;
}
#miV2SettingsPage_appearance #miPaletteChoices .mi-combo-tiles{display:contents;}
#miV2SettingsPage_appearance #miPaletteChoices :is(.mi-palette-custom-tile,.mi-combo-choice){min-width:0;min-height:44px;}
#miV2SettingsPage_appearance #miPaletteChoices .mi-palette-custom-tile{
  display:grid;grid-template-columns:minmax(0,1fr) 36px;overflow:hidden;
  border:1px solid var(--mi-global-line,var(--mi-ds-line,#b9cce4));
  border-radius:var(--mi-global-control-radius,10px);
  background:var(--mi-ds-card-fill,transparent);
}
#miV2SettingsPage_appearance #miPaletteChoices .mi-palette-custom-tile:has(.mi-palette-custom[aria-pressed="true"]){
  border-color:var(--mi-palette-accent,#2869dc);
  box-shadow:0 0 0 1px var(--mi-palette-accent,#2869dc);
}
#miV2SettingsPage_appearance #miPaletteChoices .mi-palette-custom{
  display:flex;align-items:center;gap:9px;width:100%;min-width:0;min-height:42px;
  padding:8px 10px;border:0!important;border-radius:0!important;
  background:transparent!important;box-shadow:none!important;color:inherit;
}
#miV2SettingsPage_appearance #miPaletteChoices .mi-palette-custom .mi-palette-color{
  background:var(--mi-choice-color,#2869dc)!important;
}
#miV2SettingsPage_appearance #miPaletteChoices .mi-palette-dropdown{
  display:grid!important;place-items:center;width:36px;min-width:36px;
  min-height:42px;margin:0!important;padding:0!important;border:0!important;
  border-left:1px solid var(--mi-global-line,#b9cce4)!important;
  border-radius:0!important;background:transparent!important;color:inherit!important;
  cursor:pointer;font-size:0!important;
}
#miV2SettingsPage_appearance #miPaletteChoices .mi-palette-dropdown::after{
  content:"";display:block;width:8px;height:8px;border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;transform:translateY(-2px) rotate(45deg);
  transition:transform .22s ease;
}
#miV2SettingsPage_appearance #miPaletteChoices .mi-palette-dropdown[aria-expanded="true"]::after{
  transform:translateY(2px) rotate(225deg);
}
#miV2SettingsPage_appearance #miPaletteChoices .mi-palette-dropdown:hover{
  background:color-mix(in srgb,var(--mi-palette-accent,#2869dc) 13%,transparent)!important;
}
#miV2SettingsPage_appearance #miPaletteChoices #miPaletteCustomPanel:not(.is-open){display:none!important;}
#miV2SettingsPage_appearance #miPaletteChoices #miPaletteCustomPanel.is-open{
  display:block!important;opacity:1!important;visibility:visible!important;
  margin-top:12px;animation:miPaletteEditorReveal .24s ease-out both;
}
#miV2SettingsPage_appearance #miPaletteChoices .mi-palette-custom-inner{overflow:visible;}
#miV2SettingsPage_appearance #miPaletteChoices .mi-design-color-row{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px;
  border:1px solid var(--mi-global-line,#b9cce4);
  border-radius:var(--mi-global-radius,12px);
  background:var(--mi-ds-card-fill,var(--mi-global-card,#fff));
}
#miV2SettingsPage_appearance #miPaletteChoices .mi-combo-choice{
  display:flex;align-items:center;gap:9px;min-width:0;min-height:44px;
  padding:8px 10px;border:1px solid var(--mi-global-line,#b9cce4);
  border-radius:var(--mi-global-control-radius,10px);
  background:var(--mi-ds-card-fill,rgba(128,160,200,.07));
  color:inherit;text-align:left;font:inherit;cursor:pointer;
  transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease;
}
#miV2SettingsPage_appearance #miPaletteChoices .mi-combo-swatches{
  display:flex;align-items:center;flex:0 0 30px;width:30px;height:22px;gap:0;
}
#miV2SettingsPage_appearance #miPaletteChoices .mi-combo-swatch{
  flex:1 1 0;min-width:0;height:20px;border:1px solid rgba(40,70,105,.18);
  border-radius:0;box-shadow:none;
}
#miV2SettingsPage_appearance #miPaletteChoices .mi-combo-swatch:first-child{
  border-radius:5px 0 0 5px;
}
#miV2SettingsPage_appearance #miPaletteChoices .mi-combo-swatch:last-child{
  border-radius:0 5px 5px 0;
}
#miV2SettingsPage_appearance #miPaletteChoices .mi-combo-choice[aria-pressed="true"]{
  border-color:var(--mi-palette-accent,#2869dc);
  box-shadow:0 0 0 1px var(--mi-palette-accent,#2869dc);
  font-weight:700;
}
#miV2SettingsPage_appearance #miPaletteChoices .mi-palette-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@keyframes miPaletteEditorReveal{
  from{opacity:0;transform:translateY(-5px)}
  to{opacity:1;transform:translateY(0)}
}
@media(max-width:580px){#miV2SettingsPage_appearance #miPaletteChoices .mi-palette-list{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(prefers-reduced-motion:reduce){#miV2SettingsPage_appearance #miPaletteChoices #miPaletteCustomPanel.is-open{animation:none!important;}}
/* MAHIN_PALETTE_GRID_EDITOR_V2_END */


/* MAHIN_NAV_READABILITY_V2_START
   Shared navigation contrast: text inherits the resolved sidebar ink.
   Do not use opacity on interactive labels, which makes inactive pages unreadable.
   Applies to every palette and every surface/visual style. */
html[data-mi-ds-ready] #appScreen#appScreen #sidebar :is(
  #dashboardNav, #settingsHomeNav, #settingsGroupToggle,
  .mi-settings-parent-row, .nav-item, .mi-v2-sidebar-link,
  .mi-settings-home-trigger, .mi-nav-parent, .mi-footer-brand, .mi-footer-about
) {
  color:var(--mi-ds-sidebar-ink)!important;
  -webkit-text-fill-color:var(--mi-ds-sidebar-ink)!important;
  opacity:1!important;
}
html[data-mi-ds-ready] #appScreen#appScreen #sidebar :is(
  #dashboardNav, #settingsHomeNav, #settingsGroupToggle,
  .mi-settings-parent-row, .nav-item, .mi-v2-sidebar-link,
  .mi-settings-home-trigger, .mi-nav-parent, .mi-footer-brand, .mi-footer-about
) :is(span,small,strong,.nav-label,.mi-nav-text,.mi-parent-label,.mi-settings-home-label,.mi-sidebar-icon,svg) {
  color:inherit!important;
  -webkit-text-fill-color:inherit!important;
  opacity:1!important;
}
html[data-mi-ds-ready] #appScreen#appScreen #sidebar .nav-label {
  color:var(--mi-ds-sidebar-subtle)!important;
  -webkit-text-fill-color:var(--mi-ds-sidebar-subtle)!important;
  opacity:1!important;
}
/* PALETTE HEADER ROLE: one shared rule for all combinations. */
html[data-mi-ds-ready] #appScreen#appScreen #topbar :is(
  button,.button,[role="button"]
),
html[data-mi-ds-ready] #appScreen#appScreen .mi-topbar-shell :is(
  button,.button,[role="button"]
) {
  background-color:var(--mi-ds-header-button-fill)!important;
  color:var(--mi-ds-header-button-ink)!important;
  -webkit-text-fill-color:var(--mi-ds-header-button-ink)!important;
  border-color:var(--mi-ds-header-button-border)!important;
}
/* Child labels/icons follow the parent's semantic control color. */
html[data-mi-ds-ready] #appScreen#appScreen #topbar :is(button,.button,[role="button"]) :is(span,svg,i),
html[data-mi-ds-ready] #appScreen#appScreen .mi-topbar-shell :is(button,.button,[role="button"]) :is(span,svg,i) {
  color:inherit!important;
  -webkit-text-fill-color:inherit!important;
}
/* Expanded Settings modal headings use the selected header role for multi-color presets.
   Shared, not one rule per combo. Preserves Corner/Surface controls. */
html[data-mi-color-combo][data-mi-ds-ready] #miV2SettingsPage_appearance
.mi-v6-layout .mi-pro-card.mi-v6-open .mi-pro-card-heading {
  background:var(--mi-ds-header-fill)!important;
  color:var(--mi-ds-header-ink)!important;
  -webkit-backdrop-filter:blur(var(--mi-ds-header-blur))!important;
  backdrop-filter:blur(var(--mi-ds-header-blur))!important;
}
html[data-mi-color-combo][data-mi-ds-ready] #miV2SettingsPage_appearance
.mi-v6-layout .mi-pro-card.mi-v6-open .mi-pro-card-heading :is(.mi-pro-card-title,strong,h3,h4) {
  color:var(--mi-ds-header-ink)!important;
}
html[data-mi-color-combo][data-mi-ds-ready] #miV2SettingsPage_appearance
.mi-v6-layout .mi-pro-card.mi-v6-open .mi-pro-card-heading :is(.mi-v6-card-open,.mi-v6-close) {
  background:var(--mi-ds-header-button-fill)!important;
  color:var(--mi-ds-header-button-ink)!important;
  border-color:var(--mi-ds-header-button-border)!important;
}
/* MAHIN_NAV_READABILITY_V2_END */

/* Shared native hidden behavior: do not override HTML hidden with grid/flex styles. */
#appScreen#appScreen #miDsSurfaceControls [hidden] { display: none !important; }
