/* =========================================================
   MW WALL UI (Clean + Fast) — FULL CSS (DE-DUPED)
   ========================================================= */

/* =========================
   1) Variables (ONE ONLY)
   ========================= */
:root {
  --mw-w: 1500px;
  --mw-gap: 14px;
  --mw-r: 18px;
  --mw-text: #0f172a;
  --mw-muted: #667085;
  --mw-border: #e5e7eb;
  --mw-soft: #f8fafc;
  --mw-brand: #2563eb;
  --mw-star: #b45309;
  /* Mansway navy/yellow */
  --mw-navy: #0b2a5e;
  --mw-navy2: #082047;
  --mw-deep: #00274C;
  --mw-yellow: #FFCB05;
  /* Rules colors (mobile look) */
  --mw-ok-bg: #ecfdf3;
  --mw-ok-bd: #bbf7d0;
  --mw-no-bg: #fef2f2;
  --mw-no-bd: #fecaca;
  --mw-warn-bg: #fffbeb;
  --mw-warn-bd: #fde68a;
}

/* =========================
   2) Base helpers (reduce repetition)
   ========================= */
#mw-wall, #mw-wall-app {
  color: var(--mw-text);
  font-family: system-ui, -apple-system, Segoe UI, Arial, "Noto Sans TC", sans-serif;
}

#mw-wall *, #mw-wall-app * {
  box-sizing: border-box;
}

#mw-wall .mw-btn,
#mw-wall .mw-cmt-btn,
#mw-wall-app .mw-btn,
#mw-wall-app .mw-cmt-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
}

#mw-wall .mw-search,
#mw-wall .mw-select,
#mw-wall .mw-name-input,
#mw-wall .mw-ta,
#mw-wall .mw-cmt-input,
#mw-wall-app .mw-search,
#mw-wall-app .mw-select,
#mw-wall-app .mw-name-input,
#mw-wall-app .mw-ta,
#mw-wall-app .mw-cmt-input {
  border: 1px solid #d7dee7;
  background: #fff;
  font: 14px system-ui;
}

#mw-wall .mw-card,
#mw-wall .mw-cardA,
#mw-wall .mw-cardB,
#mw-wall .mw-prev-item,
#mw-wall .mw-media,
#mw-wall-app .mw-card,
#mw-wall-app .mw-cardA,
#mw-wall-app .mw-cardB,
#mw-wall-app .mw-prev-item,
#mw-wall-app .mw-media {
  border: 1px solid var(--mw-border);
  background: #fff;
}

/* =========================
   3) Shell & header
   ========================= */
#mw-wall .mw-card,
#mw-wall-app .mw-card {
  max-width: var(--mw-w);
  margin: 20px auto;
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(2, 6, 23, .08);
  overflow: hidden;
}

#mw-wall .mw-hd,
#mw-wall-app .mw-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
  background: linear-gradient(180deg, #fbfdff, #f7f9fc);
}

#mw-wall .mw-title,
#mw-wall-app .mw-title {
  margin-right: auto;
  font: 800 18px/1 system-ui, Segoe UI, Arial;
  color: var(--mw-navy);
}

#mw-wall .mw-tabs,
#mw-wall-app .mw-tabs {
  display: flex;
  gap: 8px;
}

#mw-wall .mw-tab,
#mw-wall-app .mw-tab {
  padding: 8px 12px;
  border: 1px solid #dbe2ea;
  background: #fff;
  border-radius: 999px;
  font: 13px/1 system-ui;
  cursor: pointer;
}

#mw-wall .mw-tab.on,
#mw-wall-app .mw-tab.on {
  background: var(--mw-navy);
  color: #fff;
  border-color: var(--mw-navy);
}

#mw-wall .mw-tools,
#mw-wall-app .mw-tools {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

#mw-wall .mw-search,
#mw-wall-app .mw-search {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  min-width: 220px;
}

#mw-wall .mw-select,
#mw-wall-app .mw-select {
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
}

/* Optional topbar + pill buttons (safe if you use them) */
#mw-wall .mw-topbar,
#mw-wall-app .mw-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--mw-border);
  border-radius: 18px;
}

#mw-wall .mw-brand,
#mw-wall-app .mw-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: .3px;
}

