.student-study-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  width: calc(100% - 32px);
  max-width: 620px;
  max-height: calc(100vh - 32px);
  max-height: calc(var(--tablet-vh, 1vh) * 100 - 32px);
  padding: 24px;
  border: 1px solid #dbe5f1;
  border-radius: 16px;
  background: #fff;
  color: #14263d;
  box-shadow: 0 18px 56px rgba(15, 32, 60, .22);
  overflow: auto;
}
.student-study-dialog::backdrop { background: rgba(15, 23, 42, .56); }
.student-study-dialog h2 { margin: 0 0 8px; font-size: 23px; line-height: 1.3; }
.student-study-dialog__message { margin: 0 0 16px; font-size: 16px; line-height: 1.6; color: #465c75; }
.student-study-dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.student-study-dialog__actions button {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #c7d6e8;
  border-radius: 9px;
  background: #fff;
  color: #193552;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}
.student-study-dialog__actions .is-primary { border-color: #0865d5; background: #0865d5; color: white; }
.student-study-dialog__actions .is-danger { margin-right: auto; border-color: #edd1d5; background: #fff5f5; color: #a1232f; }
.student-study-dialog__actions button:disabled { opacity: .55; cursor: default; }
.student-study-dialog--answer-picker[open] {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  overflow: hidden;
}
.student-study-dialog--answer-picker h2 { flex: none; margin-bottom: 4px; font-size: 19px; }
.student-study-dialog--answer-picker .student-study-dialog__actions {
  flex: none;
  align-items: center;
  margin-top: 8px;
}
.student-study-dialog__answers {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0 2px;
  overscroll-behavior: contain;
}
.student-study-dialog__answer {
  padding: 2px 0 4px;
  border-bottom: 1px solid #e2ebf4;
}
.student-study-dialog__answer-header { display: flex; align-items: center; gap: 8px; }
.student-study-dialog__answer-select {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  gap: 8px;
  cursor: pointer;
}
.student-study-dialog__answer-select > input { flex: none; width: 20px; height: 20px; margin: 0; }
.student-study-dialog__answer-question { min-width: 0; overflow-wrap: anywhere; }
.student-study-dialog__answer-toggle {
  flex: none;
  min-height: 42px;
  padding: 4px 8px;
  background: transparent;
  color: #0865a9;
  border: 0;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.student-study-dialog__answer-preview {
  margin: 0 0 8px;
  overflow-x: auto;
  overflow-wrap: anywhere;
  font-size: 14px;
  color: #516880;
}
.student-study-dialog__answer-preview[hidden] { display: none; }
.student-study-dialog__answer-preview > :first-child { margin-top: 0; }
.student-study-dialog__answer-preview > :last-child { margin-bottom: 0; }
.student-study-dialog__answer-preview :is(ol, ul) { padding-inline-start: 1.6em; }
.student-study-dialog__answer-preview ol { list-style-type: decimal; }
.student-study-dialog__answer-preview ul { list-style-type: disc; }
.student-study-dialog__count { margin-right: auto; font-size: 14px; color: #49627e; }
.assistant-message + .controls button[data-student-bookmark][aria-pressed="true"] {
  background: #eef0f3 !important;
  color: #4b5563 !important;
}
.note-source-attachments.message-file-attachments { margin: 6px 0 12px; padding: 0; background: transparent; border: 0; }
.note-source-attachments button.file-thumbnail { width: 80px; font: inherit; }
.library-detail-content .note-content-preview .note-question-section > h3 { margin: 0 0 8px; }
.note-question-section + .note-question-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e2ebf4; }
.note-question-fields { display: grid; gap: 8px; }
.note-question-fields + .note-question-fields { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e2ebf4; }
.note-question-fields-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note-question-reorder { display: flex; gap: 6px; }
.note-question-reorder button {
  min-height: 44px;
  min-width: 48px;
  padding: 4px 8px;
  border: 1px solid #c7d6e8;
  border-radius: 8px;
  background: #fff;
  color: #193552;
  font: inherit;
  cursor: pointer;
}
.note-question-reorder button:disabled { opacity: .5; cursor: default; }
.note-question-fields textarea.full-width-textarea { min-height: 100px; margin-bottom: 0; }

html.student-tablet-chat #ttsVoiceModal .tts-voice-option-row .tts-voice-option {
  box-sizing: border-box;
  min-height: 60px;
  height: 100%;
  padding-right: 100px;
}

html.student-tablet-chat #ttsVoiceModal .tts-voice-preview {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 80px;
  height: 44px;
  padding: 0 8px;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  border-radius: 10px;
  background: #f4f8ff;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

html.student-tablet-chat #ttsVoiceModal .tts-voice-preview::before { flex: none; }
html.student-tablet-chat #ttsVoiceModal .tts-voice-preview:disabled:not([data-state="loading"])::before { display: none; }
html.student-tablet-chat #ttsVoiceModal .tts-voice-preview::after { content: none; }

html.student-tablet-chat #ttsVoiceModal .tts-voice-preview:hover:not(:disabled),
html.student-tablet-chat #ttsVoiceModal .tts-voice-preview:active:not(:disabled) {
  transform: translateY(-50%);
  background: #eaf2ff;
  box-shadow: none;
}

html.student-tablet-chat #ttsVoiceModal .tts-voice-preview[data-state="playing"],
html.student-tablet-chat #ttsVoiceModal .tts-voice-preview[data-state="playing"]:hover:not(:disabled) {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #fff;
  box-shadow: none;
}

html.student-tablet-chat #ttsVoiceModal .tts-voice-preview:focus-visible {
  outline: 2px solid var(--primary-dark);
  outline-offset: 2px;
  box-shadow: none;
}

#mobileStudentNotesBtn { display: none; }
html.layout-mobile .top-bar .left-aligned-group > #mobileStudentNotesBtn:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
html.layout-mobile #mobileRightDrawer [data-slot-id="openImageStrategyBtn"] { min-height: 44px !important; }

#drawingCanvas { transform-origin: top left; }
#drawingZoomControls[hidden] { display: none; }
.drawing-zoom-controls { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.drawing-zoom-controls button {
  min-height: 42px;
  min-width: 42px;
  padding: 4px 9px;
  border: 1px solid #c9d8e8;
  border-radius: 8px;
  background: #f6faff;
  color: #193552;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
#drawingPanBtn:disabled { opacity: .55; cursor: default; }
#drawingPanBtn[aria-pressed="true"] { border-color: #0865d5; background: #e8f2ff; color: #0853a9; }
.drawing-canvas-wrap.is-panning-enabled #drawingCanvas { cursor: grab; }
.drawing-canvas-wrap.is-panning-enabled #drawingCanvas:active { cursor: grabbing; }
.drawing-zoom-controls output { min-width: 42px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  #drawingBoardModal.has-drawing-zoom .modal-header { flex-wrap: wrap; }
  #drawingZoomControls { order: 3; margin-left: 0; width: 100%; }
}

/* Landscape tablets have room for one row of note filters. */
html.layout-mobile.mobile-tablet-landscape.student-tablet-chat #myLibraryModal .library-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}
html.layout-mobile.mobile-tablet-landscape.student-tablet-chat #myLibraryModal .library-controls {
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 200px) auto !important;
}
html.layout-mobile.mobile-tablet-landscape.student-tablet-chat #myLibraryModal .library-list-item {
  min-height: 80px !important;
  padding: 9px 12px !important;
}

