/* Custom time picker for every input[type=time]. */

.tp-field {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
}

.tp-field > input.tp-ready {
    padding-right: 36px;
    cursor: pointer;
}

.tp-field.is-compact > input.tp-ready {
    padding-right: 22px;
}

.tp-field > input.tp-ready::-webkit-calendar-picker-indicator,
.tp-field > input.tp-ready::-webkit-clear-button,
.tp-field > input.tp-ready::-webkit-inner-spin-button {
    display: none;
    -webkit-appearance: none;
    opacity: 0;
    width: 0;
    margin: 0;
    pointer-events: none;
}

.tp-open-btn {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0 10px 10px 0;
    background: transparent;
    color: #7C6CF2;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}

.tp-field.is-compact .tp-open-btn {
    width: 22px;
}

.tp-open-btn svg {
    display: block;
    width: 16px;
    height: 16px;
}

.tp-field.is-compact .tp-open-btn svg {
    width: 14px;
    height: 14px;
}

.tp-open-btn:hover,
.tp-field:focus-within .tp-open-btn {
    color: #6858e4;
}

.tp-field:has(input:disabled) .tp-open-btn,
.tp-field:has(input:read-only) .tp-open-btn {
    color: #b7b1c9;
    cursor: not-allowed;
}

body.portal-body .tp-open-btn {
    color: #e7d3a1;
}

body.portal-body .tp-open-btn:hover,
body.portal-body .tp-field:focus-within .tp-open-btn {
    color: #f3e7c4;
}

.tp-pop {
    position: fixed;
    z-index: 10050;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 292px;
    max-width: calc(100vw - 16px);
    padding: 12px;
    border: 1px solid #E7E4F2;
    border-radius: 16px;
    background: #fff;
    color: #2C2840;
    box-shadow: 0 18px 48px rgba(44, 40, 64, 0.18);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.2;
    overflow: hidden;
    user-select: none;
}

.tp-pop[hidden] {
    display: none !important;
}

.tp-head,
.tp-foot {
    flex: none;
}

.tp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.tp-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #b7aef0 transparent;
    touch-action: pan-y;
}

.tp-body::-webkit-scrollbar {
    width: 8px;
}

.tp-body::-webkit-scrollbar-thumb {
    background: #c4bdf0;
    border-radius: 8px;
}

.tp-display {
    display: flex;
    align-items: baseline;
    min-width: 0;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.tp-display.is-empty {
    color: #9a94ad;
    font-weight: 600;
}

.tp-colon {
    margin: 0 1px;
    color: #7C6CF2;
}

.tp-now,
.tp-clear,
.tp-done,
.tp-step,
.tp-opt {
    margin: 0;
    border: 0;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    appearance: none;
}

.tp-now,
.tp-clear,
.tp-done,
.tp-step {
    border-radius: 10px;
    font-weight: 600;
}

.tp-now {
    padding: 8px 12px;
    background: #F3F1FE;
    color: #6858e4;
}

.tp-now:hover,
.tp-clear:hover,
.tp-step:hover {
    background: #E7E2FC;
}

.tp-section {
    margin-top: 8px;
}

.tp-label {
    display: block;
    margin: 0 2px 6px;
    color: #6f6986;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tp-label.is-active {
    color: #6858e4;
}

.tp-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: #F7F7FC;
}

.tp-grid.is-active {
    background: #F3F1FE;
    box-shadow: inset 0 0 0 1px #DDD6FE;
}

.tp-opt {
    height: 32px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: #2C2840;
    width: 100%;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.tp-opt:hover:not(:disabled):not(.is-selected) {
    background: #fff;
    color: #6858e4;
}

.tp-opt.is-selected,
.tp-opt.is-selected:hover {
    background: #7C6CF2;
    color: #fff;
}

.tp-opt:disabled {
    opacity: 0.28;
    cursor: not-allowed;
}

.tp-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    background: #fff;
}

.tp-pop.is-scroll .tp-foot {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #E7E4F2;
}

.tp-clear,
.tp-done,
.tp-step {
    height: 34px;
}

.tp-clear {
    padding: 0 10px;
    background: transparent;
    color: #6f6986;
}

.tp-stepper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tp-step {
    width: 34px;
    padding: 0;
    background: #F3F1FE;
    color: #6858e4;
    font-size: 18px;
}

.tp-exact {
    min-width: 28px;
    color: #2C2840;
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.tp-exact.is-precise {
    color: #6858e4;
}

.tp-done {
    padding: 0 14px;
    background: #7C6CF2;
    color: #fff;
}

.tp-done:hover {
    background: #6858e4;
}

.tp-pop button:focus {
    outline: none;
}

.tp-pop button:focus-visible {
    box-shadow: inset 0 0 0 2px #2C2840;
}

.tp-opt.is-selected:focus-visible,
.tp-done:focus-visible {
    box-shadow: inset 0 0 0 2px #fff;
}

@media (max-height: 720px) {
    .tp-display {
        font-size: 26px;
    }

    .tp-opt,
    .tp-clear,
    .tp-done,
    .tp-step,
    .tp-now {
        height: 28px;
    }

    .tp-section {
        margin-top: 6px;
    }
}