#mw-wall .mw-dot,
#mw-wall-app .mw-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mw-yellow);
  box-shadow: 0 0 0 3px rgba(255, 203, 5, .25);
}

#mw-wall .mw-pill,
#mw-wall-app .mw-pill {
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

#mw-wall .mw-pill--navy,
#mw-wall-app .mw-pill--navy {
  background: var(--mw-navy);
  color: #fff;
}

#mw-wall .mw-pill--navy:hover,
#mw-wall-app .mw-pill--navy:hover {
  background: var(--mw-navy2);
}

#mw-wall .mw-pill--yellow,
#mw-wall-app .mw-pill--yellow {
  background: var(--mw-yellow);
  color: #000;
}

#mw-wall .mw-pill--yellow:hover,
#mw-wall-app .mw-pill--yellow:hover {
  filter: brightness(.96);
}

/* =========================
   4) Composer
   ========================= */
#mw-wall .mw-form,
#mw-wall-app .mw-form {
  padding: 12px 16px;
  display: grid;
  gap: 10px;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
  position: relative;
}

#mw-wall .mw-stars,
#mw-wall-app .mw-stars {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 4px;
}

#mw-wall .mw-stars input,
#mw-wall-app .mw-stars input {
  display: none;
}

#mw-wall .mw-stars label,
#mw-wall-app .mw-stars label {
  font-size: 18px;
  color: #e5e7eb;
  cursor: pointer;
}

#mw-wall .mw-stars label:before,
#mw-wall-app .mw-stars label:before {
  content: "\f005";
  font-family: FontAwesome;
}

#mw-wall .mw-stars label:hover,
#mw-wall .mw-stars label:hover ~ label,
#mw-wall-app .mw-stars label:hover,
#mw-wall-app .mw-stars label:hover ~ label {
  color: #d97706;
}

#mw-wall .mw-stars input:checked ~ label,
#mw-wall-app .mw-stars input:checked ~ label {
  color: var(--mw-star);
}

#mw-wall .mw-row,
#mw-wall-app .mw-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 5;
}

#mw-wall .mw-name-input,
#mw-wall-app .mw-name-input {
  height: 40px;
  flex: 1;
  min-width: 220px;
  padding: 0 12px;
  border-radius: 10px;
}

#mw-wall .mw-ta,
#mw-wall-app .mw-ta {
  width: 100%;
  min-height: 92px;
  max-height: 240px;
  padding: 12px;
  border-radius: 12px;
  line-height: 1.55;
  resize: vertical;
}

/* Attach button (navy background + yellow plus) */
#mw-wall .mw-atch,
#mw-wall-app .mw-atch {
  width: 42px;
  height: 40px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: var(--mw-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  z-index: 20;
  pointer-events: auto;
}

/* IMPORTANT: keep inner elements clickable (some JS binds to icon) */
#mw-wall .mw-atch *,
#mw-wall-app .mw-atch * {
  pointer-events: auto;
}

#mw-wall .mw-atch i.fa-plus,
#mw-wall-app .mw-atch i.fa-plus {
  color: var(--mw-yellow);
  font-weight: 900;
  font-size: 20px;
  line-height: 1;
}

/* If your HTML uses <input type="file"> inside the button/label, make it work */
#mw-wall .mw-atch input[type="file"],
#mw-wall-app .mw-atch input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 25;
}

/* Send button */
#mw-wall .mw-btn,
#mw-wall-app .mw-btn {
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: var(--mw-brand);
  color: #fff;
  font-weight: 800;
}

#mw-wall .mw-hint,
#mw-wall-app .mw-hint {
  font-size: 12px;
  color: #6b7280;
}

/* Prevent pseudo overlays blocking clicks (safe) */
#mw-wall .mw-form::before,
#mw-wall .mw-form::after,
#mw-wall-app .mw-form::before,
#mw-wall-app .mw-form::after {
  pointer-events: none !important;
}

/* =========================
   5) Upload preview
   ========================= */
#mw-wall .mw-img-count,
#mw-wall-app .mw-img-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #d7dee7;
  background: #fff;
  font: 800 13px/1 system-ui;
  color: var(--mw-navy);
}

#mw-wall .mw-prev,
#mw-wall-app .mw-prev {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

#mw-wall .mw-prev-item,
#mw-wall-app .mw-prev-item {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 14px;
  background: var(--mw-soft);
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(2, 6, 23, .08);
}