html.student-tablet-chat :is(
  #mobileRightDrawerCloseBtn, #chatRecordsCloseBtn, #closeImageStrategyModalBtn,
  #closeMyLibraryModalBtn, #closeLibraryItemDetailModalBtn, #closeDrawingBtn
).ui-close-button {
  -webkit-tap-highlight-color: transparent;
}

html.student-tablet-chat #mobileRightDrawer {
  background: #fff !important;
  padding-bottom: 12px !important;
}

html.layout-mobile.device-tablet.student-tablet-chat[data-layout-page="index"] #mobileRightDrawer .mobile-menu-slot {
  box-sizing: border-box;
  min-height: 46px !important;
  padding: 4px 3px !important;
  gap: 8px !important;
  -webkit-tap-highlight-color: transparent;
}

html.student-tablet-chat #mobileRightDrawerBtn { -webkit-tap-highlight-color: transparent; }

html.student-tablet-chat #mobileRightDrawer .mobile-menu-slot-icon {
  width: 22px !important;
  flex: 0 0 22px;
  text-align: center;
}

/* Keep history controls in the header and let the calendar and status scroll in order. */
html.layout-mobile.student-tablet-chat #chatRecordsModal .chat-records-admin {
  box-sizing: border-box;
  padding: 0 18px 12px !important;
  gap: 8px !important;
  overscroll-behavior: contain;
}

