/* ===== WeChat message thinking popover ===== */
.msg-thinking-popover {
  position: fixed;
  z-index: 4200;
  min-width: 180px;
  max-width: min(260px, calc(100vw - 24px));
  padding: 10px 12px 11px;
  box-sizing: border-box;
  color: rgba(22, 22, 24, .92);
  background: rgba(248, 248, 250, .62);
  border: .5px solid rgba(255, 255, 255, .74);
  border-radius: 14px;
  box-shadow: 0 16px 38px rgba(17, 17, 19, .18), inset 0 1px 0 rgba(255, 255, 255, .42);
  backdrop-filter: blur(24px) saturate(1.18);
  -webkit-backdrop-filter: blur(24px) saturate(1.18);
  animation: thinkingPopoverIn 170ms cubic-bezier(.22, .72, .22, 1) both;
}

.thinking-popover-title {
  margin-bottom: 5px;
  color: rgba(70, 70, 76, .68);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
}

.msg-thinking-popover p {
  margin: 0;
  color: inherit;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.msg-thinking-popover.is-empty p {
  color: rgba(88, 88, 94, .7);
}

@keyframes thinkingPopoverIn {
  from { opacity: 0; transform: translateY(4px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

[data-theme="dark"] .msg-thinking-popover {
  color: rgba(245, 245, 247, .94);
  background: rgba(33, 33, 37, .64);
  border-color: rgba(255, 255, 255, .12);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .08);
}

[data-theme="dark"] .thinking-popover-title { color: rgba(235, 235, 245, .58); }
[data-theme="dark"] .msg-thinking-popover.is-empty p { color: rgba(235, 235, 245, .62); }

[data-reduce-motion="true"] .msg-thinking-popover,
[data-performance-mode="true"] .msg-thinking-popover { animation: none; }

/* ===== Group detail settings sheet scroll repair ===== */
.group-detail-overlay {
  align-items: flex-end;
  padding: 0 10px;
}

.group-detail-sheet {
  position: relative;
  width: min(100%, 390px);
  max-height: min(88dvh, calc(100% - 18px)) !important;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  padding: 20px 16px max(14px, env(safe-area-inset-bottom, 0px));
}

.group-detail-sheet .sheet-handle,
.group-detail-sheet .sheet-title {
  flex: 0 0 auto;
}

.group-detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--app-subtext);
  background: rgba(255,255,255,.62);
  font-size: 22px;
  line-height: 1;
}

.group-detail-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 6px;
}

.group-detail-form .btn-row {
  position: sticky;
  bottom: 0;
  margin-top: 12px;
  padding-top: 10px;
  background: linear-gradient(180deg, transparent, var(--frost) 28%);
}

[data-theme="dark"] .group-detail-close {
  background: rgba(255,255,255,.12);
}

@media (max-width: 370px), (max-height: 650px) {
  .group-detail-overlay { padding-left: 8px; padding-right: 8px; }
  .group-detail-sheet {
    max-height: min(90dvh, calc(100% - 12px)) !important;
    padding-left: 12px;
    padding-right: 12px;
  }
}
