/* Ayuda contextual en la cabecera del Portal Corporativo. */
button#mmg-help-launcher {
    box-sizing:border-box;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:none;
    width:42px;
    height:42px;
    padding:0;
    margin:0;
    border:1px solid #d7e0ed;
    border-radius:12px;
    background:#fff;
    color:#274466;
    cursor:pointer;
    box-shadow:none;
}
button#mmg-help-launcher:hover { background:#edf4fc; border-color:#6587ae; }
button#mmg-help-launcher:focus-visible { outline:3px solid #2b73b5; outline-offset:2px; }
button#mmg-help-launcher svg {
    width:23px;
    height:23px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.75;
    stroke-linecap:round;
    stroke-linejoin:round;
}
:root[data-mmg-theme="dark"] button#mmg-help-launcher {
    background:#172437;
    border-color:#344b63;
    color:#afcbe5;
}
:root[data-mmg-theme="dark"] button#mmg-help-launcher:hover {
    background:#243e58;
    border-color:#7ea3c5;
}
:root[data-mmg-theme="dark"] button#mmg-help-launcher:focus-visible { outline-color:#86c5ff; }
button#mmg-help-launcher[data-position="header"] { margin-inline-start:8px; }
.access-top:has(> #mmg-help-launcher) { flex-wrap:wrap; }
.access-top > button#mmg-help-launcher { margin-inline-start:auto; }
.access-top > #mmg-help-launcher + #mmg-theme-toggle { margin-inline-start:0; }

button#mmg-help-launcher:is([data-position="floating"],[data-position="alone"]) {
    position:fixed;
    top:18px;
    right:74px;
    z-index:95;
}
button#mmg-help-launcher[data-position="alone"] { right:24px; }
button#mmg-help-launcher[data-position="floating"]:has(+ #mmg-notice-launcher + #mmg-theme-toggle) { right:124px; }
#mmg-help-launcher[data-position="floating"] + button#mmg-notice-launcher.floating:has(+ #mmg-theme-toggle) { right:74px; }
#mmg-help-launcher[data-position="floating"] + #mmg-notice-launcher + button#mmg-theme-toggle { right:24px; }