html.student-tablet-chat #chatRecordsModal .chat-records-admin > :not([hidden]) { flex-shrink: 0; }
html.student-tablet-chat #chatRecordsModal .chat-records-admin > [hidden] { display: none !important; }

html.layout-mobile.student-tablet-chat #chatRecordsModal .chat-records-admin__header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px !important;
  padding: 12px 0 10px !important;
  border-bottom: 1px solid #e2eaf3;
  background: #fff !important;
}

html.layout-mobile.student-tablet-chat #chatRecordsModal .chat-records-admin__actions {
  width: auto !important;
  flex-wrap: nowrap;
}

html.layout-mobile.student-tablet-chat #chatRecordsModal :is(#chatRecordsBackBtn, #chatRecordsRefreshBtn) {
  flex: none !important;
  min-width: 64px !important;
  padding: 0 12px !important;
  font-size: 13px !important;
  white-space: nowrap;
}

html.student-tablet-chat #chatRecordsModal .chat-records-admin__subtitle { font-size: 13px; }
html.student-tablet-chat #chatRecordsModal .personal-chat-records__context { margin: 3px 0; }
html.student-tablet-chat #chatRecordsModal[data-records-level="calendar"] .chat-records-admin__breadcrumb { display: none; }
html.student-tablet-chat #chatRecordsModal .personal-chat-calendar { padding: 8px 8px 10px; }
html.student-tablet-chat #chatRecordsModal .personal-chat-calendar__toolbar { margin-bottom: 5px; }
html.student-tablet-chat #chatRecordsModal .personal-chat-calendar__day { min-height: 44px; }
html.student-tablet-chat #chatRecordsModal .personal-chat-calendar__day.is-selected { background: #e5f0ff; }
html.student-tablet-chat #chatRecordsModal .personal-chat-calendar__day.is-selected .personal-chat-calendar__date {
  color: var(--primary-dark) !important;
}
html.student-tablet-chat #chatRecordsModal .personal-chat-calendar__day.is-selected .personal-chat-calendar__activity-dot {
  background: var(--primary-dark);
}
html.student-tablet-chat #chatRecordsModal .personal-chat-calendar__day.is-selected .personal-chat-calendar__count {
  background: #fff;
  color: var(--primary-dark);
}
html.student-tablet-chat #chatRecordsModal .chat-records-admin__hint { margin: 2px 0 4px; line-height: 1.5; }

html.student-tablet-chat #imageStrategyModal .image-strategy-option { align-items: center; }
html.student-tablet-chat #imageStrategyModal .image-strategy-option input[type="radio"] { margin: 0; }
html.student-tablet-chat #imageStrategyModal .image-strategy-option-desc {
  color: #516881;
  font-size: 13px;
  line-height: 1.5;
}

html.layout-mobile.student-tablet-chat #imageStrategyModal .preferences-modal-footer,
html.layout-mobile.student-tablet-chat #libraryItemDetailModal #libraryItemDetailFooter {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px !important;
}

html.layout-mobile.student-tablet-chat #imageStrategyModal .preferences-modal-footer > button,
html.layout-mobile.student-tablet-chat #libraryItemDetailModal #libraryItemDetailFooter > button {
  width: auto !important;
  min-width: 88px !important;
  min-height: 44px !important;
  justify-content: center !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  font-size: 14px !important;
  -webkit-tap-highlight-color: transparent;
}

html.student-tablet-chat #imageStrategyModal .preferences-modal-footer > button.btn-secondary-filled,
html.student-tablet-chat #libraryItemDetailModal #libraryItemDetailFooter > button.btn-secondary-filled {
  border: 1px solid #cfdbeb !important;
  background: #fff !important;
  color: #324e6c !important;
}