#mw-wall .mw-prev-item img,
#mw-wall-app .mw-prev-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
}

#mw-wall .mw-prev-x,
#mw-wall-app .mw-prev-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, .15);
  background: rgba(255, 255, 255, .92);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(2, 6, 23, .18);
}

#mw-wall .mw-prev-x i,
#mw-wall-app .mw-prev-x i {
  font-size: 14px;
  color: #ef4444;
  line-height: 1;
}

#mw-wall .mw-prev-x:active,
#mw-wall-app .mw-prev-x:active {
  transform: scale(.96);
}

/* =========================
   6) Avg row
   ========================= */
#mw-wall .mw-avg,
#mw-wall-app .mw-avg {
  padding: 10px 16px;
  background: #fafbfe;
  border-top: 1px solid #eef2f7;
  text-align: right;
  font: 14px system-ui;
  color: #3a4859;
}

#mw-wall .mw-avg .stars,
#mw-wall-app .mw-avg .stars {
  color: var(--mw-star);
  letter-spacing: 1px;
  margin-left: 6px;
}

/* =========================
   7) Section + Masonry grid
   ========================= */
#mw-wall .mw-section,
#mw-wall-app .mw-section {
  padding: 14px 16px;
  background: #fff;
}

#mw-wall .mw-section h3,
#mw-wall-app .mw-section h3 {
  margin: 0 0 10px;
  font: 800 14px/1 system-ui;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: .08em;
}

#mw-wall .mw-grid,
#mw-wall-app .mw-grid {
  column-count: 3;
  column-gap: var(--mw-gap);
  max-width: var(--mw-w);
  margin: 0 auto;
}

@media (max-width: 1100px) {
  #mw-wall .mw-grid,
  #mw-wall-app .mw-grid {
    column-count: 2;
  }
}
@media (max-width: 640px) {
  #mw-wall .mw-grid,
  #mw-wall-app .mw-grid {
    column-count: 1;
  }
}

/* =========================
   8) Cards
   ========================= */
#mw-wall .mw-cardA,
#mw-wall .mw-cardB,
#mw-wall-app .mw-cardA,
#mw-wall-app .mw-cardB {
  display: inline-block;
  width: 100%;
  margin: 0 0 var(--mw-gap);
  vertical-align: top;
  border-radius: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
  padding: 14px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  scroll-margin-top: 90px;
}

#mw-wall .mw-top,
#mw-wall-app .mw-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

#mw-wall .mw-avatar,
#mw-wall-app .mw-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eaf0ff;
  color: #274690;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 800 12px system-ui;
  border: 1px solid #d9e4ff;
}

#mw-wall .mw-name,
#mw-wall-app .mw-name {
  font-weight: 800;
  color: var(--mw-navy);
  font-size: 13px;
}

#mw-wall .mw-sub,
#mw-wall-app .mw-sub {
  font-size: 12px;
  color: var(--mw-muted);
  margin-left: auto;
}

#mw-wall .mw-stars-row,
#mw-wall-app .mw-stars-row {
  color: var(--mw-star);
  font: 14px/1 system-ui;
}

#mw-wall .mw-msg,
#mw-wall-app .mw-msg {
  font: 15px/1.6 system-ui;
  color: var(--mw-text);
  white-space: pre-wrap;
  word-break: break-word;
}

#mw-wall .mw-msg.clamp,
#mw-wall-app .mw-msg.clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* =========================
   9) Multi-image carousel
   ========================= */
#mw-wall .mw-media,
#mw-wall-app .mw-media {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--mw-soft);
}

#mw-wall .mw-slide-viewport,
#mw-wall-app .mw-slide-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
}

#mw-wall .mw-slides,
#mw-wall-app .mw-slides {
  display: flex;
  align-items: stretch;
  will-change: transform;
  transition: transform .3s ease;
}

#mw-wall .mw-slide,
#mw-wall-app .mw-slide {
  min-width: 100%;
  user-select: none;
}

#mw-wall .mw-slide img,
#mw-wall-app .mw-slide img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  opacity: 0;
  transition: opacity .3s ease;
  display: block;
}

#mw-wall .mw-slide img[data-loaded="1"],
#mw-wall-app .mw-slide img[data-loaded="1"] {
  opacity: 1;
}

