.class-shortcuts button[data-badge]::after {
  content: attr(data-badge);
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  min-height: 17px;
  margin-left: 4px;
  padding-inline: 3px;
  border-radius: 10px;
  background: #943947;
  color: #fffdf8;
  font-size: 10px;
}

body[data-activity-open] :is(#classStatus, #classPresentation) { visibility: hidden; }
body[data-activity-open] .emoji-bar { bottom: max(12px, env(safe-area-inset-bottom)); }
body[data-cloud-slide] #classStatus { left: max(14px, env(safe-area-inset-left)); transform: none; }
#overlays .bubble.is-chat {
  width: max-content;
  max-width: min(218px, 56vw);
  padding: 6px 9px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.activity-panel {
  --activity-controls-height: 60px;
  position: fixed;
  z-index: 25;
  top: calc(max(14px, env(safe-area-inset-top)) + var(--class-shortcut-offset, 0px) + var(--activity-controls-height));
  bottom: max(66px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(750px, calc(100vw - 24px));
  padding: clamp(12px, 2vw, 20px);
  border: 2px solid var(--ink);
  border-radius: 21px;
  background: var(--cream);
  box-shadow: 0 8px 0 rgba(24, 51, 70, .15);
  overflow: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
}
body[data-class-teacher] .activity-panel { --activity-controls-height: 103px; }
.activity-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 4px solid #619569;
  padding-top: 8px;
}
.activity-heading h2 { margin: 0; font-size: clamp(18px, 3.5vw, 25px); color: #234b39; }
.activity-panel button {
  min-height: 44px;
  padding: 5px 9px;
  border: 1px solid #cecdbf;
  border-radius: 9px;
  background: var(--cream-soft);
  color: var(--ink);
  font: 800 13px/1.15 var(--font);
  white-space: nowrap;
  cursor: pointer;
}
.activity-panel button:disabled { opacity: .56; cursor: default; }
.activity-panel button:hover:not(:disabled) { background: #eae5d6; }
.activity-panel .activity-primary { background: #3e734e; color: #fffdf8; border-color: #3e734e; }
.activity-panel .activity-primary:hover:not(:disabled) { background: #2f5e3d; }
.activity-panel :is(input, button, summary):focus-visible { outline: 2px solid #3e734e; outline-offset: 2px; }
.activity-panel input {
  min-height: 44px;
  min-width: 0;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #cecdbf;
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  font: 550 16px/1.3 var(--font);
}
.activity-panel input:disabled { background: #eeece3; }
.activity-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin-top: 9px;
  padding: 9px;
  border: 1px solid #d9dfd1;
  border-radius: 12px;
  background: #f1f4ea;
}
.activity-form label { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 6px; font-size: 13px; font-weight: 800; }
.activity-form label span { color: #526b65; white-space: nowrap; }
.activity-status {
  width: fit-content;
  margin: 5px 0 0;
  padding: 4px 8px;
  border-radius: 7px;
  background: #eef1e5;
  color: #3f5946;
  font-size: 13px;
  font-weight: 800;
}
.activity-feedback { margin: 6px 0 0; font-size: 13px; font-weight: 750; color: #714b3f; }
.activity-feedback:empty { display: none; }
.activity-empty { margin: 17px 0; color: #4d6960; text-align: center; }
#cloudQuestion { margin: 10px 0 12px; font-size: clamp(19px, 4vw, 30px); overflow-wrap: anywhere; }
.cloud-actions { flex-wrap: wrap; margin-top: 7px; }

.cloud-words {
  display: flex;
  justify-content: center;
  align-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  min-height: 105px;
  padding: 15px 8px;
  margin-top: 11px;
  border-radius: 12px;
  background: #eff3e8;
}
#classSlideBody .cloud-words { margin-top: 0; }
.cloud-word {
  display: inline-block;
  max-width: 100%;
  padding: 3px 11px;
  border-radius: 10px;
  background: var(--word-color);
  color: #183346;
  font-weight: 850;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
#cloudModeration { margin-top: 12px; }
.activity-panel summary { color: #305e44; font-size: 14px; font-weight: 800; cursor: pointer; }
#cloudModerationList { display: grid; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
#cloudModerationList li { display: flex; justify-content: space-between; align-items: center; gap: 6px; border-bottom: 1px solid #e4dfd1; }

.chat-panel { display: flex; flex-direction: column; width: min(630px, calc(100vw - 24px)); }
#chatMessages, #chatReportList { list-style: none; margin: 8px 0 0; padding: 0; min-height: 0; }
#chatMessages { flex: 1 1 0; overflow: auto; overscroll-behavior: contain; }
#chatReports { margin-top: 6px; flex: 0 1 auto; min-height: 24px; }
#chatReports summary { color: #894250; }
#chatReportList { max-height: 120px; max-height: min(120px, 18dvh); overflow: auto; padding-right: 4px; }
.chat-message {
  margin: 0 3px 6px 0;
  padding: 7px 10px;
  border: 1px solid #e4e1d6;
  border-radius: 10px;
  background: #f5f3ea;
}
.chat-message[data-own] { margin-left: 18px; border-color: #ccdecb; background: #eef4e8; }
.chat-message[data-hidden] { border-style: dashed; color: #5d625b; background: #f0ede5; }
.chat-byline { display: flex; align-items: center; gap: 7px; color: #395d48; font-size: 12px; }
.chat-byline time { color: #50636b; font-size: 11px; }
.chat-byline span { color: #843b49; font-weight: 800; }
.chat-message p { margin: 4px 0 0; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-message-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.chat-message-actions button { min-height: 36px; padding-inline: 7px; font-size: 12px; }
#chatForm { flex-shrink: 0; }

body[data-chat-keyboard] .chat-panel {
  z-index: 28;
  top: calc(var(--chat-viewport-top, 0px) + 6px);
  bottom: calc(var(--chat-keyboard-inset, 0px) + 6px);
}
body[data-chat-keyboard] .emoji-bar { display: none; }
@media (max-height: 475px) {
  body:not([data-chat-keyboard]) .activity-panel { bottom: max(53px, env(safe-area-inset-bottom)); }
  body[data-chat-keyboard] .chat-panel { padding: 8px 10px; }
}
