.when-picker { position: relative; min-width: 0; }
.when-picker input[type="hidden"] { display: none; }
.when-trigger {
    display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0;
    min-height: 48px; padding: 8px 12px 8px 10px; border: 1px solid var(--line);
    background: #f6f9f9; border-radius: 12px; color: var(--ink); text-align: left;
    cursor: pointer; transition: border .18s ease, box-shadow .18s ease, background .18s ease;
}
.when-trigger:hover { background: #fff; }
.when-picker.open .when-trigger,
.when-trigger:focus {
    outline: 0; border-color: var(--teal); background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 142, 171, .12);
}
.when-trigger-icon {
    position: relative; flex: 0 0 auto; width: 28px; height: 28px;
    display: grid; place-items: center; border-radius: 9px;
    background: var(--soft); color: var(--teal-dark);
}
.when-clock { width: 16px; height: 16px; }
.when-live-dot {
    display: none; width: 8px; height: 8px; border-radius: 50%;
    background: var(--teal); box-shadow: 0 0 0 4px rgba(0, 142, 171, .16);
}
.when-picker.is-live .when-clock { display: none; }
.when-picker.is-live .when-live-dot { display: block; }
.when-trigger-text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.when-trigger-main {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: .92rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.15;
}
.when-trigger-sub {
    font-size: .66rem; font-weight: 800; font-style: normal; letter-spacing: .08em;
    text-transform: uppercase; color: var(--teal-deep);
}
.when-caret { width: 16px; height: 16px; flex: 0 0 auto; color: var(--muted); transition: transform .18s ease; }
.when-picker.open .when-caret { transform: rotate(180deg); }
.when-backdrop {
    display: none; position: fixed; inset: 0; z-index: 1190;
    background: rgba(6, 59, 73, .28);
}
.when-backdrop[hidden] { display: none !important; }
.when-panel {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 40;
    width: min(372px, calc(100vw - 24px)); padding: 12px;
    background: var(--white); border: 1px solid var(--line); border-radius: 18px;
    box-shadow: 0 22px 56px rgba(6, 59, 73, .18);
}
.when-modes, .when-quicks, .when-clocks { display: flex; flex-wrap: wrap; gap: 6px; }
.when-modes { padding: 2px; background: var(--bg); border-radius: 12px; }
.when-modes button {
    flex: 1; min-height: 36px; border: 0; border-radius: 10px; background: transparent;
    color: var(--teal-deep); font-weight: 750; cursor: pointer;
}
.when-modes button[aria-pressed="true"] { background: var(--white); color: var(--teal-dark); box-shadow: 0 4px 12px rgba(6, 59, 73, .08); }
.when-quicks { margin-top: 10px; }
.when-quicks button, .when-clocks button, .when-cal-toggle, .when-done {
    border: 1px solid var(--line); background: #f6f9f9; color: var(--teal-deep);
    border-radius: 999px; padding: 7px 11px; font-weight: 750; font-size: .78rem; cursor: pointer;
}
.when-quicks button.is-on, .when-clocks button.is-on {
    border-color: var(--teal); background: var(--soft); color: var(--teal-dark);
}
.when-days {
    display: flex; gap: 6px; margin-top: 12px; padding-bottom: 2px;
    overflow-x: auto; scrollbar-width: thin;
}
.when-days button {
    flex: 0 0 52px; display: grid; gap: 2px; justify-items: center;
    padding: 7px 4px 8px; border: 1px solid var(--line); border-radius: 12px;
    background: #f6f9f9; color: var(--ink); cursor: pointer; user-select: none;
}
.when-days button:hover:not(.is-on), .when-cal button:hover:not(:disabled):not(.is-on),
.when-quicks button:hover:not(.is-on), .when-clocks button:hover:not(.is-on) {
    background: #fff; border-color: #c5d6d9;
}
.when-days button span { font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.when-days button strong { font-size: 1rem; line-height: 1; }
.when-days button.is-weekend span, .when-days button.is-weekend strong { color: var(--coral); }
.when-days button.is-today span { color: var(--teal); }
.when-days button.is-on,
.when-cal button.is-on {
    border-color: var(--teal); background: var(--teal); color: #fff;
}
.when-days button.is-on span,
.when-days button.is-on strong,
.when-days button.is-on.is-weekend span,
.when-days button.is-on.is-weekend strong { color: #fff; }
.when-cal-toggle {
    display: inline-flex; align-items: center; gap: 4px; margin-top: 10px;
    padding: 6px 10px; background: transparent;
}
.when-cal-toggle svg { width: 14px; height: 14px; transition: transform .18s ease; }
.when-picker.cal-open .when-cal-toggle svg { transform: rotate(180deg); }
.when-cal-wrap { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbfb; }
.when-cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.when-cal-title { font-size: .86rem; font-weight: 800; color: var(--teal-deep); text-transform: capitalize; }
.when-cal-actions { display: flex; gap: 4px; }
.when-cal-actions button {
    width: 30px; height: 30px; display: grid; place-items: center; padding: 0;
    border: 0; border-radius: 9px; background: var(--white); color: var(--teal-dark); cursor: pointer;
}
.when-cal-actions button:disabled { opacity: .35; cursor: default; }
.when-cal-actions svg { width: 16px; height: 16px; }
.when-cal-wd, .when-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.when-cal-wd span {
    text-align: center; font-size: .62rem; font-weight: 800; letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted); padding: 2px 0 6px;
}
.when-cal button {
    aspect-ratio: 1; min-height: 32px; border: 0; border-radius: 10px;
    background: transparent; color: var(--ink); font-weight: 700; cursor: pointer;
}
.when-cal button.is-out { color: #9aafb4; }
.when-cal button.is-today:not(.is-on) { color: var(--teal); box-shadow: inset 0 0 0 1px rgba(0, 142, 171, .35); }
.when-cal button.is-weekend:not(.is-on) { color: var(--coral); }
.when-cal button.is-out.is-weekend:not(.is-on) { color: #d7a3a6; }
.when-cal button:disabled { opacity: .28; cursor: default; }
.when-time { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.when-time-head {
    margin-bottom: 8px; font-size: .66rem; font-weight: 800; letter-spacing: .1em;
    text-transform: uppercase; color: var(--teal-deep);
}
.when-time-spin { display: flex; align-items: center; justify-content: center; gap: 14px; }
.when-spin { display: grid; justify-items: center; gap: 2px; }
.when-spin span {
    min-width: 2.1ch; font-size: 2rem; font-weight: 800; letter-spacing: -.04em;
    font-variant-numeric: tabular-nums; color: var(--teal-deep); line-height: 1;
}
.when-spin button {
    width: 36px; height: 28px; display: grid; place-items: center; padding: 0;
    border: 0; border-radius: 8px; background: var(--soft); color: var(--teal-dark); cursor: pointer;
}
.when-spin button:hover { background: #d8eef0; }
.when-spin svg { width: 16px; height: 16px; }
.when-time-colon { font-size: 1.7rem; font-weight: 800; color: var(--muted); padding-bottom: 4px; }
.when-clocks { justify-content: center; margin-top: 10px; }
.when-done {
    display: none; width: 100%; margin-top: 12px; min-height: 44px; border-radius: 12px;
    justify-content: center; align-items: center;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark)); color: #fff; border: 0;
}
@media (max-width: 680px) {
    .when-picker.open .when-backdrop { display: block; }
    .when-panel {
        position: fixed; top: auto; right: 0; left: 0; bottom: 0; z-index: 1200;
        width: 100%; max-height: min(92vh, 740px); overflow: auto;
        border-radius: 22px 22px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
        box-shadow: 0 -18px 50px rgba(6, 59, 73, .2);
    }
    .when-done { display: flex; }
    .when-days button { flex-basis: 56px; }
}