/* Arrows */
#mw-wall .mw-nav,
#mw-wall-app .mw-nav {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

#mw-wall .mw-arrow,
#mw-wall-app .mw-arrow {
  pointer-events: auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .65));
  border: 1px solid rgba(15, 23, 42, .12);
  backdrop-filter: blur(8px) saturate(1.2);
  box-shadow: 0 5px 14px rgba(2, 6, 23, .18), inset 0 1px 0 rgba(255, 255, 255, .8);
  margin: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s ease, box-shadow .12s ease, opacity .2s ease;
  opacity: .9;
}

#mw-wall .mw-arrow i,
#mw-wall-app .mw-arrow i {
  font-size: 13px;
}

@media (hover:hover) {
  #mw-wall .mw-media:not(:hover) .mw-arrow,
  #mw-wall-app .mw-media:not(:hover) .mw-arrow {
    opacity: 0;
  }
  #mw-wall .mw-media:hover .mw-arrow,
  #mw-wall-app .mw-media:hover .mw-arrow {
    opacity: .96;
  }
}

/* Dots */
#mw-wall .mw-dots,
#mw-wall-app .mw-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}

#mw-wall .mw-dot,
#mw-wall-app .mw-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .65);
  border: 1px solid rgba(0, 0, 0, .22);
  cursor: pointer;
  transition: transform .12s ease;
}

#mw-wall .mw-dot.on,
#mw-wall-app .mw-dot.on {
  background: #fff;
  transform: scale(1.1);
}

/* Zoom puck */
#mw-wall .mw-zoom-btn,
#mw-wall-app .mw-zoom-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, .12);
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .7));
  backdrop-filter: blur(8px);
  font: 12px/1 system-ui;
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(2, 6, 23, .15);
}

#mw-wall .mw-zoom-btn i,
#mw-wall-app .mw-zoom-btn i {
  font-size: 13px;
}

/* =========================
   10) Action Pucks (Like/Love/Save/Share)
   ========================= */
#mw-wall .mw-actions,
#mw-wall-app .mw-actions {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px 8px;
  margin-top: 2px;
}

#mw-wall .mw-side,
#mw-wall-app .mw-side {
  display: flex;
  gap: 14px;
  align-items: center;
}

#mw-wall .mw-puck,
#mw-wall-app .mw-puck {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px; /* Increased padding for wider background */
  border-radius: 20px; /* Optional: adds rounded corners */
  background-color: #f3f4f6; /* Background color for the button */
  border: none; /* Remove the border (outline) */
  transition: transform .12s ease, box-shadow .12s ease, background-color .3s ease;
}

#mw-wall .mw-puck.like,
#mw-wall-app .mw-puck.like {
  background-color: #16a34a; /* Solid green background for Like */
  color: white; /* Make icon white on active */
}

#mw-wall .mw-puck.like i,
#mw-wall-app .mw-puck.like i {
  color: white; /* Icon color when active */
}

#mw-wall .mw-puck.love i,
#mw-wall-app .mw-puck.love i {
  color: #ef4444;
}

#mw-wall .mw-puck.save i,
#mw-wall-app .mw-puck.save i {
  color: #7c3aed;
}

#mw-wall .mw-puck.share i,
#mw-wall-app .mw-puck.share i {
  color: #2563eb;
}

#mw-wall .mw-puck:active,
#mw-wall .mw-puck.on,
#mw-wall-app .mw-puck:active,
#mw-wall-app .mw-puck.on {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 12px 28px rgba(2, 6, 23, .16);
  background-color: #15803d; /* Slightly darker background for active state */
}

#mw-wall .mw-puck.like:active,
#mw-wall-app .mw-puck.like:active {
  background-color: #15803d; /* Darker shade for active Like button */
}

#mw-wall .mw-puck:hover,
#mw-wall-app .mw-puck:hover {
  background-color: #e0e0e0; /* Light background color on hover */
}

#mw-wall .mw-puck.like:hover,
#mw-wall-app .mw-puck.like:hover {
  background-color: #4caf50; /* Lighter green on hover for Like */
}

/* Theme sometimes hides actions: minimal hard fix (SCOPED) */
#mw-wall .mw-actions,
#mw-wall .mw-actions *,
#mw-wall-app .mw-actions,
#mw-wall-app .mw-actions * {
  opacity: 1;
  visibility: visible;
  filter: none;
  pointer-events: auto;
}

