/* =========================
   myTime — Zen Time Picker
========================= */

mytime {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.myTime {
    box-sizing: border-box;
    width: 100%;
    height: var(--zen-ctrl-height);
    min-height: var(--zen-ctrl-height);
    padding: 0 var(--zen-ctrl-padding-x);
    border: 0;
    border-bottom: 1px solid var(--zen-ctrl-border-color);
    border-radius: 0;
    background: transparent;
    color: var(--zen-ctrl-color);
    font-family: var(--zen-ctrl-font-family);
    font-size: var(--zen-ctrl-font-size);
    line-height: normal;
    outline: none;
}

input.myTime { display: block; }

div.myTime,
.myTime.is-readonly {
    display: flex;
    align-items: center;
    cursor: default;
    border-bottom: none;
}

.myTime.is-placeholder { color: var(--zen-theme-placeholder, #9ca3af); }

.myTime-editor {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: var(--zen-ctrl-height);
    min-height: var(--zen-ctrl-height);
    box-sizing: border-box;
    border-bottom: 1px solid var(--zen-ctrl-border-color);
}

.myTime-editor:focus-within { border-bottom-color: var(--zen-theme-focus, #0F6CB7); }

.myTime-editor > input.myTime {
    flex: 1 1 auto !important;
    width: 0 !important;
    min-width: 0;
    max-width: none !important;
    height: 100%;
    min-height: 0;
    padding: 0 var(--zen-ctrl-padding-x);
    border-bottom: 0;
}

.myTime-pickerButton {
    position: static;
    flex: 0 0 var(--zen-ctrl-height);
    width: var(--zen-ctrl-height);
    min-width: var(--zen-ctrl-height);
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.myTime-pickerButton:hover { background: var(--zen-theme-hover-bg, rgba(15, 108, 183, 0.06)); }
.myTime-pickerButton:focus-visible {
    outline: 1px solid var(--zen-theme-focus, #0F6CB7);
    outline-offset: -2px;
}

/* PopupManager owns visibility/positioning. */
.myTime-popup {
    width: 312px;
    box-sizing: border-box;
    padding: 12px;
    background: var(--zen-theme-surface, #fff);
    border: 1px solid var(--zen-theme-border, #d5dbe3);
    border-radius: 5px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    color: var(--zen-ctrl-color);
    font-family: var(--zen-ctrl-font-family);
    font-size: var(--zen-ctrl-font-size);
}

.myTime-header {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.myTime-headerTime {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 164px;
    padding: 5px 8px;
    border-radius: 5px;
    background: var(--zen-theme-surface-muted, #f0f3f7);
}

.myTime-headerPart {
    min-width: 56px;
    height: 48px;
    padding: 0 4px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--zen-theme-text, #44505f);
    cursor: pointer;
    font: inherit;
    font-size: 28px;
    font-weight: 500;
    line-height: 1;
}

.myTime-headerPart.is-active {
    background: var(--zen-theme-selection-bg, #dcecf9);
    color: var(--zen-theme-selection-accent, #0F6CB7);
}

.myTime-headerColon {
    width: 18px;
    text-align: center;
    font-size: 27px;
    line-height: 48px;
}

.myTime-periods {
    display: grid;
    grid-template-rows: 1fr 1fr;
    width: 54px;
    border: 1px solid var(--zen-theme-border, #d5dbe3);
    border-radius: 5px;
    overflow: hidden;
}

.myTime-period {
    border: 0;
    background: transparent;
    color: var(--zen-theme-text, #44505f);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
}

.myTime-period + .myTime-period { border-top: 1px solid var(--zen-theme-border, #d5dbe3); }
.myTime-period.is-active { background: var(--zen-theme-selection-bg, #dcecf9); color: var(--zen-theme-selection-accent, #0F6CB7); }

.myTime-dial {
    position: relative;
    width: 248px;
    height: 248px;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--zen-theme-surface-muted, #f3f5f8);
    user-select: none;
    touch-action: manipulation;
}

.myTime-dialNumber {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    transform: translate(-50%, -50%) translate(var(--time-x), var(--time-y));
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--zen-theme-text, #303844);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    line-height: 34px;
    text-align: center;
}

.myTime-dialNumber.is-inner {
    width: 30px;
    height: 30px;
    font-size: 11px;
    line-height: 30px;
}

.myTime-dialNumber:hover { background: var(--zen-theme-hover-bg, #e3edf6); }
.myTime-dialNumber.is-selected {
    background: var(--zen-theme-selection-bg, #0F6CB7);
    color: var(--zen-theme-selection-text, #fff);
    font-weight: 600;
}

.myTime-hand {
    position: absolute;
    z-index: 1;
    left: calc(50% - 1px);
    bottom: 50%;
    width: 2px;
    height: var(--time-hand-length);
    background: var(--zen-theme-selection-accent, #0F6CB7);
    transform-origin: 50% 100%;
    transform: rotate(var(--time-angle));
    pointer-events: none;
}

.myTime-centerDot {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--zen-theme-selection-accent, #0F6CB7);
    pointer-events: none;
}

.myTime-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--zen-theme-border, #e2e7ed);
}

.myTime-footerRight {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}

.myTime-action {
    min-height: 32px;
    padding: 5px 7px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--zen-theme-text, #44505f);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
}

.myTime-action:hover { background: var(--zen-theme-hover-bg, #f0f3f7); }
.myTime-action--primary { color: var(--zen-theme-action, #0F6CB7); }

@media (max-width: 760px) {
    .myTime-popup {
        width: min(340px, calc(100vw - 16px));
        padding: 13px;
    }

    .myTime-headerPart {
        height: 52px;
        font-size: 30px;
    }

    .myTime-headerColon { line-height: 52px; }

    .myTime-dial {
        width: 264px;
        height: 264px;
    }

    .myTime-dialNumber {
        width: 38px;
        height: 38px;
        line-height: 38px;
    }

    .myTime-dialNumber.is-inner {
        width: 34px;
        height: 34px;
        line-height: 34px;
    }

    .myTime-action {
        min-height: 38px;
        padding: 6px 8px;
    }
}
