/*
 * 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; }
}

/* Hershey's audit Oct 26 2026 item 12: tap grids, not drop-down lists. */
.tpk-wheels { display: block; }
.tpk-label { margin: 12px 0 6px; font-size: 1rem; font-weight: 700; color: var(--muted); }
.tpk-grid { display: grid; grid-template-columns: repeat(var(--grid-cols, 6), 1fr); gap: 8px; }
.tpk-ampm { margin-top: 8px; }
.tpk-cell { min-width: 0; padding: 0 4px; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.tpk-cell[aria-pressed="true"] { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; }
.tpk-hour .tpk-cell, .tpk-minute .tpk-cell { min-height: 60px; }
.tpk-fine { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.tpk-minus, .tpk-plus { font-size: 1.15rem; color: var(--muted); }
.tpk-readout { font-size: 2.6rem; }
@media (max-width: 380px) { .tpk-cell { font-size: 1.1rem; } }


/* Hershey, Oct 26 2026 (4:34 PM PT): design A -- scroll wheels.
   hour | minutes 00-59 | AM/PM, 84px rows, the middle row in a highlighted
   band (--primary-light), five rows visible. Palette tokens only. */
.tpk-dialog { width: min(600px, 100%); padding: 20px 22px 22px; border-radius: 20px; }
.tpk-head { flex-direction: column; align-items: center; gap: 4px; margin-bottom: 4px; text-align: center; }
.tpk-readout { font-size: 4.6rem; font-weight: 800; line-height: 1; }
.tpk-half { color: var(--primary-strong); font-size: 0.6em; font-weight: 800; }
.tpk-hint { margin: 6px 0 12px; text-align: center; color: var(--muted); font-size: 1.05rem; }
.tpk-wheels {
    position: relative; display: grid; grid-template-columns: 1fr auto 1fr 1fr;
    align-items: center; gap: 6px; height: 420px; padding: 0 8px;
    border: 2px solid var(--border); border-radius: 18px; background: var(--surface);
    overflow: hidden;
}
.tpk-wheels.tpk-wheels-24 { grid-template-columns: 1fr auto 1fr; }
.tpk-band {
    position: absolute; left: 8px; right: 8px; top: 168px; height: 84px;
    background: var(--primary-light); border-radius: 14px; pointer-events: none;
}
.tpk-wheel-wrap { position: relative; height: 420px; min-width: 0; }
.tpk-wheel {
    position: relative; height: 420px; overflow-y: auto; overscroll-behavior: contain;
    scroll-snap-type: y mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%);
}
.tpk-wheel::-webkit-scrollbar { display: none; }
.tpk-wheel:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; border-radius: 14px; }
.tpk-pad { height: 168px; }
.tpk-row {
    display: block; width: 100%; height: 84px; min-height: 84px; padding: 0;
    border: 0; border-radius: 0; background: transparent; color: var(--muted);
    font-size: 2.3rem; font-weight: 700; font-variant-numeric: tabular-nums;
    scroll-snap-align: center;
}
.tpk-row:hover { border: 0; }
.tpk-row[aria-selected="true"] { color: var(--text); font-size: 2.9rem; font-weight: 800; }
.tpk-ampm .tpk-row { font-size: 2rem; }
.tpk-ampm .tpk-row[aria-selected="true"] { color: var(--primary-strong); font-size: 2.4rem; }
.tpk-wheels .tpk-colon { position: relative; font-size: 2.6rem; font-weight: 800; color: var(--text); }
.tpk-now {
    min-height: 84px; margin-top: 16px; background: var(--primary-light);
    border-color: var(--primary-light); color: var(--primary-stronger); font-size: 1.6rem;
}
.tpk-actions { grid-template-columns: 1fr 1fr 1.4fr; margin-top: 14px; }
.tpk-actions .tpk-btn { min-height: 72px; font-size: 1.4rem; }
@media (max-width: 480px) {
    .tpk-readout { font-size: 3.4rem; }
    .tpk-row { font-size: 1.9rem; }
    .tpk-row[aria-selected="true"] { font-size: 2.3rem; }
}
@media (max-height: 760px) {
    .tpk-wheels, .tpk-wheel-wrap, .tpk-wheel { height: 252px; }
    .tpk-pad { height: 84px; }
    .tpk-band { top: 84px; }
}


/* Hershey, Oct 26 2026 (4:44 PM PT): "make it look light" -- lighter type,
   thin soft lines, a very pale middle band, more white space, no heavy
   borders or shadows. Same palette tokens. */
