/* Contextual help shared by admin, manager, ticket and sheet pages. */
.sips-help-trigger {
    appearance: none;
    display: inline-grid !important;
    place-items: center;
    flex: 0 0 auto;
    width: 19px !important;
    min-width: 19px !important;
    height: 19px !important;
    min-height: 19px !important;
    margin: 0 0 0 7px !important;
    padding: 0 !important;
    border: 1px solid rgba(119, 166, 255, .52) !important;
    border-radius: 50% !important;
    background: rgba(24, 43, 82, .78) !important;
    color: #cfe6ff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 0 0 rgba(86, 174, 255, 0) !important;
    font: 900 11px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    letter-spacing: 0 !important;
    vertical-align: 2px;
    cursor: help;
    pointer-events: auto !important;
    opacity: .82;
    transform: none !important;
    transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease, opacity .16s ease !important;
}

.sips-help-trigger:hover,
.sips-help-trigger:focus-visible {
    border-color: rgba(95, 211, 255, .95) !important;
    background: rgba(37, 99, 173, .94) !important;
    color: #fff !important;
    box-shadow: 0 0 0 3px rgba(77, 179, 255, .15), 0 0 18px rgba(77, 179, 255, .25) !important;
    opacity: 1;
    outline: 0;
}

.sips-help-trigger::before,
.sips-help-trigger::after {
    content: none !important;
}

h1 > .sips-help-trigger,
h2 > .sips-help-trigger,
h3 > .sips-help-trigger {
    vertical-align: .12em;
}

label > .sips-help-trigger {
    vertical-align: middle;
}

.sips-help-area-trigger {
    margin-inline-start: auto !important;
}

.sips-help-area {
    isolation: isolate;
}

.sips-help-page-trigger {
    appearance: none;
    display: inline-grid !important;
    place-items: center;
    flex: 0 0 auto;
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    border: 1px solid rgba(119, 166, 255, .42) !important;
    border-radius: 8px !important;
    background: linear-gradient(145deg, rgba(19, 37, 70, .94), rgba(13, 21, 47, .94)) !important;
    color: #e6f4ff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07) !important;
    font: 950 16px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    cursor: help;
}

.sips-help-page-trigger:hover,
.sips-help-page-trigger:focus-visible {
    border-color: rgba(91, 203, 255, .9) !important;
    background: linear-gradient(145deg, rgba(35, 91, 151, .96), rgba(31, 45, 94, .96)) !important;
    box-shadow: 0 0 0 3px rgba(77, 179, 255, .14), 0 10px 26px rgba(0, 0, 0, .24) !important;
    outline: 0;
}

.sips-help-page-trigger.is-floating {
    position: fixed !important;
    right: 18px;
    top: 18px;
    z-index: 1290;
}

.sidebar-footer-tools .sips-help-page-trigger,
.mg-side-nav-footer .sips-help-page-trigger {
    margin-bottom: 8px;
}

.sips-help-layer {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 6, 18, .74);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 0;
    transition: opacity .18s ease;
}

.sips-help-layer[hidden] {
    display: none !important;
}

.sips-help-layer.is-open {
    opacity: 1;
}

.sips-help-dialog {
    position: relative;
    width: min(680px, calc(100vw - 32px));
    max-height: min(86vh, 780px);
    overflow: hidden;
    border: 1px solid rgba(108, 169, 255, .44);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(12, 22, 46, .985), rgba(8, 12, 31, .985)),
        #0b1328;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .56), inset 0 1px 0 rgba(255, 255, 255, .07);
    color: #edf5ff;
    transform: translateY(10px) scale(.985);
    transition: transform .2s ease;
}

.sips-help-layer.is-open .sips-help-dialog {
    transform: none;
}

.sips-help-dialog::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, #51c9ff, #7868ff, #e356d7);
}

.sips-help-dialog-head {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 34px;
    gap: 12px;
    align-items: center;
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(123, 157, 224, .2);
}

.sips-help-dialog-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(91, 203, 255, .58);
    border-radius: 8px;
    background: rgba(38, 94, 160, .38);
    color: #fff;
    font-size: 17px;
    font-weight: 950;
}

.sips-help-dialog-title-wrap {
    min-width: 0;
}

.sips-help-dialog-kicker {
    display: block;
    margin-bottom: 3px;
    color: #78ccff;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.sips-help-dialog-title {
    margin: 0 !important;
    color: #fff !important;
    font-size: 19px !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
}

.sips-help-dialog-close {
    appearance: none;
    display: grid !important;
    place-items: center;
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    border: 1px solid rgba(123, 157, 224, .28) !important;
    border-radius: 7px !important;
    background: rgba(255, 255, 255, .045) !important;
    color: #dce9ff !important;
    font-size: 21px !important;
    line-height: 1 !important;
    cursor: pointer;
}