@media (min-width: 1101px) {
  #mw-wall .mw-actions,
  #mw-wall-app .mw-actions {
    transform: translateY(5px);
  }
}


/* =========================
   11) Comments
   ========================= */
#mw-wall .mw-cmts,
#mw-wall-app .mw-cmts {
  background: var(--mw-soft);
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 8px 10px;
  margin-top: 2px;
}

#mw-wall .mw-cmt-head,
#mw-wall-app .mw-cmt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 6px;
  font: 600 13px system-ui;
  color: #334155;
}

#mw-wall .mw-count,
#mw-wall-app .mw-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--mw-border);
  background: #fff;
  font: 12px/1 system-ui;
  color: #0f172a;
}

#mw-wall .mw-cmt,
#mw-wall-app .mw-cmt {
  padding: 10px 0;
  border-bottom: 1px dashed #e8eef7;
}

#mw-wall .mw-cmt:last-child,
#mw-wall-app .mw-cmt:last-child {
  border-bottom: 0;
}

#mw-wall .mw-cmt .line1,
#mw-wall-app .mw-cmt .line1 {
  display: flex;
  align-items: center;
  gap: 10px;
}

#mw-wall .mw-cmt .who,
#mw-wall-app .mw-cmt .who {
  font-weight: 800;
  color: var(--mw-navy);
}

#mw-wall .mw-cmt .ts,
#mw-wall-app .mw-cmt .ts {
  color: var(--mw-muted);
  font-size: 12px;
  margin-left: auto;
}

#mw-wall .mw-cmt .txt,
#mw-wall-app .mw-cmt .txt {
  margin-top: 4px;
  color: #2e3a49;
  white-space: pre-wrap;
  line-height: 1.55;
}

#mw-wall .mw-cmt-form,
#mw-wall-app .mw-cmt-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

#mw-wall .mw-cmt-input,
#mw-wall-app .mw-cmt-input {
  flex: 1;
  min-height: 38px;
  border-radius: 10px;
  padding: 8px;
}

#mw-wall .mw-cmt-btn,
#mw-wall-app .mw-cmt-btn {
  width: 40px;
  height: 38px;
  border: 1px solid var(--mw-brand);
  background: var(--mw-brand);
  color: #fff;
  border-radius: 10px;
}

#mw-wall .mw-cmt-actions,
#mw-wall-app .mw-cmt-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

#mw-wall .mw-cmt-actions .edit-btn,
#mw-wall-app .mw-cmt-actions .edit-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  font: 800 12px system-ui;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#mw-wall .mw-cmt.editing,
#mw-wall-app .mw-cmt.editing {
  background: #fff;
  border-radius: 10px;
  padding: 10px 10px 12px;
}

#mw-wall .mw-cmt .edit-ta,
#mw-wall-app .mw-cmt .edit-ta {
  width: 100%;
  min-height: 88px;
  max-height: 260px;
  resize: vertical;
  border: 1px solid #d7dee7;
  border-radius: 12px;
  padding: 10px 12px;
  font: 14px/1.6 system-ui;
  background: #fff;
  color: #0f172a;
}

#mw-wall .mw-cmt .edit-act,
#mw-wall-app .mw-cmt .edit-act {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}

#mw-wall .mw-cmt .edit-act button,
#mw-wall-app .mw-cmt .edit-act button {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  font: 700 13px system-ui;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#mw-wall .mw-cmt .edit-act .edit-save,
#mw-wall-app .mw-cmt .edit-act .edit-save {
  border-color: var(--mw-brand);
  background: var(--mw-brand);
  color: #fff;
}

@keyframes mwFlashIn {
  0% {
    background: #fff8cc;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, .35);
  }
  60% {
    background: #fff;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, .12);
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}

#mw-wall .mw-count.pulse,
#mw-wall-app .mw-count.pulse {
  animation: mwFlashIn .9s ease-out;
}

#mw-wall .mw-cmt.new,
#mw-wall-app .mw-cmt.new {
  animation: mwFlashIn 1.2s ease-out;
  border-radius: 10px;
}

#mw-wall .mw-empty,
#mw-wall-app .mw-empty {
  padding: 18px;
  color: #6b7280;
  text-align: center;
  border: 1px dashed var(--mw-border);
  border-radius: 12px;
}

