
.messenger-shell {
  width:min(1450px,calc(100% - 32px));
}

.messenger-stat-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:16px;
}

.messenger-stat {
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
  background:rgba(0,0,0,.1);
}

.messenger-stat span {
  display:block;
  color:var(--muted);
  font-size:.78rem;
}

.messenger-stat strong {
  display:block;
  margin-top:4px;
  font-size:1.65rem;
}

.messenger-stat.error {
  border-color:rgba(255,123,145,.28);
}

.messenger-grid,
.recent-grid,
.template-grid {
  display:grid;
  grid-template-columns:minmax(0,1.25fr) minmax(360px,.75fr);
  gap:16px;
  align-items:start;
}

.mode-switcher {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;
}

.mode-button {
  border:1px solid var(--border);
  border-radius:10px;
  padding:9px;
  cursor:pointer;
  color:var(--muted);
  background:rgba(0,0,0,.08);
  font-weight:800;
}

.mode-button.active {
  color:var(--text);
  border-color:rgba(155,124,255,.5);
  background:rgba(155,124,255,.09);
}

.mode-button.danger-mode.active {
  border-color:rgba(255,123,145,.45);
  background:rgba(255,123,145,.07);
}

.mode-badge {
  display:inline-flex;
  border:1px solid var(--border);
  border-radius:999px;
  padding:6px 9px;
  color:#bca8ff;
  font-size:.72rem;
  font-weight:900;
}

.messenger-section {
  border:1px solid var(--border);
  border-radius:13px;
  padding:12px;
  background:rgba(0,0,0,.055);
}

.compact-heading {
  margin-bottom:10px;
}

.compact-heading h3 {
  margin:0;
}

.mention-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}

.danger-check {
  border-color:rgba(255,123,145,.25);
}

.embed-master {
  display:flex;
  align-items:flex-start;
  gap:9px;
}

.embed-master input {
  width:20px;
  height:20px;
}

.embed-master span {
  display:flex;
  flex-direction:column;
  gap:3px;
}

.embed-master small {
  color:var(--muted);
}

.nested-check {
  min-height:42px;
  margin-top:5px;
}

.compose-actions {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.delete-warning {
  border:1px solid rgba(255,123,145,.35);
  border-radius:13px;
  padding:13px;
  background:rgba(255,123,145,.045);
}

.delete-warning p {
  color:var(--muted);
}

.preview-card {
  position:sticky;
  top:16px;
}

.discord-message-preview {
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
  background:#202225;
}

.preview-author {
  display:flex;
  align-items:center;
  gap:9px;
  margin-bottom:8px;
}

.preview-avatar {
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  border-radius:50%;
  background:linear-gradient(135deg,#9b7cff,#5e47e8);
  color:white;
  font-weight:950;
}

.preview-author > div:last-child {
  display:flex;
  flex-direction:column;
}

.preview-author small {
  color:#a9adb4;
}

.bot-tag {
  display:inline-block;
  margin-left:4px;
  border-radius:3px;
  padding:1px 4px;
  background:#5865f2;
  color:white;
  font-size:.62rem;
  vertical-align:middle;
}

.preview-content {
  white-space:pre-wrap;
  word-break:break-word;
  line-height:1.45;
}

.preview-ping {
  display:inline-flex;
  margin-bottom:6px;
  padding:2px 4px;
  border-radius:3px;
  background:rgba(88,101,242,.28);
  color:#c9cdfb;
}

.preview-embed {
  margin-top:10px;
  border-left:4px solid #9b7cff;
  border-radius:4px;
  padding:10px 12px;
  background:#2b2d31;
}

.preview-embed-title {
  font-weight:900;
  margin-bottom:6px;
}

.preview-embed-description {
  white-space:pre-wrap;
  color:#dbdee1;
}

.preview-image {
  display:block;
  width:100%;
  max-height:330px;
  object-fit:cover;
  border-radius:7px;
  margin-top:10px;
}

.preview-footer {
  margin-top:9px;
  color:#a9adb4;
  font-size:.75rem;
}

.template-quick-save {
  margin-top:16px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.recent-message-list,
.action-list,
.template-list {
  display:flex;
  flex-direction:column;
  gap:9px;
  margin-top:14px;
}

.recent-message-card,
.template-card,
.action-row {
  border:1px solid var(--border);
  border-radius:12px;
  padding:11px;
  background:rgba(0,0,0,.07);
}

.recent-message-head,
.action-row {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}

.recent-message-head > div:first-child,
.action-row > div:first-child {
  display:flex;
  flex-direction:column;
}

.message-flags {
  display:flex;
  gap:5px;
  flex-wrap:wrap;
}

.message-flags span {
  border:1px solid var(--border);
  border-radius:999px;
  padding:4px 7px;
  color:var(--muted);
  font-size:.7rem;
}

.recent-content,
.template-card p {
  margin:9px 0;
  white-space:pre-wrap;
  word-break:break-word;
  color:var(--muted);
  max-height:120px;
  overflow:hidden;
}

.action-state {
  display:inline-flex;
  border:1px solid var(--border);
  border-radius:999px;
  padding:4px 7px;
  font-size:.7rem;
  font-weight:900;
  text-transform:uppercase;
}

.action-state.complete {
  color:var(--good);
  border-color:rgba(103,232,165,.3);
}

.action-state.pending {
  color:#ffd36d;
  border-color:rgba(255,211,109,.3);
}

.action-state.error {
  color:var(--bad);
  border-color:rgba(255,123,145,.3);
}

.action-error {
  width:100%;
  color:#ffd2da;
  word-break:break-word;
}

.template-card {
  display:flex;
  flex-direction:column;
}

@media (max-width:1050px) {
  .messenger-grid,
  .recent-grid,
  .template-grid {
    grid-template-columns:1fr;
  }

  .preview-card {
    position:static;
  }
}

@media (max-width:720px) {
  .messenger-stat-grid,
  .mention-grid,
  .mode-switcher {
    grid-template-columns:1fr;
  }

  .recent-message-head,
  .action-row {
    flex-direction:column;
  }
}
