* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #f0f2f5; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #1a1a1a; min-height: 100vh; }

/* ─── Login Overlay ─────────────────────────── */
#loginOverlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; flex-direction: column; z-index: 1000;
}
#loginOverlay.hidden { display: none; }
.has-token #loginOverlay { display: none; }
#loginForm {
  background: #fff; padding: 32px; border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2); width: 340px;
}
#loginForm h2 { margin-bottom: 20px; font-size: 20px; text-align: center; color: #1e3a5f; }
#loginForm input {
  width: 100%; padding: 10px 12px; margin-bottom: 12px;
  border: 1px solid #d0d5dd; border-radius: 8px; font-size: 14px;
}
#loginForm input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
#loginForm button {
  width: 100%; padding: 10px; background: #2563eb; color: #fff;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
}
#loginForm button:hover { background: #1d4ed8; }
#loginError { color: #dc2626; font-size: 13px; margin-bottom: 8px; display: none; }

/* Login tabs for dual auth (admin vs twin) */
#loginTabs {
  display: flex; gap: 0; margin-bottom: 0; width: 340px;
  border-radius: 12px 12px 0 0; overflow: hidden;
}
.login-tab {
  flex: 1; padding: 10px; border: none; background: #e2e8f0; color: #475569;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.login-tab.active { background: #fff; color: #1e3a5f; }
.login-tab:hover:not(.active) { background: #cbd5e1; }
#loginTabs + #loginForm { border-radius: 0 0 12px 12px; }

#twinFields button { margin-top: 4px; }
#twinFields button:disabled { opacity: .6; cursor: not-allowed; }
#twinStep2 input { letter-spacing: 6px; text-align: center; font-size: 20px; font-weight: 700; }

/* Confirmation message styling in boss chat */
.msg-confirmation {
  border-left: 3px solid #f59e0b; background: #fffbeb; padding: 8px 12px;
  border-radius: 6px; margin: 4px 0;
}
.msg-confirmation .confirm-actions { margin-top: 8px; display: flex; gap: 8px; }
.msg-confirmation .confirm-actions button {
  padding: 4px 14px; border-radius: 6px; border: none; font-size: 12px;
  font-weight: 600; cursor: pointer;
}
.confirm-actions .btn-confirm { background: #10b981; color: #fff; }
.confirm-actions .btn-confirm:hover { background: #059669; }
.confirm-actions .btn-reject { background: #ef4444; color: #fff; }
.confirm-actions .btn-reject:hover { background: #dc2626; }

/* ─── Toolbar ───────────────────────────────── */
#toolbar {
  background: #1e293b; color: #fff; padding: 10px 20px;
  display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 100;
}
#toolbar h1 { font-size: 16px; font-weight: 600; margin-right: auto; }
#toolbar button {
  padding: 6px 14px; border-radius: 6px; border: none;
  font-size: 13px; font-weight: 500; cursor: pointer;
}
#addPanelBtn { background: #2563eb; color: #fff; }
#addPanelBtn:hover { background: #1d4ed8; }
#resetPanelLayoutBtn { background: #334155; color: #fff; }
#resetPanelLayoutBtn:hover { background: #475569; }
#logoutBtn { background: #475569; color: #fff; }
#logoutBtn:hover { background: #64748b; }
#connectionBadge {
  width: 10px; height: 10px; border-radius: 50%;
  background: #ef4444; display: inline-block; margin-left: 4px;
}
#connectionBadge.connected { background: #22c55e; }
#connectionBadge.connecting { background: #eab308; }

/* ─── Company Switcher (God) ─────────────── */
#currentCompanyBadge {
  padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600;
  background: #7c3aed; color: #fff; white-space: nowrap;
}
#companySwitcher { margin-left: 8px; }
#companySelect {
  padding: 5px 10px; border-radius: 6px; border: 1px solid #475569;
  background: #334155; color: #fff; font-size: 13px; cursor: pointer;
  max-width: 250px;
}
#companySelect:focus { outline: none; border-color: #2563eb; }
#toolbar {
  --brand-primary: #2563eb;
  --brand-accent: #4eabf9;
  --brand-warm: #f59e0b;
  --brand-bg: #17212b;
  --brand-text: #e1e3e6;
}
.workspace-brand {
  align-items: center;
  gap: 10px;
  min-width: 180px;
  max-width: 360px;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 55%, transparent);
  border-radius: 12px;
  background:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--brand-warm) 30%, transparent), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 20%, #111827), color-mix(in srgb, var(--brand-accent) 13%, #17212b));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--brand-primary) 16%, transparent);
}
.workspace-brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255,255,255,0.92);
  padding: 3px;
  flex-shrink: 0;
}
.workspace-brand-copy { min-width: 0; }
.workspace-brand-name {
  color: var(--brand-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-brand-tagline {
  color: color-mix(in srgb, var(--brand-text) 74%, transparent);
  font-size: 10px;
  line-height: 1.2;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.workspace-branded #currentCompanyBadge,
body.workspace-branded .mob-company-tab.active {
  background: color-mix(in srgb, var(--brand-primary) 20%, transparent);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
body.workspace-branded #companySelect:focus,
body.workspace-branded .mob-topbar-back {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
body.workspace-branded .mob-topbar,
body.workspace-branded .mob-company-tabs {
  background:
    radial-gradient(circle at 10% 0%, color-mix(in srgb, var(--brand-warm) 20%, transparent), transparent 28%),
    linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 22%, #16161e), color-mix(in srgb, var(--brand-bg) 78%, #0f0f14));
}
body.workspace-branded .dm-desk-contact.active,
body.workspace-branded .dm-desk-send {
  background: var(--brand-primary);
}
body.workspace-branded .dm-desk-search:focus,
body.workspace-branded .dm-desk-textarea:focus {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-accent) 35%, transparent);
}

/* Tenant App Store S0 */
.appstore-panel {
  min-height: 100%;
  padding: 16px;
  color: #e5edf7;
  background:
    radial-gradient(circle at 12% 10%, rgba(14,165,233,0.15), transparent 34%),
    linear-gradient(180deg, rgba(15,23,42,0.96), rgba(30,41,59,0.94));
}
.appstore-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(125,211,252,0.22);
  border-radius: 16px;
  background: rgba(2,6,23,0.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.appstore-eyebrow {
  color: #7dd3fc;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.appstore-title {
  margin-top: 4px;
  color: #f8fafc;
  font-size: 1.15rem;
  font-weight: 800;
}
.appstore-copy {
  margin-top: 5px;
  color: #cbd5e1;
  font-size: 0.82rem;
  line-height: 1.4;
}
.appstore-new-btn {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid rgba(125,211,252,0.35);
  border-radius: 999px;
  color: #e0f2fe;
  background: rgba(14,165,233,0.18);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}
.appstore-new-btn:hover {
  background: rgba(14,165,233,0.28);
}
.appstore-create-shell {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(125,211,252,0.2);
  border-radius: 14px;
  background: rgba(15,23,42,0.68);
}
.appstore-create-shell[hidden] {
  display: none !important;
}
.appstore-create-form {
  display: grid;
  gap: 12px;
}
.appstore-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.appstore-create-form label {
  display: grid;
  gap: 6px;
  color: #bae6fd;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.appstore-create-form input,
.appstore-create-form textarea,
.appstore-create-form select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 10px;
  color: #f8fafc;
  background: rgba(2,6,23,0.72);
  font: 0.84rem/1.35 system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
}
.appstore-create-form textarea {
  resize: vertical;
}
.appstore-create-help {
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}
.appstore-create-form input:focus,
.appstore-create-form textarea:focus,
.appstore-create-form select:focus {
  outline: none;
  border-color: rgba(125,211,252,0.65);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.14);
}
.appstore-create-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.appstore-create-submit,
.appstore-create-cancel {
  padding: 8px 11px;
  border: 1px solid rgba(125,211,252,0.35);
  border-radius: 999px;
  color: #e0f2fe;
  background: rgba(14,165,233,0.18);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}
.appstore-create-cancel {
  color: #cbd5e1;
  border-color: rgba(148,163,184,0.28);
  background: rgba(30,41,59,0.74);
}
.appstore-create-submit:hover:not(:disabled),
.appstore-create-cancel:hover {
  background: rgba(14,165,233,0.3);
}
.appstore-create-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}
.appstore-create-error {
  min-height: 1em;
  color: #fecaca;
  font-size: 0.74rem;
}
@media (max-width: 720px) {
  .appstore-create-grid {
    grid-template-columns: 1fr;
  }
}
.appstore-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.appstore-app-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 14px;
  background: rgba(15,23,42,0.72);
}
.appstore-app-main {
  min-width: 0;
}
.appstore-app-name {
  color: #f8fafc;
  font-weight: 800;
}
.appstore-app-meta {
  margin-top: 3px;
  color: #cbd5e1;
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.appstore-app-source {
  margin-top: 7px;
  color: #93c5fd;
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.appstore-app-source a {
  color: #bae6fd;
  font-weight: 800;
  text-decoration: none;
}
.appstore-app-source a:hover {
  text-decoration: underline;
}
.appstore-app-source.muted {
  color: #94a3b8;
}
.appstore-runtime-note {
  margin-top: 7px;
  color: #bae6fd;
  font-size: 0.72rem;
}
.appstore-runtime-note[hidden] {
  display: none !important;
}
.appstore-runtime-note.error {
  color: #fecaca;
}
.appstore-import-form {
  display: grid;
  gap: 8px;
  margin-top: 11px;
  padding: 11px;
  border: 1px solid rgba(45,212,191,0.22);
  border-radius: 12px;
  background: rgba(2,6,23,0.38);
}
.appstore-import-title {
  color: #ccfbf1;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.appstore-import-form label {
  display: grid;
  gap: 6px;
  color: #bae6fd;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.appstore-import-url {
  min-width: min(360px, 100%);
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 10px;
  color: #f8fafc;
  background: rgba(15,23,42,0.82);
  font: 0.82rem/1.35 system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
}
.appstore-import-url:focus {
  outline: none;
  border-color: rgba(45,212,191,0.65);
  box-shadow: 0 0 0 3px rgba(20,184,166,0.14);
}
.appstore-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.appstore-import-submit,
.appstore-import-upload {
  padding: 7px 10px;
  border: 1px solid rgba(45,212,191,0.38);
  border-radius: 999px;
  color: #ccfbf1;
  background: rgba(20,184,166,0.18);
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
}
.appstore-import-submit:hover:not(:disabled),
.appstore-import-upload:hover:not(:disabled) {
  background: rgba(20,184,166,0.3);
}
.appstore-import-submit:disabled,
.appstore-import-upload:disabled {
  cursor: wait;
  opacity: 0.72;
}
.appstore-import-upload.is-uploading {
  color: #ecfeff;
  border-color: rgba(125,211,252,0.5);
  background: rgba(14,165,233,0.22);
}
.appstore-import-hint {
  color: #94a3b8;
  font-size: 0.7rem;
  line-height: 1.35;
}
/* B532 B5: shown in place of the public-Git-URL import form when APPSTORE_PUBLIC_GIT_IMPORT_ENABLED is
   off. Dark-theme muted notice (slate text on a subtle panel, WCAG AA contrast) telling the user the Git
   path is unavailable while archive upload stays offered below it. */
.appstore-import-disabled-notice {
  color: #cbd5e1;
  font-size: 0.72rem;
  line-height: 1.4;
  padding: 8px 10px;
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 10px;
  background: rgba(15,23,42,0.5);
}
/* B532 B7: company-scope toggle (Current company | All my companies). Segmented pill matching the
   App Store sky accent; active state has a brighter border/fill. WCAG AA: light text on dark fills. */
.appstore-scope-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 2px;
}
.appstore-scope-btn {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid rgba(125,211,252,0.28);
  border-radius: 999px;
  background: rgba(2,6,23,0.35);
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}
.appstore-scope-btn:hover {
  border-color: rgba(125,211,252,0.45);
  color: #e0f2fe;
}
.appstore-scope-btn.active {
  border-color: rgba(56,189,248,0.7);
  background: rgba(14,165,233,0.25);
  color: #f0f9ff;
}
.appstore-import-upload:disabled:not(.is-uploading) {
  cursor: wait;
  color: #94a3b8;
  border-color: rgba(148,163,184,0.2);
  background: rgba(30,41,59,0.5);
}
.appstore-import-message {
  min-height: 1em;
  color: #bae6fd;
  font-size: 0.72rem;
}
.appstore-import-message[hidden] {
  display: none !important;
}
.appstore-import-message.error {
  color: #fecaca;
}

.appstore-connector-panel {
  display: grid;
  gap: 9px;
  margin-top: 11px;
  padding: 12px;
  border: 1px solid rgba(45,212,191,0.28);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(13,148,136,0.13), transparent 52%),
    rgba(2,6,23,0.48);
}
.appstore-connector-platform-label {
  display: grid;
  grid-template-columns: max-content minmax(180px, 1fr);
  gap: 9px;
  align-items: center;
  color: #99f6e4;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.appstore-connector-platform {
  width: min(280px, 100%);
  padding: 7px 28px 7px 9px;
  border: 1px solid rgba(94,234,212,0.38);
  border-radius: 9px;
  color: #ecfeff;
  background: rgba(15,23,42,0.9);
  font: 700 0.76rem/1.3 system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
}
.appstore-connector-platform:focus {
  outline: none;
  border-color: rgba(94,234,212,0.76);
  box-shadow: 0 0 0 3px rgba(20,184,166,0.16);
}
.appstore-connector-platform:disabled {
  cursor: wait;
  opacity: 0.68;
}
.appstore-connector-command {
  display: block;
  max-width: min(760px, 100%);
  padding: 10px 11px;
  overflow-wrap: anywhere;
  border: 1px solid rgba(125,211,252,0.2);
  border-radius: 10px;
  color: #bae6fd;
  background: rgba(15,23,42,0.82);
  font: 0.72rem/1.48 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
}
.appstore-connector-command.error,
.appstore-connector-key-result.error {
  color: #fecaca;
  border-color: rgba(248,113,113,0.34);
}
.appstore-connector-panel .appstore-import-actions a,
.appstore-connector-panel .appstore-import-actions button,
.appstore-connector-key-result button {
  padding: 7px 10px;
  border: 1px solid rgba(45,212,191,0.34);
  border-radius: 999px;
  color: #ccfbf1;
  background: rgba(20,184,166,0.16);
  font-size: 0.7rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.appstore-connector-panel .appstore-import-actions button:disabled {
  cursor: wait;
  opacity: 0.68;
}
.appstore-connector-key-result {
  display: grid;
  gap: 7px;
  color: #bae6fd;
  font-size: 0.72rem;
  line-height: 1.4;
}
.appstore-connector-key-result[hidden] {
  display: none !important;
}
.appstore-connector-key-export {
  width: 100%;
  min-height: 58px;
  padding: 9px;
  resize: vertical;
  border: 1px solid rgba(125,211,252,0.28);
  border-radius: 9px;
  color: #e0f2fe;
  background: rgba(15,23,42,0.9);
  font: 0.72rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.appstore-connector-key-list {
  display: grid;
  gap: 6px;
}
.appstore-connector-key-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid rgba(148,163,184,0.14);
}
.appstore-app-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}
.appstore-status-pill {
  padding: 4px 9px;
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(148,163,184,0.18);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}
.appstore-status-pill.registered { color: #bbf7d0; background: rgba(34,197,94,0.18); }
.appstore-status-pill.running { color: #bae6fd; background: rgba(14,165,233,0.2); }
.appstore-status-pill.failed { color: #fecaca; background: rgba(239,68,68,0.18); }
.appstore-scaffold-btn {
  padding: 6px 10px;
  border: 1px solid rgba(125,211,252,0.35);
  border-radius: 999px;
  color: #e0f2fe;
  background: rgba(14,165,233,0.18);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}
.appstore-scaffold-btn:hover:not(:disabled) {
  background: rgba(14,165,233,0.3);
}
.appstore-share-btn {
  padding: 6px 10px;
  border: 1px solid rgba(196,181,253,0.38);
  border-radius: 999px;
  color: #ede9fe;
  background: rgba(124,58,237,0.18);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}
.appstore-share-btn:hover {
  background: rgba(124,58,237,0.3);
}
.appstore-runtime-start-btn,
.appstore-runtime-stop-btn,
.appstore-runtime-open-btn,
.appstore-runtime-copy-link-btn {
  padding: 6px 10px;
  border: 1px solid rgba(45,212,191,0.38);
  border-radius: 999px;
  color: #ccfbf1;
  background: rgba(20,184,166,0.18);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}
.appstore-runtime-copy-link-btn {
  color: #e2e8f0;
  border-color: rgba(148,163,184,0.42);
  background: rgba(100,116,139,0.18);
}
.appstore-runtime-copy-link-btn:hover {
  background: rgba(100,116,139,0.3);
}
.appstore-runtime-stop-btn {
  color: #fed7aa;
  border-color: rgba(251,146,60,0.42);
  background: rgba(249,115,22,0.18);
}
.appstore-runtime-open-btn {
  color: #dbeafe;
  border-color: rgba(96,165,250,0.42);
  background: rgba(37,99,235,0.18);
}
.appstore-runtime-start-btn:hover:not(:disabled),
.appstore-runtime-stop-btn:hover:not(:disabled),
.appstore-runtime-open-btn:hover {
  background: rgba(20,184,166,0.3);
}
.appstore-runtime-stop-btn:hover:not(:disabled) {
  background: rgba(249,115,22,0.3);
}
.appstore-runtime-open-btn:hover {
  background: rgba(37,99,235,0.3);
}
.appstore-scaffold-btn:disabled {
  cursor: wait;
  opacity: 0.72;
}
.appstore-runtime-start-btn:disabled,
.appstore-runtime-stop-btn:disabled {
  cursor: wait;
  opacity: 0.72;
}
.appstore-scaffold-error {
  margin-top: 6px;
  color: #fecaca;
  font-size: 0.72rem;
}
.appstore-empty {
  padding: 24px;
  border: 1px dashed rgba(148,163,184,0.28);
  border-radius: 14px;
  color: #cbd5e1;
  text-align: center;
  background: rgba(15,23,42,0.5);
}
.appstore-empty.error {
  color: #fecaca;
  border-color: rgba(248,113,113,0.35);
}
.appstore-share-panel {
  width: 100%;
  flex-basis: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(196,181,253,0.24);
  border-radius: 12px;
  color: #ddd6fe;
  background: rgba(30,41,59,0.72);
}
.appstore-share-panel.error {
  color: #fecaca;
  border-color: rgba(248,113,113,0.35);
}
.appstore-share-title {
  margin-bottom: 8px;
  color: #f8fafc;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.appstore-grant-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid rgba(148,163,184,0.14);
  font-size: 0.76rem;
}
.appstore-grant-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.appstore-grant-row strong {
  color: #bae6fd;
  font-size: 0.7rem;
  text-transform: uppercase;
}
.appstore-grant-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.appstore-grant-controls select {
  min-width: 220px;
  flex: 1 1 220px;
  padding: 7px 9px;
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 10px;
  color: #e5edf7;
  background: rgba(15,23,42,0.78);
}
.appstore-grant-add,
.appstore-grant-add-all,
.appstore-grant-revoke {
  padding: 6px 9px;
  border: 1px solid rgba(125,211,252,0.28);
  border-radius: 999px;
  color: #e0f2fe;
  background: rgba(14,165,233,0.16);
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
}
.appstore-grant-revoke {
  color: #fecaca;
  border-color: rgba(248,113,113,0.3);
  background: rgba(127,29,29,0.22);
}
.appstore-grant-empty,
.appstore-grant-note {
  color: #cbd5e1;
  font-size: 0.76rem;
}
.appstore-grant-note.error {
  color: #fecaca;
}

/* App Store 2.0 - Slice 0: in-panel code editor */
.appstore-editor-toggle {
  padding: 6px 10px;
  border: 1px solid rgba(45,212,191,0.38);
  border-radius: 999px;
  background: rgba(45,212,191,0.10);
  color: #5eead4;
  font-size: 0.78rem;
  cursor: pointer;
}
.appstore-editor {
  margin-top: 11px;
  padding: 11px;
  border: 1px solid rgba(45,212,191,0.22);
  border-radius: 12px;
  background: rgba(15,23,42,0.6);
}
.appstore-editor-version {
  font-size: 0.74rem;
  color: #cbd5e1;
  margin-bottom: 8px;
}
.appstore-editor-grid {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 10px;
}
.appstore-editor-sidebar { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.appstore-editor-files {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow: auto;
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 8px;
}
.appstore-editor-files li { margin: 0; }
.appstore-editor-file,
.appstore-editor-dir {
  display: block;
  width: 100%;
  text-align: left;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  font-size: 0.76rem;
  cursor: pointer;
  word-break: break-all;
}
.appstore-editor-file:hover,
.appstore-editor-dir:hover { background: rgba(45,212,191,0.12); }
.appstore-editor-dir { color: #93c5fd; }
.appstore-editor-loading,
.appstore-editor-empty { padding: 6px 8px; color: #94a3b8; font-size: 0.74rem; }
.appstore-editor-empty.error { color: #fecaca; }
.appstore-editor-newrow { display: flex; gap: 6px; }
.appstore-editor-newpath {
  flex: 1 1 auto;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 8px;
  background: rgba(15,23,42,0.8);
  color: #e2e8f0;
  font-size: 0.74rem;
}
.appstore-editor-newfile {
  padding: 5px 8px;
  border: 1px solid rgba(45,212,191,0.38);
  border-radius: 8px;
  background: rgba(45,212,191,0.10);
  color: #5eead4;
  font-size: 0.74rem;
  cursor: pointer;
}
.appstore-editor-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.appstore-editor-path { font-size: 0.76rem; color: #cbd5e1; word-break: break-all; }
.appstore-editor-content {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  padding: 8px;
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 8px;
  background: rgba(2,6,23,0.85);
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
}
.appstore-editor-content:disabled { opacity: 0.6; }
.appstore-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.appstore-editor-save,
.appstore-editor-delete,
.appstore-editor-publish {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(45,212,191,0.38);
  background: rgba(45,212,191,0.10);
  color: #5eead4;
  font-size: 0.76rem;
  cursor: pointer;
}
.appstore-editor-delete { border-color: rgba(248,113,113,0.4); color: #fca5a5; background: rgba(248,113,113,0.08); }
.appstore-editor-publish { border-color: rgba(45,212,191,0.6); background: rgba(45,212,191,0.18); color: #99f6e4; font-weight: 600; }
.appstore-editor-save:disabled,
.appstore-editor-delete:disabled,
.appstore-editor-publish:disabled { opacity: 0.5; cursor: default; }
.appstore-editor-msg { font-size: 0.74rem; color: #5eead4; }
.appstore-editor-msg.error { color: #fecaca; }
@media (max-width: 640px) {
  .appstore-editor-grid { grid-template-columns: 1fr; }
}

/* App Store P2 — Versions tab */
.appstore-editor-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(148,163,184,0.18);
}
.appstore-editor-tab {
  padding: 6px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.appstore-editor-tab:hover { color: #ccfbf1; }
.appstore-editor-tab.active {
  color: #5eead4;
  border-bottom-color: rgba(45,212,191,0.7);
}
.appstore-editor-tabpane[hidden] { display: none !important; }
.appstore-versions { display: block; }
.appstore-versions-loading,
.appstore-versions-empty {
  padding: 8px 4px;
  color: #94a3b8;
  font-size: 0.76rem;
}
.appstore-versions-empty.error { color: #fecaca; }
.appstore-versions-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 700;
}
.appstore-versions-summary-sep { color: #475569; }
.appstore-versions-banner {
  margin-bottom: 10px;
  padding: 8px 11px;
  border: 1px solid rgba(45,212,191,0.22);
  border-radius: 10px;
  background: rgba(2,6,23,0.38);
  color: #bae6fd;
  font-size: 0.74rem;
  line-height: 1.4;
}
.appstore-versions-banner.error {
  border-color: rgba(239,68,68,0.5);
  background: rgba(239,68,68,0.12);
  color: #fecaca;
  font-weight: 700;
}
.appstore-versions-banner.error::before { content: "\26A0  "; }
.appstore-versions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.appstore-version-row {
  padding: 10px 11px;
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 12px;
  background: rgba(15,23,42,0.72);
}
.appstore-version-row.is-current {
  border-color: rgba(45,212,191,0.55);
  background: rgba(20,184,166,0.10);
}
.appstore-version-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.appstore-version-num {
  color: #f8fafc;
  font-weight: 800;
  font-size: 0.84rem;
}
.appstore-version-status { text-transform: none; }
.appstore-status-pill.appstore-version-status.draft { color: #e2e8f0; background: rgba(148,163,184,0.2); }
.appstore-status-pill.appstore-version-status.preview { color: #c4b5fd; background: rgba(139,92,246,0.18); }
.appstore-status-pill.appstore-version-status.approved { color: #bae6fd; background: rgba(14,165,233,0.2); }
.appstore-status-pill.appstore-version-status.published { color: #99f6e4; background: rgba(45,212,191,0.22); }
.appstore-status-pill.appstore-version-status.superseded { color: #cbd5e1; background: rgba(71,85,105,0.3); }
.appstore-status-pill.appstore-version-status.rolled-back { color: #fed7aa; background: rgba(249,115,22,0.18); }
/* B1 (Wave-2b): relaunch-status pill + warning for the Runtime tab. */
.appstore-status-pill.appstore-relaunch-status.appstore-relaunch-pending { color: #fde68a; background: rgba(245,158,11,0.18); }
.appstore-status-pill.appstore-relaunch-status.appstore-relaunch-ok { color: #99f6e4; background: rgba(45,212,191,0.22); }
.appstore-status-pill.appstore-relaunch-status.appstore-relaunch-failed { color: #fecaca; background: rgba(239,68,68,0.18); }
.appstore-status-pill.appstore-relaunch-status.appstore-relaunch-idle { color: #cbd5e1; background: rgba(71,85,105,0.3); }
.appstore-relaunch-warning {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #fde68a;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.28);
  font-size: 0.78rem;
  line-height: 1.4;
}
.appstore-version-current-tag {
  padding: 2px 8px;
  border-radius: 999px;
  color: #99f6e4;
  background: rgba(45,212,191,0.16);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.appstore-version-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  color: #94a3b8;
  font-size: 0.72rem;
}
.appstore-version-meta-item { white-space: nowrap; }
.appstore-version-hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #bae6fd;
}
.appstore-version-changelog {
  margin-top: 6px;
  color: #cbd5e1;
  font-size: 0.74rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.appstore-version-detail {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(45,212,191,0.22);
  border-radius: 10px;
  background: rgba(2,6,23,0.55);
  color: #cbd5e1;
  font-size: 0.73rem;
  line-height: 1.45;
}
.appstore-version-detail[hidden] { display: none !important; }
.appstore-version-detail-loading { color: #94a3b8; }
.appstore-version-detail-body.error { color: #fecaca; }
.appstore-version-diff-line { margin: 2px 0; }
.appstore-version-diff-line strong { color: #99f6e4; font-weight: 700; }
.appstore-version-diff-note {
  margin-top: 6px;
  color: #94a3b8;
  font-style: italic;
}
.appstore-version-logs {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.4;
}
.appstore-version-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}
.appstore-version-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(45,212,191,0.38);
  background: rgba(45,212,191,0.10);
  color: #5eead4;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}
.appstore-version-btn:hover:not(:disabled) { background: rgba(45,212,191,0.22); }
.appstore-version-btn.publish {
  border-color: rgba(45,212,191,0.6);
  background: rgba(45,212,191,0.18);
  color: #99f6e4;
}
.appstore-version-btn.rollback {
  border-color: rgba(249,115,22,0.5);
  color: #fed7aa;
  background: rgba(249,115,22,0.12);
}
.appstore-version-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* P1 / #7 Draft live-preview status area (mirrors the .appstore-version* palette) */
.appstore-previews-area {
  margin-top: 12px;
}
.appstore-previews-area:empty { display: none; }
.appstore-previews-title {
  margin-bottom: 6px;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 800;
}
.appstore-previews-empty {
  padding: 8px 4px;
  color: #94a3b8;
  font-size: 0.76rem;
}
.appstore-previews-empty.error { color: #fecaca; }
.appstore-previews-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.appstore-preview-row {
  padding: 10px 11px;
  border: 1px solid rgba(139,92,246,0.28);
  border-radius: 12px;
  background: rgba(15,23,42,0.72);
}
.appstore-preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.appstore-preview-status { text-transform: none; }
.appstore-status-pill.appstore-preview-status.running { color: #99f6e4; background: rgba(45,212,191,0.22); }
.appstore-status-pill.appstore-preview-status.starting { color: #c4b5fd; background: rgba(139,92,246,0.18); }
.appstore-status-pill.appstore-preview-status.stopping { color: #fed7aa; background: rgba(249,115,22,0.18); }
.appstore-status-pill.appstore-preview-status.stopped { color: #cbd5e1; background: rgba(71,85,105,0.3); }
.appstore-status-pill.appstore-preview-status.failed { color: #fecaca; background: rgba(239,68,68,0.16); }
/* P3 / TZ §6: build-job outcome pill (app card + preview row). text-transform:none so "publish: failed" reads cleanly. */
.appstore-build-status { text-transform: none; }
.appstore-status-pill.appstore-build-status.appstore-build-queued { color: #e2e8f0; background: rgba(148,163,184,0.2); }
.appstore-status-pill.appstore-build-status.appstore-build-building { color: #c4b5fd; background: rgba(139,92,246,0.18); }
.appstore-status-pill.appstore-build-status.appstore-build-success { color: #99f6e4; background: rgba(45,212,191,0.22); }
.appstore-status-pill.appstore-build-status.appstore-build-failed { color: #fecaca; background: rgba(239,68,68,0.18); }
.appstore-status-pill.appstore-build-status.appstore-build-cancelled { color: #cbd5e1; background: rgba(71,85,105,0.3); }
.appstore-preview-open-hint {
  color: #94a3b8;
  font-size: 0.72rem;
}
.appstore-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  color: #94a3b8;
  font-size: 0.72rem;
}
.appstore-preview-meta-item { white-space: nowrap; }
.appstore-preview-hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #c4b5fd;
}
.appstore-preview-detail {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(139,92,246,0.24);
  border-radius: 10px;
  background: rgba(2,6,23,0.55);
  color: #cbd5e1;
  font-size: 0.73rem;
  line-height: 1.45;
}
.appstore-preview-detail[hidden] { display: none !important; }
.appstore-preview-detail-loading { color: #94a3b8; }
.appstore-preview-detail-body.error { color: #fecaca; }
.appstore-preview-detail-error { color: #fecaca; font-weight: 700; margin-bottom: 4px; }
.appstore-preview-detail-status { color: #bae6fd; margin-bottom: 4px; }
.appstore-preview-log {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.4;
}
/* P3 / TZ §6: shared build-log panel (error block + <pre> + copy button). */
.appstore-build-log-empty { color: #94a3b8; font-size: 0.78rem; }
.appstore-build-log-status { color: #bae6fd; margin-bottom: 6px; font-size: 0.78rem; }
.appstore-build-log-error {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  margin-bottom: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
}
.appstore-build-log-error-status { color: #fecaca; font-weight: 800; text-transform: uppercase; font-size: 0.7rem; }
.appstore-build-log-error-code { color: #fca5a5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.72rem; }
.appstore-build-log-error-msg { color: #fecaca; font-size: 0.78rem; word-break: break-word; }
.appstore-build-log-toolbar { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.appstore-build-log-copy {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(30,41,59,0.6);
  color: #cbd5e1;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}
.appstore-build-log-copy:hover { background: rgba(51,65,85,0.7); color: #f1f5f9; }
.appstore-build-log {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.4;
}
.appstore-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}
.appstore-preview-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(139,92,246,0.4);
  background: rgba(139,92,246,0.10);
  color: #c4b5fd;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}
.appstore-preview-btn:hover:not(:disabled) { background: rgba(139,92,246,0.22); }
.appstore-preview-btn.stop {
  border-color: rgba(249,115,22,0.5);
  color: #fed7aa;
  background: rgba(249,115,22,0.12);
}
.appstore-preview-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* P5: App Store detail page (9-tab view) + full-screen panel */
.panel.panel-fullscreen {
  position: fixed;
  inset: 8px;
  width: auto !important;
  height: auto !important;
  max-width: none;
  z-index: 4000;
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.55);
}
.appstore-detail {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 12px;
  box-sizing: border-box;
  /* The detail view replaces the App Store list root, so it must carry its own dark
     backdrop — otherwise its light text renders white-on-white when the panel body is light. */
  background:
    radial-gradient(circle at 12% 10%, rgba(14, 165, 233, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.97));
  color: #e2e8f0;
}
.appstore-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.appstore-detail-title {
  flex: 1;
  font-weight: 800;
  font-size: 0.95rem;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.appstore-detail-back,
.appstore-detail-fullscreen {
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.76rem;
  cursor: pointer;
}
.appstore-detail-back:hover,
.appstore-detail-fullscreen:hover {
  background: rgba(148, 163, 184, 0.22);
}
.appstore-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  margin-bottom: 10px;
}
.appstore-detail-tab {
  border: none;
  background: transparent;
  color: #94a3b8;
  border-bottom: 2px solid transparent;
  padding: 6px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}
.appstore-detail-tab:hover { color: #cbd5e1; }
.appstore-detail-tab.active {
  color: #bae6fd;
  border-bottom-color: #38bdf8;
  font-weight: 700;
}
.appstore-detail-panes { flex: 1; min-height: 0; }
.appstore-detail-pane[hidden] { display: none; }
.appstore-detail-section { margin-bottom: 14px; }
.appstore-detail-section-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: #e2e8f0;
  margin-bottom: 8px;
}
.appstore-detail-kv {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.78rem;
}
.appstore-detail-kv-label { color: #94a3b8; min-width: 130px; }
.appstore-detail-kv-value { color: #e2e8f0; word-break: break-word; }
.appstore-detail-empty,
.appstore-detail-loading,
.appstore-detail-note {
  color: #94a3b8;
  font-size: 0.78rem;
  padding: 8px 0;
}
.appstore-detail-empty.error { color: #fca5a5; }
.appstore-detail-pre {
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  padding: 8px;
  font-size: 0.72rem;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
}
.appstore-detail-runtime-row,
.appstore-detail-job-row {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}
.appstore-detail-runtime-actions,
.appstore-detail-job-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.appstore-detail-rt-btn,
.appstore-detail-job-log-btn,
.appstore-detail-aib-btn,
.appstore-detail-cred-revoke,
.appstore-detail-cred-create {
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
  color: #bae6fd;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.74rem;
  cursor: pointer;
}
.appstore-detail-rt-btn:disabled,
.appstore-detail-aib-btn:disabled,
.appstore-detail-cred-create:disabled,
.appstore-detail-cred-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.appstore-detail-job-time { color: #94a3b8; font-size: 0.72rem; }
.appstore-detail-audit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.76rem;
}
.appstore-detail-audit-type { color: #bae6fd; font-weight: 600; }
.appstore-detail-audit-actor { color: #cbd5e1; }
.appstore-detail-audit-time { color: #94a3b8; margin-left: auto; }
.appstore-detail-cred-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.78rem;
}
.appstore-detail-cred-name { color: #e2e8f0; flex: 1; word-break: break-word; }
.appstore-detail-cred-revoke {
  border-color: rgba(249, 115, 22, 0.5);
  background: rgba(249, 115, 22, 0.12);
  color: #fed7aa;
}
.appstore-detail-cred-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.appstore-detail-cred-input {
  flex: 1;
  min-width: 160px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.4);
  color: #e2e8f0;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.78rem;
}
.appstore-detail-cred-msg,
.appstore-detail-aib-msg {
  flex-basis: 100%;
  color: #cbd5e1;
  font-size: 0.74rem;
}
.appstore-detail-cred-token {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid rgba(45, 212, 191, 0.5);
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.10);
}
.appstore-detail-cred-token-label {
  color: #99f6e4;
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.appstore-detail-cred-token-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.appstore-detail-cred-token-value {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(2, 6, 23, 0.55);
  color: #f1f5f9;
  border-radius: 6px;
  padding: 6px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
}
.appstore-detail-cred-token-copy {
  border: 1px solid rgba(45, 212, 191, 0.6);
  background: rgba(45, 212, 191, 0.18);
  color: #99f6e4;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.appstore-detail-cred-token-copy:hover { background: rgba(45, 212, 191, 0.28); }
.appstore-detail-cred-token-rowlabel { color: #99f6e4; font-size: 0.72rem; min-width: 132px; }
.appstore-detail-cred-token-hint { color: #cbd5e1; font-size: 0.72rem; margin-top: 6px; }
.appstore-detail-cred-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.appstore-detail-cred-idline { color: #94a3b8; font-size: 0.72rem; }
.appstore-detail-cred-idval {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #cbd5e1; cursor: pointer; border-bottom: 1px dotted rgba(148, 163, 184, 0.5);
  word-break: break-all;
}
.appstore-detail-cred-idval:hover { color: #f1f5f9; }
.appstore-detail-cred-idval.copied { color: #99f6e4; border-bottom-color: #99f6e4; }
.appstore-detail-cred-docs { margin-top: 12px; border-top: 1px solid rgba(148, 163, 184, 0.18); padding-top: 10px; }
.appstore-detail-cred-docs > summary { color: #bae6fd; font-size: 0.78rem; cursor: pointer; }
.appstore-detail-cred-docs-body { margin-top: 8px; }
.appstore-detail-cred-docs-line { color: #cbd5e1; font-size: 0.74rem; margin: 4px 0; word-break: break-word; }
.appstore-detail-cred-docs-pre {
  background: rgba(2, 6, 23, 0.55); border: 1px solid rgba(148, 163, 184, 0.2); border-radius: 6px;
  padding: 8px; font-size: 0.72rem; color: #cbd5e1; white-space: pre-wrap; word-break: break-word;
  overflow: auto; max-height: 220px;
}
.appstore-detail-aib-status {
  font-weight: 700;
  color: #bae6fd;
  margin-bottom: 8px;
}
.appstore-detail-aib-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* Usage & Billing panel */
.usage-panel-content {
  padding: 16px;
  color: #e5edf7;
}
.usage-panel-card {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(30,41,59,0.94), rgba(15,23,42,0.96));
  color: #dbeafe;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.usage-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.usage-panel-title {
  color: #f8fafc;
  font-weight: 750;
  font-size: 1rem;
}
.usage-panel-muted {
  color: #cbd5e1;
  font-size: 0.76rem;
}
.usage-budget {
  margin-bottom: 16px;
}
.usage-budget-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: #dbeafe;
  font-size: 0.82rem;
}
.usage-budget-value {
  color: #f8fafc;
  font-weight: 700;
}
.usage-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148,163,184,0.18);
}
.usage-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s;
}
.usage-stat-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.usage-stat-card {
  flex: 1;
  min-width: 140px;
  padding: 12px;
  text-align: center;
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: 10px;
  background: rgba(15,23,42,0.72);
}
.usage-stat-label {
  margin-bottom: 4px;
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 650;
}
.usage-stat-value {
  color: #f8fafc;
  font-weight: 760;
}
.usage-stat-limit {
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 500;
}
.usage-trial-banner {
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(251,191,36,0.35);
  border-radius: 10px;
  background: rgba(251,191,36,0.12);
  color: #fde68a;
  font-size: 0.82rem;
  text-align: center;
}
.usage-action-btn {
  margin-top: 12px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(96,165,250,0.42);
  border-radius: 10px;
  background: rgba(37,99,235,0.18);
  color: #bfdbfe;
  cursor: pointer;
  font-weight: 750;
  font-size: 0.86rem;
}
.usage-copy-btn {
  padding: 3px 10px;
  border: 1px solid rgba(96,165,250,0.36);
  border-radius: 7px;
  background: rgba(37,99,235,0.16);
  color: #bfdbfe;
  cursor: pointer;
  font-size: 0.72rem;
}
.usage-mono {
  color: #dbeafe;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  line-height: 1.5;
  word-break: break-all;
}
.usage-integrations-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.usage-integration-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(148,163,184,0.14);
  border-radius: 10px;
  background: rgba(15,23,42,0.62);
}
.usage-integration-name {
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 750;
}
.usage-integration-meta {
  margin-top: 3px;
  color: #cbd5e1;
  font-size: 0.72rem;
}
.usage-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
}
.usage-status-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.usage-status-pill.connected {
  border: 1px solid rgba(34,197,94,0.35);
  background: rgba(34,197,94,0.14);
  color: #86efac;
}
.usage-status-pill.missing {
  border: 1px solid rgba(248,113,113,0.32);
  background: rgba(127,29,29,0.24);
  color: #fecaca;
}
.usage-status-pill.checking {
  border: 1px solid rgba(148,163,184,0.28);
  background: rgba(148,163,184,0.12);
  color: #e2e8f0;
}

/* ─── Add-Panel Dialog ──────────────────────── */
/* B412.1: bump above floating boss-chat panels (z-index 8000-9999 in this
   file and 9999-10010 in panels.js modals) so the dialog is not occluded
   by panel cards or floating overlays. Boss reported the menu rendering
   "behind every window" (msg=dc4cdb28); the prior 200 was a dropdown-tier
   value that lost to almost every other layer. */
#addDialog {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; z-index: 10100;
}
#addDialog.hidden { display: none; }
.dialog-body {
  background: #fff; padding: 24px; border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2); width: 380px;
}
.dialog-body h3 { margin-bottom: 16px; font-size: 16px; }
.dialog-body label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: #475569; }
.dialog-body select, .dialog-body input {
  width: 100%; padding: 8px 10px; margin-bottom: 12px;
  border: 1px solid #d0d5dd; border-radius: 6px; font-size: 13px;
}
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }
.dialog-actions button {
  padding: 6px 16px; border-radius: 6px; border: none;
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.dialog-actions .btn-primary { background: #2563eb; color: #fff; }
.dialog-actions .btn-cancel { background: #e2e8f0; color: #1e293b; }

/* ─── Panels Grid ───────────────────────────── */
#panelsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px; padding: 16px;
}
body.desktop-floating-layout #panelsContainer {
  display: block;
  position: relative;
  min-height: calc(100vh - 64px);
  padding: 16px;
}

/* ─── Panel Card ────────────────────────────── */
.panel {
  background: #fff; border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  display: flex; flex-direction: column;
  max-height: 600px; overflow: hidden;
}
body.desktop-floating-layout .panel.panel-floating {
  position: absolute;
  max-height: none;
  min-width: 280px;
  min-height: 220px;
  resize: both;
  transition: box-shadow 0.15s ease, outline-color 0.15s ease;
}
body.desktop-floating-layout .panel.panel-floating.panel-wide {
  grid-column: auto;
  max-height: none;
}
body.desktop-floating-layout .panel.panel-floating:hover {
  box-shadow: 0 8px 24px rgba(15,23,42,0.16);
}
body.desktop-floating-layout .panel.panel-dragging {
  box-shadow: 0 14px 36px rgba(15,23,42,0.24);
  outline: 2px solid rgba(8,145,178,0.28);
}
.panel.panel-wide {
  grid-column: 1 / -1;
  max-height: 800px;
}
.panel-header {
  background: #2563eb; color: #fff; padding: 8px 12px;
  display: flex; align-items: center; gap: 8px;
  border-radius: 10px 10px 0 0; flex-shrink: 0;
}
body.desktop-floating-layout .panel-header.panel-drag-handle {
  cursor: grab;
  touch-action: none;
  user-select: none;
}
body.desktop-floating-layout .panel.panel-dragging .panel-header.panel-drag-handle {
  cursor: grabbing;
}
.panel-header .panel-title { font-size: 13px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-header .panel-type { font-size: 11px; opacity: .7; }
.panel-close {
  background: none; border: none; color: #fff; font-size: 16px;
  cursor: pointer; padding: 0 4px; opacity: .7; line-height: 1;
}
.panel-close:hover { opacity: 1; }
.panel-body { flex: 1; overflow-y: auto; padding: 0; min-height: 0; }
.panel-snap-guide {
  position: absolute;
  z-index: 9998;
  pointer-events: none;
  background: #06b6d4;
  box-shadow: 0 0 0 1px rgba(6,182,212,0.18), 0 0 14px rgba(6,182,212,0.32);
}
.panel-snap-guide-x {
  top: 0;
  bottom: 0;
  width: 2px;
}
.panel-snap-guide-y {
  left: 0;
  right: 0;
  height: 2px;
}

/* Panel header color variants */
.panel-header.header-purple { background: #7c3aed; }
.panel-header.header-emerald { background: #059669; }
.panel-header.header-amber { background: #d97706; }
.panel-header.header-rose { background: #e11d48; }
.panel-header.header-slate { background: #475569; }
.panel-header.header-cyan { background: #0891b2; }

/* ─── Conversation List (Employee Watcher) ─── */
.conv-list { list-style: none; }
.conv-item {
  padding: 8px 12px; border-bottom: 1px solid #f0f2f5; cursor: pointer;
  font-size: 13px; display: flex; justify-content: space-between; align-items: center;
}
.conv-item:hover { background: #f8fafc; }
.conv-item.active { background: #eff6ff; }
.conv-status {
  font-size: 11px; padding: 2px 6px; border-radius: 4px;
  background: #e2e8f0; color: #475569;
}
.conv-status.active { background: #dcfce7; color: #166534; }
.conv-status.escalated { background: #fef9c3; color: #854d0e; }
.conv-status.resolved { background: #e0e7ff; color: #3730a3; }
.conv-inline-messages {
  padding: 8px 12px; border-bottom: 1px solid #e2e8f0;
  background: #fafbfc; max-height: 300px; overflow-y: auto;
}

/* ─── Messages (Conversation Viewer / Chat) ── */
.messages {
  padding: 12px; display: flex; flex-direction: column; gap: 6px;
}
.msg {
  max-width: 85%; padding: 8px 12px; border-radius: 12px;
  font-size: 13px; line-height: 1.4; word-wrap: break-word;
}
.msg.user {
  align-self: flex-end; background: #2563eb; color: #fff;
  border-bottom-right-radius: 4px;
}
.msg.assistant {
  align-self: flex-start; background: #e5e7eb; color: #1a1a1a;
  border-bottom-left-radius: 4px;
}
.msg.system {
  align-self: center; background: #fef3c7; color: #92400e;
  font-size: 12px; font-style: italic;
}
.msg.status {
  align-self: center; background: #eff6ff; color: #1e40af;
  font-size: 12px; font-style: italic; border: 1px dashed #93c5fd;
  animation: statusPulse 2s ease-in-out infinite;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.msg-time { font-size: 10px; opacity: .6; margin-top: 2px; }

/* ─── Chat Input (modern Telegram-style) ──────── */
.chat-input {
  display: flex; gap: 6px; padding: 8px 10px;
  border-top: 1px solid #e2e8f0; flex-shrink: 0;
  align-items: flex-end; background: #f8fafc;
}
.chat-input textarea {
  flex: 1; padding: 8px 12px; border: 1.5px solid #d0d5dd;
  border-radius: 18px; font-size: 13px; font-family: inherit;
  resize: none; min-height: 36px; max-height: 200px;
  line-height: 1.5; overflow-y: auto;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff; min-width: 0;
}
.chat-input textarea:focus {
  outline: none; border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.chat-input textarea::placeholder { color: #94a3b8; }
.chat-input .chat-send-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: #2563eb; color: #fff; border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.15s, transform 0.1s;
  font-size: 16px;
}
.chat-input .chat-send-btn:hover { background: #1d4ed8; transform: scale(1.05); }
.chat-input .chat-send-btn:active { transform: scale(0.95); }
.chat-input .chat-send-btn:disabled { background: #60a5fa; cursor: not-allowed; transform: none; opacity: 0.7; }
/* Legacy input fallback */
.chat-input input {
  flex: 1; padding: 8px 10px; border: 1px solid #d0d5dd;
  border-radius: 8px; font-size: 13px;
}
.chat-input button:not(.chat-send-btn) {
  padding: 8px 14px; background: #2563eb; color: #fff;
  border: none; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.chat-input button:not(.chat-send-btn):hover { background: #1d4ed8; }
.chat-input button:not(.chat-send-btn):disabled { background: #93c5fd; cursor: not-allowed; }

/* ─── Fleet Dashboard ──────────────────────── */
.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px; padding: 12px;
}
.fleet-card {
  border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px;
  cursor: pointer; transition: all 0.15s;
  background: #fff; position: relative;
}
.fleet-card:hover { border-color: #2563eb; box-shadow: 0 2px 8px rgba(37,99,235,.15); transform: translateY(-1px); }
.fleet-card-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.fleet-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.fleet-card-name { font-size: 14px; font-weight: 600; color: #1e293b; }
.fleet-card-template { font-size: 11px; color: #64748b; }
.fleet-card-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin-top: 8px;
}
.fleet-stat {
  background: #f8fafc; border-radius: 6px; padding: 6px 8px;
  font-size: 11px;
}
.fleet-stat-label { color: #94a3b8; display: block; margin-bottom: 2px; }
.fleet-stat-value { color: #1e293b; font-weight: 600; font-size: 13px; }
.fleet-status-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.fleet-status-badge.active { background: #dcfce7; color: #166534; }
.fleet-status-badge.paused { background: #fef9c3; color: #854d0e; }
.fleet-status-badge.retired { background: #fee2e2; color: #991b1b; }
.fleet-status-badge.initializing { background: #e0e7ff; color: #3730a3; }
.fleet-actions {
  display: flex; gap: 6px; margin-top: 10px; padding-top: 8px;
  border-top: 1px solid #f0f2f5;
}
.fleet-actions button {
  flex: 1; padding: 4px 8px; border: 1px solid #e2e8f0;
  border-radius: 4px; background: #fff; font-size: 11px;
  cursor: pointer; color: #475569;
}
.fleet-actions button:hover { background: #f1f5f9; }
.fleet-actions button.btn-danger { color: #dc2626; border-color: #fecaca; }
.fleet-actions button.btn-danger:hover { background: #fef2f2; }
.fleet-actions button.btn-success { color: #16a34a; border-color: #bbf7d0; }
.fleet-actions button.btn-success:hover { background: #f0fdf4; }

/* Fleet toolbar */
.fleet-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0; background: #f8fafc;
  flex-wrap: wrap;
}
.fleet-toolbar .fleet-count {
  font-size: 12px; color: #64748b; margin-right: auto;
}
.fleet-toolbar button {
  padding: 4px 10px; border: 1px solid #e2e8f0; border-radius: 4px;
  background: #fff; font-size: 11px; cursor: pointer; color: #475569;
}
.fleet-toolbar button:hover { background: #f1f5f9; }
.fleet-toolbar button.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* ─── Employee Detail Panel ─────────────────── */
.detail-section {
  padding: 12px; border-bottom: 1px solid #f0f2f5;
}
.detail-section:last-child { border-bottom: none; }
.detail-section-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: #94a3b8; margin-bottom: 8px;
}
.detail-header {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #fff;
}
.detail-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #fff;
  border: 3px solid rgba(255,255,255,0.3);
}
.detail-name { font-size: 18px; font-weight: 700; }
.detail-meta { font-size: 12px; opacity: 0.7; margin-top: 2px; }
.detail-stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.detail-stat-card {
  text-align: center; padding: 10px 6px; background: #f8fafc;
  border-radius: 8px; border: 1px solid #e2e8f0;
}
.detail-stat-card .value { font-size: 20px; font-weight: 700; color: #1e293b; }
.detail-stat-card .label { font-size: 10px; color: #94a3b8; margin-top: 2px; }
.detail-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.detail-actions button {
  padding: 6px 12px; border-radius: 6px; border: 1px solid #e2e8f0;
  background: #fff; font-size: 12px; cursor: pointer; font-weight: 500;
}
.detail-actions button:hover { background: #f1f5f9; }
.detail-actions button.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.detail-actions button.primary:hover { background: #1d4ed8; }
.detail-actions button.danger { color: #dc2626; border-color: #fecaca; }

/* Autonomy gauge */
.autonomy-gauge {
  display: flex; align-items: center; gap: 8px; padding: 8px;
  background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0;
}
.autonomy-bar {
  flex: 1; height: 8px; background: #e2e8f0; border-radius: 4px;
  overflow: hidden;
}
.autonomy-fill {
  height: 100%; border-radius: 4px; transition: width 0.3s;
}
.autonomy-label {
  font-size: 12px; font-weight: 600; min-width: 80px; text-align: right;
}

/* ─── Ouroboros Hub ──────────────────────────── */
.ouro-tabs {
  display: flex; gap: 0; border-bottom: 2px solid #e2e8f0;
  padding: 0 12px; background: #fafbfc;
}
.ouro-tab {
  padding: 8px 14px; font-size: 12px; font-weight: 500;
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; color: #64748b;
  background: none; border-top: none; border-left: none; border-right: none;
}
.ouro-tab:hover { color: #1e293b; }
.ouro-tab.active { color: #7c3aed; border-bottom-color: #7c3aed; font-weight: 600; }
.ouro-content { padding: 12px; }
.ouro-content.hidden { display: none; }

.dna-fact {
  padding: 10px; border: 1px solid #e2e8f0; border-radius: 8px;
  margin-bottom: 8px; font-size: 12px;
}
.dna-fact-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px;
}
.dna-fact-trigger { font-weight: 600; color: #7c3aed; }
.dna-fact-confidence {
  font-size: 11px; padding: 1px 6px; border-radius: 10px;
  background: #f3e8ff; color: #7c3aed;
}
.dna-fact-text { color: #475569; line-height: 1.4; }
.dna-fact-meta { font-size: 10px; color: #94a3b8; margin-top: 4px; }
.dna-fact-actions { display: flex; gap: 6px; margin-top: 6px; }
.dna-fact-actions button {
  padding: 3px 10px; border-radius: 4px; border: 1px solid #e2e8f0;
  background: #fff; font-size: 11px; cursor: pointer;
}
.dna-fact-actions .btn-approve { color: #16a34a; border-color: #bbf7d0; }
.dna-fact-actions .btn-reject { color: #dc2626; border-color: #fecaca; }

.timeline-event {
  display: flex; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid #f5f5f5; font-size: 12px;
}
.timeline-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 4px;
  flex-shrink: 0;
}
.timeline-event-type { font-weight: 600; color: #1e293b; }
.timeline-event-time { color: #94a3b8; font-size: 11px; }

/* Self-model display */
.self-model-box {
  background: #faf5ff; border: 1px solid #e9d5ff; border-radius: 8px;
  padding: 12px; font-size: 12px; line-height: 1.6;
  white-space: pre-wrap; color: #581c87;
}

/* Block chain display */
.block-card {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; background: #f8fafc; border-radius: 6px;
  border: 1px solid #e2e8f0; margin-bottom: 6px; font-size: 11px;
}
.block-hash { font-family: monospace; color: #7c3aed; font-size: 10px; }
.block-date { font-weight: 600; color: #1e293b; min-width: 80px; }
.block-count { color: #64748b; }

/* ─── Training Panel ────────────────────────── */
.training-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  padding: 12px;
}
.training-stat {
  text-align: center; padding: 12px 8px;
  background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0;
}
.training-stat .big-value { font-size: 24px; font-weight: 700; }
.training-stat .label { font-size: 10px; color: #94a3b8; text-transform: uppercase; }
.maturity-badge {
  display: inline-block; padding: 3px 10px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.maturity-badge.apprentice { background: #fef9c3; color: #854d0e; }
.maturity-badge.specialist { background: #dbeafe; color: #1e40af; }
.maturity-badge.expert { background: #dcfce7; color: #166534; }
.maturity-badge.master { background: #f3e8ff; color: #7c3aed; }

.draft-card {
  border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px;
  margin-bottom: 8px;
}
.draft-header { font-size: 12px; color: #64748b; margin-bottom: 6px; }
.draft-content {
  font-size: 13px; background: #f8fafc; padding: 8px;
  border-radius: 4px; margin-bottom: 8px; line-height: 1.5;
}
.draft-actions { display: flex; gap: 6px; }
.draft-actions button {
  padding: 4px 12px; border-radius: 4px; border: 1px solid #e2e8f0;
  background: #fff; font-size: 11px; cursor: pointer;
}
.draft-actions .btn-approve { color: #16a34a; border-color: #bbf7d0; }
.draft-actions .btn-reject { color: #dc2626; border-color: #fecaca; }
.draft-actions .btn-edit { color: #2563eb; border-color: #bfdbfe; }

.rule-item {
  padding: 8px 12px; border-bottom: 1px solid #f0f2f5;
  font-size: 12px;
}
.rule-item:last-child { border-bottom: none; }
.rule-trigger { font-weight: 600; color: #1e40af; margin-bottom: 2px; }
.rule-response { color: #475569; }
.rule-meta { font-size: 10px; color: #94a3b8; margin-top: 2px; }

/* ─── Group Chats Panel ─────────────────────── */
.gc-list { list-style: none; }
.gc-item {
  padding: 10px 12px; border-bottom: 1px solid #f0f2f5;
  cursor: pointer; display: flex; align-items: center; gap: 10px;
}
.gc-item:hover { background: #f8fafc; }
.gc-item.active { background: #eff6ff; }
.gc-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: #e0e7ff; color: #3730a3; display: flex;
  align-items: center; justify-content: center; font-size: 14px;
  flex-shrink: 0;
}
.gc-info { flex: 1; min-width: 0; }
.gc-name { font-size: 13px; font-weight: 600; color: #1e293b; }
.gc-members { font-size: 11px; color: #94a3b8; }
.gc-messages {
  padding: 12px; max-height: 300px; overflow-y: auto;
  background: #fafbfc; border-bottom: 1px solid #e2e8f0;
}
.gc-msg {
  margin-bottom: 8px; font-size: 12px;
}
.gc-msg-sender { font-weight: 600; color: #1e40af; }
.gc-msg-time { font-size: 10px; color: #94a3b8; }
.gc-msg-content { color: #1e293b; margin-top: 2px; line-height: 1.4; }
.gc-msg.directive {
  background: #fef3c7; border: 1px solid #fbbf24;
  border-radius: 6px; padding: 8px;
}
.gc-msg.directive .gc-msg-sender { color: #92400e; }
.gc-input-row {
  display: flex; gap: 6px; padding: 8px 12px;
  border-top: 1px solid #e2e8f0;
}
.gc-input-row input {
  flex: 1; padding: 6px 10px; border: 1px solid #d0d5dd;
  border-radius: 6px; font-size: 12px;
}
.gc-input-row button {
  padding: 6px 12px; border-radius: 6px; border: none;
  font-size: 12px; font-weight: 500; cursor: pointer;
}
.gc-input-row .btn-message { background: #2563eb; color: #fff; }
.gc-input-row .btn-directive { background: #d97706; color: #fff; }

/* ─── Cost & Routing Panel ──────────────────── */
.cost-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  padding: 12px;
}
.cost-card {
  text-align: center; padding: 14px 8px; background: #f8fafc;
  border-radius: 8px; border: 1px solid #e2e8f0;
}
.cost-card .big-value { font-size: 22px; font-weight: 700; }
.cost-card .label { font-size: 10px; color: #94a3b8; margin-top: 2px; }
.cost-card.highlight { background: #f0fdf4; border-color: #bbf7d0; }
.cost-card.highlight .big-value { color: #16a34a; }
.cost-bar {
  display: flex; height: 24px; border-radius: 6px; overflow: hidden;
  margin: 0 12px 12px;
}
.cost-bar-segment {
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: #fff;
  min-width: 20px;
}
.cost-legend {
  display: flex; gap: 12px; padding: 0 12px 12px;
  font-size: 11px; color: #64748b;
}
.cost-legend-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 4px;
}

/* ─── Utility ───────────────────────────────── */
.loading { text-align: center; padding: 20px; color: #94a3b8; font-size: 13px; }
.empty { text-align: center; padding: 20px; color: #94a3b8; font-size: 13px; font-style: italic; }
.panel-body::-webkit-scrollbar { width: 5px; }
.panel-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.conv-inline-messages::-webkit-scrollbar { width: 4px; }
.conv-inline-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

/* Common buttons */
.btn-sm {
  padding: 4px 10px; border-radius: 4px; border: 1px solid #e2e8f0;
  background: #fff; font-size: 11px; cursor: pointer; color: #475569;
}
.btn-sm:hover { background: #f1f5f9; }
.btn-sm:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-sm.primary:hover { background: #1d4ed8; }

/* Info row */
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: 12px; border-bottom: 1px solid #f5f5f5;
}
.info-row:last-child { border-bottom: none; }
.info-row .label { color: #94a3b8; }
.info-row .value { color: #1e293b; font-weight: 500; }

/* ─── Boss Chat Panel (v2 — redesigned) ───── */

/* Wrapper: sidebar + main chat area */
.bc-wrapper {
  display: flex; flex: 1; min-height: 0; overflow: hidden;
  position: relative;
}

/* Left sidebar timeline — hidden on desktop (v23: replaced by minimap) */
.bc-sidebar {
  width: 200px; min-width: 160px; max-width: 260px;
  border-right: 1px solid #e2e8f0; background: #f8fafc;
  display: none; flex-direction: column; overflow: hidden;
  flex-shrink: 0;
}
.bc-sidebar-header {
  padding: 10px 12px; border-bottom: 1px solid #e2e8f0;
  font-size: 11px; font-weight: 600; color: #475569;
  text-transform: uppercase; letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 6px;
}
.bc-sidebar-header::before {
  content: ''; width: 3px; height: 14px;
  background: #2563eb; border-radius: 2px;
}
.bc-timeline {
  flex: 1; overflow-y: auto; padding: 8px 0;
}
.bc-timeline::-webkit-scrollbar { width: 3px; }
.bc-timeline::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.bc-tl-entry {
  display: flex; gap: 8px; padding: 5px 10px;
  cursor: pointer; font-size: 10px; line-height: 1.35;
  transition: background 0.15s; position: relative;
}
.bc-tl-entry:hover { background: #e2e8f0; }
.bc-tl-entry:focus { outline: 2px solid #2563eb; outline-offset: -2px; }
.bc-tl-entry.active { background: #dbeafe; border-right: 2px solid #2563eb; }

/* Timeline vertical line */
.bc-tl-entry::before {
  content: ''; position: absolute; left: 13px; top: 18px;
  bottom: -5px; width: 1px; background: #e2e8f0;
}
.bc-tl-entry:last-child::before { display: none; }

.bc-tl-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; margin-top: 3px; z-index: 1;
  border: 2px solid #cbd5e1; background: #fff;
}
.bc-tl-entry.tl-boss .bc-tl-dot { border-color: #1e293b; background: #1e293b; }
.bc-tl-entry.tl-employee .bc-tl-dot { border-color: #22c55e; background: #22c55e; }
.bc-tl-entry.tl-system .bc-tl-dot { border-color: #f59e0b; background: #f59e0b; }
.bc-tl-entry.tl-goal .bc-tl-dot { border-color: #2563eb; background: #2563eb; }
.bc-tl-entry.tl-goal { margin-top: 6px; padding-top: 8px; border-top: 1px solid #e2e8f0; }
.bc-tl-entry.tl-goal:first-child { margin-top: 0; padding-top: 5px; border-top: none; }
.bc-tl-entry.tl-progress .bc-tl-dot {
  border-color: #8b5cf6; background: #8b5cf6;
  animation: tl-pulse 2s infinite;
}
@keyframes tl-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,92,246,0.3); }
  50% { box-shadow: 0 0 0 4px rgba(139,92,246,0); }
}

.bc-tl-text {
  flex: 1; color: #475569;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.bc-tl-time {
  font-size: 9px; color: #64748b; white-space: nowrap; margin-top: 1px;
}

/* Sidebar toggle for mobile */
.bc-sidebar-toggle {
  display: none; position: absolute; left: 8px; top: 8px; z-index: 10;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px;
  padding: 4px 8px; font-size: 14px; cursor: pointer; transition: all 0.15s;
}
.bc-sidebar-toggle:hover { background: #e2e8f0; border-color: #2563eb; }
.bc-sidebar-toggle:focus { outline: 2px solid #2563eb; outline-offset: 2px; }

/* Main chat column */
.bc-main {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
}

/* Search bar */
.bc-search-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-bottom: 1px solid #e2e8f0;
  background: #fafbfc; flex-wrap: wrap;
}
.bc-search-input {
  flex: 1; padding: 5px 8px 5px 26px; border: 1px solid #d0d5dd;
  border-radius: 6px; font-size: 12px; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 0;
}
.bc-search-input:focus {
  outline: none; border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}
.bc-search-wrap {
  position: relative; flex: 1;
}
.bc-search-wrap::before {
  content: '\1F50D'; position: absolute; left: 8px; top: 50%;
  transform: translateY(-50%); font-size: 11px; pointer-events: none;
  opacity: 0.5;
}
.bc-search-count {
  font-size: 10px; color: #64748b; white-space: nowrap; font-weight: 500;
}
.bc-search-nav {
  display: none; gap: 2px;
}
.bc-search-nav.active { display: flex; }
.bc-search-nav button {
  background: none; border: 1px solid #d0d5dd; border-radius: 4px;
  padding: 5px 10px; font-size: 10px; cursor: pointer; color: #475569;
  line-height: 1; min-width: 32px; min-height: 28px;
}
.bc-search-nav button:hover { background: #e2e8f0; }
.bc-search-nav button:focus { outline: 2px solid #2563eb; outline-offset: 1px; }
.bc-search-highlight { background: #fef08a; border-radius: 2px; }
.bc-search-highlight.current { background: #fb923c; color: #fff; }

/* Messages container */
.bc-messages {
  padding: 12px 14px 12px 42px; display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto; flex: 1; min-height: 0;
  scroll-behavior: smooth; position: relative;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.bc-messages::-webkit-scrollbar { width: 0; height: 0; }
.bc-messages::-webkit-scrollbar-track { background: transparent; }
.bc-messages::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 0;
}
.bc-messages::-webkit-scrollbar-thumb:hover { background: transparent; }
/* Integrated audit-trail timeline */
.bc-messages::before {
  content: '';
  position: absolute; left: 19px; top: 0; bottom: 0;
  width: 2px; pointer-events: none; z-index: 0;
  background: linear-gradient(180deg,
    rgba(37,99,235,0.25) 0%,
    rgba(37,99,235,0.12) 40%,
    rgba(37,99,235,0.12) 60%,
    rgba(74,222,128,0.20) 100%);
}
/* Timeline dot for employee messages */
.bc-msg-employee { position: relative; }
.bc-msg-employee::after {
  content: '';
  position: absolute; left: -16px; top: 18px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e; opacity: 0.5;
  box-shadow: 0 0 0 1px rgba(34,197,94,0.15);
}
/* In-flight streaming row: pulsing blue dot replaces the static green dot */
.bc-msg-streaming.bc-msg-employee::after {
  background: #5b8def; opacity: 1;
  animation: bc-stream-pulse 1.2s ease-in-out infinite;
}
@keyframes bc-stream-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.4); }
}
/* Boss messages: no left marker (right-aligned) */

/* Date separator with timeline marker */
.bc-date-sep {
  align-self: center; font-size: 11px; color: #64748b; font-weight: 500;
  background: #e2e8f0; padding: 3px 14px; border-radius: 10px;
  margin: 12px 0 6px; position: relative;
}

/* Message row: avatar + bubble */
.bc-msg {
  display: flex; gap: 10px; max-width: 92%; font-size: 13px; line-height: 1.5;
  position: relative; scroll-margin-top: 12px;
}
/* Only animate new messages, not history load */
.bc-msg.bc-animate {
  animation: bc-msg-enter 0.25s ease-out;
}
@keyframes bc-msg-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.bc-msg-boss {
  align-self: flex-end; flex-direction: row-reverse; max-width: 88%;
}
.bc-msg-employee {
  align-self: flex-start;
}
.bc-msg-system {
  align-self: center; max-width: 90%;
}

/* Avatar */
.bc-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  letter-spacing: -0.5px;
}
.bc-msg-boss .bc-avatar {
  background: linear-gradient(135deg, #1e293b, #334155); color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.bc-msg-employee .bc-avatar {
  background: rgba(34,197,94,0.12); color: #16a34a;
  border: 1px solid rgba(34,197,94,0.2);
}

/* Bubble */
.bc-bubble {
  flex: 1; min-width: 0;
}
.bc-sender-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 3px;
  flex-wrap: wrap;
}
.bc-sender-name {
  font-size: 11px; font-weight: 600; color: #475569;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bc-msg-boss .bc-sender-name { color: #1e293b; font-weight: 700; }
.bc-sender-time {
  font-size: 10px; color: #64748b;
}
.bc-cli-panel-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  min-height: 0;
  vertical-align: middle;
}
.bc-cli-panel-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  max-height: 30px;
}
.bc-cli-tab,
.bc-cli-add,
.bc-cli-close,
.bc-cli-background {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  min-height: 22px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  line-height: 16px;
  white-space: nowrap;
}
/* B110: Background-running indicator pill. Distinct amber tint so the boss
   can spot active background CLI sessions at a glance and click to restore. */
.bc-cli-background {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.4);
  color: #b45309;
}
.bc-cli-background:hover {
  background: rgba(245, 158, 11, 0.26);
  border-color: rgba(245, 158, 11, 0.55);
}
.bc-cli-tab.active {
  background: #1e293b;
  border-color: #1e293b;
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}
.bc-cli-tab.running::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
.bc-cli-counter {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
}
.bc-cli-add {
  min-width: 24px;
  padding: 2px 8px;
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.bc-cli-panel-bar:not(.expanded) .bc-cli-add {
  padding: 2px 7px;
  font-size: 9px;
  opacity: .9;
}
.bc-cli-add:disabled,
.bc-cli-close:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.bc-cli-close {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}
.bc-cli-slot-badge {
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .04em;
  color: #1d4ed8;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 2px 6px;
}
.bc-exec-time {
  font-size: 9px; color: #8b5cf6; background: rgba(139,92,246,0.08);
  padding: 1px 6px; border-radius: 8px; white-space: nowrap;
}

.bc-bubble-body {
  padding: 8px 12px; word-wrap: break-word;
}
.bc-msg-boss .bc-bubble-body {
  background: #1e293b; color: #fff;
  border-radius: 14px 14px 4px 14px;
}
.bc-msg-employee .bc-bubble-body {
  background: #f0fdf4; color: #1e293b;
  border-radius: 14px 14px 14px 4px;
  border: 1px solid #bbf7d0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.bc-msg-system .bc-bubble-body {
  background: #fef3c7; color: #92400e;
  padding: 6px 12px; border-radius: 8px; font-size: 11px; font-style: italic;
}

/* Thinking indicator */
.bc-thinking {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; color: #7c3aed; margin-bottom: 4px;
  padding: 3px 8px; background: rgba(139,92,246,0.08);
  border-radius: 6px; border: 1px solid rgba(139,92,246,0.15);
  font-style: italic;
}
.bc-thinking::before { content: '\1F9E0'; font-size: 12px; }
.bc-thinking-text {
  max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Message content (markdown) */
.bc-msg-content { word-wrap: break-word; overflow-wrap: break-word; word-break: break-word; }

.bc-dna-feedback {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(34, 197, 94, 0.18);
  color: #15803d;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.78;
}
.bc-msg-boss .bc-dna-feedback {
  border-top-color: rgba(255, 255, 255, 0.16);
  color: #bbf7d0;
}
.mob-detail-content .bc-dna-feedback { font-size: 10px; opacity: 0.84; }

/* ─── Markdown Content Styles ──────────── */
.bc-msg-content .bc-md-h3 {
  font-size: 14px; font-weight: 600; margin: 12px 0 6px 0; color: #1e293b;
  border-bottom: 1px solid #e2e8f0; padding-bottom: 4px;
}
.bc-msg-content .bc-md-h4 {
  font-size: 13px; font-weight: 600; margin: 10px 0 4px 0; color: #334155;
}
.bc-msg-content .bc-md-p { margin: 0 0 8px 0; }
.bc-msg-content .bc-md-p:last-child { margin-bottom: 0; }
.bc-msg-content .bc-md-ul, .bc-msg-content .bc-md-ol {
  margin: 4px 0 8px 0; padding-left: 20px;
}
.bc-msg-content .bc-md-li, .bc-msg-content .bc-md-oli {
  margin: 2px 0; line-height: 1.5;
}
.bc-msg-content .bc-md-hr {
  border: none; border-top: 1px solid #e2e8f0; margin: 8px 0;
}
.bc-msg-content .bc-md-code {
  background: #f1f5f9; padding: 1px 4px; border-radius: 3px;
  font-family: monospace; font-size: 12px;
}
.bc-msg-content .bc-md-pre {
  background: #f1f5f9; padding: 8px 10px; border-radius: 6px;
  font-family: monospace; font-size: 11px; line-height: 1.5;
  overflow-x: auto; white-space: pre-wrap; margin: 6px 0;
}
.bc-msg-boss .bc-md-h3 { color: #e2e8f0; border-bottom-color: #475569; }
.bc-msg-boss .bc-md-h4 { color: #cbd5e1; }
.bc-msg-boss .bc-md-code { background: rgba(255,255,255,0.1); color: #e2e8f0; }
.bc-msg-boss .bc-md-pre { background: rgba(255,255,255,0.08); color: #e2e8f0; }
.bc-msg-boss .bc-md-hr { border-top-color: #475569; }

/* Regenerate button */
.bc-regen-btn {
  display: none;
  margin-top: 6px;
  padding: 4px 12px;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  color: #94a3b8;
  background: rgba(0,0,0,0.04);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.bc-regen-btn:hover { background: rgba(0,0,0,0.08); color: #64748b; }
.bc-msg-employee:last-child .bc-regen-btn { display: inline-block; }
.mob-detail-content .bc-regen-btn { background: rgba(255,255,255,0.05); color: #64748b; }
.mob-detail-content .bc-regen-btn:hover { background: rgba(255,255,255,0.1); }

/* Links in markdown */
.bc-md-link {
  color: #3b82f6;
  text-decoration: none;
  border-bottom: 1px solid rgba(59,130,246,0.3);
  transition: border-color 0.15s, color 0.15s;
  word-break: break-all;
}
.bc-md-link:hover { color: #2563eb; border-bottom-color: #2563eb; }
.bc-md-link-bare {
  font-size: 0.9em;
  color: #60a5fa;
  display: inline-block;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.bc-msg-boss .bc-md-link { color: #93c5fd; border-bottom-color: rgba(147,197,253,0.3); }
.bc-msg-boss .bc-md-link:hover { color: #bfdbfe; }
/* Mobile dark mode links */
.mob-detail-content .bc-md-link { color: #60a5fa; border-bottom-color: rgba(96,165,250,0.3); }

/* Chips & metadata */
.bc-msg-chips { display: flex; gap: 4px; margin-top: 6px; }
.bc-chip {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: rgba(255,255,255,0.2); color: inherit;
  font-weight: 500;
}
.bc-msg-boss .bc-chip { background: rgba(255,255,255,0.2); font-weight: 600; }
.bc-msg-employee .bc-chip { background: #dcfce7; color: #166534; }
.bc-msg-emotion {
  font-size: 10px; opacity: 0.7; margin-top: 2px; font-style: italic;
}
.bc-msg-time { font-size: 10px; opacity: 0.5; margin-top: 2px; }

/* Self-assessment */
.bc-self-assess {
  margin-top: 6px; padding: 8px; background: #f1f5f9;
  border-radius: 6px; font-size: 11px; border: 1px solid #e2e8f0;
  line-height: 1.5;
}
.bc-self-assess.hidden { display: none; }
.bc-assess-toggle {
  display: inline-block; font-size: 10px; color: #2563eb;
  cursor: pointer; margin-top: 4px;
}
.bc-assess-toggle:hover { text-decoration: underline; }

/* Asana link rendering */
.bc-asana-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 6px; font-size: 11px;
  background: rgba(244,148,116,0.1); color: #e8604c;
  text-decoration: none; border: 1px solid rgba(244,148,116,0.2);
  transition: background 0.15s; font-weight: 500;
}
.bc-asana-link:hover { background: rgba(244,148,116,0.2); }
.bc-asana-link::before { content: '\1F4CB'; }

/* ─── File Attachments ───────────────────── */
.bc-file-attachments {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
.bc-file-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500;
  background: #dbeafe; color: #1e40af; text-decoration: none;
  border: 1px solid #93c5fd; transition: background 0.15s;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bc-file-link:hover { background: #bfdbfe; }
.bc-msg-employee .bc-file-link { background: #dcfce7; color: #166534; border-color: #86efac; }
.bc-msg-employee .bc-file-link:hover { background: #bbf7d0; }
.bc-voice-message {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: min(420px, 100%);
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
}
.bc-msg-employee .bc-voice-message {
  border-color: rgba(34, 197, 94, 0.36);
  background: rgba(20, 83, 45, 0.92);
}
.bc-voice-message-wave {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 24px;
}
.bc-voice-message-wave i {
  display: block;
  width: 3px;
  border-radius: 999px;
  background: #38bdf8;
}
.bc-msg-employee .bc-voice-message-wave i { background: #86efac; }
.bc-voice-message-duration {
  font-size: 11px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #bae6fd;
}
.bc-msg-employee .bc-voice-message-duration { color: #bbf7d0; }
.bc-voice-message-audio {
  height: 28px;
  max-width: 210px;
}
.bc-voice-message-icon {
  width: 24px; height: 24px; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 999px;
  background: rgba(148,163,184,0.18); font-size: 13px; flex: 0 0 auto;
}
.bc-voice-message-notice { flex-basis: 100%; font-size: 12px; line-height: 1.35; color: #fca5a5; }
.bc-voice-message-transcript {
  flex-basis: 100%;
  font-size: 12px;
  line-height: 1.35;
  color: #cbd5e1;
}
.bc-msg-employee .bc-voice-message-transcript { color: #dcfce7; }
.bc-voice-message-missing {
  font-size: 11px;
  color: #fca5a5;
}
.dm-voice-message {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: min(420px, 100%);
  padding: 9px 11px;
  margin: 4px 0;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
}
.dm-voice-message-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
}
.dm-voice-message-audio {
  height: 28px;
  max-width: 240px;
  min-width: 160px;
  flex: 1 1 180px;
}
.dm-voice-message-transcript,
.dm-voice-message-notice {
  flex-basis: 100%;
  font-size: 12px;
  line-height: 1.35;
}
.dm-voice-message-transcript { color: #cbd5e1; }
.dm-voice-message-notice,
.dm-voice-message-missing { color: #fca5a5; }
.bc-file-image-link {
  display: block; max-width: min(420px, 100%); border-radius: 10px;
  overflow: hidden; border: 1px solid rgba(148,163,184,0.35);
  background: rgba(15,23,42,0.05);
}
.bc-file-image {
  display: block; max-width: 100%; max-height: 360px; object-fit: contain;
}

/* ─── File Upload (Boss Chat) ─────────── */
.chat-attach-btn {
  background: none; border: none; font-size: 18px; cursor: pointer;
  padding: 2px 4px; opacity: 0.6; transition: opacity 0.15s;
  flex-shrink: 0;
}
.chat-attach-btn:hover { opacity: 1; }

.bc-file-preview {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 6px 12px; background: #f8fafc; border-top: 1px solid #e2e8f0;
}
.bc-file-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px; font-size: 11px;
  background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd;
}
.bc-file-remove { cursor: pointer; margin-left: 4px; font-size: 10px; opacity: 0.6; }
.bc-file-remove:hover { opacity: 1; color: #dc2626; }

/* ─── Task Progress Indicator (enhanced) ─── */
.bc-task-progress {
  align-self: stretch; background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border: 1px solid #bfdbfe; border-left: 4px solid #2563eb;
  border-radius: 8px; padding: 10px 14px; margin: 8px 0;
  font-size: 12px; color: #1e40af; display: flex; flex-direction: column; gap: 6px;
}
.bc-progress-header {
  display: flex; align-items: center; gap: 8px;
}
.bc-progress-icon { font-size: 18px; flex-shrink: 0; animation: bc-icon-bounce 1.5s ease-in-out infinite; }
.bc-progress-text { flex: 1; font-weight: 500; font-size: 13px; }
.bc-progress-phase { font-size: 10px; opacity: 0.7; white-space: nowrap; }
.bc-progress-bar {
  height: 4px; background: #dbeafe; border-radius: 2px; overflow: hidden;
}
.bc-progress-fill {
  height: 100%; background: #2563eb; border-radius: 2px;
  transition: width 0.5s ease; will-change: width;
}
.bc-progress-details {
  display: flex; gap: 12px; font-size: 10px; color: #6b7280;
}
.bc-progress-details span { display: flex; align-items: center; gap: 3px; }
.bc-progress-goal-name {
  font-size: 11px; color: #64748b; font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
@keyframes bc-icon-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* ─── Resize handle ──────────────────────── */
.bc-resize-handle {
  position: absolute; bottom: 0; right: 0;
  width: 16px; height: 16px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, #cbd5e1 50%, transparent 60%,
              #cbd5e1 70%, transparent 80%);
  opacity: 0.4; transition: opacity 0.15s;
}
.bc-resize-handle:hover { opacity: 0.8; }
.panel.bc-resizing { user-select: none; }
.panel.bc-resizable {
  resize: both; overflow: hidden;
  min-height: 300px; min-width: 400px; height: 700px;
  /* B413.11.b: default grid panels inherit .panel{max-height:600px}.
     Boss chat owns its height so the iframe composer can pin to the
     bottom even outside desktop-floating-layout. */
  max-height: none;
  display: flex; flex-direction: column;
  max-width: calc(100vw - 48px);
  z-index: 2; position: relative;
  transition: box-shadow 0.2s;
}
.panel.bc-resizable:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
/* Boss chat panel-body must flex-contain, not scroll */
.panel.bc-resizable > .panel-body {
  overflow: hidden; display: flex; flex-direction: column;
  flex: 1 1 auto; min-height: 0; height: auto;
}
.panel.bc-resizable > .panel-body > .bc-embed-frame {
  flex: 1 1 auto; min-height: 0; height: auto !important;
  align-self: stretch;
}

/* ─── Goals Dashboard ─────────────────────── */
.goals-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0; background: #f8fafc;
}
.goals-filter, .goals-sort {
  padding: 6px 8px; border: 1px solid #d0d5dd; border-radius: 6px;
  font-size: 12px; background: #fff;
}
.goals-count { font-size: 11px; color: #64748b; margin-left: auto; }
.goals-list {
  padding: 8px 12px; overflow-y: auto; flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.goals-empty {
  text-align: center; color: #94a3b8; padding: 24px; font-size: 13px;
}
.goal-card {
  border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px;
  background: #fff; cursor: pointer; transition: all 0.15s;
  border-left: 4px solid #e2e8f0;
}
.goal-card:hover { border-color: #2563eb; box-shadow: 0 2px 8px rgba(37,99,235,.08); }
.goal-header {
  display: flex; align-items: flex-start; gap: 8px;
}
.goal-icon { flex-shrink: 0; font-size: 14px; margin-top: 1px; }
.goal-desc {
  flex: 1; font-size: 13px; font-weight: 500; color: #1e293b;
  line-height: 1.4;
}
.goal-progress {
  margin-top: 6px; display: flex; align-items: center; gap: 8px;
}
.goal-progress .bc-progress-bar { flex: 1; }
.goal-phase { font-size: 11px; color: #64748b; white-space: nowrap; }
.goal-status-row {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
  font-size: 11px; color: #64748b;
}
.goal-status-label {
  padding: 1px 8px; border-radius: 8px; font-size: 10px; font-weight: 500;
  background: #f1f5f9; color: #475569;
}
.goal-time { font-size: 10px; color: #94a3b8; }
.goal-detail { padding: 8px 0 0 26px; }
.goal-detail.hidden { display: none; }
.goal-phases { margin-bottom: 6px; }
.goal-phase-row {
  display: flex; align-items: center; gap: 6px; padding: 2px 0;
  font-size: 12px; color: #475569;
}
.goal-phase-icon { font-size: 12px; }
.goal-phase-name { flex: 1; }
.goal-stats {
  font-size: 11px; color: #64748b; margin-bottom: 6px;
  display: flex; gap: 4px; flex-wrap: wrap;
}
.goal-actions { display: flex; gap: 6px; }
.goal-actions .btn-sm {
  padding: 4px 12px; border-radius: 6px; border: 1px solid #e2e8f0;
  background: #fff; font-size: 11px; cursor: pointer; color: #475569;
}
.goal-actions .btn-sm:hover { background: #f1f5f9; border-color: #2563eb; color: #1e40af; }
.bc-goal-created { background: #ecfdf5 !important; color: #065f46 !important; border: 1px solid #a7f3d0; }

/* ─── Goal Dividers (Boss Chat) ────────────── */
.bc-goal-divider {
  display: flex; align-items: center; gap: 8px;
  margin: 16px 0 8px; padding: 0; position: relative;
}
.bc-goal-divider::before {
  content: '';
  position: absolute; left: -28px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.2), 0 0 6px rgba(37,99,235,0.15);
  z-index: 1;
  transition: box-shadow 0.2s;
}
.bc-goal-divider:hover::before {
  box-shadow: 0 0 0 3px rgba(37,99,235,0.3), 0 0 10px rgba(37,99,235,0.25);
}
/* Last goal divider pulses to show it's active */
.bc-goal-divider:last-of-type::before {
  animation: goal-pulse 2.5s infinite;
}
@keyframes goal-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(37,99,235,0.2), 0 0 6px rgba(37,99,235,0.15); }
  50% { box-shadow: 0 0 0 3px rgba(37,99,235,0.35), 0 0 12px rgba(37,99,235,0.2); }
}
.bc-goal-divider-line {
  flex: 1; height: 1px; background: linear-gradient(to right, rgba(147,197,253,0.4), transparent);
}
.bc-goal-divider-label {
  font-size: 11px; color: #1e40af;
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  padding: 5px 14px; border-radius: 8px;
  max-width: 85%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600; border: 1px solid rgba(147,197,253,0.5);
  cursor: pointer; transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(37,99,235,0.08);
  letter-spacing: -0.1px;
}
.bc-goal-divider-label:hover {
  background: linear-gradient(135deg, #bfdbfe, #dbeafe);
  border-color: #93c5fd;
  box-shadow: 0 2px 6px rgba(37,99,235,0.12);
  transform: translateX(2px);
}

/* ─── Activity Feed (Boss Chat) ────────────── */
/* ─── Plan Confirmation Buttons ─── */
.bc-confirm-plan {
  align-self: stretch;
  border-left: 3px solid #eab308;
  padding: 14px 18px;
  margin: 8px 0;
  background: linear-gradient(135deg, #fefce8, #fef9c3);
  border-radius: 0 12px 12px 0;
  box-shadow: 0 2px 8px rgba(234,179,8,0.15);
}
.bc-confirm-text {
  font-size: 13px;
  color: #713f12;
  margin-bottom: 12px;
  line-height: 1.4;
}
.bc-confirm-actions {
  display: flex;
  gap: 10px;
}
.bc-confirm-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
}
.bc-confirm-btn:active { transform: scale(0.97); }
.bc-confirm-approve {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 2px 8px rgba(34,197,94,0.3);
  flex: 1;
}
.bc-confirm-approve:hover { box-shadow: 0 4px 12px rgba(34,197,94,0.4); }
.bc-confirm-reject {
  background: rgba(0,0,0,0.06);
  color: #64748b;
}
.bc-confirm-reject:hover { background: rgba(0,0,0,0.1); }
.bc-confirm-sending {
  color: #16a34a;
  font-size: 13px;
  font-weight: 500;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.bc-activity-feed {
  align-self: stretch; border-left: 3px solid #2563eb;
  padding: 10px 14px; margin: 8px 0; background: linear-gradient(135deg, #f8fafc, #eff6ff);
  border-radius: 0 10px 10px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
}
.bc-activity-feed::before {
  content: '';
  position: absolute; left: -26px; top: 14px;
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(139,92,246,0.2);
  z-index: 1;
}
.bc-activity-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-size: 12px; font-weight: 600; color: #1e40af;
}
.bc-activity-header .bc-progress-bar { flex: 1; }
.bc-activity-title { white-space: nowrap; }
.bc-activity-entry {
  display: flex; gap: 8px; padding: 4px 0;
  font-size: 12px; line-height: 1.4;
  border-bottom: 1px solid rgba(226,232,240,0.5);
}
.bc-activity-entry:last-child { font-weight: 500; border-bottom: none; }
.bc-act-icon { flex-shrink: 0; width: 20px; text-align: center; }
.bc-act-text { flex: 1; color: #334155; }
.bc-act-time { flex-shrink: 0; color: #94a3b8; font-size: 11px; }

/* Execution time badge in activity */
.bc-act-duration {
  font-size: 9px; color: #8b5cf6; background: rgba(139,92,246,0.08);
  padding: 1px 6px; border-radius: 8px; white-space: nowrap;
  margin-left: 4px;
}

/* ─── Scroll-to-bottom FAB ────────────────── */
.bc-scroll-fab {
  position: absolute; bottom: 60px; right: 12px;
  width: 28px; height: 28px; border-radius: 50%;
  background: #2563eb; color: #fff; border: none;
  cursor: pointer; font-size: 12px; z-index: 50;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 1px 6px rgba(37,99,235,0.25);
  transition: transform 0.2s, opacity 0.2s;
  opacity: 0.7;
}
.bc-scroll-fab:hover { transform: scale(1.1); opacity: 1; }
.bc-scroll-fab.visible { display: flex; }

/* ─── Delegation Approval Buttons ─────────── */
.bc-delegation-actions {
  display: flex; gap: 8px; margin-top: 8px;
}
.bc-deleg-btn {
  padding: 6px 16px; border-radius: 8px; font-size: 12px;
  font-weight: 500; cursor: pointer; border: none;
  transition: all 0.15s;
}
.bc-deleg-approve {
  background: #22c55e; color: #fff;
}
.bc-deleg-approve:hover { background: #16a34a; }
.bc-deleg-reject {
  background: #f1f5f9; color: #dc2626; border: 1px solid #fecaca;
}
.bc-deleg-reject:hover { background: #fef2f2; }

/* ─── Timeline goal filter ────────────────── */
.bc-tl-goal-filter {
  display: flex; gap: 4px; padding: 6px 12px;
  border-bottom: 1px solid #e2e8f0; flex-wrap: wrap;
}
.bc-tl-goal-btn {
  padding: 2px 8px; border-radius: 10px; font-size: 10px;
  background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis;
}
.bc-tl-goal-btn:hover { border-color: #2563eb; color: #1e40af; }
.bc-tl-goal-btn.active { background: #dbeafe; border-color: #2563eb; color: #1e40af; font-weight: 500; }

/* ─── Sidebar stats ──────────────────────── */
.bc-sidebar-stats {
  padding: 8px 12px; border-top: 1px solid #e2e8f0;
  font-size: 10px; color: #94a3b8;
  display: flex; gap: 8px; justify-content: center;
}
.bc-sidebar-stat { display: flex; align-items: center; gap: 3px; }

/* ─── Minimap strip (v23: replaces sidebar on desktop) ─── */
.bc-content-area {
  display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden;
}
.bc-minimap {
  display: none; /* v24: replaced by integrated audit-trail timeline */
}
.bc-minimap-track {
  position: absolute; top: 0; left: 0; right: 0;
  min-height: 100%;
}
.bc-minimap-marker {
  position: absolute; left: 50%; transform: translateX(-50%);
  cursor: pointer; transition: opacity 0.15s;
  z-index: 1;
}
.bc-minimap-marker:hover { opacity: 1 !important; }
.bc-minimap-marker.mm-goal {
  width: 10px; height: 10px; border-radius: 50%;
  background: #2563eb; opacity: 0.8;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
}
.bc-minimap-marker.mm-boss {
  width: 6px; height: 3px; border-radius: 1px;
  background: #1e293b; opacity: 0.5;
}
.bc-minimap-marker.mm-date {
  width: 18px; height: 1px;
  background: #94a3b8; opacity: 0.4;
}
.bc-minimap-viewport {
  position: absolute; left: 1px; right: 1px;
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.25);
  border-radius: 2px; pointer-events: none;
  transition: top 0.1s ease-out, height 0.1s ease-out;
  z-index: 0;
}
.bc-minimap-tooltip {
  position: fixed; padding: 4px 8px; border-radius: 4px;
  background: #1e293b; color: #fff; font-size: 10px;
  white-space: nowrap; pointer-events: none; z-index: 100;
  max-width: 200px; overflow: hidden; text-overflow: ellipsis;
}

/* ─── Sticky current-goal indicator ────────── */
.bc-current-goal {
  position: sticky; top: 0; z-index: 5;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-bottom: 1px solid rgba(147,197,253,0.4);
  padding: 4px 12px 4px 32px; margin: 0 -14px 6px -42px;
  font-size: 10px; color: #1e40af; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.2s;
}
.bc-current-goal.visible { opacity: 1; }
.bc-current-goal::before {
  content: '';
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: #2563eb;
}

/* ─── Goal-jump dropdown ─────────────────── */
.bc-goal-jump {
  font-size: 11px; padding: 4px 8px; border: 1px solid #93c5fd;
  border-radius: 8px; max-width: 180px;
  background: linear-gradient(135deg, #eff6ff, #fff);
  color: #1e40af; cursor: pointer; flex-shrink: 0;
  font-weight: 500;
}
.bc-goal-jump:focus { outline: none; border-color: #2563eb; }
.bc-goal-jump:empty { display: none; }

/* ─── Semantic search toggle ─────────────── */
/* Search mode toggle group */
.bc-search-mode-group {
  display: flex; gap: 0; flex-shrink: 0;
  border: 1px solid #d0d5dd; border-radius: 8px;
  overflow: hidden;
}
.bc-search-mode {
  font-size: 11px; padding: 4px 10px;
  border: none; background: #fff; color: #64748b;
  cursor: pointer; white-space: nowrap;
  transition: all 0.15s; font-weight: 500;
}
.bc-search-mode:first-child { border-right: 1px solid #d0d5dd; }
.bc-search-mode:hover { color: #2563eb; background: #f8fafc; }
.bc-search-mode.active {
  background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #1e40af;
  font-weight: 600;
}
.bc-search-semantic-badge {
  font-size: 9px; padding: 1px 5px; border-radius: 8px;
  background: #dbeafe; color: #2563eb; margin-left: 4px;
  font-weight: 600; vertical-align: middle;
}
/* Message count pill */
.bc-msg-count {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: #f1f5f9; color: #64748b; flex-shrink: 0;
  font-weight: 500;
}

/* ─── Typing indicator ──────────────────── */
.bc-typing-indicator {
  display: flex; gap: 4px; padding: 10px 14px;
  align-self: flex-start;
}
.bc-typing-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #94a3b8; animation: bc-typing 1.4s infinite;
  will-change: transform, opacity;
}
.bc-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.bc-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bc-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ─── B176: shared chat message collapse ─── */
.b176-msg-collapsible {
  --b176-collapse-lines: 6;
  --b176-collapse-line-height: 1.45em;
  max-height: calc(var(--b176-collapse-lines) * var(--b176-collapse-line-height));
  overflow: hidden;
  position: relative;
}
.b176-msg-collapsible::after {
  content: '...';
  position: absolute;
  right: 0;
  bottom: 0;
  padding-left: 36px;
  color: currentColor;
  background: linear-gradient(90deg, transparent, var(--b176-collapse-bg, #f0fdf4) 45%);
}
.b176-msg-collapsible.b176-msg-expanded {
  max-height: none;
  overflow: visible;
}
.b176-msg-collapsible.b176-msg-expanded::after { display: none; }
.b176-msg-collapse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1d4ed8;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
.b176-msg-collapse-toggle:hover { text-decoration: underline; }
.bc-msg-boss .b176-msg-collapsible { --b176-collapse-bg: #1e293b; }
.bc-msg-employee .b176-msg-collapsible { --b176-collapse-bg: #f0fdf4; }
.bc-msg-system .b176-msg-collapsible { --b176-collapse-bg: #fef3c7; }
.bc-msg-boss .b176-msg-collapse-toggle,
.bc-msg-employee .b176-msg-collapse-toggle,
.dm-desk-bubble .b176-msg-collapse-toggle,
.dm-grp-bubble .b176-msg-collapse-toggle,
.mob-dm-bubble .b176-msg-collapse-toggle,
.mob-dm-grp-bubble .b176-msg-collapse-toggle {
  color: #93c5fd;
}
.dm-desk-msg-sent .b176-msg-collapsible { --b176-collapse-bg: #2b5278; }
.dm-desk-msg-received .b176-msg-collapsible { --b176-collapse-bg: #182533; }
.dm-grp-msg-mine .b176-msg-collapsible, .mob-dm-grp-msg-mine .b176-msg-collapsible { --b176-collapse-bg: #059669; }
.dm-grp-msg-other .b176-msg-collapsible, .mob-dm-grp-msg-other .b176-msg-collapsible { --b176-collapse-bg: #1c1c1e; }
.mob-dm-msg-sent .b176-msg-collapsible { --b176-collapse-bg: #0a84ff; }
.mob-dm-msg-received .b176-msg-collapsible { --b176-collapse-bg: #1c1c1e; }
.mob-detail-content .bc-msg-boss .b176-msg-collapsible { --b176-collapse-bg: #2a5bd7; }
.mob-detail-content .bc-msg-employee .b176-msg-collapsible { --b176-collapse-bg: #1e1e2e; }

/* ─── Message hover actions ──────────────── */
.bc-msg:hover .bc-msg-actions,
.bc-msg:focus-within .bc-msg-actions { opacity: 1; }
.bc-msg-actions {
  position: absolute; top: -8px; right: 8px;
  display: flex; gap: 2px; opacity: 0;
  transition: opacity 0.15s;
}
.bc-msg-action-btn {
  width: 24px; height: 24px; border-radius: 4px;
  background: #fff; border: 1px solid #e2e8f0;
  cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.bc-msg-action-btn:hover { background: #f1f5f9; }
.bc-msg-action-btn:focus { outline: 2px solid #2563eb; outline-offset: 1px; }

/* ─── Empty state ────────────────────────── */
.bc-empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 40px 20px; gap: 12px;
  color: #94a3b8; flex: 1;
}
.bc-empty-icon { font-size: 48px; opacity: 0.4; }
.bc-empty-title { font-size: 14px; font-weight: 500; color: #64748b; }
.bc-empty-hint { font-size: 12px; max-width: 300px; text-align: center; line-height: 1.5; }

/* ─── Phase transition marker ────────────── */
.bc-phase-marker {
  align-self: center; display: flex; align-items: center; gap: 8px;
  margin: 12px 0; padding: 6px 16px; border-radius: 20px;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  border: 1px solid #c7d2fe; font-size: 11px; font-weight: 500;
  color: #4338ca;
}
.bc-phase-marker::before { content: '\u25B6'; font-size: 8px; }

/* ─── Unread indicator ───────────────────── */
.bc-unread-badge {
  position: absolute; top: -4px; right: -4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444; border: 2px solid #fff;
}

/* ─── Employee Cards Panel ─────────────────── */
.cards-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0; background: #f8fafc;
  flex-wrap: wrap;
}
.cards-search {
  flex: 1; min-width: 120px; padding: 6px 10px; border: 1px solid #d0d5dd;
  border-radius: 6px; font-size: 12px;
}
.cards-sort {
  padding: 6px 8px; border: 1px solid #d0d5dd; border-radius: 6px;
  font-size: 12px; background: #fff;
}
.cards-count { font-size: 11px; color: #64748b; }
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px; padding: 12px;
}
.cards-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 8px 12px; border-top: 1px solid #e2e8f0;
}
.cards-page-info { font-size: 11px; color: #64748b; }

.ec-card {
  border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px;
  cursor: pointer; transition: all 0.15s; background: #fff;
  position: relative;
}
.ec-card:hover { border-color: #0891b2; box-shadow: 0 2px 8px rgba(8,145,178,.12); transform: translateY(-1px); }
.ec-flags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.ec-flag {
  font-size: 10px; padding: 2px 8px; border-radius: 8px; font-weight: 500;
}
.ec-flag-warning { background: #fef9c3; color: #854d0e; }
.ec-flag-critical { background: #fee2e2; color: #991b1b; }
.ec-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ec-info { flex: 1; min-width: 0; }
.ec-name { font-size: 14px; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-role { font-size: 11px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-template { font-size: 10px; color: #94a3b8; font-style: italic; }
.ec-mission {
  font-size: 11px; color: #475569; line-height: 1.4; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ec-status-row { display: flex; gap: 4px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.ec-status {
  font-size: 9px; padding: 1px 6px; border-radius: 8px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.ec-status-active { background: #dcfce7; color: #166534; }
.ec-status-paused { background: #fef9c3; color: #854d0e; }
.ec-status-draft { background: #e2e8f0; color: #475569; }
.ec-status-retired { background: #fee2e2; color: #991b1b; }
.ec-channel {
  font-size: 9px; padding: 1px 6px; border-radius: 8px;
  background: #e0e7ff; color: #3730a3; text-transform: uppercase;
}
.ec-boss-badge {
  font-size: 9px; padding: 1px 6px; border-radius: 8px;
  background: #fef3c7; color: #92400e; font-weight: 500;
}
.ec-maturity {
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 10px; border: 1px solid; flex-shrink: 0;
}
.ec-quality-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.ec-qlabel { font-size: 10px; color: #94a3b8; min-width: 42px; }
.ec-qtrack {
  flex: 1; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden;
}
.ec-qfill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.ec-qval { font-size: 11px; font-weight: 600; color: #1e293b; min-width: 36px; text-align: right; }
.ec-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  margin-bottom: 8px;
}
.ec-stat {
  text-align: center; padding: 4px; background: #f8fafc;
  border-radius: 4px;
}
.ec-stat-val { display: block; font-size: 14px; font-weight: 700; color: #1e293b; }
.ec-stat-label { display: block; font-size: 9px; color: #94a3b8; text-transform: uppercase; }
.ec-last-activity {
  font-size: 10px; color: #64748b; margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ec-actions {
  display: flex; gap: 4px; padding-top: 8px; border-top: 1px solid #f0f2f5;
}
.ec-actions button {
  flex: 1; padding: 4px 6px; border: 1px solid #e2e8f0;
  border-radius: 4px; background: #fff; font-size: 10px;
  cursor: pointer; color: #475569;
}
.ec-actions button:hover { background: #f1f5f9; }

/* ─── Execution Clouds Panel ──────────────── */
.cloud-summary {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0; background: #f8fafc;
  font-size: 12px; color: #475569; flex-wrap: wrap;
}
.cloud-summary .cloud-count { font-weight: 600; color: #1e293b; }
.cloud-list { padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.cloud-card {
  border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px;
  border-left: 4px solid #94a3b8; transition: border-color 0.2s;
}
.cloud-card.status-executing { border-left-color: #22c55e; }
.cloud-card.status-completed { border-left-color: #2563eb; }
.cloud-card.status-failed { border-left-color: #ef4444; }
.cloud-card.status-planning { border-left-color: #eab308; }
.cloud-card-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.cloud-status-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.cloud-status-dot.executing { background: #22c55e; animation: cloud-pulse 1.5s ease-in-out infinite; }
.cloud-status-dot.completed { background: #2563eb; }
.cloud-status-dot.failed { background: #ef4444; }
.cloud-status-dot.planning { background: #eab308; }
@keyframes cloud-pulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.4; }
}
.cloud-goal-id { font-family: monospace; font-size: 11px; color: #7c3aed; font-weight: 600; }
.cloud-goal-desc {
  flex: 1; font-size: 12px; color: #1e293b; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cloud-exec-status {
  font-size: 10px; padding: 2px 8px; border-radius: 8px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.cloud-exec-status.executing { background: #dcfce7; color: #166534; }
.cloud-exec-status.completed { background: #dbeafe; color: #1e40af; }
.cloud-exec-status.failed { background: #fee2e2; color: #991b1b; }
.cloud-exec-status.planning { background: #fef9c3; color: #854d0e; }
.cloud-progress {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 11px; color: #475569;
}
.cloud-progress-bar {
  flex: 0 0 100px; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden;
}
.cloud-progress-fill {
  height: 100%; border-radius: 3px; background: #2563eb; transition: width 0.5s;
}
.cloud-progress-fill.executing { background: #22c55e; }
.cloud-actions-breakdown {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px;
  font-size: 11px; color: #475569;
}
.cloud-ctx {
  font-family: monospace; font-size: 11px; color: #64748b;
  margin-bottom: 6px; line-height: 1.6;
}
.cloud-ctx-val { color: #059669; font-weight: 600; }
.cloud-aggregates {
  display: flex; gap: 10px; font-size: 11px; color: #64748b; margin-bottom: 8px; flex-wrap: wrap;
}
.cloud-aggregates span { display: flex; align-items: center; gap: 3px; }
.cloud-btns {
  display: flex; gap: 4px; flex-wrap: wrap; padding-top: 6px;
  border-top: 1px solid #f0f2f5;
}
.cloud-btns button {
  padding: 3px 10px; border-radius: 4px; border: 1px solid #e2e8f0;
  background: #fff; font-size: 10px; cursor: pointer; color: #475569;
}
.cloud-btns button:hover { background: #f1f5f9; }
.cloud-btns button.active { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }
.cloud-btns button.btn-danger { color: #dc2626; border-color: #fecaca; }
.cloud-btns button.btn-danger:hover { background: #fef2f2; }
.cloud-btns button.btn-success { color: #16a34a; border-color: #bbf7d0; }
.cloud-btns button.btn-success:hover { background: #f0fdf4; }
.cloud-steps { margin-top: 8px; }
.cloud-step-row {
  display: flex; align-items: center; gap: 6px; padding: 3px 0;
  font-size: 11px; color: #475569; border-bottom: 1px solid #f8fafc;
}
.cloud-step-row:last-child { border-bottom: none; }
.cloud-step-num { font-family: monospace; color: #94a3b8; min-width: 44px; }
.cloud-step-action { font-weight: 500; color: #1e293b; min-width: 56px; }
.cloud-step-phase { color: #7c3aed; min-width: 32px; }
.cloud-step-ok { min-width: 14px; }
.cloud-step-sizes { color: #64748b; flex: 1; font-family: monospace; }
.cloud-step-cost { color: #059669; font-family: monospace; min-width: 44px; text-align: right; }
/* Popup overlay for knowledge/lessons */
.cloud-popup {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; z-index: 300;
}
.cloud-popup-body {
  background: #fff; border-radius: 12px; padding: 20px;
  max-width: 600px; width: 90%; max-height: 80vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.cloud-popup-body h3 { margin-bottom: 12px; font-size: 16px; }
.cloud-popup-body pre {
  background: #f8fafc; padding: 12px; border-radius: 8px;
  font-size: 11px; line-height: 1.5; overflow-x: auto; white-space: pre-wrap;
}
.cloud-popup-close {
  float: right; background: none; border: none; font-size: 20px;
  cursor: pointer; color: #94a3b8; line-height: 1;
}
.cloud-popup-close:hover { color: #1e293b; }

/* Toast notification */
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* ─── Mobile Responsiveness ───────────────── */

/* Tablet breakpoint */
@media (max-width: 900px) {
  #panelsContainer { grid-template-columns: 1fr; gap: 8px; padding: 8px; }
  .panel { max-height: none; }
  #toolbar { flex-wrap: wrap; gap: 4px; padding: 8px; }
  #toolbar h1 { font-size: 14px; }
  .cards-grid { grid-template-columns: 1fr; }
  .dialog-body { width: 95%; max-width: none; }
}

/* ─── Mobile Shell (Telegram-style) ──────── */
@media (max-width: 768px) {
  /* Hide desktop UI completely */
  #toolbar { display: none !important; }
  #panelsContainer { display: none !important; }
  body.desktop-floating-layout .panel.panel-floating {
    position: static;
    width: auto !important;
    height: auto !important;
    resize: none;
  }
  #addDialog { display: none !important; }
  html, body { overflow: hidden; overscroll-behavior: none; max-width: 100vw; touch-action: pan-y; -webkit-text-size-adjust: 100%; }
  /* Prevent iOS Safari zoom on input focus — all inputs must be 16px+ */
  input, textarea, select { font-size: 16px !important; }

  /* Mobile shell takes over */
  #mobileShell { display: flex !important; }

  /* ─── #1: Login dark theme on mobile ─── */
  #loginOverlay {
    background: #0f0f14;
  }
  #loginOverlay.mob-login {
    background: #0f0f14;
  }
  #loginForm {
    width: 92vw; max-width: 380px; padding: 24px;
    background: #16161e; color: #e2e8f0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  }
  #loginForm h2 { color: #e2e8f0; }
  #loginForm input {
    background: #1e1e2e; color: #e2e8f0;
    border-color: rgba(255,255,255,0.1);
  }
  #loginForm input::placeholder { color: #5c5c5e; }
  #loginForm input:focus {
    border-color: #5b8def;
    box-shadow: 0 0 0 3px rgba(91,141,239,0.15);
  }
  #loginForm button[type="submit"] {
    background: #5b8def;
  }
  #loginForm button[type="submit"]:hover {
    background: #4a7de0;
  }
  #loginTabs {
    width: 92vw; max-width: 380px;
  }
  .login-tab {
    background: #1e1e2e; color: #8e8e93;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .login-tab.active {
    background: #16161e; color: #e2e8f0;
  }
  .login-tab:hover:not(.active) {
    background: #252530;
  }
  #loginForm a[href*="oauth"] {
    background: #1e1e2e !important; color: #e2e8f0 !important;
    border: 1px solid rgba(255,255,255,0.1);
  }
  #loginError { color: #ef4444; }
}

/* Mobile shell structure */
#mobileShell {
  display: none;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  max-width: 100vw;
  background: #0f0f14;
  overflow: hidden;
  position: fixed;
  inset: 0;
  z-index: 50;
  overscroll-behavior: none;
}

/* ─── Mobile Top Bar (#3: iOS-style topbar) ─── */
.mob-topbar {
  display: flex;
  align-items: center;
  height: 56px;
  min-height: 56px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0);
  background: rgba(22,22,30,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  gap: 12px;
  z-index: 10;
}
/* #13: Connection status dot */
.mob-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  flex-shrink: 0;
}
.mob-status-dot.disconnected { background: #ef4444; }
.mob-status-dot.connecting { background: #eab308; }
.mob-topbar-back {
  display: none;
  /* B237.1 — Apple HIG mandates 44pt minimum tap targets; bumped from
     36×36 so back navigation isn't a finger-stretching guessing game. */
  width: 44px; height: 44px;
  background: none; border: none;
  color: #5b8def;
  font-size: 22px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s;
}
.mob-topbar-back:active { background: rgba(91,141,239,0.15); }
.mob-topbar.has-back .mob-topbar-back { display: flex; align-items: center; justify-content: center; }
.mob-brand-logo {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255,255,255,0.93);
  padding: 3px;
  flex-shrink: 0;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand-primary, #5b8def) 22%, transparent);
}
body.workspace-branded .mob-brand-logo { display: block; }
.mob-topbar-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-topbar-subtitle {
  font-size: 12px;
  color: #64748b;
  font-weight: 400;
}
.mob-topbar-actions {
  display: flex;
  gap: 2px;
  align-items: center;
}
.mob-topbar-btn {
  min-width: 44px; min-height: 44px;
  width: 44px; height: 44px;
  background: none; border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: rgba(255,255,255,0.08);
  border-radius: 50%;
  transition: background 0.15s;
}
.mob-topbar-btn:active { background: rgba(255,255,255,0.08); }

/* ─── Mobile Screen Container ─── */
.mob-screens {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.mob-screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: none;
  background: #0f0f14;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
}
.mob-screen.hidden { display: none; }
.mob-screen.slide-out-left { transform: translateX(-30%); opacity: 0; pointer-events: none; }
.mob-screen.slide-in-right { transform: translateX(100%); }

/* ─── Company Tabs (Telegram-style folder tabs) ─── */
.mob-company-tabs {
  display: flex;
  background: rgba(22,22,30,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 9;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s;
  will-change: transform, opacity;
}
.mob-company-tabs.hidden-scroll {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
}
.mob-company-tabs-scroll {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
  width: 100%;
}
.mob-company-tabs-scroll::-webkit-scrollbar { display: none; }
.mob-company-tab {
  flex-shrink: 0;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.mob-company-tab:active { background: rgba(91,141,239,0.08); }
.mob-company-tab.active {
  color: #5b8def;
  border-bottom-color: #5b8def;
  font-weight: 600;
}
.mob-company-tab .mob-company-tab-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* ─── Bottom Tab Bar (#2: iOS-style tab bar) ─── */
.mob-tabs {
  display: flex;
  height: 60px;
  min-height: 60px;
  background: rgba(22,22,30,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 10;
}
.mob-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: #64748b;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.15s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.mob-tab-icon { font-size: 22px; line-height: 1; }
.mob-tab.active { color: #5b8def; }
.mob-tab.active .mob-tab-icon { transform: scale(1.1); }
.mob-tab-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ─── Chat List (Chats Tab) (#4: Telegram-style) ─── */
.mob-chat-list { padding: 0; }
.mob-chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  height: 72px;
  border-bottom: none;
  cursor: pointer;
  transition: background 0.1s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
/* #18: Haptic press effect */
.mob-chat-item:active {
  background: rgba(255,255,255,0.06);
  transform: scale(0.98);
}
/* #4: Telegram-style separator — indented from left, starts after avatar */
.mob-chat-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 76px; /* 16px padding + 48px avatar + 12px gap */
  right: 0;
  height: 1px;
  background: rgba(255,255,255,0.06);
}
.mob-chat-item:last-child::after { display: none; }
.mob-chat-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}
/* #19: Online indicator dot on avatar */
.mob-chat-avatar .mob-avatar-online {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0f0f14;
}
.mob-chat-info { flex: 1; min-width: 0; }
.mob-chat-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-chat-preview {
  font-size: 13px;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  line-height: 1.3;
}
.mob-chat-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  align-self: flex-start;
  padding-top: 2px;
}
.mob-chat-time {
  font-size: 12px;
  color: #8e8e93;
}
.mob-chat-unread {
  background: #5b8def;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.mob-chat-status {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mob-chat-status.online { background: #22c55e; }
.mob-chat-status.busy { background: #f59e0b; }
.mob-chat-status.offline { background: #475569; }
.b473-mobile-list-more {
  width: calc(100% - 32px);
  margin: 10px 16px 14px;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(91,141,239,0.30);
  background: rgba(91,141,239,0.12);
  color: #bfdbfe;
  font-size: 13px;
  font-weight: 700;
}
.b473-mobile-list-more span {
  color: #64748b;
  font-weight: 600;
}

/* B473: iOS accessibility pass. Keep zoom enabled and scale mobile text from rem units. */
@media (max-width: 768px) {
  :root {
    --b473-mobile-touch-target: 2.75rem;
    --b473-mobile-copy: 1rem;
    --b473-mobile-meta: 0.875rem;
    --b473-mobile-caption: 0.75rem;
  }

  .mob-chat-name,
  .mob-team-name,
  .mob-dm-name,
  .mob-dm-bubble,
  .mob-dm-input-row textarea,
  .mob-dm-picker-name {
    font-size: var(--b473-mobile-copy);
  }

  .mob-chat-preview,
  .mob-chat-time,
  .mob-team-role,
  .mob-dm-preview,
  .mob-dm-time,
  .mob-dm-msg-time,
  .mob-dm-picker-email,
  .b473-mobile-list-more,
  .b473-mobile-dm-omitted {
    font-size: var(--b473-mobile-meta);
  }

  .mob-chat-unread,
  .mob-dm-unread {
    font-size: var(--b473-mobile-caption);
  }

  .mob-tab,
  .mob-topbar-btn,
  .mob-topbar-back,
  .mob-dm-item,
  .mob-dm-picker-item,
  .b473-mobile-list-more {
    min-height: var(--b473-mobile-touch-target);
  }

  .mob-dm-inline-btn {
    min-width: var(--b473-mobile-touch-target);
    min-height: var(--b473-mobile-touch-target);
  }
}

/* ─── Search Bar (#6: pill shape like Telegram) ─── */
.mob-search {
  padding: 8px 16px;
  position: sticky;
  top: 0;
  background: #0f0f14;
  z-index: 5;
}
.mob-search input {
  width: 100%;
  height: 42px;
  padding: 10px 14px 10px 36px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  color: #e2e8f0;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.mob-search input::placeholder { color: #5c5c5e; }
.mob-search input:focus { border-color: rgba(91,141,239,0.4); }
.mob-search-icon {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: #475569;
  font-size: 14px;
  pointer-events: none;
}

/* ─── Team Grid (Contacts Tab) ─── */
.mob-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 4px;
  padding: 8px;
}
.mob-team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.mob-team-card:active { background: rgba(255,255,255,0.06); }
.mob-team-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  position: relative;
}
/* #7: Glow for online employees */
.mob-team-avatar.is-online {
  box-shadow: 0 0 0 2px rgba(34,197,94,0.3), 0 0 12px rgba(34,197,94,0.15);
}
.mob-team-avatar .mob-chat-status {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 12px; height: 12px;
  border: 2px solid #0f0f14;
}
.mob-team-name {
  font-size: 13px;
  color: #c8c8cc;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.mob-team-role {
  font-size: 10px;
  color: #475569;
  text-align: center;
}

/* ─── Dashboard Cards (Dashboard Tab) ─── */
.mob-dash-list { padding: 8px; }
.mob-dash-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  background-image: linear-gradient(135deg, rgba(255,255,255,0.02), transparent);
}
.mob-dash-card:active { background: rgba(255,255,255,0.08); }
.mob-dash-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.mob-dash-info { flex: 1; }
.mob-dash-title { font-size: 15px; font-weight: 600; color: #e2e8f0; }
.mob-dash-desc { font-size: 12px; color: #64748b; margin-top: 2px; }
.mob-dash-arrow { color: #3a3a3c; font-size: 20px; }

/* ─── Fullscreen Panel (detail view) (#9: smooth transitions) ─── */
.mob-detail-screen {
  position: absolute;
  inset: 0;
  background: #0f0f14;
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  overscroll-behavior: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
  will-change: transform;
}
.mob-detail-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 56px);
  max-height: calc(100dvh - 56px);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: none;
  max-width: 100vw;
}
/* Override panel styles inside mobile detail view */
.mob-detail-content .panel {
  border-radius: 0;
  max-height: none;
  height: 100%;
  border: none;
  background: #0f0f14;
}
.mob-detail-content .panel-header { display: none; }
.mob-detail-content .panel-body {
  height: 100%;
  max-height: none;
  overflow: visible;
  background: #0f0f14;
  color: #e2e8f0;
}
/* Boss chat fullscreen tweaks */
.mob-detail-content .bc-wrapper {
  height: 100%;
  border: none;
  border-radius: 0;
  background: #0f0f14;
}
.mob-detail-content .bc-sidebar { display: none; }
.mob-detail-content .bc-main { border-radius: 0; }
.mob-detail-content .bc-messages { padding-left: 14px; }
.mob-detail-content .bc-messages::before { display: none; }
.mob-detail-content .bc-goal-divider::before { display: none; }
.mob-detail-content .bc-activity-feed::before { display: none; }
.mob-detail-content .bc-msg-employee::after { display: none; }
.mob-detail-content .bc-msg-boss::after { display: none; }
.mob-detail-content .bc-minimap { display: none !important; }

/* ─── #5: Boss chat dark theme overrides in mobile ─── */
.mob-detail-content .bc-wrapper { background: #0f0f14; }
.mob-detail-content .bc-main { background: #0f0f14; }
.mob-detail-content .bc-messages { background: #0f0f14; }
.mob-detail-content .bc-msg-boss .bc-bubble-body {
  background: #2a5bd7; color: #fff;
  border-radius: 18px 18px 4px 18px;
}
.mob-detail-content .bc-msg-employee .bc-bubble-body {
  background: #1e1e2e; color: #e2e8f0;
  border-radius: 18px 18px 18px 4px;
  border-color: rgba(255,255,255,0.06);
}
.mob-detail-content .bc-msg-system .bc-bubble-body {
  background: rgba(245,158,11,0.12); color: #f59e0b;
}
/* ─── #11: Boss chat input bar dark theme ─── */
.mob-detail-content .chat-input,
.mob-detail-content .bc-input-row {
  position: sticky;
  bottom: 0;
  z-index: 20;
  align-items: flex-end;
  gap: 8px;
  background: linear-gradient(180deg, rgba(20,24,33,0.98), rgba(12,16,24,0.98));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 8px max(10px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom, 0)) max(10px, env(safe-area-inset-right));
}
.mob-detail-content .chat-input textarea {
  flex: 1;
  min-width: 0;
  background: rgba(30,41,59,0.92);
  border: 1px solid rgba(148,163,184,0.18);
  color: #e2e8f0;
  border-radius: 22px;
  min-height: 44px;
  max-height: 150px;
  padding: 11px 16px;
  font-size: 16px;
  line-height: 1.4;
  resize: none;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mob-detail-content .chat-input textarea::placeholder { color: #94a3b8; }
.mob-detail-content .chat-input textarea:focus {
  background: rgba(26,39,68,0.96);
  border-color: rgba(91,141,239,0.5);
  box-shadow: 0 0 0 2px rgba(91,141,239,0.16);
  outline: none;
}
.mob-detail-content .chat-input .chat-send-btn {
  width: 44px;
  height: 44px;
  background: #2563eb;
  border-radius: 50%;
  min-width: 44px;
  min-height: 44px;
  border: none;
  color: white;
}
.mob-detail-content .chat-input .chat-send-btn:hover {
  background: #2350c0;
}
.mob-detail-content .chat-input .chat-attach-btn,
.mob-detail-content .chat-attach-btn {
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: none;
  color: #5b8def;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  font-size: 16px;
  flex-shrink: 0;
}
/* ─── #19: Prevent iOS zoom on textarea focus ─── */
.mob-detail-content textarea { font-size: 16px; }
.mob-detail-content .bc-sidebar { display: none !important; }
.mob-detail-content .bc-sidebar-toggle { display: none !important; }
.mob-detail-content .bc-search-bar { display: none; }
.mob-detail-content .bc-minimap { display: none !important; }
.mob-detail-content .bc-messages::before { display: none !important; }
.mob-detail-content .bc-goal-divider::before { display: none !important; }
.mob-detail-content .bc-activity-feed::before { display: none !important; }
.mob-detail-content .bc-msg-employee::after { display: none !important; }
.mob-detail-content .bc-msg-boss::after { display: none !important; }
.mob-detail-content .bc-avatar { width: 32px; height: 32px; font-size: 11px; }
.mob-detail-content .bc-msg-time { font-size: 11px; color: rgba(255,255,255,0.4); }
.mob-detail-content .bc-sender-name { color: rgba(255,255,255,0.5); }
.mob-detail-content .bc-sender-time { color: rgba(255,255,255,0.3); }
.mob-detail-content .bc-date-sep {
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5);
}
/* #20: Boss chat empty state dark theme */
.mob-detail-content .bc-empty-state {
  color: #64748b;
  background: #0f0f14;
}
.mob-detail-content .bc-empty-icon {
  opacity: 0.3;
  animation: mob-empty-float 3s ease-in-out infinite;
}
.mob-detail-content .bc-empty-title { color: #94a3b8; }
.mob-detail-content .bc-empty-hint { color: #64748b; }
@keyframes mob-empty-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
/* Boss chat goal divider in dark mode */
.mob-detail-content .bc-goal-divider-label {
  background: rgba(91,141,239,0.12); color: #5b8def;
  border-color: rgba(91,141,239,0.2);
}
.mob-detail-content .bc-goal-divider-line {
  background: linear-gradient(to right, rgba(91,141,239,0.2), transparent);
}
/* Task progress in dark mode */
.mob-detail-content .bc-task-progress {
  background: rgba(37,99,235,0.08); border-color: rgba(37,99,235,0.2);
  color: #93c5fd;
}
/* Activity feed in dark mode */
.mob-detail-content .bc-activity-feed {
  background: rgba(255,255,255,0.03); border-left-color: #5b8def;
}
.mob-detail-content .bc-confirm-plan {
  background: rgba(234,179,8,0.08);
  border-left-color: #eab308;
}
.mob-detail-content .bc-confirm-text { color: #fbbf24; }
.mob-detail-content .bc-confirm-reject { background: rgba(255,255,255,0.06); color: #94a3b8; }
.mob-detail-content .bc-activity-header { color: #5b8def; }
.mob-detail-content .bc-act-text { color: #94a3b8; }
/* Self-assessment in dark mode */
.mob-detail-content .bc-self-assess {
  background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08);
  color: #94a3b8;
}
/* File preview in dark mode */
.mob-detail-content .bc-file-preview {
  background: #16161e; border-top-color: rgba(255,255,255,0.06);
}
/* Thinking indicator dark mode */
.mob-detail-content .bc-thinking {
  background: rgba(139,92,246,0.12); border-color: rgba(139,92,246,0.2);
  color: #a78bfa;
}
/* Current goal sticky in dark mode */
.mob-detail-content .bc-current-goal {
  background: rgba(91,141,239,0.1);
  border-bottom-color: rgba(91,141,239,0.15);
  color: #5b8def;
}
/* Scroll FAB in dark mode */
.mob-detail-content .bc-scroll-fab {
  background: #5b8def;
}
/* Slash autocomplete dark mode */
.mob-detail-content .slash-autocomplete {
  background: #1e1e2e; border-color: rgba(255,255,255,0.08);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
}
.mob-detail-content .slash-item:hover,
.mob-detail-content .slash-selected {
  background: rgba(255,255,255,0.06);
}
.mob-detail-content .slash-desc { color: #8e8e93; }
/* Markdown in dark employee bubble */
.mob-detail-content .bc-msg-employee .bc-md-h3 {
  color: #e2e8f0; border-bottom-color: rgba(255,255,255,0.1);
}
.mob-detail-content .bc-msg-employee .bc-md-h4 { color: #cbd5e1; }
.mob-detail-content .bc-msg-employee .bc-md-code {
  background: rgba(255,255,255,0.08); color: #e2e8f0;
}
.mob-detail-content .bc-msg-employee .bc-md-pre {
  background: rgba(255,255,255,0.05); color: #e2e8f0;
}
.mob-detail-content .bc-msg-employee .bc-md-hr { border-top-color: rgba(255,255,255,0.1); }
.mob-detail-content .bc-msg-employee .bc-chip { background: rgba(255,255,255,0.08); color: #94a3b8; }
/* File links in dark mode */
.mob-detail-content .bc-msg-employee .bc-file-link {
  background: rgba(91,141,239,0.12); color: #5b8def;
  border-color: rgba(91,141,239,0.2);
}
.mob-detail-content .bc-msg-boss .bc-file-link {
  background: rgba(255,255,255,0.15); color: #fff;
  border-color: rgba(255,255,255,0.2);
}
/* Delegation buttons dark mode */
.mob-detail-content .bc-deleg-reject {
  background: rgba(255,255,255,0.06); border-color: rgba(239,68,68,0.3);
}
.mob-detail-content .bc-deleg-approve {
  background: #16a34a; color: #fff;
}
/* ─── #12: Phase markers dark mode ─── */
.mob-detail-content .bc-phase-marker {
  background: linear-gradient(135deg, rgba(91,141,239,0.15), rgba(139,92,246,0.15));
  border-color: rgba(91,141,239,0.25);
  color: #93c5fd;
}
/* ─── #12: Confirmation messages dark mode ─── */
.mob-detail-content .bc-delegation-actions {
  border-color: rgba(255,255,255,0.08);
}
/* ─── #16: Topbar avatar ─── */
.mob-topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}

/* ─── Empty State ─── */
.mob-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: #475569;
  text-align: center;
  min-height: 200px;
}
.mob-empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.mob-empty-text { font-size: 15px; font-weight: 500; }
.mob-empty-hint { font-size: 13px; color: #374151; margin-top: 6px; }

/* ─── Section Header ─── */
.mob-section-header {
  padding: 20px 16px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Slash Autocomplete ─── */
.slash-autocomplete {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  margin-bottom: 4px;
  padding: 4px 0;
}
.slash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.1s;
}
.slash-item:hover,
.slash-selected {
  background: #f1f5f9;
}
.slash-cmd {
  font-weight: 600;
  font-size: 13px;
  color: #2563eb;
  white-space: nowrap;
  min-width: 120px;
}
.slash-desc {
  font-size: 12px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Share Popup ──────────────────────────────── */
.share-trigger-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #2563eb;
  line-height: 1;
}
.share-trigger-btn:hover {
  background: #eff6ff;
}
.share-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-popup {
  background: #fff;
  border-radius: 12px;
  width: 420px;
  max-width: 95vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.share-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #e2e8f0;
}
.share-popup-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #94a3b8;
  padding: 0 4px;
  line-height: 1;
}
.share-popup-close:hover {
  color: #334155;
}
.share-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}
.share-search:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}
.share-popup-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px;
  min-height: 200px;
  max-height: 400px;
}
.share-section-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 0 4px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 4px;
}
.share-employee-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}
.share-employee-row:hover {
  background: #f1f5f9;
}
.share-employee-row.selected {
  background: #eff6ff;
}
.share-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 500;
}
.share-badge.owner {
  background: #dcfce7;
  color: #16a34a;
}
.share-badge.hierarchy {
  background: #dbeafe;
  color: #2563eb;
}
.share-badge.participant {
  background: #fef3c7;
  color: #d97706;
}
.share-badge.shared {
  background: #f3e8ff;
  color: #9333ea;
}
.share-popup-footer {
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
}
.share-action-btn {
  padding: 6px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: #475569;
}
.share-action-btn:hover {
  background: #f1f5f9;
}
.share-cancel-btn {
  padding: 8px 16px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.share-submit-btn {
  padding: 8px 16px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.share-submit-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.share-submit-btn:not(:disabled):hover {
  background: #1d4ed8;
}

/* ─── #21: Telegram-style message bubble tails ─── */
.mob-detail-content .bc-msg-boss .bc-bubble-body::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: -6px;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 0 10px 8px;
  border-color: transparent transparent #2a5bd7 transparent;
}
.mob-detail-content .bc-msg-boss .bc-bubble-body {
  position: relative;
}
.mob-detail-content .bc-msg-employee .bc-bubble-body::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -6px;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 8px 10px 0;
  border-color: transparent transparent #1e1e2e transparent;
}
.mob-detail-content .bc-msg-employee .bc-bubble-body {
  position: relative;
}

/* ─── #22: Pull-to-refresh animation ─── */
.mob-pull-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 0;
  overflow: hidden;
  transition: height 0.2s ease;
  background: #0f0f14;
}
.mob-pull-indicator.active {
  height: 50px;
}
.mob-pull-indicator .mob-pull-spinner {
  width: 28px; height: 28px;
  border: 2.5px solid rgba(91,141,239,0.2);
  border-top-color: #5b8def;
  border-radius: 50%;
}
.mob-pull-indicator.active .mob-pull-spinner {
  animation: mob-pull-spin 0.8s linear infinite;
}
@keyframes mob-pull-spin {
  to { transform: rotate(360deg); }
}

/* ─── #23: Mobile typing indicator (3 bouncing dots) ─── */
.mob-typing-indicator {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 12px 16px 4px;
  align-self: flex-start;
}
.mob-typing-indicator .mob-typing-label {
  font-size: 12px;
  color: #64748b;
  margin-right: 6px;
}
.mob-typing-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #5b8def;
  animation: mob-typing-bounce 1.4s ease-in-out infinite;
}
.mob-typing-dot:nth-child(2) { animation-delay: 0.16s; }
.mob-typing-dot:nth-child(3) { animation-delay: 0.32s; }
@keyframes mob-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
  30% { transform: translateY(-8px); opacity: 1; }
}

/* ─── #24: Swipe-back gesture visual feedback ─── */
.mob-detail-screen.swiping-back {
  transition: none !important;
}

/* ─── #25: Pin chat & context menu ─── */
.mob-chat-item.pinned {
  background: rgba(91,141,239,0.04);
}
.mob-chat-pin-icon {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 10px;
  color: #5b8def;
  opacity: 0.7;
}
.mob-ctx-menu {
  position: fixed;
  z-index: 200;
  background: #1e1e2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  min-width: 160px;
  padding: 4px 0;
  overflow: hidden;
  animation: mob-ctx-appear 0.15s ease-out;
}
@keyframes mob-ctx-appear {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.mob-ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.mob-ctx-item:active,
.mob-ctx-item:hover {
  background: rgba(255,255,255,0.06);
}
.mob-ctx-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}
.mob-ctx-overlay {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: transparent;
}

/* ─── #26: Unread badge on Chats tab ─── */
.mob-tab-badge.hidden { display: none; }

/* ─── #27: Employee status subtitle in chat list ─── */
.mob-chat-subtitle-goal {
  color: #5b8def;
  font-style: italic;
}
.mob-chat-subtitle-lastseen {
  color: #64748b;
}

/* ─── #28: Animated tab switching (crossfade) ─── */
.mob-screen-leaving {
  animation: mob-screen-fadeout 150ms ease forwards;
  pointer-events: none;
}
.mob-screen-entering {
  animation: mob-screen-fadein 150ms ease forwards;
}
@keyframes mob-screen-fadeout {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes mob-screen-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── #29: Goal progress banner in boss chat ─── */
.mob-goal-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  background: linear-gradient(135deg, #1e2a4a, #1a2744);
  border-bottom: 1px solid rgba(91,141,239,0.15);
  font-size: 12px;
  color: #93c5fd;
  cursor: pointer;
  transition: background 0.15s;
  overflow: hidden;
  flex-shrink: 0;
}
.mob-goal-banner:active {
  background: linear-gradient(135deg, #243358, #1e2f52);
}
.mob-goal-banner-icon {
  font-size: 14px;
  flex-shrink: 0;
}
.mob-goal-banner-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.mob-goal-banner-progress {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.1);
  flex-shrink: 0;
  overflow: hidden;
}
.mob-goal-banner-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: #5b8def;
  transition: width 0.3s ease;
}
.mob-goal-banner-chevron {
  font-size: 14px;
  color: rgba(147,197,253,0.5);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.mob-goal-banner.expanded .mob-goal-banner-chevron {
  transform: rotate(180deg);
}
.mob-goal-banner-details {
  display: none;
  padding: 10px 14px;
  background: rgba(30,42,74,0.8);
  border-bottom: 1px solid rgba(91,141,239,0.1);
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}
.mob-goal-banner-details.visible {
  display: block;
}
.mob-goal-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.mob-goal-detail-row:last-child { margin-bottom: 0; }
.mob-goal-detail-label {
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.mob-goal-detail-value {
  color: #cbd5e1;
  font-weight: 500;
}

/* ─── #30: Boss chat search bar ─── */
.mob-chat-search-bar {
  display: none;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(15,23,42,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  animation: mob-search-slide-down 150ms ease forwards;
  position: relative;
  z-index: 12;
}
.mob-chat-search-bar.visible {
  display: flex;
}
@keyframes mob-search-slide-down {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.mob-chat-search-bar input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 6px 12px;
  background: rgba(30,41,59,0.92);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 20px;
  color: #e2e8f0;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.mob-chat-search-bar input::placeholder { color: #5c5c5e; }
.mob-chat-search-bar input:focus { border-color: rgba(91,141,239,0.4); }
.mob-chat-search-bar .mob-search-count {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  min-width: 40px;
  text-align: center;
}
.mob-chat-search-bar .mob-search-nav {
  display: flex;
  gap: 2px;
}
.mob-chat-search-bar .mob-search-nav button {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mob-chat-search-bar .mob-search-nav button:active { background: rgba(255,255,255,0.08); }
.mob-chat-search-close {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mob-dm-search-bar {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(15,23,42,0.96);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
  z-index: 12;
}
.mob-dm-search-bar[style*="display:none"] {
  display: none !important;
}
.mob-dm-search-bar input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 6px 12px;
  background: rgba(30,41,59,0.92);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 20px;
  color: #e2e8f0;
  font-size: 16px;
  outline: none;
}
.mob-dm-search-bar button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
}
.mob-chat-search-close:active { background: rgba(255,255,255,0.08); }
.mob-detail-content .bc-msg-highlight {
  background: rgba(245,158,11,0.2) !important;
  border-radius: 4px;
  transition: background 0.3s;
}
.mob-detail-content .bc-msg-highlight-current {
  background: rgba(245,158,11,0.4) !important;
}

/* ─── #31: Profile/Company header card on More tab ─── */
.mob-profile-card {
  margin: 12px 16px 4px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16162a 100%);
  border: 1px solid rgba(91,141,239,0.2);
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.mob-profile-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 15px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(91,141,239,0.3), rgba(139,92,246,0.2), rgba(91,141,239,0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.mob-profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b8def, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(91,141,239,0.3);
}
.mob-profile-info {
  flex: 1;
  min-width: 0;
}
.mob-profile-company {
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-profile-username {
  font-size: 13px;
  color: #8e8e93;
  margin-top: 2px;
}
.mob-profile-plan {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(91,141,239,0.15);
  color: #5b8def;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mob-profile-chevron {
  color: #3a3a3c;
  font-size: 20px;
  flex-shrink: 0;
}

/* ─── #32: Employee action sheet ─── */
.mob-action-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.mob-action-sheet-overlay.visible {
  opacity: 1;
}
.mob-action-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1c1c1e;
  border-radius: 14px 14px 0 0;
  z-index: 201;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: env(safe-area-inset-bottom, 0);
  max-height: 70vh;
  overflow: hidden;
}
.mob-action-sheet.visible {
  transform: translateY(0);
}
.mob-action-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.2);
  margin: 10px auto 6px;
}
.mob-action-sheet-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mob-action-sheet-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}
.mob-action-sheet-name {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
}
.mob-action-sheet-role {
  font-size: 12px;
  color: #8e8e93;
  margin-top: 2px;
}
.mob-action-sheet-items {
  padding: 6px 0 10px;
}
.mob-action-sheet-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.mob-action-sheet-item:active {
  background: rgba(255,255,255,0.08);
}
.mob-action-sheet-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.mob-action-sheet-label {
  font-size: 15px;
  color: #e2e8f0;
  font-weight: 500;
}
.mob-action-sheet-cancel {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 14px 20px;
  text-align: center;
  font-size: 15px;
  color: #ef4444;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mob-action-sheet-cancel:active {
  background: rgba(255,255,255,0.06);
}

/* ─── #33: Voice message button (mic/send toggle) ─── */
.mob-detail-content .chat-input .mob-mic-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #5b8def;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.15s ease;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}
.mob-detail-content .chat-input .mob-mic-btn:active {
  transform: scale(0.9);
}
.mob-detail-content .chat-input .mob-mic-btn.is-arming,
.mob-detail-content .chat-input .mob-mic-btn.is-recording {
  background: #ef4444;
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.16);
}
.mob-detail-content .chat-input .mob-mic-btn.is-recording {
  animation: mob-boss-mic-hold-pulse 1s ease-in-out infinite;
}
.mob-detail-content .chat-input .mob-mic-btn .mob-mic-icon,
.mob-detail-content .chat-input .mob-mic-btn .mob-send-icon {
  position: absolute;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.mob-detail-content .chat-input .mob-mic-btn.has-text .mob-mic-icon {
  opacity: 0;
  transform: scale(0.5);
}
.mob-detail-content .chat-input .mob-mic-btn.has-text .mob-send-icon {
  opacity: 1;
  transform: scale(1);
}
.mob-detail-content .chat-input .mob-mic-btn:not(.has-text) .mob-mic-icon {
  opacity: 1;
  transform: scale(1);
}
.mob-detail-content .chat-input .mob-mic-btn:not(.has-text) .mob-send-icon {
  opacity: 0;
  transform: scale(0.5);
}
.mob-detail-content .chat-input .mob-boss-mic-recording {
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(239, 68, 68, 0.32);
  border-radius: 999px;
  background: rgba(127, 29, 29, 0.55);
  color: #fee2e2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 24px rgba(127, 29, 29, 0.22);
}
.mob-detail-content .chat-input .mob-boss-mic-recording:not([style*="display: none"]) {
  display: flex;
}
.mob-detail-content .chat-input .mob-boss-mic-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #fca5a5;
  animation: mob-boss-mic-dot-pulse 1s ease-in-out infinite;
  flex-shrink: 0;
}
.mob-detail-content .chat-input .mob-boss-mic-timer {
  color: #fff;
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  text-align: right;
}
.mob-detail-content .chat-input .mob-boss-voice-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  font-size: 12px;
}
.mob-detail-content .chat-input .mob-boss-voice-preview.is-sending {
  opacity: 0.72;
}
.mob-detail-content .chat-input .mob-boss-voice-wave {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 20px;
}
.mob-detail-content .chat-input .mob-boss-voice-wave i {
  display: block;
  width: 3px;
  border-radius: 999px;
  background: #38bdf8;
}
.mob-detail-content .chat-input .mob-boss-voice-wave i:nth-child(1) { height: 8px; }
.mob-detail-content .chat-input .mob-boss-voice-wave i:nth-child(2) { height: 15px; }
.mob-detail-content .chat-input .mob-boss-voice-wave i:nth-child(3) { height: 11px; }
.mob-detail-content .chat-input .mob-boss-voice-wave i:nth-child(4) { height: 18px; }
.mob-detail-content .chat-input .mob-boss-voice-wave i:nth-child(5) { height: 10px; }
.mob-detail-content .chat-input .mob-boss-voice-meta {
  flex: 1;
  min-width: 0;
  font-weight: 700;
}
.mob-detail-content .chat-input .mob-boss-voice-error {
  color: #fca5a5;
}
.mob-detail-content .chat-input .mob-boss-voice-preview button {
  border: 0;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}
.mob-detail-content .chat-input .mob-boss-voice-send {
  background: #38bdf8;
  color: #082f49;
}
.mob-detail-content .chat-input .mob-boss-voice-delete {
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
}
@keyframes mob-boss-mic-hold-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.94); }
}
@keyframes mob-boss-mic-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.72); }
}

/* ─── #34: Chat list swipe actions ─── */
.mob-chat-item-wrapper {
  position: relative;
  overflow: hidden;
}
.mob-chat-item-wrapper .mob-chat-item {
  position: relative;
  z-index: 1;
  background: #0f0f14;
  transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.mob-chat-item-wrapper .mob-chat-item.swiping {
  transition: none;
}
.mob-swipe-actions {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: stretch;
  z-index: 0;
}
.mob-swipe-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  width: 72px;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mob-swipe-btn-mute {
  background: #636366;
}
.mob-swipe-btn-pin {
  background: #5b8def;
}
.mob-swipe-btn .mob-swipe-icon {
  font-size: 20px;
  line-height: 1;
}

/* ─── #35: Haptic feedback micro-animations ─── */
.mob-tab:active .mob-tab-icon {
  transform: scale(0.85);
  transition: transform 0.08s ease;
}
.mob-tab .mob-tab-icon {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mob-chat-item:active {
  transform: scale(0.98);
  transition: transform 0.08s ease;
}
.mob-topbar-btn:active {
  transform: scale(0.88);
  transition: transform 0.08s ease;
}
.mob-topbar-btn {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s;
}
.mob-dash-card:active {
  transform: scale(0.97);
  transition: transform 0.08s ease;
}
.mob-dash-card {
  transition: background 0.15s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mob-team-card:active {
  transform: scale(0.95);
  transition: transform 0.08s ease;
}
.mob-team-card {
  transition: background 0.15s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mob-action-sheet-item:active {
  background: rgba(255,255,255,0.1);
  transform: scale(0.98);
  transition: transform 0.08s ease, background 0.08s;
}
.mob-detail-content .chat-send-btn:active,
.mob-detail-content .mob-mic-btn:active {
  transform: scale(0.85);
  transition: transform 0.08s ease;
}
.mob-ctx-item:active {
  transform: scale(0.97);
  transition: transform 0.08s ease;
}
.mob-goal-banner:active {
  transform: scale(0.98);
  transition: transform 0.08s ease;
}
.mob-topbar-back:active {
  transform: scale(0.88);
  transition: transform 0.08s ease;
}

/* ─── #36: Dark theme for embedded panels (Fleet, Cards, Cost, Clouds, Usage) ─── */
.mob-detail-content .loading { color: #94a3b8; background: transparent; }
.mob-detail-content .empty { color: #64748b; background: transparent; }

/* Fleet Dashboard dark */
.mob-detail-content .fleet-toolbar {
  background: rgba(255,255,255,0.03); border-bottom-color: rgba(255,255,255,0.06);
}
.mob-detail-content .fleet-toolbar .fleet-count { color: #8e8e93; }
.mob-detail-content .fleet-toolbar button {
  background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08);
  color: #94a3b8;
}
.mob-detail-content .fleet-toolbar button:hover { background: rgba(255,255,255,0.1); }
.mob-detail-content .fleet-toolbar button.active {
  background: #5b8def; color: #fff; border-color: #5b8def;
}
.mob-detail-content .fleet-grid { background: #0f0f14; }
.mob-detail-content .fleet-card {
  background: #16161e; border-color: rgba(255,255,255,0.06);
}
.mob-detail-content .fleet-card:hover {
  border-color: #5b8def; box-shadow: 0 2px 8px rgba(91,141,239,0.15);
}
.mob-detail-content .fleet-card-name { color: #e2e8f0; }
.mob-detail-content .fleet-card-template { color: #8e8e93; }
.mob-detail-content .fleet-card-stats { }
.mob-detail-content .fleet-stat {
  background: rgba(255,255,255,0.04); border-radius: 6px;
}
.mob-detail-content .fleet-stat-label { color: #64748b; }
.mob-detail-content .fleet-stat-value { color: #cbd5e1; }
.mob-detail-content .fleet-actions {
  border-top-color: rgba(255,255,255,0.06);
}
.mob-detail-content .fleet-actions button {
  background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08);
  color: #94a3b8;
}
.mob-detail-content .fleet-actions button:hover { background: rgba(255,255,255,0.08); }
.mob-detail-content .fleet-actions button.btn-danger { color: #ef4444; border-color: rgba(239,68,68,0.3); }
.mob-detail-content .fleet-actions button.btn-success { color: #22c55e; border-color: rgba(34,197,94,0.3); }

/* Employee Cards (ec-card) dark */
.mob-detail-content .cards-grid { background: #0f0f14; }
.mob-detail-content .cards-toolbar {
  background: rgba(255,255,255,0.03); border-bottom-color: rgba(255,255,255,0.06);
}
.mob-detail-content .cards-search {
  background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08);
  color: #e2e8f0;
}
.mob-detail-content .cards-search::placeholder { color: #5c5c5e; }
.mob-detail-content .cards-sort {
  background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08);
  color: #e2e8f0;
}
.mob-detail-content .cards-count { color: #8e8e93; }
.mob-detail-content .ec-card {
  background: #16161e; border-color: rgba(255,255,255,0.06);
}
.mob-detail-content .ec-card:hover {
  border-color: #0891b2; box-shadow: 0 2px 8px rgba(8,145,178,0.15);
}
.mob-detail-content .ec-name { color: #e2e8f0; }
.mob-detail-content .ec-role { color: #8e8e93; }
.mob-detail-content .ec-template { color: #64748b; }
.mob-detail-content .ec-mission { color: #94a3b8; }
.mob-detail-content .ec-stat {
  background: rgba(255,255,255,0.04);
}
.mob-detail-content .ec-stat-val { color: #cbd5e1; }
.mob-detail-content .ec-stat-label { color: #64748b; }
.mob-detail-content .ec-last-activity { color: #64748b; }
.mob-detail-content .ec-qtrack { background: rgba(255,255,255,0.08); }
.mob-detail-content .ec-qlabel { color: #64748b; }
.mob-detail-content .ec-qval { color: #cbd5e1; }
.mob-detail-content .ec-actions {
  border-top-color: rgba(255,255,255,0.06);
}
.mob-detail-content .ec-actions button {
  background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08);
  color: #94a3b8;
}
.mob-detail-content .ec-actions button:hover { background: rgba(255,255,255,0.08); }
.mob-detail-content .cards-pagination {
  border-top-color: rgba(255,255,255,0.06);
}
.mob-detail-content .cards-page-info { color: #64748b; }
.mob-detail-content .cards-pagination button {
  background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08);
  color: #94a3b8;
}

/* Cost & Routing dark */
.mob-detail-content .cost-grid { background: #0f0f14; }
.mob-detail-content .cost-card {
  background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.06);
}
.mob-detail-content .cost-card .big-value { color: #e2e8f0; }
.mob-detail-content .cost-card .label { color: #64748b; }
.mob-detail-content .cost-card.highlight {
  background: rgba(22,163,74,0.08); border-color: rgba(22,163,74,0.2);
}
.mob-detail-content .cost-card.highlight .big-value { color: #22c55e; }
.mob-detail-content .cost-legend { color: #8e8e93; }

/* Execution Clouds dark */
.mob-detail-content .cloud-summary {
  background: rgba(255,255,255,0.03); border-bottom-color: rgba(255,255,255,0.06);
  color: #94a3b8;
}
.mob-detail-content .cloud-summary .cloud-count { color: #e2e8f0; }
.mob-detail-content .cloud-list { background: #0f0f14; }
.mob-detail-content .cloud-card {
  background: #16161e; border-color: rgba(255,255,255,0.06);
}
.mob-detail-content .cloud-goal-desc { color: #e2e8f0; }
.mob-detail-content .cloud-progress { color: #94a3b8; }
.mob-detail-content .cloud-progress-bar { background: rgba(255,255,255,0.08); }
.mob-detail-content .cloud-actions-breakdown { color: #94a3b8; }
.mob-detail-content .cloud-ctx { color: #8e8e93; }
.mob-detail-content .cloud-ctx-val { color: #22c55e; }
.mob-detail-content .cloud-aggregates { color: #8e8e93; }
.mob-detail-content .cloud-btns { border-top-color: rgba(255,255,255,0.06); }
.mob-detail-content .cloud-btns button {
  background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08);
  color: #94a3b8;
}
.mob-detail-content .cloud-btns button:hover { background: rgba(255,255,255,0.08); }
.mob-detail-content .cloud-btns button.active {
  background: rgba(91,141,239,0.12); border-color: rgba(91,141,239,0.3); color: #5b8def;
}
.mob-detail-content .cloud-btns button.btn-danger { color: #ef4444; border-color: rgba(239,68,68,0.3); }
.mob-detail-content .cloud-btns button.btn-success { color: #22c55e; border-color: rgba(34,197,94,0.3); }
.mob-detail-content .cloud-step-row { border-bottom-color: rgba(255,255,255,0.04); }
.mob-detail-content .cloud-step-num { color: #64748b; }
.mob-detail-content .cloud-step-action { color: #e2e8f0; }
.mob-detail-content .cloud-step-sizes { color: #8e8e93; }
.mob-detail-content .cloud-step-cost { color: #22c55e; }
.mob-detail-content .cloud-popup { background: rgba(0,0,0,0.7); }
.mob-detail-content .cloud-popup-body {
  background: #16161e; color: #e2e8f0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.mob-detail-content .cloud-popup-body h3 { color: #e2e8f0; }
.mob-detail-content .cloud-popup-body pre {
  background: rgba(255,255,255,0.04); color: #cbd5e1;
}
.mob-detail-content .cloud-popup-close { color: #64748b; }
.mob-detail-content .cloud-popup-close:hover { color: #e2e8f0; }

/* Employee Detail dark */
.mob-detail-content .detail-section {
  border-bottom-color: rgba(255,255,255,0.06);
}
.mob-detail-content .detail-section-title { color: #64748b; }
.mob-detail-content .detail-stat-card {
  background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.06);
}
.mob-detail-content .detail-stat-card .value { color: #e2e8f0; }
.mob-detail-content .detail-stat-card .label { color: #64748b; }
.mob-detail-content .detail-actions button {
  background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08);
  color: #94a3b8;
}
.mob-detail-content .detail-actions button:hover { background: rgba(255,255,255,0.08); }
.mob-detail-content .detail-actions button.primary {
  background: #5b8def; color: #fff; border-color: #5b8def;
}
.mob-detail-content .detail-actions button.danger {
  color: #ef4444; border-color: rgba(239,68,68,0.3);
}
.mob-detail-content .autonomy-gauge {
  background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.06);
}
.mob-detail-content .autonomy-bar { background: rgba(255,255,255,0.08); }
.mob-detail-content .autonomy-label { color: #cbd5e1; }

/* Training panel dark */
.mob-detail-content .training-stats { background: #0f0f14; }
.mob-detail-content .training-stat {
  background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.06);
}
.mob-detail-content .training-stat .big-value { color: #e2e8f0; }
.mob-detail-content .training-stat .label { color: #64748b; }
.mob-detail-content .draft-card {
  border-color: rgba(255,255,255,0.06); background: #16161e;
}
.mob-detail-content .draft-header { color: #8e8e93; }
.mob-detail-content .draft-content {
  background: rgba(255,255,255,0.04); color: #cbd5e1;
}
.mob-detail-content .draft-actions button {
  background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08);
  color: #94a3b8;
}
.mob-detail-content .rule-item { border-bottom-color: rgba(255,255,255,0.06); }
.mob-detail-content .rule-trigger { color: #5b8def; }
.mob-detail-content .rule-response { color: #94a3b8; }
.mob-detail-content .rule-meta { color: #64748b; }

/* Ouroboros/DNA dark */
.mob-detail-content .ouro-tabs {
  background: rgba(255,255,255,0.02); border-bottom-color: rgba(255,255,255,0.06);
}
.mob-detail-content .ouro-tab { color: #8e8e93; }
.mob-detail-content .ouro-tab:hover { color: #e2e8f0; }
.mob-detail-content .ouro-tab.active { color: #a78bfa; border-bottom-color: #a78bfa; }
.mob-detail-content .ouro-content { background: #0f0f14; }
.mob-detail-content .dna-fact {
  background: #16161e; border-color: rgba(255,255,255,0.06);
}
.mob-detail-content .dna-fact-trigger { color: #a78bfa; }
.mob-detail-content .dna-fact-confidence {
  background: rgba(139,92,246,0.12); color: #a78bfa;
}
.mob-detail-content .dna-fact-text { color: #94a3b8; }
.mob-detail-content .dna-fact-meta { color: #64748b; }
.mob-detail-content .dna-fact-actions button {
  background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08);
}
.mob-detail-content .self-model-box {
  background: rgba(139,92,246,0.08); border-color: rgba(139,92,246,0.2);
  color: #a78bfa;
}
.mob-detail-content .block-card {
  background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.06);
}
.mob-detail-content .block-date { color: #e2e8f0; }
.mob-detail-content .block-count { color: #8e8e93; }
.mob-detail-content .timeline-event { border-bottom-color: rgba(255,255,255,0.06); }
.mob-detail-content .timeline-event-type { color: #e2e8f0; }
.mob-detail-content .timeline-event-time { color: #64748b; }

/* Group Chats dark */
.mob-detail-content .gc-item { border-bottom-color: rgba(255,255,255,0.06); }
.mob-detail-content .gc-item:hover { background: rgba(255,255,255,0.04); }
.mob-detail-content .gc-item.active { background: rgba(91,141,239,0.08); }
.mob-detail-content .gc-icon {
  background: rgba(91,141,239,0.15); color: #5b8def;
}
.mob-detail-content .gc-name { color: #e2e8f0; }
.mob-detail-content .gc-members { color: #64748b; }
.mob-detail-content .gc-messages {
  background: rgba(255,255,255,0.02); border-bottom-color: rgba(255,255,255,0.06);
}
.mob-detail-content .gc-msg-content { color: #cbd5e1; }
.mob-detail-content .gc-msg.directive {
  background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.2);
}
.mob-detail-content .gc-input-row { border-top-color: rgba(255,255,255,0.06); }
.mob-detail-content .gc-input-row input {
  background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08);
  color: #e2e8f0;
}

/* Voice panel dark */
.mob-detail-content .voice-panel { background: #0f0f14; }

/* Generic overrides for any remaining light elements */
.mob-detail-content .info-row { border-bottom-color: rgba(255,255,255,0.06); }
.mob-detail-content .info-row .label { color: #64748b; }
.mob-detail-content .info-row .value { color: #e2e8f0; }
.mob-detail-content .btn-sm {
  background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08);
  color: #94a3b8;
}
.mob-detail-content .btn-sm:hover { background: rgba(255,255,255,0.08); }
.mob-detail-content .btn-sm.primary { background: #5b8def; color: #fff; border-color: #5b8def; }
.mob-detail-content select,
.mob-detail-content input:not([type="file"]) {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
  color: #e2e8f0;
}
.mob-detail-content select option { background: #16161e; color: #e2e8f0; }
.mob-detail-content table { border-collapse: collapse; width: 100%; }
.mob-detail-content th {
  background: rgba(255,255,255,0.04); color: #94a3b8;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 8px; text-align: left; font-size: 11px;
}
.mob-detail-content td {
  color: #cbd5e1; border-bottom: 1px solid rgba(255,255,255,0.04);
  padding: 6px 8px; font-size: 12px;
}
.mob-detail-content h3, .mob-detail-content h4 { color: #e2e8f0; }
.mob-detail-content a { color: #5b8def; }
.mob-detail-content hr { border-color: rgba(255,255,255,0.06); }

/* ─── #37: Toast notification system ─── */
.mob-toast-container {
  position: fixed;
  bottom: 80px;
  left: 12px;
  right: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}
.mob-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(22,22,30,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  pointer-events: auto;
  animation: mob-toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 100%;
  overflow: hidden;
}
.mob-toast.removing {
  animation: mob-toast-out 0.25s ease forwards;
}
@keyframes mob-toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes mob-toast-out {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(20px); opacity: 0; }
}
.mob-toast-accent {
  width: 4px;
  min-height: 28px;
  border-radius: 2px;
  flex-shrink: 0;
  align-self: stretch;
}
.mob-toast-success .mob-toast-accent { background: #22c55e; }
.mob-toast-error .mob-toast-accent { background: #ef4444; }
.mob-toast-info .mob-toast-accent { background: #5b8def; }
.mob-toast-warning .mob-toast-accent { background: #f59e0b; }
.mob-toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.mob-toast-message {
  flex: 1;
  font-size: 14px;
  color: #e2e8f0;
  line-height: 1.4;
  min-width: 0;
  word-wrap: break-word;
}
.mob-toast-close {
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.mob-toast-close:active { background: rgba(255,255,255,0.08); }

/* ─── #38: File attachment preview bar ─── */
.mob-file-preview-bar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(22,22,30,0.95);
  border-top: 1px solid rgba(255,255,255,0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}
.mob-file-preview-bar:empty { display: none; }
.mob-file-thumb {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mob-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mob-file-thumb-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
  gap: 2px;
}
.mob-file-thumb-icon {
  font-size: 22px;
}
.mob-file-thumb-name {
  font-size: 9px;
  color: #94a3b8;
  max-width: 56px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-file-thumb-size {
  font-size: 8px;
  color: #64748b;
}
.mob-file-thumb-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  border: 2px solid #0f0f14;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 1;
}

/* ─── #39: Landscape mode support ─── */
@media (max-width: 768px) and (orientation: landscape) {
  .mob-tabs {
    height: 40px;
    min-height: 40px;
    padding-bottom: 0;
  }
  .mob-tab {
    font-size: 0;
    gap: 0;
    padding: 4px 12px;
  }
  .mob-tab-icon {
    font-size: 16px;
  }
  .mob-topbar {
    height: 44px;
    min-height: 44px;
  }
  .mob-topbar-title {
    font-size: 15px;
  }
  .mob-topbar-subtitle {
    font-size: 11px;
  }
  .mob-detail-content .bc-msg-boss .bc-bubble-body,
  .mob-detail-content .bc-msg-employee .bc-bubble-body {
    max-width: 70%;
  }
  .mob-search {
    padding: 6px 12px;
  }
  .mob-search input {
    height: 32px;
    font-size: 13px;
  }
  .mob-chat-search-bar {
    padding: 4px 10px;
  }
  .mob-goal-banner {
    height: 30px;
    min-height: 30px;
    font-size: 11px;
  }
  .mob-toast-container {
    bottom: 50px;
  }
}

/* ─── #40: Accessibility — prefers-reduced-motion ─── */
@media (prefers-reduced-motion: reduce) {
  .mob-detail-screen,
  .mob-screen-leaving,
  .mob-screen-entering,
  .mob-toast,
  .mob-toast.removing,
  .mob-action-sheet,
  .mob-action-sheet-overlay,
  .mob-ctx-menu,
  .mob-pull-indicator .mob-pull-spinner,
  .mob-typing-dot,
  .mob-tab .mob-tab-icon,
  .mob-chat-item,
  .mob-topbar-btn,
  .mob-dash-card,
  .mob-team-card,
  .mob-chat-search-bar,
  .mob-goal-banner-chevron,
  .mob-goal-banner-progress-fill,
  .mob-detail-content .chat-input .mob-mic-btn .mob-mic-icon,
  .mob-detail-content .chat-input .mob-mic-btn .mob-send-icon,
  .mob-detail-content .bc-empty-icon,
  .mob-msg-action-menu,
  .mob-reply-bar,
  .mob-create-group-screen,
  .mob-fab {
    animation: none !important;
    transition: none !important;
  }
  .mob-screen-leaving { opacity: 0; }
  .mob-screen-entering { opacity: 1; }
  .mob-detail-screen { transform: translateX(0); opacity: 1; }
  .mob-toast { transform: translateY(0); opacity: 1; }
  .mob-toast.removing { opacity: 0; }
}

/* ─── #41: Message action menu (long-press) ─── */
.mob-msg-action-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.mob-msg-action-menu {
  position: fixed;
  z-index: 8001;
  background: rgba(22,22,30,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  min-width: 160px;
  overflow: hidden;
  animation: mob-action-menu-in 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes mob-action-menu-in {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.mob-msg-action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  font-size: 15px;
  color: #e2e8f0;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.1s;
}
.mob-msg-action-item:last-child { border-bottom: none; }
.mob-msg-action-item:active { background: rgba(255,255,255,0.08); }
.mob-msg-action-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

/* Reply preview bar */
.mob-reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(22,22,30,0.95);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid #5b8def;
  flex-shrink: 0;
  animation: mob-reply-bar-in 0.2s ease;
}
@keyframes mob-reply-bar-in {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.mob-reply-bar-content {
  flex: 1;
  min-width: 0;
}
.mob-reply-bar-sender {
  font-size: 12px;
  font-weight: 600;
  color: #5b8def;
  margin-bottom: 2px;
}
.mob-reply-bar-text {
  font-size: 13px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.mob-reply-bar-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: none;
  border: none;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mob-reply-bar-close:active { background: rgba(255,255,255,0.08); }

/* ─── #42: Message read receipts ─── */
.mob-msg-status {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  font-size: 12px;
  line-height: 1;
  vertical-align: middle;
}
.mob-msg-status-sent { color: rgba(255,255,255,0.35); }
.mob-msg-status-delivered { color: rgba(255,255,255,0.45); }
.mob-msg-status-read { color: #5b8def; }

/* ─── #43: Global search results ─── */
.mob-global-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 60vh;
  overflow-y: auto;
  background: rgba(15,15,20,0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 100;
  display: none;
}
.mob-global-search-results.visible { display: block; }
.mob-global-search-group {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mob-global-search-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #5b8def;
}
.mob-global-search-group-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.mob-global-search-item {
  padding: 8px 14px 8px 44px;
  font-size: 13px;
  color: #cbd5e1;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-global-search-item:active { background: rgba(255,255,255,0.05); }
.mob-global-search-item .mob-gsr-role {
  font-size: 11px;
  color: #5b8def;
  margin-right: 6px;
}
.mob-global-search-item .mob-gsr-match {
  color: #f59e0b;
  font-weight: 600;
}
.mob-global-search-loading {
  padding: 16px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}
.mob-global-search-empty {
  padding: 24px 16px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

/* ─── #44: FAB + Create group UI ─── */
.mob-fab {
  position: fixed;
  bottom: 80px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #5b8def;
  color: #fff;
  border: none;
  font-size: 26px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(91,141,239,0.4);
  cursor: pointer;
  z-index: 200;
  transition: transform 0.15s, box-shadow 0.15s;
}
.mob-fab:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(91,141,239,0.3);
}
.mob-create-group-screen {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #0f0f14;
  display: flex;
  flex-direction: column;
  animation: mob-create-group-in 0.25s ease;
}
@keyframes mob-create-group-in {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.mob-create-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #1a1a24;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.mob-create-group-header-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  color: #e2e8f0;
}
.mob-create-group-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}
.mob-create-group-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.mob-create-group-body input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #e2e8f0;
  font-size: 15px;
  margin-bottom: 16px;
  outline: none;
}
.mob-create-group-body input[type="text"]:focus {
  border-color: rgba(91,141,239,0.4);
}
.mob-create-group-body input[type="text"]::placeholder { color: #5c5c5e; }
.mob-create-group-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.mob-employee-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
}
.mob-employee-checkbox:active { opacity: 0.7; }
.mob-employee-checkbox-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.mob-employee-checkbox-info {
  flex: 1;
  min-width: 0;
}
.mob-employee-checkbox-name {
  font-size: 14px;
  color: #e2e8f0;
  font-weight: 500;
}
.mob-employee-checkbox-role {
  font-size: 12px;
  color: #64748b;
}
.mob-employee-checkbox-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.mob-employee-checkbox.selected .mob-employee-checkbox-check {
  background: #5b8def;
  border-color: #5b8def;
}
.mob-employee-checkbox.selected .mob-employee-checkbox-check::after {
  content: '\2713';
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.mob-create-group-footer {
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.mob-create-group-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: #5b8def;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.mob-create-group-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.mob-create-group-btn:active:not(:disabled) { opacity: 0.8; }

/* Groups section in chat list */
.mob-groups-section {
  padding: 8px 14px 4px;
}
.mob-groups-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.mob-group-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
}
.mob-group-item:active { background: rgba(255,255,255,0.04); }
.mob-group-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b8def, #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.mob-group-info { flex: 1; min-width: 0; }
.mob-group-name {
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
}
.mob-group-members {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

/* ─── #45: Telegram-style message timestamps ─── */
.mob-detail-content .bc-date-sep {
  display: flex;
  justify-content: center;
  padding: 8px 0;
  margin: 4px 0;
}
.mob-detail-content .bc-date-sep-pill {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}
.mob-detail-content .bc-msg-time-inline {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  line-height: 1;
}
.mob-detail-content .bc-msg-employee .bc-msg-time-inline {
  color: rgba(255,255,255,0.4);
}
.mob-detail-content .bc-msg-boss .bc-msg-time-inline {
  color: rgba(255,255,255,0.5);
}

/* ═══════════════════════════════════════════════════════════════════════
   ITERATIONS 46-50 — Emoji reactions, Link previews, Image viewer,
   Scroll-to-bottom, Virtual scroll
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── #46: Emoji Reaction Bar (long-press on messages) ─── */
.mob-reaction-bar {
  position: absolute;
  display: flex;
  gap: 2px;
  background: #1e1e2e;
  border-radius: 24px;
  padding: 4px 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.08);
  z-index: 310;
  transform: scale(0);
  opacity: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease;
  pointer-events: none;
}
.mob-reaction-bar.visible {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}
.mob-reaction-bar-emoji {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.mob-reaction-bar-emoji:hover {
  background: rgba(255,255,255,0.1);
}
.mob-reaction-bar-emoji:active {
  transform: scale(1.3);
}
.mob-reaction-bar-overlay {
  position: fixed;
  inset: 0;
  z-index: 309;
  background: transparent;
}

/* Reaction badges below messages */
.mob-reaction-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  padding: 0 4px;
}
.mob-reaction-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 2px 8px 2px 6px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.mob-reaction-badge:active {
  background: rgba(255,255,255,0.12);
}
.mob-reaction-badge.mob-reaction-mine {
  background: rgba(91,141,239,0.15);
  border-color: rgba(91,141,239,0.3);
}
.mob-reaction-badge-count {
  font-size: 12px;
  color: #8e8e93;
  min-width: 8px;
  text-align: center;
}
.mob-reaction-badge.mob-reaction-mine .mob-reaction-badge-count {
  color: #5b8def;
}

/* Bounce animation for newly added reaction */
@keyframes mobReactionBounce {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.mob-reaction-badge.mob-reaction-new {
  animation: mobReactionBounce 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ─── #47: Link Preview Cards ─── */
.mob-link-preview {
  display: block;
  margin-top: 8px;
  padding: 8px 10px 8px 12px;
  background: rgba(255,255,255,0.04);
  border-left: 3px solid #5b8def;
  border-radius: 0 8px 8px 0;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
  overflow: hidden;
}
.mob-link-preview:active {
  background: rgba(255,255,255,0.08);
}
.mob-link-preview-site {
  font-size: 12px;
  font-weight: 600;
  color: #5b8def;
  margin-bottom: 2px;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-link-preview-url {
  font-size: 12px;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ─── #48: Image Viewer / Gallery ─── */
.mob-image-thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.mob-image-thumb {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: opacity 0.15s ease;
}
.mob-image-thumb:active {
  opacity: 0.7;
}
.mob-image-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.mob-image-overlay.visible {
  opacity: 1;
}
.mob-image-viewer {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}
.mob-image-viewer img {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  transition: transform 0.2s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.mob-image-viewer img.mob-image-zoomed {
  transition: none;
}
.mob-image-viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 510;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mob-image-viewer-close:active {
  background: rgba(255,255,255,0.3);
}
.mob-image-viewer-counter {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  z-index: 510;
}
.mob-image-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 510;
  width: 40px;
  height: 60px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.mob-image-viewer-nav:active {
  background: rgba(255,255,255,0.25);
}
.mob-image-viewer-nav.prev { left: 8px; }
.mob-image-viewer-nav.next { right: 8px; }

/* ─── #49: Scroll-to-bottom floating button ─── */
.mob-scroll-bottom-btn {
  position: absolute;
  bottom: 70px;
  right: 14px;
  z-index: 50;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1e1e2e;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #8e8e93;
  font-size: 18px;
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}
.mob-scroll-bottom-btn.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.mob-scroll-bottom-btn:active {
  background: #2a2a3e;
}
.mob-scroll-bottom-btn .mob-scroll-unread {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #5b8def;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ─── #50: Virtual scroll placeholders ─── */
.mob-virtual-placeholder {
  height: 72px;
  width: 100%;
  flex-shrink: 0;
}
.mob-chat-item.mob-virtual-hidden {
  visibility: hidden;
  height: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
  border: none;
  min-height: 0;
}

/* ─── Direct Messages (DM) ─── */

/* Section header in chat list */
.mob-dm-section {
  padding: 8px 14px 4px;
}
.mob-dm-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.mob-dm-section-divider {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px 4px;
}

/* DM conversation item in chat list — WhatsApp style */
.mob-dm-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  min-height: 72px;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.mob-dm-item:active {
  background: rgba(255,255,255,0.06);
  transform: scale(0.98);
}
.mob-dm-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 76px;
  right: 0;
  height: 1px;
  background: rgba(255,255,255,0.06);
}
.mob-dm-item:last-child::after { display: none; }
.mob-dm-quick-call {
  background: none;
  border: none;
  font-size: 22px;
  /* B237.1 — Apple HIG 44pt minimum tap target; previous 8px+22px font
     resolved to ~32×32 which was easy to mis-tap on iPhone. */
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mob-dm-quick-call:active {
  background: rgba(124, 110, 245, 0.2);
}
.mob-topbar-call-btn {
  transition: background 0.15s;
  border-radius: 50%;
}
.mob-topbar-call-btn:active {
  background: rgba(124, 110, 245, 0.25) !important;
}
.mob-dm-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}
.mob-dm-info { flex: 1; min-width: 0; }
.mob-dm-name {
  font-size: 16px;
  font-weight: 500;
  color: #e9edef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-dm-preview {
  font-size: 14px;
  color: #8696a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  line-height: 1.3;
}
.mob-dm-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  align-self: flex-start;
  padding-top: 2px;
}
.mob-dm-time {
  font-size: 12px;
  color: #8e8e93;
}
.mob-dm-unread {
  background: #5b8def;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* DM fullscreen chat container */
.mob-dm-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #0b141a;
  overflow-x: hidden;
  max-width: 100vw;
}

/* DM messages area — WhatsApp-style dark background */
.mob-dm-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: none;
  background: #0b141a;
}
.mob-dm-messages::-webkit-scrollbar { width: 0; }

/* DM message bubbles — WhatsApp Android style */
.mob-dm-msg {
  display: flex;
  max-width: 90%;
  animation: mob-dm-msg-enter 0.15s ease-out;
}
@keyframes mob-dm-msg-enter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.mob-dm-msg-sent {
  align-self: flex-end;
}
.mob-dm-msg-received {
  align-self: flex-start;
}
.mob-dm-bubble {
  padding: 6px 8px 4px 9px;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
  font-size: 15.5px;
  line-height: 1.35;
  position: relative;
  max-width: 100%;
  box-shadow: 0 1px 1px rgba(0,0,0,0.13);
}
.mob-dm-msg-sent .mob-dm-bubble {
  background: #005c4b;
  color: #e9edef;
  border-radius: 8px 8px 2px 8px;
}
.mob-dm-msg-received .mob-dm-bubble {
  background: #1f2c34;
  color: #e9edef;
  border-radius: 8px 8px 8px 2px;
}

/* B303-C35c: DM 1:1 mobile consecutive same-sender ONE-BUBBLE glue.
   .mob-dm-messages is a flex column with gap:2px (and .mob-dm-msg carries no
   row margin), so the inter-row seam is 2px. A continuation row (mid/end) pulls
   up by -2px to leave ZERO seam. Interior joins square to 0; only the run's
   outer top corners (start) and outer bottom corners (end, incl. the 2px
   sent/received tail notch) keep the 8px/2px radius. Placed AFTER the base
   .mob-dm-bubble radius rules so they win on equal specificity. */
.mob-dm-run-mid, .mob-dm-run-end { margin-top: -2px; }
.mob-dm-run-start .mob-dm-bubble { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.mob-dm-run-mid .mob-dm-bubble { border-radius: 0; }
.mob-dm-run-end .mob-dm-bubble { border-top-left-radius: 0; border-top-right-radius: 0; }

/* Message footer (time + read receipts) — inline like WhatsApp */
.mob-dm-msg-footer {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 0;
  padding: 0;
  float: right;
  margin-left: 8px;
  position: relative;
  top: 4px;
}
.mob-dm-msg-time {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}
.mob-dm-msg-sent .mob-dm-msg-time {
  color: rgba(255,255,255,0.55);
}

/* Read receipts — checkmarks */
.mob-dm-check {
  font-size: 12px;
  line-height: 1;
}
.mob-dm-check-sent {
  color: rgba(255,255,255,0.4);
}
.mob-dm-check-read {
  color: #5b8def;
}

/* Date separators — WhatsApp style */
.mob-dm-date-sep {
  display: flex;
  justify-content: center;
  padding: 6px 0;
}
.mob-dm-date-pill {
  background: #182229;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.13);
}
.b473-mobile-dm-omitted {
  margin: 8px auto 6px;
  max-width: calc(100% - 32px);
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(91,141,239,0.12);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

/* ═══ DM input area — WhatsApp Android style ═══ */
.mob-dm-input-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 10px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(20,24,33,0.98), rgba(12,16,24,0.98));
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}
/* "+" attach button — left of input, WhatsApp style */
.mob-dm-attach-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: none;
  border: none;
  font-size: 26px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #94a3b8;
  flex-shrink: 0;
  -webkit-tap-highlight-color: rgba(255,255,255,0.1);
  transition: background 0.15s, color 0.15s;
}
.mob-dm-attach-btn:active {
  background: rgba(255,255,255,0.1);
  color: #e2e8f0;
}
/* Input wrapper: pill container with textarea + inline action buttons */
.mob-dm-input-wrap {
  flex: 1;
  flex-basis: 0;
  min-width: 0;
  background: rgba(30,41,59,0.92);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 24px;
  display: flex;
  align-items: flex-end;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.mob-dm-input-wrap:focus-within {
  border-color: rgba(91,141,239,0.5);
  background: #1a2744;
}
.mob-dm-input-row textarea {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 11px 4px 11px 16px;
  color: #e2e8f0;
  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  resize: none;
  outline: none;
  max-height: 150px;
  min-height: 44px;
  line-height: 1.4;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}
.mob-dm-input-row textarea::placeholder {
  color: #94a3b8;
}
/* Inline buttons (camera, GIF) — inside the pill, right side */
.mob-dm-input-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-right: 4px;
  gap: 0;
  align-self: flex-end;
  padding-bottom: 4px;
  max-width: 96px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mob-dm-input-actions::-webkit-scrollbar { display: none; }
.mob-dm-inline-btn {
  width: 32px;
  height: 36px;
  min-width: 32px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #64748b;
  -webkit-tap-highlight-color: rgba(255,255,255,0.1);
  transition: color 0.15s;
}
.mob-dm-inline-btn:active { color: #e2e8f0; }
/* Hide inline buttons when user is typing (like WhatsApp) */
.mob-dm-input-wrap.has-text .mob-dm-input-actions { display: none; }
/* Send button — green circle, right of input */
.mob-dm-send-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #00a884;
  color: #fff;
  border: none;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s, background 0.15s;
  -webkit-tap-highlight-color: rgba(0,168,132,0.3);
}
.mob-dm-send-btn:active {
  transform: scale(0.9);
  background: #008f72;
}
.mob-dm-send-btn:disabled {
  background: #243244;
  color: #64748b;
  cursor: not-allowed;
  opacity: 0.7;
}

/* New DM FAB button */
.mob-dm-fab {
  position: fixed;
  bottom: 80px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #5b8def;
  color: #fff;
  border: none;
  font-size: 22px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(91,141,239,0.4);
  cursor: pointer;
  z-index: 200;
  transition: transform 0.15s, box-shadow 0.15s;
}
.mob-dm-fab:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(91,141,239,0.3);
}

/* User picker screen for new DM */
.mob-dm-picker {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #0f0f14;
  display: flex;
  flex-direction: column;
  animation: mob-dm-picker-in 0.25s ease;
}
@keyframes mob-dm-picker-in {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.mob-dm-picker-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mob-dm-picker-close {
  background: none;
  border: none;
  color: #8e8e93;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.mob-dm-picker-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}
.mob-dm-picker-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.mob-dm-picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.1s;
}
.mob-dm-picker-item:active {
  background: rgba(255,255,255,0.06);
}
.mob-dm-picker-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}
.mob-dm-picker-name {
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
}
.mob-dm-picker-email {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

/* Empty state for DM messages */
.mob-dm-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  gap: 8px;
}
.mob-dm-empty-icon {
  font-size: 48px;
  opacity: 0.4;
}
.mob-dm-empty-text {
  font-size: 14px;
}

/* ─── E2E Encryption & P2P Indicators ─── */

/* Lock icon next to message timestamp */
.mob-dm-encrypted-icon {
  font-size: 10px;
  margin-left: 3px;
  opacity: 0.6;
  display: inline;
  vertical-align: middle;
  line-height: 1;
}
.mob-dm-msg-sent .mob-dm-encrypted-icon {
  color: rgba(255,255,255,0.5);
}
.mob-dm-msg-received .mob-dm-encrypted-icon {
  color: #64748b;
}

/* P2P badge in topbar */
.mob-dm-p2p-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(34,197,94,0.15);
  color: #22c55e;
  margin-left: 8px;
  flex-shrink: 0;
  animation: mob-dm-p2p-pulse 2s ease infinite;
}
.mob-dm-p2p-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
}
@keyframes mob-dm-p2p-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* E2E banner at top of chat */
.mob-dm-e2e-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  background: transparent;
  border-bottom: none;
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
  flex-shrink: 0;
}
.mob-dm-e2e-banner-icon {
  font-size: 10px;
}

/* Fingerprint verification popup */
.mob-dm-fingerprint {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mob-dm-fp-fade 0.2s ease;
}
@keyframes mob-dm-fp-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.mob-dm-fingerprint-card {
  background: #1c1c24;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 24px;
  width: 300px;
  max-width: 90vw;
  text-align: center;
}
.mob-dm-fingerprint-title {
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 16px;
}
.mob-dm-fingerprint-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.mob-dm-fingerprint-value {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 14px;
  color: #5b8def;
  letter-spacing: 1.5px;
  padding: 8px;
  background: rgba(91,141,239,0.08);
  border-radius: 8px;
  margin-bottom: 16px;
  word-break: break-all;
}
.mob-dm-fingerprint-close {
  padding: 8px 24px;
  background: #334155;
  color: #e2e8f0;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.mob-dm-fingerprint-close:active {
  background: #475569;
}

/* ─── DM File Attachments ─── */

/* Attach button (paperclip) */
.mob-dm-attach-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: none;
  color: #8e8e93;
  border: none;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, transform 0.1s;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.mob-dm-attach-btn:active {
  color: #5b8def;
  transform: scale(0.9);
}

/* File preview bar above input */
.mob-dm-file-bar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: #0f0f14;
  flex-shrink: 0;
  scrollbar-width: none;
}
.mob-dm-file-bar::-webkit-scrollbar { width: 0; height: 0; }

/* Thumbnail preview in file bar */
.mob-dm-file-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: #1c1c24;
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.mob-dm-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mob-dm-file-thumb-icon {
  font-size: 22px;
  opacity: 0.7;
}
.mob-dm-file-thumb-name {
  font-size: 8px;
  color: #8e8e93;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  margin-top: 2px;
}
.mob-dm-file-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

/* Upload progress indicator */
.mob-dm-upload-progress {
  padding: 4px 12px 8px;
  background: #0f0f14;
  flex-shrink: 0;
}
.mob-dm-upload-bar {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.mob-dm-upload-fill {
  height: 100%;
  background: #5b8def;
  border-radius: 2px;
  transition: width 0.2s ease;
  width: 0%;
}

/* ─── Inline Media in DM Messages ─── */

.mob-dm-msg-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

/* Inline image */
.mob-dm-msg-image {
  max-width: 240px;
  max-height: 240px;
  border-radius: 10px;
  object-fit: cover;
  cursor: pointer;
  display: block;
  -webkit-tap-highlight-color: transparent;
}
.mob-dm-msg-image:active {
  opacity: 0.85;
}

/* Inline video */
.mob-dm-msg-video {
  position: relative;
  max-width: 240px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mob-dm-msg-video video {
  width: 100%;
  max-height: 240px;
  display: block;
  border-radius: 10px;
  object-fit: cover;
  background: #000;
}
.mob-dm-msg-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  pointer-events: auto;
}

/* Inline audio */
.mob-dm-msg-audio {
  width: 100%;
  max-width: 240px;
  height: 36px;
  border-radius: 18px;
}

/* File download card */
.mob-dm-msg-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  max-width: 240px;
  -webkit-tap-highlight-color: transparent;
}
.mob-dm-msg-file:active {
  background: rgba(255,255,255,0.08);
}
.mob-dm-msg-file-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.mob-dm-msg-file-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mob-dm-msg-file-name {
  font-size: 13px;
  font-weight: 600;
  color: #5b8def;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* B237.1 — without an explicit max-width, a 100-char filename
     (e.g. 'comino-network-export-2026-05-09.tar.gz') stretched the
     attachment card past the bubble on iPhone SE. Clamp + flex-shrink
     so ellipsis actually engages instead of overflowing the card. */
  max-width: 220px;
  flex-shrink: 1;
  min-width: 0;
}
.mob-dm-msg-file-size {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

/* ─── DM Message Edit/Delete ─── */
.mob-dm-action-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.mob-dm-action-menu {
  background: rgba(22,22,30,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  min-width: 160px;
  overflow: hidden;
  animation: mob-action-menu-in 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mob-dm-action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  font-size: 15px;
  color: #e2e8f0;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mob-dm-action-item:last-child { border-bottom: none; }
.mob-dm-action-item:active { background: rgba(255,255,255,0.08); }
.mob-dm-action-danger { color: #ef4444; }
.mob-dm-edited {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  font-style: italic;
  margin-right: 4px;
}

/* ─── Desktop DM Panel — Telegram Desktop Dark Theme ─────────────────── */
.dm-desk-container {
  display: flex; height: 100%; min-height: 400px;
  position: relative; overflow: hidden;
}
.dm-desk-sidebar {
  width: 280px; min-width: 220px; border-right: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column; background: #17212b;
  position: relative;
  transition: width .2s ease, min-width .2s ease;
}
.dm-topic-drawer-open .dm-desk-sidebar { width: 64px; min-width: 64px; }
.dm-topic-drawer-open .dm-desk-sidebar {
  max-width: 64px;
  flex: 0 0 64px;
  box-sizing: border-box;
  border-right-color: transparent;
}
.dm-topic-drawer-open .dm-desk-search,
.dm-topic-drawer-open .dm-desk-action-fab-stack,
.dm-topic-drawer-open .dm-desk-contact-info,
.dm-topic-drawer-open .dm-grp-sidebar-info,
.dm-topic-drawer-open .dm-desk-contact-time,
.dm-topic-drawer-open .dm-grp-sidebar-time,
.dm-topic-drawer-open .dm-grp-sidebar-title,
.dm-topic-drawer-open .dm-grp-sidebar-create { display: none !important; }
.dm-topic-drawer-open .dm-desk-contact,
.dm-topic-drawer-open .dm-grp-sidebar-item { justify-content: center; padding: 8px; gap: 0; }
.dm-topic-drawer-open .dm-desk-avatar,
.dm-topic-drawer-open .dm-grp-sidebar-avatar { width: 44px; height: 44px; font-size: 14px; }
.dm-desk-search {
  width: 100%; padding: 10px 14px; border: none; border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 13px; background: #242f3d; color: #d5dde6; outline: none;
  border-radius: 0;
}
.dm-desk-search::placeholder { color: #6c7883; }
.dm-desk-search:focus { box-shadow: inset 0 -2px 0 #4eabf9; }
.dm-desk-folder-tabs {
  display: flex;
  gap: 2px;
  padding: 4px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.dm-desk-folder-tabs::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.dm-desk-folder-tab { flex: 0 0 auto; }
.dm-desk-action-fab-stack {
  position: absolute;
  right: 12px;
  bottom: 14px;
  z-index: 24;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.dm-desk-action-fab {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.dm-desk-action-fab:hover { transform: translateY(-1px); }
.dm-desk-action-fab-primary {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #5b8def;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.32), 0 3px 10px rgba(91,141,239,0.28);
}
.dm-desk-action-fab-primary:hover { background: #6b9bff; }
.dm-desk-action-fab-secondary {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.24);
  opacity: .96;
}
.dm-desk-action-fab-secondary:hover {
  background: #263449;
  color: #d5dde6;
}
.dm-desk-contact-list {
  flex: 1; overflow-y: auto; padding-bottom: 72px;
}
.dm-desk-contact-list::-webkit-scrollbar { width: 6px; }
.dm-desk-contact-list::-webkit-scrollbar-track { background: transparent; }
.dm-desk-contact-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.dm-desk-contact {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  cursor: pointer; border-bottom: none; transition: background 0.12s;
}
.dm-desk-contact:hover { background: #202b36; }
.dm-desk-contact.active { background: #2b5278; }
.dm-desk-avatar {
  width: 48px; height: 48px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; color: #fff;
  font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.dm-desk-avatar-support {
  background: #4eabf9 !important;
  font-size: 20px;
}
.dm-desk-contact-info { flex: 1; min-width: 0; }
.dm-desk-contact-name-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.dm-desk-contact-name {
  font-size: 15px; font-weight: 600; color: #e1e3e6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dm-desk-contact-time { font-size: 11px; color: #6c7883; white-space: nowrap; flex-shrink: 0; }
.dm-desk-contact-preview {
  font-size: 13px; color: #6c7883; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}
.dm-desk-unread {
  background: #4eabf9; color: #fff; font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; padding: 0 6px; flex-shrink: 0;
}
.dm-desk-no-contacts, .dm-desk-error {
  padding: 32px 16px; text-align: center; color: #6c7883; font-size: 13px;
}

/* ─── Chat Area ─── */
.dm-desk-chat {
  flex: 1; display: flex; flex-direction: column; min-width: 0; background: #0e1621;
  position: relative; overflow: hidden;
}
.dm-desk-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: #6c7883; padding: 40px;
}
.dm-desk-empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.dm-desk-empty-title { font-size: 16px; font-weight: 600; color: #8a9099; margin-bottom: 6px; }
.dm-desk-empty-sub { font-size: 13px; color: #6c7883; }
.dm-topic-empty { padding: 40px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: #94a3b8; }
.dm-topic-empty-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(125,211,252,.24); background: rgba(14,116,144,.14); color: #e0f2fe; font-size: 12px; font-weight: 700; }
.dm-topic-empty-title { font-size: 15px; font-weight: 700; color: #dbe7f3; }
.dm-topic-empty-sub { font-size: 13px; color: #7f8ea3; }

/* ─── Chat Header ─── */
.dm-desk-header {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06); background: #17212b; flex-shrink: 0;
}
.dm-desk-header-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; color: #fff;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.dm-desk-header-info { flex: 1; min-width: 0; }
.dm-desk-header-name { font-size: 15px; font-weight: 600; color: #e1e3e6; }
.dm-desk-call-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  color: #6c7883;
  border-radius: 50%;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.dm-desk-call-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #e1e3e6;
}
.dm-desk-header-status { font-size: 12px; color: #3dcc6e; }

/* ─── Messages ─── */
.dm-desk-messages {
  flex: 1; overflow-y: auto; padding: 12px 16px;
  display: flex; flex-direction: column; gap: 4px;
  background: #0e1621;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.dm-desk-messages::-webkit-scrollbar { width: 0; height: 0; }
.dm-desk-messages::-webkit-scrollbar-track { background: transparent; }
.dm-desk-messages::-webkit-scrollbar-thumb { background: transparent; border-radius: 0; }
.dm-desk-date-sep {
  text-align: center; margin: 12px 0 8px; font-size: 12px;
  color: #6c7883; position: relative;
}
.dm-desk-date-sep::before, .dm-desk-date-sep::after {
  content: ''; position: absolute; top: 50%; width: 30%;
  height: 1px; background: rgba(255,255,255,0.06);
}
.dm-desk-date-sep::before { left: 5%; }
.dm-desk-date-sep::after { right: 5%; }

.dm-desk-msg-row { display: flex; margin-bottom: 2px; }
.dm-desk-msg-sent { justify-content: flex-end; }
.dm-desk-msg-received { justify-content: flex-start; }

.dm-desk-bubble {
  /* B131 follow-up: direct-message desktop bubbles had the old 55% clamp
   * after group DM bubbles were widened. On wide floating panels this
   * still rendered long 1:1 messages as a narrow column. Match the group
   * DM cap so resized panels can use the available reading width.
   */
  max-width: min(96%, 1500px); padding: 8px 12px; border-radius: 12px;
  font-size: 14px; line-height: 1.45; word-wrap: break-word;
  position: relative;
}
.dm-desk-msg-sent .dm-desk-bubble {
  background: #2b5278; color: #e1e3e6; border-bottom-right-radius: 4px;
}
.dm-desk-msg-received .dm-desk-bubble {
  background: #182533; color: #e1e3e6; border-bottom-left-radius: 4px;
  border: none;
}

/* B303-C35c: DM 1:1 desktop consecutive same-sender ONE-BUBBLE glue.
   .dm-desk-messages is a flex column with gap:4px and .dm-desk-msg-row adds
   margin-bottom:2px, so the inter-row seam is 4+2 = 6px (a flex gap is a
   container gutter, additive to item margins). A continuation row (mid/end)
   pulls up by the FULL 6px so consecutive same-side bubbles read as one with
   ZERO seam. Interior joins square to 0; only the run's outer top corners
   (start) and outer bottom corners (end, incl. the 4px sent/received tail
   notch) keep the 12px/4px radius. Placed AFTER the base .dm-desk-bubble radius
   rules so they win on equal specificity. */
.dm-desk-run-mid, .dm-desk-run-end { margin-top: -6px; }
.dm-desk-run-start .dm-desk-bubble { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.dm-desk-run-mid .dm-desk-bubble { border-radius: 0; }
.dm-desk-run-end .dm-desk-bubble { border-top-left-radius: 0; border-top-right-radius: 0; }

.dm-desk-msg-text { margin-bottom: 2px; }
.dm-desk-msg-img {
  max-width: 400px; max-height: 320px; border-radius: 8px;
  cursor: pointer; display: block; margin-bottom: 4px;
}
.dm-desk-search-hl {
  background: rgba(78,171,249,0.15) !important;
  box-shadow: 0 0 0 2px rgba(78,171,249,0.3);
}
/* B236: distinct style for the active match while cycling with prev/next. */
.dm-desk-search-active {
  background: rgba(78,171,249,0.32) !important;
  box-shadow: 0 0 0 2px rgba(78,171,249,0.7);
  transition: background 0.15s, box-shadow 0.15s;
}
.dm-desk-msg-file {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; background: rgba(255,255,255,0.06); border-radius: 8px;
  font-size: 12px; color: #4eabf9; text-decoration: none;
  margin-bottom: 4px;
}
.dm-desk-msg-sent .dm-desk-msg-file {
  background: rgba(255,255,255,0.08); color: #7fc8f8;
}

.dm-desk-msg-meta {
  display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end;
  float: right; margin-left: 10px; margin-top: 4px;
}
.dm-desk-msg-time { font-size: 11px; opacity: 0.55; color: inherit; }
.dm-desk-edited { font-size: 10px; opacity: 0.45; font-style: italic; }
.dm-desk-receipt { font-size: 12px; opacity: 0.5; }
.dm-desk-receipt-read { color: #4eabf9; opacity: 1; }
.dm-desk-msg-sent .dm-desk-receipt-read { color: #7fc8f8; }
/* B237.3 — unified DM bubble state palette. The state-specific classes
   take precedence over the legacy opacity-based receipt styles so
   queued / sending / failed messages stand out without relying on
   colour alone (also see aria-label + title). */
.dm-desk-receipt--queued { color: #94a3b8; opacity: 1; }
.dm-desk-receipt--sending { color: #94a3b8; opacity: 1; animation: dm-receipt-pulse 1.2s ease-in-out infinite; }
.dm-desk-receipt--failed { color: #ef4444; opacity: 1; font-weight: 600; }
.dm-desk-receipt--failed:hover { text-decoration: underline; cursor: pointer; }
.mob-dm-check-queued { color: #94a3b8 !important; opacity: 1 !important; }
.mob-dm-check-sending { color: #94a3b8 !important; opacity: 1 !important; animation: dm-receipt-pulse 1.2s ease-in-out infinite; }
.mob-dm-check-failed { color: #ef4444 !important; opacity: 1 !important; font-weight: 600; }
.mob-dm-check-delivered { color: inherit; opacity: 0.55; }
@keyframes dm-receipt-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* ─── Input Area ─── */
.dm-desk-input-row {
  display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,0.06); background: #17212b; flex-shrink: 0;
  box-sizing: border-box; min-width: 0; overflow: hidden;
}
.dm-desk-attach {
  background: none; border: none; font-size: 20px; cursor: pointer;
  padding: 6px; color: #6c7883; line-height: 1; flex-shrink: 0;
  border-radius: 50%; transition: background 0.15s, color 0.15s;
}
.dm-desk-attach:hover { color: #e1e3e6; background: rgba(255,255,255,0.08); }
.dm-desk-input-wrap { flex: 1 1 0; min-width: 0; max-width: 100%; overflow: hidden; }
.dm-desk-textarea {
  width: 100%; padding: 10px 16px; border: none; border-radius: 20px;
  font-size: 14px; font-family: inherit; resize: none; outline: none;
  max-height: 150px; line-height: 1.4;
  background: #242f3d; color: #e1e3e6;
  box-sizing: border-box;
  min-width: 0;
  display: block;
}
.dm-desk-textarea::placeholder { color: #6c7883; }
.dm-desk-textarea:focus { border: none; box-shadow: 0 0 0 2px rgba(78,171,249,0.25); }
.dm-desk-send {
  background: #4fae4e; color: #fff; border: none; border-radius: 50%;
  width: 40px; height: 40px; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background 0.15s;
}
.dm-desk-send:hover { background: #45a044; }
.dm-desk-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* File preview in input */
.dm-desk-file-preview {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px;
}
.dm-desk-file-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; background: #242f3d; border-radius: 6px;
  font-size: 11px; color: #8a9099;
}
.dm-desk-file-rm {
  cursor: pointer; color: #6c7883; font-size: 10px; margin-left: 2px;
}
.dm-desk-file-rm:hover { color: #ef4444; }

/* ─── Context Menu ─── */
.dm-desk-ctx-menu {
  position: fixed; z-index: 9999; background: #17212b;
  border: 1px solid rgba(255,255,255,0.08); border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4); min-width: 140px; overflow: hidden;
}
.dm-desk-ctx-item {
  padding: 10px 16px; font-size: 13px; cursor: pointer; color: #e1e3e6;
  display: flex; align-items: center; gap: 8px;
}
.dm-desk-ctx-item:hover { background: #202b36; }
.dm-desk-ctx-danger { color: #e55454; }
.dm-desk-ctx-danger:hover { background: rgba(229,84,84,0.12); }
.dm-desk-topic-menu { min-width: 180px; }
.dm-grp-topic-manage { color: #f8fafc; border-color: rgba(248,250,252,.18); }
.dm-topic-drawer-shell {
  position: relative; z-index: 3;
  width: 0; min-width: 0; flex: 0 0 0;
  overflow: hidden; pointer-events: none;
  transition: width .2s cubic-bezier(.2,.8,.2,1), min-width .2s cubic-bezier(.2,.8,.2,1);
}
.dm-topic-drawer {
  position: relative; height: 100%;
  width: 280px; max-width: 280px;
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(148,163,184,.16);
  background: linear-gradient(180deg, rgba(23,33,43,.98), rgba(14,22,33,.99));
  box-shadow: 16px 0 36px rgba(2,6,23,.22);
  transform: translateX(-104%);
  transition: transform .2s cubic-bezier(.2,.8,.2,1);
  pointer-events: auto;
}
.dm-topic-drawer-open .dm-topic-drawer { border-left: 0; }
.dm-topic-drawer-open .dm-topic-drawer-shell { width: 280px; min-width: 280px; flex-basis: 280px; pointer-events: auto; }
.dm-topic-drawer-open .dm-topic-drawer { transform: translateX(0); }
.dm-topic-drawer-head {
  display: flex; align-items: flex-start; justify-content: flex-start; gap: 12px;
  padding: 16px 16px 12px; border-bottom: 1px solid rgba(148,163,184,.12);
}
.dm-topic-drawer-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: #7dd3fc;
}
.dm-topic-drawer-title { margin-top: 3px; color: #f8fafc; font-size: 17px; font-weight: 800; }
.dm-topic-drawer-close {
  width: 32px; height: 32px; border-radius: 999px;
  border: 1px solid rgba(148,163,184,.18); background: rgba(15,23,42,.72);
  color: #cbd5e1; font-size: 18px; cursor: pointer; flex-shrink: 0;
}
.dm-topic-drawer-list.dm-grp-topic-bar {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  padding: 12px; border-bottom: 0; background: transparent; overflow-y: auto; overflow-x: hidden;
}
.dm-topic-drawer-list .dm-grp-topic-tab,
.dm-topic-drawer-list .dm-grp-topic-share,
.dm-topic-drawer-list .dm-grp-topic-new,
.dm-topic-drawer-list .dm-grp-topic-listeners-pill {
  width: 100%; max-width: none; justify-content: flex-start; text-align: left;
  border-radius: 14px; padding: 9px 11px;
}
.dm-topic-drawer-list .dm-grp-topic-listeners { margin-left: 0; flex-direction: column; align-items: stretch; gap: 8px; }
@media (max-width: 900px) {
  .dm-topic-drawer-open .dm-topic-drawer-shell { width: min(280px, calc(100vw - 72px)); min-width: min(280px, calc(100vw - 72px)); flex-basis: min(280px, calc(100vw - 72px)); }
  .dm-topic-drawer { width: min(280px, calc(100vw - 72px)); }
  .dm-topic-drawer-open .dm-desk-sidebar { width: 56px; min-width: 56px; }
  .dm-topic-drawer-open .dm-desk-avatar,
  .dm-topic-drawer-open .dm-grp-sidebar-avatar { width: 40px; height: 40px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .dm-desk-sidebar, .dm-topic-drawer-shell, .dm-topic-drawer, .mob-dm-topic-drawer, .mob-dm-topic-drawer-backdrop { transition: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════
   DM GROUP CHATS — dm-grp- prefix
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Desktop: Group section in DM sidebar ─── */
.dm-grp-sidebar-section {
  border-top: 1px solid rgba(255,255,255,0.06); padding-top: 8px; margin-top: 8px;
}
.dm-grp-sidebar-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: #6c7883; padding: 4px 12px 8px; letter-spacing: 0.5px;
}
.dm-grp-sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px; cursor: pointer; transition: background 0.12s, box-shadow 0.12s;
}
.dm-grp-sidebar-item:hover { background: #202b36; }
.dm-grp-sidebar-item.active {
  background: linear-gradient(180deg, rgba(43,82,120,0.95), rgba(40,76,111,0.95));
  box-shadow: inset 3px 0 0 #63b3ed;
}
.dm-grp-sidebar-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #fff; flex-shrink: 0;
}
.dm-grp-sidebar-info { flex: 1; min-width: 0; }
.dm-grp-sidebar-name {
  font-size: 15px; font-weight: 600; color: #e1e3e6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dm-grp-sidebar-preview {
  font-size: 13px; color: #6c7883;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dm-grp-sidebar-time {
  font-size: 11px; color: #6c7883; white-space: nowrap; flex-shrink: 0;
}
.dm-grp-sidebar-create {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; cursor: pointer; color: #4eabf9; font-size: 13px; font-weight: 600;
}
.dm-grp-sidebar-create:hover { background: #202b36; }

/* ─── Desktop: Group chat header ─── */
/* B98 Phase A: collapsed single-row layout. Padding tightened, avatar 40→32,
   roster moved out of info block to render as flex sibling — keeps the whole
   chrome on one visual row instead of stacking under the name.
   Phase A2: flex-wrap added so chips wrap to a second visual line on narrow
   panels (e.g. when Boss Chat is open alongside DM panel) instead of
   disappearing off-screen. Names stay readable even at narrow widths. */
.dm-grp-header {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: #17212b;
  flex-wrap: wrap;
}
.dm-grp-header-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
}
.dm-grp-header-info { flex: 1 1 200px; min-width: 0; }
.dm-grp-header-name { font-size: 14px; font-weight: 600; color: #e1e3e6; }
.dm-grp-header-sub { font-size: 11px; color: #a7b8ca; }
/* B98 Phase A2: flex-basis 100% on roster so on narrow panels it wraps to
   its own line below the name (instead of competing for horizontal space).
   On wide panels chips still appear inline next to name (flex-wrap is
   wrap-reverse-friendly with flex-basis collapsing to fit when room exists). */
.dm-grp-header-roster { margin-top: 0; flex: 1 1 100%; min-width: 0; }
/* B105 / B98 A4: chips wrap to MAX 2 visual rows. Chip ≈ 34px tall (avatar 26
   + 4px padding top/bot), 2 rows + 4px row gap = ~72px. JS post-render
   measurement (_dmCollapseRosterTo2Rows) iteratively trims chips so the
   "+N more" chip always lands in row 2 (never hidden in row 3+). */
.dm-grp-header-roster-items { display: flex; flex-wrap: wrap; gap: 4px; max-height: 72px; overflow: hidden; padding-bottom: 0; }
.dm-grp-header-roster-chip { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 8px; border-radius: 12px; background: rgba(15,23,42,.42); border: 1px solid rgba(148,163,184,.14); cursor: pointer; }
.dm-grp-header-roster-chip-agent { border-color: rgba(59,130,246,.22); background: rgba(30,41,59,.72); }
.dm-grp-header-roster-chip-more { justify-content: center; min-width: 40px; color: #cbd5e1; font-weight: 700; cursor: pointer; appearance: none; }
.dm-grp-header-roster-chip-overflow { justify-content: center; min-width: 32px; color: #cbd5e1; font-weight: 700; font-size: 16px; line-height: 1; cursor: pointer; appearance: none; }
/* B98 Phase A1: chip avatar restored 22→26 + name max-width 90→140 so
   actual names are READABLE (boss complaint #5 — names truncated to "..."). */
.dm-grp-header-roster-avatar { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; }
.dm-grp-header-roster-copy { min-width: 0; }
.dm-grp-header-roster-name { font-size: 12px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.dm-grp-header-roster-badge { font-size: 9px; font-weight: 700; color: #93c5fd; background: rgba(37,99,235,.14); border: 1px solid rgba(59,130,246,.25); border-radius: 999px; padding: 1px 5px; }
/* B98 Phase A: chat-controls strip removed entirely from desktop header. CSS
   kept defensively to hide any DOM left over from cached frontends. */
.dm-chat-controls { display: none; }
.dm-chat-controls-btn { border: 1px solid rgba(148,163,184,.16); background: rgba(15,23,42,.66); color: #dbeafe; border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 700; cursor: pointer; }
.dm-chat-controls-btn:hover { border-color: rgba(96,165,250,.28); background: rgba(30,41,59,.9); }
.dm-chat-controls-btn-muted { color: #cbd5e1; }
.dm-actor-directory-shell { position: fixed; inset: 0; z-index: 10020; }
.dm-actor-directory-backdrop { position: absolute; inset: 0; background: rgba(2,6,23,.62); backdrop-filter: blur(8px); }
.dm-actor-directory-sheet { position: absolute; top: 72px; right: 32px; width: min(520px, calc(100vw - 48px)); max-height: calc(100vh - 112px); border-radius: 24px; overflow: hidden; border: 1px solid rgba(148,163,184,.18); background: linear-gradient(180deg, rgba(15,23,42,.98), rgba(2,6,23,.98)); box-shadow: 0 24px 60px rgba(2,6,23,.44); display: flex; flex-direction: column; }
.dm-actor-directory-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 16px; border-bottom: 1px solid rgba(148,163,184,.12); }
.dm-actor-directory-kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #7dd3fc; }
.dm-actor-directory-title { font-size: 20px; font-weight: 700; color: #f8fafc; margin-top: 4px; }
.dm-actor-directory-close { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(148,163,184,.18); background: rgba(15,23,42,.72); color: #cbd5e1; font-size: 22px; cursor: pointer; }
.dm-actor-directory-body { padding: 18px 20px 20px; overflow-y: auto; }
.dm-actor-directory-summary { font-size: 13px; color: #94a3b8; margin-bottom: 10px; }
.dm-actor-directory-scope { display:inline-flex; align-items:center; gap:8px; margin-bottom:14px; padding:8px 12px; border-radius:999px; border:1px solid rgba(125,211,252,.22); background:rgba(14,116,144,.14); color:#dbeafe; font-size:12px; font-weight:700; }
.dm-actor-directory-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.dm-actor-directory-filter { border: 1px solid rgba(148,163,184,.16); background: rgba(15,23,42,.78); color: #cbd5e1; border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 700; cursor: pointer; }
.dm-actor-directory-filter-active { border-color: rgba(96,165,250,.34); background: rgba(30,41,59,.96); color: #eff6ff; }
.dm-actor-directory-filter-count { color: #93c5fd; }
.dm-actor-directory-search { margin-bottom: 14px; }
.dm-actor-directory-search-input { width: 100%; box-sizing: border-box; border: 1px solid rgba(148,163,184,.16); background: rgba(15,23,42,.74); color: #f8fafc; border-radius: 14px; padding: 11px 14px; font-size: 14px; outline: none; }
.dm-actor-directory-search-input:focus { border-color: rgba(96,165,250,.4); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.dm-actor-directory-no-results { font-size: 13px; color: #94a3b8; padding: 4px 0 12px; }
.dm-actor-directory-page { margin: 0 0 12px; font-size: 12px; color: #8fa0b8; }
.dm-actor-directory-load-more { width: 100%; margin-top: 14px; border: 1px solid rgba(96,165,250,.24); background: rgba(30,41,59,.9); color: #dbeafe; border-radius: 14px; padding: 11px 14px; font-size: 13px; font-weight: 700; cursor: pointer; }
.dm-actor-directory-load-more:hover { border-color: rgba(96,165,250,.42); background: rgba(30,64,175,.24); }
.dm-actor-directory-section + .dm-actor-directory-section { margin-top: 18px; }
.dm-actor-directory-section-title { font-size: 11px; font-weight: 700; color: #7f8ea3; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.dm-actor-directory-empty { font-size: 13px; color: #64748b; padding: 12px 0; }
.dm-actor-directory-card { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; border: 1px solid rgba(148,163,184,.12); background: rgba(15,23,42,.56); }
.dm-actor-directory-card + .dm-actor-directory-card { margin-top: 10px; }
.dm-actor-directory-card-agent { border-color: rgba(59,130,246,.2); background: linear-gradient(180deg, rgba(30,41,59,.88), rgba(15,23,42,.94)); }
.dm-actor-directory-card-active { border-color: rgba(96,165,250,.82); box-shadow: 0 0 0 2px rgba(96,165,250,.28), 0 16px 32px rgba(15,23,42,.28); transform: translateY(-1px); }
.dm-actor-directory-card:focus { outline: none; }
.dm-actor-directory-filter-hotkey { display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px; padding:0 5px; border-radius:999px; background: rgba(148,163,184,.18); color:#cbd5e1; font-size:10px; font-weight:700; margin-left:6px; }
.dm-actor-directory-shortcut-hint { margin-top:10px; margin-bottom:12px; color:#94a3b8; font-size:12px; }
.dm-actor-directory-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; }
.dm-actor-directory-copy { min-width: 0; }
.dm-actor-directory-name { font-size: 14px; font-weight: 700; color: #f8fafc; }
.dm-actor-directory-meta { font-size: 12px; color: #93c5fd; margin-top: 2px; }
.dm-actor-directory-submeta { font-size: 12px; color: #8fa0b8; margin-top: 3px; }
.dm-actor-directory-presence, .dm-agent-presence-pill { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; border: 1px solid rgba(148,163,184,.18); background: rgba(15,23,42,.64); color: #cbd5e1; padding: 4px 8px; font-size: 11px; font-weight: 700; }
.dm-actor-directory-presence::before, .dm-agent-presence-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #64748b; }
.dm-actor-directory-presence-online, .dm-agent-presence-pill-online { color: #bbf7d0; border-color: rgba(34,197,94,.26); background: rgba(22,101,52,.16); }
.dm-actor-directory-presence-online::before, .dm-agent-presence-pill-online::before { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.14); }
.dm-actor-directory-presence-recent, .dm-agent-presence-pill-recent { color: #fde68a; border-color: rgba(245,158,11,.26); background: rgba(120,53,15,.16); }
.dm-actor-directory-presence-recent::before, .dm-agent-presence-pill-recent::before { background: #f59e0b; }
.dm-actor-directory-presence-offline, .dm-agent-presence-pill-offline, .dm-actor-directory-presence-never, .dm-agent-presence-pill-never { color: #94a3b8; }
.dm-actor-directory-presence-disabled, .dm-agent-presence-pill-disabled { color: #fecaca; border-color: rgba(239,68,68,.26); background: rgba(127,29,29,.18); }
.dm-actor-directory-presence-disabled::before, .dm-agent-presence-pill-disabled::before { background: #ef4444; }
.dm-actor-directory-badge { margin-top: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #dbeafe; background: rgba(37,99,235,.18); border: 1px solid rgba(96,165,250,.22); border-radius: 999px; padding: 4px 8px; }
.dm-actor-directory-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dm-actor-directory-action { border: 1px solid rgba(148,163,184,.16); background: rgba(15,23,42,.78); color: #e2e8f0; border-radius: 999px; padding: 7px 10px; font-size: 11px; font-weight: 700; cursor: pointer; }
.dm-actor-directory-action:hover { border-color: rgba(96,165,250,.3); background: rgba(30,41,59,.94); }
/* B126v3 — admin pin carousel mirrors task-pin v3 layout. Single-row
 * grid with all actions in one inline-flex container; inline-expand
 * detail beneath; click body toggles [data-pin-expanded]. Same
 * structure as .dm-task-pins but kept on its own selectors so the
 * legacy B95 amber/blue palette stays distinguishable from task pins. */
.dm-topic-pins, .mob-dm-topic-pins { position: sticky; top: 0; z-index: 3; display: block; padding: 0; background: rgba(23,33,43,.98); border-bottom: 1px solid rgba(148,163,184,.12); }
.mob-dm-topic-pins { z-index: 4; }
/* B98 Phase A1 empty-state hint preserved. */
.dm-topic-pins-empty, .mob-dm-topic-pins-empty { padding: 6px 14px; background: rgba(15,23,42,.62); border-bottom: 1px solid rgba(148,163,184,.10); flex-shrink: 0; }
.dm-topic-pins-empty-text, .mob-dm-topic-pins-empty-text { font-size: 11px; color: #94a3b8; line-height: 1.3; }
.dm-topic-pins-item, .mob-dm-topic-pins-item { min-height: 42px; display: grid; grid-template-columns: 3px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 5px 12px; background: rgba(23,33,43,.98); }
.dm-topic-pins-item:hover, .mob-dm-topic-pins-item:hover { background: rgba(31,45,59,.98); }
.dm-topic-pins-item:focus-visible, .mob-dm-topic-pins-item:focus-visible { outline: 2px solid rgba(83,155,245,.7); outline-offset: -2px; }
.dm-topic-pins-accent, .mob-dm-topic-pins-accent { align-self: stretch; width: 3px; border-radius: 999px; background: #539bf5; }
.dm-topic-pins-copy, .mob-dm-topic-pins-copy { min-width: 0; }
.dm-topic-pins-title, .mob-dm-topic-pins-title { display: flex; align-items: center; gap: 6px; color: #f1f5f9; font-size: 13px; line-height: 1.2; font-weight: 700; min-width: 0; }
.dm-topic-pins-title strong, .mob-dm-topic-pins-title strong { font-weight: 700; color: inherit; min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-topic-pins-pin, .mob-dm-topic-pins-pin { color: #539bf5; font-size: 13px; transform: rotate(22deg); opacity: .95; flex-shrink: 0; }
.dm-topic-pins-preview, .mob-dm-topic-pins-preview { margin-top: 1px; color: #cbd5e1; font-size: 12px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-topic-pins-actions, .mob-dm-topic-pins-actions { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; flex-wrap: nowrap; }
.dm-topic-pins-prev, .dm-topic-pins-next, .mob-dm-topic-pins-prev, .mob-dm-topic-pins-next { border: 1px solid rgba(83,155,245,.22); background: rgba(15,23,42,.65); color: #93c5fd; border-radius: 6px; padding: 1px 6px; font-size: 12px; cursor: pointer; line-height: 1; flex-shrink: 0; }
.dm-topic-pins-prev:disabled, .dm-topic-pins-next:disabled, .mob-dm-topic-pins-prev:disabled, .mob-dm-topic-pins-next:disabled { opacity: .35; cursor: not-allowed; }
.dm-topic-pins-prev:not(:disabled):hover, .dm-topic-pins-next:not(:disabled):hover, .mob-dm-topic-pins-prev:not(:disabled):hover, .mob-dm-topic-pins-next:not(:disabled):hover { background: rgba(83,155,245,.16); }
.dm-topic-pins-count, .mob-dm-topic-pins-count { color: #93c5fd; font-size: 11px; font-weight: 700; padding: 0 4px; min-width: 28px; text-align: center; flex-shrink: 0; }
.dm-topic-pins-jump, .mob-dm-topic-pins-jump { border: 1px solid rgba(83,155,245,.22); background: rgba(15,23,42,.65); color: #93c5fd; border-radius: 6px; padding: 2px 6px; font-size: 12px; cursor: pointer; line-height: 1; flex-shrink: 0; }
.dm-topic-pins-jump:hover, .mob-dm-topic-pins-jump:hover { background: rgba(83,155,245,.16); }
.dm-topic-pins-edit, .mob-dm-topic-pins-edit { border: 0; background: transparent; color: #93c5fd; border-radius: 4px; padding: 2px 6px; font-size: 13px; line-height: 1; cursor: pointer; flex-shrink: 0; }
.dm-topic-pins-edit:hover, .mob-dm-topic-pins-edit:hover { background: rgba(83,155,245,.16); }
.dm-topic-pins-unpin, .mob-dm-topic-pins-unpin { border: 0; background: transparent; color: #fca5a5; border-radius: 4px; padding: 2px 6px; font-size: 16px; line-height: 1; cursor: pointer; flex-shrink: 0; }
.dm-topic-pins-unpin:hover, .mob-dm-topic-pins-unpin:hover { background: rgba(248,113,113,.16); }
.dm-topic-pins-detail, .mob-dm-topic-pins-detail { padding: 10px 14px 14px 18px; background: rgba(15,23,42,.74); color: #e2e8f0; font-size: 13px; line-height: 1.55; border-top: 1px solid rgba(148,163,184,.10); max-height: 60vh; overflow-y: auto; }
.dm-topic-pins-detail[hidden], .mob-dm-topic-pins-detail[hidden] { display: none; }
.dm-topic-pins-detail p, .mob-dm-topic-pins-detail p { margin: 0 0 8px; }
.dm-topic-pins-detail strong, .mob-dm-topic-pins-detail strong { color: #f1f5f9; }
.dm-topic-pins-detail a, .mob-dm-topic-pins-detail a { color: #5b8def; }
.dm-topic-pins-detail table, .mob-dm-topic-pins-detail table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.dm-topic-pins-detail th, .dm-topic-pins-detail td, .mob-dm-topic-pins-detail th, .mob-dm-topic-pins-detail td { border: 1px solid #334155; padding: 6px 10px; font-size: 12px; }
.dm-topic-pins-detail th, .mob-dm-topic-pins-detail th { background: #1e293b; }
.dm-topic-pins-detail pre, .mob-dm-topic-pins-detail pre { background: #0f172a; padding: 12px; border-radius: 8px; overflow-x: auto; }
.dm-topic-pins-detail code, .mob-dm-topic-pins-detail code { background: rgba(148,163,184,.12); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
/* B126 — Telegram-style task pin strip. Boss msg=fa80e5ed wanted pinned
 * tasks rendered like Telegram pinned messages — persistent strip ABOVE
 * the chat with bold title + one-line preview, click anywhere to scroll
 * to the source message. Matches the .dm-topic-pins admin pin layout for
 * visual consistency. The previous chip+drawer hid pins behind a button
 * which contradicted the Telegram parity boss explicitly asked for. */
/* B126v3 — carousel pin strip with single-row layout + inline expand.
 * Boss msg=44a61470 reported: (a) Unpin wraps to its own row; (b) text
 * truncates with ellipsis even on a wide panel; (c) modal detail view
 * is inconvenient. v3:
 *   - 3-column grid (accent / copy / actions) with the actions cell as
 *     an inline-flex container holding nav + jump + edit + unpin —
 *     never wraps to a second row.
 *   - .dm-task-pins-detail expands inline beneath the strip when the
 *     [data-pin-expanded] flag is on; replaces the modal overlay.
 *   - Title cell uses minmax(0,1fr) so CSS text-overflow only kicks in
 *     when the row genuinely cannot fit. JS no longer truncates by
 *     character count.
 */
.dm-task-pins-host, .mob-dm-task-pins-host { flex-shrink: 0; }
.dm-task-pins, .mob-dm-task-pins { display: block; padding: 0; background: rgba(23,33,43,.98); border-bottom: 1px solid rgba(148,163,184,.12); }
.dm-task-pins-item, .mob-dm-task-pins-item { min-height: 42px; display: grid; grid-template-columns: 3px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 5px 12px; background: rgba(23,33,43,.98); }
.dm-task-pins-item:hover, .mob-dm-task-pins-item:hover { background: rgba(31,45,59,.98); }
.dm-task-pins-item:focus-visible, .mob-dm-task-pins-item:focus-visible { outline: 2px solid rgba(83,155,245,.7); outline-offset: -2px; }
.dm-task-pins-accent, .mob-dm-task-pins-accent { align-self: stretch; width: 3px; border-radius: 999px; background: #539bf5; }
.dm-task-pins-copy, .mob-dm-task-pins-copy { min-width: 0; }
.dm-task-pins-title, .mob-dm-task-pins-title { display: flex; align-items: center; gap: 6px; color: #f1f5f9; font-size: 13px; line-height: 1.2; font-weight: 700; min-width: 0; }
.dm-task-pins-title strong, .mob-dm-task-pins-title strong { font-weight: 700; color: inherit; min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-task-pins-pin, .mob-dm-task-pins-pin { color: #539bf5; font-size: 13px; transform: rotate(22deg); opacity: .95; flex-shrink: 0; }
.dm-task-pins-topic, .mob-dm-task-pins-topic { color: #93c5fd; font-size: 11px; font-weight: 600; margin-left: 4px; flex-shrink: 0; }
.dm-task-pins-preview, .mob-dm-task-pins-preview { margin-top: 1px; color: #cbd5e1; font-size: 12px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-task-pins-actions, .mob-dm-task-pins-actions { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; flex-wrap: nowrap; }
.dm-task-pins-prev, .dm-task-pins-next, .mob-dm-task-pins-prev, .mob-dm-task-pins-next { border: 1px solid rgba(83,155,245,.22); background: rgba(15,23,42,.65); color: #93c5fd; border-radius: 6px; padding: 1px 6px; font-size: 12px; cursor: pointer; line-height: 1; flex-shrink: 0; }
.dm-task-pins-prev:disabled, .dm-task-pins-next:disabled, .mob-dm-task-pins-prev:disabled, .mob-dm-task-pins-next:disabled { opacity: .35; cursor: not-allowed; }
.dm-task-pins-prev:not(:disabled):hover, .dm-task-pins-next:not(:disabled):hover, .mob-dm-task-pins-prev:not(:disabled):hover, .mob-dm-task-pins-next:not(:disabled):hover { background: rgba(83,155,245,.16); }
.dm-task-pins-count, .mob-dm-task-pins-count { color: #93c5fd; font-size: 11px; font-weight: 700; padding: 0 4px; min-width: 28px; text-align: center; flex-shrink: 0; }
.dm-task-pins-jump, .mob-dm-task-pins-jump { border: 1px solid rgba(83,155,245,.22); background: rgba(15,23,42,.65); color: #93c5fd; border-radius: 6px; padding: 2px 6px; font-size: 12px; cursor: pointer; line-height: 1; flex-shrink: 0; }
.dm-task-pins-jump:hover, .mob-dm-task-pins-jump:hover { background: rgba(83,155,245,.16); }
.dm-task-pins-unpin, .mob-dm-task-pins-unpin { border: 0; background: transparent; color: #fca5a5; border-radius: 4px; padding: 2px 6px; font-size: 16px; line-height: 1; cursor: pointer; flex-shrink: 0; }
.dm-task-pins-unpin:hover, .mob-dm-task-pins-unpin:hover { background: rgba(248,113,113,.16); }
.dm-task-pins-detail, .mob-dm-task-pins-detail { padding: 10px 14px 14px 18px; background: rgba(15,23,42,.74); color: #e2e8f0; font-size: 13px; line-height: 1.55; border-top: 1px solid rgba(148,163,184,.10); max-height: 60vh; overflow-y: auto; }
.dm-task-pins-detail[hidden], .mob-dm-task-pins-detail[hidden] { display: none; }
.dm-task-pins-detail p, .mob-dm-task-pins-detail p { margin: 0 0 8px; }
.dm-task-pins-detail strong, .mob-dm-task-pins-detail strong { color: #f1f5f9; }
.dm-task-pins-detail a, .mob-dm-task-pins-detail a { color: #5b8def; }
.dm-task-pins-detail table, .mob-dm-task-pins-detail table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.dm-task-pins-detail th, .dm-task-pins-detail td, .mob-dm-task-pins-detail th, .mob-dm-task-pins-detail td { border: 1px solid #334155; padding: 6px 10px; font-size: 12px; }
.dm-task-pins-detail th, .mob-dm-task-pins-detail th { background: #1e293b; }
.dm-task-pins-detail pre, .mob-dm-task-pins-detail pre { background: #0f172a; padding: 12px; border-radius: 8px; overflow-x: auto; }
.dm-task-pins-detail code, .mob-dm-task-pins-detail code { background: rgba(148,163,184,.12); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ─── Desktop: Group messages ─── */
.dm-grp-messages {
  flex: 1; overflow-y: auto; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 2px;
  background: #0e1621;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.dm-grp-messages::-webkit-scrollbar { width: 0; height: 0; }
.dm-grp-messages::-webkit-scrollbar-track { background: transparent; }
.dm-grp-messages::-webkit-scrollbar-thumb { background: transparent; border-radius: 0; }
.dm-grp-msg-row { display: flex; margin-bottom: 2px; }
.dm-grp-msg-mine { justify-content: flex-end; }
.dm-grp-msg-other { justify-content: flex-start; }
.dm-grp-bubble {
  /* B131 v2 — boss msg=44a61470 reported the v1 fix did not stop the
   * three-dot truncation. v1 was min(85%, 1100px); v2 lifts to
   * min(96%, 1500px) so bubbles use almost the full DM panel width
   * (only a tiny gutter for the avatar rail) and grow up to 1500px
   * on very wide windows. The remaining truncation case is when the
   * DM panel itself collapses to default width on deploy reset —
   * that's covered by B116 (server-side layout persistence) up next.
   */
  max-width: min(96%, 1500px);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.45;
  position: relative;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.dm-grp-msg-mine .dm-grp-bubble {
  background: #2b5278;
  color: #e1e3e6;
  border-bottom-right-radius: 4px;
}
.dm-grp-msg-other .dm-grp-bubble {
  background: #182533;
  color: #e1e3e6;
  border-bottom-left-radius: 4px;
}
/* B98 Phase A1: sender name is now click-to-reply gesture (boss Q4 directive).
   Add hover state so the affordance is discoverable. JS sets cursor:pointer
   inline; CSS adds underline + text-shadow on hover. */
.dm-grp-sender-name {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  user-select: none;
  transition: text-decoration-color .15s, opacity .15s;
}
.dm-grp-sender-name:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  opacity: .85;
}
.mob-dm-grp-sender-row { user-select: none; }
.mob-dm-grp-sender-row:active { opacity: .75; }
.dm-grp-msg-targets { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:8px; }
.dm-grp-msg-targets-label { font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#7dd3fc; }
.dm-grp-msg-targets-chip, .dm-grp-msg-targets-more { display:inline-flex; align-items:center; min-height:22px; padding:4px 9px; border-radius:999px; background:rgba(14,116,144,.16); border:1px solid rgba(125,211,252,.22); color:#dbeafe; font-size:11px; font-weight:700; }
.dm-grp-msg-targets-chip { cursor:pointer; appearance:none; -webkit-appearance:none; font-family:inherit; line-height:1; }
.dm-grp-msg-targets-chip:hover { background:rgba(14,116,144,.24); border-color:rgba(125,211,252,.34); color:#eff6ff; }
.dm-grp-msg-targets-more { color:#93c5fd; }
.dm-grp-msg-mine .dm-grp-msg-targets-label { color:#bfdbfe; }
.dm-grp-msg-mine .dm-grp-msg-targets-chip, .dm-grp-msg-mine .dm-grp-msg-targets-more { background:rgba(255,255,255,.1); border-color:rgba(255,255,255,.16); color:#eff6ff; }
.dm-grp-command-badge { display:inline-flex; align-items:center; gap:6px; margin:0 0 8px; padding:5px 9px; border-radius:999px; border:1px solid rgba(148,163,184,.18); background:rgba(15,23,42,.62); color:#cbd5e1; font-size:11px; font-weight:800; letter-spacing:.02em; }
.dm-grp-command-badge-task { color:#fed7aa; border-color:rgba(249,115,22,.28); background:rgba(124,45,18,.18); }
.dm-grp-command-badge-question { color:#bfdbfe; border-color:rgba(59,130,246,.28); background:rgba(30,64,175,.16); }
.dm-grp-command-badge-approval { color:#bbf7d0; border-color:rgba(34,197,94,.28); background:rgba(22,101,52,.16); }
.dm-grp-command-badge-rejection { color:#fecaca; border-color:rgba(239,68,68,.28); background:rgba(127,29,29,.18); }
.dm-grp-command-badge-status { color:#ddd6fe; border-color:rgba(139,92,246,.28); background:rgba(76,29,149,.16); }
.dm-grp-assignment { display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin:0 0 8px; }
.dm-grp-assignment-label { font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:#fbbf24; }
.dm-grp-assignment-chip { display:inline-flex; align-items:center; padding:4px 8px; border-radius:999px; border:1px solid rgba(251,191,36,.22); background:rgba(120,53,15,.16); color:#fde68a; font-size:11px; font-weight:800; }
.dm-grp-assignment-chip-ack { color:#bbf7d0; border-color:rgba(34,197,94,.24); background:rgba(22,101,52,.16); }
.dm-grp-msg-text { margin-bottom: 2px; }
.dm-grp-reply-quote { padding: 5px 8px; margin-bottom: 6px; border-left: 3px solid #60a5fa; border-radius: 8px; background: rgba(255,255,255,.05); cursor: pointer; }
.dm-grp-reply-quote:hover { background: rgba(255,255,255,.08); }
.dm-grp-reply-quote-sender { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.dm-grp-reply-quote-text { font-size: 12px; color: #a8b6c7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-grp-msg-jump-target { animation: dm-grp-jump-flash 1.6s ease; }
@keyframes dm-grp-jump-flash { 0% { box-shadow: 0 0 0 0 rgba(96,165,250,.42); } 30% { box-shadow: 0 0 0 6px rgba(96,165,250,.22); } 100% { box-shadow: 0 0 0 0 rgba(96,165,250,0); } }
.dm-grp-msg-meta { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.dm-grp-msg-time { font-size: 11px; opacity: 0.55; color: inherit; }
.dm-grp-msg-avatar-rail { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; box-shadow: 0 6px 18px rgba(15,23,42,.22); margin-right: 10px; align-self: flex-end; }
.dm-grp-msg-avatar-rail-ghost { background: transparent !important; box-shadow: none; }
.dm-grp-msg-row-continuation { margin-top: -1px; }
.dm-grp-msg-row-continuation .dm-grp-bubble { border-top-left-radius: 8px; }
/* Smart Merge decouple (client visual): glue a run of consecutive settled
   same-sender human messages into ONE contiguous bubble. .dm-desk-messages is
   display:flex; gap:4px and .dm-grp-msg-row adds margin-bottom:2px, so the flex
   gap (a container gutter, additive to item margins) leaves a ~6px dark seam
   between rows. A continuation row (mid/end) must pull up by the FULL inter-row
   spacing (gap 4px + prior margin-bottom 2px = 6px) so consecutive bubbles read
   as one with ZERO seam. Interior joins lose all corner radius; only the run's
   outer top corners (start row) and outer bottom corners (end row, incl. the
   tail notch) keep their radius. These rules follow the .dm-grp-msg-mine /
   -other / -continuation radius rules above so they win on equal specificity. */
.dm-grp-run-mid, .dm-grp-run-end { margin-top: -6px; }
.dm-grp-run-start .dm-grp-bubble { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.dm-grp-run-mid .dm-grp-bubble { border-radius: 0; }
.dm-grp-run-end .dm-grp-bubble { border-top-left-radius: 0; border-top-right-radius: 0; }
.dm-grp-msg-actions { display: inline-flex; align-items: center; gap: 6px; opacity: 0; transform: translateY(2px); transition: opacity .14s ease, transform .14s ease; }
.dm-grp-bubble:hover .dm-grp-msg-actions, .dm-grp-msg-actions:focus-within { opacity: 1; transform: translateY(0); }
.dm-grp-msg-action-btn { border: 1px solid rgba(148,163,184,.18); background: rgba(15,23,42,.56); color: #cbd5e1; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 700; cursor: pointer; }
.dm-grp-msg-action-btn:hover { background: rgba(30,41,59,.92); color: #f8fafc; border-color: rgba(96,165,250,.28); }
.dm-grp-msg-mine .dm-grp-msg-action-btn { display: none; }

/* ─── Desktop: Topic tabs ─── */
/* B98 Phase A1: tightened. Padding 8x12->3x10, tab padding 7x14->3x10, font
   12->11. Topic bar visual height ~44px -> ~28px (boss complaint #2 — said
   the topic bar plate was huge/wide). Single horizontal scroll preserved. */
.dm-grp-topic-bar {
  display: flex; gap: 6px; padding: 3px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, #192737 0%, #13202d 100%);
  overflow-x: auto;
  flex-shrink: 0;
}
.dm-grp-topic-bar::-webkit-scrollbar { height: 0; }
/* B98 Phase A2: max-width + ellipsis truncation for long topic names per
   boss directive (he flagged topic-tab widths as huge — long names like
   "DNA Memory Dev Coordination" were rendering full-width). Title attribute
   on each tab exposes the full name on hover. */
.dm-grp-topic-tab {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid rgba(148,163,184,.24);
  color: #d7e2ee;
  background: rgba(15,23,42,.56);
  transition: all 0.15s;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-grp-topic-tab:hover { background: rgba(30,41,59,.92); color: #f8fbff; border-color: rgba(125,211,252,.42); }
.dm-grp-topic-tab.active {
  background: linear-gradient(180deg, #2f6ea5 0%, #21537d 100%);
  color: #fff;
  border-color: rgba(125,211,252,.72);
  box-shadow: inset 0 0 0 1px rgba(191,219,254,.18), 0 6px 18px rgba(14,116,144,.22);
}
.dm-grp-topic-share, .dm-grp-topic-new {
  padding: 7px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  color: #c7d8ea;
  background: rgba(15,23,42,.42);
}
.dm-grp-topic-share { border: 1px solid rgba(148,163,184,.22); }
.dm-grp-topic-share-mentions { color: #7dd3fc; border-color: rgba(125,211,252,.24); }
.dm-grp-topic-new { border: 1px dashed rgba(125,211,252,.36); }
.dm-grp-topic-share:hover, .dm-grp-topic-new:hover { border-color: #7dd3fc; color: #e0f2fe; background: rgba(14,165,233,.12); }
.dm-grp-topic-listeners { display:inline-flex; align-items:center; gap:6px; margin-left:6px; }
.dm-grp-topic-listeners-pill { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px; border:1px solid rgba(148,163,184,.24); background:rgba(15,23,42,.82); color:#cbd5e1; font-size:12px; font-weight:700; cursor:pointer; }
.dm-grp-topic-listeners-full { border-color:rgba(59,130,246,.28); color:#bfdbfe; }
.dm-grp-topic-listeners-mentions { border-color:rgba(16,185,129,.28); color:#a7f3d0; }
.dm-grp-topic-listeners-pill:hover { border-color:#63b3ed; background:rgba(99,179,237,0.05); }
.dm-grp-topic-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: rgba(148,163,184,.2); color: #e2e8f0; font-size: 10px; font-weight: 700; }
.dm-grp-topic-tab.active .dm-grp-topic-count { background: rgba(255,255,255,0.24); color: #fff; }
.dm-grp-topic-closed { color: #9aa7b8 !important; border-style: dashed !important; font-style: italic; }
.dm-grp-topic-closed-item { color: #9aa7b8 !important; border-color: rgba(148,163,184,.24) !important; text-decoration: line-through; }
/* B98 Phase A: compose-context collapsed to a 1-line breadcrumb (Forum Routing
   kicker removed; pill + desc render side-by-side instead of stacked). For
   non-forum groups the JS builder returns '' so the host element stays
   display:none and the plate disappears entirely. */
.dm-grp-compose-context { padding: 6px 14px; border-top: 1px solid rgba(255,255,255,0.05); background: linear-gradient(180deg, rgba(15,23,42,.96), rgba(23,33,43,.96)); flex-shrink: 0; }
.dm-grp-compose-context-copy { display: flex; flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
.dm-grp-compose-context-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 10px; border-radius: 999px; border: 1px solid rgba(125,211,252,.26); background: rgba(14,116,144,.16); color: #e0f2fe; font-size: 11px; font-weight: 700; }
.dm-grp-compose-context-pill-actionable { cursor: pointer; }
.dm-grp-compose-context-pill-actionable:hover { background: rgba(14,116,144,.22); border-color: rgba(125,211,252,.36); }
.dm-grp-compose-context-desc { font-size: 11px; color: #94a3b8; }

/* ─── Desktop: Create group modal ─── */
.dm-grp-create-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.5); display: flex;
  align-items: center; justify-content: center;
}
.dm-grp-create-modal {
  background: #fff; border-radius: 16px; padding: 24px;
  max-width: 440px; width: 90%; max-height: 70vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.dm-grp-create-title {
  font-size: 18px; font-weight: 700; color: #1a1a1a; margin-bottom: 16px;
}
.dm-grp-create-input {
  width: 100%; box-sizing: border-box; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 10px;
  font-size: 14px; margin-bottom: 12px; outline: none; color: #1a1a1a;
}
.dm-grp-create-input:focus { border-color: #059669; box-shadow: 0 0 0 2px rgba(5,150,105,0.15); }
.dm-grp-create-label {
  font-size: 12px; font-weight: 600; color: #64748b;
  text-transform: uppercase; margin: 12px 0 8px; letter-spacing: 0.5px;
}
.dm-grp-create-toggle {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  cursor: pointer; font-size: 13px; color: #1a1a1a;
}
.dm-grp-create-toggle input { width: 16px; height: 16px; accent-color: #059669; }
.dm-grp-create-user-list { max-height: 200px; overflow-y: auto; }
.dm-grp-create-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 8px; cursor: pointer; transition: background 0.15s;
}
.dm-grp-create-user:hover { background: #f0f2f5; }
.dm-grp-create-user.selected { background: #ecfdf5; }
.dm-grp-create-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.dm-grp-create-user-name { font-size: 13px; color: #1a1a1a; flex: 1; }
.dm-grp-create-user-check {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid #d1d5db;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: transparent; transition: all 0.15s;
}
.dm-grp-create-user.selected .dm-grp-create-user-check {
  background: #059669; border-color: #059669; color: #fff;
}
.dm-grp-create-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px;
}
.dm-grp-create-btn {
  padding: 8px 20px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
}
.dm-grp-create-btn-cancel { background: #f1f5f9; color: #64748b; }
.dm-grp-create-btn-create { background: #059669; color: #fff; }
.dm-grp-create-btn-create:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Desktop: Group details panel ─── */
.dm-grp-details {
  position: absolute; right: 0; top: 0; bottom: 0; width: 280px;
  background: #fff; border-left: 1px solid #e2e8f0; overflow-y: auto; z-index: 10;
  box-shadow: -4px 0 16px rgba(0,0,0,0.06);
}
.dm-grp-details-header { padding: 16px; text-align: center; border-bottom: 1px solid #e2e8f0; }
.dm-grp-details-avatar {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px; color: #fff;
}
.dm-grp-details-name { font-size: 16px; font-weight: 700; color: #1a1a1a; }
.dm-grp-details-sub { font-size: 12px; color: #64748b; margin-top: 2px; }
.dm-grp-details-section { padding: 12px 16px; }
.dm-grp-details-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: #94a3b8; margin-bottom: 8px; letter-spacing: 0.5px;
}
.dm-grp-details-member {
  display: flex; align-items: center; gap: 10px; padding: 6px 0;
}
.dm-grp-details-member-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.dm-grp-details-member-name { font-size: 13px; color: #1a1a1a; flex: 1; }
.dm-grp-details-member-role { font-size: 11px; color: #94a3b8; }
.dm-grp-details-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.dm-grp-details-stat-card {
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(15,23,42,.04);
  border-radius: 12px;
  padding: 10px 12px;
}
.dm-grp-details-stat-value { font-size: 14px; font-weight: 700; color: #0f172a; }
.dm-grp-details-stat-label { font-size: 11px; color: #64748b; margin-top: 2px; }
.dm-grp-details-subsection-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: .4px;
  margin: 12px 0 8px;
}
.dm-grp-details-actor-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148,163,184,.12);
}
.dm-grp-details-actor-card:last-child { border-bottom: none; }
.dm-grp-details-actor-card-agent {
  border: 1px solid rgba(59,130,246,.14);
  background: rgba(37,99,235,.04);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 8px;
}
.dm-grp-details-actor-info { min-width: 0; flex: 1; }
.dm-grp-details-actor-meta { font-size: 12px; color: #64748b; margin-top: 2px; }
.dm-grp-details-actor-submeta { font-size: 11px; color: #94a3b8; margin-top: 3px; }
.dm-grp-details-actor-kind {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  background: rgba(15,23,42,.06);
  border-radius: 999px;
  padding: 4px 8px;
}
.dm-grp-details-actor-kind-agent {
  color: #1d4ed8;
  background: rgba(59,130,246,.12);
}
.dm-grp-details-actor-manage {
  border: 1px solid rgba(37,99,235,.18);
  border-radius: 999px;
  background: rgba(37,99,235,.08);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
  cursor: pointer;
}
.dm-grp-details-member-menu {
  position: absolute;
  right: 14px;
  z-index: 3;
  min-width: 170px;
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 14px;
  background: #0f172a;
  box-shadow: 0 16px 40px rgba(15,23,42,.24);
  padding: 8px;
}
.dm-grp-details-member-menu-title {
  font-size: 11px;
  color: #94a3b8;
  padding: 4px 8px 8px;
}
.dm-grp-details-member-menu-action {
  display: block;
  width: 100%;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 8px;
  text-align: left;
}
.dm-grp-details-member-menu-action:hover { background: rgba(148,163,184,.12); }
.dm-grp-details-member-menu-action.danger { color: #fca5a5; }
.dm-grp-details-member-avatar-agent {
  background: linear-gradient(135deg,#0f766e,#2563eb);
}
.dm-grp-details-empty {
  font-size: 12px;
  color: #94a3b8;
  padding: 10px 0;
}
.dm-grp-details-close {
  position: absolute; top: 12px; right: 12px; background: none;
  border: none; color: #94a3b8; font-size: 18px; cursor: pointer;
}
.dm-grp-details-action {
  display: block; width: 100%; padding: 10px; margin-top: 8px;
  border: none; border-radius: 8px; font-size: 13px; cursor: pointer;
  text-align: center; font-weight: 600;
}
.dm-grp-details-action-forum { background: rgba(5,150,105,0.1); color: #059669; }
.dm-grp-details-action-leave { background: rgba(239,68,68,0.1); color: #ef4444; }

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE: Group Chats — dm-grp- prefix
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Group items in Chats list ─── */
.mob-dm-grp-section {
  padding: 0;
}
.mob-dm-grp-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: #5c5c5e; padding: 16px 16px 8px; letter-spacing: 0.5px;
}
.mob-dm-grp-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; position: relative;
  transition: background 0.15s;
}
.mob-dm-grp-item:active { background: rgba(255,255,255,0.04); }
.mob-dm-grp-item::after {
  content: ''; position: absolute; bottom: 0; left: 68px; right: 16px;
  height: 0.5px; background: rgba(255,255,255,0.06);
}
.mob-dm-grp-item:last-child::after { display: none; }
.mob-dm-grp-avatar {
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg, #059669, #0891b2);
}
.mob-dm-grp-info { flex: 1; min-width: 0; }
.mob-dm-grp-name {
  font-size: 16px; font-weight: 600; color: #e2e8f0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mob-dm-grp-preview {
  font-size: 13px; color: #8e8e93; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mob-dm-grp-meta {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 4px; flex-shrink: 0;
}
.mob-dm-grp-time {
  font-size: 12px; color: #5c5c5e;
}

/* ─── Mobile: Group Chat View ─── */
.mob-dm-grp-chat {
  display: flex; flex-direction: column; height: 100%;
  background: #000; position: relative;
  overflow: hidden;
}
/* B98 Phase A (mobile parity): collapsed roster — single chips row only.
   Wrapper padding tightened, top summary + View-all + per-chip second-line meta
   + .mob-dm-chat-controls strip all dropped per boss directive. */
.mob-dm-grp-roster {
  appearance: none; border: none; width: calc(100% - 24px); margin: 6px 12px 0;
  padding: 6px 10px; border-radius: 14px; text-align: left;
  background: linear-gradient(180deg, rgba(19,29,40,.96), rgba(12,18,28,.98));
  border: 1px solid rgba(120,156,199,.16); box-shadow: 0 14px 34px rgba(2,6,23,.28);
}
/* B105 / B98 A4: mobile mirror — chips wrap to MAX 2 rows. */
.mob-dm-grp-roster-items { display: flex; flex-wrap: wrap; gap: 4px; max-height: 72px; overflow: hidden; padding-bottom: 0; }
.mob-dm-grp-roster-chip { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 8px; border-radius: 12px; background: rgba(15,23,42,.54); border: 1px solid rgba(148,163,184,.14); cursor: pointer; }
.mob-dm-grp-roster-chip-agent { border-color: rgba(59,130,246,.22); background: rgba(30,41,59,.8); }
.mob-dm-grp-roster-chip-more { justify-content: center; min-width: 40px; color: #cbd5e1; font-weight: 700; cursor: pointer; appearance: none; }
.mob-dm-grp-roster-chip-overflow { justify-content: center; min-width: 32px; color: #cbd5e1; font-weight: 700; font-size: 16px; line-height: 1; cursor: pointer; appearance: none; }
/* B98 Phase A1: chip avatar restored 22→26 + name max-width 90→140 (mobile mirror). */
.mob-dm-grp-roster-avatar { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; }
.mob-dm-grp-roster-copy { min-width: 0; }
.mob-dm-grp-roster-name { font-size: 12px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.mob-dm-grp-roster-badge { font-size: 9px; font-weight: 700; color: #93c5fd; background: rgba(37,99,235,.14); border: 1px solid rgba(59,130,246,.25); border-radius: 999px; padding: 1px 5px; }
/* B98 Phase A (mobile parity): chat-controls strip removed. CSS kept defensively
   to hide any DOM left over from cached frontends. */
.mob-dm-chat-controls { display: none; }
.mob-dm-chat-controls-btn { border: 1px solid rgba(148,163,184,.16); background: rgba(15,23,42,.66); color: #dbeafe; border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.mob-dm-chat-controls-btn-muted { color: #cbd5e1; }
.mob-dm-topic-drawer-shell {
  position: absolute; inset: 0; z-index: 20; pointer-events: none;
}
.mob-dm-topic-drawer-backdrop {
  position: absolute; inset: 0; border: 0; padding: 0;
  background: rgba(2,6,23,.56); opacity: 0;
  transition: opacity .2s ease;
}
.mob-dm-topic-drawer {
  position: absolute; top: 0; left: 0; height: 100%;
  width: min(86vw, 360px);
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(148,163,184,.18);
  background: linear-gradient(180deg, rgba(17,24,39,.99), rgba(2,6,23,.99));
  box-shadow: 18px 0 42px rgba(0,0,0,.5);
  transform: translateX(-104%);
  transition: transform .2s cubic-bezier(.2,.8,.2,1);
  pointer-events: auto;
}
.mob-dm-topic-drawer-shell.open { pointer-events: auto; }
.mob-dm-topic-drawer-shell.open .mob-dm-topic-drawer-backdrop { opacity: 1; }
.mob-dm-topic-drawer-shell.open .mob-dm-topic-drawer { transform: translateX(0); }
.mob-dm-topic-drawer-head {
  display: flex; align-items: flex-start; justify-content: flex-start; gap: 12px;
  padding: 16px 16px 12px; border-bottom: 1px solid rgba(148,163,184,.12);
}
.mob-dm-topic-drawer-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: #67e8f9;
}
.mob-dm-topic-drawer-title { margin-top: 3px; color: #f8fafc; font-size: 18px; font-weight: 800; }
.mob-dm-topic-drawer-close {
  width: 34px; height: 34px; border-radius: 999px;
  border: 1px solid rgba(148,163,184,.18); background: rgba(15,23,42,.72);
  color: #cbd5e1; font-size: 19px; cursor: pointer; flex-shrink: 0;
}
.mob-dm-topic-drawer .mob-dm-grp-topic-bar {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  padding: 12px; overflow-y: auto; overflow-x: hidden; flex: 1;
  background: transparent; border-bottom: 0;
}
.mob-dm-topic-drawer .mob-dm-grp-topic-tab,
.mob-dm-topic-drawer .mob-dm-grp-topic-share,
.mob-dm-topic-drawer .mob-dm-grp-topic-new,
.mob-dm-topic-drawer .mob-dm-grp-topic-listeners-pill {
  width: 100%; max-width: none; justify-content: flex-start; text-align: left;
  border-radius: 14px; padding: 10px 12px;
}
.mob-dm-topic-drawer .mob-dm-grp-topic-listeners { margin-left: 0; flex-direction: column; align-items: stretch; gap: 8px; }
.mob-dm-actor-directory-shell { position: fixed; inset: 0; z-index: 10030; }
.mob-dm-actor-directory-backdrop { position: absolute; inset: 0; background: rgba(2,6,23,.72); backdrop-filter: blur(8px); }
.mob-dm-actor-directory-sheet { position: absolute; inset: auto 0 0 0; max-height: 84vh; border-radius: 26px 26px 0 0; background: linear-gradient(180deg, rgba(15,23,42,.98), rgba(2,6,23,.99)); border-top: 1px solid rgba(148,163,184,.18); box-shadow: 0 -18px 48px rgba(2,6,23,.5); display: flex; flex-direction: column; animation: mob-dm-picker-in 0.22s ease; }
.mob-dm-actor-directory-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px 14px; border-bottom: 1px solid rgba(148,163,184,.12); }
.mob-dm-actor-directory-kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #67e8f9; }
.mob-dm-actor-directory-title { font-size: 20px; font-weight: 700; color: #f8fafc; margin-top: 4px; }
.mob-dm-actor-directory-close { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(148,163,184,.18); background: rgba(15,23,42,.72); color: #cbd5e1; font-size: 22px; cursor: pointer; }
.mob-dm-actor-directory-body { padding: 16px 16px max(20px, env(safe-area-inset-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.mob-dm-actor-directory-summary { font-size: 13px; color: #94a3b8; margin-bottom: 10px; }
.mob-dm-actor-directory-scope { display:inline-flex; align-items:center; gap:8px; margin-bottom:14px; padding:8px 12px; border-radius:999px; border:1px solid rgba(103,232,249,.22); background:rgba(14,116,144,.16); color:#dbeafe; font-size:12px; font-weight:700; }
.mob-dm-actor-directory-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mob-dm-actor-directory-filter { border: 1px solid rgba(148,163,184,.16); background: rgba(15,23,42,.78); color: #cbd5e1; border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.mob-dm-actor-directory-filter-active { border-color: rgba(96,165,250,.34); background: rgba(30,41,59,.96); color: #eff6ff; }
.mob-dm-actor-directory-filter-count { color: #93c5fd; }
.mob-dm-actor-directory-search { margin-bottom: 14px; }
.mob-dm-actor-directory-search-input { width: 100%; box-sizing: border-box; border: 1px solid rgba(148,163,184,.16); background: rgba(15,23,42,.74); color: #f8fafc; border-radius: 14px; padding: 12px 14px; font-size: 16px; outline: none; }
.mob-dm-actor-directory-search-input:focus { border-color: rgba(96,165,250,.4); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.mob-dm-actor-directory-no-results { font-size: 13px; color: #94a3b8; padding: 4px 0 12px; }
.mob-dm-actor-directory-page { margin: 0 0 12px; font-size: 12px; color: #8fa0b8; }
.mob-dm-actor-directory-load-more { width: 100%; margin-top: 14px; border: 1px solid rgba(96,165,250,.24); background: rgba(30,41,59,.9); color: #dbeafe; border-radius: 14px; padding: 12px 14px; font-size: 13px; font-weight: 700; cursor: pointer; }
.mob-dm-actor-directory-section + .mob-dm-actor-directory-section { margin-top: 18px; }
.mob-dm-actor-directory-section-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8fa0b8; margin-bottom: 10px; }
.mob-dm-actor-directory-empty { font-size: 13px; color: #64748b; padding: 12px 0; }
.mob-dm-actor-directory-card { display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 12px; padding: 12px 14px; border-radius: 18px; border: 1px solid rgba(148,163,184,.12); background: rgba(15,23,42,.58); }
.mob-dm-actor-directory-card + .mob-dm-actor-directory-card { margin-top: 10px; }
.mob-dm-actor-directory-card-agent { border-color: rgba(59,130,246,.2); background: linear-gradient(180deg, rgba(30,41,59,.88), rgba(15,23,42,.94)); }
.mob-dm-actor-directory-card-active { border-color: rgba(96,165,250,.82); box-shadow: 0 0 0 2px rgba(96,165,250,.28), 0 16px 32px rgba(15,23,42,.28); transform: translateY(-1px); }
.mob-dm-actor-directory-card:focus { outline: none; }
.mob-dm-actor-directory-filter-hotkey { display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px; padding:0 5px; border-radius:999px; background: rgba(148,163,184,.18); color:#cbd5e1; font-size:10px; font-weight:700; margin-left:6px; }
.mob-dm-actor-directory-shortcut-hint { margin-top:10px; margin-bottom:12px; color:#94a3b8; font-size:12px; }
.mob-dm-actor-directory-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; }
.mob-dm-actor-directory-copy { min-width: 0; }
.mob-dm-actor-directory-name { font-size: 14px; font-weight: 700; color: #f8fafc; }
.mob-dm-actor-directory-meta { font-size: 12px; color: #93c5fd; margin-top: 2px; }
.mob-dm-actor-directory-submeta { font-size: 12px; color: #8fa0b8; margin-top: 3px; }
.mob-dm-actor-directory-presence, .mob-dm-agent-presence-pill { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; border: 1px solid rgba(148,163,184,.18); background: rgba(15,23,42,.64); color: #cbd5e1; padding: 4px 8px; font-size: 11px; font-weight: 700; }
.mob-dm-actor-directory-presence::before, .mob-dm-agent-presence-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #64748b; }
.mob-dm-actor-directory-presence-online, .mob-dm-agent-presence-pill-online { color: #bbf7d0; border-color: rgba(34,197,94,.26); background: rgba(22,101,52,.16); }
.mob-dm-actor-directory-presence-online::before, .mob-dm-agent-presence-pill-online::before { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.14); }
.mob-dm-actor-directory-presence-recent, .mob-dm-agent-presence-pill-recent { color: #fde68a; border-color: rgba(245,158,11,.26); background: rgba(120,53,15,.16); }
.mob-dm-actor-directory-presence-recent::before, .mob-dm-agent-presence-pill-recent::before { background: #f59e0b; }
.mob-dm-actor-directory-presence-offline, .mob-dm-agent-presence-pill-offline, .mob-dm-actor-directory-presence-never, .mob-dm-agent-presence-pill-never { color: #94a3b8; }
.mob-dm-actor-directory-presence-disabled, .mob-dm-agent-presence-pill-disabled { color: #fecaca; border-color: rgba(239,68,68,.26); background: rgba(127,29,29,.18); }
.mob-dm-actor-directory-presence-disabled::before, .mob-dm-agent-presence-pill-disabled::before { background: #ef4444; }
.mob-dm-actor-directory-badge { margin-top: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #dbeafe; background: rgba(37,99,235,.18); border: 1px solid rgba(96,165,250,.22); border-radius: 999px; padding: 4px 8px; }
.mob-dm-actor-directory-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.mob-dm-actor-directory-action { flex: 1 1 calc(50% - 6px); border: 1px solid rgba(148,163,184,.16); background: rgba(15,23,42,.78); color: #e2e8f0; border-radius: 999px; padding: 9px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
/* B98 Phase A1: mobile topic bar tightened to match desktop (boss complaint #2). */
.mob-dm-grp-topic-bar {
  display: flex; gap: 6px; padding: 3px 10px;
  overflow-x: auto; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  -webkit-overflow-scrolling: touch;
}
.mob-dm-grp-topic-bar::-webkit-scrollbar { display: none; }
/* B98 Phase A2: mobile topic tab cap mirror desktop. */
.mob-dm-grp-topic-tab {
  padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 500;
  white-space: nowrap; border: 1px solid rgba(255,255,255,0.12);
  color: #8e8e93; background: transparent; cursor: pointer;
  transition: all 0.15s; flex-shrink: 0;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-dm-grp-topic-tab.active {
  background: #059669; color: #fff; border-color: #059669;
}
.mob-dm-grp-topic-share, .mob-dm-grp-topic-new {
  padding: 6px 12px; border-radius: 16px; font-size: 13px;
  white-space: nowrap; color: #5c5c5e; background: transparent; cursor: pointer; flex-shrink: 0;
}
.mob-dm-grp-topic-share { border: 1px solid rgba(255,255,255,0.15); }
.mob-dm-grp-topic-manage { color: #f8fafc; border-color: rgba(248,250,252,.18); }
.mob-dm-grp-topic-share-mentions { color: #67e8f9; border-color: rgba(103,232,249,.24); }
.mob-dm-grp-topic-new { border: 1px dashed rgba(255,255,255,0.15); }
.mob-dm-grp-topic-listeners { display:inline-flex; align-items:center; gap:6px; }
.mob-dm-grp-topic-listeners-pill { display:inline-flex; align-items:center; gap:6px; padding:7px 11px; border-radius:999px; border:1px solid rgba(148,163,184,.24); background:rgba(15,23,42,.82); color:#cbd5e1; font-size:12px; font-weight:700; white-space:nowrap; }
.mob-dm-grp-topic-listeners-full { border-color:rgba(59,130,246,.28); color:#bfdbfe; }
.mob-dm-grp-topic-listeners-mentions { border-color:rgba(16,185,129,.28); color:#a7f3d0; }
.mob-dm-grp-messages {
  flex: 1; overflow-y: auto; padding: 12px 16px;
  -webkit-overflow-scrolling: touch;
}
.mob-dm-grp-messages::-webkit-scrollbar { width: 0; }
.mob-dm-grp-msg {
  margin-bottom: 2px;
  animation: mob-dm-msg-enter 0.2s ease;
}
.mob-dm-grp-msg-mine { display: flex; justify-content: flex-end; }
.mob-dm-grp-msg-other { display: flex; justify-content: flex-start; }
.mob-dm-grp-bubble {
  max-width: 90%; border-radius: 18px; padding: 8px 12px;
  font-size: 16px; line-height: 1.4;
}
.mob-dm-grp-msg-mine .mob-dm-grp-bubble {
  background: #059669; color: #fff; border-bottom-right-radius: 4px;
}
.mob-dm-grp-msg-other .mob-dm-grp-bubble {
  background: #1c1c1e; color: #e2e8f0; border-bottom-left-radius: 4px;
}
.mob-dm-grp-sender {
  font-size: 12px; font-weight: 600; margin-bottom: 2px;
  color: #34d399;
}
.mob-dm-grp-msg-mine .mob-dm-grp-sender { display: none; }
.mob-dm-grp-msg-text { word-break: break-word; }
.mob-dm-grp-msg-footer {
  display: flex; align-items: center; gap: 4px;
  justify-content: flex-end; margin-top: 2px;
}
.mob-dm-grp-msg-time { font-size: 11px; opacity: 0.6; }
.mob-dm-grp-msg-mine .mob-dm-grp-msg-time { color: rgba(255,255,255,0.7); }
/* Smart Merge decouple (mobile visual): glue a run of consecutive settled
   same-sender human messages into ONE contiguous bubble — the mobile analog of
   the desktop .dm-grp-run-* rules. NOTE: the mobile numbers DIFFER from desktop
   (measured, not assumed): .mob-dm-grp-messages is a plain BLOCK container (no
   display:flex, no gap), and .mob-dm-grp-msg adds only margin-bottom:2px, so the
   real inter-row seam is 2px. A continuation row (mid/end) pulls up by -2px to
   leave ZERO seam. Interior joins square to 0; only the run's outer top corners
   (start) and outer bottom corners (end, incl. the 4px tail notch) keep the
   18px/4px radius. Placed after the base bubble radius rules so they win on
   equal specificity. */
.mob-dm-grp-run-mid, .mob-dm-grp-run-end { margin-top: -2px; }
.mob-dm-grp-run-start .mob-dm-grp-bubble { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.mob-dm-grp-run-mid .mob-dm-grp-bubble { border-radius: 0; }
.mob-dm-grp-run-end .mob-dm-grp-bubble { border-top-left-radius: 0; border-top-right-radius: 0; }

/* ─── Mobile: Group Input Row ─── */
.mob-dm-grp-input-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(20,24,33,0.98), rgba(12,16,24,0.98));
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  position: relative;
}
.mob-dm-grp-input-row:focus-within {
  box-shadow: 0 0 0 2px rgba(91,141,239,0.22), 0 12px 28px rgba(2,6,23,0.28);
}
.mob-dm-grp-input-row textarea {
  width: 100%;
  min-width: 0;
  background: rgba(30,41,59,0.92); border: 1px solid rgba(148,163,184,0.18); border-radius: 22px;
  padding: 11px 16px; color: #e2e8f0; font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  resize: none; outline: none; max-height: 150px; line-height: 1.4;
  min-height: 44px;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mob-dm-grp-input-row textarea::placeholder { color: #94a3b8; }
.mob-dm-grp-input-row textarea:focus {
  background: rgba(26,39,68,0.96);
  border-color: rgba(5,150,105,0.45);
  box-shadow: 0 0 0 2px rgba(5,150,105,0.16);
}
.mob-dm-grp-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.mob-dm-grp-mention-btn {
  width: 40px; height: 40px; min-width: 40px; min-height: 40px; border-radius: 50%;
  background: rgba(91,141,239,0.16); border: 1px solid rgba(91,141,239,0.22); color: #93c5fd;
  font-size: 18px; font-weight: 700; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.mob-dm-grp-mention-btn:active { transform: translateY(1px); }
.mob-dm-grp-send-btn {
  width: 40px; height: 40px; min-width: 40px; min-height: 40px; border-radius: 50%;
  background: #059669; border: none; color: #fff;
  font-size: 16px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  transition: transform 0.1s;
}
.mob-dm-grp-send-btn:active { transform: scale(0.9); }
.mob-dm-grp-send-btn:disabled { opacity: 0.65; background: #243244; color: #64748b; }
.mob-dm-grp-attach-btn {
  width: 40px; height: 40px; min-width: 40px; min-height: 40px; border-radius: 50%;
  background: transparent; border: none; color: #8e8e93;
  font-size: 20px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}

/* ─── Mobile: Group Details ─── */
/* Group/contact details panel — ensure scrollable on mobile */
.mob-dm-grp-details {
  padding: 16px;
  max-height: calc(100vh - 56px);
  max-height: calc(100dvh - 56px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}
.mob-dm-grp-details-header {
  text-align: center; padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mob-dm-grp-details-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  margin: 0 auto 12px; display: flex;
  align-items: center; justify-content: center;
  font-weight: 700; font-size: 28px; color: #fff;
  background: linear-gradient(135deg, #059669, #0891b2);
}
.mob-dm-grp-details-name {
  font-size: 20px; font-weight: 700; color: #e2e8f0;
}
.mob-dm-grp-details-sub {
  font-size: 13px; color: #8e8e93; margin-top: 4px;
}
.mob-dm-grp-details-section {
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mob-dm-grp-details-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: #5c5c5e; margin-bottom: 12px; letter-spacing: 0.5px;
}
.mob-dm-grp-details-member {
  display: flex; align-items: center; gap: 12px; padding: 8px 0;
}
.mob-dm-grp-details-member-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.mob-dm-grp-details-member-name {
  font-size: 15px; color: #e2e8f0; flex: 1;
}
.mob-dm-grp-details-member-role {
  font-size: 12px; color: #5c5c5e; padding: 2px 8px;
  border-radius: 8px; background: rgba(255,255,255,0.04);
}
.mob-dm-grp-details-member-agent {
  border: 1px solid rgba(59,130,246,.12);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(15,23,42,.22);
}
.mob-dm-grp-details-member-avatar-agent {
  background: linear-gradient(135deg,#0f766e,#2563eb);
}
.mob-dm-grp-details-member-role-agent {
  color: #93c5fd;
  font-weight: 700;
}
.mob-dm-grp-member-manage {
  border: 1px solid rgba(91,141,239,.24);
  border-radius: 999px;
  background: rgba(91,141,239,.12);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}
.mob-grp-enh-permission-status {
  font-size: 12px;
  color: #8e8e93;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}
.mob-dm-grp-details-empty {
  font-size: 13px;
  color: #8e8e93;
  padding: 8px 0;
}
.mob-dm-grp-details-btn {
  display: block; width: 100%; padding: 12px; margin-top: 12px;
  border: none; border-radius: 12px; font-size: 15px;
  font-weight: 600; cursor: pointer; text-align: center;
}
.mob-dm-grp-details-btn-forum {
  background: rgba(5,150,105,0.12); color: #34d399;
}
.mob-dm-grp-details-btn-add {
  background: rgba(91,141,239,0.12); color: #5b8def;
}
.mob-dm-grp-details-btn-leave {
  background: rgba(239,68,68,0.12); color: #ef4444;
}

/* ─── Mobile: Create Group Screen (new, server-backed) ─── */
.mob-dm-grp-create {
  position: fixed; inset: 0; z-index: 10000;
  background: #000; color: #e2e8f0;
  display: flex; flex-direction: column;
  animation: mob-dm-picker-in 0.25s ease;
}
.mob-dm-grp-create-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.mob-dm-grp-create-close {
  background: none; border: none; color: #8e8e93;
  font-size: 24px; cursor: pointer; padding: 0; line-height: 1;
}
.mob-dm-grp-create-title {
  font-size: 18px; font-weight: 700; color: #e2e8f0; flex: 1;
}
.mob-dm-grp-create-body {
  flex: 1; overflow-y: auto; padding: 16px;
  -webkit-overflow-scrolling: touch;
}
.mob-dm-grp-create-input {
  width: 100%; box-sizing: border-box; padding: 12px 16px;
  background: #1c1c1e; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; color: #e2e8f0; font-size: 16px;
  outline: none; margin-bottom: 16px;
}
.mob-dm-grp-create-input:focus {
  border-color: #059669; box-shadow: 0 0 0 2px rgba(5,150,105,0.2);
}
.mob-dm-grp-create-input::placeholder { color: #5c5c5e; }
.mob-dm-grp-create-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: #5c5c5e; margin: 12px 0 8px; letter-spacing: 0.5px;
}
.mob-dm-grp-create-toggle {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  font-size: 15px; color: #e2e8f0;
}
.mob-dm-grp-create-toggle input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: #059669;
}
.mob-dm-grp-create-user {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; border-radius: 10px; cursor: pointer;
}
.mob-dm-grp-create-user.selected { background: rgba(5,150,105,0.08); }
.mob-dm-grp-create-user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.mob-dm-grp-create-user-name { font-size: 15px; color: #e2e8f0; flex: 1; }
.mob-dm-grp-create-user-check {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid #3a3a3c;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: transparent; transition: all 0.15s; flex-shrink: 0;
}
.mob-dm-grp-create-user.selected .mob-dm-grp-create-user-check {
  background: #059669; border-color: #059669; color: #fff;
}
.mob-dm-grp-create-footer {
  padding: 16px; border-top: 1px solid rgba(255,255,255,0.06);
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  flex-shrink: 0;
}
.mob-dm-grp-create-btn {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: #059669; color: #fff; font-size: 16px;
  font-weight: 600; cursor: pointer;
}
.mob-dm-grp-create-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Mobile: FAB menu (New Message / New Group) ─── */
.mob-dm-fab-menu {
  position: fixed; bottom: 100px; right: 20px; z-index: 9998;
  background: #1c1c1e; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; overflow: hidden; min-width: 180px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: mob-dm-picker-in 0.15s ease;
}
.mob-dm-fab-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; color: #e2e8f0; font-size: 15px;
  cursor: pointer; transition: background 0.1s;
}
.mob-dm-fab-menu-item:active { background: rgba(255,255,255,0.06); }
.mob-dm-fab-menu-item + .mob-dm-fab-menu-item {
  border-top: 1px solid rgba(255,255,255,0.06);
}
.mob-dm-fab-menu-icon {
  font-size: 18px; width: 24px; text-align: center;
}
.mob-dm-fab-overlay {
  position: fixed; inset: 0; z-index: 9997;
}

/* ─── Mobile: Group date separator ─── */
.mob-dm-grp-date-sep {
  text-align: center; padding: 12px 0;
}
.mob-dm-grp-date-pill {
  display: inline-block; padding: 4px 14px;
  background: rgba(255,255,255,0.06); border-radius: 12px;
  font-size: 12px; color: #8e8e93; font-weight: 500;
}

/* ─── Mobile: Group file bar ─── */
.mob-dm-grp-file-bar {
  display: flex; gap: 8px; padding: 8px 12px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: #1c1c1e; border-top: 1px solid rgba(255,255,255,0.06);
}
.mob-dm-grp-file-bar::-webkit-scrollbar { display: none; }

/* ─── Mobile: Group message files ─── */
.mob-dm-grp-msg-files { margin-bottom: 4px; }
.mob-dm-grp-msg-image {
  max-width: 100%; border-radius: 12px; cursor: pointer;
  display: block; margin-bottom: 4px;
}
.mob-dm-grp-msg-file {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; background: rgba(255,255,255,0.06);
  border-radius: 8px; margin-bottom: 4px;
  text-decoration: none; color: inherit;
}
.mob-dm-grp-msg-file-icon { font-size: 20px; }
.mob-dm-grp-msg-file-name {
  font-size: 13px; flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════
   ENHANCED GROUP CHATS — Telegram-style features
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Sender avatar + name row ─── */
.mob-dm-grp-sender-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 4px;
}
.mob-dm-grp-sender-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.mob-dm-grp-msg-mine .mob-dm-grp-sender-row { display: none; }
.mob-dm-grp-msg-targets { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin:0 0 6px; }
.mob-dm-grp-msg-targets-label { font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#67e8f9; }
.mob-dm-grp-msg-targets-chip, .mob-dm-grp-msg-targets-more { display:inline-flex; align-items:center; min-height:22px; padding:4px 9px; border-radius:999px; background:rgba(14,116,144,.16); border:1px solid rgba(125,211,252,.22); color:#dbeafe; font-size:11px; font-weight:700; }
.mob-dm-grp-msg-targets-chip { cursor:pointer; appearance:none; -webkit-appearance:none; font-family:inherit; line-height:1; }
.mob-dm-grp-msg-targets-chip:active { background:rgba(14,116,144,.28); border-color:rgba(125,211,252,.34); color:#eff6ff; }
.mob-dm-grp-msg-targets-more { color:#93c5fd; }
.mob-dm-grp-msg-mine .mob-dm-grp-msg-targets-label { color:#dbeafe; }
.mob-dm-grp-msg-mine .mob-dm-grp-msg-targets-chip, .mob-dm-grp-msg-mine .mob-dm-grp-msg-targets-more { background:rgba(255,255,255,.14); border-color:rgba(255,255,255,.18); color:#fff; }
.mob-dm-grp-command-badge { display:inline-flex; align-items:center; gap:6px; margin:0 0 7px; padding:5px 9px; border-radius:999px; border:1px solid rgba(148,163,184,.18); background:rgba(15,23,42,.62); color:#cbd5e1; font-size:11px; font-weight:800; letter-spacing:.02em; }
.mob-dm-grp-command-badge-task { color:#fed7aa; border-color:rgba(249,115,22,.28); background:rgba(124,45,18,.18); }
.mob-dm-grp-command-badge-question { color:#bfdbfe; border-color:rgba(59,130,246,.28); background:rgba(30,64,175,.16); }
.mob-dm-grp-command-badge-approval { color:#bbf7d0; border-color:rgba(34,197,94,.28); background:rgba(22,101,52,.16); }
.mob-dm-grp-command-badge-rejection { color:#fecaca; border-color:rgba(239,68,68,.28); background:rgba(127,29,29,.18); }
.mob-dm-grp-command-badge-status { color:#ddd6fe; border-color:rgba(139,92,246,.28); background:rgba(76,29,149,.16); }
.mob-dm-grp-assignment { display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin:0 0 7px; }
.mob-dm-grp-assignment-label { font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:#fbbf24; }
.mob-dm-grp-assignment-chip { display:inline-flex; align-items:center; padding:4px 8px; border-radius:999px; border:1px solid rgba(251,191,36,.22); background:rgba(120,53,15,.16); color:#fde68a; font-size:11px; font-weight:800; }
.mob-dm-grp-assignment-chip-ack { color:#bbf7d0; border-color:rgba(34,197,94,.24); background:rgba(22,101,52,.16); }

/* ─── Reply quote inside message bubble ─── */
.mob-dm-grp-reply-quote {
  padding: 4px 8px; margin-bottom: 4px;
  border-left: 3px solid #5b8def;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  cursor: pointer;
}
.mob-dm-grp-msg-jump-target { animation: mob-dm-grp-jump-flash 1.6s ease; }
@keyframes mob-dm-grp-jump-flash { 0% { box-shadow: 0 0 0 0 rgba(91,141,239,.42); } 30% { box-shadow: 0 0 0 6px rgba(91,141,239,.22); } 100% { box-shadow: 0 0 0 0 rgba(91,141,239,0); } }
.mob-dm-grp-msg-mine .mob-dm-grp-reply-quote {
  background: rgba(255,255,255,0.12);
}
.mob-dm-grp-reply-quote-sender {
  font-size: 12px; font-weight: 600; margin-bottom: 1px;
}
.mob-dm-grp-reply-quote-text {
  font-size: 13px; color: #94a3b8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 220px;
}
.mob-dm-grp-msg-mine .mob-dm-grp-reply-quote-text {
  color: rgba(255,255,255,0.7);
}

/* ─── Reply bar above input ─── */
/* B98 Phase A (mobile parity): compose-context tightened to 1-line breadcrumb;
   kicker class no longer rendered by builder so its style is dead but kept for
   defense against cached frontends. */
.mob-dm-grp-compose-context { padding: 6px 14px; background: rgba(18,24,32,0.96); border-top: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.mob-dm-grp-compose-context .dm-grp-compose-context-pill { min-height: 24px; }
.mob-dm-grp-compose-context .dm-grp-compose-context-desc { color: #8fa0b8; }

.mob-dm-grp-reply-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(22,22,30,0.95);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid #5b8def;
  flex-shrink: 0;
  animation: mob-reply-bar-in 0.2s ease;
}
.mob-dm-grp-reply-content {
  flex: 1; min-width: 0;
}
.mob-dm-grp-reply-sender {
  font-size: 12px; font-weight: 600; color: #5b8def;
  margin-bottom: 2px;
}
.mob-dm-grp-reply-text {
  font-size: 13px; color: #94a3b8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 260px;
}
.mob-dm-grp-reply-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: none; border: none; color: #64748b;
  font-size: 16px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.mob-dm-grp-reply-close:active { background: rgba(255,255,255,0.08); }

/* ─── Scroll to bottom button ─── */
.mob-dm-grp-scroll-btn {
  position: absolute;
  bottom: 80px; right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(28,28,30,0.95);
  border: 1px solid rgba(255,255,255,0.12);
  color: #e2e8f0;
  font-size: 20px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: opacity 0.2s, transform 0.2s;
  animation: mob-dm-grp-scroll-in 0.2s ease;
}
.mob-dm-grp-scroll-btn:active { transform: scale(0.9); }
@keyframes mob-dm-grp-scroll-in {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* ─── Pinned message banner ─── */
.mob-dm-grp-pinned-bar {
  display: grid; grid-template-columns: 3px minmax(0,1fr) auto; align-items: center; gap: 10px;
  padding: 5px 12px; min-height: 42px;
  background: rgba(23,33,43,0.98);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  cursor: pointer;
}
.mob-dm-grp-pinned-accent {
  align-self: stretch; width: 3px; border-radius: 999px; background: #539bf5;
}
.mob-dm-grp-pinned-content {
  min-width: 0;
}
.mob-dm-grp-pinned-label {
  font-size: 12px; line-height: 1.2; font-weight: 800; color: #539bf5;
}
.mob-dm-grp-pinned-text {
  margin-top: 1px; font-size: 13px; color: #cbd5e1; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mob-dm-grp-pinned-pin {
  color: #539bf5; font-size: 15px; transform: rotate(22deg); opacity: .95;
}

/* ─── Edited indicator for group messages ─── */
.mob-dm-grp-edited {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  font-style: italic;
  margin-right: 4px;
}
.mob-dm-grp-msg-mine .mob-dm-grp-edited {
  color: rgba(255,255,255,0.5);
}

/* ─── Edit input for group messages ─── */
.mob-dm-grp-edit-input {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid #5b8def;
  border-radius: 8px;
  color: #e2e8f0;
  padding: 6px 8px;
  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  resize: none;
  outline: none;
  min-height: 36px;
  line-height: 1.4;
}

/* ─── Topic tab enhancements ─── */
.mob-dm-grp-topic-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: rgba(255,255,255,0.12);
  font-size: 10px; font-weight: 700; color: #8e8e93;
  margin-left: 6px;
}
.mob-dm-grp-topic-tab.active .mob-dm-grp-topic-count {
  background: rgba(255,255,255,0.25); color: #fff;
}
.mob-dm-grp-topic-closed {
  color: #5c5c5e !important;
  border-style: dashed !important;
  font-style: italic;
}
.mob-dm-grp-topic-closed-item {
  color: #5c5c5e !important;
  border-color: rgba(255,255,255,0.08) !important;
  text-decoration: line-through;
}

/* ─── Enhanced Group Details ─── */
.mob-dm-grp-details-name-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.mob-dm-grp-details-edit-btn {
  background: none; border: none; font-size: 16px;
  cursor: pointer; padding: 4px; color: #5b8def;
  border-radius: 50%;
}
.mob-dm-grp-details-edit-btn:active { background: rgba(91,141,239,0.15); }
.mob-dm-grp-details-created {
  font-size: 12px; color: #5c5c5e; margin-top: 6px;
  font-style: italic;
}
.mob-dm-grp-details-desc {
  font-size: 14px; color: #b0b0b3; line-height: 1.5;
  padding: 4px 0;
  word-break: break-word;
}
.mob-dm-grp-details-edit-desc {
  background: none; border: none;
  color: #5b8def; font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 6px 0 0; display: block;
}
.mob-dm-grp-details-edit-desc:active { opacity: 0.7; }

/* ─── Forum toggle switch (iOS-style) ─── */
.mob-dm-grp-details-setting {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; font-size: 15px; color: #e2e8f0;
}
.mob-dm-grp-toggle {
  position: relative; display: inline-block;
  width: 48px; height: 28px;
}
.mob-dm-grp-toggle input {
  opacity: 0; width: 0; height: 0;
}
.mob-dm-grp-toggle-slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #3a3a3c;
  border-radius: 14px;
  transition: background 0.3s;
}
.mob-dm-grp-toggle-slider::before {
  content: '';
  position: absolute;
  height: 22px; width: 22px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}
.mob-dm-grp-toggle input:checked + .mob-dm-grp-toggle-slider {
  background: #059669;
}
.mob-dm-grp-toggle input:checked + .mob-dm-grp-toggle-slider::before {
  transform: translateX(20px);
}
.mob-dm-grp-toggle input:disabled + .mob-dm-grp-toggle-slider {
  opacity: 0.4; cursor: not-allowed;
}

/* ─── Member info in details ─── */
.mob-dm-grp-details-member-info {
  flex: 1; min-width: 0;
}
.mob-dm-grp-details-member-username {
  font-size: 12px; color: #5c5c5e; margin-top: 1px;
}

/* ═══════════════════════════════════════════════════════════════════════
   FEATURE: Swipe to Reply
   ═══════════════════════════════════════════════════════════════════════ */
.mob-dm-msg.swiping, .mob-dm-grp-msg.swiping {
  transition: none !important;
}
.mob-dm-msg, .mob-dm-grp-msg {
  transition: transform 0.25s ease;
  position: relative;
}
.mob-dm-swipe-reply-icon {
  position: absolute;
  left: -36px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(91,141,239,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.mob-dm-swipe-reply-icon.visible {
  opacity: 1;
}

/* DM Reply bar (mobile) */
.mob-dm-reply-bar {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  background: #1a1a22;
  border-top: 1px solid rgba(255,255,255,0.06);
  gap: 8px;
}
.mob-dm-reply-bar-content {
  flex: 1;
  min-width: 0;
  border-left: 3px solid #5b8def;
  padding-left: 10px;
}
.mob-dm-reply-bar-sender {
  font-size: 12px;
  font-weight: 700;
  color: #5b8def;
}
.mob-dm-reply-bar-text {
  font-size: 13px;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-dm-reply-bar-close {
  background: none;
  border: none;
  color: #8e8e93;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
.mob-dm-reply-bar-close:active { color: #fff; }

/* DM Reply quote inside message bubble */
.mob-dm-reply-quote {
  border-left: 3px solid #5b8def;
  padding: 3px 8px;
  margin-bottom: 4px;
  border-radius: 2px;
  background: rgba(91,141,239,0.08);
}
.mob-dm-reply-quote-sender {
  font-size: 11px;
  font-weight: 700;
  color: #5b8def;
}
.mob-dm-reply-quote-text {
  font-size: 12px;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.mob-dm-msg-sent .mob-dm-reply-quote {
  background: rgba(255,255,255,0.08);
}
.mob-dm-msg-sent .mob-dm-reply-quote-text {
  color: rgba(255,255,255,0.6);
}

/* Desktop DM reply bar */
.dm-desk-reply-bar {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: #17212b;
  border-top: 1px solid rgba(255,255,255,0.06);
  gap: 8px;
}
.dm-desk-reply-bar-content {
  flex: 1;
  min-width: 0;
  border-left: 3px solid #4eabf9;
  padding-left: 10px;
}
.dm-desk-reply-bar-sender {
  font-size: 12px;
  font-weight: 700;
  color: #4eabf9;
}
.dm-desk-reply-bar-text {
  font-size: 13px;
  color: #8a9099;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-desk-reply-bar-close {
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  color: #6c7883;
  font-size: 14px;
  cursor: pointer;
}
.dm-desk-reply-bar-close:hover { background: rgba(255,255,255,0.08); color: #e1e3e6; }

/* Desktop reply quote in message bubble */
.dm-desk-reply-quote {
  border-left: 3px solid #4eabf9;
  padding: 3px 8px;
  margin-bottom: 6px;
  border-radius: 2px;
  background: rgba(78,171,249,0.08);
  cursor: pointer;
}
.dm-desk-reply-quote-sender {
  font-size: 11px;
  font-weight: 700;
  color: #4eabf9;
}
.dm-desk-reply-quote-text {
  font-size: 12px;
  color: #8a9099;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

/* ═══════════════════════════════════════════════════════════════════════
   FEATURE: Typing Indicator
   ═══════════════════════════════════════════════════════════════════════ */
.mob-dm-typing-indicator, .dm-desk-typing-indicator {
  font-size: 12px;
  color: #5b8def;
  display: none;
}
.mob-dm-typing-indicator.active, .dm-desk-typing-indicator.active {
  display: block;
}
.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
}
.typing-dots span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #5b8def;
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════════
   FEATURE: Online / Last Seen Status
   ═══════════════════════════════════════════════════════════════════════ */
.mob-dm-online-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0f0f14;
  display: none;
}
.mob-dm-online-dot.online {
  display: block;
}
.dm-desk-online-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #3dcc6e;
  border: 2px solid #17212b;
  display: none;
}
.dm-desk-online-dot.online {
  display: block;
}
.dm-desk-avatar, .mob-dm-avatar {
  position: relative;
}
.dm-desk-header-status {
  font-size: 12px;
  color: #3dcc6e;
}
.dm-desk-header-status.offline {
  color: #6c7883;
}

/* ═══════════════════════════════════════════════════════════════════════
   FEATURE: Drafts
   ═══════════════════════════════════════════════════════════════════════ */
.mob-dm-draft-label, .mob-dm-grp-draft-label {
  color: #ef4444;
  font-weight: 700;
  font-size: 13px;
}
.dm-desk-draft-label {
  color: #e55454;
  font-weight: 600;
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════
   FEATURE: New Messages Divider
   ═══════════════════════════════════════════════════════════════════════ */
.mob-dm-new-msgs-divider, .dm-desk-new-msgs-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  margin: 4px 0;
}
.mob-dm-new-msgs-divider::before, .mob-dm-new-msgs-divider::after,
.dm-desk-new-msgs-divider::before, .dm-desk-new-msgs-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #5b8def;
}
.mob-dm-new-msgs-divider span, .dm-desk-new-msgs-divider span {
  font-size: 12px;
  font-weight: 600;
  color: #5b8def;
  white-space: nowrap;
  padding: 0 4px;
}
.dm-desk-new-msgs-divider::before, .dm-desk-new-msgs-divider::after {
  background: #4eabf9;
}
.dm-desk-new-msgs-divider span {
  color: #4eabf9;
}

/* ═══════════════════════════════════════════════════════════════════════
   CONTENT FEATURES #6-#10 — Voice, Emoji, Caption, Link Preview, Formatting
   Prefix: .mob-content-
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── #10: Text Formatting (Markdown-lite) ─── */
.mob-content-codeblock {
  display: block;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 13px;
  color: #a5d6ff;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 4px 0;
  overflow-x: auto;
  /* B237.1 — html/body sets touch-action: pan-y, which silently
     defeated the overflow-x:auto here: a horizontal swipe over a long
     code line was hijacked into vertical message-list scroll. Allowing
     pan-x at the codeblock level lets users actually scroll long
     lines without leaving the message. */
  touch-action: pan-x;
}
.mob-content-code {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  color: #ffa657;
}
.mob-dm-bubble strong,
.mob-dm-grp-bubble strong {
  font-weight: 700;
}
.mob-dm-bubble em,
.mob-dm-grp-bubble em {
  font-style: italic;
}

/* ─── Formatting hint below textarea ─── */
.mob-content-format-hint {
  padding: 2px 12px 4px;
  font-size: 10px;
  color: #64748b;
  background: #0f0f14;
  line-height: 1.4;
  flex-shrink: 0;
}
.mob-content-format-hint b {
  font-weight: 700;
  color: #8e8e93;
}
.mob-content-format-hint em {
  font-style: italic;
  color: #8e8e93;
}
.mob-content-format-hint code {
  font-family: 'SF Mono', monospace;
  font-size: 10px;
  color: #8e8e93;
  background: rgba(255,255,255,0.06);
  padding: 0 3px;
  border-radius: 3px;
}

/* ─── #9: Link Preview ─── */
.mob-content-link-preview {
  display: block;
  text-decoration: none;
  margin: 6px 0 4px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.mob-content-link-preview:active {
  background: rgba(255,255,255,0.08);
}
.mob-content-link-preview-inner {
  padding: 8px 10px;
  border-left: 3px solid #5b8def;
}
.mob-content-link-domain {
  font-size: 12px;
  font-weight: 600;
  color: #5b8def;
  margin-bottom: 2px;
}
.mob-content-link-url {
  font-size: 11px;
  color: #8e8e93;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── #7: Emoji Picker ─── */
.mob-content-emoji-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: none;
  border: none;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s;
}
.mob-content-emoji-btn:active {
  transform: scale(0.9);
}
.mob-content-emoji-panel {
  background: #1c1c24;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
  max-height: 280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  animation: mob-content-emoji-slide-up 0.2s ease-out;
}
@keyframes mob-content-emoji-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.mob-content-emoji-search-row {
  padding: 8px 10px 4px;
  flex-shrink: 0;
}
.mob-content-emoji-search {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 6px 10px;
  color: #e2e8f0;
  font-size: 14px;
  outline: none;
}
.mob-content-emoji-search::placeholder {
  color: #64748b;
}
.mob-content-emoji-search:focus {
  border-color: rgba(91,141,239,0.4);
}
.mob-content-emoji-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 4px 6px;
  flex-shrink: 0;
  scrollbar-width: none;
}
.mob-content-emoji-tabs::-webkit-scrollbar { display: none; }
.mob-content-emoji-tab {
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.mob-content-emoji-tab:active,
.mob-content-emoji-tab.active {
  background: rgba(91,141,239,0.2);
}
.mob-content-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 4px 8px 10px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.mob-content-emoji-grid::-webkit-scrollbar {
  width: 4px;
}
.mob-content-emoji-grid::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}
.mob-content-emoji-item {
  background: none;
  border: none;
  font-size: 24px;
  padding: 4px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
  min-height: 36px;
}
.mob-content-emoji-item:active {
  background: rgba(255,255,255,0.1);
  transform: scale(1.15);
}
.mob-content-emoji-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  color: #64748b;
  font-size: 13px;
}

/* ─── #8: Caption on Photos ─── */
.mob-content-caption-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.mob-content-caption-card {
  background: #1c1c24;
  border-radius: 16px;
  overflow: hidden;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.mob-content-caption-preview {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 300px;
  overflow: hidden;
}
.mob-content-caption-preview img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
}
.mob-content-caption-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.06);
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px 14px;
  color: #e2e8f0;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 44px;
  max-height: 100px;
}
.mob-content-caption-input::placeholder {
  color: #64748b;
}
.mob-content-caption-btns {
  display: flex;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.mob-content-caption-cancel {
  flex: 1;
  padding: 14px;
  background: none;
  border: none;
  color: #8e8e93;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.mob-content-caption-cancel:active {
  background: rgba(255,255,255,0.05);
}
.mob-content-caption-send {
  flex: 1;
  padding: 14px;
  background: none;
  border: none;
  border-left: 1px solid rgba(255,255,255,0.06);
  color: #5b8def;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.mob-content-caption-send:active {
  background: rgba(91,141,239,0.1);
}

/* ─── #6: Voice Messages ─── */

/* Mic button */
.mob-content-mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #5b8def;
  border: none;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  color: #fff;
}
.mob-content-mic-btn:active {
  background: #4a7de0;
  transform: scale(0.92);
}

/* Recording overlay (replaces input row) */
.mob-content-recording-overlay {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: #0f0f14;
  border-top: 1px solid rgba(255,50,50,0.3);
  flex-shrink: 0;
  animation: mob-content-rec-fade-in 0.2s ease-out;
}
@keyframes mob-content-rec-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.mob-content-recording-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.mob-content-recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  animation: mob-content-rec-pulse 1s infinite;
  flex-shrink: 0;
}
@keyframes mob-content-rec-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}
.mob-content-recording-timer {
  font-size: 16px;
  font-weight: 600;
  color: #ef4444;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
}
.mob-content-recording-slide {
  font-size: 13px;
  color: #64748b;
  margin-left: auto;
  animation: mob-content-slide-hint 2s ease-in-out infinite;
}
@keyframes mob-content-slide-hint {
  0%, 100% { opacity: 0.6; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(-8px); }
}

/* Waveform voice message player */
.mob-content-voice-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  min-width: 180px;
  max-width: 240px;
}
.mob-content-voice-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #5b8def;
  border: none;
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  padding: 0;
  padding-left: 2px; /* visual centering for triangle */
}
.mob-content-voice-play:active {
  background: #4a7de0;
  transform: scale(0.9);
}
.mob-content-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  height: 28px;
}
.mob-content-waveform-bar {
  width: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.25);
  flex-shrink: 0;
  transition: background 0.2s;
  min-height: 4px;
}
.mob-content-waveform-bar.active {
  background: #5b8def;
}
.mob-content-voice-dur {
  font-size: 11px;
  color: #8e8e93;
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* #11-15: Chat Organization Features                                 */
/* ═══════════════════════════════════════════════════════════════════ */

/* ─── #11: Chat Folder Tabs ─── */
.mob-org-folder-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: #0d0d14;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.mob-org-folder-tabs::-webkit-scrollbar { display: none; }

.mob-org-folder-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  color: #8e8e93;
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.mob-org-folder-tab.active {
  background: #5b8def;
  color: #fff;
}
.mob-org-folder-tab:active {
  transform: scale(0.95);
}
.mob-org-folder-add {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: #8e8e93;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.mob-org-folder-add:active {
  background: rgba(255,255,255,0.12);
  transform: scale(0.9);
}

/* ─── Create Folder Dialog ─── */
.mob-org-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mob-org-fade-in 0.15s ease-out;
}
.mob-org-overlay.transparent {
  background: transparent;
}
@keyframes mob-org-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.mob-org-dialog {
  width: 90%;
  max-width: 360px;
  max-height: 80vh;
  background: #1e1e2e;
  border-radius: 16px;
  padding: 20px;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  animation: mob-org-dialog-appear 0.2s ease-out;
}
@keyframes mob-org-dialog-appear {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.mob-org-dialog-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 14px;
}
.mob-org-dialog-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #e2e8f0;
  font-size: 15px;
  outline: none;
  margin-bottom: 12px;
  box-sizing: border-box;
}
.mob-org-dialog-input:focus {
  border-color: #5b8def;
}
.mob-org-dialog-subtitle {
  font-size: 13px;
  color: #8e8e93;
  margin-bottom: 8px;
}
.mob-org-dialog-chatlist {
  max-height: 40vh;
  overflow-y: auto;
  margin-bottom: 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
}
.mob-org-dialog-chatrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.mob-org-dialog-chatrow:active {
  background: rgba(255,255,255,0.06);
}
.mob-org-dialog-chatrow-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.mob-org-dialog-chatrow-check.checked {
  background: #5b8def;
  border-color: #5b8def;
}
.mob-org-dialog-chatrow-check.checked::after {
  content: '\2713';
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.mob-org-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.mob-org-dialog-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.mob-org-dialog-btn-cancel {
  background: rgba(255,255,255,0.08);
  color: #8e8e93;
}
.mob-org-dialog-btn-cancel:active {
  background: rgba(255,255,255,0.14);
}
.mob-org-dialog-btn-ok {
  background: #5b8def;
  color: #fff;
}
.mob-org-dialog-btn-ok:active {
  background: #4a7de0;
  transform: scale(0.97);
}

/* ─── Folder context menu ─── */
.mob-org-ctx-menu {
  position: fixed;
  z-index: 301;
  background: #1e1e2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  min-width: 180px;
  padding: 4px 0;
  overflow: hidden;
  animation: mob-ctx-appear 0.15s ease-out;
}
.mob-org-ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.mob-org-ctx-item:active {
  background: rgba(255,255,255,0.06);
}
.mob-org-ctx-danger {
  color: #ef4444;
}
.mob-org-ctx-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* ─── #12: Pin icon ─── */
.mob-org-pin-icon {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 10px;
  color: #5b8def;
  opacity: 0.8;
  z-index: 1;
}

/* ─── #13: Mute icon ─── */
.mob-org-mute-icon {
  font-size: 12px;
  color: #636366;
  margin-left: 4px;
  flex-shrink: 0;
}

/* ─── Mute submenu ─── */
.mob-org-mute-submenu {
  position: fixed;
  z-index: 302;
  background: #1e1e2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
  min-width: 130px;
  padding: 4px 0;
  animation: mob-ctx-appear 0.12s ease-out;
}
.mob-org-mute-option {
  padding: 10px 16px;
  font-size: 14px;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.mob-org-mute-option:active {
  background: rgba(255,255,255,0.06);
}

/* ─── #14: Archive section ─── */
.mob-org-archived-section {
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.mob-org-archived-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 14px;
  color: #8e8e93;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.mob-org-archived-header:active {
  background: rgba(255,255,255,0.04);
}
.mob-org-archived-icon {
  font-size: 16px;
}
.mob-org-archived-label {
  flex: 1;
  font-weight: 500;
}
.mob-org-archived-count {
  background: rgba(255,255,255,0.08);
  color: #8e8e93;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.mob-org-archived-chevron {
  font-size: 10px;
  color: #636366;
  transition: transform 0.2s;
}
.mob-org-archived-content {
  padding: 0 8px 8px;
}
.mob-org-archived-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.mob-org-archived-item:active {
  background: rgba(255,255,255,0.04);
}
.mob-org-archived-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.mob-org-archived-name {
  flex: 1;
  font-size: 14px;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-org-archived-type {
  font-size: 11px;
  color: #636366;
  font-weight: 400;
}
.mob-org-archived-unarchive {
  padding: 5px 12px;
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 8px;
  color: #5b8def;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.mob-org-archived-unarchive:active {
  background: rgba(91,141,239,0.2);
  transform: scale(0.95);
}

/* ─── #14: Swipe-to-archive action ─── */
.mob-org-swipe-archive {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100px;
  background: #ef4444;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  gap: 4px;
  border-radius: 0 10px 10px 0;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: -1;
  pointer-events: none;
}

/* ─── #15: Unread dot ─── */
.mob-org-unread-dot {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5b8def;
  z-index: 1;
}

/* ─── Extended context menu (wider) ─── */
.mob-org-extended-menu {
  min-width: 190px;
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* GROUP ENHANCEMENTS #16-#20: Polls, @Mentions, Permissions, Invite, Slow Mode */
/* ═══════════════════════════════════════════════════════════════════════ */

/* ─── #16: Poll Button in Input Row ─── */
.mob-grp-enh-poll-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  color: #8e8e93;
}
.mob-grp-enh-poll-btn:active {
  background: rgba(91,141,239,0.15);
  transform: scale(0.92);
}

/* ─── #16: Poll Creation Modal ─── */
.mob-grp-enh-poll-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: mob-grp-enh-fade-in 0.2s ease-out;
}
@keyframes mob-grp-enh-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.mob-grp-enh-poll-modal {
  background: #1c1c1e;
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.mob-grp-enh-poll-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  text-align: center;
}
.mob-grp-enh-poll-question {
  width: 100%;
  padding: 12px 14px;
  background: #2c2c2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  outline: none;
  margin-bottom: 12px;
  box-sizing: border-box;
}
.mob-grp-enh-poll-question:focus {
  border-color: #5b8def;
}
.mob-grp-enh-poll-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.mob-grp-enh-poll-option {
  width: 100%;
  padding: 10px 14px;
  background: #2c2c2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
.mob-grp-enh-poll-option:focus {
  border-color: #5b8def;
}
.mob-grp-enh-poll-opt-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mob-grp-enh-poll-opt-row .mob-grp-enh-poll-option {
  flex: 1;
}
.mob-grp-enh-poll-opt-remove {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(239,68,68,0.15);
  border: none;
  color: #ef4444;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.mob-grp-enh-poll-opt-remove:active {
  background: rgba(239,68,68,0.3);
}
.mob-grp-enh-poll-add-opt {
  width: 100%;
  padding: 10px;
  background: none;
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 10px;
  color: #5b8def;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background 0.15s;
}
.mob-grp-enh-poll-add-opt:active {
  background: rgba(91,141,239,0.1);
}
.mob-grp-enh-poll-toggles {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.mob-grp-enh-poll-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c7c7cc;
  font-size: 14px;
  cursor: pointer;
}
.mob-grp-enh-poll-toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #5b8def;
}
.mob-grp-enh-poll-actions {
  display: flex;
  gap: 10px;
}
.mob-grp-enh-poll-cancel {
  flex: 1;
  padding: 12px;
  background: #2c2c2e;
  border: none;
  border-radius: 10px;
  color: #8e8e93;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.mob-grp-enh-poll-cancel:active {
  background: #3a3a3c;
}
.mob-grp-enh-poll-send {
  flex: 1;
  padding: 12px;
  background: #5b8def;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.mob-grp-enh-poll-send:active {
  background: #4a7de0;
}

/* ─── #16: Poll Card (in-message) ─── */
.mob-grp-enh-poll-card {
  padding: 12px;
  min-width: 220px;
  max-width: 300px;
}
.mob-grp-enh-poll-card-question {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.3;
}
.mob-grp-enh-poll-card-type {
  font-size: 11px;
  color: #8e8e93;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.mob-grp-enh-poll-option-row {
  position: relative;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.mob-grp-enh-poll-option-row:active {
  background: rgba(255,255,255,0.1);
}
.mob-grp-enh-poll-option-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(91,141,239,0.15);
  border-radius: 8px;
  transition: width 0.4s ease-out;
}
.mob-grp-enh-poll-voted .mob-grp-enh-poll-option-bar {
  background: rgba(91,141,239,0.3);
}
.mob-grp-enh-poll-option-text {
  position: relative;
  z-index: 1;
  font-size: 14px;
  color: #e5e5ea;
}
.mob-grp-enh-poll-voted .mob-grp-enh-poll-option-text {
  color: #5b8def;
  font-weight: 600;
}
.mob-grp-enh-poll-option-pct {
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: #8e8e93;
  font-weight: 500;
  min-width: 32px;
  text-align: right;
}
.mob-grp-enh-poll-voted .mob-grp-enh-poll-option-pct {
  color: #5b8def;
}
.mob-grp-enh-poll-correct {
  border-left: 3px solid #34d399;
}
.mob-grp-enh-poll-correct .mob-grp-enh-poll-option-bar {
  background: rgba(52,211,153,0.2);
}
.mob-grp-enh-poll-wrong {
  border-left: 3px solid #ef4444;
}
.mob-grp-enh-poll-wrong .mob-grp-enh-poll-option-bar {
  background: rgba(239,68,68,0.15);
}
.mob-grp-enh-poll-total {
  font-size: 12px;
  color: #636366;
  margin-top: 6px;
  text-align: center;
}

/* ─── #17: @Mention Dropdown ─── */
.dm-desk-mention-popup {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 74px;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(24,37,51,.98), rgba(15,23,34,.98));
  border: 1px solid rgba(120,156,199,.18);
  border-radius: 18px;
  padding: 8px 0;
  z-index: 140;
  box-shadow: 0 20px 48px rgba(2,6,23,.48);
  backdrop-filter: blur(18px);
  overflow: hidden;
}
.dm-desk-mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .12s ease, transform .12s ease;
}
.dm-desk-mention-item:hover,
.dm-desk-mention-item.active {
  background: rgba(91,141,239,.16);
}
.dm-desk-mention-item:active {
  transform: translateY(1px);
}
.dm-mention-group { padding-top: 2px; }
.dm-mention-group + .dm-mention-group { border-top: 1px solid rgba(148,163,184,.12); margin-top: 4px; padding-top: 8px; }
.dm-mention-group-label { padding: 4px 14px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #7f8ea3; }
.dm-mention-popup-footer { padding: 8px 14px 2px; font-size: 11px; color: #7f8ea3; border-top: 1px solid rgba(148,163,184,.12); margin-top: 6px; }
.mob-grp-enh-mention-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(28,28,30,.98), rgba(16,24,32,.98));
  border: 1px solid rgba(120,156,199,0.18);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(0,0,0,0.42);
  max-height: 240px;
  overflow-y: auto;
  z-index: 140;
  margin-bottom: 0;
  animation: mob-grp-enh-slide-up 0.15s ease-out;
  backdrop-filter: blur(18px);
}
@keyframes mob-grp-enh-slide-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.mob-grp-enh-mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}
.mob-grp-enh-mention-item:active,
.mob-grp-enh-mention-item.active {
  background: rgba(91,141,239,0.18);
}
.mob-grp-enh-mention-item:active {
  transform: translateY(1px);
}
.mob-grp-enh-mention-group-label { padding: 8px 14px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8fa0b8; }
.mob-grp-enh-mention-footer { padding: 8px 14px 10px; font-size: 11px; color: #8fa0b8; border-top: 1px solid rgba(148,163,184,.12); margin-top: 6px; }
.mob-grp-enh-mention-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.mob-grp-enh-mention-name {
  font-size: 14px;
  color: #e5e5ea;
  font-weight: 500;
}

/* ─── #17: @Mention Highlight in Messages ─── */
.mob-grp-enh-mention {
  color: #5b8def;
  font-weight: 600;
  cursor: pointer;
}

/* ─── #18: Permissions Loading ─── */
.mob-grp-enh-perms-loading {
  color: #8e8e93;
  font-size: 13px;
  padding: 8px 0;
}

/* ─── #18: No-send notice ─── */
.mob-grp-enh-no-send-notice {
  padding: 14px 16px;
  text-align: center;
  color: #8e8e93;
  font-size: 13px;
  background: #1c1c1e;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

/* ─── #19: Invite Link ─── */
.mob-grp-enh-invite-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}
.mob-grp-enh-invite-link-text {
  flex: 1;
  font-size: 13px;
  color: #5b8def;
  word-break: break-all;
  line-height: 1.3;
}
.mob-grp-enh-invite-copy-btn {
  padding: 6px 14px;
  background: #5b8def;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.mob-grp-enh-invite-copy-btn:active {
  background: #4a7de0;
}
.mob-grp-enh-invite-stats {
  font-size: 12px;
  color: #636366;
  padding: 4px 0 8px;
}
.mob-grp-enh-invite-gen-btn {
  width: 100%;
  padding: 10px;
  background: rgba(91,141,239,0.1);
  border: 1px solid rgba(91,141,239,0.2);
  border-radius: 10px;
  color: #5b8def;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
}
.mob-grp-enh-invite-gen-btn:active {
  background: rgba(91,141,239,0.2);
}
.mob-grp-enh-invite-opt-row {
  margin-bottom: 12px;
}
.mob-grp-enh-invite-opt-row label {
  display: block;
  font-size: 13px;
  color: #8e8e93;
  margin-bottom: 6px;
}

/* ─── #20: Slow Mode ─── */
.mob-grp-enh-slowmode-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}
.mob-grp-enh-slowmode-btn {
  padding: 8px 14px;
  background: #2c2c2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: #c7c7cc;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.mob-grp-enh-slowmode-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.mob-grp-enh-slowmode-btn.active {
  background: rgba(91,141,239,0.15);
  border-color: #5b8def;
  color: #5b8def;
  font-weight: 600;
}
.mob-grp-enh-slowmode-btn:not(:disabled):active {
  background: rgba(91,141,239,0.1);
}

/* ─── #20: Slow mode active state on send button ─── */
.mob-grp-enh-slowmode-active {
  background: #2c2c2e !important;
  color: #ef4444 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums;
}

/* ─── #20: Slow mode indicator in header ─── */
.mob-grp-enh-slow-indicator {
  color: #f59e0b;
  font-size: 11px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* Smart Messaging: Gear button, Settings popup, Corrected toast,    */
/* Merge highlight, Album-style photo grid                           */
/* ═══════════════════════════════════════════════════════════════════ */

/* ─── Gear button (in input row) ─── */
.mob-smart-gear-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: none;
  color: #8e8e93;
  font-size: 18px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  border-radius: 50%;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.mob-dm-input-actions .mob-content-emoji-btn,
.mob-dm-input-actions .mob-smart-gear-btn {
  width: 32px;
  height: 36px;
  min-width: 32px;
  min-height: 36px;
  font-size: 16px;
}
.mob-dm-grp-tools .mob-content-emoji-btn,
.mob-dm-grp-tools .mob-smart-gear-btn,
.mob-dm-grp-tools .mob-content-mic-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  flex: 0 0 40px;
}
.mob-smart-gear-btn:hover,
.mob-smart-gear-btn:active {
  color: #5b8def;
}
.mob-smart-gear-btn-desk {
  font-size: 16px;
  padding: 4px 6px;
}

/* ─── Settings popup ─── */
.mob-smart-settings-popup {
  position: fixed;
  z-index: 99999;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  width: auto;
  max-width: 420px;
  box-sizing: border-box;
  margin: 0 auto;
  background: #1c1c1e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: mob-smart-popup-in 0.15s ease-out;
}
@keyframes mob-smart-popup-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mob-smart-settings-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}
.mob-smart-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  position: relative;
  gap: 12px;
}
.mob-smart-settings-label {
  font-size: 13px;
  color: #c7c7cc;
  flex: 1;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  user-select: none;
}

/* Toggle switch */
.mob-smart-toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.mob-smart-slider {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  background: #3a3a3c;
  border-radius: 13px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.mob-smart-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.mob-smart-toggle:checked + .mob-smart-slider {
  background: #34c759;
}
.mob-smart-toggle:checked + .mob-smart-slider::after {
  transform: translateX(18px);
}

/* ─── Corrected toast ─── */
.mob-smart-corrected-toast {
  position: fixed;
  z-index: 100000;
  background: rgba(52,199,89,0.9);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 8px;
  transform: translate(-50%, 0);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.mob-smart-corrected-show {
  opacity: 1;
  transform: translate(-50%, -4px);
}
.mob-smart-corrected-hide {
  opacity: 0;
  transform: translate(-50%, 4px);
}

/* ─── Merge highlight ─── */
.mob-smart-merge-highlight {
  animation: mob-smart-merge-flash 1.5s ease-out;
}
@keyframes mob-smart-merge-flash {
  0%   { background-color: rgba(91,141,239,0.25); }
  100% { background-color: transparent; }
}

/* ─── Album-style photo grid ─── */
.mob-smart-album {
  display: grid;
  gap: 2px;
  border-radius: 12px;
  overflow: hidden;
  max-width: 280px;
  margin-bottom: 4px;
}
.mob-smart-album-2 {
  grid-template-columns: 1fr 1fr;
}
.mob-smart-album-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
}
.mob-smart-album-3 .mob-smart-album-item:first-child {
  grid-column: 1 / -1;
}
.mob-smart-album-grid {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.mob-smart-album-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: #1c1c1e;
  min-height: 80px;
}
.mob-smart-album-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.15s;
}
.mob-smart-album-item:active img {
  transform: scale(0.97);
}
.mob-smart-album-more {
  position: relative;
}
.mob-smart-album-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  pointer-events: none;
}

/* Desktop adjustments for album */
@media (min-width: 769px) {
  .mob-smart-album {
    max-width: 360px;
  }
  .mob-smart-album-item {
    min-height: 100px;
  }
}

/* ─── Compute Node Status Animations ─────────── */
@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.7); }
  70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
@keyframes bounce-dot {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-4px); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* ─── Tooltip System (CSS-only) ─────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  max-width: 220px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease 0.5s;
  z-index: 1000;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
[data-tooltip]:hover::after { opacity: 1; }
[data-tooltip]::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1e293b;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease 0.5s;
  z-index: 1000;
}
[data-tooltip]:hover::before { opacity: 1; }


/* ─── Compute Panel Responsive ───────────────── */
@media (max-width: 600px) {
  .panel-body [style*="padding:8px"] { padding: 4px !important; }
  .panel-body button { min-height: 44px !important; font-size: 14px !important; }
  .panel-body input { min-height: 44px !important; font-size: 16px !important; }
}


@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Task 119: Big Friendly Touch Targets ──── */
.vep-touch {
  min-height: 48px !important;
  min-width: 48px !important;
}

/* ─── Task 116: Onboarding Tour ─────────────── */
.vep-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}
.vep-tour-spotlight {
  position: fixed;
  z-index: 10001;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.65);
  pointer-events: none;
  transition: all 0.35s ease;
}
.vep-tour-tooltip {
  position: fixed;
  z-index: 10002;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 16px 20px;
  max-width: 320px;
  color: #e2e8f0;
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  pointer-events: auto;
  transition: all 0.35s ease;
}
.vep-tour-tooltip h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
}
.vep-tour-tooltip p {
  margin: 0 0 14px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.4;
}
.vep-tour-tooltip .tour-btns {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.vep-tour-tooltip .tour-btn-next {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.vep-tour-tooltip .tour-btn-next:hover { background: #1d4ed8; }
.vep-tour-tooltip .tour-btn-skip {
  background: none;
  color: #6b7280;
  border: none;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}
.vep-tour-tooltip .tour-btn-skip:hover { color: #9ca3af; }
.vep-tour-step-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 12px;
}
.vep-tour-step-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: #334155;
  transition: background 0.2s;
}
.vep-tour-step-dots span.active { background: #2563eb; }

@keyframes tour-pulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(0,0,0,0.65), 0 0 0 0 rgba(37,99,235,0.4); }
  50% { box-shadow: 0 0 0 9999px rgba(0,0,0,0.65), 0 0 0 8px rgba(37,99,235,0); }
}
.vep-tour-spotlight.pulse {
  animation: tour-pulse 1.5s ease infinite;
}

/* ─── Task 121: Smart Confirmation Dialogs ──── */
.vep-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10010;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.vep-confirm-dialog {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 24px;
  max-width: 420px;
  width: 90%;
  color: #e2e8f0;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.vep-confirm-dialog h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
}
.vep-confirm-dialog .confirm-section {
  margin-bottom: 12px;
  font-size: 13px;
}
.vep-confirm-dialog .confirm-section strong {
  display: block;
  margin-bottom: 4px;
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.vep-confirm-dialog .confirm-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.vep-confirm-dialog .confirm-section ul li {
  padding: 3px 0;
  color: #cbd5e1;
}
.vep-confirm-dialog .confirm-section ul li::before {
  margin-right: 6px;
}
.vep-confirm-dialog .confirm-section.will ul li::before { content: "⚠️"; }
.vep-confirm-dialog .confirm-section.wont ul li::before { content: "✓"; }
.vep-confirm-dialog .confirm-undoable {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 16px;
  font-style: italic;
}
.vep-confirm-dialog .confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.vep-confirm-dialog .confirm-cancel {
  background: #334155;
  color: #d1d5db;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}
.vep-confirm-dialog .confirm-cancel:hover { background: #475569; }
.vep-confirm-dialog .confirm-cancel:focus { outline: 2px solid #2563eb; outline-offset: 2px; }
.vep-confirm-dialog .confirm-destructive {
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}
.vep-confirm-dialog .confirm-destructive:hover { background: #b91c1c; }
.vep-confirm-dialog .confirm-destructive:focus { outline: 2px solid #dc2626; outline-offset: 2px; }

/* ─── Task 122: Success Celebrations — Green Ripple ── */
@keyframes ripple-green {
  0% {
    box-shadow: 0 0 0 0 rgba(34,197,94,0.5);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(34,197,94,0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34,197,94,0);
  }
}
.node-online-ripple {
  animation: ripple-green 0.8s ease-out;
}

/* ═══════════════════════════════════════════════════
   Task 128 — Accessibility: High Contrast Mode
   ═══════════════════════════════════════════════════ */

/* Focus ring for all focusable elements */
*:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

/* Skip-to-content link */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100000;
  background: #1e293b;
  color: #f1f5f9;
  padding: 12px 24px;
  border-radius: 0 0 8px 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-to-content:focus {
  top: 0;
}

/* High contrast class — manually toggled or auto-applied */
.high-contrast {
  --hc-bg: #000;
  --hc-text: #fff;
  --hc-border: #fff;
  --hc-link: #6db3f2;
  --hc-accent: #ffd700;
}
.high-contrast body,
.high-contrast .panel,
.high-contrast .panel-body,
.high-contrast #toolbar,
.high-contrast #loginOverlay {
  background: var(--hc-bg) !important;
  color: var(--hc-text) !important;
}
.high-contrast .panel {
  border: 2px solid var(--hc-border) !important;
}
.high-contrast a {
  color: var(--hc-link) !important;
  text-decoration: underline !important;
}
.high-contrast button,
.high-contrast input,
.high-contrast select,
.high-contrast textarea {
  background: #111 !important;
  color: #fff !important;
  border: 2px solid #ccc !important;
}
.high-contrast button:hover,
.high-contrast button:focus-visible {
  background: #333 !important;
  border-color: var(--hc-accent) !important;
}
.high-contrast img {
  filter: contrast(1.2) brightness(1.1);
}
.high-contrast [data-tooltip]::after {
  background: #fff !important;
  color: #000 !important;
  border: 1px solid #000 !important;
}

/* Auto-apply high contrast when user prefers it */
@media (prefers-contrast: more) {
  :root {
    --hc-bg: #000;
    --hc-text: #fff;
    --hc-border: #fff;
    --hc-link: #6db3f2;
    --hc-accent: #ffd700;
  }
  body,
  .panel,
  .panel-body,
  #toolbar,
  #loginOverlay {
    background: var(--hc-bg) !important;
    color: var(--hc-text) !important;
  }
  .panel {
    border: 2px solid var(--hc-border) !important;
  }
  a {
    color: var(--hc-link) !important;
    text-decoration: underline !important;
  }
  button, input, select, textarea {
    background: #111 !important;
    color: #fff !important;
    border: 2px solid #ccc !important;
  }
  button:hover, button:focus-visible {
    background: #333 !important;
    border-color: var(--hc-accent) !important;
  }
  img {
    filter: contrast(1.2) brightness(1.1);
  }
}


/* ═══════════════════════════════════════════════════
   Task 129 — Print-Friendly Resource Summary
   ═══════════════════════════════════════════════════ */
@media print {
  /* Hide non-printable elements */
  #toolbar,
  #loginOverlay,
  #addDialog,
  .skip-to-content,
  .panel-header button,
  .panel-body button,
  .panel-body input,
  .panel-body select,
  .dm-desk-compose,
  .mob-bottom-nav,
  .dm-scroll-bottom-btn,
  [data-tooltip]::after,
  [data-tooltip]::before,
  .cmd-palette-overlay {
    display: none !important;
  }

  /* White background, black text */
  * {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-family: "Times New Roman", Times, serif;
    font-size: 12pt;
    line-height: 1.5;
    margin: 0;
    padding: 0;
  }

  /* Panels as clean blocks */
  .panel {
    border: 1px solid #999 !important;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 12pt;
    padding: 8pt;
  }
  .panel-header {
    border-bottom: 1px solid #ccc !important;
    padding-bottom: 4pt;
    margin-bottom: 6pt;
  }

  /* Node list as clean table appearance */
  .compute-node-card,
  .node-card {
    display: block;
    border: 1px solid #ccc;
    padding: 6pt;
    margin-bottom: 4pt;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Employee assignments as readable list */
  .employee-list-item,
  .fleet-row {
    display: block;
    border-bottom: 1px solid #eee;
    padding: 4pt 0;
  }

  /* A4 fit */
  @page {
    size: A4;
    margin: 15mm;
  }

  /* Force show content area */
  #panelsContainer {
    display: block !important;
    width: 100% !important;
    overflow: visible !important;
  }

  /* Remove animations */
  * {
    animation: none !important;
    transition: none !important;
  }

  /* Links: show URL */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666 !important;
  }
}


/* ═══════════════════════════════════════════════════
   Task 139 — Command Palette Styles
   ═══════════════════════════════════════════════════ */
.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  backdrop-filter: blur(4px);
}
.cmd-palette {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: 480px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.cmd-palette-input {
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  font-size: 16px;
  outline: none;
  box-sizing: border-box;
}
.cmd-palette-input::placeholder {
  color: #64748b;
}
.cmd-palette-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 6px 0;
}
.cmd-palette-item {
  padding: 10px 20px;
  color: #cbd5e1;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.1s;
}
.cmd-palette-item:hover,
.cmd-palette-item.active {
  background: rgba(91, 141, 239, 0.15);
  color: #f1f5f9;
}
.cmd-palette-item .cmd-icon {
  width: 20px;
  text-align: center;
  font-size: 14px;
  opacity: 0.7;
}
.cmd-palette-item .cmd-label {
  flex: 1;
}
.cmd-palette-item .cmd-shortcut {
  font-size: 11px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}
.cmd-palette-hint {
  padding: 8px 20px;
  font-size: 11px;
  color: #475569;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 12px;
}
.cmd-palette-hint kbd {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 11px;
}

/* Resource switch fade animation (Boss Chat header "Where" button) */
@keyframes resource-fade {
  0%   { opacity: 1; transform: scale(1); }
  50%  { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}

/* ─── Compute panel: drag-drop visual feedback (Task 5) ─── */
.compute-drag-source {
  transform: scale(0.95);
  opacity: 0.7;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.compute-drop-valid {
  animation: compute-drop-pulse 1.2s infinite ease-in-out;
  border-color: #3b82f6 !important;
}
@keyframes compute-drop-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.6); }
  50%      { box-shadow: 0 0 0 6px rgba(59,130,246,0); }
}

/* ─── Compute panel: mobile-optimized layout (Task 9) ─── */
@media (max-width: 768px) {
  .fleet-toolbar {
    flex-wrap: wrap !important;
    gap: 6px;
    padding: 8px !important;
  }
  .fleet-toolbar button {
    min-height: 48px !important;
    min-width: 48px !important;
    flex: 1 1 auto;
  }
  .compute-node-card {
    width: 100% !important;
    flex-direction: column !important;
  }
  .compute-node-card .secondary-meta {
    display: none;
  }
  .compute-node-card.tap-expanded .secondary-meta {
    display: block;
  }
  /* Larger touch targets across compute panel */
  .vep-compute-panel button,
  .vep-compute-panel a {
    min-height: 44px;
  }
}

/* ─── Compute help popover (Task 10) ─── */
.compute-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(59,130,246,0.15);
  color: #60a5fa;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  border: 1px solid rgba(59,130,246,0.4);
}
.compute-help-icon:hover { background: rgba(59,130,246,0.3); }
.compute-help-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9998;
}
.compute-help-popover {
  position: fixed;
  z-index: 9999;
  background: #0f172a;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  padding: 12px 14px;
  max-width: 280px;
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* ─── Onboarding progress tracker (Task 20) ─── */
.compute-onboarding-tracker {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 12px;
  font-size: 12px;
  color: #d1d5db;
}
.compute-onboarding-bar {
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 0;
}
.compute-onboarding-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  transition: width 0.4s ease;
}
.compute-onboarding-next {
  color: #60a5fa;
  cursor: pointer;
  text-decoration: none;
  font-size: 11px;
}
.compute-onboarding-next:hover { text-decoration: underline; }

/* ─── Auto-detected hardware cards (Task 3) ─── */
.compute-hw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.compute-hw-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px;
  position: relative;
}
.compute-hw-card .hw-title {
  font-size: 11px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.compute-hw-card .hw-value {
  font-size: 13px;
  color: #f1f5f9;
  font-weight: 600;
}
.compute-hw-card .hw-bar {
  height: 4px;
  background: #1e293b;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.compute-hw-card .hw-bar > div { height: 100%; border-radius: 2px; }
.compute-hw-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.compute-hw-status.good { background: #22c55e; }
.compute-hw-status.warn { background: #eab308; }

/* R19/R20/R24/R25: boss-only persisted prompt transparency. */
.bc-pt-host { position: relative; }
.bc-pt-trigger {
  position: absolute;
  /* SUP-0005 (2026-08-27): top:12px landed the pill INSIDE the embed
     iframe's 48px header band (the parent header is a 6px strip), where it
     covered the embed's right-aligned action buttons and stole their
     clicks at desktop widths. 56px clears the band. */
  top: 56px;
  right: 14px;
  z-index: 8;
  border: 1px solid rgba(125, 211, 252, 0.45);
  border-radius: 999px;
  background: rgba(8, 47, 73, 0.92);
  color: #e0f2fe;
  padding: 6px 11px;
  font: 700 11px/1.2 ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(2, 8, 23, 0.32);
}
.bc-pt-trigger:hover { background: rgba(12, 74, 110, 0.96); }
.bc-pt-trigger:focus-visible,
.bc-prompt-trace-btn:focus-visible,
.bc-pt-dialog button:focus-visible,
.bc-pt-dialog select:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.bc-prompt-trace-btn {
  margin: 6px 6px 0 0;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  background: #f0f9ff;
  color: #075985;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.bc-pt-backdrop {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 12%, rgba(14, 116, 144, 0.24), transparent 34%),
    rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(7px);
}
.bc-pt-dialog {
  width: min(1180px, 96vw);
  height: min(820px, 92vh);
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #334155;
  border-radius: 18px;
  background: #0b1220;
  color: #e2e8f0;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}
.bc-pt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #1e293b;
  background: linear-gradient(110deg, #102234, #0b1220 55%, #13221d);
}
.bc-pt-header h2 { margin: 0; color: #f8fafc; font-size: 21px; letter-spacing: -0.02em; }
.bc-pt-header p { margin: 4px 0 0; color: #94a3b8; font-size: 12px; }
.bc-pt-close,
.bc-pt-copy,
.bc-pt-download,
.bc-pt-tabs button {
  border: 1px solid #334155;
  border-radius: 8px;
  background: #111c2d;
  color: #cbd5e1;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.bc-pt-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid #1e293b;
}
.bc-pt-message-select {
  min-width: 0;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #111827;
  color: #e2e8f0;
  padding: 8px 10px;
  font-size: 12px;
}
.bc-pt-tabs { display: flex; gap: 4px; }
.bc-pt-tabs button.active { border-color: #38bdf8; background: #0c4a6e; color: #f0f9ff; }
.bc-pt-copy:disabled,
.bc-pt-download:disabled { cursor: wait; opacity: 0.45; }
.bc-pt-status {
  padding: 10px 20px 4px;
  color: #fbbf24;
  font-size: 12px;
  font-weight: 650;
}
.bc-pt-metrics {
  padding: 3px 20px 8px;
  color: #94a3b8;
  font: 11px/1.5 ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}
.bc-pt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  padding: 7px 20px 10px;
  border-bottom: 1px solid #1e293b;
}
.bc-pt-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #cbd5e1;
  font-size: 10px;
}
.bc-pt-legend-item i { width: 9px; height: 9px; border-radius: 2px; background: currentColor; }
.bc-pt-legend-item b { font-weight: 600; }
.bc-pt-viewer {
  margin: 0;
  min-height: 0;
  overflow: auto;
  padding: 20px 22px 34px;
  background-color: #060b14;
  background-image: linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: 100% 26px;
  color: #dbeafe;
  font: 12.5px/1.62 ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  font-variant-ligatures: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  unicode-bidi: plaintext;
  tab-size: 2;
}
.bc-pt-segment { border-radius: 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.bc-pt-source-template,
.bc-pt-source-policy-template { color: #fde68a; background: rgba(180, 83, 9, 0.12); }
.bc-pt-source-template-runtime,
.bc-pt-source-identity-runtime,
.bc-pt-source-identity-boundary { color: #bfdbfe; background: rgba(30, 64, 175, 0.11); }
.bc-pt-source-runtime-date,
.bc-pt-source-runtime-state { color: #a5f3fc; background: rgba(8, 145, 178, 0.12); }
.bc-pt-source-employee-config { color: #99f6e4; background: rgba(13, 148, 136, 0.12); }
.bc-pt-source-semantic-dna,
.bc-pt-source-semantic-recall { color: #bbf7d0; background: rgba(22, 163, 74, 0.13); }
.bc-pt-source-conversation-history { color: #c7d2fe; background: rgba(79, 70, 229, 0.12); }
.bc-pt-source-active-goals { color: #fed7aa; background: rgba(234, 88, 12, 0.12); }
.bc-pt-source-current-files,
.bc-pt-source-file-context,
.bc-pt-source-file-content,
.bc-pt-source-image-context,
.bc-pt-source-voice-transcript { color: #bae6fd; background: rgba(2, 132, 199, 0.12); }
.bc-pt-source-voice-provenance { color: #ddd6fe; background: rgba(109, 40, 217, 0.12); }
.bc-pt-source-boss-message { color: #fecdd3; background: rgba(225, 29, 72, 0.12); }
.bc-pt-source-structure-marker { color: #94a3b8; background: rgba(100, 116, 139, 0.13); }
.bc-pt-source-security-redaction {
  color: #fff7ed;
  background: #9a3412;
  border: 1px solid #fb923c;
  padding: 0 3px;
  font-weight: 800;
}
.bc-pt-cyrillic-hardcoded { text-decoration: underline 2px #f59e0b; text-underline-offset: 3px; }
.bc-pt-cyrillic-data { text-decoration: underline 2px #22c55e; text-underline-offset: 3px; }
.bc-pt-cyrillic-unresolved { text-decoration: underline 2px #94a3b8; text-decoration-style: dotted; text-underline-offset: 3px; }

@media (max-width: 720px) {
  .bc-pt-backdrop { padding: 0; }
  .bc-pt-dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .bc-pt-controls { grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px; }
  .bc-pt-message-select { grid-column: 1 / -1; }
  .bc-pt-download { grid-column: 1 / -1; }
  .bc-pt-header { padding: 14px 12px 11px; }
  .bc-pt-status, .bc-pt-metrics, .bc-pt-legend { padding-left: 12px; padding-right: 12px; }
  .bc-pt-viewer { padding: 15px 13px 28px; font-size: 11.5px; }
  .bc-pt-trigger { top: 8px; right: 9px; }
}
