/* Shared app tokens preserve the current ClassPlanr theme. */
.desktop-workspace-nav{display:flex;gap:10px;flex-wrap:wrap;margin:0}.desktop-workspace-nav button{min-height:44px}
.program-actions-card .program-actions{display:none!important}.mobile-program-actions>button.legacy-action{display:none!important}.mobile-program-actions{grid-template-columns:repeat(4,minmax(0,1fr))!important}.mobile-program-actions.schedule-off{grid-template-columns:repeat(3,minmax(0,1fr))!important}
.schedule-view{margin:0 0 24px}.schedule-view h2{font-size:28px;margin:0 0 6px}.schedule-title-row,.schedule-toolbar,.schedule-controls,.schedule-dialog-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.schedule-toolbar{margin:22px 0 16px}.schedule-controls{justify-content:flex-start}.schedule-week-label{min-width:190px;text-align:center;font-weight:600}.schedule-calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--card)}.schedule-day{min-height:310px;padding:12px 8px;border-right:1px solid var(--line)}.schedule-day:last-child{border:0}.schedule-day-heading{text-align:center;font-weight:500;margin:0 0 16px}.schedule-day-heading span{display:block;font-size:22px}.schedule-class{display:block;width:100%;text-align:left;background:var(--soft);color:var(--ink);border:1px solid var(--line);border-radius:10px;padding:12px 9px;margin-bottom:10px;overflow-wrap:anywhere;min-height:44px}.schedule-class.unassigned{background:var(--card);border-style:dashed}.schedule-class strong{display:block;margin:9px 0 4px;font-weight:600}.schedule-class small{display:block;font-size:12px;color:var(--muted)}.schedule-add-day{border:0;background:none;color:var(--muted);padding:10px 4px;width:100%;min-height:44px}.schedule-empty-day{font-size:12px;color:var(--muted);padding:15px 0;text-align:center}.schedule-dialog{border:1px solid var(--line);border-radius:18px;background:var(--card);color:var(--ink);padding:24px;width:min(570px,calc(100% - 28px));max-height:85dvh;overflow:auto}.schedule-dialog::backdrop{background:rgba(27,43,35,.45)}.schedule-dialog h2{font-size:24px;margin:0}.schedule-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}.schedule-dialog-head button{border:0;background:none;color:var(--ink);font-size:25px;min-height:44px;min-width:44px}.schedule-dialog .field label{font-size:14px;font-weight:600}.schedule-dialog .schedule-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}.schedule-dialog input,.schedule-dialog select,.schedule-dialog textarea{font-size:16px}.schedule-dialog .wide{grid-column:1/-1}.schedule-dialog-actions{justify-content:flex-start;margin-top:18px}.schedule-dialog-actions button{min-height:44px}.schedule-dialog .schedule-check{display:flex;gap:9px;align-items:center}.schedule-dialog .schedule-check input{width:auto}.schedule-class-notes{padding:12px;background:var(--soft);border-radius:10px;white-space:pre-wrap}.schedule-error{color:var(--warn)}.schedule-context{margin:12px 0;color:var(--accent)}.schedule-assign-button{min-height:42px}.actions-sheet .actions-list{display:grid;gap:10px}.actions-sheet .actions-list button{min-height:48px;text-align:left}.schedule-regular-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0;border-bottom:1px solid var(--line)}
body.schedule-mode .grid{display:none!important}body.schedule-mode .desktop-workspace-nav{display:none!important}.schedule-unavailable{padding:18px;background:var(--soft);border-radius:12px;line-height:1.6}
@media(max-width:900px),(pointer:coarse) and (max-width:1400px){.desktop-workspace-nav{display:none!important}.schedule-calendar{display:block;border:0;background:transparent}.schedule-day{min-height:0;border:0;padding:0;margin:0 0 22px}.schedule-day-heading{text-align:left;margin-bottom:10px;display:flex;gap:8px;align-items:center}.schedule-day-heading span{font-size:16px}.schedule-class{padding:16px;background:var(--card)}.schedule-class:not(.unassigned){border-left:4px solid var(--accent)}.schedule-class strong{margin:5px 0}.schedule-week-label{min-width:0}.schedule-controls{width:100%;justify-content:space-between}.schedule-title-row{align-items:flex-start}.schedule-view h2{font-size:26px}.schedule-dialog{padding:20px;max-height:88dvh}.schedule-dialog .schedule-form-grid{grid-template-columns:1fr}.actions-sheet{margin:auto auto max(12px,env(safe-area-inset-bottom));border-radius:18px}.schedule-toolbar>.btn{width:100%}}
.builder-page:not(.pro-user) #mobileScheduleBtn,.builder-page:not(.pro-user) #mobileScheduleBtn .mobile-action-label{color:var(--pro)}
@media print{.schedule-view,.desktop-workspace-nav,.schedule-dialog{display:none!important}}

/* Actions uses the same text rows as My Programs and Class Structure menus. */
.program-actions-menu{position:fixed;z-index:1200;padding:6px;border:1px solid var(--line);border-radius:10px;background:var(--card);color:var(--ink);box-shadow:0 8px 24px rgba(36,49,45,.14);max-height:calc(100dvh - 24px);overflow:auto}
.program-actions-menu .actions-list{display:grid;gap:0}
body.builder-page .program-actions-menu .btn{display:flex;align-items:center;width:100%;min-height:44px;padding:10px 12px;border:0!important;border-radius:9px;background:transparent!important;color:var(--accent)!important;font:inherit;font-size:14px;font-weight:800;line-height:1.2;text-align:left;white-space:nowrap}
body.builder-page .program-actions-menu .btn:hover,body.builder-page .program-actions-menu .btn:focus-visible{background:var(--soft)!important}
body.builder-page .program-actions-menu .btn:disabled{opacity:.45;cursor:default;background:transparent!important;color:var(--muted)!important}
body.builder-page:not(.pro-user) #desktopActionsBtn{background:var(--accent)!important;border-color:var(--accent)!important;color:#fff!important}
body.builder-page:not(.pro-user) #mobileActionsBtn,body.builder-page:not(.pro-user) #mobileActionsBtn .mobile-action-label{color:var(--accent)!important}
@media print{.program-actions-menu{display:none!important}}

