/* Schedule management extends the existing celadon workspace tokens. */
.schedule-page { --schedule-border: rgba(31, 91, 78, .14); }
.schedule-page [hidden], .schedule-editor [hidden] { display: none !important; }
.schedule-page-head, .schedule-list-toolbar, .schedule-history > header,
.schedule-editor-head, .schedule-editor-foot, .schedule-plan-head,
.schedule-plan-foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.schedule-page-head { margin-bottom: 24px; }
.schedule-page-head h2 { margin: 6px 0; font-size: 28px; letter-spacing: -.03em; color: var(--text); }
.schedule-page-head p, .schedule-editor-head p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.7; }
.schedule-actions, .schedule-plan-actions, .schedule-editor-foot > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.schedule-button, .schedule-text-button, .schedule-icon-button { font: inherit; cursor: pointer; }
.schedule-button { min-height: 40px; padding: 9px 15px; border: 1px solid rgba(31, 91, 78, .18); border-radius: 10px; background: var(--card-solid, #fff); color: var(--text); font-size: 13px; font-weight: 650; box-shadow: none; }
.schedule-button:hover:not(:disabled) { border-color: var(--accent); background: #f0f8f4; transform: none; }
.schedule-button.is-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.schedule-button.is-primary:hover:not(:disabled) { background: var(--accent-hover); color: #fff; }
.schedule-button.is-danger { color: var(--danger); }
.schedule-button:disabled, .schedule-icon-button:disabled { opacity: .5; cursor: not-allowed; }
.schedule-text-button { min-height: 40px; padding: 7px 3px; border: 0; background: none; color: var(--accent-hover); font-size: 12px; font-weight: 650; }
.schedule-icon-button { display: inline-grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; min-height: 34px; padding: 0; border: 1px solid rgba(31, 91, 78, .13); border-radius: 8px; background: #fff; color: var(--text-muted); font-size: 19px; }
.schedule-page :is(button,input,select):focus-visible, .schedule-editor :is(button,input,select):focus-visible { outline: 3px solid rgba(31,141,122,.35); outline-offset: 3px; }
.schedule-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.schedule-overview article { display: grid; gap: 5px; padding: 20px 22px; border: 1px solid var(--schedule-border); border-radius: 16px; background: var(--card-solid, #fff); }
.schedule-overview article > span { font-size: 12px; color: var(--text-muted); }
.schedule-overview strong { font-size: 30px; line-height: 1.3; color: var(--accent-hover); font-variant-numeric: tabular-nums; }
.schedule-overview small { font-size: 11px; color: var(--text-muted); }
.schedule-notice { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 27px; padding: 13px 16px; border-radius: 11px; background: rgba(31,141,122,.055); color: #52685f; font-size: 12px; line-height: 1.8; }
.schedule-notice > span:first-child { display: grid; place-items: center; flex: 0 0 auto; width: 19px; height: 19px; margin-top: 2px; border: 1px solid currentColor; border-radius: 50%; font-family: Georgia, serif; font-weight: bold; }
.schedule-list-toolbar { margin-bottom: 14px; }
.schedule-list-toolbar > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; }
.schedule-list-toolbar h3, .schedule-history h3 { margin: 0; font-size: 17px; }
.schedule-list-toolbar > div > span { color: var(--text-muted); font-size: 12px; }
.schedule-filter-label { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; }
.schedule-filter-label select { width: auto; min-width: 130px; max-width: 240px; min-height: 38px; padding: 7px 32px 7px 10px; border: 1px solid rgba(31,91,78,.16); border-radius: 9px; background-color: #fff; color: var(--text); font: inherit; }
.schedule-plan-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.schedule-plan { min-width: 0; border: 1px solid var(--schedule-border); border-radius: 16px; background: var(--card-solid, #fff); overflow: hidden; }
.schedule-plan-head { align-items: flex-start; padding: 19px 20px 13px; }
.schedule-plan-head h4 { margin: 0 0 5px; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.schedule-plan-head p { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.schedule-status { display: inline-flex; align-items: center; flex: 0 0 auto; padding: 4px 9px; border-radius: 20px; background: #edf0ee; color: #647168; font-size: 11px; font-weight: 650; white-space: nowrap; }
.schedule-status.is-enabled, .schedule-status.is-success { color: #246b49; background: #e7f3eb; }
.schedule-status.is-running { color: #225f86; background: #e6f1f8; }
.schedule-status.is-failed, .schedule-status.is-interrupted { color: #a03838; background: #faeaea; }
.schedule-status.is-authorization_required, .schedule-status.is-skipped { color: #8c641e; background: #fbf0d8; }
.schedule-plan-rule { margin: 0 20px 14px; padding: 12px 13px; border-radius: 10px; background: #f4f8f4; color: #315a48; font-size: 13px; font-weight: 650; line-height: 1.65; overflow-wrap: anywhere; }
.schedule-plan-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 20px 17px; }
.schedule-plan-meta div { min-width: 0; display: grid; gap: 4px; }
.schedule-plan-meta span { font-size: 11px; color: var(--text-muted); }
.schedule-plan-meta strong { font-size: 12px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.schedule-plan-tasks { margin: 0 20px 15px; color: var(--text-muted); font-size: 12px; line-height: 1.7; }
.schedule-plan-last-error { margin: 0 20px 16px; color: var(--danger); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.schedule-plan-foot { flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid rgba(31,91,78,.08); background: #fcfdfb; }
.schedule-plan-actions { gap: 6px; }
.schedule-plan-actions .schedule-button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.schedule-plan-foot .schedule-text-button { min-height: 34px; color: var(--danger); }
.schedule-empty { grid-column: 1/-1; padding: 38px 20px; border: 1px dashed rgba(31,91,78,.2); border-radius: 14px; background: rgba(255,255,255,.55); text-align: center; color: var(--text-muted); }
.schedule-empty strong { display: block; margin-bottom: 7px; color: var(--text); font-size: 15px; }
.schedule-empty p { margin: 0; font-size: 12px; line-height: 1.7; }
.schedule-empty .schedule-button { margin-top: 16px; }
.schedule-error { margin-bottom: 16px; padding: 12px 15px; border: 1px solid #e9baba; border-radius: 10px; background: #fff2f0; color: #9e3535; font-size: 13px; line-height: 1.7; }
.schedule-history { margin-top: 30px; border: 1px solid var(--schedule-border); border-radius: 16px; background: var(--card-solid, #fff); overflow: hidden; }
.schedule-history > header { padding: 20px; border-bottom: 1px solid var(--schedule-border); }
.schedule-history h3 { margin-top: 5px; }
.schedule-run-list { padding: 0 20px; }
.schedule-run-list .schedule-empty { margin: 20px 0; border: 0; padding: 22px; }
.schedule-run { display: grid; grid-template-columns: minmax(150px,1fr) minmax(170px,1fr) minmax(100px,.55fr); gap: 18px; padding: 16px 0; border-bottom: 1px solid rgba(31,91,78,.09); }
.schedule-run:last-child { border-bottom: 0; }
.schedule-run strong { display: block; margin-bottom: 5px; font-size: 13px; overflow-wrap: anywhere; }
.schedule-run small, .schedule-run p { margin: 4px 0 0; font-size: 11px; color: var(--text-muted); line-height: 1.65; overflow-wrap: anywhere; }
.schedule-run .schedule-run-result { text-align: right; }
.schedule-run-result small { display: block; }

/* Native dialog supplies modal focus containment and background inertness. */
.schedule-editor { width: min(880px, calc(100vw - 40px)); max-width: none; max-height: min(92dvh, 1000px); margin: auto; padding: 0; border: 1px solid rgba(31,91,78,.16); border-radius: 20px; background: #fbfcf8; color: var(--text); box-shadow: var(--dialog-elevation); overflow: hidden; }
.schedule-editor::backdrop { background: rgba(25,43,35,.48); backdrop-filter: blur(3px); }
.schedule-editor form { display: flex; flex-direction: column; max-height: min(92dvh,1000px); margin: 0; }
.schedule-editor-head { align-items: flex-start; flex: 0 0 auto; padding: 23px 26px 19px; border-bottom: 1px solid rgba(31,91,78,.12); background: #fff; }
.schedule-editor-head h2 { margin: 5px 0; font-size: 23px; }
.schedule-editor-body { min-height: 0; overflow-y: auto; padding: 24px 26px; overscroll-behavior: contain; }
.schedule-form-section { min-width: 0; margin: 0 0 25px; padding: 0 0 24px; border: 0; border-bottom: 1px solid rgba(31,91,78,.12); }
.schedule-form-section > legend { display: flex; align-items: center; gap: 9px; width: 100%; margin-bottom: 17px; padding: 0; font-size: 15px; font-weight: 700; }
.schedule-form-section > legend > span { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; background: #e7f1e9; color: var(--accent-hover); font-size: 11px; font-variant-numeric: tabular-nums; }
.schedule-form-section > legend small { margin-left: auto; color: var(--text-muted); font-size: 12px; font-weight: 500; }
.schedule-field { display: flex; flex-direction: column; gap: 7px; margin: 0 0 14px; color: #40524a; font-size: 12px; font-weight: 600; }
.schedule-field :is(input,select), .schedule-date-add input { width: 100%; min-width: 0; min-height: 43px; padding: 10px 12px; border: 1px solid #d5e0d7; border-radius: 9px; background-color: #fff; color: var(--text); font-family: inherit; font-size: 13px; box-sizing: border-box; }
.schedule-field select { padding-right: 34px; }
.schedule-field input[aria-invalid="true"], .schedule-field select[aria-invalid="true"] { border-color: var(--danger); }
.schedule-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.schedule-source-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.schedule-source-actions > span { flex-basis: 100%; font-size: 11px; color: var(--text-muted); }
.schedule-kind-picker { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 18px; }
.schedule-kind-picker label, .schedule-weekdays label { position: relative; cursor: pointer; }
.schedule-kind-picker input, .schedule-weekdays input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.schedule-kind-picker span { display: block; padding: 11px 14px; border: 1px solid #d5e0d7; border-radius: 10px; background: #fff; color: #66766b; text-align: center; font-size: 13px; font-weight: 650; }
.schedule-kind-picker input:checked + span, .schedule-weekdays input:checked + span { border-color: var(--accent); background: #e8f3ec; color: var(--accent-hover); }
.schedule-kind-picker input:focus-visible + span, .schedule-weekdays input:focus-visible + span { outline: 3px solid rgba(31,141,122,.35); outline-offset: 3px; }
.schedule-date-add { display: flex; align-items: center; gap: 10px; }
.schedule-date-add input { max-width: 250px; }
.schedule-date-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.schedule-date-chip { display: inline-flex; align-items: center; gap: 9px; padding: 5px 6px 5px 11px; border: 1px solid #cde0d3; border-radius: 8px; background: #eef6f0; color: #355c44; font-size: 12px; }
.schedule-date-chip button { width: 27px; height: 27px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: inherit; font-size: 18px; cursor: pointer; }
.schedule-help { display: block; margin: 6px 0 12px; font-size: 11px; line-height: 1.75; color: #748076; font-weight: 400; }
.schedule-weekdays { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.schedule-weekdays legend { margin-bottom: 10px; font-size: 12px; }
.schedule-weekdays span { display: grid; place-items: center; min-width: 48px; min-height: 42px; padding: 6px 10px; border: 1px solid #d5e0d7; border-radius: 8px; background: #fff; font-size: 12px; }
.schedule-time-preview { margin: 15px 0 0; padding: 10px 13px; border-radius: 9px; background: #edf2eb; color: #45654e; font-size: 12px; line-height: 1.7; }
.schedule-task-add { display: flex; align-items: flex-end; gap: 10px; }
.schedule-task-add .schedule-field { flex: 1; min-width: 0; margin-bottom: 0; }
.schedule-task-add > button { min-height: 43px; flex: 0 0 auto; }
.schedule-selected-tasks { display: grid; gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.schedule-task-row { padding: 15px; border: 1px solid #dce5da; border-radius: 12px; background: #fff; }
.schedule-task-row-head { display: flex; align-items: flex-start; gap: 10px; }
.schedule-task-number { display: grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; border-radius: 50%; background: #f0f3ec; color: #69806b; font-size: 11px; }
.schedule-task-row-copy { flex: 1; min-width: 0; }
.schedule-task-row-copy strong { font-size: 13px; }
.schedule-task-row-copy p { margin: 5px 0 0; font-size: 11px; line-height: 1.7; color: var(--text-muted); }
.schedule-task-row-actions { display: flex; gap: 4px; }
.schedule-task-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 12px; margin-top: 14px; }
.schedule-task-fields .schedule-field { margin-bottom: 7px; }
.schedule-task-fields .schedule-help { margin: 0; }
.schedule-enable-option { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; }
.schedule-enable-option input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.schedule-enable-option strong { display: block; font-size: 13px; }
.schedule-enable-option small { display: block; margin-top: 5px; color: var(--text-muted); font-size: 11px; line-height: 1.7; }
.schedule-editor-foot { flex: 0 0 auto; padding: 16px 26px; border-top: 1px solid rgba(31,91,78,.12); background: #fff; }
.schedule-editor-foot > span { color: var(--text-muted); font-size: 11px; }
@media (max-width: 1100px) { .schedule-plan-list { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .schedule-page-head { align-items: flex-start; flex-direction: column; gap: 15px; }
  .schedule-page-head h2 { font-size: 24px; }
  .schedule-overview { gap: 8px; }
  .schedule-overview article { padding: 14px 10px; }
  .schedule-overview strong { font-size: 24px; }
  .schedule-overview small { display: none; }
  .schedule-list-toolbar, .schedule-history > header { align-items: flex-start; gap: 12px; flex-direction: column; }
  .schedule-filter-label select { max-width: 230px; }
  .schedule-plan-head, .schedule-plan-meta { padding-left: 15px; padding-right: 15px; }
  .schedule-plan-rule, .schedule-plan-tasks, .schedule-plan-last-error { margin-left: 15px; margin-right: 15px; }
  .schedule-run { grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .schedule-run > div:nth-child(2) { grid-column: 1/-1; grid-row: 2; }
  .schedule-run-result { grid-column: 2; grid-row: 1; }
  .schedule-editor { width: calc(100vw - 16px); max-height: 96dvh; border-radius: 15px; }
  .schedule-editor form { max-height: 96dvh; }
  .schedule-editor-head, .schedule-editor-body, .schedule-editor-foot { padding: 17px 15px; }
  .schedule-editor-head p { font-size: 11px; }
  .schedule-form-grid { grid-template-columns: 1fr; gap: 0; }
  .schedule-editor-foot > span { display: none; }
  .schedule-editor-foot > div { width: 100%; justify-content: flex-end; }
  .schedule-task-add { align-items: stretch; flex-direction: column; }
  .schedule-task-fields { grid-template-columns: 1fr; }
  .schedule-task-row-head { flex-wrap: wrap; }
  .schedule-task-row-copy { flex-basis: calc(100% - 40px); }
  .schedule-task-row-actions { margin-left: auto; }
  .schedule-button { min-height: 44px; }
  .schedule-plan-actions .schedule-button, .schedule-plan-foot .schedule-text-button { min-height: 44px; }
  .schedule-icon-button { width: 44px; height: 44px; }
  .schedule-date-chip button { width: 36px; height: 36px; }
}
.schedule-warning { color: #825400; background: #fff7e4; border: 1px solid #e8d4a5; border-radius: 10px; padding: 12px 16px; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
#btnChooseQQLogin[hidden], #btnChooseWechatLogin[hidden], [data-login-method][hidden],
#scheduleConflictAcceptLabel[hidden], #scheduleConflictHint[hidden],
html:not([data-online-renewal="true"]) [data-platform-account-action="renew"] { display: none !important; }