#mw-wall .mw-more-wrap,
#mw-wall-app .mw-more-wrap {
  padding: 8px 16px 18px;
  text-align: center;
}

#mw-wall .mw-more,
#mw-wall-app .mw-more {
  display: none;
  margin: 0 auto;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
}

/* =========================
   12) Lightbox (ONE SYSTEM)
   ========================= */
#mw-wall .mw-light,
#mw-wall-app .mw-light {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  touch-action: none;
}

#mw-wall .mw-light.on,
#mw-wall-app .mw-light.on {
  display: flex;
}

#mw-wall .mw-light .lb-stage,
#mw-wall-app .mw-light .lb-stage {
  position: relative;
  max-width: 94vw;
  max-height: 90vh;
  z-index: 1001;
}

#mw-wall .mw-light img,
#mw-wall-app .mw-light img {
  max-width: 94vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  user-select: none;
  transition: transform .08s ease;
  position: relative;
  z-index: 1001;
}

#mw-wall .mw-light .close,
#mw-wall-app .mw-light .close {
  position: fixed;
  top: 16px;
  right: 16px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .1);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(2, 6, 23, .25);
  z-index: 1004;
}

/* =========================
   13) RULES MODAL (ONE SYSTEM)
   - #mw-rules + .is-open
   - Overlay uses ::before so theme can't remove it
   ========================= */
#mw-rules {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2147483000;
}

#mw-rules.is-open {
  display: flex;
}

#mw-rules::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, .62);
}

#mw-rules .mw-rules-card,
#mw-rules .mw-rules-modal {
  position: relative;
  z-index: 1;
  width: min(720px, 96vw);
  background: #fff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  overflow: hidden;
  font-family: system-ui, -apple-system, "Noto Sans TC", Arial, sans-serif;
}

#mw-rules .mw-rules-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fbfdff, #f4f7fb);
  border-bottom: 1px solid #e8eef7;
}

#mw-rules .mw-rules-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 900;
  color: var(--mw-navy);
}

#mw-rules .mw-rules-title i {
  font-size: 18px;
  color: var(--mw-navy);
}

#mw-rules .mw-rules-x {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, .12);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(2, 6, 23, .10);
  transition: transform .12s ease, box-shadow .12s ease;
}

#mw-rules .mw-rules-x:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(2, 6, 23, .14);
}

#mw-rules .mw-rules-x:active {
  transform: scale(.98);
}

#mw-rules .mw-rules-bd {
  padding: 16px 16px 14px;
  font-size: 14px;
  line-height: 1.75;
}

#mw-rules .mw-rules-box,
#mw-rules .mw-rules-warn {
  margin: 10px 0;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, .08);
}

#mw-rules .mw-rules-box.ok {
  background: var(--mw-ok-bg);
  border-color: var(--mw-ok-bd);
}

#mw-rules .mw-rules-box.no {
  background: var(--mw-no-bg);
  border-color: var(--mw-no-bd);
}

#mw-rules .mw-rules-warn {
  background: var(--mw-warn-bg);
  border-color: var(--mw-warn-bd);
}

#mw-rules .mw-rules-ft {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid #eef2f7;
  background: #fff;
}

#mw-rules .mw-rbtn,
#mw-rules .mw-rules-btn {
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #fff;
  cursor: pointer;
  user-select: none;
  font-weight: 900;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease, border-color .12s ease;
}

#mw-rules .mw-rbtn:active,
#mw-rules .mw-rules-btn:active {
  transform: scale(.99);
}

#mw-rules .mw-rbtn.ghost,
#mw-rules .mw-rules-btn.ghost {
  background: #f3f4f6;
  color: #0f172a;
  border-color: rgba(15, 23, 42, .10);
}

#mw-rules .mw-rbtn.ghost:hover,
#mw-rules .mw-rules-btn.ghost:hover {
  background: #eaeef5;
  transform: translateY(-1px);
}

/* Primary/OK (NAVY pill + YELLOW hover) */
#mw-rules .mw-rbtn.primary,
#mw-rules .mw-rules-btn.ok {
  background: var(--mw-navy);
  color: #fff;
  box-shadow: 0 12px 26px rgba(11, 42, 94, .22);
}