@media (min-width:1251px) {
    :is(.mmg-shell-tools,.top-right,.header-tools) > #mmg-help-launcher:has(+ #mmg-notice-launcher) { margin-inline-end:-10px; }
}
@media (max-width:650px) {
    button#mmg-help-launcher[data-position="floating"] { top:12px; right:62px; }
    button#mmg-help-launcher[data-position="alone"] { top:12px; right:12px; }
    button#mmg-help-launcher[data-position="floating"]:has(+ #mmg-notice-launcher + #mmg-theme-toggle) { right:112px; }
    #mmg-help-launcher[data-position="floating"] + button#mmg-notice-launcher.floating:has(+ #mmg-theme-toggle) { right:62px; }
    #mmg-help-launcher[data-position="floating"] + #mmg-notice-launcher + button#mmg-theme-toggle { right:12px; }
    :is(.mmg-shell-tools,.top-right,.header-tools):has(> #mmg-help-launcher) { gap:6px; }
}
@media (max-width:430px) {
    :is(.mmg-shell-header,body > header,app-root .top):has(> :is(.mmg-shell-tools,.top-right,.header-tools) > #mmg-help-launcher) {
        flex-wrap:wrap;
        row-gap:8px;
        padding-block:8px;
    }
    :is(.mmg-shell-tools,.top-right,.header-tools):has(> #mmg-help-launcher) { margin-inline-start:auto; }
}
@media (max-width:380px) {
    :is(.mmg-shell-tools,.top-right,.header-tools):has(> #mmg-help-launcher) { gap:4px; }
    :is(.mmg-shell-tools,.top-right,.header-tools) > button#mmg-help-launcher { width:38px; height:40px; }
}

button.mmg-help-resume {
    box-sizing:border-box;
    display:inline-flex;
    align-items:center;
    justify-content:flex-start;
    column-gap:9px;
    padding:8px 10px;
    margin:0;
    min-height:40px;
    border-radius:10px;
    border:1px solid #9fbce1;
    background:#eef5ff;
    color:#173c71;
    cursor:pointer;
    font:700 12px/1.32 system-ui,sans-serif;
    box-shadow:none;
    text-align:left;
}
button.mmg-help-resume:hover { background:#deecff; border-color:#648ebf; }
button.mmg-help-resume {
    position:fixed;
    top:max(12px,env(safe-area-inset-top));
    right:max(14px,env(safe-area-inset-right));
    z-index:105;
    box-shadow:0 7px 22px #142f6040;
}
.mmg-help-target {
    outline:3px solid #1166c2 !important;
    outline-offset:3px;
}

dialog.mmg-help-dialog {
    box-sizing:border-box;
    width:min(900px, calc(100% - 28px));
    max-width:none;
    height:fit-content;
    max-height:calc(100dvh - 30px);
    padding:0;
    margin:auto;
    border:1px solid #c7d7eb;
    border-radius:18px;
    background:#fff;
    color:#1a3354;
    box-shadow:0 24px 90px #11284957;
    font:400 14px/1.55 system-ui,sans-serif;
    text-align:left;
    overflow:auto;
    overscroll-behavior:contain;
}
dialog.mmg-help-dialog:not([open]) { display:none; }
dialog.mmg-help-dialog[open] { display:block; }
dialog.mmg-help-dialog::backdrop { background:#11284e99; }
.mmg-help-dialog *, .mmg-help-dialog :before, .mmg-help-dialog :after { box-sizing:border-box; }
.mmg-help-dialog [hidden], button.mmg-help-resume[hidden] { display:none !important; }
.mmg-help-header {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    padding:20px 24px 18px;
    background:linear-gradient(110deg,#132e57,#21558c);
    color:#fff;
}
.mmg-help-header h2.mmg-help-heading {
    color:#fff;
    font:750 clamp(19px,3.1vw,26px)/1.2 system-ui,sans-serif;
    margin:0 0 5px;
}
.mmg-help-header .mmg-help-description {
    color:#ecf3fc;
    margin:0;
    font-size:14px;
}
.mmg-help-dialog button.mmg-help-close {
    display:grid;
    place-items:center;
    flex:none;
    width:36px;
    min-height:36px;
    padding:0;
    margin:0;
    border:1px solid #d3e4ff9c;
    border-radius:9px;
    background:#ffffff16;
    color:#fff;
    font:500 25px/1 system-ui,sans-serif;
    cursor:pointer;
}
.mmg-help-dialog button.mmg-help-close:hover { background:#ffffff35; }
.mmg-help-choices {
    padding:11px 24px;
    background:#f1f6fc;
    border-bottom:1px solid #d9e5f3;
}
.mmg-help-dialog .mmg-help-choice-label {
    display:flex;
    align-items:center;
    gap:10px 14px;
    flex-wrap:wrap;
    color:#193458;
    font-size:13px;
    font-weight:700;
}
.mmg-help-dialog select.mmg-help-select {
    max-width:100%;
    min-width:min(310px,100%);
    width:auto;
    min-height:37px;
    margin:0;
    border:1px solid #98b0ce;
    border-radius:7px;
    background:#fff;
    color:#193458;
    padding:6px 26px 6px 9px;
    font:600 14px/1.25 system-ui,sans-serif;
}
.mmg-help-body {
    display:grid;
    grid-template-columns:minmax(170px, 225px) minmax(0, 1fr);
    min-height:234px;
}
.mmg-help-dialog ol.mmg-help-steps {
    list-style:none;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:5px;
    padding:16px 12px;
    margin:0;
    background:#f8fafd;
    border-right:1px solid #dce6f3;
}
.mmg-help-dialog button.mmg-help-step-link {
    display:flex;
    align-items:center;
    gap:8px;
    width:100%;
    min-height:44px;
    padding:7px;
    border:1px solid transparent;
    margin:0;
    border-radius:8px;
    background:transparent;
    color:#264468;
    cursor:pointer;
    text-align:left;
    font:650 13px/1.35 system-ui,sans-serif;
}
.mmg-help-dialog button.mmg-help-step-link:hover { background:#eef4ff; }
.mmg-help-dialog button.mmg-help-step-link[aria-current="step"] {
    background:#e7f0ff;
    border-color:#adc8ea;
    color:#163f75;
}
.mmg-help-number {
    flex:none;
    display:grid;
    place-items:center;
    width:26px;
    height:26px;
    border-radius:50%;
    border:1px solid #9eb7d9;
    background:#fff;
    font-size:13px;
}
[aria-current="step"] .mmg-help-number {
    background:#22538e;
    border-color:#22538e;
    color:#fff;
}
.mmg-help-pane { padding:18px 24px 19px; }
.mmg-help-dialog .mmg-help-progress {
    margin:0 0 6px;
    color:#395779;
    font-weight:750;
    font-size:12px;
}
.mmg-help-dialog .mmg-help-step-title {
    margin:0 0 7px;
    color:#163658;
    font:750 20px/1.24 system-ui,sans-serif;
}
.mmg-help-dialog .mmg-help-text { margin:0 0 12px; color:#263f5f; }
.mmg-help-dialog .mmg-help-figure {
    overflow:hidden;
    background:#f3f7fc;
    border:1px solid #d0dff0;
    border-radius:9px;
    margin:12px 0 0;
}
.mmg-help-image {
    display:block;
    width:100%;
    height:auto;
    max-height: min(340px,39dvh);
    object-fit:contain;
    background:#edf2f8;
}
.mmg-help-caption {
    display:flex;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:2px 12px;
    padding:6px 10px;
    color:#3b5577;
    font-size:12px;
}
.mmg-help-caption a { color:#174e90; text-decoration:underline; }
.mmg-help-footer {
    position:sticky;
    bottom:0;
    display:flex;
    justify-content:space-between;
    gap:10px;
    padding:11px 24px;
    border-top:1px solid #dbe5f1;
    background:#fff;
}
.mmg-help-dialog button.mmg-help-button {
    width:auto;
    margin:0;
    min-height:40px;
    padding:6px 13px;
    border:1px solid #a7bddb;
    border-radius:8px;
    background:#fff;
    color:#173e6a;
    font:700 13px/1.3 system-ui,sans-serif;
    cursor:pointer;
    box-shadow:none;
}
.mmg-help-dialog button.mmg-help-button:hover { background:#eef5ff; }
.mmg-help-dialog button.mmg-help-button:disabled { opacity:.5; cursor:default; }
.mmg-help-dialog button.mmg-help-primary { color:#fff; background:#21558c; border-color:#21558c; }
.mmg-help-dialog button.mmg-help-primary:hover { background:#163e69; }
.mmg-help-dialog button.mmg-help-show { background:#edf5ff; }
:is(.mmg-help-launch,.mmg-help-resume,.mmg-help-dialog button,.mmg-help-dialog select,.mmg-help-dialog a):focus-visible {
    outline:3px solid #1166c2;
    outline-offset:2px;
}
.mmg-help-dialog .mmg-help-close:focus-visible { outline-color:#f7d879; }
@media (max-width:640px) {
    .mmg-help-dialog { max-height:calc(100dvh - 18px); }
    .mmg-help-header,.mmg-help-choices,.mmg-help-pane,.mmg-help-footer { padding-inline:14px; }
    .mmg-help-header { padding-block:12px; }
    .mmg-help-choices { padding-block:8px; }
    .mmg-help-body { display:block; min-height:0; }
    .mmg-help-dialog ol.mmg-help-steps {
        flex-direction:row;
        padding:5px 14px;
        border-right:0;
        border-bottom:1px solid #dce6f3;
        overflow-x:auto;
    }
    .mmg-help-dialog .mmg-help-step-link { justify-content:center; min-width:44px; }
    .mmg-help-step-link > span + span {
        position:absolute;
        width:1px;
        height:1px;
        overflow:hidden;
        clip-path:inset(50%);
    }
    .mmg-help-pane { padding-block:12px; }
    .mmg-help-dialog button.mmg-help-button { min-height:44px; }
}
@media print {
    button.mmg-help-launch, button.mmg-help-resume, dialog.mmg-help-dialog { display:none !important; }
}

.mmg-help-dialog .mmg-help-text strong { font-weight:750; }
.mmg-help-dialog .mmg-help-image { max-height:min(420px,48dvh); }
.mmg-help-dialog .mmg-help-caption a { font-weight:650; }
@media (max-width:640px) {
    .mmg-help-dialog .mmg-help-image { max-height:min(300px,40dvh); }
}
