.topics-modal { width: min(1400px, calc(100vw - 32px)); max-width: calc(100vw - 32px); height: min(860px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); padding: 0; border-radius: 8px; background: #fff; }
.topics-modal h2, .review-modal h2, .scenario-library h2 { font-size: 20px; letter-spacing: 0; }
.topics-modal h3 { font-size: 17px; letter-spacing: 0; margin: 0; }
.topics-modal .modal-header > div { min-width: 0; }
.topics-modal h2, .topics-modal h3 { overflow-wrap: anywhere; }
.topics-modal .modal-header .icon-button { flex-shrink: 0; }
.topics-modal .modal-header { padding: 16px 22px; }
.topic-modal-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topic-modal-actions .secondary { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; border-radius: 6px; }
.topics-modal .primary { background: #2459ba; box-shadow: none; border-radius: 6px; }
.topics-modal p, .scenario-library p { margin-bottom: 0; }
.topics-modal .modal-header p, .scenario-library .modal-header p { font-size: 12px; margin: 6px 0 0; }
.topics-modal .modal-header .topics-dialog-period { color: #465b77; }
.topics-modal .modal-header .topics-dialog-check { color: #66758a; }
.topics-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 8px 22px; border-bottom: 1px solid var(--line); background: #f7f9fb; }
.topics-toolbar span { font-size: 12px; color: var(--muted); }
.topics-toolbar input { max-width: 350px; }
.topic-period-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; padding: 10px 22px; border-bottom: 1px solid var(--line); background: #f7f9fb; flex-shrink: 0; }
.topic-period-modes { display: flex; gap: 0; padding: 0; margin: 0; border: 1px solid #dce3eb; border-radius: 6px; min-width: 0; background: #fff; }
.topic-period-modes label { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 9px 12px; min-height: 38px; cursor: pointer; font-size: 12px; color: #465b77; }
.topic-period-modes label + label { border-left: 1px solid #dce3eb; }
.topic-period-modes label:has(input:checked) { background: #eaf1fc; color: #234f95; }
.topic-period-modes label:has(input:focus-visible) { outline: 2px solid #2459ba; outline-offset: -2px; }
.topic-period-modes input { width: 14px; height: 14px; margin: 0; accent-color: #2459ba; }
.topic-period-dates { display: flex; gap: 10px; min-width: 0; }
.topic-period-dates label { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: #465b77; font-size: 12px; min-width: 0; }
.topic-period-dates input { width: 145px; max-width: 100%; min-width: 0; height: 38px; padding: 7px 9px; border-radius: 6px; font-size: 12px; color: var(--text); background: #fff; }
.topic-period-dates input[aria-invalid="true"] { border-color: #bc3d3d; }
.topic-period-count { font-size: 12px; color: #66758a; }
.topic-period-count.dirty { color: #946021; }
.topics-modal .topic-period-error { color: #b33232; font-size: 12px; flex-basis: 100%; margin: 0; }
#topicsNotice, #topicSourceNotice, #scenarioLibraryNotice { margin: 12px 24px; border-radius: 6px; }
.source-update-notice { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; background: #fff7e7; border-color: #e8ce98; color: #79500f; }
.source-update-notice span { flex: 1 1 260px; }
#topicExportSkipped { margin: 0 24px 12px; }
.topics-workspace { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; flex: 1; overflow: hidden; }
.topics-workspace.single-topic { grid-template-columns: minmax(0, 1fr); }
.topics-workspace.single-topic .topics-sidebar { display: none; }
.topic-source-history { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.topic-source-history > summary { cursor: pointer; color: var(--muted); font-size: 12px; }
#topicHistoryMessages { padding-top: 14px; display: grid; gap: 10px; }
.topics-modal .topics-toolbar, .topics-modal > .notice { flex-shrink: 0; }
.topics-sidebar { padding: 14px 12px; border-right: 1px solid var(--line); background: #f8f9fb; min-width: 0; min-height: 0; overflow: auto; }
.topic-list { display: grid; gap: 8px; margin-top: 0; }
.topic-card { width: 100%; text-align: left; padding: 13px; display: grid; gap: 8px; border-radius: 6px; background: #fff; color: var(--text); border: 1px solid var(--line); overflow-wrap: anywhere; }
.topic-card strong { font-size: 13px; font-weight: 600; }
.topic-card small { font-size: 11px; color: var(--muted); }
.topic-card[aria-pressed="true"] { border-color: #477766; box-shadow: inset 3px 0 #477766; background: #f2faf6; }
.topic-status { font-size: 11px; color: #805a28; }
.topic-status.approved, .topic-status.ready { color: #287250; }
.topic-detail { min-width: 0; min-height: 0; overflow: auto; padding: 18px 22px; }
.topic-scenario { min-width: 0; }
#topicAdditionalSections .topic-scenario { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.topic-detail-heading, .topic-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.topic-detail-heading span { font-size: 12px; color: var(--muted); }
.topic-actions { justify-content: flex-start; }
.topic-rating-label { font-size: 11px; color: #476777; }
.topic-rating-summary { display: grid; gap: 5px; margin-bottom: 12px; font-size: 13px; }
.topic-rating-comment { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.topic-rating-summary .stale, .topic-rating-label.stale { color: #946021; }
.topic-rating-name { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.topic-score { margin: 0; padding: 0; border: 0; min-width: 0; }
.topic-score legend { margin-bottom: 12px; font-size: 13px; }
.topic-score-options { display: flex; gap: 10px; flex-wrap: wrap; }
.topic-score-options label { position: relative; width: 44px; height: 42px; cursor: pointer; }
.topic-score-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.topic-score-options span { display: grid; place-items: center; width: 100%; height: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.topic-score-options input:checked + span { background: #e7f5ef; border-color: #367157; color: #285a44; }
.topic-score-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.topic-score-options input:disabled + span { opacity: .6; cursor: wait; }
.topic-move { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 0; margin-top: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.topic-move span { font-size: 12px; white-space: nowrap; }
.topic-move label { flex: 1 1 140px; }
.topic-move input, .topic-move select { border-radius: 6px; padding: 8px; font-size: 12px; }
.topic-messages { display: grid; gap: 14px; margin: 14px 0; }
.topic-messages:has(.scenario-editor) { display: block; overflow-x: auto; }
.scenario-editor { width: 100%; min-width: 680px; table-layout: fixed; border-collapse: collapse; }
.scenario-editor th { text-align: left; font-size: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #f4f6f8; }
.scenario-editor th:nth-child(1) { width: 26%; }
.scenario-editor th:nth-child(2) { width: 51%; }
.scenario-editor th:nth-child(3) { width: 23%; }
.scenario-editor td { vertical-align: top; padding: 18px 14px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.scenario-editor textarea, .scenario-editor select { width: 100%; min-width: 0; border-radius: 6px; font-size: 13px; padding: 10px; }
.scenario-editor select { margin-bottom: 10px; }
.scenario-editor textarea { resize: vertical; min-height: 130px; }
.scenario-editor small { display: block; margin-top: 8px; }
.scenario-editor .topic-message-text { margin: 3px 0; font-size: 14px; }
.review-reply { display: grid; gap: 9px; }
.review-reply-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 30px; }
.review-context-label { color: #66758a; font-size: 11px; font-weight: 500; line-height: 1.5; }
.review-answer-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; }
.review-reply textarea { min-height: 155px; background: #fff; border: 1px solid #6b91c8; line-height: 1.65; font-size: 14px; }
.review-reply-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 3px; }
.review-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.review-icon-button { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; background: #fff; border: 1px solid #dce3eb; border-radius: 4px; cursor: pointer; }
.review-icon-button:hover { background: #eef3f9; border-color: #8c9bb0; }
.review-icon-button:focus-visible { outline: 2px solid #2459ba; outline-offset: 2px; }
.review-save-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 7px 10px; background: #edf4ff; color: #234f95; border: 1px solid #d4e1f5; border-radius: 4px; font-size: 12px; font-weight: 600; cursor: pointer; }
.review-save-button:hover { background: #dfebff; }
.review-save-status { font-size: 11px; color: #6b7787; }
.review-save-status.saved { color: #287250; }
.review-save-status.dirty { color: #946021; }
.dialog-review-status { display: flex; align-items: center; gap: 5px; margin-top: 7px; font-size: 11px; line-height: 1.5; color: #66758a; white-space: nowrap; }
.dialog-review-status.reviewed { color: #287250; }
.dialog-review-status.reviewing { color: #805a28; }
.dialog-review-status.unavailable { color: #b33232; }
.dialog-review-status .review-icon { width: 14px; height: 14px; flex-basis: 14px; }
.dialog-check-control { display: inline-flex; align-items: center; gap: 8px; color: #315842; font-size: 12px; white-space: nowrap; cursor: pointer; }
.dialog-check-control input { width: 17px; height: 17px; margin: 0; accent-color: #26834e; flex: 0 0 17px; }
.dialog-check-control:has(input:disabled) { opacity: .65; cursor: wait; }
#dialogTable tr.dialog-checked td { background: #effaf2; border-color: #d0e8d7; }
#dialogTable tr.dialog-checked td:first-child { box-shadow: inset 3px 0 #26834e; }
#dialogTable th:last-child, #dialogTable td:last-child { min-width: 130px; }
.review-original-source { border-top: 1px solid #e5eaf0; padding-top: 8px; margin-top: 3px; }
.review-original-source summary { cursor: pointer; font-size: 11px; color: #66758a; }
.review-original-source .topic-message-text { font-size: 12px; color: #66758a; margin-top: 8px; max-height: 240px; overflow: auto; }
.review-row-error { color: #b33232; font-size: 12px; margin: 0; }
.manager-assessment { border: 0; padding: 0; margin: 2px 0; min-width: 0; }
.manager-assessment legend { margin-bottom: 7px; }
.manager-assessment-options { display: flex; flex-wrap: wrap; gap: 8px; }
.manager-assessment-choice { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 9px; border: 1px solid #d9e6dc; border-radius: 4px; font-size: 12px; line-height: 1.5; cursor: pointer; color: #276a44; background: #fff; }
.manager-assessment-choice.incorrect { color: #b33232; border-color: #ead7d7; }
.manager-assessment-choice.correct:has(input:checked) { background: #eaf6ee; border-color: #328552; }
.manager-assessment-choice.incorrect:has(input:checked) { background: #fff0f0; border-color: #bc3d3d; }
.manager-assessment-choice input { width: 14px; height: 14px; margin: 0; flex: 0 0 14px; accent-color: #328552; }
.manager-assessment-choice.incorrect input { accent-color: #bc3d3d; }
.manager-assessment-choice:has(input:focus-visible) { outline: 2px solid #2459ba; outline-offset: 2px; }
.manager-assessment-choice:has(input:disabled) { opacity: .65; cursor: wait; }
.scenario-editor select[aria-invalid="true"] { border-color: #bc3d3d; }
.scenario-editor td.review-empty { padding: 40px 14px; color: #66758a; font-size: 13px; }
.scenario-message-selection { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.scenario-message-selection input { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 3px; }
.scenario-message-selection .topic-message-text { margin: 0; }
.scenario-context { background: #f7f9fc; font-size: 12px; }
.scenario-context summary { margin-top: 10px; cursor: pointer; }
.scenario-context pre { max-height: 280px; overflow: auto; }
.topic-message { padding: 12px 14px; border-left: 3px solid #c4ced8; background: #f6f8fb; min-width: 0; }
.topic-message.outgoing { border-left-color: #8398c3; background: #f4f7ff; }
.topic-message.reviewed { border-left-color: #4c9274; }
.topic-message-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; }
.topic-message-head label { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.topic-message input[type="checkbox"], .scenario-row input { width: 16px; height: 16px; flex: 0 0 16px; accent-color: #367157; }
.topic-message time { color: var(--muted); font-size: 11px; }
.topic-message-text, .review-original, .review-answer { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.6; margin: 10px 0; }
.review-answer { border-top: 1px solid #d9e7df; padding-top: 10px; color: #285a44; }
.review-modal { width: min(700px, 96vw); padding: 0; }
.review-form { padding: 20px 24px; display: grid; gap: 16px; overflow: auto; min-height: 0; }
.review-original { max-height: 200px; overflow: auto; padding: 12px; background: #f4f6f9; }
.topic-downloads { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 18px; }
.scenario-library { width: min(960px, 96vw); padding: 0; }
#scenarioLibraryList { overflow: auto; min-height: 0; }
.scenario-row { display: flex; align-items: center; gap: 14px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.scenario-row label { display: flex; align-items: center; flex: 1; min-width: 0; gap: 12px; }
.scenario-row label span { overflow-wrap: anywhere; min-width: 0; }
.scenario-row small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 5px; }
.topics-modal button, .review-modal button, .scenario-library button { white-space: normal; overflow-wrap: anywhere; }
.topic-empty { padding: 20px 0; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) {
  .topic-period-controls { padding: 10px 16px; gap: 10px; }
  .topic-period-dates { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .topic-period-dates label { display: grid; gap: 4px; }
  .topic-period-dates input { width: 100%; }
  .manager-assessment-options { flex-direction: column; align-items: flex-start; }
  #dialogModal .modal-header { flex-wrap: wrap; }
  #dialogModal .modal-actions { flex-wrap: wrap; }
  #dialogModal .modal-actions .primary { font-size: 12px; padding: 8px 10px; }
  .topics-modal { width: calc(100vw - 16px); max-width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); }
  .topics-workspace { display: flex; flex-direction: column; }
  .topics-sidebar { flex: 0 0 auto; max-height: 140px; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .topic-list { display: flex; overflow-x: auto; }
  .topic-card { flex: 0 0 205px; }
  .topic-detail { padding: 16px; }
  .topics-toolbar, .review-form { padding: 14px 16px; }
  .topics-modal .modal-header { padding: 16px; }
  .topics-modal .modal-header { gap: 10px; flex-wrap: wrap; }
  .topic-modal-actions { margin-left: auto; gap: 8px; }
  .topic-actions button { flex: 1 1 140px; }
  .scenario-row { padding: 14px; }
}