.tpk-backdrop { background: rgba(43, 42, 40, 0.35); }
.tpk-dialog { padding: 26px 26px 24px; box-shadow: 0 6px 24px rgba(43, 42, 40, 0.12); }
.tpk-title { font-weight: 500; font-size: 1.05rem; }
.tpk-readout { font-weight: 500; letter-spacing: -0.01em; }
.tpk-half { font-weight: 500; }
.tpk-hint { font-size: 1rem; margin: 8px 0 16px; }
.tpk-wheels { border: 1px solid var(--border); background: #fff; }
.tpk-band { background: var(--primary-light); opacity: 0.55; }
.tpk-row { font-weight: 400; color: var(--muted); opacity: 0.75; }
.tpk-row[aria-selected="true"] { font-weight: 600; color: var(--text); opacity: 1; }
.tpk-ampm .tpk-row[aria-selected="true"] { font-weight: 600; }
.tpk-wheels .tpk-colon { font-weight: 400; color: var(--muted); }
.tpk-btn { border-width: 1px; font-weight: 500; }
.tpk-now { background: #fff; border-color: var(--primary-light); color: var(--primary-strong); font-weight: 500; }
.tpk-ok { font-weight: 600; }


/* FINAL (Hershey approved, Oct 26 2026): A_light -- clean, light wheels.
   Matches /files/kiosk_time_picker_board/A_light.jpg. Palette tokens plus
   the two lighter tints the spec allows (band #EEF6F4, hairlines #EFECE7). */
.tpk-backdrop { background: rgba(20, 20, 18, 0.32); align-items: flex-start; padding: 120px 30px 20px; }
.tpk-dialog {
    width: min(740px, 100%); padding: 30px 34px 30px; border-radius: 24px;
    box-shadow: 0 10px 30px rgba(20, 20, 18, 0.12);
}
.tpk-head { flex-direction: row; justify-content: space-between; align-items: baseline; text-align: left; margin: 0; }
.tpk-title { font-size: 1.75rem; font-weight: 500; color: var(--text); }
.tpk-status {
    height: 30px; margin: 2px 0 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    font-size: 1.3rem; line-height: 30px; color: var(--muted); cursor: default;
}
.tpk-status.tpk-status-error { color: #b42318; font-weight: 500; cursor: pointer; }
.tpk-status.tpk-status-ok { color: var(--primary-strong); font-weight: 500; }
.tpk-readout {
    display: block; text-align: center; margin: 6px 0 22px;
    font-size: 6.5rem; font-weight: 300; line-height: 1; letter-spacing: -0.02em; color: var(--text);
}
.tpk-half { font-size: 3rem; font-weight: 400; color: var(--primary-strong); letter-spacing: 0; }
.tpk-dialog.tpk-blocked .tpk-readout,
.tpk-dialog.tpk-blocked .tpk-row[aria-selected="true"] { color: #b42318; }
.tpk-wheels {
    height: 460px; padding: 0; gap: 0; border: 0; border-radius: 0; background: #fff;
    border-top: 1px solid #EFECE7; border-bottom: 1px solid #EFECE7;
    grid-template-columns: 1fr 40px 1fr 1fr;
}
.tpk-wheels.tpk-wheels-24 { grid-template-columns: 1fr 40px 1fr; }
.tpk-band {
    left: 0; right: 0; top: 184px; height: 92px; border-radius: 0; opacity: 1;
    background: #EEF6F4; border-top: 1px solid var(--primary-light); border-bottom: 1px solid var(--primary-light);
}
.tpk-wheel-wrap, .tpk-wheel { height: 460px; }
.tpk-wheel { -webkit-mask-image: none; mask-image: none; }
.tpk-pad { height: 184px; }
.tpk-row {
    height: 92px; min-height: 92px; font-size: 2.4rem; font-weight: 300; color: var(--text); opacity: 0.42;
}
.tpk-row[data-d="1"] { font-size: 2.6rem; opacity: 0.6; }
.tpk-row[data-d="0"], .tpk-row[aria-selected="true"] { font-size: 3.4rem; font-weight: 500; color: var(--primary-stronger); opacity: 1; }
.tpk-row[data-d="3"] { opacity: 0.25; }
.tpk-minute .tpk-row[data-value="0"], .tpk-minute .tpk-row[data-value="15"],
.tpk-minute .tpk-row[data-value="30"], .tpk-minute .tpk-row[data-value="45"] { font-weight: 400; }
.tpk-ampm .tpk-row { font-size: 2.4rem; }
.tpk-ampm .tpk-row[aria-selected="true"] { font-size: 3rem; color: var(--primary-stronger); font-weight: 500; }
.tpk-wheels .tpk-colon { text-align: center; font-size: 2rem; font-weight: 400; color: var(--primary-stronger); }
.tpk-now {
    min-height: 84px; margin-top: 22px; background: #fff; border: 1px solid var(--primary-light);
    color: var(--primary-strong); font-size: 1.6rem; font-weight: 500; border-radius: 14px;
}
.tpk-actions { grid-template-columns: 1fr 1fr 1.4fr; gap: 14px; margin-top: 16px; }
.tpk-actions .tpk-btn { min-height: 88px; font-size: 1.6rem; font-weight: 400; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: var(--text); }
.tpk-actions .tpk-ok { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; font-weight: 500; }
.tpk-actions .tpk-ok:disabled { opacity: 0.35; }
.tpk-undo {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 10001;
    display: flex; align-items: center; gap: 18px; padding: 12px 14px 12px 22px;
    background: var(--text); color: #fff; border-radius: 14px; font-size: 1.2rem;
}
.tpk-undo-text { white-space: nowrap; }
.tpk-undo-btn { min-height: 56px; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.5); }
@media (max-width: 560px) {
    .tpk-backdrop { padding: 16px 12px; align-items: center; }
    .tpk-dialog { padding: 20px 18px; }
    .tpk-readout { font-size: 4.4rem; }
    .tpk-half { font-size: 2rem; }
    .tpk-row { font-size: 1.9rem; }
    .tpk-row[data-d="0"], .tpk-row[aria-selected="true"] { font-size: 2.6rem; }
}
@media (max-height: 900px) {
    .tpk-backdrop { padding-top: 16px; align-items: center; }
    .tpk-wheels, .tpk-wheel-wrap, .tpk-wheel { height: 276px; }
    .tpk-pad { height: 92px; }
    .tpk-band { top: 92px; }
    .tpk-readout { font-size: 4.6rem; margin-bottom: 12px; }
}