#mw-rules .mw-rbtn.primary:hover,
#mw-rules .mw-rules-btn.ok:hover {
  background: var(--mw-yellow);
  color: var(--mw-deep);
  box-shadow: 0 14px 32px rgba(255, 203, 5, .30);
  transform: translateY(-1px);
}

/* Mobile: stack + bigger buttons (ONE @media ONLY) */
@media (max-width: 520px) {
  #mw-rules .mw-rules-ft {
    flex-direction: column;
    align-items: stretch;
  }
  #mw-rules .mw-rbtn,
  #mw-rules .mw-rules-btn {
    width: 100%;
    min-height: 56px;
    padding: 14px 22px;
    line-height: 1.2;
    font-size: 16px;
  }
  #mw-rules .mw-rbtn.primary,
  #mw-rules .mw-rules-btn.ok {
    min-height: 60px;
    font-size: 17px;
  }
}

/* ===== FORCE LIGHTBOX PREVIEW ARROWS (DESKTOP INSIDE) ===== */

/* Lightbox overlay stays fullscreen */
#mw-wall .mw-light,
#mw-wall-app .mw-light {
  position: fixed;
}

/*
  Your arrows are likely NOT inside .lb-stage in HTML,
  so absolute positioning uses the fullscreen overlay.
  We position arrows using viewport center, matching stage max-width (94vw).
*/

/* Arrow base */
#mw-wall .mw-light .lb-arrow,
#mw-wall-app .mw-light .lb-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(0, 0, 0, .18);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1006;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Desktop: place arrows near the image (stage max-width = 94vw => half = 47vw)
   Use max() so it never goes off-screen on small widths. */
#mw-wall .mw-light .lb-arrow.prev,
#mw-wall-app .mw-light .lb-arrow.prev {
  left: max(12px, calc(50% - min(47vw, 720px) + 12px));
}

#mw-wall .mw-light .lb-arrow.next,
#mw-wall-app .mw-light .lb-arrow.next {
  right: max(12px, calc(50% - min(47vw, 720px) + 12px));
}

/* Arrow icon */
#mw-wall .mw-light .lb-arrow i,
#mw-wall-app .mw-light .lb-arrow i {
  font-size: 18px;
  color: #0f172a;
}

/* Hover polish */
@media (hover: hover) {
  #mw-wall .mw-light .lb-arrow:hover,
  #mw-wall-app .mw-light .lb-arrow:hover {
    transform: translateY(-50%) scale(1.08);
  }
}



/* =========================
   MOBILE: hide carousel arrows until user taps image
   ========================= */

/* default: on mobile, arrows hidden */
@media (max-width: 768px) {
  #mw-wall .mw-arrow,
  #mw-wall-app .mw-arrow {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(.98);
    transition: opacity .18s ease, transform .18s ease;
  }

  /* when user taps, we add .mw-show-nav to the media block */
  #mw-wall .mw-media.mw-show-nav .mw-arrow,
  #mw-wall-app .mw-media.mw-show-nav .mw-arrow {
    opacity: .96 !important;
    pointer-events: auto !important;
    transform: scale(1);
  }
}

/* Mobile: you can still push the RIGHT arrow a bit outward if you want */
@media (max-width: 768px) {
  #mw-wall .mw-light .lb-arrow.prev,
  #mw-wall-app .mw-light .lb-arrow.prev {
    left: 10px;
  }
  #mw-wall .mw-light .lb-arrow.next,
  #mw-wall-app .mw-light .lb-arrow.next {
    right: -3px; /* outside a bit like your old behavior */
  }
}







@media (max-width: 768px) {
  #mw-wall .mw-actions,
  #mw-wall-app .mw-actions {
    display: flex;
    justify-content: center; /* Center buttons horizontally */
    gap: 1px; /* Adjust gap between buttons (this ensures even spacing) */
    padding: 6px 12px; /* Adjust padding as needed */
  }

  #mw-wall .mw-side,
  #mw-wall-app .mw-side {
    display: flex;
    gap: 1px; /* Ensure even gap between the buttons */
  }

  #mw-wall .mw-puck,
  #mw-wall-app .mw-puck {
    width: auto; /* Allow buttons to adjust based on content */
  }
}






/* =========================
   Hide comments' edit button
   ========================= */
.mw-cmt-actions .edit-btn {
  display: none !important;
}
