.schedule-template { margin-bottom: 20px; }
.schedule-template__days { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 12px; }
.schedule-day { display: grid; align-content: start; gap: 8px; min-width: 0; }
.schedule-day__name { font-size: 15px; font-weight: 700; padding-bottom: 6px; border-bottom: 2px solid var(--color-line); }
.schedule-day__add { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 8px; border-radius: 8px; color: var(--color-primary-text); font-weight: 600; font-size: 15px; text-decoration: none; }
.schedule-day__add:hover { background: var(--color-tint); }

.schedule-rule { display: grid; gap: 6px; padding: 10px 12px; background: var(--color-bg); border: 1px solid var(--color-line); border-radius: var(--radius-sm); min-width: 0; }
.schedule-rule.is-paused { background: var(--color-surface); border-style: dashed; color: var(--color-muted); }
.schedule-rule__when { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; font-size: 13px; }
.schedule-rule__time { font-family: var(--font-mono); font-weight: 600; color: var(--color-ink); }
.schedule-rule__cadence { color: var(--color-muted); }
.schedule-rule__detail { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.schedule-rule__actions { display: flex; flex-wrap: wrap; gap: 0 2px; margin-inline: -8px; }
.schedule-rule__actions form { display: inline; }
.schedule-rule__actions .text-btn { display: inline-flex; align-items: center; min-height: 36px; text-decoration: none; }
.schedule-rule__actions .text-btn:disabled { color: var(--color-muted); cursor: default; background: none; }
.channel__mark--reminder { background: var(--color-note-coral); color: var(--color-ink); }

.schedule-plan { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: start; margin-bottom: 28px; }
.schedule-plan__form { margin-bottom: 20px; }
.schedule-plan__dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.schedule-plan__group { padding-top: 14px; border-top: 1px solid var(--color-line); margin-top: 14px; display: grid; gap: 8px; justify-items: start; }
.schedule-plan__label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); }
.schedule-plan__list { list-style: none; display: grid; gap: 2px; width: 100%; }
.schedule-plan__list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
.schedule-plan__list a { display: inline-block; padding-block: 3px; color: var(--color-primary-text); font-weight: 600; }
.schedule-plan__note { color: var(--color-muted); font-size: 14px; }
.schedule-fill { display: grid; gap: 10px; justify-items: start; max-width: 260px; }
.schedule-fill form { display: block; }

.schedule-weeks { display: grid; gap: 12px; }
.schedule-week { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius); padding: 14px 18px; }
.schedule-week--open { border-color: var(--color-primary); }
.schedule-week__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.schedule-week__head h3 { font-size: 16px; }
.schedule-week__tag { background: var(--color-tint); color: var(--color-primary-text); }
.schedule-week__compact { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.schedule-week__compact li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.schedule-week__daylabel { font-size: 13px; font-weight: 600; color: var(--color-muted); min-width: 44px; }
.schedule-week__days { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.schedule-week__day { display: grid; align-content: start; gap: 8px; min-width: 0; }
.schedule-week__day h4 { font-size: 14px; font-weight: 700; padding-bottom: 6px; border-bottom: 2px solid var(--color-line); }
.schedule-week__avoid { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--color-muted); }

.schedule-slot { display: grid; gap: 6px; padding: 10px 12px; background: var(--color-bg); border: 1px solid var(--color-line); border-radius: var(--radius-sm); min-width: 0; }
.schedule-slot__head { display: flex; justify-content: space-between; gap: 8px; }
.schedule-slot__code { font-family: var(--font-mono); font-weight: 600; font-size: 13px; }
.schedule-slot__time { font-size: 13px; color: var(--color-muted); }
.schedule-slot__title { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.schedule-slot__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.schedule-slot__when { font-size: 13px; font-weight: 600; color: var(--color-accent-text); }
.schedule-slot .text-btn { justify-self: start; display: inline-flex; align-items: center; margin-left: -8px; text-decoration: none; }

.week-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 10px 3px 8px; border-radius: var(--radius-round); font-size: 12px; font-weight: 600; background: var(--color-line); color: var(--color-ink); text-decoration: none; white-space: nowrap; }
.week-pill svg { flex: none; }
.week-pill__code { font-family: var(--font-mono); }
.week-pill__status { font-weight: 500; }
a.week-pill:hover { box-shadow: inset 0 0 0 1px currentColor; }
.week-pill--placeholder, .week-pill--open { background: var(--color-surface); color: var(--color-muted); box-shadow: inset 0 0 0 1px var(--color-line); }
.week-pill--draft { background: var(--color-surface); color: var(--color-muted); box-shadow: inset 0 0 0 1px var(--color-line); }
.week-pill--needs_review { background: var(--color-accent-soft); color: var(--color-accent-text); }
.week-pill--approved { background: var(--color-tint); color: var(--color-primary-text); }
.week-pill--published { background: var(--color-live-soft); color: var(--color-live-text); }
.week-pill--failed { background: var(--color-danger); color: var(--color-on-danger); }
.week-pill--paused, .week-pill--canceled, .week-pill--avoid, .week-pill--reminder { background: var(--color-line); color: var(--color-ink); }

.schedule-form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; align-items: end; }
.schedule-form__row[hidden], .schedule-form [hidden] { display: none; }
.schedule-form__pillars { display: grid; gap: 4px; border: 0; padding: 0; min-width: 0; }
.schedule-form__pillars legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.admin-form .errors ul { margin: 6px 0 0 18px; }
.schedule-danger { margin-top: 16px; }
.schedule-danger form { display: inline; }

.schedule-weeks a:focus-visible, .schedule-day__add:focus-visible, .schedule-rule__actions .text-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

@media (max-width: 760px) {
  .schedule-plan { grid-template-columns: minmax(0, 1fr); }
  .schedule-fill { max-width: none; }
  .schedule-template__days { grid-template-columns: minmax(0, 1fr); }
  .schedule-week { padding: 12px; }
  .schedule-week__compact li { flex-basis: 100%; }
  .week-pill { white-space: normal; }
}

.admin-form input[type="date"], .admin-form input[type="time"] { width: 100%; font: inherit; font-size: 16px; color: var(--color-ink); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: 10px; padding: 11px 13px; }
.schedule-template .admin-section-title, .schedule-plan .admin-section-title { margin-bottom: 14px; }
.schedule-weeks .admin-section-title { margin-bottom: 2px; }
