.history-section { margin-top: 26px; border: 1px solid #d9d2c5; background: #fbf9f4; }
.history-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border: 0; background: transparent; color: #205747; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.history-toggle small { margin-left: 7px; font-size: .84em; font-weight: 400; }
.history-chevron { font-size: 22px; line-height: 1; transition: transform .2s; }
.history-toggle[aria-expanded="true"] .history-chevron { transform: rotate(180deg); }
.history-panel { padding: 0 18px 18px; }
.history-panel[hidden], .schedule-wrap[hidden], .schedule-empty[hidden], .history-empty[hidden], .history-table[hidden] { display: none; }
.history-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0 14px; }
.history-toolbar p, .schedule-empty, .history-empty { margin: 0; color: #6f716a; font-size: 14px; }
.history-clear { border: 1px solid #ba6b59; background: transparent; color: #a44835; padding: 8px 11px; cursor: pointer; font: inherit; font-size: 13px; }
.history-clear:hover:not(:disabled) { background: #fbebe7; }
.history-clear:disabled { opacity: .45; cursor: default; }
.history-table td { white-space: normal; overflow-wrap: anywhere; }
.history-table td:last-child { min-width: 100px; }
.restore-row { border: 0; padding: 5px 0; background: transparent; color: #205747; font: inherit; font-weight: 600; cursor: pointer; }
.restore-row:hover { text-decoration: underline; }
.schedule-empty { padding: 13px 0 0; }
.history-empty { padding: 14px 0 2px; }
#archive-schedule:disabled { opacity: .45; cursor: default; }
@media (max-width: 700px) { .history-panel { padding: 0 10px 12px; } .history-table { min-width: 720px; } }
.cloud-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cloud-controls select, .dorm-mapping select { border: 1px solid #c8c9bd; background: #fffdf8; color: #203b32; padding: 9px 12px; font: inherit; max-width: 100%; }
.cloud-controls span, .local-note, .workflow-status, .mapping-note { color: #656c61; font-size: 14px; line-height: 1.7; }
.workflow-status { overflow-wrap: anywhere; }
.workflow-status[data-tone="error"] { color: #ad4a32; }
.required-clients { margin-top: 20px; padding: 16px; background: #f3f0e7; font-size: 14px; }
.client-requirements { display: grid; gap: 8px; margin: 10px 0 0; padding-left: 28px; }
.client-requirement { border: 1px solid #d4cbbb; padding: 7px 10px; overflow-wrap: anywhere; }
.client-prefix { font-weight: 700; user-select: text; }
.client-file-status { margin-left: 10px; white-space: nowrap; }
.client-file-status::before { content: '· '; }
.client-requirement.is-ready { color: #205747; background: #eaf1e8; }
.client-requirement.is-missing { color: #a44835; }
.schedule-picker { margin-bottom: 34px; padding-bottom: 28px; border-bottom: 1px solid #d9d2c5; }
.schedule-picker h2 { margin-bottom: 10px; }
.workflow-empty { color: #6f716a; padding: 15px 0; }
.dorm-option { border: 1px solid #d9d2c5; margin: 12px 0; padding: 15px; }
.dorm-option.is-selected { border-color: #205747; background: #fafbf6; }
.dorm-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; cursor: pointer; }
.dorm-title span { color: #687066; font-size: 14px; margin-left: auto; }
.dorm-title input, .client-options input { width: 18px; height: 18px; flex-shrink: 0; accent-color: #205747; }
.dorm-mapping { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; font-size: 14px; color: #a44835; }
.mapping-note { margin: 7px 0 0 28px; }
.client-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #deded1; }
.client-options label { display: flex; align-items: center; gap: 9px; padding: 9px; background: white; border: 1px solid #e4e2d9; cursor: pointer; font-size: 14px; }
.client-options small { margin-left: auto; white-space: nowrap; color: #205747; }
.selection-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 18px; font-size: 14px; }
.selection-button { background: #205747; color: white; border: 0; padding: 12px 18px; font: inherit; cursor: pointer; }
.selection-button:disabled, #analyze:disabled { opacity: .45; cursor: not-allowed; }
[hidden] { display: none !important; }
@media (max-width: 700px) { .dorm-title span { margin-left: 28px; width: 100%; } .selection-footer { flex-wrap: wrap; } }

.month-picker { border: 1px solid #d9d2c5; padding: 14px; margin: 0; min-width: 0; }
.month-picker legend { color: #205747; padding: 0 6px; font-weight: 600; }
#schedule-months { max-height: 280px; overflow-y: auto; }
.month-year + .month-year { margin-top: 14px; }
.month-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.month-options label { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid #d9d2c5; background: #fffdf8; cursor: pointer; }
.month-options label:has(input:checked) { background: #eaf1e8; border-color: #205747; }
.month-options input { width: 18px; height: 18px; accent-color: #205747; }

.paste-dorms { margin: 16px 0; padding: 14px; border: 1px solid #d9d2c5; }
.paste-dorms summary { cursor: pointer; color: #205747; font-weight: 600; }
.paste-dorms label { display: block; margin: 14px 0 8px; }
.paste-dorms textarea { display: block; box-sizing: border-box; width: 100%; padding: 12px; font: inherit; resize: vertical; border: 1px solid #c8c9bd; background: #fffdf8; }
