/* SpaceGram 3.1 package "msgx": every selector starts with the package prefix. */

/* ——— shared ——— */
.mx-modal-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 20px 8px;
  overflow-y: auto;
  min-height: 0;
}
.mx-modal .profile-field-error { margin: 0 20px 6px; }
.mx-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 20px 18px;
}
.mx-modal-foot .btn-primary { min-height: 44px; }
.mx-textarea,
.mx-input,
.mx-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 13px;
  background: var(--input-bg);
  color: var(--text);
  border: 1.5px solid transparent;
  outline: none;
  font: inherit;
  font-size: 14.5px;
  box-sizing: border-box;
}
.mx-textarea { resize: vertical; min-height: 84px; max-height: 40vh; }
.mx-select { width: auto; max-width: 100%; }
.mx-textarea:focus,
.mx-input:focus,
.mx-select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.mx-modal .profile-field textarea,
.mx-modal .profile-field select { font-weight: 450; }
.mx-muted { margin: 2px 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.mx-sub { margin: 10px 0 2px; font-size: 13px; font-weight: 650; color: var(--text-2); }
.mx-link {
  min-height: 32px;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--radius-sm, 8px);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.mx-link:hover:not(:disabled) { background: var(--accent-soft); }
.mx-link:disabled { opacity: 0.5; cursor: default; }
.mx-link.is-danger { color: var(--danger); }
.mx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mx-chip {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.mx-chip.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong, var(--accent)); }
@media (hover: none) { .mx-chip, .mx-link { min-height: 44px; } }

/* ——— polls ——— */
.bubble.mx-has-poll { min-width: min(280px, 72vw); padding: 10px 12px 6px; }
.mx-poll { display: flex; flex-direction: column; gap: 6px; }
.mx-poll-q { font-weight: 650; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.mx-poll-kind { font-size: 12px; opacity: 0.7; }
.mx-poll-loading { height: 72px; border-radius: 10px; background: var(--hover); }
.mx-poll-options { display: flex; flex-direction: column; gap: 4px; }
.mx-poll-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.mx-poll-opt:disabled { cursor: default; }
.mx-poll-opt:hover:not(:disabled) { background: color-mix(in srgb, currentColor 7%, transparent); }
.mx-poll-mark {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 45%, transparent);
  z-index: 1;
}
.mx-poll-mark.is-multi { border-radius: 4px; }
.mx-poll-opt.is-picked .mx-poll-mark,
.mx-poll-opt.is-mine .mx-poll-mark { background: var(--accent); border-color: var(--accent); }
.mx-poll-text { flex: 1; min-width: 0; overflow-wrap: anywhere; z-index: 1; }
.mx-poll-pct { flex: none; font-size: 12.5px; font-weight: 650; z-index: 1; }
.mx-poll-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  transition: width 0.25s var(--ease);
}
.mx-poll-opt.is-mine .mx-poll-bar { background: color-mix(in srgb, var(--accent) 32%, transparent); }
.mx-poll-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; }
.mx-poll-total { font-size: 12px; opacity: 0.75; }
.mx-poll-actions { display: flex; flex-wrap: wrap; gap: 2px; }
.bubble.mx-has-poll .mx-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.mx-poll-inputs { display: flex; flex-direction: column; gap: 6px; }
.mx-voter {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 4px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* ——— scheduled ——— */
.mx-time { display: flex; flex-direction: column; gap: 8px; }
.mx-sched {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.mx-sched-time { font-size: 12.5px; font-weight: 650; color: var(--accent); }
.mx-sched-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.mx-sched-err { font-size: 12.5px; color: var(--danger); }
.mx-sched.is-failed .mx-sched-time { color: var(--danger); }
.mx-sched-actions { display: flex; flex-wrap: wrap; gap: 2px; margin-left: -8px; }

/* ——— effects ——— */
.mx-fx-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.mx-fx-mark svg { width: 13px; height: 13px; }
.mx-fx {
  position: fixed;
  inset: 0;
  z-index: 3000;
  pointer-events: none;
  overflow: hidden;
}
.mx-fx-p {
  position: absolute;
  top: -6vh;
  left: var(--x);
  width: 9px;
  height: 14px;
  border-radius: 2px;
  font-size: 22px;
  line-height: 1;
  animation: mx-fall var(--t) linear var(--d) both;
}
.mx-fx-hearts .mx-fx-p,
.mx-fx-snow .mx-fx-p { width: auto; height: auto; background: none; }
.mx-fx-hearts .mx-fx-p { top: auto; bottom: -6vh; animation-name: mx-rise; }
.mx-fx-fireworks .mx-fx-p {
  top: 38%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: mx-burst 1.6s cubic-bezier(0.1, 0.7, 0.3, 1) var(--d) both;
}
.mx-fx-big {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: min(36vw, 180px);
  transform: translate(-50%, -50%);
  animation: mx-pop 1.4s var(--ease) both;
}
.mx-fx-spotlight:not(.is-reduced) {
  background: radial-gradient(circle at 50% 50%, transparent 0 18vmin, rgba(0, 0, 0, 0.55) 34vmin);
  animation: mx-fade 2.6s var(--ease) both;
}
.mx-fx.is-reduced .mx-fx-big { animation: mx-fade 1.4s var(--ease) both; }
@keyframes mx-fall {
  from { transform: translate(0, 0) rotate(0); opacity: 1; }
  to { transform: translate(var(--dx), 112vh) rotate(var(--r)); opacity: 0.9; }
}
@keyframes mx-rise {
  from { transform: translate(0, 0) scale(0.8); opacity: 1; }
  to { transform: translate(var(--dx), -112vh) scale(1.2); opacity: 0; }
}
@keyframes mx-burst {
  0% { transform: translate(0, 40vh) scale(0.6); opacity: 1; }
  35% { transform: translate(0, 0) scale(0.6); opacity: 1; }
  100% { transform: translate(var(--bx), var(--by)) scale(1); opacity: 0; }
}
@keyframes mx-pop {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  30% { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
  75% { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
@keyframes mx-fade {
  0% { opacity: 0; }
  25%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

/* ——— disappearing messages ——— */
.mx-ttl-mark { display: inline-flex; align-items: center; gap: 2px; margin-right: 4px; opacity: 0.85; }
.mx-ttl-mark svg { width: 12px; height: 12px; }
.mx-ttl-list { display: flex; flex-direction: column; }
.mx-ttl-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 8px 4px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.mx-ttl-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--faint, var(--muted));
}
.mx-ttl-opt.is-on .mx-ttl-dot { border: 5px solid var(--accent); }

/* modal frame details */
.mx-modal .sg-modal-head { padding: 18px 16px 6px 20px; }
.mx-modal .sg-modal-head .modal-title { margin: 0; }
.mx-modal-foot .btn-primary { padding: 0 22px; }
.mx-modal .profile-field input,
.mx-textarea,
.mx-input,
.mx-select { border-color: var(--border); }
