/* Schedule tab (schedule-editor.js): the next change first, then how it runs as choice cards, the fields of the
   choice, the weekly editor for Custom, and Save when something changed. Also used in the Edit environment drawer. */
.sched { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.sched-next { --tone-border: var(--border); --tone-bg: var(--page); --tone-icon-bg: #ECEEF1; --tone-icon: #3F4654; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 24px; border: 1px solid var(--tone-border); border-radius: var(--radius-card); background: var(--tone-bg); }
.sched-next.tone-good { --tone-border: #ABEFC6; --tone-bg: #F6FEF9; --tone-icon-bg: #DCFCE7; --tone-icon: #166534; }
.sched-next.tone-info { --tone-border: #B2DDFF; --tone-bg: #F5FAFF; --tone-icon-bg: #DBEAFE; --tone-icon: #1D4ED8; }
.sched-next.tone-warn { --tone-border: var(--warn-border, #FDE68A); --tone-bg: var(--warn-bg, #FFFBEB); --tone-icon-bg: #FEF3C7; --tone-icon: var(--warn-text, #7A5900); }
.sched-next-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--tone-icon-bg); color: var(--tone-icon); }
.sched-next-words { display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; min-width: 0; }
.sched-next-title { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; color: var(--text); }
.sched-next-sub { font-size: 13px; line-height: 20px; color: var(--secondary); overflow-wrap: anywhere; }
.sched-next-warn { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-size: 13px; font-weight: 500; color: var(--warn-text, #7A5900); }
.sched-next > button { flex: none; }
.sched-choose { display: flex; flex-direction: column; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.sched-legend { margin: 0 0 4px; padding: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--text); }
.sched-hint { margin: 0; font-size: 13px; line-height: 20px; color: var(--secondary); }
.sched-hint.bad { color: #B42318; }
.sched-choose .env-choice-list { margin-top: 0; }
.sched-fields { display: flex; flex-direction: column; gap: 16px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); }
.sched-field { display: flex; flex-direction: column; gap: 8px; max-width: 320px; font-size: 13px; font-weight: 500; color: var(--text); }
.sched-week { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sched-week-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.sched-week-title { font-size: 13px; font-weight: 600; color: var(--secondary); }
.sched-week-head .text-button { min-height: 32px; padding: 0; font-size: 13px; }
.sched-days { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.sched-day { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 8px 8px 16px; background: var(--card); }
.sched-day + .sched-day { border-top: 1px solid var(--border); }
.sched-day-name { flex: none; width: 40px; font-size: 13px; font-weight: 600; color: var(--secondary); }
.sched-day.on .sched-day-name { color: var(--text); }
.sched-day-slots { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.sched-day-off { font-size: 13px; color: var(--muted); }
.sched-slot { display: inline-flex; align-items: center; gap: 8px; padding: 2px 2px 2px 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--page); }
.sched-slot input[type="time"] { width: 128px; min-height: 36px; height: 36px; padding: 0 8px; }
.sched-slot-to { font-size: 13px; color: var(--secondary); }
.sched-slot-remove, .sched-slot-add { flex: none; width: 36px; height: 36px; }
.sched-rules summary { font-size: 13px; }
.sched-rules p { max-width: 640px; margin: 4px 0 0; font-size: 13px; line-height: 20px; color: var(--secondary); }
.sched-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.sched-foot .sched-error { flex: 1 1 200px; margin: 0; }
.sched-foot .sched-error:empty { display: none; }
@media (max-width: 600px) {
  .sched-next { padding: 16px; }
  .sched-next > button { flex: 1 1 100%; }
  .sched-fields { padding: 12px; }
  .sched-field { max-width: none; }
  .sched-day { flex-wrap: wrap; align-items: flex-start; padding: 8px; }
  .sched-day-name { width: auto; flex: 1 1 auto; line-height: 36px; }
  .sched-day-slots { order: 3; flex: 1 1 100%; }
  .sched-slot { flex: 1 1 100%; gap: 4px; padding: 2px; }
  .sched-slot input[type="time"] { flex: 1 1 0; width: auto; min-width: 0; padding: 0 8px; }
  .sched-slot input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
  .sched-foot > button { flex: 1 1 auto; }
}
/* What the unsaved choice will do, worked out before Save. */
.sched-preview { --tone-border: var(--border); --tone-bg: var(--page); --tone-text: var(--secondary); --tone-icon: var(--muted); display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 8px 12px; border: 1px solid var(--tone-border); border-radius: var(--radius-control); background: var(--tone-bg); color: var(--tone-text); font-size: 13px; line-height: 20px; font-weight: 500; }
.sched-preview > svg { flex: none; margin-top: 2px; color: var(--tone-icon); }
.sched-preview.tone-good { --tone-border: #ABEFC6; --tone-bg: #F6FEF9; --tone-text: #14532D; --tone-icon: #166534; }
.sched-preview.tone-warn { --tone-border: var(--warn-border); --tone-bg: var(--warn-bg); --tone-text: var(--warn-text); --tone-icon: var(--warn-icon); }
