/*
 * DayPilot global header search, v1.
 *
 * Host layouts may set these custom properties on .dpsh:
 * --dpsh-inline-size, --dpsh-accent, --dpsh-focus,
 * --dpsh-control-background, --dpsh-control-text,
 * --dpsh-control-border, --dpsh-control-hover-background,
 * --dpsh-control-hover-border, --dpsh-control-placeholder,
 * --dpsh-control-action-hover, --dpsh-panel-background,
 * --dpsh-panel-text, --dpsh-panel-muted, --dpsh-panel-action,
 * --dpsh-panel-focus, --dpsh-panel-border,
 * --dpsh-panel-active-background, --dpsh-panel-shadow, and
 * --dpsh-z-index. Override the control variables for a light host header.
 */
.dpsh {
    --dpsh-inline-size: clamp(14rem, 28vw, 23rem);
    --dpsh-accent: #1686d9;
    --dpsh-focus: #8fd0ff;
    --dpsh-control-background: rgba(255, 255, 255, 0.12);
    --dpsh-control-text: #ffffff;
    --dpsh-control-border: rgba(255, 255, 255, 0.4);
    --dpsh-control-hover-background: rgba(255, 255, 255, 0.17);
    --dpsh-control-hover-border: rgba(255, 255, 255, 0.62);
    --dpsh-control-placeholder: rgba(255, 255, 255, 0.76);
    --dpsh-control-action-hover: rgba(255, 255, 255, 0.16);
    --dpsh-panel-background: #ffffff;
    --dpsh-panel-text: #172033;
    --dpsh-panel-muted: #667085;
    --dpsh-panel-action: #0874bd;
    --dpsh-panel-focus: #075c99;
    --dpsh-panel-border: #d8dee9;
    --dpsh-panel-active-background: #eaf4fc;
    --dpsh-panel-shadow: 0 18px 45px rgba(10, 24, 45, 0.24);
    --dpsh-z-index: 3000;

    position: relative;
    display: block;
    inline-size: var(--dpsh-inline-size);
    max-inline-size: calc(100vw - 1rem);
    color: var(--dpsh-control-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.35;
    text-align: start;
}

.dpsh,
.dpsh * {
    box-sizing: border-box;
}

.dpsh .dpsh__form {
    display: block;
    margin: 0;
    padding: 0;
}

.dpsh__control {
    display: flex;
    align-items: stretch;
    min-block-size: 38px;
    overflow: hidden;
    border: 1px solid var(--dpsh-control-border);
    border-radius: 999px;
    background: var(--dpsh-control-background);
    color: var(--dpsh-control-text);
    transition:
        border-color 120ms ease,
        background-color 120ms ease,
        box-shadow 120ms ease;
}

@supports (backdrop-filter: blur(8px)) {
    .dpsh__control {
        backdrop-filter: blur(8px);
    }
}

.dpsh__control:hover {
    border-color: var(--dpsh-control-hover-border);
    background: var(--dpsh-control-hover-background);
}

.dpsh__control:focus-within {
    border-color: var(--dpsh-focus);
    box-shadow: 0 0 0 3px rgba(143, 208, 255, 0.38);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--dpsh-focus) 38%, transparent);
}

.dpsh .dpsh__input {
    min-inline-size: 0;
    inline-size: 100%;
    block-size: 36px;
    margin: 0;
    padding: 7px 4px 7px 14px;
    border: 0;
    border-radius: 999px 0 0 999px;
    outline: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 14px;
    line-height: 22px;
    appearance: none;
}

.dpsh .dpsh__input::-webkit-search-cancel-button {
    cursor: pointer;
}

.dpsh .dpsh__input::placeholder {
    color: var(--dpsh-control-placeholder);
    opacity: 1;
}

.dpsh .dpsh__submit {
    display: inline-flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    min-inline-size: 42px;
    min-block-size: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0 999px 999px 0;
    outline: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    appearance: none;
    transition: background-color 120ms ease, transform 120ms ease;
}

.dpsh .dpsh__submit:hover,
.dpsh .dpsh__submit:focus-visible {
    background: var(--dpsh-control-action-hover);
}

.dpsh .dpsh__submit:focus-visible {
    box-shadow: inset 0 0 0 2px var(--dpsh-focus);
}

.dpsh .dpsh__submit:active {
    transform: scale(0.94);
}

.dpsh__submit svg {
    inline-size: 19px;
    block-size: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.dpsh .dpsh__preview {
    position: absolute;
    z-index: var(--dpsh-z-index);
    inset-block-start: calc(100% + 7px);
    inset-inline-end: 0;
    inline-size: min(36rem, calc(100vw - 2rem));
    min-inline-size: min(100%, calc(100vw - 2rem));
    max-inline-size: calc(100vw - 2rem);
    max-block-size: min(70vh, 30rem);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--dpsh-panel-border);
    border-radius: 12px;
    background: var(--dpsh-panel-background);
    box-shadow: var(--dpsh-panel-shadow);
    color: var(--dpsh-panel-text);
    text-align: start;
    scrollbar-gutter: stable;
}

.dpsh .dpsh__preview[hidden] {
    display: none !important;
}

