.panel-date {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .25rem;
    max-width: 100%;
    vertical-align: baseline;
    overflow-wrap: anywhere;
}

.panel-date__value {
    min-width: 0;
    font: inherit;
    color: inherit;
    white-space: normal;
}

.panel-date__value[dir="ltr"] {
    direction: ltr;
    unicode-bidi: isolate;
}

.panel-date__value[data-date-trigger] {
    cursor: help;
    border-radius: .35rem;
    outline: none;
}

.panel-date__value[data-date-trigger]:focus-visible {
    box-shadow: 0 0 0 .2rem color-mix(in srgb, currentColor 24%, transparent);
}

.panel-date__value--null,
.panel-date__value--invalid {
    opacity: .78;
}

.panel-date__tooltip {
    position: absolute;
    z-index: 1085;
    inset-inline-start: 50%;
    bottom: calc(100% + .5rem);
    width: max-content;
    max-width: min(20rem, calc(100vw - 2rem));
    padding: .45rem .65rem;
    border-radius: .45rem;
    background: #242745;
    color: #fff;
    font-size: .78rem;
    line-height: 1.55;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(50%) translateY(.2rem);
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}

.panel-date__tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    inset-inline-start: 50%;
    width: .55rem;
    height: .55rem;
    background: inherit;
    transform: translateX(50%) translateY(-50%) rotate(45deg);
}

.panel-date[data-date-open="true"] .panel-date__tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(50%) translateY(0);
}

.panel-date__touch-toggle {
    display: none;
    min-height: 2rem;
    padding: .2rem .5rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: .75rem;
    line-height: 1.4;
}

.panel-date__touch-toggle:focus-visible {
    outline: .15rem solid currentColor;
    outline-offset: .12rem;
}

.panel-date__touch-detail {
    flex-basis: 100%;
    width: fit-content;
    max-width: 100%;
    padding: .35rem .5rem;
    border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
    border-radius: .4rem;
    background: color-mix(in srgb, currentColor 7%, transparent);
    font-size: .8rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.panel-date__touch-detail[hidden] {
    display: none;
}

@media (hover: none), (pointer: coarse) {
    .panel-date__touch-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .panel-date__tooltip {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .panel-date__tooltip {
        transition: none;
    }
}