.sips-help-dialog-close:hover,
.sips-help-dialog-close:focus-visible {
    border-color: rgba(255, 112, 151, .68) !important;
    background: rgba(114, 30, 58, .28) !important;
    color: #fff !important;
    outline: 0;
}

.sips-help-dialog-body {
    max-height: calc(min(86vh, 780px) - 126px);
    overflow: auto;
    padding: 18px;
    scrollbar-color: rgba(101, 156, 255, .55) transparent;
}

.sips-help-summary {
    margin: 0;
    color: #d7e5f8;
    font-size: 14px;
    line-height: 1.58;
}

.sips-help-section {
    margin-top: 17px;
}

.sips-help-overview {
    margin-top: 0;
}

.sips-help-section-title {
    display: block;
    margin-bottom: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.sips-help-steps {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: help-step;
}

.sips-help-steps li {
    position: relative;
    min-height: 30px;
    padding: 7px 10px 7px 40px;
    border: 1px solid rgba(123, 157, 224, .18);
    border-radius: 7px;
    background: rgba(255, 255, 255, .035);
    color: #dce8f8;
    font-size: 13px;
    line-height: 1.45;
    counter-increment: help-step;
}

.sips-help-steps li::before {
    content: counter(help-step);
    position: absolute;
    left: 9px;
    top: 7px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(63, 138, 224, .28);
    color: #a9ddff;
    font-size: 11px;
    font-weight: 950;
}

.sips-help-important {
    margin-top: 16px;
    padding: 11px 12px;
    border: 1px solid rgba(255, 190, 86, .38);
    border-left: 3px solid #ffbf5f;
    border-radius: 7px;
    background: rgba(104, 69, 18, .16);
    color: #ffe4ad;
    font-size: 13px;
    line-height: 1.48;
}

.sips-help-preview {
    margin: 16px 0 0;
}

.sips-help-preview-caption {
    margin-bottom: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.sips-help-preview-canvas {
    min-height: 132px;
    padding: 12px;
    overflow: hidden;
    border: 1px solid rgba(108, 169, 255, .28);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(16, 36, 70, .86), rgba(8, 14, 34, .94)),
        #0a1329;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.sips-help-preview-toolbar,
.sips-help-preview-sheet-head {
    display: flex;
    gap: 6px;
    align-items: center;
    height: 20px;
    margin-bottom: 9px;
}

.sips-help-preview-toolbar i,
.sips-help-preview-sheet-head i {
    display: block;
    width: 52px;
    height: 9px;
    border-radius: 4px;
    background: rgba(143, 184, 242, .2);
}

.sips-help-preview-toolbar i:first-child,
.sips-help-preview-sheet-head i:first-child {
    width: 72px;
    background: rgba(81, 201, 255, .42);
}

.sips-help-preview-chart {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 7px;
    align-items: end;
    height: 72px;
    padding: 6px 8px 0;
    border-bottom: 1px solid rgba(134, 173, 232, .22);
    background: repeating-linear-gradient(
        to top,
        transparent 0,
        transparent 23px,
        rgba(134, 173, 232, .1) 24px
    );
}

.sips-help-preview-chart span {
    height: var(--help-value);
    min-height: 5px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, #54d6ff, #6a73ff);
    box-shadow: 0 0 12px rgba(80, 193, 255, .22);
}

.sips-help-preview-legend {
    display: flex;
    gap: 7px;
    align-items: center;
    margin-top: 9px;
    color: #aebfd8;
    font-size: 11px;
}

.sips-help-preview-legend b {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #55d3ff;
    box-shadow: 0 0 8px rgba(85, 211, 255, .7);
}

.sips-help-preview-sheet {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 78px;
    border-top: 1px solid rgba(153, 181, 224, .26);
    border-left: 1px solid rgba(153, 181, 224, .26);
    background: rgba(245, 249, 255, .92);
}

.sips-help-preview-sheet span {
    min-height: 26px;
    border-right: 1px solid rgba(79, 106, 147, .22);
    border-bottom: 1px solid rgba(79, 106, 147, .22);
}

.sips-help-preview-sheet span.is-selected {
    position: relative;
    z-index: 1;
    outline: 2px solid #3188ff;
    outline-offset: -2px;
    background: rgba(74, 151, 255, .16);
}

.sips-help-preview-import {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 88px;
}

.sips-help-preview-paste,
.sips-help-preview-rows {
    display: grid;
    gap: 7px;
    padding: 11px;
    border: 1px solid rgba(134, 173, 232, .2);
    border-radius: 7px;
    background: rgba(4, 10, 25, .5);
}

.sips-help-preview-paste i,
.sips-help-preview-rows i {
    display: block;
    height: 8px;
    border-radius: 3px;
    background: rgba(151, 183, 230, .22);
}

.sips-help-preview-rows i {
    background: rgba(89, 209, 156, .38);
}

.sips-help-preview-import > strong {
    color: #78ccff;
    text-align: center;
}

.sips-help-preview-messages {
    display: grid;
    gap: 8px;
}

.sips-help-preview-messages > div {
    display: flex;
}

.sips-help-preview-messages > .is-outgoing {
    justify-content: flex-end;
}

.sips-help-preview-messages span {
    display: block;
    max-width: 72%;
    padding: 8px 10px;
    border: 1px solid rgba(128, 169, 231, .24);
    border-radius: 7px;
    background: rgba(255, 255, 255, .05);
    color: #dbe8f9;
    font-size: 11px;
}

.sips-help-preview-messages .is-outgoing span {
    border-color: rgba(90, 176, 255, .42);
    background: rgba(49, 116, 198, .28);
}

.sips-help-preview-flow {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-top: 11px;
    color: #8edcff;
    font-size: 11px;
}

.sips-help-preview-flow i {
    width: 42px;
    height: 1px;
    background: rgba(101, 202, 255, .48);
}

.sips-help-preview-ticket-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(134, 173, 232, .16);
    color: #fff;
    font-size: 11px;
}

.sips-help-preview-ticket-head span {
    padding: 4px 7px;
    border: 1px solid rgba(255, 190, 86, .34);
    border-radius: 6px;
    color: #ffd687;
}

.sips-help-preview-sips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.sips-help-preview-sips > span {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 2px 7px;
    min-width: 0;
    padding: 10px 8px;
    border: 1px solid rgba(127, 171, 232, .2);
    border-radius: 7px;
    background: rgba(4, 12, 28, .48);
}

.sips-help-preview-sips i {
    grid-row: 1 / 3;
    align-self: center;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #61e97a;
    box-shadow: 0 0 10px currentColor;
}

.sips-help-preview-sips .is-warn i {
    background: #ffc948;
}

.sips-help-preview-sips .is-error i {
    background: #ff5967;
}

.sips-help-preview-sips b,
.sips-help-preview-sips small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sips-help-preview-sips b {
    color: #f2f7ff;
    font-size: 11px;
}

.sips-help-preview-sips small {
    color: #9eb1cb;
    font-size: 9px;
}

.sips-help-preview-settings {
    display: grid;
    gap: 7px;
}

.sips-help-preview-settings > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 28px;
    padding: 5px 8px;
    border-bottom: 1px solid rgba(134, 173, 232, .14);
    color: #dce8f8;
    font-size: 11px;
}