.dpsh__group + .dpsh__group,
.dpsh__group + .dpsh__option--full,
.dpsh__empty + .dpsh__option--full {
    margin-block-start: 5px;
    padding-block-start: 5px;
    border-block-start: 1px solid var(--dpsh-panel-border);
}

.dpsh__heading {
    padding: 5px 10px 4px;
    color: var(--dpsh-panel-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.055em;
    line-height: 1.2;
    text-transform: uppercase;
}

.dpsh .dpsh__option,
.dpsh .dpsh__option:link,
.dpsh .dpsh__option:visited {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    min-block-size: 44px;
    margin: 0;
    padding: 7px 10px;
    border: 0;
    border-inline-start: 3px solid transparent;
    border-radius: 8px;
    outline: 0;
    background: transparent;
    color: var(--dpsh-panel-text);
    font: inherit;
    line-height: 1.25;
    text-decoration: none;
    cursor: pointer;
}

.dpsh .dpsh__option:hover,
.dpsh .dpsh__option[aria-selected="true"] {
    border-inline-start-color: var(--dpsh-panel-focus);
    background: var(--dpsh-panel-active-background);
    background: color-mix(in srgb, var(--dpsh-accent) 12%, transparent);
    color: var(--dpsh-panel-text);
}

.dpsh .dpsh__option:focus-visible {
    box-shadow: inset 0 0 0 2px var(--dpsh-panel-focus);
}

.dpsh__title {
    min-inline-size: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dpsh__option--api .dpsh__title {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
}

.dpsh__context {
    min-inline-size: 0;
    overflow: hidden;
    margin-block-start: 2px;
    color: var(--dpsh-panel-muted);
    font-size: 12px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dpsh .dpsh__option:hover .dpsh__context,
.dpsh .dpsh__option[aria-selected="true"] .dpsh__context {
    color: var(--dpsh-panel-focus);
}

.dpsh .dpsh__option.dpsh__option--query {
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    column-gap: 7px;
}

.dpsh__query-icon {
    position: relative;
    display: block;
    align-self: center;
    justify-self: center;
    inline-size: 14px;
    block-size: 14px;
    border: 1.8px solid currentColor;
    border-radius: 50%;
    color: var(--dpsh-panel-muted);
}

.dpsh__query-icon::after {
    position: absolute;
    inset-block-start: 9px;
    inset-inline-start: 9px;
    display: block;
    inline-size: 6px;
    block-size: 1.8px;
    margin: 0;
    border-radius: 999px;
    background: currentColor;
    content: "";
    transform: rotate(45deg);
    transform-origin: left center;
}

.dpsh .dpsh__option--full,
.dpsh .dpsh__option--full:link,
.dpsh .dpsh__option--full:visited {
    color: var(--dpsh-panel-action);
    font-size: 13px;
    font-weight: 650;
}

.dpsh .dpsh__option--full:hover,
.dpsh .dpsh__option--full[aria-selected="true"] {
    color: var(--dpsh-panel-focus);
}

.dpsh__empty {
    padding: 10px;
    color: var(--dpsh-panel-muted);
    font-size: 13px;
    line-height: 1.4;
}

.dpsh__guidance {
    display: grid;
    row-gap: 2px;
    min-block-size: 52px;
    padding: 9px 11px;
    border-radius: 8px;
    cursor: default;
}

.dpsh__guidance-title {
    color: var(--dpsh-panel-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.dpsh__guidance-detail {
    color: var(--dpsh-panel-muted);
    font-size: 12px;
    line-height: 1.35;
}

.dpsh__visually-hidden {
    position: absolute !important;
    inline-size: 1px !important;
    block-size: 1px !important;
    overflow: hidden !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

@media (max-width: 720px) {
    .dpsh {
        --dpsh-inline-size: 100%;
        max-inline-size: 100%;
    }

    .dpsh .dpsh__preview {
        inset-inline: 0;
        inline-size: 100%;
        min-inline-size: 100%;
        max-inline-size: 100%;
        max-block-size: min(65vh, 26rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dpsh__control,
    .dpsh .dpsh__submit {
        transition: none;
    }
}

@media (forced-colors: active) {
    .dpsh__control,
    .dpsh .dpsh__preview {
        border: 1px solid CanvasText;
        background: Canvas;
        color: CanvasText;
        box-shadow: none;
        forced-color-adjust: auto;
    }

    .dpsh .dpsh__input,
    .dpsh .dpsh__submit {
        color: CanvasText;
    }

    .dpsh .dpsh__input::placeholder,
    .dpsh__heading,
    .dpsh__context,
    .dpsh__empty,
    .dpsh__guidance-detail {
        color: GrayText;
    }

    .dpsh .dpsh__option:hover,
    .dpsh .dpsh__option[aria-selected="true"] {
        border-inline-start-color: HighlightText;
        background: Highlight;
        color: HighlightText;
    }

    .dpsh .dpsh__option:hover .dpsh__context,
    .dpsh .dpsh__option[aria-selected="true"] .dpsh__context {
        color: HighlightText;
    }

    .dpsh .dpsh__option:focus-visible,
    .dpsh .dpsh__submit:focus-visible,
    .dpsh__control:focus-within {
        outline: 2px solid Highlight;
        outline-offset: 2px;
        box-shadow: none;
    }
}
