/* ================================================================
   MSN ULTRA COMPOSER - msn-ultra-composer.css
   Works with Feed 1 (includes/feed/views/post-form.php)
   ================================================================ */

/* ── COLLAPSED CARD ── */
.msn-uc-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
  border: 1px solid #e4e6ea;
  overflow: hidden;
  margin-bottom: 0;
  transition: box-shadow .2s ease;
}
.msn-uc-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.13); }

.msn-uc-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
}
.msn-uc-top .msn-avatar img,
.msn-uc-top img { border-radius: 50%; }

.msn-uc-prompt-btn {
  flex: 1;
  height: 44px;
  border-radius: 999px;
  background: #f0f2f5;
  border: 1.5px solid #e4e6ea;
  padding: 0 18px;
  text-align: left;
  font-size: 15px;
  color: #65676b;
  cursor: pointer;
  font-family: inherit;
  font-weight: 400;
  transition: background .15s, border-color .15s;
}
.msn-uc-prompt-btn:hover { background: #e9ebee; border-color: #bdbfc2; }

.msn-uc-sep { height: 1px; background: #e4e6ea; margin: 2px 0; }

.msn-uc-shortcuts {
  display: flex;
  padding: 4px 6px 10px;
}
.msn-uc-shortcut {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 4px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #65676b;
  font-family: inherit;
  transition: background .15s;
}
.msn-uc-shortcut:hover { background: #f0f2f5; }
.msn-uc-shortcut svg {
  width: 22px; height: 22px;
  fill: none; stroke: #65676b; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.msn-uc-shortcut:nth-child(1) svg { stroke: #f40002; }
.msn-uc-shortcut:nth-child(2) svg { stroke: #45bd62; }
.msn-uc-shortcut:nth-child(3) svg { stroke: #f7b928; }

/* ── BACKDROP ── */
.msn-uc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  transition: background .28s ease;
  /* CRITICAL: when hidden, never block clicks */
  pointer-events: none;
  visibility: hidden;
}
.msn-uc-backdrop.msn-uc-vis {
  background: rgba(0,0,0,.65);
  pointer-events: auto;
  visibility: visible;
}
/* Also ensure hidden attribute fully removes it from interaction */
.msn-uc-backdrop[hidden] {
  display: none !important;
}
body.msn-uc-open { overflow: hidden; }

/* ── MODAL ── */
.msn-uc-modal {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.24), 0 6px 20px rgba(0,0,0,.14);
  transform: translateY(28px) scale(.96);
  opacity: 0;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;
  overflow: hidden;
  z-index: 99999;
}
.msn-uc-modal.msn-uc-in { transform: translateY(0) scale(1); opacity: 1; }

.msn-uc-mhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px 13px;
  border-bottom: 1.5px solid #e4e6ea;
  flex-shrink: 0;
}
.msn-uc-mhead h2 { margin: 0; font-size: 18px; font-weight: 800; color: #050505; letter-spacing: -.02em; }
.msn-uc-close {
  width: 36px; height: 36px;
  border: none; border-radius: 50%;
  background: #f0f2f5;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.msn-uc-close:hover { background: #e4e6ea; }
.msn-uc-close svg { width: 17px; height: 17px; fill: none; stroke: #050505; stroke-width: 2.5; stroke-linecap: round; }

.msn-uc-mbody {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 16px 16px;
  scrollbar-width: thin;
  scrollbar-color: #dadde1 transparent;
}

/* ── AUTHOR ROW ── */
.msn-uc-author {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 0 8px;
}
.msn-uc-author .msn-avatar img,
.msn-uc-author img { border-radius: 50%; }
.msn-uc-ainfo { display: flex; flex-direction: column; gap: 5px; }
.msn-uc-ainfo strong { font-size: 15px; font-weight: 800; color: #050505; }

/* Audience button */
.msn-uc-audwrap { position: relative; }
.msn-uc-audbtn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px 4px 8px;
  border: none; border-radius: 8px;
  background: #f0f2f5;
  font-size: 12.5px; font-weight: 700;
  color: #050505; cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.msn-uc-audbtn:hover { background: #e4e6ea; }
.msn-uc-audbtn svg { width: 14px; height: 14px; fill: none; stroke: #050505; stroke-width: 2; stroke-linecap: round; }
.msn-uc-caret { width: 13px !important; height: 13px !important; }

.msn-uc-audmenu {
  position: absolute;
  top: calc(100% + 5px); left: 0; z-index: 200;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  border: 1px solid #e4e6ea;
  min-width: 260px;
  overflow: hidden;
  animation: ucddIn .18s ease;
}
@keyframes ucddIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }

.msn-uc-audopt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px;
  border: none; background: transparent;
  cursor: pointer; text-align: left;
  font-family: inherit;
  transition: background .12s;
}
.msn-uc-audopt:hover { background: #f0f2f5; }
.msn-uc-audopt.active { background: #e7f0fd; }
.msn-uc-audico { font-size: 22px; flex-shrink: 0; }
.msn-uc-audtxt { flex: 1; display: flex; flex-direction: column; }
.msn-uc-audtxt strong { font-size: 14px; font-weight: 700; color: #050505; }
.msn-uc-audtxt small  { font-size: 12px; color: #65676b; }
.msn-uc-tick { width: 18px; height: 18px; fill: none; stroke: #1877f2; stroke-width: 2.5; opacity: 0; }
.msn-uc-audopt.active .msn-uc-tick { opacity: 1; }

/* ── TEXT ZONE ── */
.msn-uc-txtwrap {
  position: relative; border-radius: 12px; overflow: hidden;
  margin: 4px 0; transition: background .3s ease, min-height .3s ease;
}
.msn-uc-txtwrap.has-bg {
  min-height: 160px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px 16px 14px;
}
#msn-post-textarea {
  width: 100%; min-height: 80px;
  border: none; outline: none; resize: none;
  background: transparent;
  font-size: 17px; font-family: inherit;
  color: #050505; line-height: 1.5; padding: 4px 0;
}
.msn-uc-txtwrap.has-bg #msn-post-textarea {
  font-size: 22px; font-weight: 800; text-align: center;
  color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.35); caret-color: #fff;
}
#msn-post-textarea::placeholder { color: #bec3c9; }
.msn-uc-txtwrap.has-bg #msn-post-textarea::placeholder { color: rgba(255,255,255,.7); }

.msn-uc-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
}
.msn-uc-chip-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px; background: #e7f0fd;
  color: #1877f2; font-size: 13px; font-weight: 700;
}
.msn-uc-chip-pill button {
  border: none; background: none; color: #1877f2; cursor: pointer; padding: 0; font-size: 13px;
}

/* ── BG COLOR STRIP ── */
.msn-uc-bgs {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; overflow-x: auto; scrollbar-width: none;
}
.msn-uc-bgs::-webkit-scrollbar { display: none; }
.msn-uc-bg {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid transparent; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s, border-color .18s;
}
.msn-uc-bg:hover { transform: scale(1.12); }
.msn-uc-bg.active { border-color: #1877f2; transform: scale(1.18); }
.msn-uc-bg:first-child { background: #f0f2f5; }
.msn-uc-bg:first-child svg { width: 16px; height: 16px; fill: none; stroke: #65676b; stroke-width: 2.5; stroke-linecap: round; }

/* ── MEDIA ZONE ── */
.msn-uc-mediazone {
  position: relative; background: #f0f2f5; border-radius: 12px;
  padding: 10px; margin: 8px 0;
  border: 2px dashed #e4e6ea;
}
.msn-uc-mediax {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,.55); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.msn-uc-mediax svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.msn-uc-mgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 6px;
}
.msn-uc-mitem {
  position: relative; border-radius: 10px; overflow: hidden;
  aspect-ratio: 1; background: #000;
}
.msn-uc-mitem img, .msn-uc-mitem video { width: 100%; height: 100%; object-fit: cover; }
.msn-uc-mitem-rm {
  position: absolute; top: 4px; right: 4px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: none;
  font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.msn-uc-mitem-badge {
  position: absolute; bottom: 5px; left: 5px;
  background: rgba(0,0,0,.65); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 4px; padding: 2px 6px; letter-spacing: .04em;
}
.msn-uc-addmore {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 8px; padding: 10px; border-radius: 10px;
  background: #fff; border: 1.5px dashed #e4e6ea; cursor: pointer;
  font-size: 14px; font-weight: 600; color: #65676b;
  transition: background .15s;
}
.msn-uc-addmore:hover { background: #e4e6ea; }
.msn-uc-addmore svg { width: 16px; height: 16px; fill: none; stroke: #65676b; stroke-width: 2; }

/* ── PANELS ── */
.msn-uc-panel {
  background: #f0f2f5; border-radius: 12px; padding: 14px; margin: 8px 0;
  animation: ucPanelIn .2s ease;
}
@keyframes ucPanelIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.msn-uc-phead {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.msn-uc-phead strong { font-size: 15px; font-weight: 800; color: #050505; }
.msn-uc-pback {
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
}
.msn-uc-pback:hover { background: #e4e6ea; }
.msn-uc-pback svg { width: 16px; height: 16px; fill: none; stroke: #050505; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.msn-uc-psearch-row {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 10px;
  padding: 10px 14px; border: 1.5px solid #e4e6ea; margin-bottom: 10px;
  transition: border-color .15s;
}
.msn-uc-psearch-row:focus-within { border-color: #1877f2; }
.msn-uc-psearch-row svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: #65676b; stroke-width: 2; stroke-linecap: round; }
.msn-uc-psearch-row input { flex: 1; border: none; outline: none; background: transparent; font-size: 14.5px; font-family: inherit; }

/* Feeling search */
.msn-uc-fq {
  width: 100%; background: #fff; border: 1.5px solid #e4e6ea;
  border-radius: 10px; padding: 10px 14px;
  font-size: 14px; font-family: inherit; outline: none; margin-bottom: 12px;
  transition: border-color .15s;
}
.msn-uc-fq:focus { border-color: #1877f2; }

.msn-uc-fgrid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 6px;
  max-height: 240px; overflow-y: auto; scrollbar-width: thin;
}
.msn-uc-fbtn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 6px; border-radius: 10px; border: none;
  background: #fff; cursor: pointer; font-family: inherit;
  transition: background .15s, transform .15s;
}
.msn-uc-fbtn:hover { background: #e7f0fd; transform: scale(1.06); }
.msn-uc-fbtn span { font-size: 24px; }
.msn-uc-fbtn small { font-size: 11px; color: #65676b; font-weight: 600; }

/* GPS button */
.msn-uc-gps {
  width: 100%; padding: 12px 14px; border: none; border-radius: 10px;
  background: #fff; font-size: 14px; font-weight: 700; color: #1877f2;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
  transition: background .15s;
}
.msn-uc-gps:hover { background: #e7f0fd; }
.msn-uc-gps svg { width: 18px; height: 18px; fill: none; stroke: #1877f2; stroke-width: 2; flex-shrink: 0; }
.msn-uc-loc-item {
  width: 100%; padding: 10px 14px; border: none; border-radius: 8px;
  background: #fff; text-align: left; font-size: 14px; cursor: pointer;
  font-family: inherit; display: block; margin-bottom: 4px;
  transition: background .15s;
}
.msn-uc-loc-item:hover { background: #e7f0fd; color: #1877f2; }

/* Tag panel */
.msn-uc-tag-results { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.msn-uc-tag-person {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border: none; border-radius: 8px;
  background: #fff; cursor: pointer; font-size: 14px; font-family: inherit; text-align: left;
  transition: background .15s;
}
.msn-uc-tag-person:hover { background: #e7f0fd; }
.msn-uc-tchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msn-uc-tchip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: #1877f2; color: #fff; font-size: 13px; font-weight: 700;
}
.msn-uc-tchip button { border: none; background: none; color: rgba(255,255,255,.8); cursor: pointer; font-size: 12px; }
.msn-uc-no-results { padding: 12px; color: #65676b; font-size: 14px; text-align: center; }

/* GIF grid */
.msn-uc-gif-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 5px;
  max-height: 240px; overflow-y: auto;
}
.msn-uc-gif-img {
  width: 100%; border-radius: 6px; cursor: pointer; aspect-ratio: 1; object-fit: cover;
  transition: transform .18s, opacity .18s;
}
.msn-uc-gif-img:hover { transform: scale(1.04); opacity: .9; }
.msn-uc-hint { grid-column:1/-1; color:#65676b; font-size:14px; text-align:center; padding:20px 0; }

/* Poll */
.msn-uc-pq {
  width: 100%; padding: 12px 14px; border: 1.5px solid #e4e6ea; border-radius: 10px;
  font-size: 15px; font-family: inherit; outline: none; margin-bottom: 10px;
  transition: border-color .15s;
}
.msn-uc-pq:focus { border-color: #1877f2; }
.msn-uc-popt {
  width: 100%; padding: 10px 14px; border: 1.5px solid #e4e6ea; border-radius: 10px;
  font-size: 14px; font-family: inherit; outline: none; margin-bottom: 6px;
  transition: border-color .15s; display: block;
}
.msn-uc-popt:focus { border-color: #1877f2; }
.msn-uc-padd {
  padding: 10px 16px; border: none; border-radius: 10px; background: #fff;
  color: #1877f2; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.msn-uc-padd:hover { background: #e7f0fd; }
.msn-uc-pdur { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 14px; color: #65676b; }
.msn-uc-pdur select { border: 1.5px solid #e4e6ea; border-radius: 8px; padding: 6px 10px; font-size: 14px; outline: none; background: #fff; }

/* Live */
.msn-uc-livecam {
  position: relative; background: #000; border-radius: 12px; overflow: hidden;
  aspect-ratio: 16/9; margin-bottom: 12px;
}
#msn-uc-live-vid { width: 100%; height: 100%; object-fit: cover; }
.msn-uc-livebadge {
  position: absolute; top: 12px; left: 12px;
  background: #f40002; color: #fff; font-size: 11px; font-weight: 900;
  border-radius: 6px; padding: 4px 10px;
  display: flex; align-items: center; gap: 5px; letter-spacing: .08em;
}
.msn-uc-livebadge span {
  width: 7px; height: 7px; background: #fff; border-radius: 50%;
  animation: liveblink 1.2s ease-in-out infinite;
}
@keyframes liveblink { 0%,100%{opacity:1;} 50%{opacity:.2;} }
.msn-uc-livetitle {
  width: 100%; padding: 12px 14px; border: 1.5px solid #e4e6ea; border-radius: 10px;
  font-size: 15px; font-family: inherit; outline: none; margin-bottom: 10px;
  transition: border-color .15s;
}
.msn-uc-livetitle:focus { border-color: #f40002; }
.msn-uc-livechecks { display: flex; gap: 16px; margin-bottom: 12px; }
.msn-uc-livechecks label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: #65676b; cursor: pointer; }
.msn-uc-golivebtn {
  width: 100%; height: 46px; border: none; border-radius: 10px;
  background: #f40002; color: #fff; font-size: 15px; font-weight: 800;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s;
}
.msn-uc-golivebtn:hover { background: #d50002; }
.msn-uc-golivebtn svg { width: 14px; height: 14px; fill: #fff; animation: liveblink 1.2s ease-in-out infinite; }

/* ── TOOLBAR ── */
.msn-uc-toolbar {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid #e4e6ea; border-radius: 12px;
  padding: 10px 14px; margin: 10px 0 8px;
}
.msn-uc-toolbar-label { font-size: 14px; font-weight: 700; color: #050505; flex-shrink: 0; }
.msn-uc-tools {
  display: flex; align-items: center; gap: 0;
  overflow-x: auto; scrollbar-width: none; flex: 1;
}
.msn-uc-tools::-webkit-scrollbar { display: none; }
.msn-uc-tool {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 9px; border: none; border-radius: 8px;
  background: transparent; cursor: pointer; font-family: inherit;
  transition: background .15s, transform .15s; flex-shrink: 0;
}
.msn-uc-tool:hover { background: #f0f2f5; transform: scale(1.06); }
.msn-uc-tool svg {
  width: 22px; height: 22px;
  fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.msn-uc-tool > span:last-child { font-size: 10px; font-weight: 700; color: #65676b; }
.msn-gif-lbl {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 22px; background: #0866ff; color: #fff;
  font-size: 10px; font-weight: 900; border-radius: 6px; letter-spacing: .06em;
}

/* ── SUBMIT ── */
.msn-uc-post-btn {
  width: 100%; height: 46px; border: none; border-radius: 10px;
  background: #1877f2; color: #fff; font-size: 16px; font-weight: 800;
  cursor: pointer; font-family: inherit; letter-spacing: .01em;
  transition: background .15s, opacity .15s, transform .12s;
}
.msn-uc-post-btn:hover:not(:disabled) { background: #1565d8; transform: translateY(-1px); }
.msn-uc-post-btn:disabled { background: #e4e6ea; color: #bec3c9; cursor: not-allowed; transform: none; }
.msn-uc-status { min-height: 18px; font-size: 13px; color: #d32f2f; margin-top: 8px; text-align: center; }

/* ── MOBILE ── */
@media (max-width: 540px) {
  .msn-uc-modal { border-radius: 20px 20px 0 0; margin: auto 0 0; max-height: 95vh; }
  .msn-uc-backdrop { align-items: flex-end; padding: 0; }
  .msn-uc-toolbar-label { display: none; }
  .msn-uc-fgrid { grid-template-columns: repeat(3,1fr); }
  .msn-uc-gif-grid { grid-template-columns: repeat(2,1fr); }
  .msn-uc-shortcut > span { display: none; }
}

/* =====================================================
   ULTRA COMPOSER — DARK MODE
   Activated ONLY by the Miracle App Shell setting
   <html data-theme="dark">. Never OS preference.
   Palette matches the feed/messaging dark surfaces:
     bg/card  #242526   raised  #3a3b3c   border #393a3b
     text     #e4e6eb   muted   #b0b3b8   accent #2d88ff
   ===================================================== */

/* ── Composer card (collapsed state) ── */
html[data-theme="dark"] .msn-uc-card {
  background: #242526;
  border-color: #393a3b;
  color: #e4e6eb;
}
html[data-theme="dark"] .msn-uc-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.5); }

html[data-theme="dark"] .msn-uc-prompt-btn {
  background: #3a3b3c;
  border-color: #4a4b4c;
  color: #b0b3b8;
}
html[data-theme="dark"] .msn-uc-prompt-btn:hover {
  background: #4e4f50;
  border-color: #5a5b5c;
}
html[data-theme="dark"] .msn-uc-sep { background: #393a3b; }
html[data-theme="dark"] .msn-uc-shortcut { color: #b0b3b8; }
html[data-theme="dark"] .msn-uc-shortcut:hover { background: #3a3b3c; }

/* ── Modal shell ── */
html[data-theme="dark"] .msn-uc-backdrop.msn-uc-vis { background: rgba(0,0,0,.75); }
html[data-theme="dark"] .msn-uc-modal {
  background: #242526;
  color: #e4e6eb;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
html[data-theme="dark"] .msn-uc-mhead { border-bottom-color: #393a3b; }
html[data-theme="dark"] .msn-uc-mhead h2 { color: #e4e6eb; }
html[data-theme="dark"] .msn-uc-close { background: #3a3b3c; }
html[data-theme="dark"] .msn-uc-close:hover { background: #4e4f50; }
html[data-theme="dark"] .msn-uc-close svg { stroke: #e4e6eb; }

/* ── Author + audience selector ── */
html[data-theme="dark"] .msn-uc-ainfo strong { color: #e4e6eb; }
html[data-theme="dark"] .msn-uc-audbtn {
  background: #3a3b3c;
  color: #e4e6eb;
}
html[data-theme="dark"] .msn-uc-audbtn:hover { background: #4e4f50; }
html[data-theme="dark"] .msn-uc-audbtn svg { stroke: #e4e6eb; }
html[data-theme="dark"] .msn-uc-audmenu {
  background: #242526;
  border-color: #393a3b;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
html[data-theme="dark"] .msn-uc-audopt:hover { background: #3a3b3c; }
html[data-theme="dark"] .msn-uc-audopt.active { background: rgba(45,136,255,.18); }
html[data-theme="dark"] .msn-uc-audtxt strong { color: #e4e6eb; }
html[data-theme="dark"] .msn-uc-audtxt small { color: #b0b3b8; }
html[data-theme="dark"] .msn-uc-tick { stroke: #4599ff; }

/* ── Text area ── */
html[data-theme="dark"] #msn-post-textarea { color: #e4e6eb; caret-color: #e4e6eb; }
html[data-theme="dark"] #msn-post-textarea::placeholder { color: #b0b3b8; }
/* When a coloured background is chosen the white text rule still applies. */

/* ── Inline chips ── */
html[data-theme="dark"] .msn-uc-chip-pill {
  background: rgba(45,136,255,.18);
  color: #4599ff;
}
html[data-theme="dark"] .msn-uc-chip-pill button { color: #4599ff; }

/* ── Background swatch row (first = "no bg") ── */
html[data-theme="dark"] .msn-uc-bg:first-child { background: #3a3b3c; }
html[data-theme="dark"] .msn-uc-bg:first-child svg { stroke: #b0b3b8; }

/* ── Media zone ── */
html[data-theme="dark"] .msn-uc-mediazone {
  background: #18191a;
  border-color: #393a3b;
}
html[data-theme="dark"] .msn-uc-addmore {
  background: #242526;
  border-color: #4a4b4c;
  color: #b0b3b8;
}
html[data-theme="dark"] .msn-uc-addmore:hover { background: #3a3b3c; }
html[data-theme="dark"] .msn-uc-addmore svg { stroke: #b0b3b8; }

/* ── Sub-panels (gif / poll / feeling / location / tag / live) ── */
html[data-theme="dark"] .msn-uc-panel { background: #18191a; }
html[data-theme="dark"] .msn-uc-phead strong { color: #e4e6eb; }
html[data-theme="dark"] .msn-uc-pback { background: #3a3b3c; }
html[data-theme="dark"] .msn-uc-pback:hover { background: #4e4f50; }
html[data-theme="dark"] .msn-uc-pback svg { stroke: #e4e6eb; }

/* search rows / inputs inside panels */
html[data-theme="dark"] .msn-uc-psearch-row {
  background: #242526;
  border-color: #393a3b;
}
html[data-theme="dark"] .msn-uc-psearch-row:focus-within { border-color: #2d88ff; }
html[data-theme="dark"] .msn-uc-psearch-row svg { stroke: #b0b3b8; }
html[data-theme="dark"] .msn-uc-psearch-row input { color: #e4e6eb; }
html[data-theme="dark"] .msn-uc-psearch-row input::placeholder { color: #b0b3b8; }

html[data-theme="dark"] .msn-uc-fq,
html[data-theme="dark"] .msn-uc-pq,
html[data-theme="dark"] .msn-uc-popt,
html[data-theme="dark"] .msn-uc-livetitle {
  background: #242526;
  border-color: #393a3b;
  color: #e4e6eb;
}
html[data-theme="dark"] .msn-uc-fq:focus,
html[data-theme="dark"] .msn-uc-pq:focus,
html[data-theme="dark"] .msn-uc-popt:focus { border-color: #2d88ff; }
html[data-theme="dark"] .msn-uc-livetitle:focus { border-color: #f40002; }
html[data-theme="dark"] .msn-uc-fq::placeholder,
html[data-theme="dark"] .msn-uc-pq::placeholder,
html[data-theme="dark"] .msn-uc-popt::placeholder,
html[data-theme="dark"] .msn-uc-livetitle::placeholder { color: #b0b3b8; }

/* feeling grid */
html[data-theme="dark"] .msn-uc-fbtn { background: #242526; }
html[data-theme="dark"] .msn-uc-fbtn:hover { background: rgba(45,136,255,.18); }
html[data-theme="dark"] .msn-uc-fbtn small { color: #b0b3b8; }

/* location */
html[data-theme="dark"] .msn-uc-gps { background: #242526; color: #4599ff; }
html[data-theme="dark"] .msn-uc-gps:hover { background: rgba(45,136,255,.18); }
html[data-theme="dark"] .msn-uc-gps svg { stroke: #4599ff; }
html[data-theme="dark"] .msn-uc-loc-item { background: #242526; color: #e4e6eb; }
html[data-theme="dark"] .msn-uc-loc-item:hover { background: rgba(45,136,255,.18); color: #4599ff; }

/* tag people */
html[data-theme="dark"] .msn-uc-tag-person { background: #242526; color: #e4e6eb; }
html[data-theme="dark"] .msn-uc-tag-person:hover { background: rgba(45,136,255,.18); }
html[data-theme="dark"] .msn-uc-tchip { background: #2d88ff; }

/* generic empty/hint text */
html[data-theme="dark"] .msn-uc-no-results,
html[data-theme="dark"] .msn-uc-hint { color: #b0b3b8; }

/* poll */
html[data-theme="dark"] .msn-uc-padd { background: #242526; color: #4599ff; }
html[data-theme="dark"] .msn-uc-padd:hover { background: rgba(45,136,255,.18); }
html[data-theme="dark"] .msn-uc-pdur { color: #b0b3b8; }
html[data-theme="dark"] .msn-uc-pdur select {
  background: #242526;
  border-color: #393a3b;
  color: #e4e6eb;
}

/* live */
html[data-theme="dark"] .msn-uc-livechecks label { color: #b0b3b8; }

/* ── Toolbar ("Add to your post") ── */
html[data-theme="dark"] .msn-uc-toolbar { border-color: #393a3b; }
html[data-theme="dark"] .msn-uc-toolbar-label { color: #e4e6eb; }
html[data-theme="dark"] .msn-uc-tool:hover { background: #3a3b3c; }
html[data-theme="dark"] .msn-uc-tool > span:last-child { color: #b0b3b8; }

/* ── Submit button ── */
html[data-theme="dark"] .msn-uc-post-btn:disabled {
  background: #3a3b3c;
  color: #6b6e73;
}
html[data-theme="dark"] .msn-uc-status { color: #ff6b6b; }

/* ── Scrollbars inside the modal body ── */
html[data-theme="dark"] .msn-uc-mbody { scrollbar-color: rgba(255,255,255,.28) transparent; }
html[data-theme="dark"] .msn-uc-mbody::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); }
html[data-theme="dark"] .msn-uc-mbody::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.42); }
/* === EOF msn-ultra-composer.css dark-mode === */

/* =====================================================
   DARK MODE — COLOUR SWATCHES MUST KEEP THEIR COLOURS
   On Android Chrome, when a view doesn't declare
   color-scheme, the "Auto Dark Theme" engine desaturates
   inline gradient backgrounds — turning every post
   background swatch into a flat dark-grey circle.
   1) Declare color-scheme:dark so Chrome stops auto-darkening.
   2) Re-assert each swatch gradient with !important as a
      guaranteed fallback so the palette always shows.
   ===================================================== */
html[data-theme="dark"]{ color-scheme: dark; }

html[data-theme="dark"] .msn-uc-bg[data-color="linear-gradient(135deg,#f97316,#ef4444)"]{
  background: linear-gradient(135deg,#f97316,#ef4444) !important;
}
html[data-theme="dark"] .msn-uc-bg[data-color="linear-gradient(135deg,#a855f7,#ec4899)"]{
  background: linear-gradient(135deg,#a855f7,#ec4899) !important;
}
html[data-theme="dark"] .msn-uc-bg[data-color="linear-gradient(135deg,#06b6d4,#3b82f6)"]{
  background: linear-gradient(135deg,#06b6d4,#3b82f6) !important;
}
html[data-theme="dark"] .msn-uc-bg[data-color="linear-gradient(135deg,#22c55e,#10b981)"]{
  background: linear-gradient(135deg,#22c55e,#10b981) !important;
}
html[data-theme="dark"] .msn-uc-bg[data-color="linear-gradient(135deg,#fbbf24,#f59e0b)"]{
  background: linear-gradient(135deg,#fbbf24,#f59e0b) !important;
}
html[data-theme="dark"] .msn-uc-bg[data-color="#1e1b4b"]{
  background: #1e1b4b !important;
}
html[data-theme="dark"] .msn-uc-bg[data-color="linear-gradient(135deg,#be185d,#9d174d)"]{
  background: linear-gradient(135deg,#be185d,#9d174d) !important;
}
html[data-theme="dark"] .msn-uc-bg[data-color="linear-gradient(135deg,#0f172a,#1e293b)"]{
  background: linear-gradient(135deg,#0f172a,#1e293b) !important;
}
/* Keep the swatch ring visible on selected colour in dark mode */
html[data-theme="dark"] .msn-uc-bg.active{ border-color:#4599ff !important; }
/* === EOF swatch dark-mode === */

/* =====================================================
   COMPOSER 2.0 — Vouxat design + AI Post Studio
   Facebook-inspired hierarchy with Vouxat gold/blue identity.
   ===================================================== */
.msn-uc-card{
  position:relative;
  border-radius:18px;
  border-color:rgba(15,23,42,.08);
  box-shadow:0 8px 26px rgba(15,23,42,.08);
}
.msn-uc-card::before{
  content:"";
  position:absolute;
  inset:0 0 auto;
  height:3px;
  background:linear-gradient(90deg,#f4c44e 0 42%,#2457c5 68%,#0866ff 100%);
  pointer-events:none;
}
.msn-uc-top{ padding:15px 15px 11px; }
.msn-uc-prompt-btn{
  height:48px;
  border:0;
  font-size:15.5px;
}
.msn-uc-shortcuts{ padding:5px 8px 10px; gap:4px; }
.msn-uc-shortcut{
  min-height:44px;
  border-radius:12px;
  font-size:12.5px;
}
.msn-uc-shortcut-photo svg{ stroke:#45bd62 !important; }
.msn-uc-shortcut-feeling svg{ stroke:#f7b928 !important; }
.msn-uc-shortcut-ai{
  color:#6d3bc1;
  background:linear-gradient(135deg,rgba(244,196,78,.14),rgba(109,59,193,.1));
}
.msn-uc-shortcut-ai:hover{ background:linear-gradient(135deg,rgba(244,196,78,.22),rgba(109,59,193,.16)); }
.msn-uc-shortcut-ai svg{ stroke:#7c3aed !important; }
.msn-uc-modal{ border-radius:22px; }
.msn-uc-mhead{
  position:sticky;
  top:0;
  z-index:30;
  background:inherit;
}
.msn-uc-post-btn{
  position:sticky;
  bottom:0;
  z-index:25;
  height:48px;
  border-radius:12px;
  box-shadow:0 -8px 22px rgba(255,255,255,.9);
}
.msn-uc-tool-ai-icon{
  width:24px;
  height:24px;
  border-radius:8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  background:linear-gradient(135deg,#f4c44e,#7c3aed 72%);
  box-shadow:0 4px 10px rgba(124,58,237,.22);
  font-size:15px;
}

/* AI Post panel */
.msn-uc-ai-panel{
  position:relative;
  overflow:hidden;
  border:1px solid rgba(124,58,237,.15);
  background:linear-gradient(145deg,#fffbeb 0%,#f8f5ff 52%,#eef6ff 100%);
}
.msn-uc-ai-panel::after{
  content:"";
  position:absolute;
  width:150px;
  height:150px;
  right:-80px;
  top:-90px;
  border-radius:50%;
  background:rgba(244,196,78,.2);
  filter:blur(2px);
  pointer-events:none;
}
.msn-uc-ai-panel .msn-uc-phead{ position:relative; z-index:1; align-items:center; }
.msn-uc-ai-panel .msn-uc-phead > div{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.msn-uc-ai-panel .msn-uc-phead small{ color:#6b7280; font-size:11.5px; }
.msn-uc-ai-spark{
  width:36px;
  height:36px;
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  background:linear-gradient(135deg,#f4c44e,#7c3aed 70%);
  box-shadow:0 8px 18px rgba(124,58,237,.22);
  font-size:20px;
}
.msn-uc-ai-label{
  display:block;
  margin:4px 0 7px;
  color:#111827;
  font-size:13px;
  font-weight:800;
}
.msn-uc-ai-prompt{
  width:100%;
  min-height:104px;
  max-height:220px;
  resize:vertical;
  box-sizing:border-box;
  padding:13px 14px;
  border:1.5px solid rgba(109,59,193,.2);
  border-radius:14px;
  outline:none;
  background:rgba(255,255,255,.86);
  color:#111827;
  font:inherit;
  font-size:14px;
  line-height:1.45;
  transition:border-color .15s,box-shadow .15s;
}
.msn-uc-ai-prompt:focus{
  border-color:#7c3aed;
  box-shadow:0 0 0 4px rgba(124,58,237,.11);
}
.msn-uc-ai-modes{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;
  margin:10px 0;
}
.msn-uc-ai-modes label{ cursor:pointer; }
.msn-uc-ai-modes input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.msn-uc-ai-modes span{
  min-height:38px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:6px 8px;
  border:1px solid rgba(109,59,193,.14);
  border-radius:10px;
  background:rgba(255,255,255,.72);
  color:#5b6472;
  font-size:11.5px;
  font-weight:750;
  text-align:center;
}
.msn-uc-ai-modes input:checked + span{
  border-color:#7c3aed;
  background:#fff;
  color:#6d28d9;
  box-shadow:0 0 0 2px rgba(124,58,237,.1);
}
.msn-uc-ai-generate{
  width:100%;
  min-height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  border:0;
  border-radius:12px;
  background:linear-gradient(100deg,#2457c5,#6d3bc1 65%,#b7791f);
  color:#fff;
  font:inherit;
  font-size:14px;
  font-weight:850;
  cursor:pointer;
  box-shadow:0 8px 20px rgba(61,71,191,.22);
}
.msn-uc-ai-generate:hover:not(:disabled){ transform:translateY(-1px); filter:brightness(1.04); }
.msn-uc-ai-generate:disabled{ opacity:.52; cursor:not-allowed; box-shadow:none; }
.msn-uc-ai-generate.is-loading .msn-uc-ai-generate-icon{ animation:msn-ai-spin 1.1s linear infinite; }
@keyframes msn-ai-spin{ to{ transform:rotate(360deg); } }
.msn-uc-ai-config-note,
.msn-uc-ai-status{
  margin-top:9px;
  font-size:12.5px;
  font-weight:650;
  line-height:1.4;
  text-align:center;
}
.msn-uc-ai-config-note{ color:#92400e; }
.msn-uc-ai-status:empty{ display:none; }
.msn-uc-ai-status.is-loading{ color:#5b21b6; }
.msn-uc-ai-status.is-success{ color:#067647; }
.msn-uc-ai-status.is-warning{ color:#92400e; }
.msn-uc-ai-status.is-error{ color:#b42318; }
.msn-uc-ai-result{
  margin-top:12px;
  padding:10px;
  border:1px solid rgba(16,185,129,.18);
  border-radius:14px;
  background:rgba(255,255,255,.75);
}
.msn-uc-ai-ready{
  display:flex;
  align-items:center;
  gap:9px;
  margin-bottom:8px;
}
.msn-uc-ai-ready > span{
  width:28px;
  height:28px;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#d1fae5;
  color:#047857;
  font-weight:900;
}
.msn-uc-ai-ready > div{ display:flex; flex-direction:column; }
.msn-uc-ai-ready strong{ color:#111827; font-size:13px; }
.msn-uc-ai-ready small{ color:#6b7280; font-size:11.5px; }
.msn-uc-ai-image-wrap{ position:relative; overflow:hidden; border-radius:12px; background:#111; }
.msn-uc-ai-image-wrap img{ width:100%; aspect-ratio:1; object-fit:cover; display:block; }
.msn-uc-ai-remove-image{
  position:absolute;
  right:9px;
  bottom:9px;
  border:0;
  border-radius:999px;
  padding:8px 12px;
  background:rgba(17,24,39,.8);
  color:#fff;
  font:inherit;
  font-size:11.5px;
  font-weight:800;
  cursor:pointer;
  backdrop-filter:blur(5px);
}

html[data-theme="dark"] .msn-uc-card::before,
body.msn-dark .msn-uc-card::before{ background:linear-gradient(90deg,#f4c44e,#4599ff 72%); }
html[data-theme="dark"] .msn-uc-shortcut-ai,
body.msn-dark .msn-uc-shortcut-ai{ color:#d8b4fe; background:linear-gradient(135deg,rgba(244,196,78,.12),rgba(124,58,237,.22)); }
html[data-theme="dark"] .msn-uc-post-btn,
body.msn-dark .msn-uc-post-btn{ box-shadow:0 -9px 22px rgba(36,37,38,.94); }
html[data-theme="dark"] .msn-uc-ai-panel,
body.msn-dark .msn-uc-ai-panel{
  background:linear-gradient(145deg,#252016 0%,#211b2e 52%,#172234 100%);
  border-color:rgba(216,180,254,.18);
}
html[data-theme="dark"] .msn-uc-ai-panel .msn-uc-phead small,
body.msn-dark .msn-uc-ai-panel .msn-uc-phead small,
html[data-theme="dark"] .msn-uc-ai-ready small,
body.msn-dark .msn-uc-ai-ready small{ color:#b0b3b8; }
html[data-theme="dark"] .msn-uc-ai-label,
body.msn-dark .msn-uc-ai-label,
html[data-theme="dark"] .msn-uc-ai-ready strong,
body.msn-dark .msn-uc-ai-ready strong{ color:#e4e6eb; }
html[data-theme="dark"] .msn-uc-ai-prompt,
body.msn-dark .msn-uc-ai-prompt{
  background:rgba(36,37,38,.9);
  border-color:#4e4f50;
  color:#e4e6eb;
}
html[data-theme="dark"] .msn-uc-ai-prompt::placeholder,
body.msn-dark .msn-uc-ai-prompt::placeholder{ color:#8f9399; }
html[data-theme="dark"] .msn-uc-ai-prompt:focus,
body.msn-dark .msn-uc-ai-prompt:focus{ border-color:#a78bfa; box-shadow:0 0 0 4px rgba(167,139,250,.16); }
html[data-theme="dark"] .msn-uc-ai-modes span,
body.msn-dark .msn-uc-ai-modes span{
  background:rgba(58,59,60,.75);
  border-color:#4e4f50;
  color:#b0b3b8;
}
html[data-theme="dark"] .msn-uc-ai-modes input:checked + span,
body.msn-dark .msn-uc-ai-modes input:checked + span{
  background:#3a3b3c;
  border-color:#a78bfa;
  color:#ddd6fe;
}
html[data-theme="dark"] .msn-uc-ai-result,
body.msn-dark .msn-uc-ai-result{ background:rgba(36,37,38,.82); border-color:rgba(52,211,153,.2); }
html[data-theme="dark"] .msn-uc-ai-status.is-loading,
body.msn-dark .msn-uc-ai-status.is-loading{ color:#c4b5fd; }
html[data-theme="dark"] .msn-uc-ai-status.is-success,
body.msn-dark .msn-uc-ai-status.is-success{ color:#6ee7b7; }
html[data-theme="dark"] .msn-uc-ai-status.is-warning,
body.msn-dark .msn-uc-ai-status.is-warning,
html[data-theme="dark"] .msn-uc-ai-config-note,
body.msn-dark .msn-uc-ai-config-note{ color:#fcd34d; }
html[data-theme="dark"] .msn-uc-ai-status.is-error,
body.msn-dark .msn-uc-ai-status.is-error{ color:#fda4af; }

@media (max-width:540px){
  .msn-uc-shortcuts{ gap:1px; }
  .msn-uc-shortcut{ font-size:11px; gap:5px; }
  .msn-uc-shortcut svg{ width:20px; height:20px; }
  .msn-uc-ai-modes{ grid-template-columns:1fr; }
  .msn-uc-ai-modes span{ min-height:36px; }
}

@media (prefers-reduced-motion:reduce){
  .msn-uc-modal,
  .msn-uc-card,
  .msn-uc-ai-generate{ transition:none !important; }
  .msn-uc-ai-generate.is-loading .msn-uc-ai-generate-icon{ animation:none; }
}
