/* Company branding: retain layout and semantic status colors. */
@media screen{
 html body>.sidebar{color:var(--nav-text,#fff)!important}
 html body>.main>.topbar{border-bottom-color:var(--navy)!important}
 html body>.main>.topbar .brand :is(strong,small){color:var(--nav-text,#fff)!important}
 html body>.sidebar #nav :is(.nav-btn,.nav-section-toggle),html body>.sidebar .sidebar-exit{color:var(--nav-text,#fff)!important}
 html body>.sidebar #nav .nav-btn.active{background:var(--blue)!important;color:var(--button-ink,#fff)!important;border-color:var(--blue)!important;border-left-color:var(--teal)!important}
 html body:has(>.main) :is(.btn.primary,.entity-selected-edit,.ov-btn.primary,.rt-save .rt-main,.right-tools-aside .rt-primary-action),html body :is(#materialPage,#sentinelOnePage,#partnersPage) .mt-action.mt-primary{background:var(--blue)!important;border-color:var(--blue)!important;color:var(--button-ink,#fff)!important}
 html body .rt-command:not(:disabled):not(.rt-main):not(.rt-primary-action),html body :is(#materialPage,#sentinelOnePage,#partnersPage) .mt-action:not(.mt-primary):not(:disabled){color:var(--blue)}
 html body .rt-group[data-group="Actions sensibles"] .rt-command{color:#d94242}
}

/* Time tracker: stable year selector, independent of generic form sizing. */
.time-tracker-page .time-year-filter{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.time-tracker-page .time-year-label{display:block;margin:0;width:auto;min-width:0;flex:0 0 auto}.time-tracker-page .time-year-control{display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;width:auto}.time-tracker-page #timeTrackerYear{width:104px!important;min-width:104px!important;max-width:104px!important;height:36px!important;min-height:36px!important;padding:6px 24px 6px 10px!important;font-size:14px!important;box-sizing:border-box}.time-tracker-page #timeYearPrevious,.time-tracker-page #timeYearNext{display:inline-flex;align-items:center;justify-content:center;width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important;padding:0!important;margin:0;font-size:20px;box-sizing:border-box}

/* V648: destructive commands stay red independently of the company theme. */
html body .right-tools-aside .rt-command.rt-delete,
html body :is(.mt-aside,.m1-menu-panel) :is(button[data-action="delete"],button[data-partner-action="delete"],button.danger){color:#c62828!important;}
html body .right-tools-aside .rt-delete :is(svg,span),
html body :is(.mt-aside,.m1-menu-panel) :is(button[data-action="delete"],button[data-partner-action="delete"],button.danger) :is(svg,span){color:inherit!important;}
html body :is(.right-tools-aside,.mt-aside,.m1-menu-panel) .refresh-with-label:has(svg)::before{content:none!important;display:none!important;}

/* Secure screen link controls: keep checkbox and buttons compact. */
.cs-settings .cs-address input[type="checkbox"]{width:auto;min-height:0}.cs-settings .cs-address>button{align-self:flex-start}

/* V652: slightly wider desktop navigation; keep the collapsed and drawer modes. */
@media screen and (min-width:761px){
 html:not([data-layout="drawer"]) body:not(.mobile-device):not(.m1-unpinned)>.sidebar{width:264px!important}
 html:not([data-layout="drawer"]) body:not(.mobile-device):not(.m1-unpinned)>.main{margin-left:264px!important}
 html:not([data-layout="drawer"]) body:not(.mobile-device):not(.m1-unpinned) .app-status-footer{left:264px!important}
 html:not([data-layout="drawer"]) body:not(.mobile-device).m1-unpinned>.sidebar:is(:hover,:focus-within){width:264px!important}
 html:not([data-layout="drawer"]) body:not(.mobile-device)>.sidebar #nav{width:100%;min-width:0;min-height:0;overflow-x:hidden!important;overflow-y:auto!important;scrollbar-gutter:stable}
 html:not([data-layout="drawer"]) body:not(.mobile-device)>.sidebar #nav>.nav-group{width:100%;min-width:0;box-sizing:border-box}
 html:not([data-layout="drawer"]) body:not(.mobile-device)>.sidebar #nav .nav-submenu{width:auto;min-width:0;box-sizing:border-box;grid-template-columns:minmax(0,1fr)}
 html:not([data-layout="drawer"]) body:not(.mobile-device)>.sidebar #nav .nav-section-toggle{grid-template-columns:22px minmax(0,1fr) 16px;min-width:0;max-width:100%}
 html:not([data-layout="drawer"]) body:not(.mobile-device)>.sidebar #nav .nav-btn{min-width:0;max-width:100%;box-sizing:border-box}
 html:not([data-layout="drawer"]) body:not(.mobile-device)>.sidebar #nav .nav-btn:hover{transform:none}
}
/* Native scrollbars follow company colours immediately, including Firefox/WebKit. */
html body>.sidebar,html body>.sidebar #nav{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--nav-text,#fff) 32%,var(--navy)) var(--navy)}
html body>.sidebar::-webkit-scrollbar,html body>.sidebar #nav::-webkit-scrollbar{width:8px;height:8px}
html body>.sidebar::-webkit-scrollbar-track,html body>.sidebar #nav::-webkit-scrollbar-track,html body>.sidebar #nav::-webkit-scrollbar-corner{background:var(--navy)}
html body>.sidebar::-webkit-scrollbar-thumb,html body>.sidebar #nav::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--nav-text,#fff) 32%,var(--navy));border:2px solid var(--navy);border-radius:8px}
html body>.sidebar #nav::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--nav-text,#fff) 48%,var(--navy))}

/* V654 provider marks retain their colours while labels follow the company theme. */
html body :is(.rt-command,.mt-action,.remote-provider-link)>.remote-brand{width:24px!important;height:24px!important;min-width:24px!important;max-width:24px!important;object-fit:contain!important;flex:0 0 24px;filter:none!important;opacity:1}
html body [data-remote-provider]{display:flex;align-items:center;gap:10px}

/* V655: close controls must remain legible on light/dark/company headers.
   Scope by semantic role assigned by ButtonRules; keep nodes and handlers. */
html body button.ui-symbol-button[data-ui-role="close"],
html body :is(dialog,[role="dialog"],.modal,.context-help-dialog) button:is([data-ui-role="close"],.context-help-close){
 color:#b91c1c!important;-webkit-text-fill-color:#b91c1c!important;
 background:#f3f4f6!important;border:1px solid #9ca3af!important;
 text-shadow:none!important;filter:none!important;box-shadow:0 1px 3px #00000014;
}
html body button.ui-symbol-button[data-ui-role="close"]>span,
html body :is(dialog,[role="dialog"],.modal,.context-help-dialog) button:is([data-ui-role="close"],.context-help-close)>span{
 color:inherit!important;-webkit-text-fill-color:inherit!important;opacity:1!important;text-shadow:none!important;
}
html body button.ui-symbol-button[data-ui-role="close"]:hover,
html body :is(dialog,[role="dialog"],.modal,.context-help-dialog) button:is([data-ui-role="close"],.context-help-close):hover{
 color:#991b1b!important;-webkit-text-fill-color:#991b1b!important;background:#e5e7eb!important;border-color:#e11d48!important;
}
html body button.ui-symbol-button[data-ui-role="close"]:focus-visible,
html body :is(dialog,[role="dialog"],.modal,.context-help-dialog) button:is([data-ui-role="close"],.context-help-close):focus-visible{
 outline:3px solid #be123c!important;outline-offset:3px!important;
}

/* V656: only the enhanced font control is visible. Keep the native field
   enabled and named for FormData, but never open its second OS dropdown. */
html body #settingsForm select#fontFamily[data-word-picker="1"]{display:none!important}
html body #settingsForm .word-font-picker-menu[hidden]{display:none!important}

/* V669: independent columns prevent tall left cards pushing right cards down. */
html body #settingsForm>.settings-service-columns{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;grid-column:1/-1;align-items:start}
html body #settingsForm .settings-service-columns>div{display:flex;flex-direction:column;gap:18px;min-width:0}
html body #settingsForm .settings-service-columns .settings-section{margin:0!important}
html body #settingsForm #mailInboundPanel{margin:0;min-width:0;box-shadow:none;border:1px solid var(--line);border-radius:10px;overflow:hidden}
html body #settingsForm #mailInboundPanel .panel-body{display:block;padding:14px;min-width:0}
html body #settingsForm #mailInboundPanel summary{cursor:pointer;padding:14px;font-weight:700}
html body #settingsForm #mailInboundPanel .mail-inbound-form{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:14px}
html body #settingsForm #mailInboundPanel input[type=checkbox]{width:auto!important;min-height:0!important}
html body #settingsForm #fontFamily{display:block!important;max-width:420px}
@media(max-width:1100px){html body #settingsForm>.settings-service-columns{grid-template-columns:minmax(0,1fr)}}

/* Context help follows the same company header/background and contrasting text
   variables as navigation, including runtime palette changes. */
html body #contextHelpDialog .context-help-head,
html body .context-help-dialog .context-help-head{
 background:var(--navy)!important;color:var(--nav-text,#fff)!important;border-bottom-color:var(--navy)!important;
}
html body #contextHelpDialog .context-help-head :is(h2,small,.context-help-close,.context-help-close span,.context-help-close strong),
html body .context-help-dialog .context-help-head :is(h2,small,.context-help-close,.context-help-close span,.context-help-close strong){color:var(--nav-text,#fff)!important}
html body #contextHelpDialog .context-help-head .context-help-close{background:transparent!important;border-color:currentColor!important}
