/* ===== OmboxDatePicker ===== */
.ombox-datepicker-wrap {
    position: relative;
    display: block;
}
.ombox-datepicker-wrap.is-modal-expanded {
    padding-bottom: var(--ombox-dp-modal-space, 0);
}
.ombox-datepicker-wrap.is-modal-expanded .ombox-dp-popup {
    top: calc(var(--widget-control-min-height, 38px) + 4px);
}
.ombox-dp-input {
    width: 100%;
    box-sizing: border-box;
    min-height: var(--widget-control-min-height, 38px);
    height: var(--widget-control-min-height, 38px);
    font-size: var(--widget-font-size, 14px);
    line-height: var(--widget-line-height, 1.571);
    border-radius: var(--widget-control-radius, var(--radius-md, 8px));
    cursor: pointer;
    background-color: #fff !important;
}
.ombox-dp-input[readonly]:focus {
    border-color: var(--color-primary, #0087f7);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--color-primary, #0087f7) 18%, transparent);
}
.ombox-dp-input:disabled {
    color: var(--color-text-muted, #697586);
    background-color: var(--color-surface-muted, #e9ecef) !important;
    cursor: not-allowed;
    opacity: 1;
}
.ombox-dp-input.is-invalid,
.ombox-dp-input[aria-invalid="true"],
.ombox-dp-input:invalid {
    border-color: var(--color-border, #dee2e6);
    box-shadow: none;
}
.ombox-dp-input.is-invalid:focus,
.ombox-dp-input[aria-invalid="true"]:focus,
.ombox-dp-input:invalid:focus {
    border-color: var(--color-primary, #0087f7);
    box-shadow: none;
}
/* ---- popup ---- */
.ombox-dp-popup {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 1055;
    min-width: 252px;
    background: #fff;
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(20, 32, 50, .13);
    padding: 10px;
    user-select: none;
}
.ombox-dp-popup.is-above {
    top: auto;
    bottom: calc(100% + 4px);
}

/* ---- calendar navigation ---- */
.ombox-dp-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.ombox-dp-cal-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary, #202733);
}
.ombox-dp-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: 6px;
    background: #fff;
    color: var(--text-primary, #202733);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.ombox-dp-nav-btn:hover {
    border-color: #0087f7;
    color: #0087f7;
    background: #f0f8ff;
}

/* ---- day grid ---- */
.ombox-dp-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.ombox-dp-day-hdr {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    color: var(--text-muted, #697586);
    font-size: var(--widget-small-font-size, 12px);
    font-weight: 600;
    line-height: var(--widget-small-line-height, 1.5);
}
.ombox-dp-day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    border-radius: 6px;
    border: 0;
    background: transparent;
    color: var(--text-primary, #202733);
    font-size: var(--widget-font-size, 14px);
    line-height: var(--widget-line-height, 1.571);
    cursor: pointer;
    padding: 0;
    width: 100%;
    transition: background .12s, color .12s;
}
.ombox-dp-day:hover:not(.is-disabled):not(.ombox-dp-day-empty) {
    background: #eef6ff;
    color: #0087f7;
}
.ombox-dp-day-empty {
    pointer-events: none;
}
.ombox-dp-day.is-today {
    font-weight: 700;
    color: #0087f7;
}
.ombox-dp-day.is-selected {
    background: #0087f7 !important;
    color: #fff !important;
    font-weight: 600;
}
.ombox-dp-day.is-disabled {
    color: #c0c8d4;
    cursor: not-allowed;
}

/* ---- month picker ---- */
.ombox-dp-month-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}
.ombox-dp-month {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-primary, #202733);
    cursor: pointer;
    display: flex;
    font-size: var(--widget-font-size, 14px);
    height: 34px;
    justify-content: center;
    padding: 0 8px;
}
.ombox-dp-month:hover:not(.is-disabled) {
    background: #eef6ff;
    border-color: #cfe5ff;
    color: #0087f7;
}
.ombox-dp-month.is-selected {
    background: #0087f7;
    border-color: #0087f7;
    color: #fff;
    font-weight: 600;
}
.ombox-dp-month.is-disabled {
    color: #c0c8d4;
    cursor: not-allowed;
}

/* ---- time picker ---- */
.ombox-dp-time {
    border-top: 1px solid var(--color-border, #dee2e6);
    margin-top: 8px;
    padding-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}
.ombox-dp-time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.ombox-dp-time-sep {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #202733);
    margin: 0 4px;
    padding-bottom: 2px;
}
.ombox-dp-time-val {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: var(--widget-control-min-height, 38px);
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: var(--widget-control-radius, 8px);
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary, #202733);
    background: #f9fafc;
}
.ombox-dp-time-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 26px;
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: 5px;
    background: #fff;
    color: var(--text-muted, #697586);
    font-size: var(--widget-small-font-size, 12px);
    line-height: var(--widget-small-line-height, 1.5);
    cursor: pointer;
    padding: 0;
    transition: border-color .12s, color .12s, background .12s;
}
.ombox-dp-time-btn:hover {
    border-color: #0087f7;
    color: #0087f7;
    background: #f0f8ff;
}
.ombox-dp-time-confirm {
    margin-left: 10px;
    align-self: center;
    padding: 5px 12px;
    border: 0;
    border-radius: 6px;
    background: #0087f7;
    color: #fff;
    font-size: var(--widget-font-size, 14px);
    font-weight: 600;
    cursor: pointer;
    height: 32px;
}
.ombox-dp-time-confirm:hover {
    background: #006fcf;
}

/* ---- eye-protection ---- */
body.eye-protection .ombox-dp-input {
    background: var(--bg-card, #fbfefb) !important;
}
body.eye-protection .ombox-dp-popup {
    background: var(--bg-card, #fbfefb);
    border-color: var(--border-color, #cfe3d2);
}
body.eye-protection .ombox-dp-cal-title,
body.eye-protection .ombox-dp-day {
    color: var(--text-primary, #24422f);
}
body.eye-protection .ombox-dp-day:hover:not(.is-disabled):not(.ombox-dp-day-empty) {
    background: #edf7ee;
    color: var(--primary-color, #4f9d69);
}
body.eye-protection .ombox-dp-day.is-today {
    color: var(--primary-color, #4f9d69);
}
body.eye-protection .ombox-dp-day.is-selected {
    background: var(--primary-color, #4f9d69) !important;
    color: #fff !important;
}
body.eye-protection .ombox-dp-month {
    color: var(--text-primary, #24422f);
}
body.eye-protection .ombox-dp-month:hover:not(.is-disabled) {
    background: #edf7ee;
    border-color: var(--border-color, #cfe3d2);
    color: var(--primary-color, #4f9d69);
}
body.eye-protection .ombox-dp-month.is-selected {
    background: var(--primary-color, #4f9d69);
    border-color: var(--primary-color, #4f9d69);
    color: #fff;
}
body.eye-protection .ombox-dp-time-val {
    background: var(--bg-gray, #edf7ee);
    border-color: var(--border-color, #cfe3d2);
    color: var(--text-primary, #24422f);
}
body.eye-protection .ombox-dp-time-btn,
body.eye-protection .ombox-dp-nav-btn {
    background: var(--bg-card, #fbfefb);
    border-color: var(--border-color, #cfe3d2);
    color: var(--text-secondary, #52695a);
}
body.eye-protection .ombox-dp-time-confirm {
    background: var(--primary-color, #4f9d69);
}
