.sg-dialog {
  width: min(100%, 660px);
  height: min(90dvh, 840px);
  max-width: 100%;
  max-height: 100%;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #efeae2;
  color: #142821;
  overflow: hidden;
  font: 15px/1.42 system-ui, sans-serif;
}
.sg-dialog::backdrop { background: rgb(15 32 27 / .52); }
.sg-shell { height: 100%; display: flex; flex-direction: column; position: relative; }
.sg-dialog [hidden] { display: none !important; }
.sg-dialog .privateTeacherChatImageMarkerModal { position: absolute; }
.sg-header {
  box-sizing: border-box; display: flex; align-items: center; gap: 7px; padding: 4px 9px;
  min-height: 48px; background: #f8fffc; border-bottom: 1px solid #d7e5dc; flex: none;
}
.sg-header-label { flex: 1; min-width: 0; }
.sg-header h2, .sg-group-status { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-header h2 { font-size: 16px; line-height: 1.16; }
.sg-group-status { display: block; color: #376252; font-size: 11px; line-height: 1.2; }
.sg-member-online, .sg-seen { color: #176b69; }
.sg-member-online:empty { display: none; }
.sg-member-photo { object-fit: cover; }
#classHubChatPane .sg-inbox-groups[hidden], #classHubChatPane .sg-inbox-create[hidden] { display: none; }
#classHubChatPane .classHubChatSearchRow.sg-inbox-manage { grid-template-columns: 34px auto minmax(0, 1fr) repeat(4, 34px); }
#classHubChatPane .sg-inbox-group, #classHubChatPane .sg-inbox-account { width: 100%; text-align: left; }
#classHubChatPane .sg-inbox-account img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
#classHubChatPane .classHubChatSearchRow.sg-owner-search { grid-template-columns: 34px auto minmax(0, 1fr) 34px; }
#classHubChatPane .classHubChatSearchRow .sg-scope-button { width: auto; padding: 0 7px; min-height: 34px; border: 1px solid #e3e9e5; border-radius: 8px; }
#classHubChatPane .sg-inbox-more { border: 0; background: none; padding: 8px; color: #167a55; }
.teacherHubDesign .classHubHead.sg-class-header { flex-wrap: wrap; }
.teacherHubDesign .sg-class-header .classHubTeacherRow { flex: 0 0 100%; }
.sg-owner-home { padding: 14px; color: #376252; }
.sg-header-actions { display: flex; }
.sg-avatar { width: 34px; height: 34px; border-radius: 50%; background: #fff; object-fit: contain; flex: none; }
.sg-dialog button { color: inherit; font: inherit; cursor: pointer; }
.sg-icon, .sg-send {
  display: inline-grid; place-items: center; flex: none; border: 0;
  border-radius: 50%; width: 40px; height: 40px; background: transparent; font-size: 23px !important;
}
.sg-icon:hover, .sg-icon:focus-visible { background: #dceee5; }
.sg-content { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 10px 13px; }
.sg-group {
  display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px;
  background: #fff; border: 0; border-bottom: 1px solid #e8eeea; text-align: left;
}
.sg-group:first-child { border-radius: 10px 10px 0 0; }
.sg-group:hover { background: #f5fbf8; }
.sg-group-label { display: grid; flex: 1; }
.sg-group-label small, .sg-chevron, .sg-empty { color: #53665c; }
.sg-empty { text-align: center; padding: 16px 6px; }
.sg-date { margin: 10px auto; width: max-content; border-radius: 7px; padding: 3px 9px; background: #fffdf9; color: #53665c; font-size: 12px; }
.sg-message { display: flex; align-items: flex-start; justify-content: flex-start; gap: 6px; margin: 6px 0; }
.sg-message.sg-own { justify-content: flex-start; flex-direction: row-reverse; }
.sg-sender-avatar {
  display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none;
  overflow: hidden; border-radius: 50%; background: #dcefe5; color: #245d4a; font-size: 10px; font-weight: 650;
}
.sg-sender-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sg-bubble {
  min-width: 90px; max-width: min(84%, 450px); position: relative; padding: 6px 9px;
  border-radius: 3px 11px 11px 11px; background: #fff;
  box-shadow: 0 1px 2px rgb(28 41 34 / .14); touch-action: pan-y; -webkit-touch-callout: none;
}
.sg-own .sg-bubble { border-radius: 11px 3px 11px 11px; background: #dcf8cb; }
.sg-sender { display: block; color: #1c6d59; font-size: 12px; margin-bottom: 2px; overflow-wrap: anywhere; }
.sg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.sg-retracted { color: #647369; }
.sg-time { display: block; color: #53665c; text-align: right; margin-top: 3px; font-size: 10px; }
.sg-quote { border-left: 3px solid #55a98c; background: rgb(22 87 66 / .08); border-radius: 4px; padding: 3px 6px; margin: 3px 0; font-size: 12px; overflow-wrap: anywhere; }
.sg-reactions { display: inline-block; margin: 2px 0 -4px; border-radius: 14px; padding: 1px 5px; background: #fff; border: 1px solid #e4eee9; font-size: 13px; }
.sg-photo {
  display: grid; place-items: center; width: min(58vw, 238px); min-height: 78px; padding: 3px; border: 0;
  border-radius: 7px; background: #e5efe9; overflow: hidden;
}
.sg-photo img { display: block; width: 100%; height: auto; max-height: 270px; object-fit: contain; }
.sg-photo-pending { opacity: .82; }
.sg-send-loading::before { content: ''; display: inline-block; margin-right: 5px; width: .7em; height: .7em; border: 1px solid currentColor; border-right-color: transparent; border-radius: 50%; }
@media (prefers-reduced-motion: no-preference) {
  .sg-send-loading::before { animation: sg-spin .8s linear infinite; }
  @keyframes sg-spin { to { transform: rotate(1turn); } }
}
.sg-profile-photo { display: block; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin: 8px auto; }
.sg-photo-viewer {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: 100%; max-height: 100%; margin: 0;
  border: 0; padding: 0; background: #101714; color: #fff; overflow: hidden;
}
.sg-photo-viewer[open] { display: flex; flex-direction: column; }
.sg-photo-top { display: flex; align-items: center; gap: 8px; padding: max(4px, env(safe-area-inset-top)) 12px 4px; }
.sg-photo-top strong { flex: 1; }
.sg-photo-top button:hover { background: #2c4138; }
.sg-save { color: #fff; text-decoration: none; padding: 7px 12px; border-radius: 16px; background: #205844; }
.sg-photo-body { flex: 1; min-height: 0; display: grid; place-items: center; padding: 4px 8px max(4px, env(safe-area-inset-bottom)); }
.sg-full-photo { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.sg-notice { padding: 5px 10px; text-align: center; background: #fdf8df; color: #5b4813; font-size: 12px; }
.sg-footer { background: #f6fbf8; flex: none; padding-bottom: env(safe-area-inset-bottom, 0); }
.sg-composer { display: flex; gap: 6px; align-items: center; padding: 6px 9px; margin: 0; }
.sg-input, .sg-form input:not([type="checkbox"]) {
  display: block; flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid #d6e4da;
  border-radius: 18px; background: #fff; color: #142821; font: inherit;
}
.sg-input { resize: none; min-height: 40px; max-height: 108px; field-sizing: content; }
.sg-dialog .sg-send, .sg-dialog .sg-primary { background: #116d55; color: #fff; }
.sg-dialog button:disabled { opacity: .55; cursor: default; }
.sg-draft { display: flex; align-items: center; gap: 8px; margin: 6px 11px 0; padding: 2px 7px; border-left: 3px solid #409875; background: #e8f6ee; }
.sg-draft span { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-preview { width: 48px; height: 46px; object-fit: contain; }
.sg-shade {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center;
  background: rgb(22 38 29 / .38); overscroll-behavior: contain;
}
.sg-panel {
  width: min(100%, 480px); max-height: 84%; overflow: auto; overscroll-behavior: contain;
  border-radius: 14px 14px 0 0; background: #fff; padding: 10px 13px max(12px, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 22px rgb(9 32 21 / .15);
}
.sg-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sg-person { display: flex; min-height: 39px; padding: 3px 0; align-items: center; gap: 9px; border-bottom: 1px solid #ebf1ed; }
.sg-person span { flex: 1; }
.sg-form { display: grid; gap: 5px; }
.sg-form input[type="checkbox"], .sg-person input[type="checkbox"] { accent-color: #116d55; width: 17px; height: 17px; }
.sg-options, .sg-emoji { display: flex; flex-wrap: wrap; gap: 4px; }
.sg-emoji button[aria-pressed="true"] { background: #d2efdf; }
.sg-primary, .sg-option, .sg-options button, .sg-danger, .sg-link {
  border: 0; border-radius: 7px; padding: 8px 10px; background: #edf5ef; text-align: left;
}
.sg-option { display: block; width: 100%; margin-top: 5px; }
.sg-dialog .sg-danger { background: #fae8e7; color: #921f1b; }
.sg-dialog .sg-link { display: block; width: max-content; margin: 4px auto; color: #1d6c55; }
.sg-dialog button:focus-visible, .sg-dialog [role="button"]:focus-visible { outline: 2px solid #168564; outline-offset: 2px; }
@media (max-width: 620px) {
  .sg-dialog { position: fixed; inset: var(--sg-viewport-top, 0px) 0 auto; width: 100%; height: var(--sg-viewport-height, 100dvh); max-height: none; margin: 0; border-radius: 0; }
  .sg-header { padding-top: max(4px, env(safe-area-inset-top)); }
  .sg-input { font-size: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .sg-bubble { transform: translateX(var(--sg-swipe-offset, 0)); }
  .sg-dialog[open] { animation: sg-open .18s ease-out; }
  .sg-shade:not([hidden]) .sg-panel { animation: sg-panel .16s ease-out; }
  @keyframes sg-open { from { opacity: 0; transform: translateY(6px); } }
  @keyframes sg-panel { from { opacity: 0; transform: translateY(9px); } }
}
