/* Shared course messages stay visually separate from private lesson notes. */
.dm-layer {
  position:absolute;
  inset:0;
  z-index:3;
  overflow:hidden;
  pointer-events:none;
  user-select:none;
}
.dm-item {
  position:absolute;
  left:0;
  white-space:nowrap;
  color:#fff;
  font:600 20px/1.5 var(--sans);
  letter-spacing:.015em;
  text-shadow:0 1px 3px #000b, 1px 0 1px #0009, -1px 0 1px #0009;
  -webkit-text-stroke:.35px #0007;
  will-change:transform;
}
.dm-item.is-mine {
  padding:0 5px;
  border:1px solid #ffffffb3;
  border-radius:3px;
  background:#19162224;
}
.dm-toolbar {
  padding:10px clamp(14px,2.2vw,28px);
  background:#fff;
  color:var(--ink-blue);
  border-bottom:1px solid var(--line);
}
.dm-compose {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto auto;
  align-items:center;
  gap:10px;
  margin:0;
}
.dm-toolbar button {
  min-height:44px;
  border:0;
  font:500 13px/1.4 var(--sans);
  white-space:nowrap;
}
.dm-toggle {
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:0 2px;
  color:#474952;
  background:transparent;
}
.dm-toggle-track {
  position:relative;
  display:block;
  flex:0 0 29px;
  width:29px;
  height:17px;
  border-radius:10px;
  background:#a3a5ad;
  transition:background-color 150ms ease-out;
}
.dm-toggle-track::before {
  content:'';
  position:absolute;
  top:3px;
  left:3px;
  width:11px;
  height:11px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 1px 2px #0002;
  transition:transform 150ms ease-out;
}
.dm-toggle[aria-checked="true"] .dm-toggle-track { background:var(--purple,#5144aa); }
.dm-toggle[aria-checked="true"] .dm-toggle-track::before { transform:translateX(12px); }
.dm-field {
  position:relative;
  min-width:0;
}
#dm-input {
  display:block;
  width:100%;
  min-width:0;
  height:44px;
  padding:9px 47px 9px 12px;
  border:1px solid #d5d6df;
  border-radius:5px;
  background:#f8f8fb;
  color:#24252b;
  font:14px/1.4 var(--sans);
}
#dm-input::placeholder { color:#737682; }
#dm-input:focus { border-color:#8b80c7; background:#fff; }
.dm-count {
  position:absolute;
  top:50%;
  right:10px;
  transform:translateY(-50%);
  color:#80828c;
  font:11px/1.3 var(--sans);
  font-variant-numeric:tabular-nums;
  pointer-events:none;
}
.dm-send {
  padding:0 17px;
  border-radius:5px;
  color:#fff;
  background:var(--purple,#5144aa);
}
.dm-mine {
  padding:0 6px;
  color:#626570;
  background:transparent;
  border-radius:4px;
}
.dm-mine[aria-expanded="true"] { color:var(--purple,#5144aa); background:#f3f1fb; }
.dm-caption {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:3px 14px;
  min-height:18px;
  margin-top:6px;
  color:#7a7d87;
  font:11px/1.5 var(--sans);
}
.dm-preview-label { flex-shrink:0; }
#dm-feedback { color:#665b9e; overflow-wrap:anywhere; }
#dm-feedback:empty { display:none; }
.dm-history {
  margin-top:9px;
  padding-top:7px;
  border-top:1px solid #ebeaf1;
  max-height:220px;
  overflow-y:auto;
  overscroll-behavior:contain;
}
.dm-history-row {
  display:grid;
  grid-template-columns:48px minmax(0,1fr) 44px;
  gap:9px;
  align-items:center;
  min-height:44px;
  border-bottom:1px solid #f0eff4;
}
.dm-history-row:last-child { border-bottom:0; }
.dm-time {
  padding:0 3px;
  color:var(--purple,#5144aa);
  background:transparent;
  font-variant-numeric:tabular-nums;
}
.dm-history-text { color:#43454e; font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
.dm-delete { padding:0; color:#777b86; background:transparent; }
.dm-report { padding:0; color:#777b86; background:transparent; }
.dm-history-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.dm-tabs { display:flex; align-items:center; gap:8px; }
.dm-tab,.dm-refresh,.dm-more { background:transparent; color:#626570; padding:0 8px; border-radius:4px; }
.dm-tab[aria-pressed="true"] { background:#f3f1fb; color:var(--purple,#5144aa); }
.dm-list-status { font-size:11px; line-height:1.6; color:#777b86; padding:5px 0; }
.dm-report-form { grid-column:1/-1; display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:0 0 8px; }
.dm-report-reason { min-height:44px; padding:7px 10px; border:1px solid #d5d6df; border-radius:4px; color:var(--ink-blue); background:#fff; }
.dm-report-submit,.dm-report-cancel { padding:0 10px; color:var(--purple,#5144aa); background:#f3f1fb; border-radius:4px; }
.dm-report-cancel { color:#777b86; background:transparent; }
.dm-more { display:block; margin:5px auto 0; color:var(--purple,#5144aa); }
.dm-empty { padding:12px 0; color:#777b86; font-size:12px; }
.dm-toolbar button:disabled,
.dm-toolbar input:disabled { cursor:default; opacity:.5; }
.dm-fullscreen-toggle {
  display:none;
  position:absolute;
  top:max(12px,env(safe-area-inset-top));
  right:max(14px,env(safe-area-inset-right));
  z-index:4;
  align-items:center;
  justify-content:center;
  min-width:88px;
  min-height:44px;
  padding:8px 13px;
  border:1px solid #ffffff4a;
  border-radius:5px;
  background:#18191dbf;
  color:#fff;
  font:500 13px/1.4 var(--sans);
  cursor:pointer;
}
.dm-fullscreen-toggle[aria-pressed="false"] { color:#d4d3dc; }
.dm-expand {
  position:absolute; right:14px; top:12px; z-index:4;
  min-width:68px; min-height:44px; padding:8px 12px;
  border:1px solid #ffffff4a; border-radius:5px;
  color:#fff; background:#18191dbf; font:500 13px/1.4 var(--sans);
  opacity:0; pointer-events:none;
}
.player-wrap:has(video[style*="block"]):hover .dm-expand,
.player-wrap:has(video[style*="block"]):focus-within .dm-expand,
.player-wrap:fullscreen .dm-expand,
.player-wrap:-webkit-full-screen .dm-expand { opacity:1; pointer-events:auto; }
.player-wrap:fullscreen .dm-fullscreen-toggle { display:inline-flex; }
.player-wrap:-webkit-full-screen .dm-fullscreen-toggle { display:inline-flex; }
.player-wrap:fullscreen .dm-fullscreen-toggle,
.player-wrap:-webkit-full-screen .dm-fullscreen-toggle { right:116px; }
#panel-play .player-wrap.dm-page-expanded {
  position:fixed; inset:0; z-index:100;
  width:100vw; height:100dvh; max-height:none; aspect-ratio:auto;
}
body:has(.dm-page-expanded) { overflow:hidden; }
.dm-page-expanded .dm-fullscreen-toggle { display:inline-flex; right:116px; }
.dm-page-expanded .dm-expand { opacity:1; pointer-events:auto; }
.dm-toolbar [hidden],
.dm-toolbar[hidden],
.dm-layer[hidden],
.dm-fullscreen-toggle[hidden],
.dm-expand[hidden],
#view-app.is-displaced :is(.dm-toolbar,.dm-layer,.dm-fullscreen-toggle,.dm-expand) { display:none !important; }
@media(hover:none) {
  .player-wrap:has(video[style*="block"]) .dm-expand { opacity:1; pointer-events:auto; }
}
@media(hover:hover) {
  .dm-send:not(:disabled):hover { background:#453892; }
  .dm-mine:not(:disabled):hover { background:#f3f1fb; color:#5144aa; }
  .dm-time:not(:disabled):hover,.dm-delete:not(:disabled):hover { text-decoration:underline; text-underline-offset:3px; }
  .dm-fullscreen-toggle:hover { background:#18191de8; }
}
@media(max-width:620px) {
  .dm-item { font-size:15px; }
  .dm-toolbar {
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:2px 8px;
    padding:8px 14px;
  }
  .dm-compose { display:contents; }
  .dm-toggle { grid-column:1; grid-row:1; gap:5px; }
  .dm-field { grid-column:2; grid-row:1; }
  .dm-send { grid-column:3; grid-row:1; padding-inline:14px; }
  #dm-input { font-size:16px; padding-left:10px; }
  .dm-mine { grid-column:3; grid-row:2; justify-self:end; padding-inline:2px; }
  .dm-caption { grid-column:1/3; grid-row:2; margin:0; gap:1px 7px; padding-block:5px; }
  .dm-preview-label { flex-shrink:1; }
  .dm-history { grid-column:1/-1; margin-top:0; }
}
@media(prefers-reduced-motion:reduce) {
  .dm-toggle-track,.dm-toggle-track::before { transition:none; }
  .dm-item { max-width:calc(100% - 24px); overflow:hidden; text-overflow:ellipsis; }
}