.sips-help-preview-settings i {
    position: relative;
    width: 30px;
    height: 16px;
    border-radius: 8px;
    background: rgba(138, 159, 194, .26);
}

.sips-help-preview-settings i::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c7d3e4;
}

.sips-help-preview-settings i.is-on {
    background: rgba(63, 183, 135, .5);
}

.sips-help-preview-settings i.is-on::after {
    left: 17px;
    background: #71f0ac;
}

.sips-help-preview-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-height: 82px;
}

.sips-help-preview-controls span {
    padding: 10px;
    border: 1px solid rgba(134, 173, 232, .28);
    border-radius: 7px;
    background: rgba(4, 12, 28, .48);
    color: #dce8f8;
    font-size: 11px;
    text-align: center;
}

.sips-help-preview-controls strong {
    color: #78ccff;
    text-align: center;
}

.sips-help-preview-controls .is-result {
    border-color: rgba(89, 209, 156, .38);
    color: #9cf0c9;
}

.sips-help-dialog-footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 18px;
    border-top: 1px solid rgba(123, 157, 224, .2);
    background: rgba(4, 9, 24, .5);
}

.sips-help-understood {
    appearance: none;
    min-height: 36px !important;
    padding: 8px 17px !important;
    border: 1px solid rgba(91, 203, 255, .58) !important;
    border-radius: 7px !important;
    background: linear-gradient(135deg, rgba(42, 139, 218, .92), rgba(91, 84, 208, .92)) !important;
    color: #fff !important;
    font-weight: 900 !important;
    cursor: pointer;
}

body.sips-help-open {
    overflow: hidden !important;
}

