/*
 * The shared touch time picker (static/js/time-picker.js): a plain
 * phone-alarm style dialog -- hour, minute, AM / PM lists, Now, Cancel, OK.
 * Colours are the :root tokens in style.css (loaded first). Every target is
 * at least 56px; the three lists are 80px tall.
 */
/* The field: no native clock icon, a tap opens the picker instead. */
input.tpk-field { cursor: pointer; }
input.tpk-field::-webkit-calendar-picker-indicator { display: none; }

.tpk-backdrop {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 12px;
    background: rgba(43, 42, 40, 0.55);
}
.tpk-dialog {
    width: min(520px, 100%); max-height: 100%; overflow: auto;
    padding: 16px 18px 18px;
    background: var(--surface); color: var(--text);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(43, 42, 40, 0.25);
}
.tpk-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.tpk-title { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--muted); }
.tpk-readout {
    font-size: 2.2rem; font-weight: 800; line-height: 1.1;
    font-variant-numeric: tabular-nums; color: var(--text);
}

/* Hour : Minute  AM/PM -- three big lists side by side. */
.tpk-wheels {
    display: grid; grid-template-columns: 1fr auto 1fr 1fr;
    align-items: center; gap: 10px;
}
.tpk-wheels-24 { grid-template-columns: 1fr auto 1fr; }
.tpk-colon { font-size: 2.4rem; font-weight: 800; color: var(--muted); }
.tpk-sel {
    width: 100%; min-width: 0; min-height: 80px; padding: 0 12px;
    border: 2px solid var(--border); border-radius: 14px;
    background: var(--surface); color: var(--text);
    font: inherit; font-size: 2.2rem; font-weight: 800;
    font-variant-numeric: tabular-nums; text-align: center; text-align-last: center;
    cursor: pointer; touch-action: manipulation;
}
.tpk-sel:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.tpk-hour, .tpk-minute { border-color: var(--primary); }
.tpk-ampm { font-size: 1.6rem; }

.tpk-btn {
    min-height: 56px; min-width: 56px; padding: 0 12px;
    border: 2px solid var(--border); border-radius: 12px;
    background: var(--surface); color: var(--text);
    font: inherit; font-size: 1.3rem; font-weight: 700;
    cursor: pointer; touch-action: manipulation;
}
.tpk-btn:hover { border-color: var(--primary); }
.tpk-btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.tpk-btn:disabled { opacity: 0.35; cursor: default; }

.tpk-error { margin: 12px 0 0; color: var(--danger-strong); font-weight: 600; }
.tpk-error[hidden] { display: none; }

.tpk-now {
    display: block; width: 100%; min-height: 64px; margin-top: 16px;
    border-color: var(--primary-strong); color: var(--primary-strong);
    font-size: 1.5rem;
}
.tpk-actions {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px; margin-top: 10px;
}
.tpk-clear, .tpk-cancel { color: var(--muted); }
.tpk-ok { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; }
.tpk-ok:hover { background: var(--primary-stronger); border-color: var(--primary-stronger); }

@media (max-width: 380px) {
    .tpk-sel { font-size: 1.7rem; padding: 0 6px; }
    .tpk-readout { font-size: 1.8rem; }
}
