/* ============================================================================
   MUMS — App Update Screen  (force hard-refresh broadcast)
   Self-contained, enterprise-grade full-screen takeover. Scoped under .muo-*
   so it renders identically on index.html, support_studio.html and mobile.html
   regardless of each page's own design tokens.
   ============================================================================ */

:root {
  --muo-accent: #58a6ff;
  --muo-accent-2: #7c5cff;
  --muo-ok: #3fb950;
  --muo-warn: #f0a020;
}

/* ── Backdrop overlay ─────────────────────────────────────────────────────── */
#mumsUpdateOverlay.muo-root {
  position: fixed;
  inset: 0;
  z-index: 2147483600;            /* above every modal, toast and bar in MUMS */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(88,166,255,.14), transparent 60%),
    radial-gradient(900px 600px at 100% 110%, rgba(124,92,255,.12), transparent 55%),
    rgba(6, 10, 20, .82);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  transition: opacity .28s ease;
}
#mumsUpdateOverlay.muo-root.muo-show { display: flex; opacity: 1; }

/* ── Card ─────────────────────────────────────────────────────────────────── */
.muo-card {
  position: relative;
  width: 100%;
  max-width: 540px;
  border-radius: 20px;
  padding: 34px 34px 28px;
  box-sizing: border-box;
  color: #e9eefb;
  background:
    linear-gradient(180deg, rgba(28,36,58,.96), rgba(15,21,38,.97));
  border: 1px solid rgba(120,150,220,.20);
  box-shadow:
    0 0 0 1px rgba(0,0,0,.4),
    0 40px 120px -30px rgba(0,0,0,.85),
    0 0 90px -20px rgba(88,166,255,.35);
  transform: translateY(14px) scale(.985);
  opacity: 0;
  transition: transform .42s cubic-bezier(.16,1,.3,1), opacity .42s ease;
  overflow: hidden;
}
#mumsUpdateOverlay.muo-show .muo-card { transform: translateY(0) scale(1); opacity: 1; }

/* animated top sheen */
.muo-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--muo-accent), var(--muo-accent-2), transparent);
  background-size: 200% 100%;
  animation: muo-sheen 3.2s linear infinite;
}
@keyframes muo-sheen { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Icon badge ───────────────────────────────────────────────────────────── */
.muo-icon {
  width: 72px;
  height: 72px;
  margin: 2px 0 18px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--muo-accent), var(--muo-accent-2));
  box-shadow: 0 12px 32px -8px rgba(88,166,255,.6), inset 0 1px 0 rgba(255,255,255,.25);
}
.muo-icon svg { width: 36px; height: 36px; }
.muo-icon.muo-spin svg { animation: muo-rotate 1.1s linear infinite; }
@keyframes muo-rotate { to { transform: rotate(360deg); } }

.muo-state-completed .muo-icon { background: linear-gradient(135deg, #2ea043, #3fb950); box-shadow: 0 12px 32px -8px rgba(63,185,80,.6), inset 0 1px 0 rgba(255,255,255,.25); }

/* ── Text ─────────────────────────────────────────────────────────────────── */
.muo-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muo-accent);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.muo-eyebrow .muo-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muo-accent);
  box-shadow: 0 0 0 0 rgba(88,166,255,.7);
  animation: muo-ping 1.6s ease-out infinite;
}
.muo-state-completed .muo-eyebrow { color: var(--muo-ok); }
.muo-state-completed .muo-eyebrow .muo-pulse { background: var(--muo-ok); box-shadow: 0 0 0 0 rgba(63,185,80,.7); }
@keyframes muo-ping {
  0%   { box-shadow: 0 0 0 0 rgba(88,166,255,.55); }
  70%  { box-shadow: 0 0 0 10px rgba(88,166,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(88,166,255,0); }
}

.muo-title {
  font-size: 23px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 10px;
  letter-spacing: -.01em;
  color: #fff;
}
.muo-message {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(214,224,244,.82);
  margin: 0 0 18px;
}

/* details box */
.muo-details {
  display: none;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(88,166,255,.06);
  border: 1px solid rgba(88,166,255,.16);
  font-size: 13px;
  line-height: 1.6;
  color: rgba(206,220,245,.9);
  max-height: 190px;
  overflow: auto;
}
.muo-details.muo-on { display: block; }
.muo-details-label {
  font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(148,170,210,.75); margin-bottom: 8px;
}
.muo-details ul { margin: 0; padding-left: 18px; }
.muo-details li { margin: 3px 0; }
.muo-details p { margin: 0 0 6px; }

/* meta strip */
.muo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: 11.5px;
  color: rgba(160,176,206,.72);
}
.muo-meta b { color: rgba(214,224,244,.92); font-weight: 600; }