html.student-tablet-chat #libraryItemDetailModal .note-read-shell { gap: 0; }
html.student-tablet-chat #libraryItemDetailModal .note-detail-head { margin-bottom: 12px; }
html.student-tablet-chat #libraryItemDetailModal .note-detail-eyebrow,
html.student-tablet-chat #libraryItemDetailModal .note-read-shell .note-tag-chip.is-muted { display: none; }
html.student-tablet-chat #libraryItemDetailModal .note-read-shell .note-tag-chip { margin-bottom: 8px; }
html.student-tablet-chat #libraryItemDetailModal .note-detail-title { margin-top: 0; }
html.student-tablet-chat #libraryItemDetailModal .note-content-preview { -webkit-tap-highlight-color: transparent; }

html.student-tablet-chat #myLibraryModal .library-search-wrap,
html.student-tablet-chat #myLibraryModal .library-sort-wrap { min-height: 46px; }
html.student-tablet-chat #myLibraryModal #openDrawingBtn { color: #244d79 !important; }
html.student-tablet-chat #myLibraryModal .library-list-item { -webkit-tap-highlight-color: transparent; }

html.student-tablet-chat .student-study-dialog__answer-select,
html.student-tablet-chat .student-study-dialog__answer-toggle { min-height: 44px; }

html.student-tablet-chat .student-study-dialog__answer-toggle {
  min-width: 80px;
  padding: 0 8px;
  border: 1px solid #d7e4f4;
  border-radius: 9px;
  background: #f6faff;
  color: var(--primary-dark);
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

html.student-tablet-chat .student-study-dialog__answer-header { padding: 3px 2px; }
html.student-tablet-chat .student-study-dialog__answer-preview {
  margin: 3px 2px 10px 30px;
  padding: 12px;
  border-radius: 10px;
  background: #f6f9fd;
  color: #304b68;
  line-height: 1.65;
}

html.student-tablet-chat .student-study-dialog--answer-picker .student-study-dialog__actions {
  padding-top: 8px;
  border-top: 1px solid #e2ebf4;
}

html.student-tablet-chat #drawingZoomControls {
  margin-right: 10px;
  padding: 3px;
  border: 1px solid #dce6f1;
  border-radius: 12px;
  background: #f5f8fc;
}

html.student-tablet-chat #drawingZoomControls button {
  min-width: 44px;
  min-height: 44px;
  border-color: transparent;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

html.student-tablet-chat #drawingZoomControls button:active:not(:disabled),
html.student-tablet-chat #drawingZoomControls #drawingPanBtn[aria-pressed="true"] { background: #e2eeff; }

html.student-tablet-chat #drawingBoardModal .drawing-controls #uploadDrawingBtn {
  border: 1px solid #c8d9ee !important;
  background: #fff !important;
  color: var(--primary-dark) !important;
  box-shadow: none !important;
}

html.student-tablet-chat #drawingBoardModal .drawing-controls #saveDrawingBtn {
  background: var(--primary-dark) !important;
  box-shadow: none !important;
}

html.student-tablet-chat #drawingBoardModal .drawing-controls .tool-button[aria-pressed="true"] {
  border-color: #b7d3ff !important;
  background: #e7f0ff !important;
  color: var(--primary-dark) !important;
  box-shadow: none !important;
}

html.layout-mobile.student-tablet-chat #chatArea .assistant-message + .controls .assistant-control-fold__panel button[data-assistant-action] {
  flex-direction: row;
  height: auto !important;
  min-height: 44px !important;
  padding: 6px 9px !important;
  gap: 5px !important;
  border: 1px solid #dbe6f2 !important;
  border-radius: 9px !important;
  background: #f8faff !important;
  color: #35516f !important;
  -webkit-tap-highlight-color: transparent;
}

html.layout-mobile.student-tablet-chat #chatArea .assistant-message + .controls .assistant-control-fold__panel button[aria-pressed="true"][data-student-bookmark] {
  background: #eef2f6 !important;
  color: #414f62 !important;
}

html.layout-mobile.student-tablet-chat #chatArea .assistant-message + .controls .assistant-control-fold__panel .control-btn-label {
  font-size: 13px !important;
}

@media (max-width: 560px) {
  html.student-tablet-chat #drawingZoomControls { margin-right: 0; }
}
