/* ============================================================================
   AU ONE ERP · Global Messenger
   ----------------------------------------------------------------------------
   Presentation for the floating, page-independent messaging surface.
   Every class is `aumsg-` prefixed so this stylesheet cannot alter a module's
   own cards, forms, drawers, or legacy Construction messaging view.

   Layer contract:
     module content < AU Messenger (9600) < AU shell drawer / blocking modals
   ============================================================================ */

.aumsg-root{
  --aumsg-bg:#fbfaf5;
  --aumsg-bg-soft:#f4f3ec;
  --aumsg-bg-hover:#ececdf;
  --aumsg-ink:#1c1e16;
  --aumsg-ink-soft:#444a38;
  --aumsg-muted:#777d69;
  --aumsg-line:#dedfd2;
  --aumsg-line-strong:#c9ccba;
  --aumsg-accent:var(--au-olive,#748040);
  --aumsg-accent-strong:#5d692f;
  --aumsg-accent-soft:rgba(116,128,64,.14);
  --aumsg-on-accent:#fff;
  --aumsg-danger:var(--au-bad,#c74640);
  --aumsg-danger-soft:rgba(199,70,64,.12);
  --aumsg-ok:var(--au-ok,#3f7d4e);
  --aumsg-shadow:0 22px 60px rgba(20,24,15,.24),0 4px 16px rgba(20,24,15,.12);
  --aumsg-shadow-soft:0 8px 24px rgba(20,24,15,.14);
  --aumsg-radius:18px;
  --aumsg-radius-sm:12px;
  --aumsg-font:var(--au-font,'Archivo','Lexend',system-ui,'Segoe UI',sans-serif);
  position:fixed;
  inset:0;
  /* Above the host page own corner furniture. Construction "+" FAB sits at
     z 99990 and this app highest layer is 100002, so 9600 put the launcher
     UNDERNEATH both - mounted, but invisible and unclickable, which is why
     Construction looked like it had no messenger at all. The :has() lanes
     further down move it clear of the FAB rather than parking on top of it. */
  z-index:100010;
  --aumsg-lift:0px;
  pointer-events:none;
  color:var(--aumsg-ink);
  font-family:var(--aumsg-font);
  font-size:14px;
  line-height:1.4;
  -webkit-font-smoothing:antialiased;
}

html[data-theme="dark"] .aumsg-root,
.aumsg-root.aumsg-theme-dark{
  --aumsg-bg:#171a12;
  --aumsg-bg-soft:#10130c;
  --aumsg-bg-hover:#23281b;
  --aumsg-ink:#f3f5ed;
  --aumsg-ink-soft:#cbd0bf;
  --aumsg-muted:#969d88;
  --aumsg-line:rgba(226,233,207,.12);
  --aumsg-line-strong:rgba(226,233,207,.22);
  --aumsg-accent:#a3b25e;
  --aumsg-accent-strong:#bdcb78;
  --aumsg-accent-soft:rgba(163,178,94,.17);
  --aumsg-on-accent:#12150c;
  --aumsg-danger:#ef817a;
  --aumsg-danger-soft:rgba(239,129,122,.14);
  --aumsg-ok:#73c489;
  --aumsg-shadow:0 24px 68px rgba(0,0,0,.58),0 4px 18px rgba(0,0,0,.38);
  --aumsg-shadow-soft:0 10px 28px rgba(0,0,0,.38);
}

.aumsg-root *,
.aumsg-root *::before,
.aumsg-root *::after{ box-sizing:border-box; }

.aumsg-root[hidden],
.aumsg-hidden{ display:none !important; }

/* Launcher ---------------------------------------------------------------- */
.aumsg-launcher{
  position:fixed;
  right:calc(18px + env(safe-area-inset-right,0px));
  bottom:calc(18px + var(--aumsg-lift,0px) + env(safe-area-inset-bottom,0px));
  width:58px;
  height:58px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin:0;
  padding:0;
  border:1px solid rgba(255,255,255,.32);
  border-radius:50%;
  background:linear-gradient(145deg,var(--aumsg-accent),var(--aumsg-accent-strong));
  color:var(--aumsg-on-accent);
  box-shadow:0 14px 32px rgba(52,61,30,.32),inset 0 1px 0 rgba(255,255,255,.24);
  cursor:pointer;
  pointer-events:auto;
  -webkit-tap-highlight-color:transparent;
  transition:transform .16s ease,box-shadow .16s ease,filter .16s ease;
}

.aumsg-launcher:hover{ transform:translateY(-2px); filter:saturate(1.08); box-shadow:0 17px 38px rgba(52,61,30,.38); }
.aumsg-launcher:active{ transform:translateY(0) scale(.96); }
.aumsg-launcher-icon{ width:27px; height:27px; display:block; fill:currentColor; }

.aumsg-launcher-badge{
  position:absolute;
  top:-5px;
  right:-5px;
  min-width:23px;
  height:23px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 6px;
  border:3px solid var(--aumsg-bg);
  border-radius:999px;
  background:var(--aumsg-danger);
  color:#fff;
  font:800 10px/1 var(--aumsg-font);
  font-variant-numeric:tabular-nums;
}

.aumsg-launcher-badge.aumsg-is-zero{ display:none; }
.aumsg-launcher.aumsg-has-unread::after{
  content:"";
  position:absolute;
  inset:-5px;
  border:2px solid color-mix(in srgb,var(--aumsg-accent) 72%,transparent);
  border-radius:50%;
  animation:aumsg-pulse 1.8s ease-out infinite;
  pointer-events:none;
}

/* Desktop panel ----------------------------------------------------------- */
.aumsg-scrim{
  position:fixed;
  inset:0;
  background:rgba(7,10,5,.34);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .18s ease,visibility 0s linear .18s;
}

.aumsg-panel{
  position:fixed;
  right:calc(18px + env(safe-area-inset-right,0px));
  bottom:calc(88px + var(--aumsg-lift,0px) + env(safe-area-inset-bottom,0px));
  width:min(390px,calc(100vw - 28px));
  height:min(650px,calc(100dvh - 112px - env(safe-area-inset-top,0px)));
  min-height:430px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid var(--aumsg-line);
  border-radius:var(--aumsg-radius);
  background:var(--aumsg-bg);
  color:var(--aumsg-ink);
  box-shadow:var(--aumsg-shadow);
  opacity:0;
  visibility:hidden;
  transform:translateY(18px) scale(.97);
  transform-origin:bottom right;
  pointer-events:none;
  transition:opacity .17s ease,transform .2s cubic-bezier(.2,.8,.2,1),visibility 0s linear .2s;
}

/* THE DEAD-BUTTON BUG (2026-09-01): setOpen() toggles aumsg-is-open on the
   ROOT (au-messenger.js:512) — the mobile block below already keys off
   .aumsg-root.aumsg-is-open, but this desktop rule required the class on the
   PANEL itself, which nothing ever sets. The launcher "did nothing" because
   the panel opened in state and stayed invisible in CSS. Descendant selector
   matches the JS contract. */
.aumsg-root.aumsg-is-open .aumsg-panel{
  opacity:1;
  visibility:visible;
  transform:none;
  pointer-events:auto;
  transition-delay:0s;
}

.aumsg-surface{
  position:relative;
  min-height:0;
  flex:1;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:var(--aumsg-bg);
}

.aumsg-view{
  position:absolute;
  inset:0;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:var(--aumsg-bg);
  opacity:0;
  visibility:hidden;
  transform:translateX(12px);
  pointer-events:none;
  transition:opacity .14s ease,transform .18s ease,visibility 0s linear .18s;
}

.aumsg-view.aumsg-is-active{
  opacity:1;
  visibility:visible;
  transform:none;
  pointer-events:auto;
  transition-delay:0s;
}

.aumsg-view.aumsg-goes-back{ transform:translateX(-12px); }

/* THE INVISIBLE SHIELD (owner, 2026-09-04: "in mobile … when i click messenger
   then close it i cant touch anything on the pages"). The closed panel is
   opacity:0 / visibility:hidden / pointer-events:none — but the ACTIVE VIEW
   inside it sets visibility:visible and pointer-events:auto on itself, and
   both override what it inherits. Opacity never blocks hit-testing, so the
   view kept catching every touch: on a phone the panel is the whole screen,
   so the whole page went dead; on desktop only the panel's corner did. When
   the root is not open, nothing inside the panel may catch a pointer, and
   the views hide after their own fade. */
.aumsg-root:not(.aumsg-is-open) .aumsg-panel,
.aumsg-root:not(.aumsg-is-open) .aumsg-panel *{ pointer-events:none !important; }
.aumsg-root:not(.aumsg-is-open) .aumsg-view{ visibility:hidden; }

/* Shared controls --------------------------------------------------------- */
.aumsg-header{
  min-height:62px;
  flex:none;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid var(--aumsg-line);
  background:color-mix(in srgb,var(--aumsg-bg) 94%,transparent);
  -webkit-backdrop-filter:blur(14px) saturate(1.2);
  backdrop-filter:blur(14px) saturate(1.2);
}

.aumsg-header-copy{ flex:1; min-width:0; }
.aumsg-title{
  margin:0;
  color:var(--aumsg-ink);
  font:800 17px/1.2 var(--aumsg-font);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.aumsg-subtitle{
  margin:3px 0 0;
  color:var(--aumsg-muted);
  font:600 11px/1.25 var(--aumsg-font);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.aumsg-header-actions{ flex:none; display:flex; align-items:center; gap:4px; }
.aumsg-icon-btn{
  width:40px;
  height:40px;
  flex:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin:0;
  padding:0;
  border:0;
  border-radius:50%;
  background:transparent;
  color:var(--aumsg-ink-soft);
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:background .12s ease,color .12s ease,transform .1s ease;
}

.aumsg-icon-btn:hover{ background:var(--aumsg-accent-soft); color:var(--aumsg-accent-strong); }
.aumsg-icon-btn:active{ transform:scale(.94); }
.aumsg-icon-btn.aumsg-is-danger{ color:var(--aumsg-danger); }
.aumsg-icon-btn.aumsg-is-danger:hover{ background:var(--aumsg-danger-soft); }
.aumsg-icon{ width:20px; height:20px; display:block; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }

.aumsg-avatar{
  position:relative;
  width:42px;
  height:42px;
  flex:none;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border:1px solid var(--aumsg-line);
  border-radius:50%;
  background:linear-gradient(145deg,var(--aumsg-accent-soft),var(--aumsg-bg-hover));
  color:var(--aumsg-accent-strong);
  font:800 13px/1 var(--aumsg-font);
  text-transform:uppercase;
  user-select:none;
}

.aumsg-avatar-img{ width:100%; height:100%; display:block; object-fit:cover; }
.aumsg-avatar.aumsg-is-group{ border-radius:14px; }
.aumsg-presence{
  position:absolute;
  right:0;
  bottom:0;
  width:12px;
  height:12px;
  border:2px solid var(--aumsg-bg);
  border-radius:50%;
  background:var(--aumsg-muted);
}
.aumsg-presence.aumsg-is-online{ background:var(--aumsg-ok); }

.aumsg-search-wrap{
  flex:none;
  position:relative;
  display:flex;
  align-items:center;
  margin:10px 12px 8px;
}

.aumsg-search-icon{
  position:absolute;
  left:12px;
  width:17px;
  height:17px;
  color:var(--aumsg-muted);
  pointer-events:none;
}

.aumsg-search,
.aumsg-input,
.aumsg-textarea{
  width:100%;
  margin:0;
  border:1px solid var(--aumsg-line);
  border-radius:var(--aumsg-radius-sm);
  background:var(--aumsg-bg-soft);
  color:var(--aumsg-ink);
  caret-color:var(--aumsg-accent);
  font:600 14px/1.4 var(--aumsg-font);
  outline:0;
  transition:border-color .12s ease,box-shadow .12s ease,background .12s ease;
}

.aumsg-search{ height:40px; padding:9px 12px 9px 38px; border-radius:999px; }
.aumsg-input{ min-height:43px; padding:10px 12px; }
.aumsg-textarea{ min-height:76px; max-height:150px; resize:vertical; padding:10px 12px; }
.aumsg-search::placeholder,
.aumsg-input::placeholder,
.aumsg-textarea::placeholder{ color:var(--aumsg-muted); opacity:.85; }

.aumsg-search:focus,
.aumsg-input:focus,
.aumsg-textarea:focus{
  border-color:var(--aumsg-accent);
  background:var(--aumsg-bg);
  box-shadow:0 0 0 3px var(--aumsg-accent-soft);
}

.aumsg-label{
  display:block;
  margin:0 0 6px;
  color:var(--aumsg-ink-soft);
  font:800 11px/1.25 var(--aumsg-font);
  letter-spacing:.045em;
  text-transform:uppercase;
}

.aumsg-help{ margin:6px 0 0; color:var(--aumsg-muted); font:600 11px/1.45 var(--aumsg-font); }
.aumsg-error{ margin:6px 0 0; color:var(--aumsg-danger); font:700 11px/1.4 var(--aumsg-font); }
.aumsg-field{ margin:0 0 14px; }

.aumsg-primary-btn,
.aumsg-secondary-btn,
.aumsg-danger-btn{
  min-height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  margin:0;
  padding:10px 15px;
  border:1px solid transparent;
  border-radius:var(--aumsg-radius-sm);
  font:800 13px/1 var(--aumsg-font);
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:filter .12s ease,transform .1s ease,background .12s ease;
}

.aumsg-primary-btn{ background:var(--aumsg-accent); color:var(--aumsg-on-accent); }
.aumsg-secondary-btn{ border-color:var(--aumsg-line); background:var(--aumsg-bg-soft); color:var(--aumsg-ink); }
.aumsg-danger-btn{ border-color:color-mix(in srgb,var(--aumsg-danger) 40%,transparent); background:var(--aumsg-danger-soft); color:var(--aumsg-danger); }
.aumsg-primary-btn:hover,
.aumsg-secondary-btn:hover,
.aumsg-danger-btn:hover{ filter:brightness(1.04); }
.aumsg-primary-btn:active,
.aumsg-secondary-btn:active,
.aumsg-danger-btn:active{ transform:scale(.98); }
.aumsg-primary-btn:disabled,
.aumsg-secondary-btn:disabled,
.aumsg-danger-btn:disabled,
.aumsg-icon-btn:disabled{ cursor:not-allowed; opacity:.48; filter:none; transform:none; }

/* Inbox ------------------------------------------------------------------- */
.aumsg-inbox-toolbar{
  flex:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:0 12px 8px;
}

.aumsg-filter-row{ min-width:0; display:flex; align-items:center; gap:5px; overflow:auto; scrollbar-width:none; }
.aumsg-filter-row::-webkit-scrollbar{ display:none; }
.aumsg-filter{
  min-height:31px;
  flex:none;
  padding:7px 11px;
  border:1px solid transparent;
  border-radius:999px;
  background:transparent;
  color:var(--aumsg-muted);
  font:800 11px/1 var(--aumsg-font);
  cursor:pointer;
}
.aumsg-filter:hover{ background:var(--aumsg-bg-hover); color:var(--aumsg-ink); }
.aumsg-filter.aumsg-is-active{ border-color:color-mix(in srgb,var(--aumsg-accent) 24%,transparent); background:var(--aumsg-accent-soft); color:var(--aumsg-accent-strong); }

.aumsg-inbox-list,
.aumsg-people-list,
.aumsg-member-list{
  min-height:0;
  flex:1;
  margin:0;
  padding:2px 7px 10px;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-color:var(--aumsg-line-strong) transparent;
  scrollbar-width:thin;
}

.aumsg-inbox-item,
.aumsg-person-item,
.aumsg-member-item{
  width:100%;
  min-height:66px;
  display:flex;
  align-items:center;
  gap:10px;
  margin:0;
  padding:8px;
  border:0;
  border-radius:13px;
  background:transparent;
  color:var(--aumsg-ink);
  text-align:left;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:background .12s ease;
}

.aumsg-inbox-item:hover,
.aumsg-person-item:hover,
.aumsg-member-item:hover{ background:var(--aumsg-bg-hover); }
.aumsg-inbox-item.aumsg-is-active{ background:var(--aumsg-accent-soft); }
.aumsg-inbox-item.aumsg-is-unread .aumsg-inbox-name,
.aumsg-inbox-item.aumsg-is-unread .aumsg-inbox-preview{ color:var(--aumsg-ink); font-weight:800; }

.aumsg-inbox-main,
.aumsg-person-main,
.aumsg-member-main{ min-width:0; flex:1; }
.aumsg-inbox-line,
.aumsg-person-line,
.aumsg-member-line{ display:flex; align-items:baseline; gap:7px; min-width:0; }
.aumsg-inbox-name,
.aumsg-person-name,
.aumsg-member-name{
  min-width:0;
  flex:1;
  overflow:hidden;
  color:var(--aumsg-ink);
  font:750 13.5px/1.25 var(--aumsg-font);
  text-overflow:ellipsis;
  white-space:nowrap;
}
.aumsg-inbox-time{ flex:none; color:var(--aumsg-muted); font:650 10px/1 var(--aumsg-font); font-variant-numeric:tabular-nums; }
.aumsg-inbox-preview,
.aumsg-person-detail,
.aumsg-member-detail{
  display:block;
  margin-top:4px;
  overflow:hidden;
  color:var(--aumsg-muted);
  font:600 11.5px/1.3 var(--aumsg-font);
  text-overflow:ellipsis;
  white-space:nowrap;
}
.aumsg-inbox-side{ flex:none; display:flex; flex-direction:column; align-items:flex-end; gap:6px; }
.aumsg-unread{
  min-width:20px;
  height:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 6px;
  border-radius:999px;
  background:var(--aumsg-accent);
  color:var(--aumsg-on-accent);
  font:800 9.5px/1 var(--aumsg-font);
  font-variant-numeric:tabular-nums;
}
.aumsg-unread.aumsg-is-zero{ visibility:hidden; }
.aumsg-delivery{ color:var(--aumsg-muted); font-size:11px; line-height:1; }
.aumsg-delivery.aumsg-is-seen{ color:var(--aumsg-accent); }

.aumsg-compose-fab{
  position:absolute;
  right:16px;
  bottom:16px;
  width:48px;
  height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:50%;
  background:var(--aumsg-accent);
  color:var(--aumsg-on-accent);
  box-shadow:var(--aumsg-shadow-soft);
  cursor:pointer;
  transition:transform .12s ease,filter .12s ease;
}
.aumsg-compose-fab:hover{ transform:translateY(-2px); filter:brightness(1.05); }
.aumsg-compose-fab:active{ transform:scale(.96); }

/* Empty, loading, and offline states -------------------------------------- */
.aumsg-state{
  min-height:0;
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:28px;
  color:var(--aumsg-muted);
  text-align:center;
}
.aumsg-state-icon{
  width:54px;
  height:54px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin:0 0 13px;
  border-radius:18px;
  background:var(--aumsg-accent-soft);
  color:var(--aumsg-accent-strong);
}
.aumsg-state-title{ margin:0; color:var(--aumsg-ink); font:800 15px/1.3 var(--aumsg-font); }
.aumsg-state-copy{ max-width:270px; margin:6px 0 0; color:var(--aumsg-muted); font:600 12px/1.5 var(--aumsg-font); }
.aumsg-state-action{ margin-top:15px; }
.aumsg-skeleton{
  height:64px;
  margin:3px 8px;
  border-radius:13px;
  background:linear-gradient(90deg,var(--aumsg-bg-soft),var(--aumsg-bg-hover),var(--aumsg-bg-soft));
  background-size:220% 100%;
  animation:aumsg-shimmer 1.2s linear infinite;
}
.aumsg-status-banner{
  flex:none;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:30px;
  padding:6px 12px;
  border-bottom:1px solid var(--aumsg-line);
  background:var(--aumsg-bg-soft);
  color:var(--aumsg-muted);
  font:750 10.5px/1.3 var(--aumsg-font);
  text-align:center;
}
.aumsg-status-banner.aumsg-is-online{ background:color-mix(in srgb,var(--aumsg-ok) 12%,var(--aumsg-bg)); color:var(--aumsg-ok); }
.aumsg-status-banner.aumsg-is-error{ background:var(--aumsg-danger-soft); color:var(--aumsg-danger); }

/* Conversation thread ---------------------------------------------------- */
.aumsg-thread-header{ cursor:default; }
.aumsg-thread-avatar{ width:38px; height:38px; }
.aumsg-messages{
  min-height:0;
  flex:1;
  display:flex;
  flex-direction:column;
  gap:3px;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:14px 11px 12px;
  scroll-behavior:smooth;
  scrollbar-color:var(--aumsg-line-strong) transparent;
  scrollbar-width:thin;
}
.aumsg-load-older{ align-self:center; margin:0 0 8px; min-height:32px; padding:7px 12px; border-radius:999px; font-size:10.5px; }
.aumsg-day{
  align-self:center;
  margin:10px 0 8px;
  padding:4px 9px;
  border-radius:999px;
  background:var(--aumsg-bg-soft);
  color:var(--aumsg-muted);
  font:750 9.5px/1 var(--aumsg-font);
}
.aumsg-message-row{
  max-width:88%;
  align-self:flex-start;
  display:flex;
  align-items:flex-end;
  gap:6px;
  margin:2px 0;
}
.aumsg-message-row.aumsg-is-mine{ align-self:flex-end; flex-direction:row-reverse; }
.aumsg-message-row.aumsg-is-system{ max-width:100%; align-self:stretch; justify-content:center; }
.aumsg-message-avatar{ width:27px; height:27px; font-size:9px; }
.aumsg-message-stack{ min-width:0; display:flex; flex-direction:column; align-items:flex-start; }
.aumsg-message-row.aumsg-is-mine .aumsg-message-stack{ align-items:flex-end; }
.aumsg-sender{
  max-width:100%;
  margin:0 8px 3px;
  overflow:hidden;
  color:var(--aumsg-muted);
  font:750 9.5px/1.2 var(--aumsg-font);
  text-overflow:ellipsis;
  white-space:nowrap;
}
.aumsg-bubble{
  position:relative;
  max-width:100%;
  padding:9px 12px;
  border:1px solid var(--aumsg-line);
  border-radius:16px 16px 16px 5px;
  background:var(--aumsg-bg-soft);
  color:var(--aumsg-ink);
  font:600 13px/1.42 var(--aumsg-font);
  overflow-wrap:anywhere;
  white-space:pre-wrap;
  -webkit-user-select:text;
  user-select:text;
}
.aumsg-message-row.aumsg-is-mine .aumsg-bubble{
  border-color:transparent;
  border-radius:16px 16px 5px 16px;
  background:var(--aumsg-accent);
  color:var(--aumsg-on-accent);
}
.aumsg-bubble.aumsg-has-photo{ padding:4px; overflow:hidden; }
.aumsg-bubble.aumsg-has-photo .aumsg-message-text{ display:block; padding:6px 8px 5px; }
.aumsg-message-text{ min-width:0; }
.aumsg-message-meta{
  display:flex;
  align-items:center;
  gap:5px;
  margin:3px 7px 0;
  color:var(--aumsg-muted);
  font:650 9px/1 var(--aumsg-font);
  font-variant-numeric:tabular-nums;
}
.aumsg-message-row.aumsg-is-mine .aumsg-message-meta{ justify-content:flex-end; }
.aumsg-message-row.aumsg-is-pending .aumsg-bubble{ opacity:.72; }
.aumsg-message-row.aumsg-is-failed .aumsg-message-meta{ color:var(--aumsg-danger); }
.aumsg-system-message{
  max-width:90%;
  padding:5px 10px;
  border-radius:999px;
  background:var(--aumsg-bg-soft);
  color:var(--aumsg-muted);
  font:650 10px/1.35 var(--aumsg-font);
  text-align:center;
}

.aumsg-photo-button{
  display:block;
  max-width:260px;
  max-height:310px;
  margin:0;
  padding:0;
  overflow:hidden;
  border:0;
  border-radius:12px;
  background:var(--aumsg-bg-hover);
  cursor:zoom-in;
}
.aumsg-photo{
  display:block;
  width:auto;
  max-width:260px;
  height:auto;
  max-height:310px;
  object-fit:cover;
}
.aumsg-photo-loading{
  width:220px;
  height:150px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(120deg,var(--aumsg-bg-hover),var(--aumsg-bg-soft));
  color:var(--aumsg-muted);
  font:700 10px/1 var(--aumsg-font);
}

.aumsg-reactions{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:3px;
  margin:-3px 5px 0;
}
.aumsg-reaction{
  min-width:29px;
  height:23px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:3px;
  padding:2px 6px;
  border:1px solid var(--aumsg-line);
  border-radius:999px;
  background:var(--aumsg-bg);
  color:var(--aumsg-ink-soft);
  box-shadow:0 2px 7px rgba(0,0,0,.09);
  font:750 10px/1 var(--aumsg-font);
  cursor:pointer;
}
.aumsg-reaction:hover{ border-color:var(--aumsg-accent); background:var(--aumsg-accent-soft); }
.aumsg-reaction.aumsg-is-mine{ border-color:var(--aumsg-accent); background:var(--aumsg-accent-soft); color:var(--aumsg-accent-strong); }
.aumsg-reaction-picker{
  position:absolute;
  right:6px;
  bottom:calc(100% + 7px);
  display:flex;
  align-items:center;
  gap:2px;
  padding:5px;
  border:1px solid var(--aumsg-line);
  border-radius:999px;
  background:var(--aumsg-bg);
  box-shadow:var(--aumsg-shadow-soft);
}
.aumsg-reaction-option{
  width:34px;
  height:34px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border:0;
  border-radius:50%;
  background:transparent;
  font-size:19px;
  cursor:pointer;
  transition:transform .12s ease,background .12s ease;
}
.aumsg-reaction-option:hover{ transform:scale(1.15); background:var(--aumsg-bg-hover); }

.aumsg-typing{
  align-self:flex-start;
  display:flex;
  align-items:center;
  gap:4px;
  min-height:31px;
  margin:3px 0 3px 34px;
  padding:8px 11px;
  border:1px solid var(--aumsg-line);
  border-radius:15px 15px 15px 5px;
  background:var(--aumsg-bg-soft);
}
.aumsg-typing-dot{
  width:5px;
  height:5px;
  border-radius:50%;
  background:var(--aumsg-muted);
  animation:aumsg-typing 1.1s ease-in-out infinite;
}
.aumsg-typing-dot:nth-child(2){ animation-delay:.14s; }
.aumsg-typing-dot:nth-child(3){ animation-delay:.28s; }

/* Composer ---------------------------------------------------------------- */
.aumsg-attachment-preview{
  flex:none;
  display:flex;
  align-items:center;
  gap:9px;
  padding:8px 10px 0;
  border-top:1px solid var(--aumsg-line);
  background:var(--aumsg-bg);
}
.aumsg-attachment-thumb{
  position:relative;
  width:58px;
  height:58px;
  overflow:hidden;
  border:1px solid var(--aumsg-line);
  border-radius:10px;
  background:var(--aumsg-bg-soft);
}
.aumsg-attachment-img{ width:100%; height:100%; display:block; object-fit:cover; }
.aumsg-attachment-remove{ position:absolute; top:-5px; right:-5px; width:24px; height:24px; border:2px solid var(--aumsg-bg); background:var(--aumsg-danger); color:#fff; }
.aumsg-attachment-copy{ min-width:0; flex:1; }
.aumsg-attachment-name{ display:block; overflow:hidden; color:var(--aumsg-ink); font:750 11px/1.3 var(--aumsg-font); text-overflow:ellipsis; white-space:nowrap; }
.aumsg-attachment-size{ display:block; margin-top:2px; color:var(--aumsg-muted); font:600 9.5px/1.2 var(--aumsg-font); }

.aumsg-composer{
  flex:none;
  display:flex;
  align-items:flex-end;
  gap:6px;
  padding:9px 9px calc(9px + env(safe-area-inset-bottom,0px));
  border-top:1px solid var(--aumsg-line);
  background:var(--aumsg-bg);
}
.aumsg-composer-input{
  min-width:0;
  min-height:40px;
  max-height:112px;
  flex:1;
  resize:none;
  overflow-y:auto;
  padding:9px 12px;
  border:1px solid var(--aumsg-line);
  border-radius:19px;
  background:var(--aumsg-bg-soft);
  color:var(--aumsg-ink);
  caret-color:var(--aumsg-accent);
  font:600 14px/1.42 var(--aumsg-font);
  outline:0;
}
.aumsg-composer-input:focus{ border-color:var(--aumsg-accent); background:var(--aumsg-bg); box-shadow:0 0 0 3px var(--aumsg-accent-soft); }
.aumsg-attach-btn{ width:40px; height:40px; color:var(--aumsg-accent-strong); }
.aumsg-send-btn{
  width:40px;
  height:40px;
  flex:none;
  display:flex;
  align-items:center;
  justify-content:center;
  margin:0;
  padding:0;
  border:0;
  border-radius:50%;
  background:var(--aumsg-accent);
  color:var(--aumsg-on-accent);
  cursor:pointer;
  transition:transform .1s ease,filter .12s ease;
}
.aumsg-send-btn:hover{ filter:brightness(1.06); }
.aumsg-send-btn:active{ transform:scale(.94); }
.aumsg-send-btn:disabled{ cursor:not-allowed; opacity:.45; filter:none; transform:none; }
.aumsg-file-input{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; }

/* New direct chat / create group ----------------------------------------- */
.aumsg-selection{
  flex:none;
  display:flex;
  align-items:center;
  gap:6px;
  min-height:0;
  max-height:96px;
  margin:0 12px 8px;
  padding:0;
  overflow:auto;
  scrollbar-width:thin;
}
.aumsg-selection:empty{ display:none; }
.aumsg-chip{
  min-height:30px;
  flex:none;
  display:inline-flex;
  align-items:center;
  gap:5px;
  max-width:150px;
  padding:5px 7px 5px 9px;
  border:1px solid color-mix(in srgb,var(--aumsg-accent) 30%,transparent);
  border-radius:999px;
  background:var(--aumsg-accent-soft);
  color:var(--aumsg-accent-strong);
  font:750 10.5px/1 var(--aumsg-font);
}
.aumsg-chip-name{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.aumsg-chip-remove{ width:20px; height:20px; flex:none; padding:0; border:0; border-radius:50%; background:transparent; color:inherit; cursor:pointer; }
.aumsg-check{
  width:21px;
  height:21px;
  flex:none;
  display:flex;
  align-items:center;
  justify-content:center;
  border:2px solid var(--aumsg-line-strong);
  border-radius:7px;
  background:var(--aumsg-bg);
  color:var(--aumsg-on-accent);
}
.aumsg-person-item.aumsg-is-selected .aumsg-check{ border-color:var(--aumsg-accent); background:var(--aumsg-accent); }
.aumsg-person-item.aumsg-is-disabled{ cursor:not-allowed; opacity:.5; }
.aumsg-section-label{
  flex:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:7px 15px 5px;
  color:var(--aumsg-muted);
  font:800 10px/1.2 var(--aumsg-font);
  letter-spacing:.05em;
  text-transform:uppercase;
}
.aumsg-view-footer{
  flex:none;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));
  border-top:1px solid var(--aumsg-line);
  background:var(--aumsg-bg);
}
.aumsg-view-footer .aumsg-primary-btn{ min-width:104px; }

/* Group settings ---------------------------------------------------------- */
.aumsg-settings-scroll{
  min-height:0;
  flex:1;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:14px 13px calc(20px + env(safe-area-inset-bottom,0px));
  scrollbar-color:var(--aumsg-line-strong) transparent;
  scrollbar-width:thin;
}
.aumsg-settings-card{
  margin:0 0 12px;
  padding:13px;
  border:1px solid var(--aumsg-line);
  border-radius:14px;
  background:var(--aumsg-bg-soft);
}
.aumsg-settings-title{ margin:0 0 10px; color:var(--aumsg-ink); font:800 12.5px/1.3 var(--aumsg-font); }
.aumsg-group-identity{ display:flex; align-items:center; gap:11px; margin-bottom:12px; }
.aumsg-group-avatar{ width:58px; height:58px; border-radius:18px; }
.aumsg-group-copy{ min-width:0; flex:1; }
.aumsg-member-list{ max-height:260px; margin:0 -7px; padding:0; }
.aumsg-member-item{ min-height:57px; padding:7px; cursor:default; }
.aumsg-member-role{
  flex:none;
  padding:4px 7px;
  border-radius:999px;
  background:var(--aumsg-accent-soft);
  color:var(--aumsg-accent-strong);
  font:800 8.5px/1 var(--aumsg-font);
  letter-spacing:.03em;
  text-transform:uppercase;
}
.aumsg-member-actions{ flex:none; display:flex; align-items:center; gap:2px; }
.aumsg-danger-zone{ border-color:color-mix(in srgb,var(--aumsg-danger) 28%,var(--aumsg-line)); background:var(--aumsg-danger-soft); }
.aumsg-danger-zone .aumsg-settings-title{ color:var(--aumsg-danger); }
.aumsg-danger-copy{ margin:0 0 11px; color:var(--aumsg-muted); font:600 11px/1.45 var(--aumsg-font); }

/* Menus, lightbox, and transient notices --------------------------------- */
.aumsg-menu{
  position:absolute;
  top:54px;
  right:10px;
  z-index:2;
  width:210px;
  padding:6px;
  border:1px solid var(--aumsg-line);
  border-radius:13px;
  background:var(--aumsg-bg);
  box-shadow:var(--aumsg-shadow-soft);
}
.aumsg-menu-item{
  width:100%;
  min-height:39px;
  display:flex;
  align-items:center;
  gap:9px;
  padding:8px 9px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--aumsg-ink);
  font:700 12px/1.2 var(--aumsg-font);
  text-align:left;
  cursor:pointer;
}
.aumsg-menu-item:hover{ background:var(--aumsg-bg-hover); }
.aumsg-menu-item.aumsg-is-danger{ color:var(--aumsg-danger); }
.aumsg-menu-item.aumsg-is-danger:hover{ background:var(--aumsg-danger-soft); }

.aumsg-lightbox{
  position:fixed;
  inset:0;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(5,7,4,.88);
  pointer-events:auto;
}
.aumsg-lightbox-img{ display:block; max-width:min(1100px,94vw); max-height:90dvh; object-fit:contain; border-radius:10px; box-shadow:0 24px 70px rgba(0,0,0,.65); }
.aumsg-lightbox-close{ position:absolute; top:calc(12px + env(safe-area-inset-top,0px)); right:calc(12px + env(safe-area-inset-right,0px)); background:rgba(255,255,255,.13); color:#fff; }

.aumsg-toast-stack{
  position:fixed;
  right:calc(18px + env(safe-area-inset-right,0px));
  bottom:calc(92px + var(--aumsg-lift,0px) + env(safe-area-inset-bottom,0px));
  width:min(340px,calc(100vw - 28px));
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:7px;
  pointer-events:none;
}
.aumsg-root.aumsg-is-open .aumsg-toast-stack{ bottom:calc(18px + env(safe-area-inset-bottom,0px)); }
.aumsg-toast{
  display:flex;
  align-items:center;
  gap:9px;
  min-height:49px;
  padding:8px 10px;
  border:1px solid var(--aumsg-line);
  border-radius:13px;
  background:var(--aumsg-bg);
  color:var(--aumsg-ink);
  box-shadow:var(--aumsg-shadow-soft);
  pointer-events:auto;
  animation:aumsg-toast-in .2s ease-out both;
}
.aumsg-toast.aumsg-is-error{ border-color:color-mix(in srgb,var(--aumsg-danger) 35%,var(--aumsg-line)); }
.aumsg-toast-avatar{ width:34px; height:34px; font-size:10px; }
.aumsg-toast-copy{ min-width:0; flex:1; }
.aumsg-toast-title{ display:block; overflow:hidden; color:var(--aumsg-ink); font:800 11.5px/1.25 var(--aumsg-font); text-overflow:ellipsis; white-space:nowrap; }
.aumsg-toast-message{ display:block; margin-top:2px; overflow:hidden; color:var(--aumsg-muted); font:600 10.5px/1.25 var(--aumsg-font); text-overflow:ellipsis; white-space:nowrap; }

/* Focus, animation, and platform adaptations ----------------------------- */
.aumsg-launcher:focus-visible,
.aumsg-icon-btn:focus-visible,
.aumsg-primary-btn:focus-visible,
.aumsg-secondary-btn:focus-visible,
.aumsg-danger-btn:focus-visible,
.aumsg-filter:focus-visible,
.aumsg-inbox-item:focus-visible,
.aumsg-person-item:focus-visible,
.aumsg-member-item:focus-visible,
.aumsg-compose-fab:focus-visible,
.aumsg-send-btn:focus-visible,
.aumsg-photo-button:focus-visible,
.aumsg-reaction:focus-visible,
.aumsg-reaction-option:focus-visible,
.aumsg-chip-remove:focus-visible,
.aumsg-menu-item:focus-visible{
  outline:3px solid color-mix(in srgb,var(--aumsg-accent) 70%,#fff);
  outline-offset:2px;
}

@keyframes aumsg-pulse{
  0%{ opacity:.7; transform:scale(.9); }
  70%,100%{ opacity:0; transform:scale(1.22); }
}
@keyframes aumsg-shimmer{ from{ background-position:200% 0; } to{ background-position:-20% 0; } }
@keyframes aumsg-typing{ 0%,60%,100%{ opacity:.38; transform:translateY(0); } 30%{ opacity:1; transform:translateY(-3px); } }
@keyframes aumsg-toast-in{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }

@media (hover:none){
  .aumsg-launcher:hover,
  .aumsg-compose-fab:hover{ transform:none; filter:none; }
  .aumsg-reaction-option:hover{ transform:none; }
}

@media (max-width:640px){
  .aumsg-root.aumsg-is-open{ pointer-events:auto; }
  .aumsg-root.aumsg-is-open .aumsg-scrim{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transition-delay:0s;
  }
  .aumsg-root.aumsg-is-open .aumsg-launcher{ opacity:0; visibility:hidden; pointer-events:none; }
  .aumsg-panel{
    inset:0;
    width:100vw;
    max-width:none;
    height:100dvh;
    min-height:0;
    border:0;
    border-radius:0;
    transform:translateY(24px);
    transform-origin:bottom center;
  }
  .aumsg-header{ min-height:calc(58px + env(safe-area-inset-top,0px)); padding-top:calc(8px + env(safe-area-inset-top,0px)); }
  .aumsg-title{ font-size:16px; }
  .aumsg-search,
  .aumsg-input,
  .aumsg-textarea,
  .aumsg-composer-input{ font-size:16px; }
  .aumsg-messages{ padding-inline:9px; }
  .aumsg-message-row{ max-width:91%; }
  .aumsg-toast-stack{ right:10px; bottom:calc(84px + env(safe-area-inset-bottom,0px)); width:calc(100vw - 20px); }
  .aumsg-root.aumsg-is-open .aumsg-toast-stack{ bottom:calc(10px + env(safe-area-inset-bottom,0px)); }
  .aumsg-lightbox{ padding:12px; }
  .aumsg-lightbox-img{ max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)); }
}

@media (max-width:360px){
  .aumsg-header{ gap:6px; padding-inline:8px; }
  .aumsg-icon-btn{ width:38px; height:38px; }
  .aumsg-header-actions{ gap:1px; }
  .aumsg-photo-button,
  .aumsg-photo{ max-width:230px; }
}

@media (prefers-reduced-motion:reduce){
  .aumsg-launcher,
  .aumsg-panel,
  .aumsg-scrim,
  .aumsg-view,
  .aumsg-icon-btn,
  .aumsg-primary-btn,
  .aumsg-secondary-btn,
  .aumsg-danger-btn,
  .aumsg-compose-fab,
  .aumsg-send-btn,
  .aumsg-reaction-option{ transition:none; }
  .aumsg-launcher.aumsg-has-unread::after,
  .aumsg-skeleton,
  .aumsg-typing-dot,
  .aumsg-toast{ animation:none; }
  .aumsg-messages{ scroll-behavior:auto; }
}

@media (forced-colors:active){
  .aumsg-launcher,
  .aumsg-primary-btn,
  .aumsg-send-btn,
  .aumsg-unread,
  .aumsg-person-item.aumsg-is-selected .aumsg-check{ border:1px solid ButtonText; }
  .aumsg-inbox-item.aumsg-is-unread{ outline:1px solid Highlight; }
}

@media print{
  .aumsg-root{ display:none !important; }
}


/* ═══ voice notes + project share (2026-09-01) ═══════════════════════════ */
.aumsg-voice-btn,.aumsg-share-btn{ width:40px; height:40px; color:var(--aumsg-accent-strong); }
.aumsg-rec-strip{
  display:flex;align-items:center;gap:10px;
  padding:10px 12px;border-radius:14px;
  background:color-mix(in srgb,var(--aumsg-accent) 10%,var(--aumsg-bg-soft,var(--aumsg-bg)));
  border:1px solid color-mix(in srgb,var(--aumsg-accent) 30%,transparent);
}
.aumsg-rec-dot{width:10px;height:10px;border-radius:50%;background:#d6453f;animation:aumsg-pulse 1.2s ease-out infinite}
.aumsg-rec-time{font-variant-numeric:tabular-nums;font-weight:800;font-size:13px}
.aumsg-rec-hint{flex:1;font-size:12px;color:var(--aumsg-muted)}
.aumsg-rec-cancel{border:0;background:none;color:var(--aumsg-muted);font:inherit;font-size:12.5px;font-weight:700;cursor:pointer;padding:6px 8px}
.aumsg-rec-stop{width:36px;height:36px;border-radius:50%;border:0;cursor:pointer;display:flex;align-items:center;justify-content:center;
  background:var(--aumsg-accent);color:#fff}
.aumsg-rec-stop svg{width:16px;height:16px}

.aumsg-voice{display:flex;align-items:center;gap:8px;max-width:240px}
.aumsg-voice audio{width:200px;height:36px}
.aumsg-voice-dur{font-size:11px;color:var(--aumsg-muted);font-variant-numeric:tabular-nums}
.aumsg-voice-preview{width:180px;height:32px;margin-top:4px}

.aumsg-projcard{
  display:flex;align-items:center;gap:10px;min-width:200px;max-width:260px;
  padding:10px 12px;border-radius:12px;text-decoration:none;color:inherit;
  background:color-mix(in srgb,var(--aumsg-accent) 8%,var(--aumsg-bg));
  border:1px solid color-mix(in srgb,var(--aumsg-accent) 26%,transparent);
}
.aumsg-projcard:hover{background:color-mix(in srgb,var(--aumsg-accent) 14%,var(--aumsg-bg))}
.aumsg-projcard-copy{min-width:0;display:flex;flex-direction:column;gap:1px}
.aumsg-projcard-name{font-weight:800;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.aumsg-projcard-mod{font-size:11px;color:var(--aumsg-muted);text-transform:capitalize}
.aumsg-share-ic{width:34px;height:34px;flex:none;border-radius:10px;display:flex;align-items:center;justify-content:center;
  background:color-mix(in srgb,var(--aumsg-accent) 16%,transparent);color:var(--aumsg-accent)}
.aumsg-share-ic svg{width:17px;height:17px}

.aumsg-share-pick{display:flex;flex-direction:column;gap:4px;width:100%;max-height:240px;overflow-y:auto}
.aumsg-share-title{font-size:11px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--aumsg-muted);padding:2px 4px}
.aumsg-share-row{display:flex;align-items:center;gap:9px;padding:8px 9px;border-radius:10px;border:0;background:none;cursor:pointer;
  font:inherit;color:inherit;text-align:left;width:100%}
.aumsg-share-row:hover{background:color-mix(in srgb,var(--aumsg-accent) 10%,transparent)}
.aumsg-share-name{flex:1;min-width:0;font-weight:700;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.aumsg-share-mod{font-size:10.5px;color:var(--aumsg-muted);text-transform:capitalize}
.aumsg-share-cancel{border:0;background:none;color:var(--aumsg-muted);font:inherit;font-size:12px;font-weight:700;cursor:pointer;padding:7px;align-self:flex-end}

/* ═══ Meta-Messenger pass (2026-09-01) — composer, bubbles, mini profile ══ */
.aumsg-composer-row{ display:flex; align-items:flex-end; gap:7px; flex:1; min-width:0; }
.aumsg-cbtn{
  width:36px; height:36px; flex:none; border:0; border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  background:transparent; color:var(--aumsg-accent-strong);
}
.aumsg-cbtn svg{ width:21px; height:21px; }
.aumsg-cbtn:hover{ background:var(--aumsg-accent-soft); }
.aumsg-composer-input{
  position:relative; display:flex; align-items:center;
  max-height:120px; padding:0; overflow:hidden; border-radius:19px;
}
.aumsg-composer-input:focus-within{
  border-color:var(--aumsg-accent); background:var(--aumsg-bg);
  box-shadow:0 0 0 3px var(--aumsg-accent-soft);
}
.aumsg-composer-input .aumsg-textarea{
  height:40px; min-height:40px; max-height:120px;
  overflow-y:hidden; resize:none;
  border:0; background:transparent; padding:9px 34px 9px 13px;
}
.aumsg-emoji-btn{
  position:absolute; right:5px; bottom:5px; width:30px; height:30px; border:0; border-radius:50%;
  background:transparent; color:var(--aumsg-accent-strong); cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.aumsg-emoji-btn svg{ width:19px; height:19px; }
.aumsg-send-btn{ background:transparent; color:var(--aumsg-accent-strong); }
.aumsg-send-btn svg{ width:22px; height:22px; }
.aumsg-send-btn:hover{ filter:none; background:var(--aumsg-accent-soft); }
.aumsg-emoji-pop{
  position:absolute; right:12px; bottom:64px; z-index:5; display:flex; flex-wrap:wrap; gap:2px;
  width:212px; padding:8px; border-radius:14px;
  background:var(--aumsg-bg); border:1px solid var(--aumsg-line); box-shadow:var(--aumsg-shadow-soft);
}
.aumsg-emoji-opt{ width:32px; height:32px; border:0; background:transparent; border-radius:8px; font-size:19px; cursor:pointer; }
.aumsg-emoji-opt:hover{ background:var(--aumsg-accent-soft); }

/* mini profile in the thread header */
.aumsg-head-ava{ width:34px; height:34px; flex:none; border-radius:50%; overflow:hidden; }
.aumsg-head-ava img{ width:100%; height:100%; object-fit:cover; display:block; }
.aumsg-head-ava .aumsg-avatar, .aumsg-head-ava-fallback{ width:34px; height:34px; font-size:13px; }

/* bubbles: Messenger geometry — mine warm, theirs deep, tight grouping */
.aumsg-bubble{ border:0; border-radius:18px 18px 18px 6px; font-weight:500; }
.aumsg-message-row.aumsg-is-mine .aumsg-bubble{ border-radius:18px 18px 6px 18px; }
.aumsg-root.aumsg-theme-dark .aumsg-bubble,
html[data-theme="dark"] .aumsg-root .aumsg-bubble{ background:#2e3526; color:#f0f2e6; }
.aumsg-root.aumsg-theme-dark .aumsg-message-row.aumsg-is-mine .aumsg-bubble,
html[data-theme="dark"] .aumsg-root .aumsg-message-row.aumsg-is-mine .aumsg-bubble{ background:#e5d5a9; color:#26290f; }
.aumsg-message-row{ margin-top:2px; }

/* ═══ glass + motion + compact pass (2026-09-01) ═════════════════════════ */
/* the panel pops from the launcher with a soft spring and frosted glass */
.aumsg-panel{
  background:color-mix(in srgb, var(--aumsg-bg) 84%, transparent);
  -webkit-backdrop-filter:blur(18px) saturate(1.25); backdrop-filter:blur(18px) saturate(1.25);
  transform:translateY(14px) scale(.92);
  transition:opacity .2s ease, transform .32s cubic-bezier(.34,1.45,.5,1), visibility 0s linear .2s;
}
.aumsg-header{ background:color-mix(in srgb, var(--aumsg-bg) 55%, transparent);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); }
.aumsg-composer{ background:color-mix(in srgb, var(--aumsg-bg) 62%, transparent);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); }
/* launcher: alive to the touch, morphs while the panel is open */
.aumsg-launcher{ transition:transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s ease, background .22s ease; }
.aumsg-launcher:active{ transform:scale(.88); }
.aumsg-root.aumsg-is-open .aumsg-launcher{ transform:scale(.92); box-shadow:0 4px 14px rgba(0,0,0,.28); }

/* compact professional header */
.aumsg-header{ min-height:0; padding:8px 10px; gap:8px; }
.aumsg-title{ font-size:13.5px; font-weight:700; letter-spacing:-.1px; }
.aumsg-subtitle{ font-size:10.5px; }
.aumsg-icon-btn{ width:30px; height:30px; border-radius:50%; }
.aumsg-icon-btn svg{ width:16px; height:16px; }
.aumsg-head-ava, .aumsg-head-ava .aumsg-avatar, .aumsg-head-ava-fallback{ width:30px; height:30px; font-size:12px; }

/* photo avatars */
.aumsg-ava-img{ display:inline-flex; border-radius:50%; overflow:hidden; }
.aumsg-ava-img img{ width:100%; height:100%; object-fit:cover; display:block; }

/* quoted reply inside a bubble */
.aumsg-quote{
  display:flex; flex-direction:column; gap:1px; text-align:left; cursor:pointer;
  border:0; border-left:3px solid var(--aumsg-accent); border-radius:8px;
  padding:5px 9px; margin:-2px -3px 6px;
  background:color-mix(in srgb, currentColor 8%, transparent);
  color:inherit; font:inherit; opacity:.86; max-width:100%;
}
.aumsg-quote b{ font-size:10.5px; font-weight:800; }
.aumsg-quote span{ font-size:11.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:220px; }
.aumsg-flash .aumsg-bubble{ box-shadow:0 0 0 2px var(--aumsg-accent); transition:box-shadow .3s; }

/* reply chip above the composer */
.aumsg-replychip{
  display:flex; align-items:center; gap:9px; padding:7px 10px 0;
}
.aumsg-replychip-bar{ width:3px; align-self:stretch; border-radius:2px; background:var(--aumsg-accent); }
.aumsg-replychip-copy{ flex:1; min-width:0; display:flex; flex-direction:column; }
.aumsg-replychip-copy b{ font-size:11px; }
.aumsg-replychip-copy span{ font-size:11px; color:var(--aumsg-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.aumsg-replychip-x{ width:26px; height:26px; border:0; border-radius:50%; background:transparent; color:var(--aumsg-muted); cursor:pointer; }
.aumsg-replychip-x svg{ width:13px; height:13px; }
/* the reply action inside the reaction row */
.aumsg-reply-opt svg{ width:15px; height:15px; }

@media (prefers-reduced-motion:reduce){
  .aumsg-panel{ transition:opacity .15s ease, visibility 0s linear .15s; transform:none; }
  .aumsg-launcher, .aumsg-launcher:active, .aumsg-root.aumsg-is-open .aumsg-launcher{ transition:none; transform:none; }
}

/* ═══ pending-attachment card, cleaned up (2026-09-01) ═══════════════════
   What the owner screenshotted was the preview strip with inherited-nothing
   buttons floating at the viewport edge. This makes it a single quiet card:
   thumb / mic badge · name + size · one circular remove control. */
.aumsg-attachment-preview{
  display:flex; align-items:center; gap:10px;
  margin:8px 10px 0; padding:8px 10px;
  border-radius:14px;
  background:color-mix(in srgb, var(--aumsg-accent) 7%, var(--aumsg-bg));
  border:1px solid color-mix(in srgb, var(--aumsg-accent) 22%, transparent);
}
.aumsg-attachment-preview.aumsg-hidden{ display:none; }
.aumsg-attachment-thumb{
  width:44px; height:44px; flex:none; border-radius:10px; object-fit:cover;
  background:var(--aumsg-bg-soft); border:1px solid var(--aumsg-line);
}
.aumsg-attachment-copy{ flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.aumsg-attachment-name{
  font-size:12.5px; font-weight:700; color:var(--aumsg-ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.aumsg-attachment-size{ font-size:11px; color:var(--aumsg-muted); }
.aumsg-attachment-remove{
  width:30px; height:30px; flex:none; border:0; border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  background:color-mix(in srgb, var(--aumsg-ink) 8%, transparent);
  color:var(--aumsg-muted);
  transition:background .15s ease, color .15s ease;
}
.aumsg-attachment-remove:hover{ background:var(--aumsg-danger-soft); color:var(--aumsg-danger); }
.aumsg-attachment-remove svg{ width:14px; height:14px; }
.aumsg-voice-preview{ width:200px; height:32px; margin-top:2px; }

/* the share picker inherits the same card language */
.aumsg-share-pick{ padding:2px; }
.aumsg-share-cancel{ align-self:flex-end; padding:8px 10px; border-radius:9px; }
.aumsg-share-cancel:hover{ background:color-mix(in srgb, var(--aumsg-ink) 7%, transparent); }

/* recording strip aligns with the card language too */
.aumsg-rec-strip{ margin:8px 10px 0; }

/* while a send is in flight the composer quiets down instead of jumping */
.aumsg-composer[data-busy="1"] .aumsg-cbtn,
.aumsg-composer[data-busy="1"] .aumsg-send-btn{ opacity:.45; pointer-events:none; }

/* the composer stacks reply chip / attachment card / input row vertically —
   it was still a flex ROW from the original single-line design, which made
   the stacked cards shrink to content width (2026-09-01) */
.aumsg-composer{ flex-direction:column; align-items:stretch; }
.aumsg-composer-row{ width:100%; }
.aumsg-replychip{ width:100%; }

/* ═══ corner lanes (2026-09-01) ═══════════════════════════════════════════
   The bottom-right corner already belongs to page controls on some screens:
   the construction "+" command FAB (.au-fab) and the Owner/Head "⚙ Configure"
   button (.aucfg-btn — mounted hidden, shown with an inline
   display:inline-flex only for Heads; the selector keys on exactly that
   write, see AU.mode.refreshButton in au-config.js). Both out-stack the
   launcher (z 99990 vs 9600), which is why the messenger seemed to be
   missing on construction — it was underneath the FAB. When either control
   is present, the launcher takes the lane directly above it. */
body:has(.au-fab) .aumsg-launcher,
body:has(.aucfg-btn[style*="inline-flex"]) .aumsg-launcher{
  bottom:calc(88px + env(safe-area-inset-bottom,0px));
}
@media (min-width:641px){
  body:has(.au-fab) .aumsg-panel,
  body:has(.aucfg-btn[style*="inline-flex"]) .aumsg-panel{
    bottom:calc(158px + env(safe-area-inset-bottom,0px));
    height:min(650px,calc(100dvh - 182px - env(safe-area-inset-top,0px)));
  }
}

/* ══ AU ONE OBJECT CARDS ═══════════════════════════════════════════════════
   A live window onto a record that lives in its own module — compact, quiet,
   and the same shape whatever the object is. Tone is the module's own status,
   never a Messenger opinion. */
.aumsg-obj{
  border:1px solid var(--aumsg-line);
  border-radius:var(--aumsg-radius-sm);
  background:var(--aumsg-bg);
  padding:11px 12px 10px;
  margin:0 0 6px;
  max-width:min(310px,78vw);
  display:flex; flex-direction:column; gap:3px;
}
.aumsg-obj-head{display:flex;align-items:center;gap:7px;margin-bottom:1px}
.aumsg-obj-ic{flex:none;width:16px;height:16px;color:var(--aumsg-muted);display:inline-flex}
.aumsg-obj-ic svg{width:16px;height:16px}
.aumsg-obj-kind{font-size:10px;font-weight:800;letter-spacing:.07em;text-transform:uppercase;color:var(--aumsg-muted);flex:1;min-width:0}
.aumsg-obj-status{font-size:10px;font-weight:800;letter-spacing:.03em;text-transform:uppercase;border-radius:999px;padding:2px 7px;white-space:nowrap}
.aumsg-obj-status.aumsg-tone-ok{background:color-mix(in srgb,var(--aumsg-ok) 16%,transparent);color:var(--aumsg-ok)}
.aumsg-obj-status.aumsg-tone-warn{background:color-mix(in srgb,#e08b2f 18%,transparent);color:#b06a16}
.aumsg-obj-status.aumsg-tone-bad{background:color-mix(in srgb,#e05c5c 16%,transparent);color:#c63f3f}
.aumsg-obj-status.aumsg-tone-neutral{background:var(--aumsg-bg-soft);color:var(--aumsg-muted)}
.aumsg-obj-title{font-size:14px;font-weight:750;line-height:1.25;letter-spacing:-.01em;color:var(--aumsg-ink)}
.aumsg-obj-sub{font-size:12px;color:var(--aumsg-ink-soft);line-height:1.35;overflow-wrap:anywhere}
.aumsg-obj-amt{font-size:16px;font-weight:800;letter-spacing:-.02em;margin-top:2px;font-variant-numeric:tabular-nums}
.aumsg-obj-meta,.aumsg-obj-by{font-size:11.5px;color:var(--aumsg-muted)}
.aumsg-obj-note{font-size:12px;color:var(--aumsg-ink-soft);font-style:italic;margin-top:2px;overflow-wrap:anywhere}
.aumsg-obj-note-sm{font-size:11px;color:var(--aumsg-muted);align-self:center}
.aumsg-obj-acts{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
/* ── a card's full details + attachments (2026-09-04) ─────────────────────
   Every input the requester typed, two per row, and each attached file with
   its thumbnail — so a decision can be made from the thread itself. */
.aumsg-obj-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 10px;margin-top:10px;padding-top:9px;border-top:1px solid var(--aumsg-line,rgba(0,0,0,.09))}
.aumsg-obj-row{min-width:0}
.aumsg-obj-row.wide{grid-column:1/-1}
.aumsg-obj-row span{display:block;font-size:9.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--aumsg-ink-soft,#6b7280);margin-bottom:1px}
.aumsg-obj-row b{display:block;font-size:12.5px;font-weight:600;line-height:1.35;overflow-wrap:anywhere;white-space:pre-wrap}
.aumsg-obj-files{display:flex;flex-direction:column;gap:7px;margin-top:10px}
.aumsg-obj-file{display:flex;align-items:center;gap:9px;padding:7px;border:1px solid var(--aumsg-line,rgba(0,0,0,.1));border-radius:10px;background:var(--aumsg-paper,rgba(255,255,255,.55));text-decoration:none;color:inherit;min-width:0;cursor:zoom-in}
.aumsg-obj-file.is-img{flex-direction:column;align-items:stretch}
.aumsg-obj-file img{display:block;width:100%;max-height:240px;object-fit:contain;border-radius:7px;background:#fff}
.aumsg-obj-file img:not([src]){min-height:90px;background:var(--aumsg-line,rgba(0,0,0,.06))}
.aumsg-obj-fileic{flex:none;width:28px;height:28px;display:flex;align-items:center;justify-content:center;color:var(--aumsg-ink-soft,#6b7280)}
.aumsg-obj-filename{font-size:11.5px;font-weight:600;overflow-wrap:anywhere}
/* 44px touch targets, and they wrap rather than overflow on a phone */
.aumsg-obj-btn{
  flex:1 1 auto; min-width:96px; min-height:38px;
  display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--aumsg-line); border-radius:10px;
  background:var(--aumsg-bg-soft); color:var(--aumsg-ink);
  font:inherit;font-size:12.5px;font-weight:700;text-decoration:none;
  padding:0 12px;cursor:pointer;transition:background .14s ease,border-color .14s ease,transform .1s ease;
}
.aumsg-obj-btn:hover{background:var(--aumsg-bg-hover)}
.aumsg-obj-btn:active{transform:translateY(1px)}
.aumsg-obj-btn.aumsg-obj-ok{border-color:var(--aumsg-ok);color:var(--aumsg-ok)}
.aumsg-obj-btn.aumsg-obj-bad{border-color:#e05c5c;color:#c63f3f}
.aumsg-obj-working{font-size:12px;font-weight:700;color:var(--aumsg-muted);padding:9px 2px}
.aumsg-obj-locked{background:var(--aumsg-bg-soft);border-style:dashed;flex-direction:row;align-items:flex-start;gap:9px}
.aumsg-obj-locked .aumsg-obj-copy{display:flex;flex-direction:column;gap:2px;min-width:0}
.aumsg-obj-skel{display:block;height:56px;border-radius:8px;background:linear-gradient(90deg,var(--aumsg-bg-soft),var(--aumsg-bg-hover),var(--aumsg-bg-soft));background-size:200% 100%;animation:aumsg-shimmer 1.2s linear infinite}
@keyframes aumsg-shimmer{to{background-position:-200% 0}}
.aumsg-obj.aumsg-is-loading{padding:0;border-color:transparent;background:transparent}
@media (max-width:560px){
  .aumsg-obj{max-width:84vw}
  .aumsg-obj-btn{flex:1 1 100%;min-height:44px}
}

/* ═══ bottom-navigation lanes (2026-09-02, mobile audit) ══════════════════
   Measured live at 390×844: the launcher (bottom:18px) sat directly on the
   page-owned bottom tab bars — Home/Profile's <nav class="tabs"> (Profile tab
   hidden under it, 58×53px intersection) and Design's #tabbar. Same idea as
   the FAB lane above: when a page carries a bottom bar, the launcher takes
   the lane above it. The bar selectors are the only ones those pages use for
   a FIXED bottom nav (tab strips elsewhere are <div class="tabs">, not nav). */
@media (max-width:768px){
  body:has(nav.tabs) .aumsg-launcher,
  body:has(#tabbar) .aumsg-launcher{
    bottom:calc(84px + var(--aumsg-lift,0px) + env(safe-area-inset-bottom,0px));
  }
}
@media (max-width:768px){
  /* …and when the Head's Configure pill is ALSO parked above that bar
     (au-shell.css lifts it to 84px), the launcher climbs one more lane. */
  body:has(nav.tabs):has(.aucfg-btn[style*="inline-flex"]) .aumsg-launcher,
  body:has(#tabbar):has(.aucfg-btn[style*="inline-flex"]) .aumsg-launcher{
    bottom:calc(144px + var(--aumsg-lift,0px) + env(safe-area-inset-bottom,0px));
  }
}

/* ═══ last-content clearance (2026-09-02, mobile audit) ═══════════════════
   Scrolled to the end, the launcher (and the Head's Configure pill) covered
   the final row on workers, worker_evaluation, approvals ("View all"),
   legal, the incentive footer and the profile card. Every page that hosts
   the launcher gets a spacer after its content so the last line can scroll
   above the fixed chrome. A pseudo-element, so no page markup changes, and
   it only exists where the launcher does. */
@media (max-width:768px){
  body:has(.aumsg-launcher)::after{
    content:""; display:block; pointer-events:none;
    height:calc(96px + env(safe-area-inset-bottom,0px));
  }
  body:has(.aumsg-launcher):has(.aucfg-btn[style*="inline-flex"])::after{
    height:calc(124px + env(safe-area-inset-bottom,0px));
  }
}
@media print{ body:has(.aumsg-launcher)::after{ display:none; } }

/* Conversation dock: one shared transport, independently collapsible windows. */
.aumsg-chat-heads{position:fixed;right:calc(22px + env(safe-area-inset-right,0px));bottom:calc(92px + var(--aumsg-lift,0px) + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:12px;max-height:55dvh;overflow:visible;pointer-events:auto}
.aumsg-chat-heads[hidden],.aumsg-chat-popup[hidden]{display:none!important}
.aumsg-chat-head{position:relative;display:grid;place-items:center;width:50px;height:50px;padding:0;border:2px solid var(--aumsg-line-strong);border-radius:50%;background:var(--aumsg-bg);box-shadow:var(--aumsg-shadow-soft);cursor:pointer;transition:transform .16s ease,border-color .16s ease}
.aumsg-chat-head:hover{transform:translateX(-3px);border-color:var(--aumsg-accent)}
.aumsg-chat-head .aumsg-avatar{width:44px;height:44px;font-size:14px}
.aumsg-head-count{position:absolute;top:-6px;right:-6px;min-width:20px;height:20px;padding:0 4px;display:grid;place-items:center;border:2px solid var(--aumsg-bg);border-radius:20px;background:var(--aumsg-danger);color:#fff;font-size:10px;font-weight:800}
.aumsg-chat-dock{position:fixed;right:calc(90px + env(safe-area-inset-right,0px));bottom:calc(24px + var(--aumsg-lift,0px) + env(safe-area-inset-bottom,0px));display:flex;flex-direction:row-reverse;align-items:flex-end;gap:12px;pointer-events:none}
.aumsg-is-open .aumsg-chat-dock{right:calc(492px + env(safe-area-inset-right,0px))}
.aumsg-chat-popup{display:flex;flex-direction:column;width:318px;height:min(500px,calc(100dvh - 120px));min-height:260px;overflow:hidden;border:1px solid var(--aumsg-line-strong);border-radius:16px;background:var(--aumsg-bg);box-shadow:var(--aumsg-shadow);pointer-events:auto}
.aumsg-popup-header{display:flex;align-items:center;gap:5px;padding:12px 8px 12px 12px;background:var(--aumsg-bg);border-bottom:1px solid var(--aumsg-line)}
.aumsg-popup-header .aumsg-avatar{width:32px;height:32px;flex-shrink:0;font-size:11px}
.aumsg-popup-header .aumsg-icon-btn{width:30px;height:32px;flex:0 0 30px;font-size:22px}
.aumsg-popup-title{min-width:0;flex:1;border:0;background:none;padding:5px 2px;text-align:left;color:var(--aumsg-ink);font:700 13px/1.3 var(--aumsg-font);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer}
.aumsg-popup-title:hover{color:var(--aumsg-accent)}
.aumsg-popup-history{flex-shrink:0;margin:10px 12px 0;font-size:11px!important;min-height:30px!important}
.aumsg-popup-private{flex-shrink:0;display:flex;align-items:center;gap:6px;margin:8px 12px 0;padding:7px 10px;border:1px solid color-mix(in srgb,var(--aumsg-accent) 30%,transparent);border-radius:10px;background:color-mix(in srgb,var(--aumsg-accent) 10%,var(--aumsg-bg));color:var(--aumsg-ink);font:600 11.5px/1.3 var(--aumsg-font);text-align:left;cursor:pointer}
.aumsg-popup-private b{margin-left:auto;padding:4px 9px;border-radius:7px;background:var(--aumsg-accent);color:#fff;font-weight:800}
.aumsg-popup-private:hover{border-color:var(--aumsg-accent)}
.aumsg-popup-messages{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px 12px;scrollbar-width:thin;scrollbar-color:var(--aumsg-line-strong) transparent}
.aumsg-mini-message{display:flex;align-items:flex-start;flex-direction:column;gap:4px;margin:0 26px 14px 0;font-size:13px}
.aumsg-mini-message>small{color:var(--aumsg-muted);font-size:10px;line-height:1.3;margin:0 6px}
.aumsg-mini-message.aumsg-is-mine{align-items:flex-end;margin:0 0 14px 26px}
.aumsg-mini-bubble{max-width:100%;padding:10px 12px;border-radius:15px 15px 15px 4px;background:var(--aumsg-bg-hover);white-space:pre-wrap;overflow-wrap:anywhere;color:var(--aumsg-ink)}
.aumsg-is-mine .aumsg-mini-bubble{border-radius:15px 15px 4px 15px;background:var(--aumsg-accent);color:var(--aumsg-on-accent)}
.aumsg-mini-receipt{font-weight:500}
.aumsg-popup-compose{display:flex;align-items:flex-end;gap:8px;padding:12px;border-top:1px solid var(--aumsg-line)}
.aumsg-popup-compose textarea{width:100%;min-width:0;min-height:40px;max-height:88px;resize:vertical;padding:10px 12px;border:1px solid var(--aumsg-line);border-radius:18px;background:var(--aumsg-bg-soft);color:var(--aumsg-ink);font:13px/1.4 var(--aumsg-font)}
.aumsg-popup-compose .aumsg-icon-btn{flex:0 0 34px;height:40px;color:var(--aumsg-accent)}
.aumsg-popup-error{padding:0 12px 8px;color:var(--aumsg-danger);font-size:11px}
.aumsg-popup-error:empty{display:none}
.aumsg-popup-image{display:block;padding:0;margin:0 0 6px;border:0;background:none;cursor:zoom-in;max-width:100%}
.aumsg-popup-image img{display:block;max-width:100%;max-height:200px;object-fit:contain;border-radius:10px}
.aumsg-media-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}
.aumsg-media-item{display:flex;flex-direction:column;align-items:center;gap:7px;min-width:0;min-height:125px;padding:18px 10px;border:1px solid var(--aumsg-line);border-radius:14px;background:var(--aumsg-bg-soft);color:var(--aumsg-ink);cursor:pointer;font:12px/1.4 var(--aumsg-font)}
.aumsg-media-item:hover{border-color:var(--aumsg-accent);background:var(--aumsg-accent-soft)}
.aumsg-media-item>span{display:grid;place-items:center;width:40px;height:40px;color:var(--aumsg-accent)}
.aumsg-media-item svg{width:28px;height:28px}
.aumsg-media-item small{color:var(--aumsg-muted);font-size:10px}
.aumsg-media-item.aumsg-has-thumb{padding:0 0 10px;overflow:hidden}
.aumsg-media-thumb{display:block;width:100%;height:96px;object-fit:cover;border-bottom:1px solid var(--aumsg-line);background:var(--aumsg-bg-hover)}
.aumsg-chat-head:focus-visible,.aumsg-popup-title:focus-visible,.aumsg-media-item:focus-visible,.aumsg-popup-compose textarea:focus-visible{outline:2px solid var(--aumsg-accent);outline-offset:3px}
@media(min-width:820px){.aumsg-panel{right:calc(90px + env(safe-area-inset-right,0px))}}
@media(max-width:819px){
  .aumsg-chat-dock{display:none}
  .aumsg-chat-heads{right:20px;gap:9px;max-height:38dvh;overflow-y:auto;overflow-x:hidden;padding:8px}
  .aumsg-is-open .aumsg-chat-heads{display:none}
  .aumsg-chat-head{width:44px;height:44px;flex-shrink:0}
  .aumsg-chat-head .aumsg-avatar{width:38px;height:38px}
  body:has(nav.tabs) .aumsg-chat-heads,body:has(#tabbar) .aumsg-chat-heads{bottom:160px}
}
body:has(.au-fab) .aumsg-chat-heads,body:has(.aucfg-btn[style*="inline-flex"]) .aumsg-chat-heads{bottom:calc(166px + var(--aumsg-lift,0px) + env(safe-area-inset-bottom,0px))}
@media print{.aumsg-chat-heads,.aumsg-chat-dock{display:none!important}}
@media(prefers-reduced-motion:reduce){.aumsg-chat-head{transition:none}}

/* ═══ chat heads: bigger, movable, droppable on ✕ (owner, 2026-09-10) ═════
   On phones the heads sat at 160px while the launcher climbs 84px + the
   safe-area + its own 60px, so on an iPhone the two overlapped (the head
   rode on top of the launcher on Home). The stack now clears the launcher
   with the safe-area counted, heads are 56px, and a press-and-drag moves
   the stack (edge-snapped, remembered per device); while dragging an ✕ zone
   appears at the bottom — drop a head there to hide that person's head. */
.aumsg-chat-heads{ touch-action:none; }
.aumsg-chat-heads.aumsg-heads-dragging{ transition:none; opacity:.92; }
.aumsg-chat-heads.aumsg-heads-dragging .aumsg-chat-head{ transform:scale(1.06); }
.aumsg-chat-heads.aumsg-heads-left .aumsg-chat-head:hover{ transform:translateX(3px); }
.aumsg-head-trash{ position:fixed; left:50%; bottom:calc(18px + env(safe-area-inset-bottom,0px)); transform:translateX(-50%); z-index:1305;
  width:72px; height:72px; border-radius:50%; display:grid; place-items:center; gap:0; background:rgba(20,22,14,.86); color:#fff;
  box-shadow:0 10px 30px rgba(0,0,0,.35); border:2px solid rgba(255,255,255,.35); pointer-events:none; transition:transform .16s ease, background .16s ease; }
.aumsg-head-trash[hidden]{ display:none!important; }
.aumsg-head-trash span{ font-size:26px; line-height:1; font-weight:800; }
.aumsg-head-trash small{ position:absolute; top:calc(100% + 6px); left:50%; transform:translateX(-50%); white-space:nowrap; font-size:11px; font-weight:700; color:#fff; text-shadow:0 1px 3px rgba(0,0,0,.6); }
.aumsg-head-trash.aumsg-is-hot{ background:#b3261e; transform:translateX(-50%) scale(1.18); border-color:#fff; }
/* Phones/tablets use the single Messenger launcher. Saved drag coordinates
   must never keep a stack of faces over Attendance/forms or bottom navigation. */
@media (max-width:819px){
  .aumsg-root .aumsg-chat-heads,.aumsg-root .aumsg-head-trash{display:none!important;pointer-events:none!important}
}
@media (max-width:768px){
  .aumsg-chat-heads{ bottom:calc(168px + var(--aumsg-lift,0px) + env(safe-area-inset-bottom,0px)); gap:10px; }
  body:has(nav.tabs) .aumsg-chat-heads, body:has(#tabbar) .aumsg-chat-heads{ bottom:calc(172px + var(--aumsg-lift,0px) + env(safe-area-inset-bottom,0px)); }
  body:has(nav.tabs):has(.aucfg-btn[style*="inline-flex"]) .aumsg-chat-heads,
  body:has(#tabbar):has(.aucfg-btn[style*="inline-flex"]) .aumsg-chat-heads{ bottom:calc(232px + var(--aumsg-lift,0px) + env(safe-area-inset-bottom,0px)); }
  .aumsg-chat-head{ width:56px; height:56px; }
  .aumsg-chat-head .aumsg-avatar{ width:50px; height:50px; font-size:16px; }
  .aumsg-chat-head .aumsg-head-count{ min-width:20px; height:20px; font-size:11px; }
}