@media (max-width: 760px) {
    .sips-help-page-trigger.is-floating {
        top: auto;
        right: auto;
        bottom: 12px;
        left: 12px;
        z-index: 1295;
    }

    .sips-help-layer {
        align-items: end;
        padding: 8px;
    }

    .sips-help-dialog {
        width: 100%;
        max-height: 90vh;
    }

    .sips-help-dialog-body {
        max-height: calc(90vh - 126px);
    }

    .sips-help-dialog-head {
        grid-template-columns: 32px minmax(0, 1fr) 32px;
        gap: 9px;
        padding: 15px 14px 12px;
    }

    .sips-help-dialog-mark {
        width: 30px;
        height: 30px;
    }

    .sips-help-dialog-title {
        font-size: 17px !important;
    }

    .sips-help-dialog-body {
        padding: 14px;
    }

    .sips-help-preview-canvas {
        min-height: 118px;
        padding: 10px;
    }

    .sips-help-preview-sips {
        grid-template-columns: 1fr;
    }

    .sips-help-preview-sips > span:nth-child(n + 3) {
        display: none;
    }

    .sips-help-preview-import {
        grid-template-columns: 1fr 20px 1fr;
        gap: 6px;
    }
}

@media (max-width: 1000px) {
    body.manager-has-sidebar .sips-help-page-trigger.is-floating {
        bottom: 80px;
    }

    body.manager-has-sidebar .mg-side-nav-footer:has(> .sips-help-page-trigger) {
        display: contents !important;
    }

    body.manager-has-sidebar .mg-side-nav-footer:has(> .sips-help-page-trigger) > :not(.sips-help-page-trigger) {
        display: none !important;
    }

    body.manager-has-sidebar .mg-side-nav-footer > .sips-help-page-trigger {
        position: fixed !important;
        left: 12px;
        right: auto;
        top: auto;
        bottom: 80px;
        z-index: 1295;
        margin: 0 !important;
    }
}

/* Compact comment-style help popovers. */
.sips-help-layer {
    display: block;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
}

.sips-help-dialog {
    position: fixed;
    width: min(340px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow: visible;
    border-color: rgba(104, 183, 255, .52);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(14, 27, 54, .99), rgba(8, 13, 31, .99)),
        #0b1328;
    box-shadow: 0 16px 42px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255, 255, 255, .07);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-4px) scale(.985);
    transform-origin: var(--sips-help-arrow-x, 50%) top;
    transition: opacity .14s ease, transform .14s ease;
}

.sips-help-dialog[data-placement="top"] {
    transform: translateY(4px) scale(.985);
    transform-origin: var(--sips-help-arrow-x, 50%) bottom;
}

.sips-help-layer.is-open .sips-help-dialog {
    opacity: 1;
    transform: none;
}

.sips-help-dialog::before {
    height: 2px;
    border-radius: 8px 8px 0 0;
}

.sips-help-dialog::after {
    content: "";
    position: absolute;
    left: calc(var(--sips-help-arrow-x, 50%) - 6px);
    width: 11px;
    height: 11px;
    background: #0d1a36;
    transform: rotate(45deg);
}

.sips-help-dialog[data-placement="bottom"]::after {
    top: -6px;
    border-top: 1px solid rgba(104, 183, 255, .52);
    border-left: 1px solid rgba(104, 183, 255, .52);
}

.sips-help-dialog[data-placement="top"]::after {
    bottom: -6px;
    border-right: 1px solid rgba(104, 183, 255, .52);
    border-bottom: 1px solid rgba(104, 183, 255, .52);
}

.sips-help-dialog[data-placement="free"]::after {
    content: none;
}

.sips-help-dialog-head {
    grid-template-columns: 24px minmax(0, 1fr) 24px;
    gap: 8px;
    padding: 10px 10px 8px;
}

.sips-help-dialog-mark {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 12px;
}

.sips-help-dialog-kicker {
    margin-bottom: 1px;
    font-size: 8px;
}

.sips-help-dialog-title {
    font-size: 14px !important;
    line-height: 1.25 !important;
}

.sips-help-dialog-close {
    width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 17px !important;
}

.sips-help-dialog-body {
    max-height: min(260px, calc(100vh - 84px));
    padding: 10px 12px 12px;
    overflow: auto;
}

.sips-help-summary {
    font-size: 12.5px;
    line-height: 1.45;
}

.sips-help-section {
    margin-top: 10px;
}

.sips-help-overview {
    margin-top: 0;
}

.sips-help-section-title {
    margin-bottom: 5px;
    font-size: 9px;
}

.sips-help-steps {
    display: block;
    margin: 0 0 0 17px;
    padding: 0;
    list-style: decimal outside;
    counter-reset: none;
}

.sips-help-steps li {
    display: list-item;
    min-height: 0;
    margin: 4px 0;
    padding: 0 0 0 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #cbd9ed;
    font-size: 11.5px;
    line-height: 1.4;
    counter-increment: none;
}

.sips-help-steps li::before {
    content: none;
}

.sips-help-important {
    margin-top: 9px;
    padding: 7px 8px;
    border-left-width: 2px;
    font-size: 11.5px;
    line-height: 1.4;
}

.sips-help-preview,
.sips-help-dialog-footer {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .sips-help-trigger,
    .sips-help-layer,
    .sips-help-dialog {
        transition: none !important;
    }
}
