/* Scoped notebook UI; page dimensions are ratios, never native PDF canvas sizes. */
.course-notebook-host { display: block !important; position: relative; min-width: 0; width: 100%; max-height: min(78vh, 980px); overflow: auto; overscroll-behavior: contain; scroll-behavior: auto; overflow-anchor: none; padding: 0 12px 16px; box-sizing: border-box; border: 1px solid #d9e1e9; border-radius: 9px; background: #edf1f5; color: #233a52; }
.course-notebook-host *, .course-notebook-host *::before, .course-notebook-host *::after { box-sizing: border-box; }
.cn-toolbar { position: sticky; top: 0; z-index: 12; margin: 0 -12px 14px; padding: 9px 12px 7px; border-bottom: 1px solid #dce3ec; background: #fffffff7; box-shadow: 0 3px 10px #263e5210; }
.cn-main-tools, .cn-navigation { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cn-main-tools { padding-bottom: 7px; }
.cn-tool-group, .cn-colors, .cn-page-navigation { display: flex; align-items: center; gap: 4px; }
.cn-toolbar button, .cn-toolbar select, .cn-page-error button { min-height: 31px; margin: 0; border: 1px solid #cdd8e5; border-radius: 5px; padding: 5px 8px; background: #fff; color: #3d526b; font-family: inherit; font-size: 12px; line-height: 1.3; cursor: pointer; white-space: nowrap; }
.cn-toolbar button.active { color: #5145c0; border-color: #8278d9; background: #f0edff; }
.cn-toolbar button:disabled { opacity: .45; cursor: default; }
.cn-toolbar .cn-primary { color: #fff; background: #5b4bc4; border-color: #5b4bc4; }
.cn-toolbar .cn-color { width: 26px; min-height: 28px; height: 28px; padding: 5px; border: 2px solid transparent; border-radius: 50%; background: var(--cn-color); background-clip: content-box; }
.cn-toolbar .cn-color.active { border-color: var(--cn-color); background-color: var(--cn-color); }
.cn-custom-color { position: relative; display: inline-flex; align-items: center; min-height: 29px; padding: 4px; font-size: 11px; cursor: pointer; }
.cn-custom-color input { position: absolute; width: 100%; height: 100%; inset: 0; opacity: 0; cursor: pointer; }
.cn-select-label { display: flex; align-items: center; gap: 3px; color: #596d83; font-size: 11px; }
.cn-select-label select { padding: 4px; }
.cn-navigation { border-top: 1px solid #eef1f5; padding-top: 6px; }
.cn-page-navigation { margin-right: 3px; }
.cn-page-navigation label { white-space: nowrap; font-size: 11px; }
.cn-page-navigation input { width: 46px; height: 29px; padding: 3px; border: 1px solid #ccd6e3; border-radius: 4px; color: #3d526b; text-align: center; font-size: 12px; }
.cn-active-page { flex: 1; margin-right: 8px; color: #7560bd; font-size: 11px; }
.cn-navigation a { color: #574aab; padding: 5px; font-size: 11px; white-space: nowrap; }
.cn-status { margin: 5px 0 0; color: #677b8b; font-size: 10px; line-height: 1.5; }
.cn-status.warning { color: #9a570b; background: #fff3d5; padding: 5px; border-radius: 4px; }
.cn-pages { display: grid; gap: 14px; justify-items: center; }
.cn-page { display: block; width: min(100%, 920px); min-width: 0; margin: 0; padding: 8px; border: 1px solid #d3dde9; border-radius: 5px; background: #fff; }
.cn-page.cn-active { border-color: #9f93df; }
.cn-page figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 6px; color: #6b7f92; font-size: 10px; }
.cn-page figcaption a { color: #6654b6; }
.cn-page-links { display: flex; align-items: center; gap: 12px; }
.cn-page-links button { padding: 2px 5px; border: 1px solid #d5cfee; border-radius: 4px; background: #f6f3ff; color: #6654b6; font-family: inherit; font-size: 10px; cursor: pointer; }
.cn-writing-surface { position: relative; isolation: isolate; width: 100%; max-width: 100%; overflow: hidden; background: #fff; }
.cn-writing-surface img { position: absolute; inset: 0; display: block; width: 100% !important; height: 100% !important; max-width: 100%; object-fit: contain; pointer-events: none; user-select: none; -webkit-user-select: none; }
.cn-writing-surface img:not([src]) { visibility: hidden; }
.cn-writing-surface canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cn-page-error, .cn-empty, .cn-answer-note { margin: 8px 0; color: #6e7280; font-size: 12px; line-height: 1.8; }
.cn-page-error button { padding: 3px 6px; font-size: 11px; }
.cn-answer { margin-top: 18px; padding: 12px; border: 1px solid #cfdae5; border-radius: 7px; background: #fff; }
.cn-answer summary { cursor: pointer; color: #5b4aa5; font-size: 14px; font-weight: 750; }
.cn-answer-host.course-notebook-host { max-height: min(68vh, 800px); }
.course-notebook-host:focus-visible, .cn-toolbar button:focus-visible, .cn-toolbar input:focus-visible, .cn-toolbar select:focus-visible, .cn-custom-color:focus-within, .cn-answer summary:focus-visible { outline: 3px solid #c0b6ee; outline-offset: 1px; }
@media (max-width: 600px) {
  .course-notebook-host { max-height: 78vh; padding: 0 6px 10px; }
  .cn-toolbar { margin: 0 -6px 9px; padding: 6px; }
  .cn-main-tools { flex-wrap: nowrap; gap: 6px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: thin; }
  .cn-main-tools > * { flex-shrink: 0; }
  .cn-toolbar button { min-height: 30px; padding: 5px 6px; font-size: 11px; }
  .cn-navigation { gap: 4px; }
  .cn-active-page { display: none; }
  .cn-page-navigation { margin-right: auto; }
  .cn-page-navigation input { width: 36px; }
  .cn-page { padding: 5px; }
  .cn-pages { gap: 9px; }
  .cn-answer { padding: 7px; }
  .cn-status { font-size: 9px; }
}
