/* Help links remain separate controls: never nest a link inside a button. */
a.ms-function-help {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    min-width: 16px;
    padding: 0 !important;
    margin: 0 2px !important;
    border: 1px solid #64748b !important;
    border-radius: 50% !important;
    background: #f8fafc !important;
    color: #475569 !important;
    font: 700 11px/1 Georgia, serif !important;
    text-decoration: none !important;
    vertical-align: middle;
    align-self: center;
    cursor: help;
    user-select: none;
    box-shadow: none !important;
}
a.ms-function-help:hover, a.ms-function-help:focus-visible {
    color: #1d4ed8 !important;
    border-color: #2563eb !important;
    background: #eff6ff !important;
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}
a.ms-function-help.ms-help-float { float: right; position: relative; z-index: 1; margin-top: 6px; }
a.ms-function-help[hidden] { display: none !important; }
.dark a.ms-function-help { background: #1e293b !important; color: #cbd5e1 !important; border-color: #94a3b8 !important; }
label > a.ms-function-help { margin-inline-start: 5px; }
label.absolute > a.ms-function-help { width: 12px; min-width: 12px; height: 12px; font-size: 9px !important; margin-inline-start: 3px; }
label.absolute:has(> .ms-function-help) { white-space: nowrap; }
label.ms-help-label-host { position: relative; }
label.ms-help-label-host > a.ms-function-help { position: absolute; inset-inline-end: 0; top: 0; margin: 0; }
html:not([data-information-icons="hidden"]) .cv2-viewbar > label.ms-help-label-host { padding-inline-end: 22px; }
.cv2-viewbar > label.ms-help-label-host > a.ms-function-help { top: 50%; transform: translateY(-50%); }
.cv2-options > summary > a.ms-function-help { margin-inline-start: 5px !important; }
.ms-help-inline-action { display: inline-flex !important; }
a.ms-function-help.ms-help-summary::before { content: 'i'; }
.ms-help-field-host { position: relative; padding-inline-end: 20px; }
a.ms-function-help.ms-help-field { position: absolute; inset-inline-end: 0; top: 50%; transform: translateY(-50%); margin: 0; }
/* Reserve the icon outside the original currency-and-price width. */
.material-row > .ms-help-field-host:has(> .mat-price) { box-sizing: content-box; }
/* Keep columns aligned, with help shown only on the first material row. */
.material-stack > .material-row ~ .material-row a.ms-function-help {
    visibility: hidden !important;
    pointer-events: none;
}

a.ms-function-help.ms-help-grid { grid-column: 1; justify-self: end; z-index: 1; margin-inline-end: 9px; }
html:not([data-information-icons="hidden"]) .sku-dropdown:not(.hidden):has(> .ms-function-help) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20px;
    align-items: center;
}
.sku-dropdown > a.ms-function-help { justify-self: center; margin: 0 !important; }
/* Five workshop stations, each paired with its information link. */
:is(main, #workshopStationsContainer) > .grid:has(> a[href="/workshop/station/intake"]) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    max-width: calc(100vw - 32px);
}
html:not([data-information-icons="hidden"]) :is(main, #workshopStationsContainer) > .grid:has(> a[href="/workshop/station/intake"]):has(> .ms-function-help) {
    grid-template-columns: repeat(5, minmax(0, 1fr) 16px);
    column-gap: 6px;
}
:is(main, #workshopStationsContainer) > .grid:has(> a[href="/workshop/station/intake"]) > a:not(.ms-function-help) {
    min-width: 0;
    padding: 12px 8px;
}
:is(main, #workshopStationsContainer) > .grid:has(> a[href="/workshop/station/intake"]) > a:not(.ms-function-help) > div {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
}
:is(main, #workshopStationsContainer) > .grid:has(> a[href="/workshop/station/intake"]) > a:not(.ms-function-help) > span {
    font-size: 11px;
    letter-spacing: .04em;
}
@media (max-width: 640px) {
    :is(main, #workshopStationsContainer) > .grid:has(> a[href="/workshop/station/intake"]) {
        grid-template-columns: repeat(5, minmax(80px, 1fr));
        overflow-x: auto;
    }
    html:not([data-information-icons="hidden"]) :is(main, #workshopStationsContainer) > .grid:has(> a[href="/workshop/station/intake"]):has(> .ms-function-help) {
        grid-template-columns: repeat(5, minmax(80px, 1fr) 16px);
    }
}
/* Compact dashboard modules, with a dedicated slot for each help icon. */
#dashboardCardsContainer { width: min(100%, calc(100vw - 64px)); }
#dashboardGrid { --dashboard-columns: 3; grid-template-columns: repeat(var(--dashboard-columns), minmax(0, 1fr)); gap: 12px; }
html:not([data-information-icons="hidden"]) #dashboardGrid:has(> .ms-function-help) {
    grid-template-columns: repeat(var(--dashboard-columns), minmax(0, 1fr) 16px);
    column-gap: 6px;
}
#dashboardGrid > a { grid-column: auto !important; grid-row: auto !important; }
#dashboardGrid > a:not(.ms-function-help) { min-width: 0; padding: 16px; }
#dashboardGrid > a:not(.ms-function-help) > div { width: 32px; height: 32px; margin-bottom: 10px; }
#dashboardGrid > a:not(.ms-function-help) > div svg { width: 20px; height: 20px; }
#dashboardGrid > a:not(.ms-function-help) > h2 { font-size: 16px; line-height: 20px; }
#dashboardGrid > a:not(.ms-function-help) > p { font-size: 12px; line-height: 18px; }
#dashboardGrid > a.ms-function-help { justify-self: center; margin: 0 !important; }
@media (max-width: 1023px) { #dashboardGrid { --dashboard-columns: 2; } }
@media (max-width: 639px) { #dashboardGrid { --dashboard-columns: 1; } }
/* Keep each catalogue action and its information icon in the same row. */
html:not([data-information-icons="hidden"]) #productGrid .product-card .grid.grid-cols-3:has(> .ms-function-help) {
    grid-template-columns: repeat(3, minmax(0, 1fr) 12px);
    column-gap: 2px;
    align-items: center;
}
html:not([data-information-icons="hidden"]) #productGrid .product-card .grid.grid-cols-3:has(> .ms-function-help) > :not(.ms-function-help) {
    padding-inline: 2px;
}
#productGrid .product-card .grid.grid-cols-3 > a.ms-function-help {
    width: 12px;
    min-width: 12px;
    height: 12px;
    margin: 0 !important;
    font-size: 9px !important;
}
#smart-nav-links:has(> .ms-function-help) { gap: 5px; }
/* Keep the global Menu trigger and its help icon together. */
header nav > .group:has(> button + a.ms-function-help) {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 4px;
}
header nav > .group:has(> button + a.ms-function-help) > div { top: 100%; }
html:not([data-information-icons="hidden"]) header nav > .group:has(> button + a.ms-function-help) > div {
    width: 260px;
    max-width: calc(100vw - 16px);
}
html:not([data-information-icons="hidden"]) header nav > .group > div > div:has(> a.ms-function-help),
html:not([data-information-icons="hidden"]) #toolbox-menu-container:has(> a.ms-function-help) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px;
    align-items: center;
}
header nav > .group > div > div:has(> a.ms-function-help) > a:not(.ms-function-help),
#toolbox-menu-container:has(> a.ms-function-help) > a:not(.ms-function-help) { grid-column: 1; min-width: 0; }
header nav > .group > div > div > a.ms-function-help,
#toolbox-menu-container > a.ms-function-help {
    grid-column: 2;
    justify-self: center;
    float: none;
    margin: 0 !important;
}
.material-row > div:has(> button[onclick^="moveRowUp"]) { display: grid; grid-template-columns: 14px 12px; gap: 1px; width: 28px !important; min-width: 28px; }
.material-row > div:has(> button[onclick^="moveRowUp"]) > a.ms-function-help { width: 12px; min-width: 12px; height: 12px; margin: 0; font-size: 9px !important; }
.cv2-search button:has(+ a.ms-function-help) { right: 26px; }
.cv2-search button + a.ms-function-help { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
@media screen and (min-width: 761px) {
    .cv2-navigation nav > .group > div:has(.ms-function-help) { max-height: calc(100dvh - 90px); }
}
#ms-context-help-tip {
    position: fixed;
    inset: auto;
    margin: 0;
    width: max-content;
    max-width: min(320px, calc(100vw - 20px));
    padding: 10px 12px;
    border: 1px solid #475569;
    border-radius: 8px;
    background: #0f172a;
    color: #fff;
    font: 13px/1.5 system-ui, sans-serif;
    text-align: left;
    white-space: pre-line;
    box-shadow: 0 4px 18px #0004;
    pointer-events: none;
    z-index: 2147483647;
}
#ms-context-help-tip[hidden] { display: none; }
html[data-information-icons="hidden"] a.ms-function-help,
html[data-information-icons="hidden"] #ms-context-help-tip { display: none !important; }
html[data-information-icons="hidden"] .ms-help-field-host { padding-inline-end: 0; }
html[data-information-icons="hidden"] #smart-nav-links:has(> .ms-function-help) { gap: 12px; }
html[data-information-icons="hidden"] .material-row > div:has(> button[onclick^="moveRowUp"]) { display: flex; width: 16px !important; min-width: 16px; }
html[data-information-icons="hidden"] .cv2-search button:has(+ a.ms-function-help) { right: 6px; }
@media print { a.ms-function-help, #ms-context-help-tip { display: none !important; } }
