* { box-sizing: border-box; }
body { margin: 0; color: #172a47; background: #f7f9fc; font: 15px/1.45 Arial, sans-serif; }
main { width: min(1010px, calc(100% - 32px)); margin: 28px auto 48px; }
h1 { font-size: 27px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 12px; }
p { margin: 0 0 10px; }
#message { min-height: 1.5em; color: #294b72; }
#message:empty { position: absolute; min-height: 0; margin: 0; }
.workspace { display: grid; grid-template-columns: minmax(230px, 1fr) minmax(0, 1.55fr); gap: 15px; align-items: start; }
.workspace > *, .draft { background: white; border: 1px solid #d7e0eb; padding: 15px; border-radius: 5px; }
form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; }
form h2, .wide { grid-column: 1 / -1; }
label { display: grid; gap: 3px; font-size: 13px; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea, button { border: 1px solid #aebcce; border-radius: 4px; padding: 6px 8px; min-width: 0; background: white; }
button { cursor: pointer; margin-bottom: 3px; }
button:hover { background: #edf3fa; }
.primary { background: #173a65; border-color: #173a65; color: white; }
.primary:hover { background: #244b77; }
.publish, .publish:disabled, .update-sheets { background: #2d6b50; border-color: #2d6b50; color: white; }
.publish:hover:not(:disabled), .update-sheets:hover:not(:disabled) { background: #24583f; border-color: #24583f; }
.update-sheets:disabled { background: #547165; border-color: #547165; color: white; cursor: default; }
.update-sheets:focus-visible { outline-color: #24583f; }
.publish:disabled { cursor: default; }
:is(.publish, .update-sheets)[aria-busy="true"] {
  background-image: linear-gradient(105deg, transparent 36%, #ffffff1f 50%, transparent 64%);
  background-size: 280% 100%;
  animation: publish-shimmer 1.5s linear infinite;
}
@keyframes publish-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  :is(.publish, .update-sheets)[aria-busy="true"] { animation: none; background-image: none; }
  :is(.publish, .update-sheets)[aria-busy="true"]::before { content: ''; display: inline-block; width: .7em; height: .7em; margin-inline-end: .45em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
}
#publish-error { color: #9c2a35; }
#copy-month-preview .editor-heading button { min-height: 36px; margin: 0; }
ul { list-style: none; padding: 0; margin: 8px 0 0; }
li { border-top: 1px solid #d7e0eb; padding: 8px 0; }
li p { color: #49596e; font-size: 13px; margin: 2px 0 5px; }
li button { margin-right: 5px; font-size: 12px; }
.draft { margin-top: 15px; }
:focus-visible { outline: 2px solid #174c87; outline-offset: 2px; }
@media (max-width: 650px) { .workspace { grid-template-columns: 1fr; } }
#courses { max-height: 440px; overflow: auto; }
.staff-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.staff-heading h1 { display: flex; align-items: center; gap: 10px; min-width: 0; }
.staff-logo { display: block; width: clamp(30px, 6vw, 40px); height: auto; flex: none; }
.staff-heading #sign-out { flex: none; }
.sign-in-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.login { width: min(470px, calc(100% - 32px)); margin: 24px 0; padding: clamp(20px, 5vw, 36px); background: white; border: 1px solid #d7e0eb; border-top: 4px solid #9e2735; border-radius: 10px; box-shadow: 0 12px 35px #172a4712; text-align: center; }
.login h1 { font-size: clamp(22px, 4vw, 27px); margin: 16px 0; }
.login-logo { display: block; width: min(220px, 80%); height: auto; margin-inline: auto; }
.login-form { grid-template-columns: 1fr; gap: 14px; margin: 16px 0; text-align: left; }
.login-form input:not([type="checkbox"]), .login-form button { min-height: 42px; }
.login-password { display: grid; grid-template-columns: minmax(0, 1fr) 62px; align-items: end; gap: 6px; }
.login-password button { margin: 0; }
.login [role="alert"] { color: #9c2a35; }
.schedule-admin { width: min(1180px, calc(100% - 32px)); }
.calendar-panel, .sessions, .management { margin: 14px 0; padding: 14px; background: white; border: 1px solid #d7e0eb; border-radius: 6px; }
.sessions { padding: 0; }
.sessions > summary { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; font-weight: 700; }
.sessions > summary:hover { background: #eff5fc; }
.sessions > summary::-webkit-details-marker { display: none; }
.sessions > summary::before { content: ''; width: 6px; height: 6px; border: solid #526981; border-width: 0 1px 1px 0; transform: rotate(-45deg); }
.sessions[open] > summary { border-bottom: 1px solid #d7e0eb; }
.sessions[open] > summary::before { transform: rotate(45deg); }
.list-view-content { padding: 8px 14px 12px; }
.list-view-toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; }
.list-view-toolbar .course-search { flex: 1 1 150px; min-width: min(120px, 100%); max-width: 300px; }
.list-view-toolbar :is(input, select, button) { height: 36px; }
.list-view-toolbar button { flex: none; margin: 0; margin-inline-start: auto; }
.list-filter { display: grid; gap: 3px; flex: 0 1 auto; min-width: 0; max-width: 100%; }
.list-filter select { width: 100%; appearance: none; padding-inline-end: 28px; }
.list-course-control { position: relative; display: block; }
.list-course-control::after { content: ''; position: absolute; inset-inline-end: 12px; inset-block-start: 50%; width: 6px; height: 6px; border: solid #526981; border-width: 0 1px 1px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.list-day-hours { white-space: nowrap; line-height: 1.4; }
#list-course { padding-inline-start: 28px; }
#list-course-swatch { position: absolute; inset-inline-start: 9px; inset-block-start: 50%; transform: translateY(-50%); width: 12px; height: 12px; border: 1px solid #aebcce; border-radius: 3px; pointer-events: none; }
@media (max-width: 540px) {
  .list-view-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .list-view-toolbar .course-search { max-width: none; }
  .list-view-toolbar button { grid-column: 2; grid-row: 1; width: 100%; }
}
.list-view-actions { margin-top: 8px; gap: 8px 14px; }
.list-view-actions button { margin: 0; }
#list-feedback { margin: 6px 0 0; }
#list-feedback:empty { display: none; }
#restore-options { position: fixed; inset: auto; margin: 0; padding: 4px; border: 1px solid #aab7c9; border-radius: 6px; background: white; }
#restore-options button { display: block; width: 100%; text-align: left; }
.list-check { width: 1%; min-width: 0; text-align: center; vertical-align: middle; }
.list-check input { width: 16px; height: 16px; margin: 0; vertical-align: middle; accent-color: #173a65; cursor: pointer; }
#session-expired { background: #fff3f2; border: 1px solid #d7a8a9; border-radius: 4px; padding: 8px 10px; }
.calendar-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.calendar-actions { justify-content: flex-end; }
.calendar-actions button { min-height: 34px; margin: 0; padding: 3px 8px; font-size: 14px; }
.calendar-actions .history-controls button { font-size: 18px; }
.history-controls { display: inline-flex; gap: 4px; }
.history-controls button { min-width: 34px; padding: 5px 7px; font-size: 19px; line-height: 1.15; }
.history-controls button:disabled { color: #64748a; background: #f4f6f9; border-color: #d7e0eb; cursor: default; }
.table-scroll { max-height: 480px; overflow: auto; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th, td { border-bottom: 1px solid #d7e0eb; padding: 7px; vertical-align: top; }
th { position: sticky; top: 0; background: #f0f4f9; z-index: 1; white-space: nowrap; }
td { min-width: 90px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
td.actions { display: table-cell; min-width: 168px; vertical-align: middle; }
.row-actions { display: flex; gap: 6px; align-items: center; }
.row-actions button { margin: 0; font-size: 12px; }
.row-actions:has(.lifecycle-confirm) { min-width: 215px; }
.row-actions .row-button { flex: 0 0 72px; height: 31px; padding: 4px 8px; white-space: nowrap; }
.row-actions.trash-actions .row-button { flex-basis: 122px; }
.list-edit { background: #172a54; border-color: #172a54; color: white; }
.list-edit:hover { background: #24436e; }
.list-cancel { background: #9e2735; border-color: #9e2735; color: white; }
.list-cancel:hover:not(:disabled) { background: #7d1d28; }
.list-destructive { background: white; border-color: #9e2735; color: #9e2735; }
.list-destructive:hover:not(:disabled) { background: #fff1f2; }
.list-view-actions button:disabled { background: #f4f6f9; border-color: #d7e0eb; color: #64748a; cursor: default; }
.wide-dialog { width: min(940px, calc(100% - 28px)); }
.dialog-actions { margin-top: 10px; }
.inline-check { display: flex; align-items: center; gap: 6px; }
.copy-warning { color: #6c4c19; }
.copy-error { color: #9e2735; font-weight: 600; }
#copy-dialog td, #sheets-dialog td { vertical-align: middle; }
#copy-dialog td:last-child { min-width: 210px; }
#sheets-content { margin-bottom: 10px; }
.change-list { margin: 0; }
.change-scroll { max-height: min(360px, 42vh); overflow: auto; padding-inline-end: 8px; }
.export-csv { display: inline-block; margin-bottom: 3px; padding: 6px 8px; border: 1px solid #aebcce; border-radius: 4px; background: white; color: inherit; text-decoration: none; }
.export-csv:hover { background: #edf3fa; }
.preview-button, .preview-button:visited { background: #3074b2; border-color: #3074b2; color: white; }
.preview-button:hover { background: #28659e; border-color: #28659e; }
.preview-button[aria-disabled="true"] { background: #576f85; border-color: #576f85; cursor: default; }
.schedule-export { margin-block-start: 12px; }
.publication-actions { margin-block: 8px 12px; }
.save-draft { margin-inline-start: auto; display: inline-flex; align-items: center; gap: .45rem; }
.save-draft[aria-busy="true"] svg { animation: save-pulse .9s ease-in-out infinite alternate; }
@keyframes save-pulse { from { opacity: 1; } to { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .save-draft[aria-busy="true"] svg { animation: none; }
}
#save-feedback { color: #9c2a35; }
#publication-status { color: #526981; font-size: 13px; }
.field-error { font-size: 12px; font-weight: normal; color: #9c2a35; }
#pending-count { font-size: 14px; margin: 4px 0 6px; }
.change-list li { display: grid; gap: 2px; overflow-wrap: anywhere; }
.change-list small { color: #53657c; }
#pending-notice { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.text-action, .text-action:hover { border: 0; margin: 0; padding: 2px; background: transparent; color: #18558e; text-decoration: underline; }
#draft-feedback:empty { display: none; }
.pending-undo { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.pending-undo button { margin: 0; white-space: nowrap; }
#annual-sheet { margin-top: 12px; }
.duplicate-dialog { width: min(630px, calc(100% - 28px)); }
#copy-months { display: grid; gap: 6px; }
.destination-month { min-width: 0; border: 1px solid #d4ddea; border-radius: 5px; padding: 6px 8px; }
.destination-month:has(.destination-heading input:checked) { background: #eff5fc; border-color: #7392b3; }
.destination-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.destination-heading button { margin: 0; }
.destination-heading label { cursor: pointer; }
.destination-month summary { font-size: 13px; cursor: pointer; color: #365b83; margin-top: 4px; }
#draft-feedback:empty { display: none; }
.duplicate-options { margin-top: 12px; }
.duplicate-detail-list { max-height: 32vh; overflow-y: auto; padding-right: 6px; }
.duplicate-detail-list li { display: grid; gap: 4px; }
.duplicate-date { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#copy-report { margin: 8px 0 0; }
.sheet-removed { text-decoration: line-through; }
.management summary { cursor: pointer; font-weight: 600; }
.management[open] summary { margin-bottom: 8px; }
dialog { width: min(540px, calc(100% - 28px)); max-height: calc(100% - 28px); border: 1px solid #aebcce; border-radius: 8px; padding: 17px; color: inherit; }
dialog::backdrop { background: #172a4760; }
#course-dialog { width: min(640px, calc(100% - 28px)); }
.daily-field { min-width: 0; border: 1px solid #d7e0eb; border-radius: 5px; margin: 2px 0; padding: 8px; }
.daily-field legend { font-weight: 700; }
.daily-row { display: grid; grid-template-columns: minmax(118px, 1.25fr) minmax(88px, 1fr) minmax(88px, 1fr) auto; gap: 5px; align-items: end; margin-bottom: 6px; }
.daily-row button { margin: 0; min-height: 32px; }
.daily-day-heading { grid-column: 1 / -1; margin: 4px 0 0; font-size: 14px; }
.daily-row details { grid-column: 1 / -1; font-size: 12px; }
.daily-row details summary { cursor: pointer; margin-bottom: 3px; }
#daily-context, #daily-advisory { margin: 4px 0; font-size: 13px; color: #5b4b2e; }
@media (max-width: 530px) {
  .daily-row { grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid #d7e0eb; padding-bottom: 6px; }
  .daily-row > label:first-of-type { grid-column: 1 / -1; }
}
dialog [role="alert"] { color: #9c2a35; }
[hidden] { display: none !important; }
.delete-course { background: #9e2735; border-color: #9e2735; color: white; }
.delete-course:hover { background: #7d1d28; }
.cancel-course { background: #b64a54; border-color: #b64a54; color: white; }
.cancel-course:hover { background: #a03b45; border-color: #a03b45; }
.editor-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.editor-heading h2, .calendar-heading h2 { margin: 0; }
.editor-lifecycle:not(:empty) { border-top: 1px solid #d7e0eb; padding-top: 8px; }
.discard-prompt { background: #fff6de; padding: 8px; border-radius: 4px; }
.color-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.color-field legend { padding: 0; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.palette button { min-height: 30px; }
.palette .swatch { width: 30px; padding: 0; }
.palette [aria-pressed="true"] { box-shadow: 0 0 0 2px #173a65; }
.palette .swatch[aria-pressed="true"]::after { content: '✓'; color: #173a65; }
#custom-color:not([hidden]) { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 6px; }
#color-picker { padding: 2px; width: 44px; height: 30px; }
#color-hint { margin: 4px 0 0; font-size: 12px; }
#color-hint:empty { display: none; }
#editor .required-field { border-color: #af5360; }
.course-start-date { align-self: start; }
#confirm-end-date { margin: 4px 0 0; font-size: 12px; }
.move-notice {
  position: fixed;
  z-index: 5;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  background: #173a65;
  color: white;
  box-shadow: 0 3px 14px #142c4a30;
}
.move-notice.move-error { background: #8e2532; }
.move-notice button { margin: 0; background: white; color: #173a65; }
.move-notice button:focus-visible { outline-color: white; }
.lifecycle-confirm p { margin: 0 0 5px; }
.lifecycle-confirm button { margin-right: 6px; }
