/* 390 FieldOps — DM Standard (shared Messages surface). Namespaced under .dm-* + #dmSurface.
 * Brand: navy #0f1f3d, gold #d4a437. Bubble thread per Matthew's approved mocks. */

.dm-pill {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  background: #0f1f3d; color: #fff; border: none; border-radius: 999px;
  padding: 8px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.dm-pill:hover { background: #16294e; }
/* Standardized header row: Messages (navy) + Notifications (white) + Enable Alerts (red), one row every portal. */
.dm-header-row { display: flex; gap: 8px; align-items: stretch; padding: 12px 16px 6px; }
.dm-header-row > #dmHeaderRow { display: flex; gap: 8px; flex: 1; }
.dm-pill-msg, .dm-pill-notif { flex: 1; justify-content: center; padding: 12px 14px; }
.dm-pill-notif { background: #fff; color: #0f1f3d; border: 1.5px solid #e2e8f0; }
.dm-pill-notif:hover { background: #eef1f5; }
.dm-header-row .btn-enable-push { flex-shrink: 0; }
.dm-pill-badge {
  background: #EF4444; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center;
}

/* ── full-screen surface ─────────────────────────────────────────────── */
.dm-surface {
  position: fixed; inset: 0; z-index: 9000; background: #f4f5f7;
  display: none; flex-direction: column;
}
@media (min-width: 720px) {
  .dm-surface { inset: 0 0 0 auto; width: 440px; box-shadow: -8px 0 24px rgba(0,0,0,.18); }
}
.dm-head {
  display: flex; align-items: center; gap: 6px; background: #0f1f3d; color: #fff;
  padding: max(14px, env(safe-area-inset-top, 0px)) 10px 14px; flex: 0 0 auto;
  min-width: 0; box-sizing: border-box; overflow: hidden;
}
/* Installed PWA: the black-translucent status bar draws over the surface (position:fixed;inset:0),
   burying the X / title under it — user can't escape. Floor the top pad even when
   env(safe-area-inset-top) reports 0 (non-notched devices / webview quirks). */
@media (display-mode: standalone) {
  .dm-head { padding-top: max(env(safe-area-inset-top, 0px), 44px); }
}
.dm-back { background: transparent; border: none; color: #fff; font-size: 20px; cursor: pointer; width: 34px; flex: 0 0 auto; }
.dm-head-title { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-compose-btn {
  background: #d4a437; color: #0f1f3d; border: none; border-radius: 10px;
  padding: 7px 12px; font-weight: 700; cursor: pointer; flex: 0 0 auto; white-space: nowrap;
  font-size: 13px; max-width: 100%;
}
.dm-settings-btn { background: transparent; border: none; color: #fff; font-size: 18px; cursor: pointer; width: 32px; flex: 0 0 auto; }
.dm-select-btn { background: transparent; border: 1px solid rgba(255,255,255,.45); color: #fff; border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 600; cursor: pointer; flex: 0 0 auto; }
/* multi-select delete */
.dm-bub-wrap[data-selable] { cursor: pointer; }
.dm-bub-wrap.dm-sel .dm-bub { outline: 2px solid #d4a437; outline-offset: 1px; }
.dm-selbox { display: inline-block; width: 20px; height: 20px; border: 2px solid #d4a437; border-radius: 50%; text-align: center; line-height: 17px; color: #d4a437; font-weight: 700; font-size: 12px; margin: 0 6px; }
.dm-removed { font-style: italic; color: #9aa4b2; }
.dm-selbar { position: absolute; bottom: 0; left: 0; right: 0; background: #0f1f3d; color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; z-index: 20; }
.dm-selbar-n { font-weight: 600; }
.dm-selbar-cancel, .dm-selbar-del { background: transparent; border: none; color: #fff; font-weight: 700; cursor: pointer; padding: 6px 10px; font-size: 15px; }
.dm-selbar-del { color: #ff6b6b; }
.dm-selbar-del[disabled] { opacity: .4; cursor: default; }
.dm-confirm { position: fixed; inset: 0; z-index: 9900; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; }
.dm-confirm-box { background: #fff; border-radius: 14px; padding: 22px; max-width: 320px; width: 86%; }
.dm-confirm-txt { color: #1a2233; font-size: 15px; line-height: 1.4; margin-bottom: 18px; }
.dm-confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.dm-confirm-cancel { background: #eef0f3; border: none; border-radius: 8px; padding: 10px 18px; font-weight: 600; cursor: pointer; }
.dm-confirm-yes { background: #DC2626; color: #fff; border: none; border-radius: 8px; padding: 10px 18px; font-weight: 700; cursor: pointer; }
.dm-prompt-input { width: 100%; border: 1px solid #d5dae1; border-radius: 8px; padding: 11px 12px; font-size: 15px; box-sizing: border-box; margin-bottom: 16px; }
.dm-prompt-input:focus { outline: none; border-color: #d4a437; }
/* source badges (Coach / Parent / Team / Group / DM) */
.dm-badge { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 5px; letter-spacing: .02em; }
.dm-badge-coach { background: #DBEAFE; color: #1E40AF; }
.dm-badge-umpire { background: #FEF3C7; color: #92400E; }
.dm-badge-staff { background: #FDE68A; color: #78350F; }
.dm-badge-parent { background: #FEF3C7; color: #92400E; }
.dm-badge-team { background: #0f1f3d; color: #fff; }
.dm-badge-group { background: #E7EBF1; color: #55637A; }
.dm-badge-dm { background: #E7EBF1; color: #55637A; }
.dm-badge-ann { background: #FBE6C4; color: #8A6516; }
/* Messages-list search */
.dm-list-search { width: calc(100% - 24px); margin: 10px 12px; border: 1px solid #d5dae1; border-radius: 10px; padding: 10px 14px; font-size: 14px; box-sizing: border-box; }
.dm-list-search:focus { outline: none; border-color: #d4a437; }
.dm-row-check { width: 20px; height: 20px; accent-color: #d4a437; flex: 0 0 auto; align-self: center; margin-left: 2px; }
.dm-row-sel { background: #fff8e6 !important; }
/* team filter pills */
.dm-teamfilter { display: flex; gap: 8px; padding: 0 12px 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dm-teamfilter::-webkit-scrollbar { display: none; }
.dm-tf { flex: 0 0 auto; background: #fff; border: 1.5px solid #d5dae1; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; color: #55637a; cursor: pointer; white-space: nowrap; }
.dm-tf.on { background: #0f1f3d; color: #fff; border-color: #0f1f3d; }
/* long-press context menu (Copy / Delete) */
.dm-bmenu { position: fixed; z-index: 9950; background: #fff; border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.28); overflow: hidden; min-width: 132px; }
.dm-bmenu button { display: block; width: 100%; text-align: left; background: #fff; border: none; padding: 13px 18px; font-size: 15px; cursor: pointer; color: #1a2233; }
.dm-bmenu button:hover { background: #f4f5f7; }
.dm-bmenu-del { color: #DC2626; border-top: 1px solid #eef0f3; }
.dm-bmenu-report { color: #B45309; border-top: 1px solid #eef0f3; }
/* Reaction row in the long-press menu. */
.dm-bmenu-react { display: flex; gap: 2px; padding: 6px 6px; border-bottom: 1px solid #eef0f3; }
.dm-react-opt { background: transparent; border: none; font-size: 22px; line-height: 1; padding: 6px 7px; border-radius: 8px; cursor: pointer; }
.dm-react-opt:hover { background: #f1f4f9; }
/* Reaction count pills under a bubble. */
.dm-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 0; }
.dm-react-pill { background: #eef1f6; border: 1px solid #e3e9f2; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 600; color: #33415c; cursor: pointer; line-height: 1.6; }
.dm-react-pill.dm-react-mine { background: #dbe7ff; border-color: #9cc0ff; color: #1e40af; }
/* Poll card in a bubble. */
.dm-poll { min-width: 220px; }
.dm-poll-q { font-weight: 700; color: #0f1f3d; margin-bottom: 8px; }
.dm-poll-opt { position: relative; display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; background: #f1f4f9; border: 1px solid #e3e9f2; border-radius: 10px; padding: 9px 12px; margin: 4px 0; font-size: 14px; font-weight: 600; color: #22304a; cursor: pointer; overflow: hidden; }
.dm-poll-opt:disabled { cursor: default; opacity: .85; }
.dm-poll-opt-mine { border-color: #9cc0ff; background: #eaf1ff; color: #1e40af; }
.dm-poll-bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(30,64,175,.10); z-index: 0; transition: width .25s; }
.dm-poll-lbl, .dm-poll-cnt { position: relative; z-index: 1; }
.dm-poll-lbl { display: flex; flex-direction: column; align-items: flex-start; }
.dm-poll-who { font-size: 11px; font-weight: 500; color: #1e40af; margin-top: 2px; }
.dm-poll-cnt { font-size: 12px; color: #55637a; margin-left: 10px; flex-shrink: 0; }
.dm-poll-foot { font-size: 12px; color: #8b95a3; margin-top: 6px; }
/* Poll builder dialog. */
.dm-pollbuild { text-align: left; }
.dm-poll-qin, .dm-poll-optin { width: 100%; box-sizing: border-box; border: 1px solid #d5dae1; border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 6px 0; }
.dm-poll-add { background: transparent; border: none; color: #1d4ed8; font-weight: 700; cursor: pointer; font-size: 13.5px; padding: 4px 0; }
/* RSVP / availability card. */
.dm-rsvp { min-width: 240px; }
.dm-rsvp-q { font-weight: 700; color: #0f1f3d; margin-bottom: 8px; }
.dm-rsvp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid #eef0f3; }
.dm-rsvp-row:last-of-type { border-bottom: none; }
.dm-rsvp-name { font-weight: 600; color: #22304a; font-size: 14px; display: flex; flex-direction: column; }
.dm-rsvp-by { font-size: 11px; font-weight: 500; color: #8b95a3; }
.dm-rsvp-btns { display: flex; gap: 4px; flex-shrink: 0; }
.dm-rsvp-btn { background: #f1f4f9; border: 1px solid #e3e9f2; border-radius: 8px; width: 34px; height: 30px; font-size: 15px; cursor: pointer; padding: 0; opacity: .6; }
.dm-rsvp-btn.on { opacity: 1; }
.dm-rsvp-going.on { background: #e7f7ee; border-color: #9fdcb8; }
.dm-rsvp-maybe.on { background: #fdf5e3; border-color: #ecd39a; }
.dm-rsvp-out.on { background: #fdecec; border-color: #f0b4b4; }
.dm-rsvp-board { margin-top: 8px; padding: 7px 10px; background: #f4f7fb; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: #33415c; }
/* Coach auto-ask toggle in the People sheet. */
.dm-autoask { display: flex; align-items: center; gap: 10px; margin: 4px 12px 8px; padding: 10px 12px; background: #f4f7fb; border: 1px solid #e3e9f2; border-radius: 10px; font-size: 13px; font-weight: 600; color: #33415c; cursor: pointer; }
.dm-autoask input { width: 18px; height: 18px; flex-shrink: 0; accent-color: #d4a437; }
.dm-reach-btn { display: block; width: calc(100% - 24px); margin: 0 12px 8px; padding: 10px 12px; background: #eef4ff; border: 1px solid #cfe0ff; border-radius: 10px; font-size: 13px; font-weight: 700; color: #1e40af; cursor: pointer; text-align: left; }
/* Contextual push nudge at the top of Messages. */
.dm-pushnudge { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 11px 12px; background: #fff7e6; border: 1px solid #f0d9a6; border-radius: 12px; }
.dm-pushnudge-ico { font-size: 18px; flex-shrink: 0; }
.dm-pushnudge-txt { flex: 1; font-size: 13px; font-weight: 600; color: #7a5b12; line-height: 1.35; }
.dm-pushnudge-btn { flex-shrink: 0; background: #e53935; color: #fff; border: none; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 700; cursor: pointer; }
.dm-pushnudge-x { flex-shrink: 0; background: transparent; border: none; color: #b99a4e; font-size: 15px; cursor: pointer; padding: 2px 4px; }
/* Reachability panel. */
.dm-reach-sum { padding: 10px 14px; font-size: 12.5px; font-weight: 700; color: #33415c; background: #f4f7fb; border-bottom: 1px solid #eef0f3; }
.dm-reach-badge { margin-left: auto; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.dm-reach-installed { background: #e7f7ee; color: #167a45; }
.dm-reach-browser { background: #eaf1ff; color: #1e40af; }
.dm-reach-notEnabled { background: #fdf1e3; color: #92600e; }
.dm-reach-never { background: #f1f3f6; color: #8b95a3; }
.dm-av-title, .dm-av-when { width: 100%; box-sizing: border-box; border: 1px solid #d5dae1; border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 6px 0; }
/* Availability event picker (pull from the coach's real schedule). */
.dm-av-list { max-height: 320px; overflow-y: auto; margin: 6px 0; }
.dm-av-ev { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: #f6f7f9; border: 1px solid #eceef1; border-radius: 10px; padding: 10px 12px; margin: 4px 0; cursor: pointer; }
.dm-av-ev:hover { background: #eef1f6; }
.dm-av-ev-b { font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 4px; color: #fff; flex-shrink: 0; }
.dm-av-game { background: #0f3460; }
.dm-av-practice { background: #C9A227; }
.dm-av-ev-t { font-weight: 600; color: #22304a; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-av-ev-d { font-size: 11px; color: #8b95a3; flex-shrink: 0; }
/* Survey templates + multi toggle. */
.dm-poll-tpl { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.dm-tpl-btn { background: #f1f4f9; border: 1px solid #e3e9f2; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: #33415c; cursor: pointer; }
.dm-tpl-btn:hover { background: #e7edf6; }
.dm-poll-multi { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; font-size: 13px; color: #33415c; }
.dm-poll-multi input { width: 17px; height: 17px; }
/* Multi-date calendar. */
.dm-cal { border: 1px solid #eceef1; border-radius: 12px; padding: 8px; margin: 4px 0; }
.dm-cal-hd { display: flex; align-items: center; justify-content: space-between; font-weight: 700; color: #0f1f3d; padding: 2px 4px 8px; }
.dm-cal-hd button { background: #f1f4f9; border: 1px solid #e3e9f2; border-radius: 8px; width: 30px; height: 30px; font-size: 18px; cursor: pointer; color: #22304a; }
.dm-cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; color: #8b95a3; font-weight: 700; }
.dm-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 4px; }
.dm-cal-cell { aspect-ratio: 1; background: #f6f7f9; border: 1px solid #eceef1; border-radius: 8px; font-size: 13px; font-weight: 600; color: #22304a; cursor: pointer; padding: 0; }
.dm-cal-cell.dm-cal-empty { background: transparent; border: none; cursor: default; }
.dm-cal-cell.dm-cal-on { background: #0f1f3d; border-color: #0f1f3d; color: #fff; }
.dm-cal-count { text-align: center; font-size: 12.5px; font-weight: 600; color: #1e40af; margin-top: 8px; }
.dm-row { transition: transform 0s; touch-action: pan-y; }
.dm-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
/* Thin filter row under head (above search) — footer nav stays available on host portals */
.dm-tabs {
  display: flex; flex: 0 0 auto; background: #fff;
  border-bottom: 1px solid #e3e6ea; border-top: none;
}
.dm-tab {
  flex: 1; background: transparent; border: none; padding: 7px 0;
  font-size: 12px; font-weight: 600; color: #7a8494; cursor: pointer;
  border-bottom: 2px solid transparent; border-top: none;
}
.dm-tab-on { color: #0f1f3d; border-bottom-color: #d4a437; border-top-color: transparent; }

/* ── list ─────────────────────────────────────────────────────────────── */
.dm-empty { padding: 40px 20px; text-align: center; color: #8b95a3; }
.dm-sec { margin-bottom: 6px; }
.dm-sec-h { padding: 10px 14px 4px; font-size: 12px; font-weight: 700; color: #8b95a3; text-transform: uppercase; letter-spacing: .04em; }
.dm-sec-unread .dm-sec-h { color: #EF4444; }
.dm-ro { color: #b6bcc6; font-weight: 500; text-transform: none; }
.dm-row {
  display: flex; gap: 10px; padding: 12px 14px; background: #fff;
  border: 0.5px solid #e6e8ec; border-radius: 12px; margin: 0 10px 8px;
  cursor: pointer; align-items: flex-start; box-sizing: border-box;
}
.dm-row:hover { background: #f8f9fb; }
.dm-row-unread { border-left: 3px solid #d4a437; }
.dm-row-main { flex: 1; min-width: 0; }
.dm-row-title { font-weight: 600; color: #0f1f3d; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dm-row-last { color: #7a8494; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.dm-row-meta { text-align: right; flex: 0 0 auto; }
.dm-row-time { color: #a2abb8; font-size: 12px; }
.dm-row-badge { margin-top: 4px; background: #EF4444; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; min-width: 18px; padding: 1px 6px; display: inline-block; }
.dm-chip { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: #e7ebf1; color: #55637a; }
.dm-chip-team { background: #0f1f3d; color: #fff; }
.dm-chip-announcement { background: #fbe6c4; color: #8a6516; }
.dm-count, .dm-teamchip { font-size: 11px; color: #7a8494; font-weight: 500; }
.dm-teamchip { background: #eef0f3; padding: 1px 6px; border-radius: 4px; }
.dm-needs { font-size: 10px; font-weight: 700; color: #b45309; background: #fef3c7; padding: 1px 6px; border-radius: 4px; }

/* ── thread (bubbles) ─────────────────────────────────────────────────── */
.dm-thread { display: flex; flex-direction: column; height: 100%; }
.dm-msgs { flex: 1; overflow-y: auto; padding: 14px; }
.dm-bub-wrap { display: flex; flex-direction: column; margin-bottom: 10px; max-width: 78%; }
.dm-theirs { align-items: flex-start; }
.dm-mine { align-items: flex-end; margin-left: auto; }
.dm-from { font-size: 11px; color: #7a8494; margin: 0 6px 2px; font-weight: 600; background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; }
.dm-from:hover { color: #1d4ed8; text-decoration: underline; }
.dm-bub { padding: 9px 13px; border-radius: 16px; font-size: 15px; line-height: 1.35; word-wrap: break-word; }
.dm-theirs .dm-bub { background: #fff; color: #1a2233; border: 1px solid #e3e6ea; border-bottom-left-radius: 5px; }
.dm-mine .dm-bub { background: #d4a437; color: #17233d; border-bottom-right-radius: 5px; }
.dm-mine .dm-bub a { color: #17233d; }
.dm-btime { font-size: 10px; color: #a2abb8; margin: 2px 8px; }
.dm-txt a { color: #1d4ed8; text-decoration: underline; word-break: break-all; }
.dm-photo { max-width: 220px; border-radius: 14px; cursor: pointer; display: block; }
/* media bubbles: drop the chat-bubble bg/padding so the image stands alone, edge-to-edge (iMessage-style) */
.dm-bub-media { padding: 0 !important; background: transparent !important; border: none !important; }
.dm-pending .dm-bub-media { opacity: .6; }
.dm-cap { font-size: 13px; margin-top: 4px; }
.dm-sys { text-align: center; color: #8b95a3; font-size: 12px; margin: 8px 0; }

/* ── reply bar ────────────────────────────────────────────────────────── */
.dm-replybar { flex: 0 0 auto; border-top: 1px solid #e3e6ea; background: #fff; padding: 8px; }
.dm-policy { font-size: 12px; color: #8a6516; background: #fbe6c4; padding: 6px 10px; border-radius: 8px; margin-bottom: 6px; }
.dm-replyrow { display: flex; align-items: center; gap: 8px; }
.dm-photo-btn { background: transparent; border: none; font-size: 20px; cursor: pointer; }
.dm-input { flex: 1; border: 1px solid #d5dae1; border-radius: 999px; padding: 10px 14px; font-size: 15px; outline: none; }
.dm-input:focus { border-color: #d4a437; }
.dm-send { background: #0f1f3d; color: #fff; border: none; border-radius: 50%; width: 38px; height: 38px; font-size: 16px; cursor: pointer; }
/* "+" attachment tray (Camera / Photos / Emoji) */
.dm-plus-btn { flex: 0 0 auto; background: #e8ebf0; border: none; color: #0f1f3d; width: 36px; height: 36px; border-radius: 50%; font-size: 26px; line-height: 34px; text-align: center; padding: 0; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.dm-plus-btn.dm-plus-open { transform: rotate(45deg); background: #d4a437; }
.dm-tray { display: flex; gap: 6px; padding: 4px 2px 8px; }
.dm-tray[hidden], .dm-emoji-panel[hidden], .dm-gif-panel[hidden] { display: none; }  /* class display: must not defeat the hidden attr */
/* Compact, polished attach tiles (were chunky). */
.dm-tray-tile { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; background: #f6f7f9; border: 1px solid #eceef1; border-radius: 10px; padding: 7px 4px; font-size: 10.5px; font-weight: 600; color: #55637a; cursor: pointer; }
.dm-tray-tile:active { background: #e9ebef; }
.dm-tray-ico { font-size: 17px; line-height: 1; }
.dm-emoji-panel { display: flex; flex-wrap: wrap; gap: 2px; padding: 2px 0 8px; max-height: 176px; overflow-y: auto; }
.dm-emoji { background: transparent; border: none; font-size: 23px; width: 40px; height: 40px; line-height: 1; padding: 0; cursor: pointer; border-radius: 8px; }
.dm-emoji:active { background: #e8ebf0; }
/* GIF picker (Tenor search) */
.dm-gif-panel { max-height: 262px; overflow-y: auto; padding: 2px 2px 6px; }
.dm-gif-search { position: sticky; top: 0; background: #fff; padding: 2px 0 8px; z-index: 1; }
.dm-gif-q { width: 100%; box-sizing: border-box; border: 1px solid #d5dae1; border-radius: 999px; padding: 9px 14px; font-size: 14px; outline: none; }
.dm-gif-q:focus { border-color: #d4a437; }
.dm-gif-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.dm-gif-cell { border: none; padding: 0; background: #eceef1; border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 1 / 1; }
.dm-gif-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dm-gif-msg { grid-column: 1 / -1; padding: 18px 12px; text-align: center; color: #6b7686; font-size: 13px; line-height: 1.4; }
.dm-gif-attr { text-align: center; color: #9aa4b2; font-size: 10px; padding: 6px 0 0; }
/* GIF message bubble */
.dm-gif-img { max-width: 220px; max-height: 240px; border-radius: 14px; display: block; cursor: pointer; }
.dm-readonly { text-align: center; color: #8b95a3; font-size: 13px; padding: 8px; }

/* ── compose ──────────────────────────────────────────────────────────── */
.dm-compose { padding: 16px; }
.dm-f-lbl { font-size: 12px; font-weight: 700; color: #8b95a3; margin: 12px 0 6px; text-transform: uppercase; }
.dm-seasonbar { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 4px; }
.dm-seasonbar-field { flex: 1; min-width: 140px; }
.dm-seasonbar-field .dm-f-lbl { margin-top: 0; }
.dm-season-select {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #d5dae1; border-radius: 10px;
  background: #fff; color: #0f1f3d; font-weight: 600; font-size: 14px; font-family: inherit;
}
.dm-teamscope, .dm-typescope { display: flex; gap: 8px; flex-wrap: wrap; }
.dm-team-opt, .dm-type-opt { background: #fff; border: 1px solid #d5dae1; border-radius: 999px; padding: 8px 14px; font-weight: 600; cursor: pointer; color: #55637a; }
.dm-team-opt.on, .dm-type-opt.on { background: #0f1f3d; color: #fff; border-color: #0f1f3d; }
.dm-hint { font-size: 12px; color: #8a6516; margin: 8px 0; min-height: 16px; }
.dm-compose-msg { width: 100%; min-height: 120px; border: 1px solid #d5dae1; border-radius: 12px; padding: 12px; font-size: 15px; margin-top: 6px; box-sizing: border-box; resize: vertical; }
.dm-compose-send { flex: 1; background: #d4a437; color: #17233d; border: none; border-radius: 10px; padding: 13px; font-weight: 700; font-size: 15px; cursor: pointer; }
/* unified compose recipient picker */
.dm-aud-opt { background: #fff; border: 1px solid #d5dae1; border-radius: 999px; padding: 8px 16px; font-weight: 600; cursor: pointer; color: #55637a; }
.dm-aud-opt.on { background: #0f1f3d; color: #fff; border-color: #0f1f3d; }
.dm-reciprow { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 6px; }
.dm-all-btn { background: transparent; border: none; color: #1d4ed8; font-weight: 700; cursor: pointer; font-size: 14px; padding: 0; }
.dm-selcount { font-size: 13px; color: #7a8494; font-weight: 600; }
/* Running cross-category selection summary (persists across the audience tabs). */
.dm-selsummary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 8px; padding: 8px 12px; background: #f4f7fb; border: 1px solid #e3e9f2; border-radius: 999px; font-size: 13px; color: #33415c; }
.dm-selsummary strong { color: #0f1f3d; }
.dm-selsummary-empty { color: #8b95a3; justify-content: center; }
.dm-sel-clear { margin-left: auto; background: transparent; border: none; color: #1d4ed8; font-weight: 700; cursor: pointer; font-size: 13px; padding: 0; }
/* Role group header inside the recipient list — colour-tinted per role for quick scanning. */
.dm-recip-group-hd { display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px 14px; background: #f4f7fb; border-bottom: 1px solid #eef0f3; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: #55637a; position: sticky; top: 0; z-index: 1; }
.dm-recip-group-hd.dm-grp-coaches { background: #eaf1ff; color: #1e40af; }   /* blue  — Coaches */
.dm-recip-group-hd.dm-grp-parents { background: #e7f7ee; color: #167a45; }   /* green — Parents */
.dm-recip-group-hd.dm-grp-admin   { background: #fdf1e3; color: #92600e; }   /* amber — Admins  */
/* Title stays centred; the action pins to the right edge. */
.dm-recip-group-hd .dm-all-btn { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 12.5px; }
.dm-recip-group-hd .dm-grp-loading { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
.dm-grp-loading { font-size: 12px; font-weight: 600; color: #8b95a3; text-transform: none; letter-spacing: 0; font-style: italic; }
.dm-search { width: 100%; border: 1px solid #d5dae1; border-radius: 8px; padding: 10px 12px; font-size: 14px; box-sizing: border-box; margin-bottom: 8px; }
.dm-search:focus { outline: none; border-color: #d4a437; }
.dm-reciplist { max-height: 240px; overflow-y: auto; border: 1px solid #eef0f3; border-radius: 10px; }
.dm-recip { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #eef0f3; cursor: pointer; }
.dm-recip:last-child { border-bottom: none; }
.dm-recip input { width: 18px; height: 18px; accent-color: #d4a437; }
.dm-recip-name { font-weight: 600; color: #0f1f3d; }
.dm-recip-sub { font-size: 12px; color: #8b95a3; margin-left: auto; }
.dm-compose-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.dm-photo-attach { background: #eef0f3; border: none; border-radius: 10px; padding: 12px 16px; font-size: 18px; cursor: pointer; }

/* ── parent front-door card ───────────────────────────────────────────── */
.dm-frontcard { background: #fff; border: 1px solid #e3e6ea; border-radius: 14px; overflow: hidden; margin: 12px 0; }
.dm-frontcard-h { display: flex; align-items: center; justify-content: space-between; background: #0f1f3d; color: #fff; padding: 12px 14px; cursor: pointer; }
.dm-frontcard-h b { font-size: 15px; }
.dm-front-row { display: flex; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid #eef0f3; cursor: pointer; }
.dm-front-row:last-child { border-bottom: none; }
.dm-front-row:hover { background: #f8f9fb; }
.dm-front-title { font-weight: 600; color: #0f1f3d; }
.dm-front-last { color: #7a8494; font-size: 13px; }

/* ── toast / emergency / lightbox / mini-toast ────────────────────────── */
.dm-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 9500;
  background: #0f1f3d; color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.dm-emergency { position: fixed; top: 0; left: 0; right: 0; z-index: 9600; display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #B91C1C, #991B1B); color: #fff; padding: 14px 16px; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.dm-emg-txt { flex: 1; }
.dm-emg-ack { background: #fff; color: #991B1B; border: none; border-radius: 8px; padding: 8px 14px; font-weight: 700; cursor: pointer; }
.dm-lightbox { position: fixed; inset: 0; z-index: 9700; background: rgba(0,0,0,.9); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dm-lightbox img { max-width: 94vw; max-height: 82vh; border-radius: 8px; }
.dm-lb-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 14px 18px; }
.dm-lb-save { background: #d4a437; color: #17233d; padding: 8px 16px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.dm-lb-close { background: transparent; border: none; color: #fff; font-size: 22px; cursor: pointer; }
.dm-mini-toast { position: fixed; left: 50%; bottom: 140px; transform: translateX(-50%); z-index: 9800;
  background: rgba(15,31,61,.95); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; pointer-events: none; }

/* ── per-category push prefs row (host mounts .dm-prefs into settings) ─── */
.dm-prefs { padding: 8px 0; }
.dm-pref-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.dm-pref-lbl { font-weight: 600; color: #0f1f3d; }
.dm-pref-desc { font-size: 12px; color: #8b95a3; }
.dm-tog { width: 46px; height: 26px; border-radius: 999px; background: #cbd2db; position: relative; cursor: pointer; transition: background .15s; flex: 0 0 auto; }
.dm-tog.on { background: #2e9e5b; }
.dm-tog::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
.dm-tog.on::after { left: 23px; }

@media (prefers-reduced-motion: reduce) { .dm-tog, .dm-tog::after { transition: none; } }

/* ── iMessage-style thread header: back chevron + tappable avatars/names (People sheet) ── */
.dm-back-chev { font-size: 30px; line-height: 1; font-weight: 300; }
.dm-identity { display: flex; align-items: center; gap: 8px; background: transparent; border: none; color: #fff; cursor: pointer; padding: 0; max-width: 100%; overflow: hidden; text-align: left; }
.dm-identity-txt { display: flex; flex-direction: column; min-width: 0; }
.dm-identity-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-identity-sub { font-size: 11px; color: #b7c0d4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-identity-caret { color: #7f8db0; font-size: 20px; margin-left: 2px; flex: 0 0 auto; }
.dm-av { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; flex: 0 0 auto; }
.dm-avstack { display: inline-flex; align-items: center; }
.dm-avstack .dm-av { margin-left: -10px; box-shadow: 0 0 0 2px #0f1f3d; }
.dm-avstack .dm-av:first-child { margin-left: 0; }
/* People / details sheet */
.dm-sheet { position: fixed; inset: 0; z-index: 9750; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 720px) { .dm-sheet { align-items: center; } }
.dm-sheet-card { background: #fff; width: 100%; max-width: 440px; max-height: 80vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom, 8px); }
@media (min-width: 720px) { .dm-sheet-card { border-radius: 18px; } }
.dm-sheet-hd { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; font-weight: 800; color: #0f1f3d; font-size: 16px; }
.dm-sheet-x { background: transparent; border: none; font-size: 18px; color: #7a8494; cursor: pointer; }
.dm-sheet-rename { display: block; width: calc(100% - 36px); margin: 0 18px 8px; text-align: left; background: #f4f5f7; border: none; border-radius: 10px; padding: 12px 14px; font-weight: 600; color: #0f1f3d; cursor: pointer; }
.dm-sheet-list { padding: 4px 8px 10px; }
.dm-sheet-mem { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #f2f4f7; }
.dm-sheet-mem-top { display: flex; align-items: center; gap: 12px; }
.dm-sheet-mem-n { font-weight: 600; color: #0f1f3d; }
.dm-sheet-mem-r { font-size: 12px; color: #8b95a3; text-transform: capitalize; }
/* Per-member moderation actions in the People sheet (M2a) — their OWN row (avatar-aligned),
   wrapping so Block + Mute + Remove are ALL visible together on narrow phones. */
.dm-mem-acts { margin-left: 50px; display: flex; gap: 6px; flex-wrap: wrap; }
.dm-mem-act { background: #f1f4f9; border: 1px solid #e3e9f2; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: #33415c; cursor: pointer; }
.dm-mem-act:hover { background: #e7edf6; }
.dm-mem-remove { color: #DC2626; border-color: #f3d3d3; background: #fdf2f2; }
.dm-mem-act:disabled, .dm-mem-act.dm-act-busy { opacity: .55; cursor: default; }
/* "Who reacted" sheet row emoji. */
.dm-react-who { margin-left: auto; font-size: 20px; }
/* Active state — the action is currently ON (Unmute/Unblock undo it). */
.dm-mem-act.dm-act-on { background: #0f1f3d; border-color: #0f1f3d; color: #fff; }
/* Status pills on a member row so muted/blocked is visible at a glance. */
.dm-mem-tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: middle; }
.dm-tag-muted { background: #fdf1e3; color: #92600e; }
.dm-tag-blocked { background: #fdecec; color: #b42318; }
/* Blocked tab */
.dm-blocked-hint { padding: 14px 16px; font-size: 12.5px; color: #7a8494; line-height: 1.45; border-bottom: 1px solid #eef0f3; }
.dm-blocked-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #eef0f3; }
.dm-blocked-name { font-weight: 600; color: #0f1f3d; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-unblock-btn { flex-shrink: 0; }
.dm-you { font-size: 11px; color: #8b95a3; font-weight: 500; }
.dm-fwd-t { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: transparent; border: none; padding: 10px 12px; cursor: pointer; }
.dm-fwd-t:hover { background: #f4f5f7; }
/* staged-attachment chip (thread + compose): a picked GIF/photo waits here until you send */
.dm-staged-chip { display: inline-flex; align-items: center; gap: 8px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 12px; padding: 6px 8px; max-width: 100%; }
.dm-staged-chip img { height: 44px; border-radius: 8px; }
.dm-staged-chip span { font-size: 12px; color: #475569; white-space: nowrap; }
.dm-staged-chip .dm-c-unstage { border: none; background: transparent; font-size: 16px; color: #94a3b8; cursor: pointer; line-height: 1; padding: 0; }
.dm-staged-ph { font-size: 20px; }