/* Match the builder's card, heading and section styling. */
body.builder-page .schedule-view{padding:20px;border:1px solid var(--line);border-radius:17px;background:var(--card);box-shadow:0 8px 26px rgba(36,49,45,.035)}
body.builder-page .schedule-view h2{font-size:22px;font-weight:400;letter-spacing:-.035em;line-height:1.15;margin:0 0 6px}
.schedule-title-row>.schedule-controls{width:auto;gap:10px}
.schedule-title-row .notice{margin:0;line-height:1.5}
.schedule-calendar{border-color:#c9d9d0;border-radius:13px}
.schedule-day-heading{color:var(--accent);font-size:14px;letter-spacing:-.02em}
.schedule-day-heading span{font-size:20px;font-weight:400}
.schedule-view .btn{border-radius:9px;min-height:42px}
@media(max-width:900px),(pointer:coarse) and (max-width:1400px){
  body.builder-page .schedule-view{padding:16px}
  body.builder-page .schedule-view h2{font-size:20px}
  .schedule-title-row>.schedule-controls{width:100%;justify-content:space-between}
  .schedule-day{padding:14px;border:1px solid #c9d9d0;border-radius:13px;background:var(--card);margin-bottom:14px}
  .schedule-day:last-child{border:1px solid #c9d9d0}
  .schedule-day-heading span{font-size:16px}
  .schedule-toolbar{margin-top:18px}
}

.builder-page-title{font-size:26px;font-weight:400;letter-spacing:-.035em;margin:4px 0 20px}
body.schedule-mode .builder-page-title{display:none}
@media(max-width:900px),(pointer:coarse) and (max-width:1400px){
  .builder-page-title{display:none}
  .mobile-program-actions{z-index:1250!important}
  .mobile-program-actions .mobile-action-label{font-weight:400!important;white-space:normal!important}
  .mobile-program-actions .mobile-action[aria-current="page"] .mobile-action-label{font-weight:800!important}
  .mobile-program-actions .mobile-action[aria-current="page"] svg{stroke-width:2.5}
  .program-actions-card .program-actions{display:flex!important;gap:8px}
  .program-actions-card #uploadJsonBtn{display:none}
  .program-actions-card .program-actions>.btn{flex:1;min-height:44px}
  #savedProgramsModal,#teachProgramModal,#accountPanel{bottom:calc(72px + env(safe-area-inset-bottom))}
  #savedProgramsModal .saved-programs-card,#teachProgramModal .teach-program-card,#accountPanel .account-modal-card{max-height:100%}
}

@media(max-width:900px),(pointer:coarse) and (max-width:1400px){
  body.builder-page .grid>main>.program-actions-card{display:block!important}
  #scheduleBack{display:none}
  body.mobile-programs-page .grid,body.mobile-programs-page #myScheduleView{display:none!important}
  body.mobile-programs-page #savedProgramsModal{position:static;inset:auto;display:block;background:transparent;padding:0;margin:0 0 20px;z-index:auto}
  body.mobile-programs-page #savedProgramsModal .saved-programs-card{width:100%;height:auto;max-height:none;overflow:visible;padding:16px;border:1px solid var(--line);border-radius:17px;background:var(--card);box-shadow:0 8px 26px rgba(36,49,45,.035)}
  body.mobile-programs-page #savedProgramsModal .saved-programs-sticky-head{position:static;padding:0;background:transparent}
  body.mobile-programs-page #savedProgramsModal #savedProgramsTitle{font-size:20px;font-weight:400;letter-spacing:-.035em;line-height:1.15}
  body.mobile-programs-page #closeSavedPrograms{display:none}
}

/* Direct builder actions share the desktop navigation row. */
body.builder-page .program-actions-card{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
body.builder-page .program-actions-card .program-actions{display:flex!important;align-items:center;gap:10px}
.program-actions-card #uploadJsonBtn,#desktopActionsBtn{display:none!important}
.program-actions-card .program-action-status{flex-basis:100%}
.program-actions-card .program-actions .btn{min-height:44px;border-radius:9px}
@media(max-width:900px),(pointer:coarse) and (max-width:1400px){
  body.builder-page .program-actions-card .program-actions{width:100%}
}

.schedule-bottom-nav{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:14px 20px;border-radius:17px;border:1px solid var(--line);background:var(--card);box-shadow:0 8px 26px rgba(36,49,45,.035)}
.schedule-bottom-nav .btn{min-height:44px;border-radius:9px}
@media(max-width:900px),(pointer:coarse) and (max-width:1400px){.schedule-bottom-nav{display:none!important}}
@media print{.schedule-bottom-nav{display:none!important}}

body.schedule-mode #userGreeting{margin:0 0 18px;padding:0 2px;font-family:inherit;font-size:21px;font-weight:400;line-height:1.2;letter-spacing:-.03em;color:var(--ink)}
@media(max-width:850px),(pointer:coarse) and (max-width:1400px){body.schedule-mode #userGreeting{margin-bottom:13px}}

/* Permanent desktop workspace tabs and shared page shell. */
body.builder-page .desktop-workspace-nav{display:flex!important;gap:30px;flex-wrap:wrap;margin:0 0 22px;border-bottom:1px solid var(--line)}
body.builder-page .desktop-workspace-nav button{border:0;border-bottom:3px solid transparent;border-radius:0;background:none;padding:12px 0;color:var(--muted);font:inherit;font-weight:400;min-height:44px}
body.builder-page .desktop-workspace-nav button[aria-current="page"]{font-weight:800;color:var(--accent);border-bottom-color:var(--accent)}
body.builder-page .desktop-workspace-nav button:hover{color:var(--accent)}
body.builder-page .desktop-workspace-nav button:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
body.builder-page .wrap>#userGreeting{margin:0 0 18px;padding:0 2px;font-family:inherit;font-size:21px;font-weight:400;line-height:1.2;letter-spacing:-.03em;color:var(--ink)}
body.workspace-programs-page .grid,body.workspace-programs-page #myScheduleView{display:none!important}
body.workspace-programs-page #savedProgramsModal{position:static;inset:auto;display:block;background:transparent;padding:0;margin:0 0 20px;z-index:auto;align-items:initial}
body.workspace-programs-page #savedProgramsModal .saved-programs-card{width:100%;height:auto;max-width:none;max-height:none;overflow:visible;padding:20px;border:1px solid var(--line);border-radius:17px;background:var(--card);box-shadow:0 8px 26px rgba(36,49,45,.035)}
body.workspace-programs-page #savedProgramsModal .saved-programs-sticky-head{position:static;padding:0;background:transparent}
body.workspace-programs-page #savedProgramsModal #savedProgramsTitle{font-size:22px;font-weight:400;letter-spacing:-.035em;line-height:1.15}
body.workspace-programs-page #closeSavedPrograms{display:none}
@media(max-width:900px),(pointer:coarse) and (max-width:1400px){
  body.builder-page .desktop-workspace-nav{display:none!important}
  body.builder-page .wrap>#userGreeting{margin-bottom:13px}
  body.workspace-programs-page #savedProgramsModal .saved-programs-card{padding:16px}
  body.workspace-programs-page #savedProgramsModal #savedProgramsTitle{font-size:20px}
}

/* Compact, consistent schedule controls and responsive week navigation. */
.schedule-view .btn{font-size:13px;font-weight:600;line-height:1.25;min-height:36px;padding:8px 11px;background:var(--soft);color:var(--accent);border:1px solid var(--line)}
.schedule-title-row{align-items:center;gap:12px}
.schedule-title-row>.schedule-controls{width:auto;justify-content:flex-end}
.schedule-toolbar{margin:16px 0 12px}
.schedule-toolbar>.schedule-controls{width:auto;gap:8px}
.schedule-week-label{font-size:14px;min-width:0}
.schedule-class{font-size:13px;line-height:1.4}
.schedule-class strong{font-size:14px;font-weight:600}
.schedule-add-day{color:var(--accent);font-size:13px;font-weight:600}
.schedule-dialog .btn{font-size:13px;line-height:1.3;font-weight:600;padding:9px 12px;background:var(--accent);color:#fff;border:0}
.schedule-dialog .btn.danger{background:#f7e9e5;color:#733c2f}
.schedule-dialog h2{font-size:22px;font-weight:400;letter-spacing:-.035em}
.schedule-dialog-actions{gap:8px}
.schedule-form-grid .field{min-width:0}
@media(max-width:900px),(pointer:coarse) and (max-width:1400px){
  .schedule-title-row{align-items:flex-start}
  .schedule-title-row>.schedule-controls{width:auto}
  .schedule-view .btn{min-height:44px}
  .schedule-toolbar>.schedule-controls{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;width:100%;gap:6px}
  .schedule-week-label{text-align:center;font-size:13px;overflow-wrap:anywhere}
  #scheduleToday{grid-column:1/-1;justify-self:end}
  .schedule-day{padding:12px;margin-bottom:12px}
  .schedule-class{padding:12px}
  .schedule-day-heading{margin-bottom:8px}
  .schedule-empty-day{padding:8px 0}
  .schedule-dialog-actions .btn{flex:1 1 auto}
}
@media(max-width:380px){.schedule-title-row>.schedule-controls{width:100%;justify-content:flex-start}}

.schedule-class-details{display:flex;align-items:center;justify-content:space-between;gap:8px 16px;flex-wrap:wrap}
.schedule-class-details .notice{margin:0}
.schedule-class-links{display:flex;gap:12px}
.schedule-class-link{padding:5px 0;border:0;background:none;color:var(--accent);text-decoration:underline;text-underline-offset:3px;font:inherit;font-size:12px}
.schedule-assigned-name{margin:18px 0 12px;font-size:18px;font-weight:600}
@media(min-width:901px) and (pointer:fine){
  .saved-program-row:has(.assignScheduleProgram) .library-item-actions>.btn{width:140px;min-height:40px;padding:9px 12px;font-size:13px;line-height:1.3;display:inline-flex;align-items:center;justify-content:center}
}
@media(max-width:900px),(pointer:coarse) and (max-width:1400px){.schedule-class-link{min-height:44px}.schedule-class-details{gap:0 12px}}

/* Center week controls and keep class details in reading order. */
.schedule-toolbar{justify-content:center}
.schedule-toolbar>.schedule-controls{justify-content:center}
.schedule-detail-list{display:grid;gap:8px;flex:1;min-width:0}
.schedule-detail-list>div{display:grid;grid-template-columns:90px minmax(0,1fr);gap:12px;font-size:14px}
.schedule-detail-list b{font-weight:600}
.schedule-class-details{align-items:flex-start}
.schedule-program-actions{margin-top:0;margin-bottom:20px}
.schedule-notes-field{margin-top:0}
.schedule-preview-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.saved-program-row:has(.assignScheduleProgram) .library-item-actions>.teachCloudProgram{width:40px;min-width:40px;min-height:40px;padding:9px;display:inline-flex;align-items:center;justify-content:center}
@media(max-width:900px),(pointer:coarse) and (max-width:1400px){#scheduleToday{justify-self:center}.saved-program-row:has(.assignScheduleProgram) .library-item-actions>.teachCloudProgram{width:44px;min-width:44px;min-height:44px}}

/* Calendar status and direct unassigned-class controls. */
.schedule-class.assigned{background:var(--accent);color:#fff;border-color:var(--accent)}
.schedule-class.assigned small{color:rgba(255,255,255,.85)}
.schedule-class.unassigned{background:#f0f1f0;color:var(--ink);border:1px solid #d9ddda}
.schedule-choose-program{display:block;margin-top:12px;padding:9px 10px;width:100%;border:1px solid #c5ccc7;border-radius:8px;background:var(--card);color:var(--accent);font:inherit;font-size:13px;font-weight:600;min-height:40px}
.schedule-card-options{display:flex;justify-content:flex-end;gap:4px;margin-top:6px}
.schedule-card-options button{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:8px;border:0;border-radius:7px;background:transparent;color:var(--muted)}
.schedule-card-options svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.schedule-card-options button:hover,.schedule-card-options button:focus-visible{background:#e0e5e1;color:var(--accent)}
.schedule-card-options button:focus-visible,.schedule-choose-program:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(max-width:900px),(pointer:coarse) and (max-width:1400px){.schedule-title-row{align-items:center;justify-content:space-between}.schedule-title-row #scheduleToday{margin-left:auto;flex-shrink:0}.schedule-card-options button{width:44px;height:44px}.schedule-choose-program{min-height:44px}}

/* Give the cancellation action breathing room below its scope selector. */
#scheduleConfirmCancel{padding:12px 18px;min-height:44px}

/* Compact calendar metadata mirrors My Programs' wrapping text. */
.schedule-card-time{display:block;margin-bottom:4px}
.schedule-class .schedule-card-meta{line-height:1.45;overflow-wrap:anywhere}
.schedule-class strong{margin:8px 0 0}

/* Additional dated classes are selected above the existing program filters. */
#scheduleOtherClassSelection{margin:0 0 14px}
#scheduleOtherClassChoices{max-height:240px;overflow:auto;overscroll-behavior:contain}
.schedule-other-class{display:flex;align-items:flex-start;gap:10px;padding:12px 0;border-bottom:1px solid var(--line);font-size:14px;cursor:pointer}
.schedule-other-class input{width:20px;height:20px;flex-shrink:0;margin:0;accent-color:var(--accent)}
.schedule-other-class small{display:block;margin-top:4px;color:var(--muted);font-size:12px}

.schedule-card-options button:disabled{opacity:.3;cursor:default}
.schedule-card-options button:disabled:hover{background:transparent;color:var(--muted)}
.schedule-history-preview{justify-content:flex-start;margin-top:0}

/* Keep assignment picker rows compact without changing the My Programs page. */
#savedProgramsModal:has(#schedulePickerContext) #savedProgramsTitle{display:none}
#savedProgramsModal:has(#schedulePickerContext) .saved-program-date{font-size:12px;line-height:1.45}
#savedProgramsModal:has(#schedulePickerContext) .saved-program-meta{font-size:12px;line-height:1.45}
#savedProgramsModal:has(#schedulePickerContext) .assignScheduleProgram{width:auto;min-width:0;padding-left:10px;padding-right:10px;flex:0 0 auto}

/* Quiet history heading and a right-aligned picker close control. */
#scheduleHistoryIntro{font-size:16px;line-height:1.4;margin:0 0 10px}
#savedProgramsModal:has(#schedulePickerContext) .saved-programs-title-row{justify-content:flex-end}
#savedProgramsModal:has(#schedulePickerContext) #closeSavedPrograms{margin-left:auto;flex-shrink:0}

.schedule-dialog-head{position:sticky;top:0;z-index:20;background:var(--card);align-items:flex-start}
.schedule-dialog-head>button{margin-left:auto;flex-shrink:0}

@media(max-width:900px),(pointer:coarse) and (max-width:1400px){.schedule-class.unassigned>.schedule-card-options{justify-content:space-between;width:100%;margin-top:8px}}

@media(max-width:900px),(pointer:coarse) and (max-width:1400px){.schedule-dialog.schedule-assignment-confirmation #scheduleDialogClose{display:none}}

.schedule-celebration{font-size:16px;line-height:1.45;color:var(--accent);margin:0 0 16px}

.app-success-icon{display:inline-block;vertical-align:middle;width:24px;height:24px;flex-shrink:0;margin-right:8px;color:var(--accent);stroke:currentColor}

/* Lead assignment confirmations with the success message. */
.schedule-dialog.schedule-assignment-confirmation #scheduleDialogTitle{font-size:24px;line-height:1.3;font-weight:500;margin:0;color:var(--accent)}
.schedule-assignment-program{font-size:18px;line-height:1.4;font-weight:500;margin:0 0 12px}
.schedule-assignment-dates{font-size:14px;line-height:1.6;padding-left:20px;margin:0}
.schedule-assignment-dates li+li{margin-top:8px}

/* A single visual treatment for successful saves and assignments. */
dialog.app-positive-confirmation,.app-positive-confirmation .section-modal-card{width:min(570px,calc(100% - 28px));padding:24px;border:1px solid var(--line);border-radius:18px;background:var(--card);color:var(--ink)}
.app-positive-confirmation #scheduleDialogClose,.app-positive-confirmation #closeProgramAction,.app-positive-confirmation .section-modal-actions{display:none!important}
.app-positive-confirmation .schedule-dialog-head{position:static;display:flex;flex-direction:column;align-items:center;gap:0;margin:0 0 18px}
.app-positive-confirmation .positive-confirmation-icon{text-align:center;margin:0 0 12px;line-height:1}
.app-positive-confirmation .positive-confirmation-icon .app-success-icon{width:32px;height:32px;margin:0;color:var(--accent)}
.app-positive-confirmation #programActionTitle,.schedule-dialog.app-positive-confirmation #scheduleDialogTitle{padding:0;margin:0 0 18px;font-size:24px;font-weight:500;line-height:1.3;letter-spacing:-.035em;text-align:center;color:var(--accent)}
.schedule-dialog.app-positive-confirmation #scheduleDialogTitle{margin-bottom:0}
.app-positive-confirmation #programActionMessage{font-size:14px;line-height:1.6;margin:0;text-align:left;color:var(--ink)}
.app-positive-confirmation #programActionMessage strong{font-size:18px;line-height:1.4;font-weight:500}
@media(max-width:900px),(pointer:coarse) and (max-width:1400px){dialog.app-positive-confirmation,.app-positive-confirmation .section-modal-card{padding:20px}}

/* Native schedule confirmations use the same centred mobile placement. */
@media(max-width:900px),(pointer:coarse) and (max-width:1400px){
  .schedule-dialog{margin:auto;max-height:calc(100dvh - 32px)}
}

/* Keep desktop account access at the right of the workspace tabs. */
body.builder-page .desktop-workspace-nav #signedInAccountLinks{margin-left:auto;align-self:center}
body.builder-page .desktop-workspace-nav #accountBtn{white-space:nowrap}

/* Give the mobile My Programs heading room above its controls. */
@media(max-width:900px),(pointer:coarse) and (max-width:1400px){
  body.workspace-programs-page #savedProgramsModal #savedProgramsTitle{margin-bottom:16px}
}

/* Assignment preview uses the same outline icon treatment as class controls. */
.saved-program-row:has(.assignScheduleProgram) .library-item-actions>.teachCloudProgram{
  background:transparent!important;color:var(--muted)!important;border:0!important;border-radius:7px;
}
.saved-program-row:has(.assignScheduleProgram) .teachCloudProgram svg{
  width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;
}
.saved-program-row:has(.assignScheduleProgram) .library-item-actions>.teachCloudProgram:hover,
.saved-program-row:has(.assignScheduleProgram) .library-item-actions>.teachCloudProgram:focus-visible{
  background:#e0e5e1!important;color:var(--accent)!important;
}

.schedule-studio-choices{display:flex;flex-wrap:wrap;gap:6px;margin-top:7px}
.schedule-studio-choice{display:inline-flex;max-width:100%;align-items:stretch;border:1px solid var(--line);border-radius:9px;background:var(--soft);overflow:hidden}
.schedule-studio-choice button{border:0;background:transparent;color:var(--accent);font:inherit;font-size:12px;min-height:36px}
.schedule-studio-select{padding:6px 9px;text-align:left;overflow-wrap:anywhere;min-width:0}
.schedule-studio-delete{padding:6px 10px;font-size:19px!important;flex-shrink:0}
.schedule-studio-choice button:hover,.schedule-studio-choice button:focus-visible{background:#dbe6df}

/* Assignment colours apply on desktop and mobile. */
.schedule-class.unassigned{background:var(--soft);border-color:#c4d5cb;color:var(--ink)}
.schedule-class.unassigned .schedule-card-time{color:var(--ink)}
.schedule-class.unassigned .schedule-card-meta{color:var(--muted)}
@media(max-width:900px), (pointer:coarse) and (max-width:1400px){
 .schedule-day{margin-bottom:12px}
 .schedule-day-heading{font-size:13px;margin-bottom:6px}
 .schedule-class{padding:8px 10px;margin-bottom:6px}
 .schedule-card-time{font-size:13px;line-height:1.25;margin-bottom:2px}
 .schedule-class .schedule-card-meta{font-size:12px;line-height:1.3}
 .schedule-class strong{font-size:13px;margin:4px 0 0}
 .schedule-class.unassigned{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:4px;align-items:center}
 .schedule-class.unassigned>.schedule-card-time,.schedule-class.unassigned>.schedule-card-meta{grid-column:1/-1}
 .schedule-class.unassigned>.schedule-choose-program{font-size:12px;padding:5px 6px;margin-top:0;justify-self:start;min-height:44px}
 .schedule-class.unassigned>.schedule-card-options{width:auto;gap:0;margin:0;justify-content:flex-end}
 .schedule-card-options button{width:44px;height:44px;padding:12px}
 .schedule-card-options svg{width:16px;height:16px}
 .schedule-add-day{width:auto;display:block;margin:0 0 0 auto;min-height:32px;padding:5px 8px;font-size:11px}
 .schedule-empty-day{padding:6px 0}
}

.schedule-card-studio{font-weight:400}
@media(max-width:900px), (pointer:coarse) and (max-width:1400px){
 .schedule-day{display:grid;grid-template-columns:38px minmax(0,1fr);gap:8px;align-items:start;margin:0;padding:9px 0;border-bottom:1px solid var(--line)}
 .schedule-day:last-child{border-bottom:0}.schedule-day-heading{display:block;text-align:center;margin:5px 0 0;font-size:11px;color:var(--muted)}
 .schedule-day-heading span{display:block;font-size:19px;color:var(--ink)}.schedule-day-content{min-width:0}
 .schedule-card-time{font-size:12px;line-height:1.4;overflow-wrap:anywhere}.schedule-class .schedule-card-meta{font-size:11px;line-height:1.4}
 .schedule-class strong{font-size:13px;margin:4px 0 0}.schedule-class.unassigned{grid-template-columns:minmax(0,1fr) 44px;row-gap:3px}
 .schedule-class.unassigned>.schedule-choose-program{font-weight:600;border:0;background:transparent;padding:4px 0;min-height:40px;text-align:left;margin:0}
 .schedule-class.unassigned>.schedule-card-options{min-height:40px}.schedule-card-options button{width:44px;height:40px}
 .schedule-empty-day{display:none}.schedule-add-day{margin-left:auto;min-height:32px;font-size:11px;padding:5px 8px}
 #schedulePickerContext{font-size:12px;line-height:1.4;margin:4px 0 8px;padding-right:28px;overflow-wrap:anywhere}
 .saved-programs-card:has(#schedulePickerContext) .saved-programs-tools{gap:8px}
 .saved-programs-card:has(#schedulePickerContext) .saved-program-filters:not(.mobile-open){display:none!important}
}

@media(max-width:900px), (pointer:coarse) and (max-width:1400px){.schedule-class.unassigned [data-history-occurrence]:disabled{display:none}}

.schedule-remove-program{border:0;background:transparent;color:var(--muted);font:inherit;font-size:12px;padding:8px;min-height:40px;text-decoration:underline}
.schedule-detail-date{font-weight:600}.schedule-detail-format{color:var(--muted)}
#scheduleNotes{min-height:44px;resize:none;overflow:hidden}#scheduleNotesStatus{font-size:12px;color:var(--accent)}#scheduleNotesStatus.schedule-error{color:var(--warn)}
@media(max-width:900px), (pointer:coarse) and (max-width:1400px){
 .schedule-dialog:not(.app-positive-confirmation){padding:14px;max-height:90dvh}
 .schedule-dialog-head{margin-bottom:10px}.schedule-dialog h2{font-size:20px}
 .schedule-class-details{display:flex;align-items:center;justify-content:space-between;gap:6px}
 .schedule-detail-list{display:grid;gap:3px;min-width:0;font-size:13px;line-height:1.4}
 .schedule-detail-list>div{display:block}.schedule-detail-list span{overflow-wrap:anywhere}
 .schedule-class-details>.schedule-card-options{flex-shrink:0;gap:0;margin:0}
 .schedule-class-details .schedule-card-options button{width:36px;height:44px;padding:9px}
 .schedule-assigned-name{font-size:17px;margin:14px 0 8px;overflow-wrap:anywhere}
 .schedule-program-actions{margin-top:6px;align-items:center}.schedule-program-actions #scheduleTeach{order:-1;flex:0 1 auto;min-width:100px}
 .schedule-notes-field{margin:14px 0 6px}.schedule-notes-field+.schedule-dialog-actions{margin-top:6px}
 .schedule-notes-field+.schedule-dialog-actions #scheduleSaveNotes{flex:0 1 auto}
 #savedProgramsModal:has(#schedulePickerContext){padding:8px}
 #savedProgramsModal:has(#schedulePickerContext) .saved-programs-card{width:100%;max-width:none;max-height:92dvh;padding:12px;overflow:auto}
 #savedProgramsModal:has(#schedulePickerContext) .saved-programs-sticky-head{position:sticky;top:-12px;z-index:5;background:var(--card);padding:8px 0 10px}
 #savedProgramsModal:has(#schedulePickerContext) .saved-programs-title-row{height:32px;min-height:32px}
 #savedProgramsModal:has(#schedulePickerContext) #closeSavedPrograms{min-width:40px;min-height:40px}
 #savedProgramsModal:has(#schedulePickerContext) .saved-programs-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}
 #savedProgramsModal:has(#schedulePickerContext) #programSearch{grid-column:1/-1;font-size:16px;width:100%;min-width:0}
 #savedProgramsModal:has(#schedulePickerContext) .saved-program-sort{display:flex;min-width:0;gap:4px;align-items:center}
 #savedProgramsModal:has(#schedulePickerContext) .saved-program-sort>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 #savedProgramsModal:has(#schedulePickerContext) .saved-program-sort select{font-size:12px;min-width:0;width:auto;flex:1;padding:8px 5px}
 #savedProgramsModal:has(#schedulePickerContext) .saved-program-mobile-filter-bar{display:flex;gap:4px;margin:0}
 #savedProgramsModal:has(#schedulePickerContext) .saved-program-mobile-filter-bar button{font-size:12px;padding:8px 5px}
 #savedProgramsModal:has(#schedulePickerContext) .saved-program-filters{grid-column:1/-1}
 #savedProgramsModal:has(#schedulePickerContext) .saved-program-row{padding:10px 0;gap:7px}
 #savedProgramsModal:has(#schedulePickerContext) .saved-program-name{font-size:15px}
 #savedProgramsModal:has(#schedulePickerContext) .saved-program-meta,#savedProgramsModal:has(#schedulePickerContext) .saved-program-date{font-size:11px;line-height:1.4}
 #savedProgramsModal:has(#schedulePickerContext) .library-item-actions{display:flex;align-items:center;gap:5px;flex-wrap:nowrap}
 #savedProgramsModal:has(#schedulePickerContext) .assignScheduleProgram,#savedProgramsModal:has(#schedulePickerContext) .teachCloudProgram{height:44px;min-height:44px;margin:0;font-size:12px}
 .schedule-other-class{padding:8px 0;font-size:12px;line-height:1.4}.schedule-other-class small{font-size:11px;margin-top:2px}
 #scheduleOtherClassChoices{max-height:24dvh;overflow:auto}#scheduleOtherClassChoices[hidden]{display:none}
 #scheduleOtherClassChoices>.notice{font-size:12px;margin:5px 0}.schedule-class-link{font-size:12px}
}

.mobile-program-sort{display:none}
@media(max-width:900px), (pointer:coarse) and (max-width:1400px){
 #savedProgramsModal .mobile-program-sort{display:block;font:inherit;font-size:13px;min-height:42px;border:1px solid var(--line);border-radius:9px;background:var(--card);color:var(--ink);padding:8px;min-width:0;width:100%}
 #savedProgramsModal .saved-program-sort{display:none!important}
 body.mobile-programs-page #savedProgramsModal .saved-programs-sticky-head{position:sticky;top:var(--programs-header-height,80px);z-index:6;background:var(--card);padding:8px 0 10px;margin-bottom:5px}
 body.mobile-programs-page #savedProgramsModal .saved-programs-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}
 body.mobile-programs-page #savedProgramsModal #programSearch{grid-column:1/-1;width:100%;font-size:16px;margin:0}
 body.mobile-programs-page #savedProgramsModal .saved-program-mobile-filter-bar{display:flex;align-items:center;gap:5px;margin:0}
 body.mobile-programs-page #savedProgramsModal .saved-program-mobile-filter-bar button{min-height:42px;padding:8px;font-size:12px}
 body.mobile-programs-page #savedProgramsModal .saved-program-filters{grid-column:1/-1}
 body.mobile-programs-page #savedProgramsModal .saved-program-row{display:flex;flex-direction:column;align-items:stretch;gap:7px;padding:12px 0}
 body.mobile-programs-page #savedProgramsModal .saved-program-info{width:100%;min-width:0}
 body.mobile-programs-page #savedProgramsModal .saved-program-name b{font-size:16px;line-height:1.35;overflow-wrap:anywhere}
 body.mobile-programs-page #savedProgramsModal .saved-program-meta{font-size:12px;line-height:1.4;margin-top:4px!important}
 body.mobile-programs-page #savedProgramsModal .saved-program-date{display:inline;font-size:11px;line-height:1.4}
 body.mobile-programs-page #savedProgramsModal .saved-program-last-taught::before{content:' · '}
 body.mobile-programs-page #savedProgramsModal .library-item-actions{display:flex;justify-content:flex-end;gap:6px;align-items:center;width:100%;margin:0}
 body.mobile-programs-page #savedProgramsModal .teachCloudProgram{min-height:44px;height:44px;padding:8px 15px;font-size:13px}
 body.mobile-programs-page #savedProgramsModal .savedProgramMore{width:44px;min-height:44px;height:44px}
 #savedProgramsModal:has(#schedulePickerContext) .mobile-program-sort{grid-column:1;width:100%}
}

@media(max-width:900px), (pointer:coarse) and (max-width:1400px){
 body.mobile-programs-page #savedProgramsModal .saved-program-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;align-items:end;padding:10px 0}
 body.mobile-programs-page #savedProgramsModal .saved-program-info{display:contents}
 body.mobile-programs-page #savedProgramsModal .saved-program-name,
 body.mobile-programs-page #savedProgramsModal .saved-program-meta{grid-column:1/-1}
 body.mobile-programs-page #savedProgramsModal .saved-program-date{display:block;grid-column:1;margin-top:0!important}
 body.mobile-programs-page #savedProgramsModal .saved-program-last-taught{grid-row:4}
 body.mobile-programs-page #savedProgramsModal .saved-program-last-taught::before{content:none}
 body.mobile-programs-page #savedProgramsModal .library-item-actions{grid-column:2;grid-row:3 / 5;width:auto;align-self:center}
}

.saved-program-row .teachCloudProgram .schedule-preview-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.saved-program-row .teachCloudProgram{display:inline-flex;align-items:center;justify-content:center;min-width:44px}
.saved-program-row .teachCloudProgram svg{width:20px;height:20px;flex-shrink:0}

/* Use the same quiet preview control in My Programs and schedule assignment. */
#savedProgramsModal .saved-program-row .library-item-actions>.teachCloudProgram{
 background:transparent!important;color:var(--muted)!important;border:0!important;border-radius:7px;
 width:44px;min-width:44px;height:44px;min-height:44px;padding:9px!important;display:inline-flex;align-items:center;justify-content:center;
}
#savedProgramsModal .saved-program-row .teachCloudProgram svg{
 width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;
}
#savedProgramsModal .saved-program-row .library-item-actions>.teachCloudProgram:hover,
#savedProgramsModal .saved-program-row .library-item-actions>.teachCloudProgram:focus-visible{
 background:#e0e5e1!important;color:var(--accent)!important;
}

/* Make assignment context and additional-class guidance easy to notice. */
#savedProgramsModal #schedulePickerContext{font-size:16px;line-height:1.45;font-weight:600;color:var(--accent)}
#savedProgramsModal #scheduleUseOtherClasses{font-size:15px;line-height:1.4;font-weight:600;min-height:44px}
#savedProgramsModal #scheduleOtherClassChoices>.notice{font-size:15px;line-height:1.45;color:var(--ink)}

.schedule-dialog #scheduleTeach.schedule-class-preview{
 background:transparent!important;color:var(--muted)!important;border:0!important;border-radius:7px;
 width:44px;min-width:44px;height:44px;min-height:44px;padding:9px!important;
 display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;
}
.schedule-dialog #scheduleTeach.schedule-class-preview svg{
 width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;
}
.schedule-dialog #scheduleTeach.schedule-class-preview:hover,
.schedule-dialog #scheduleTeach.schedule-class-preview:focus-visible{
 background:#e0e5e1!important;color:var(--accent)!important;
}

/* Stack the larger program preview above its more-actions menu. */
#savedProgramsModal:not(:has(#schedulePickerContext)) .saved-program-row .library-item-actions{
 flex-direction:column;align-items:center;justify-content:center;gap:0;width:auto;
}
#savedProgramsModal:not(:has(#schedulePickerContext)) .saved-program-row .library-item-actions>.teachCloudProgram{
 width:48px;min-width:48px;height:48px;min-height:48px;padding:6px!important;
}
#savedProgramsModal:not(:has(#schedulePickerContext)) .saved-program-row .teachCloudProgram svg{
 width:36px;height:36px;
}

/* Centre the remaining menu across the full program card. */
#savedProgramsModal:not(:has(#schedulePickerContext)) .saved-program-row .library-item-actions{align-self:center}
@media(max-width:900px), (pointer:coarse) and (max-width:1400px){
 body.mobile-programs-page #savedProgramsModal:not(:has(#schedulePickerContext)) .saved-program-name,
 body.mobile-programs-page #savedProgramsModal:not(:has(#schedulePickerContext)) .saved-program-meta{grid-column:1}
 body.mobile-programs-page #savedProgramsModal:not(:has(#schedulePickerContext)) .saved-program-row .library-item-actions{grid-column:2;grid-row:1 / 5;align-self:center}
}

.schedule-program-name-link{border:0;background:transparent;padding:0;color:var(--accent);font:inherit;font-weight:inherit;text-align:left;text-decoration:underline;text-underline-offset:3px;cursor:pointer;overflow-wrap:anywhere}
.schedule-program-name-link:focus-visible{outline:2px solid var(--accent);outline-offset:4px;border-radius:3px}
.schedule-assigned-name{margin-bottom:4px}.schedule-program-actions{margin-top:0;justify-content:flex-start}

/* Desktop styling shared with the refreshed mobile workspace. */
@media screen and (min-width:901px) and (pointer:fine), screen and (min-width:1401px){
 body.builder-page .grid .section-head{padding:12px 14px;gap:12px}
 body.builder-page .grid .section-head h3{font-size:17px;line-height:1.35}
 body.builder-page .grid .section-head .btn{font-size:13px;padding:8px 12px}
 body.builder-page .grid .sectionMore{background:transparent;border:0;color:var(--muted)}
 body.builder-page .exercise{border-radius:10px}
 body.builder-page .exercise input,body.builder-page .exercise textarea{line-height:1.45}
 body.builder-page .exercise-setup textarea{padding:10px 12px;border-radius:9px;background:#fff}
 #savedProgramsModal .saved-programs-tools{gap:10px}
 #savedProgramsModal .saved-program-row{padding:14px 12px;margin:8px 0;border:1px solid var(--line);border-radius:11px;gap:16px;align-items:center;transition:background .15s,border-color .15s}
 #savedProgramsModal .saved-program-row:hover{background:#f5f8f5;border-color:#c4d5cb}
 #savedProgramsModal .saved-program-row:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
 #savedProgramsModal .saved-program-info{min-width:0;flex:1}
 #savedProgramsModal .saved-program-name b{font-size:16px;line-height:1.4;overflow-wrap:anywhere}
 #savedProgramsModal .saved-program-meta{font-size:13px;line-height:1.45;margin-top:4px}
 #savedProgramsModal .saved-program-date{font-size:12px;line-height:1.45;margin-top:4px;color:var(--muted)}
 #savedProgramsModal .saved-program-row .savedProgramMore{display:inline-flex;align-items:center;justify-content:center;background:transparent!important;border:0;color:var(--muted);width:38px;min-height:38px;padding:6px;font-size:22px}
 #savedProgramsModal .savedProgramMore:hover{background:var(--soft)!important;color:var(--accent)}
 #savedProgramsModal .assignScheduleProgram{font-size:13px;min-height:38px;padding:8px 14px}
 .exercise-picker-result{padding:12px 8px;gap:12px;border-bottom:1px solid var(--line);border-radius:7px}
 .exercise-picker-result:hover{background:#f5f8f5}
 .exercise-picker-name b{font-size:15px;line-height:1.4;overflow-wrap:anywhere}
 .exercise-picker-meta{font-size:12px;line-height:1.45;color:var(--muted)}
 .exercise-picker-result .addLib,.exercise-picker-result .addSavedLib{font-size:13px;min-width:68px;padding:8px 12px}
 .exercise-picker .movement-drawer-head h2{font-size:22px}
 .exercise-picker-footer{border-top:1px solid var(--line);padding:12px 0}
 .teach-program-card{padding-top:0}
 .teach-preview-header{position:sticky;top:0;z-index:10;background:var(--card);align-items:center;padding:18px 0 12px;border-bottom:1px solid var(--line);margin-bottom:18px}
 .teach-preview-header h2{font-size:26px;line-height:1.3;margin:0}
 .teach-preview-header #closeTeachProgram{width:40px;height:40px}
 .teach-sections h3{background:var(--soft);color:var(--accent);border:1px solid var(--line);border-radius:9px;padding:10px 14px;font-size:17px}
 .teach-sections th{font-size:11px;font-weight:600;padding:10px 12px}
 .teach-sections td{font-size:14px;line-height:1.55;padding:12px;white-space:pre-wrap;overflow-wrap:anywhere}
 .teach-sections td div+div{margin-top:8px}
 .teach-overview{border-radius:10px;margin-bottom:18px}
 .teach-overview>div{padding:10px 12px}
 .teach-overview b{font-size:10px}.teach-overview span{font-size:14px;line-height:1.45;white-space:pre-wrap}
 .teach-taught-tools .btn{font-size:13px;padding:8px 12px}
 .schedule-dialog{border-radius:14px}
 .schedule-dialog-head{padding-bottom:12px;border-bottom:1px solid var(--line)}
 .schedule-class-details{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}
 .schedule-detail-list{gap:4px}.schedule-detail-list>div{display:block;font-size:14px;line-height:1.5}
 .schedule-assigned-name{font-size:18px;line-height:1.4;margin:18px 0 4px}
 .schedule-dialog .schedule-notes-field{margin-top:16px}
 .schedule-calendar{border-radius:12px}
 .schedule-day-heading{background:var(--soft);border-radius:8px;padding:8px 4px;margin-bottom:12px;color:var(--accent);font-size:12px}
 .schedule-class{border-radius:9px;padding:10px 9px}
 .schedule-class strong{font-size:13px;line-height:1.4}
 .schedule-card-options button{background:transparent;color:var(--muted)}
 .schedule-add-day{font-size:12px}
}

/* Allow desktop exercise-library users to choose the destination section. */
@media screen and (min-width:901px) and (pointer:fine), screen and (min-width:1401px){
 .exercise-picker #movementDrawerSection{display:none}
 .exercise-picker #pickerSectionSelect{display:inline-block;max-width:240px;min-height:36px;padding:6px 30px 6px 9px;border:1px solid var(--line);border-radius:8px;background-color:var(--card);color:var(--accent);font:inherit;font-size:13px;font-weight:600;vertical-align:middle;cursor:pointer}
 .exercise-picker #pickerSectionSelect:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
}

/* Program action menus use the top layer to escape clipped card containers. */
.saved-program-more-menu[popover]{position:fixed;inset:auto;margin:0;box-sizing:border-box;z-index:1500;overflow-y:auto;overscroll-behavior:contain;background:var(--card);color:var(--ink);border:1px solid var(--line)}
.saved-program-more-menu[popover]::backdrop{background:transparent;pointer-events:none}

/* Two-column collection cards in the desktop My Programs page. */
@media screen and (min-width:901px) and (pointer:fine), screen and (min-width:1401px){
 body.workspace-programs-page #savedProgramsList{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 body.workspace-programs-page #savedProgramsModal .saved-program-row{margin:0;min-width:0;height:100%}
 body.workspace-programs-page #savedProgramsModal .saved-program-row .library-item-actions{flex-shrink:0;align-self:center}
 body.workspace-programs-page #savedProgramsList>.saved-programs-empty{grid-column:1/-1}
}

/* Use the same program sorting and filter controls across desktop and mobile. */
@media screen and (min-width:901px) and (pointer:fine), screen and (min-width:1401px){
 #savedProgramsModal .saved-programs-tools{display:grid;grid-template-columns:minmax(0,1fr) 210px auto;gap:10px;align-items:center;margin-bottom:14px}
 #savedProgramsModal #programSearch{width:100%;margin:0;min-height:42px}
 #savedProgramsModal .saved-program-sort{display:none!important}
 #savedProgramsModal .mobile-program-sort{display:block;width:100%;min-height:42px;border:1px solid var(--line);border-radius:9px;background:var(--card);color:var(--ink);font:inherit;font-size:13px;padding:8px 10px}
 #savedProgramsModal .saved-program-mobile-filter-bar{display:flex;align-items:center;gap:8px;margin:0}
 #savedProgramsModal .saved-program-mobile-filter-bar button{min-height:42px;padding:8px;font-size:13px}
 #savedProgramsModal .saved-program-filters{grid-column:1/-1;display:none;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:0}
 #savedProgramsModal .saved-program-filters.mobile-open{display:grid}
 #savedProgramsModal .saved-program-filters select{width:100%;min-width:0;min-height:40px;font-size:13px}
 #savedProgramsModal #clearProgramFilters{display:none}
}

@media screen and (min-width:901px) and (pointer:fine), screen and (min-width:1401px){
 body.builder-page .hero{position:sticky;top:0;z-index:40;background:var(--bg)}
}

/* The centred account dialog has rounded corners on every edge. */
@media(max-width:900px),(pointer:coarse) and (max-width:1400px){
 #accountPanel .account-modal-card{border-radius:22px}
}

#schedulePickerContext:has(.schedule-picker-history){display:flex;align-items:center;justify-content:space-between;gap:10px}
.schedule-picker-history{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;border:0;border-radius:8px;background:transparent;color:var(--muted);padding:10px;cursor:pointer}
.schedule-picker-history svg{width:22px;height:22px}
.schedule-picker-history:hover,.schedule-picker-history:focus-visible{background:var(--soft);color:var(--accent)}

.class-program-history-head{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--card);z-index:2}
.class-program-history-head h2{font-size:21px;line-height:1.3;margin:0}
.class-program-history-head .section-modal-close{position:static;flex:0 0 44px;width:44px;height:44px}
.class-program-history-card{width:min(520px,calc(100% - 24px));border-radius:18px;max-height:85dvh;overflow:auto}
.class-program-history-list{display:grid;gap:10px}
.class-program-history-entry{position:relative;display:grid;gap:5px;padding:14px 38px 14px 14px;background:var(--soft);border:1px solid var(--line);border-radius:10px;text-align:left;color:var(--accent);font:inherit;width:100%}
.class-program-history-entry>span:first-child{font-size:12px;color:var(--muted)}
.class-program-history-entry strong{font-size:16px;overflow-wrap:anywhere}
.class-program-history-arrow{position:absolute;right:14px;top:50%;transform:translateY(-50%);font-size:25px}
#classProgramHistoryModal{align-items:center;justify-content:center;padding:12px}
#classProgramHistoryModal .class-program-history-card{border-radius:18px}

/* Keep history discoverable even before previous programs exist. */
.schedule-picker-history:not(:disabled),.schedule-class [data-history-occurrence]:not(:disabled){color:var(--accent)}
.schedule-picker-history:disabled,.schedule-class [data-history-occurrence]:disabled{display:inline-flex!important;opacity:.35;cursor:default}
.schedule-picker-history:disabled:hover{background:transparent;color:var(--muted)}

.schedule-assigned-name:has(.schedule-program-name-link){display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.schedule-program-name-link{min-width:0}
.schedule-remove-program-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 40px;width:40px;height:40px;padding:9px;border:0;border-radius:7px;background:transparent;color:var(--muted);cursor:pointer}
.schedule-remove-program-icon svg{width:20px;height:20px}
.schedule-remove-program-icon:hover,.schedule-remove-program-icon:focus-visible{background:#f9e7e3;color:#b44335}
.schedule-program-actions:empty{display:none}