/* ── Actions ──────────────────────────────────────────────────────────────── */
.muo-actions { display: flex; gap: 12px; }
.muo-btn {
  flex: 1;
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: .01em;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.muo-btn:active { transform: translateY(1px) scale(.99); }
.muo-btn[disabled] { opacity: .6; cursor: default; }
.muo-btn svg { width: 16px; height: 16px; }

.muo-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--muo-accent), var(--muo-accent-2));
  box-shadow: 0 10px 26px -8px rgba(88,166,255,.6), inset 0 1px 0 rgba(255,255,255,.22);
}
.muo-btn-primary:hover { box-shadow: 0 14px 34px -8px rgba(88,166,255,.75), inset 0 1px 0 rgba(255,255,255,.28); }

.muo-btn-ghost {
  color: rgba(214,224,244,.86);
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.12);
}
.muo-btn-ghost:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.2); }

.muo-state-completed .muo-btn-primary {
  background: linear-gradient(135deg, #2ea043, #3fb950);
  box-shadow: 0 10px 26px -8px rgba(63,185,80,.6), inset 0 1px 0 rgba(255,255,255,.22);
}

/* remind countdown line */
.muo-foot {
  margin-top: 14px;
  text-align: center;
  font-size: 11.5px;
  color: rgba(150,166,196,.62);
  min-height: 14px;
}
.muo-foot b { color: var(--muo-accent); font-weight: 700; }

/* working spinner (Update Now in progress) */
.muo-working { display: none; align-items: center; justify-content: center; gap: 10px; padding: 6px 0 2px; color: rgba(206,220,245,.9); font-size: 13px; font-weight: 600; }
.muo-working.muo-on { display: flex; }
.muo-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.18);
  border-top-color: var(--muo-accent);
  animation: muo-rotate .8s linear infinite;
}

/* state visibility toggling */
.muo-state-prompt .muo-only-completed { display: none; }
.muo-state-completed .muo-only-prompt { display: none; }

/* responsive */
@media (max-width: 560px) {
  .muo-card { padding: 26px 22px 22px; border-radius: 16px; }
  .muo-title { font-size: 20px; }
  .muo-actions { flex-direction: column; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .muo-card::before, .muo-icon.muo-spin svg, .muo-eyebrow .muo-pulse, .muo-spinner { animation: none; }
  #mumsUpdateOverlay.muo-root, .muo-card { transition: none; }
}

/* ============================================================================
   Admin panel — "App Update" broadcast composer (Settings ▸ Admin Controls).
   Reuses the .ms-* settings shell; only the status card needs bespoke styling.
   ============================================================================ */
.fu-status {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.025);
  font-size: 12.5px;
  line-height: 1.55;
}
.fu-status.fu-active { border-color: rgba(63,185,80,.32); background: rgba(63,185,80,.07); }
.fu-status.fu-error  { border-color: rgba(248,81,73,.32); background: rgba(248,81,73,.07); }
.fu-status-head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 6px; color: #e7eefc; }
.fu-dot { width: 9px; height: 9px; border-radius: 50%; background: #6b7280; flex: 0 0 auto; }
.fu-status.fu-active .fu-dot { background: var(--muo-ok); box-shadow: 0 0 0 4px rgba(63,185,80,.14); }
.fu-status-meta { color: rgba(160,176,206,.8); }
.fu-status-meta b { color: rgba(220,230,248,.92); font-weight: 600; }

.fu-callout {
  font-size: 12px;
  color: rgba(148,163,184,.85);
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(88,166,255,.06);
  border: 1px solid rgba(88,166,255,.16);
  border-radius: 10px;
}
.fu-msg { font-size: 12px; opacity: 0; transition: opacity .3s; min-height: 14px; }
.fu-msg.fu-ok  { color: #4ade80; opacity: 1; }
.fu-msg.fu-bad { color: #f87171; opacity: 1; }
.fu-actions-row { display: flex; align-items: center; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.fu-btn-danger {
  background: linear-gradient(135deg, #d9822b, #e0533d) !important;
  border-color: rgba(224,83,61,.5) !important;
  color: #fff !important;
}
textarea.fu-textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}
