:root {
  color-scheme: light;
  --bg: #ededed;
  --surface: #ffffff;
  --surface-soft: #f7f7f7;
  --line: #e5e5e5;
  --text: #191919;
  --muted: #888888;
  --faint: #b2b2b2;
  --green: #07c160;
  --green-dark: #06ad56;
  --green-soft: #e8f8ef;
  --danger: #fa5151;
  --orange: #fa9d3b;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-viewport-height: 100dvh;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}

body.app-mode {
  height: var(--app-viewport-height);
  overflow: hidden;
}

body.app-mode #app {
  height: 100%;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

input,
textarea {
  width: 100%;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  padding: 12px;
  color: var(--text);
  background: var(--surface);
  outline: none;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--green);
}

label {
  color: var(--text);
}

svg {
  display: block;
}

.shell {
  min-height: var(--app-viewport-height);
}

.app-shell {
  width: 100%;
  height: var(--app-viewport-height);
  min-height: 0;
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 0;
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr) calc(64px + var(--safe-bottom));
  overflow: hidden;
  background: var(--bg);
}

.app-topbar {
  position: relative;
  z-index: 20;
  height: 54px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  align-items: center;
  border-bottom: 1px solid #dcdcdc;
  background: rgba(247, 247, 247, 0.98);
}

.app-topbar h1 {
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 650;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-side {
  height: 54px;
  display: flex;
  align-items: center;
}

.topbar-right {
  justify-content: flex-end;
}

.topbar-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  padding: 0;
}

.topbar-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

.topbar-brand {
  width: 30px;
  height: 30px;
  margin-right: 13px;
  border-radius: 7px;
}

.app-content {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.app-initial-loading {
  min-height: 100%;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}

.app-initial-loading-spinner {
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  border: 3px solid #d7ecef;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: app-initial-loading-spin 800ms linear infinite;
}

.app-initial-loading strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
}

.app-initial-loading small {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
}

@keyframes app-initial-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-initial-loading-spinner {
    animation: none;
  }
}

.tabs {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 30;
  width: 100%;
  min-height: calc(64px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid #d6d6d6;
  background: rgba(247, 247, 247, 0.98);
  transform: none;
}

.tabs button {
  min-width: 0;
  height: 64px;
  padding: 7px 2px 5px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  color: #555;
  font-size: 11px;
  line-height: 1;
}

.tabs button.active {
  color: var(--green);
}

.tab-icon,
.tab-icon svg {
  width: 26px;
  height: 26px;
}

.tab-icon {
  position: relative;
}

.tab-unread-badge {
  position: absolute;
  top: -8px;
  right: -12px;
  z-index: 2;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 9px;
  color: #fff;
  background: #f04444;
  box-shadow: 0 2px 0 rgba(180, 32, 32, 0.2);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.tab-unread-badge.hidden {
  display: none;
}

.tab-icon svg {
  stroke: currentColor;
}

.wechat-section,
.wechat-list {
  margin: 12px 0;
  background: var(--surface);
}

.wechat-list {
  overflow: hidden;
}

.wechat-row {
  position: relative;
  width: 100%;
  min-height: 64px;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  background: var(--surface);
  text-align: left;
}

.wechat-row::after {
  content: "";
  position: absolute;
  left: 76px;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--line);
}

.wechat-row:last-child::after {
  display: none;
}

.wechat-row > svg,
.settings-row > svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  stroke: var(--faint);
}

.row-main {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}

.row-main strong {
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-main small,
.row-sub {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-title,
.row-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.row-title-line {
  justify-content: space-between;
}

.row-title-line time,
.wechat-row time,
.moment-meta time {
  color: var(--faint);
  font-size: 12px;
  font-weight: 400;
}

.avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  color: #fff;
  background: #5bbad5;
  font-size: 18px;
  font-weight: 650;
}

.avatar svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
}

.avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.group-avatar {
  background: #576b95;
}

.bottle-avatar {
  background: var(--green);
}

.primary-button,
.outline-button,
.button-link {
  min-height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.primary-button,
.button-link {
  color: #fff;
  background: var(--green);
}

.primary-button:active,
.button-link:active {
  background: var(--green-dark);
}

.outline-button {
  border: 1px solid var(--green);
  color: var(--green);
  background: #fff;
}

.small-green-button {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 5px;
  color: #fff;
  background: var(--green);
  font-size: 13px;
}

.text-command {
  min-height: 32px;
  padding: 0 7px;
  color: #576b95;
  font-size: 14px;
}

.danger,
button.danger {
  color: #fff;
  background: var(--danger);
}

.ghost,
button.ghost,
.secondary,
button.secondary {
  color: #576b95;
  background: #f0f0f0;
}

.page-actions {
  display: grid;
  gap: 12px;
  padding: 0 16px 12px;
}

.padded-actions {
  padding-top: 16px;
}

.quota-strip {
  min-height: 52px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.quota-strip > div {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #555;
  font-size: 14px;
}

.quota-strip > div + div {
  border-left: 1px solid var(--line);
}

.quota-strip svg {
  width: 20px;
  height: 20px;
  stroke: var(--green);
}

.quota-strip strong {
  color: var(--green);
  font-size: 19px;
  font-weight: 550;
}

.official-contact-notice {
  min-height: 64px;
  padding: 11px 16px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #f1d7a8;
  background: #fff8e8;
}

.official-contact-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #b7791f;
  background: #ffedbd;
}

.official-contact-icon svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
}

.official-contact-notice > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.official-contact-notice strong {
  font-size: 14px;
}

.official-contact-notice small {
  color: #6d562c;
  font-size: 12px;
  line-height: 1.45;
}

.official-contact-notice b {
  color: #c4472d;
  font-weight: 650;
}

.bottle-composer {
  padding: 16px;
}

.bottle-composer textarea {
  min-height: 138px;
  border: 0;
  padding: 4px 0 12px;
  font-size: 17px;
}

.media-toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.media-action {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #555;
  cursor: pointer;
}

.media-action svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
}

.media-action span {
  min-width: 0;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-toggle {
  flex: 0 0 auto;
  min-height: 44px;
}

.picked-bottle-section {
  min-height: 160px;
  padding: 16px;
}

.bottle-empty {
  min-height: 130px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
}

.bottle-empty img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  opacity: 0.7;
}

.bottle-source {
  margin-bottom: 10px;
  color: #576b95;
  font-weight: 500;
}

.bottle-text {
  white-space: pre-wrap;
  line-height: 1.65;
}

.inline-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.media-preview,
.moment-media {
  width: 100%;
  max-height: 360px;
  margin-top: 10px;
  object-fit: cover;
  border-radius: 4px;
}

.subnav {
  height: 46px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.subnav button {
  position: relative;
  font-size: 15px;
}

.subnav button.active {
  color: var(--green);
  font-weight: 600;
}

.subnav button.active::after {
  content: "";
  position: absolute;
  left: 24%;
  right: 24%;
  bottom: 0;
  height: 2px;
  background: var(--green);
}

.contact-shortcuts {
  margin-top: 12px;
}

.shortcut-icon,
.settings-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #fff;
}

.shortcut-icon.orange {
  background: var(--orange);
}

.shortcut-icon.green {
  background: var(--green);
}

.shortcut-icon svg {
  width: 25px;
  height: 25px;
  stroke: currentColor;
}

.count-dot {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--danger);
  font-size: 11px;
}

.contact-search-area {
  padding: 8px 12px;
  background: var(--bg);
}

.search-line {
  height: 42px;
  padding-left: 10px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border-radius: 6px;
  background: #fff;
}

.search-line svg {
  width: 19px;
  height: 19px;
  stroke: var(--muted);
}

.search-line input {
  height: 42px;
  border: 0;
  padding: 0;
}

.search-line button {
  height: 42px;
  padding: 0 12px;
  color: var(--green);
}

.search-results {
  margin: 8px -12px -8px;
}

.section-index {
  min-height: 34px;
  padding: 10px 16px 6px;
  color: var(--muted);
  font-size: 13px;
}

.conversation-list {
  margin-top: 0;
}

.conversation-row {
  min-height: 72px;
}

.conversation-row .row-main {
  gap: 5px;
}

.empty,
.empty-state {
  color: var(--muted);
  text-align: center;
}

.empty {
  padding: 28px 16px;
}

.empty-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
}

.empty-state > svg {
  width: 52px;
  height: 52px;
  stroke: #c8c8c8;
}

.empty-state div {
  color: #555;
  font-size: 16px;
}

.empty-state span {
  font-size: 13px;
}

.chat-screen {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.message-list {
  min-height: 220px;
  padding: 18px 14px;
  display: grid;
  align-content: start;
  gap: 14px;
  overflow-y: auto;
  background: var(--bg);
}

.full-chat-list {
  min-height: 0;
  max-height: none;
}

.message-time {
  justify-self: center;
  padding: 3px 8px;
  border-radius: 4px;
  color: #fff;
  background: rgba(0, 0, 0, 0.16);
  font-size: 11px;
  line-height: 1.4;
}

.message-row {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: flex-start;
  gap: 9px;
}

.message-row.mine {
  grid-template-columns: minmax(0, 1fr) 38px;
}

.chat-message-avatar {
  width: 38px;
  height: 38px;
  grid-column: 1;
  grid-row: 1;
  border-radius: 5px;
  font-size: 15px;
  position: relative;
  z-index: 1;
}

.message-stack {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  max-width: 78%;
  display: grid;
  gap: 4px;
  justify-self: start;
  justify-items: start;
}

.message-stack.has-media {
  width: min(260px, 100%);
  max-width: 100%;
}

.message-row.mine .chat-message-avatar {
  grid-column: 2;
}

.message-row.mine .message-stack {
  grid-column: 1;
  justify-self: end;
  justify-items: end;
}

.message-sender {
  padding: 0 3px;
  color: var(--muted);
  font-size: 11px;
}

.message {
  position: relative;
  padding: 10px 12px;
  border-radius: 5px;
  background: #fff;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.message:not(.media-only)::before {
  content: "";
  position: absolute;
  top: 13px;
  left: -6px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-right: 7px solid #fff;
  border-bottom: 5px solid transparent;
}

.message.media-only {
  padding: 4px;
  background: transparent;
}

.message-text {
  white-space: pre-wrap;
}

.chat-message-media {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 320px;
  border-radius: 4px;
  object-fit: cover;
  background: #111;
  opacity: 0;
  transition: opacity 150ms ease-out;
}

.chat-message-media.is-loaded {
  opacity: 1;
}

.chat-media-open {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #e2e2e2;
}

.chat-image-thumb {
  aspect-ratio: 4 / 3;
}

.chat-image-thumb .chat-message-media {
  width: 100%;
  height: 100%;
}

.chat-video-thumb video {
  pointer-events: none;
}

.chat-video-thumb {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  background: #222;
}

.chat-video-thumb .chat-message-media {
  width: 100%;
  height: 100%;
}

.chat-video-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #fff;
  background: #555;
}

.chat-video-placeholder svg {
  width: 44px;
  height: 44px;
  stroke: currentColor;
}

.chat-media-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.18);
}

.chat-media-play svg {
  width: 54px;
  height: 54px;
  fill: rgba(0, 0, 0, 0.35);
  stroke: #fff;
}

.chat-media-kind {
  position: absolute;
  right: 7px;
  bottom: 6px;
  padding: 2px 5px;
  border-radius: 3px;
  color: #fff;
  background: rgba(0, 0, 0, 0.52);
  font-size: 11px;
  line-height: 1.3;
}

.message:not(.media-only) .chat-message-media {
  margin-bottom: 8px;
}

.chat-media-viewer-open {
  overflow: hidden;
}

.chat-media-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: calc(54px + env(safe-area-inset-top, 0px)) minmax(0, 1fr);
  color: #fff;
  background: #000;
}

.chat-media-viewer-bar {
  padding-top: env(safe-area-inset-top, 0px);
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  align-items: center;
  background: rgba(18, 18, 18, 0.96);
}

.chat-media-viewer-bar strong {
  text-align: center;
}

.chat-media-viewer-bar button {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff;
}

.chat-media-viewer-bar svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
}

.chat-media-viewer-stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
}

.chat-media-viewer-content {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

img.chat-media-viewer-content {
  cursor: zoom-out;
}

video.chat-media-viewer-content {
  width: 100%;
  height: 100%;
  background: #000;
}

.message-row.mine .message {
  background: #95ec69;
}

.message-row.mine .message:not(.media-only)::before {
  right: -6px;
  left: auto;
  border-right: 0;
  border-left: 7px solid #95ec69;
}

.message-row.mine .message.media-only {
  background: transparent;
}

.chat-compose-shell {
  border-top: 1px solid #d6d6d6;
  background: #f7f7f7;
}

.chat-composer {
  min-height: 56px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px 40px;
  align-items: center;
  gap: 8px;
}

.chat-input-slot {
  min-width: 0;
  height: 40px;
}

.chat-input-slot > input {
  height: 40px;
  min-height: 40px;
  min-height: 40px;
  border: 0;
}

.chat-voice-hold {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d8d8d8;
  border-radius: 5px;
  color: #333;
  background: #fff;
  font-weight: 550;
  user-select: none;
  touch-action: none;
}

.chat-voice-hold.recording {
  color: #fff;
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.chat-tool {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #444;
  cursor: pointer;
}

.chat-tool svg {
  width: 27px;
  height: 27px;
  stroke: currentColor;
}

.chat-send {
  width: 58px;
  min-height: 40px;
  margin-left: -18px;
  padding: 0 9px;
  border-radius: 5px;
  color: #fff;
  background: var(--green);
}

.chat-plus-panel {
  min-height: 146px;
  padding: 18px 18px 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
  gap: 14px 10px;
  border-bottom: 1px solid var(--line);
  background: #f7f7f7;
}

.chat-plus-item {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #555;
  cursor: pointer;
}

.chat-plus-item > span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  color: #333;
  background: #fff;
}

.chat-plus-item svg {
  width: 27px;
  height: 27px;
  stroke: currentColor;
}

.chat-plus-item small {
  font-size: 12px;
  white-space: nowrap;
}

.chat-send:disabled {
  color: #aaa;
  background: #e3e3e3;
  opacity: 1;
}

.emoji-picker {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.emoji-picker button {
  aspect-ratio: 1;
  min-width: 0;
  padding: 2px;
  font-size: 24px;
  line-height: 1;
}

.chat-file-preview {
  min-height: 96px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.chat-file-preview > img,
.chat-video-preview,
.chat-video-preview video {
  width: 112px;
  height: 76px;
  border-radius: 4px;
  object-fit: cover;
  background: #111;
}

.chat-audio-preview {
  width: 112px;
  height: 76px;
  padding: 8px;
  display: grid;
  place-items: stretch;
  border-radius: 4px;
  color: var(--green-dark);
  background: var(--green-soft);
}

.chat-audio-preview > button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: inherit;
}

.chat-audio-preview > button.playing {
  background: rgba(7, 193, 96, 0.08);
}

.chat-audio-preview svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

.chat-audio-preview span {
  font-size: 11px;
}

.chat-voice-message {
  min-width: 132px;
  min-height: 36px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #333;
}

.chat-voice-message svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
}

.chat-voice-message.playing svg {
  color: var(--green-dark);
}

.chat-call-record {
  min-width: 172px;
  padding: 4px 2px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.chat-call-record > svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
}

.chat-call-record > span {
  display: grid;
  gap: 2px;
}

.chat-call-record strong {
  font-size: 14px;
  font-weight: 550;
}

.chat-call-record small {
  color: #777;
  font-size: 11px;
}

.chat-video-preview {
  position: relative;
  overflow: hidden;
}

.chat-video-preview span {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 2px 5px;
  border-radius: 3px;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  font-size: 10px;
  pointer-events: none;
}

.chat-file-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.chat-file-meta strong {
  font-size: 14px;
  font-weight: 500;
}

.chat-file-meta span {
  min-width: 0;
  overflow: hidden;
  color: #555;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-file-meta small {
  color: var(--muted);
  font-size: 11px;
}

.chat-file-preview > .chat-file-remove {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
}

.chat-file-preview > .chat-file-remove svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
}

.group-create-section {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-heading span {
  color: var(--muted);
  font-size: 13px;
}

.check-list {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.check-row {
  min-height: 46px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
}

.check-row input,
.toggle-row input {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  accent-color: var(--green);
}

.compact-checks {
  max-height: 180px;
  overflow-y: auto;
}

.badge {
  min-height: 20px;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 500;
}

.danger-badge {
  color: #fff;
  background: var(--danger);
}

.admin-badge {
  color: #576b95;
  background: #edf0f7;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

.compact-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.group-manage-section {
  padding: 16px;
}

.panel-title {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-title h2,
.panel-title h3 {
  margin: 0;
  font-size: 17px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px 8px;
}

.member {
  position: relative;
  min-width: 0;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

.member .avatar {
  margin: 0 auto 5px;
}

.member-name {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-role {
  margin-top: 2px;
}

.member-remove {
  position: absolute;
  top: -5px;
  right: 1px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--danger);
  font-size: 16px;
}

.member-add {
  min-height: 68px;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
  font-size: 25px;
}

.group-admin-bar {
  margin: 0 -16px 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fffbea;
}

.group-admin-bar span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.moments-cover {
  position: relative;
  height: 236px;
  margin-bottom: 42px;
  background: #777;
}

.discover-content {
  overflow-anchor: none;
  scroll-behavior: auto;
}

.discover-visibility-note {
  min-height: 62px;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.discover-visibility-note > span {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--green);
  background: var(--green-soft);
}

.discover-visibility-note svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.discover-visibility-note div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.discover-visibility-note strong {
  font-size: 14px;
  font-weight: 600;
}

.discover-visibility-note small {
  color: var(--muted);
  font-size: 12px;
}

.moments-segmented {
  position: sticky;
  top: 0;
  z-index: 8;
  height: 44px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.moments-segmented button {
  position: relative;
  min-width: 0;
  font-size: 14px;
}

.moments-segmented button.active {
  color: var(--green);
  font-weight: 600;
}

.moments-segmented button.active::after {
  content: "";
  position: absolute;
  left: 36%;
  right: 36%;
  bottom: 0;
  height: 2px;
  background: var(--green);
}

.moments-cover > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.moments-cover-edit {
  position: absolute;
  right: 16px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: rgba(0, 0, 0, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  cursor: pointer;
}

.moments-cover-edit svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

.moments-profile {
  position: absolute;
  right: 18px;
  bottom: -34px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.large-avatar {
  width: 72px;
  height: 72px;
  flex-basis: 72px;
  border: 3px solid #fff;
  font-size: 25px;
  text-shadow: none;
}

.moment-composer {
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.moment-compose-main {
  min-width: 0;
  flex: 1;
}

.moment-compose-heading {
  min-height: 28px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.moment-compose-heading strong {
  font-size: 15px;
  font-weight: 600;
}

.moment-compose-heading span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.moment-compose-main textarea {
  min-height: 76px;
  border: 0;
  padding: 4px 0;
}

.moment-topic-field {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #f0f0f0;
}

.moment-topic-field > span {
  color: var(--muted);
  font-size: 13px;
}

.moment-topic-field select {
  min-width: 92px;
  height: 32px;
  margin-left: auto;
  border: 0;
  border-radius: 4px;
  padding: 0 26px 0 9px;
  color: #576b95;
  background: #f5f5f5;
  font: inherit;
  font-size: 13px;
  outline: 0;
}

.moment-compose-actions {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.compact-media-action {
  max-width: calc(100% - 70px);
  color: #576b95;
  font-size: 13px;
}

.moments-feed {
  background: #fff;
}

.moment-item {
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.moment-main {
  min-width: 0;
  flex: 1;
}

.moment-author-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.moment-author-line strong,
.moment-comment strong {
  color: #576b95;
  font-weight: 600;
}

.moment-author-details {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.moment-topic {
  color: var(--green-dark);
  font-size: 12px;
}

.moment-delete {
  padding: 3px 0;
  color: var(--muted);
  font-size: 12px;
}

.moment-text {
  margin-top: 6px;
  white-space: pre-wrap;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.moment-media {
  max-width: 360px;
  aspect-ratio: 4 / 3;
}

.moment-media-grid {
  width: min(100%, 360px);
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.moment-media-grid.count-1 { grid-template-columns: minmax(0, 1fr); }
.moment-media-grid.count-2,
.moment-media-grid.count-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.moment-media-grid .moment-media-wrap { width: 100%; margin: 0; }
.moment-media-grid .moment-media { display: block; width: 100%; max-width: none; aspect-ratio: 1; margin: 0; object-fit: cover; background: #111; }
.moment-media-grid.count-1 .moment-media { aspect-ratio: 4 / 3; object-fit: contain; }

.moment-media-wrap {
  position: relative;
  width: min(100%, 360px);
  margin-top: 10px;
}

.moment-media-wrap .moment-media {
  display: block;
  max-width: 100%;
  margin-top: 0;
  cursor: zoom-in;
  touch-action: manipulation;
}

.moment-like-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.55);
}

.moment-like-burst svg {
  width: 38px;
  height: 38px;
  fill: #fa5151;
  stroke: #fff;
}

.moment-media-wrap.show-like-burst .moment-like-burst {
  animation: moment-like-burst 650ms ease-out;
}

@keyframes moment-like-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.45); }
  28% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.18); }
}

.moment-meta {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.moment-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.moment-actions button {
  min-height: 34px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #576b95;
  font-size: 12px;
}

.moment-actions button.active {
  color: var(--green);
}

.moment-actions svg,
.moment-likes svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
}

.moment-reactions {
  padding: 7px 9px;
  background: #f5f5f5;
  font-size: 13px;
  line-height: 1.55;
}

.moment-comment { width: 100%; padding: 2px 0; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; line-height: inherit; }
.moment-reaction-picker { position: fixed; z-index: 1200; display: grid; grid-template-columns: repeat(6, 42px); padding: 6px; border: 1px solid #d7d7d7; border-radius: 6px; background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .2); }
.moment-reaction-picker button { width: 42px; height: 42px; border: 0; background: transparent; font-size: 24px; }

.moment-likes {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #576b95;
}

.moments-empty {
  min-height: 220px;
}

.moment-item.is-linked {
  animation: moment-linked-highlight 3.2s ease-out;
}

@keyframes moment-linked-highlight {
  0%, 42% { background: #e8f8ef; }
  100% { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  .moment-media-wrap.show-like-burst .moment-like-burst,
  .moment-item.is-linked {
    animation-duration: 1ms;
  }
}

.profile-section {
  margin-top: 12px;
}

.profile-row {
  width: 100%;
  min-height: 112px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  background: var(--surface);
  text-align: left;
}

.profile-avatar {
  width: 68px;
  height: 68px;
  flex-basis: 68px;
  font-size: 25px;
}

.profile-row .row-main strong {
  font-size: 21px;
  font-weight: 600;
}

.profile-row > svg {
  width: 19px;
  height: 19px;
  stroke: var(--faint);
}

.profile-edit-avatar-row {
  min-height: 88px;
}

.profile-edit-avatar {
  width: 64px;
  height: 64px;
  flex-basis: 64px;
  font-size: 24px;
}

.profile-form-row {
  min-height: 58px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.profile-form-row:last-child {
  border-bottom: 0;
}

.profile-form-row span {
  font-size: 16px;
}

.profile-form-row input {
  min-width: 0;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: right;
}

.profile-form-row input[readonly] {
  color: var(--muted);
}

.profile-phone-note {
  padding: 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.field-hint {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.register-invite-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 8px;
}

.register-invite-link-row button {
  min-height: 46px;
  padding: 0 10px;
  border-radius: 6px;
  color: #fff;
  background: var(--green);
  font-size: 14px;
  white-space: nowrap;
}

.register-invite-link-row button:disabled {
  color: #437b5a;
  background: #dcefe4;
  opacity: 1;
}

.readonly-phone {
  color: var(--muted);
  background: #f7f7f7;
}

.settings-group {
  margin-top: 12px;
}

.settings-icon {
  color: #576b95;
  background: transparent;
}

.settings-icon svg {
  width: 25px;
  height: 25px;
  stroke: currentColor;
}

.settings-row::after {
  left: 68px;
}

.logout-row {
  min-height: 54px;
  justify-content: center;
  color: var(--danger);
  text-align: center;
}

.logout-row::after {
  display: none;
}

.toggle-list .wechat-row {
  min-height: 76px;
}

.toggle-row {
  justify-content: space-between;
}

.notice-list {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.notice-item {
  padding: 14px;
  border-radius: 6px;
  background: #fff;
}

.notice-reason {
  margin: 8px 0 5px;
  font-weight: 600;
}

.notice-message {
  color: #555;
  line-height: 1.5;
}

.danger-text {
  color: var(--danger) !important;
}

.hidden {
  display: none !important;
}

.incoming-call-prompt,
.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  min-height: var(--app-viewport-height);
  color: #fff;
  background: #171a1d;
}

.incoming-call-prompt {
  padding: calc(76px + env(safe-area-inset-top)) 28px calc(48px + env(safe-area-inset-bottom));
  display: grid;
  justify-items: center;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #202428;
}

.incoming-call-identity {
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.incoming-call-avatar {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  font-size: 34px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.25);
}

.incoming-call-identity > strong {
  max-width: min(320px, 84vw);
  overflow: hidden;
  font-size: 25px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incoming-call-identity > span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
}

.incoming-call-actions {
  width: min(294px, 100%);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

.call-action,
.call-control {
  position: relative;
  width: 74px;
  display: grid;
  justify-items: center;
  gap: 9px;
  color: #fff;
  touch-action: manipulation;
}

.call-action-icon,
.call-control-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  transition: transform 120ms ease, background 120ms ease;
}

.call-action:active .call-action-icon,
.call-control:active .call-control-icon {
  transform: scale(0.94);
}

.call-action svg,
.call-control svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
}

.call-action.decline .call-action-icon,
.call-control.hangup .call-control-icon {
  background: #fa5151;
}

.call-action.accept .call-action-icon {
  background: var(--green);
}

.call-action.decline svg,
.call-control.hangup svg {
  transform: rotate(135deg);
}

.call-action small,
.call-control small {
  min-height: 18px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  white-space: nowrap;
}

.call-overlay {
  padding: calc(38px + env(safe-area-inset-top)) 18px calc(25px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 18px;
  overflow: hidden;
}

.call-header {
  position: relative;
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: 5px;
}

.call-header strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 21px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-header span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.audio-call {
  background: #24292d;
}

.audio-call-identity {
  min-height: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 13px;
}

.audio-call-avatar {
  width: 108px;
  height: 108px;
  border-radius: 11px;
  font-size: 38px;
  box-shadow: 0 15px 38px rgba(0, 0, 0, 0.24);
}

.audio-call-identity strong {
  max-width: min(320px, 82vw);
  overflow: hidden;
  font-size: 25px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-call-identity > span:last-child {
  color: rgba(255, 255, 255, 0.64);
  font-size: 14px;
}

.audio-call .call-participant-grid {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.call-participant {
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.call-media-slot {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.call-media-slot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}

.video-call {
  display: block;
  padding: 0;
  background: #0d0f10;
}

.video-call .call-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  padding: calc(24px + env(safe-area-inset-top)) 118px 56px 18px;
  justify-items: start;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.62), transparent);
}

.video-call .call-header strong {
  font-size: 18px;
}

.video-call .call-participant-grid {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.video-call .call-participant.primary-remote {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #171a1c;
}

.video-call .call-participant.secondary-remote {
  position: absolute;
  left: 10px;
  top: calc(90px + (var(--remote-index) * 102px));
  z-index: 4;
  width: 70px;
  height: 94px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  background: #222629;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.3);
}

.video-call .call-participant.is-local {
  position: absolute;
  top: calc(20px + env(safe-area-inset-top));
  right: 12px;
  z-index: 8;
  width: 96px;
  height: 136px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 6px;
  background: #24282b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
  transition: width 160ms ease, height 160ms ease;
  touch-action: none;
  user-select: none;
}

.video-call .call-participant.is-local.is-expanded {
  width: min(45vw, 210px);
  height: min(60vw, 294px);
}

.video-call.front-camera .call-participant.is-local video {
  transform: scaleX(-1);
}

.video-call .call-participant > strong,
.video-call .call-participant > small {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 7px;
  z-index: 2;
  overflow: hidden;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px #000;
  white-space: nowrap;
}

.video-call .call-participant > small,
.video-call .call-participant.is-local > strong,
.video-call .call-participant.primary-remote > strong {
  display: none;
}

.call-video-placeholder,
.call-avatar {
  width: 82px;
  height: 82px;
  border-radius: 9px;
  font-size: 28px;
}

.video-call .primary-remote .call-video-placeholder {
  width: 96px;
  height: 96px;
  font-size: 34px;
}

.video-call .is-local .call-video-placeholder,
.video-call .secondary-remote .call-video-placeholder {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.call-controls {
  display: flex;
  justify-content: center;
  gap: clamp(4px, 3vw, 24px);
}

.audio-call .call-controls {
  margin-top: 12px;
}

.video-call .call-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  padding: 48px 8px calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
}

.call-control-icon {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.call-control.off .call-control-icon,
.call-control.active .call-control-icon {
  color: #16191b;
  background: rgba(255, 255, 255, 0.9);
}

.call-control:disabled {
  opacity: 0.5;
}

@media (max-width: 390px) {
  .video-call .call-control,
  .video-call .call-action {
    width: 58px;
  }

  .video-call .call-control-icon {
    width: 50px;
    height: 50px;
  }

  .video-call .call-controls {
    gap: 0;
  }
}

.ringtone-settings .ringtone-option {
  min-height: 72px;
}

.ringtone-check {
  display: none;
  color: var(--green);
  font-size: 21px;
  font-weight: 700;
}

.ringtone-option.selected .ringtone-check {
  display: block;
}

.ringtone-note {
  padding: 10px 16px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.invite-landing-shell .content {
  display: grid;
  align-items: start;
}

.invite-landing-panel,
.invite-center {
  text-align: center;
}

.invite-share-icon,
.invite-center-icon {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 4px auto 14px;
  color: #fff;
  background: #07c160;
  border-radius: 8px;
}

.invite-share-icon svg,
.invite-center-icon svg {
  width: 34px;
  height: 34px;
  stroke: currentColor;
}

.invite-landing-panel h2,
.invite-center h2 {
  margin: 0 0 10px;
  font-size: 21px;
}

.invite-landing-panel p,
.invite-center p {
  margin: 0 auto 22px;
  max-width: 460px;
  color: #666;
  line-height: 1.7;
}

.invite-landing-panel .primary-button,
.invite-center .primary-button {
  width: 100%;
}

.secondary-download {
  display: flex;
  margin-top: 12px;
  background: #f2f2f2;
  color: #222;
}

.claimed-invite-result {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #d8d8d8;
  background: #f7f7f7;
  border-radius: 6px;
}

.claimed-invite-result strong {
  overflow-wrap: anywhere;
  font-size: 18px;
  color: #07a850;
}

.claimed-invite-result span,
.claimed-invite-result small {
  color: #777;
}

.claimed-invite-result button,
.invite-link-box button {
  color: #07a850;
  background: transparent;
  border: 0;
}

.invite-center {
  padding: 32px 20px 24px;
  background: #fff;
}

.invite-link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 18px 0;
  padding: 12px;
  text-align: left;
  background: #f5f5f5;
  border-radius: 6px;
}

.invite-link-box span {
  overflow: hidden;
  color: #666;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-stats {
  display: grid;
  gap: 3px;
  margin: 22px 0;
}

.invite-stats strong {
  font-size: 30px;
  color: #07c160;
}

.invite-stats span {
  color: #777;
}

.invite-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 22px 0 14px;
  border-top: 1px solid #ededed;
  border-bottom: 1px solid #ededed;
}

.invite-stat-grid > div {
  min-width: 0;
  padding: 15px 6px;
  display: grid;
  gap: 5px;
}

.invite-stat-grid > div + div {
  border-left: 1px solid #ededed;
}

.invite-stat-grid strong {
  overflow-wrap: anywhere;
  color: #111;
  font-size: 20px;
  line-height: 1.2;
}

.invite-stat-grid span {
  color: #777;
  font-size: 12px;
}

.invite-reward-line {
  min-height: 48px;
  margin-bottom: 12px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #555;
  background: #fff8e8;
  border: 1px solid #f0d49a;
  border-radius: 6px;
}

.invite-reward-line strong {
  color: #d84a21;
  font-size: 22px;
}

.invite-pending {
  margin: -2px 0 14px;
  color: #8a6420;
  font-size: 12px;
}

.invite-ranking {
  margin-top: 12px;
  background: #fff;
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
}

.invite-ranking-title {
  min-height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #ededed;
}

.invite-ranking-title strong {
  font-size: 17px;
}

.invite-ranking-title span,
.invite-ranking-note {
  color: #888;
  font-size: 12px;
}

.invite-rank-row {
  min-height: 68px;
  padding: 10px 16px;
  display: grid;
  grid-template-columns: 28px 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #ededed;
}

.invite-rank-row.current {
  background: #f0faf4;
}

.invite-rank-number {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 26px;
  color: #777;
  font-size: 14px;
  font-weight: 700;
}

.invite-rank-number.rank-1,
.invite-rank-number.rank-2,
.invite-rank-number.rank-3 {
  color: #fff;
  border-radius: 5px;
}

.invite-rank-number.rank-1 { background: #d9a317; }
.invite-rank-number.rank-2 { background: #7f8b96; }
.invite-rank-number.rank-3 { background: #a5673f; }

.invite-rank-avatar {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}

.invite-rank-main {
  min-width: 0;
  display: grid;
  gap: 4px;
  text-align: left;
}

.invite-rank-main strong,
.invite-rank-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-rank-main strong {
  font-size: 15px;
}

.invite-rank-main small {
  color: #888;
  font-size: 12px;
}

.invite-rank-reward {
  color: #d84a21;
  font-size: 14px;
}

.invite-ranking-note {
  padding: 12px 16px 16px;
  line-height: 1.55;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(82px + var(--safe-bottom));
  z-index: 50;
  max-width: min(360px, calc(100% - 32px));
  padding: 11px 16px;
  border-radius: 6px;
  color: #fff;
  background: rgba(25, 25, 25, 0.9);
  transform: translateX(-50%);
  text-align: center;
}

body.chat-input-focused .tabs {
  display: none;
}

body.chat-input-focused .app-shell {
  height: var(--app-viewport-height);
  min-height: 0;
  padding-bottom: 0;
  grid-template-rows: 54px minmax(0, 1fr);
}

body.chat-input-focused .app-content {
  min-height: 0;
}

body.chat-input-focused .chat-screen {
  height: 100%;
  min-height: 0;
}

body.chat-input-focused .toast {
  bottom: 72px;
}

/* Login, update and developer forms keep a compact flat layout. */
.hero {
  padding: 42px 24px 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.brand-icon {
  width: 62px;
  height: 62px;
  border-radius: 12px;
}

.brand-title {
  margin: 0;
  font-size: 30px;
}

.brand-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.content {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px;
}

.auth-download-panel {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-download-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.auth-download-copy strong {
  font-size: 17px;
  font-weight: 600;
}

.auth-download-copy span {
  color: var(--muted);
  font-size: 13px;
}

.auth-download-button {
  min-width: 142px;
  min-height: 46px;
  padding: 0 17px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  color: #fff;
  background: var(--green);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.auth-download-button:active {
  background: var(--green-dark);
}

.auth-download-button svg {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  stroke: currentColor;
}

.panel {
  margin: 12px 0;
  padding: 16px;
  background: #fff;
}

@media (max-width: 380px) {
  .auth-download-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-download-button {
    width: 100%;
  }
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.form-grid > button,
.form-actions button,
.panel > button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 6px;
  color: #fff;
  background: var(--green);
}

.form-actions {
  display: flex;
  gap: 10px;
}

.form-actions button {
  flex: 1;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.segmented button {
  min-height: 42px;
}

.segmented button.active {
  color: var(--green);
  border-bottom: 2px solid var(--green);
}

.link-button {
  min-height: 34px;
  padding: 0;
  color: #576b95;
}

.update-version {
  display: grid;
  gap: 8px;
}

.update-version > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.update-version span,
.update-message {
  color: var(--muted);
}

.about-version-head {
  padding: 36px 20px 28px;
  text-align: center;
}

.about-version-head img {
  width: 76px;
  height: 76px;
  border-radius: 14px;
}

.about-version-head h2 {
  margin: 14px 0 6px;
  font-size: 21px;
  font-weight: 600;
}

.about-version-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.version-detail-row {
  justify-content: space-between;
  gap: 18px;
}

.version-detail-row > span {
  flex: 0 0 auto;
  color: var(--text);
}

.version-detail-row > strong {
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  overflow-wrap: anywhere;
  text-align: right;
}

.about-version-actions {
  display: grid;
  gap: 12px;
}

.admin-user-row,
.row-item {
  min-height: 64px;
  padding: 10px 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.row-item:last-child {
  border-bottom: 0;
}

@media (max-width: 520px) {
  .app-shell {
    width: 100%;
  }

  .member-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .group-admin-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .moment-media {
    max-width: 100%;
  }

  .admin-user-row,
  .row-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .row-item > .row-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (min-width: 721px) {
  .app-shell {
    box-shadow: 0 0 0 1px #d7d7d7;
  }
}

/* v32 chat stability and feature surfaces */
#appTitle {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.15;
}

.chat-top-presence,
.conversation-preview {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-top-presence {
  color: #888;
  font-size: 11px;
  font-weight: 400;
}

.conversation-preview > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #b7b7b7;
}

.presence-dot.online { background: #20b86a; }
.presence-dot.busy { background: #ef5350; }
.presence-dot.invisible { background: #e9a92f; }
.presence-text { color: #8b8b8b; font-size: 11px; }
.presence-text.group { white-space: nowrap; }

.conversation-row {
  position: relative;
}

.unread-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: #fff;
  background: #fa5151;
  font-size: 11px;
  line-height: 1;
}

[data-profile-user] {
  cursor: pointer;
  touch-action: manipulation;
}

.emoji-picker {
  position: relative;
  width: 100%;
  max-height: min(44vh, 360px);
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  display: block;
  overflow: hidden;
  background: #f5f5f5;
  border-top: 1px solid #dedede;
}

.emoji-picker.hidden { display: none; }

.emoji-search-line {
  height: 34px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 6px;
  background: #fff;
}

.emoji-search-line svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke: #888;
}

.emoji-search-line input {
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}

.emoji-pack-tabs {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

.emoji-pack-tabs::-webkit-scrollbar { display: none; }

.emoji-pack-tabs button {
  width: 42px;
  height: 38px;
  flex: 0 0 42px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  font-size: 22px;
}

.emoji-pack-tabs button.active { background: #e4e4e4; }

.emoji-pack-tabs button svg {
  width: 23px;
  height: 23px;
  margin: auto;
}

.emoji-custom-tools {
  min-height: 38px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 2px 5px;
  color: #777;
  font-size: 12px;
}

.emoji-custom-tools.hidden { display: none; }

.emoji-custom-tools label,
.emoji-custom-tools button {
  min-height: 32px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 5px;
  background: #fff;
  color: #333;
  font: inherit;
}

.emoji-custom-tools label svg { width: 16px; height: 16px; }
.emoji-custom-count { text-align: right; }

.emoji-grid {
  height: min(29vh, 236px);
  padding: 4px 0 10px;
  display: grid;
  grid-template-columns: repeat(8, minmax(36px, 1fr));
  grid-auto-rows: 44px;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  content-visibility: auto;
  contain-intrinsic-size: 236px;
}

.emoji-grid .emoji-item {
  width: 100%;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 27px;
  transition: transform 120ms ease, background 120ms ease;
}

.emoji-grid .sticker-item { font-size: 30px; }
.emoji-grid .custom-sticker-item {
  position: relative;
  height: 58px;
  padding: 4px;
}

.emoji-grid .custom-sticker-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.emoji-grid .custom-sticker-item.managing { opacity: .82; }

.custom-sticker-delete {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e64340;
  color: #fff;
  font-size: 15px;
  line-height: 1;
}

.emoji-grid.custom-sticker-grid {
  grid-auto-rows: 58px;
  grid-template-columns: repeat(5, minmax(52px, 1fr));
}
.emoji-grid .emoji-picked { transform: scale(.84); background: #e7e7e7; }
.emoji-empty { grid-column: 1 / -1; padding: 28px 0; color: #999; text-align: center; }
.emoji-empty span,
.emoji-empty small { display: block; }
.emoji-empty small { margin-top: 6px; }
.emoji-empty button { margin-top: 10px; padding: 6px 12px; border: 0; border-radius: 5px; background: #fff; color: #07c160; }

.chat-cache-notice {
  flex: 0 0 auto;
  padding: 6px 12px;
  background: #fff5d8;
  color: #866b21;
  text-align: center;
  font-size: 12px;
}

.emoji-preview-pop {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
  font-size: 54px;
}

.message-state-line {
  min-height: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.message-receipt {
  padding: 0;
  border: 0;
  background: transparent;
  color: #a0a0a0;
  font-size: 11px;
  line-height: 16px;
}

.message-receipt.read { color: #2f83d0; }
.message-receipt.group { color: #7f8c98; }
.favorite-mark { color: #e8a121; font-size: 12px; }
.message-row.mentioned-me { background: rgba(250, 81, 81, .06); }

.action-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, .35);
}

.action-sheet-backdrop.hidden { display: none; }

.action-sheet {
  width: min(100%, 720px);
  padding-bottom: env(safe-area-inset-bottom);
  background: #efeff4;
}

.action-sheet-title,
.action-sheet-option,
.action-sheet-cancel {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-bottom: 1px solid #e6e6e6;
  background: #fff;
  text-align: center;
}

.action-sheet-title { padding: 14px; color: #888; font-size: 13px; }
.action-sheet-cancel { margin-top: 7px; color: #111; font-weight: 600; }

.voice-match-entry {
  width: 100%;
  min-height: 66px;
  padding: 10px 16px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.voice-match-entry > svg:first-child { width: 28px; height: 28px; stroke: #07c160; }
.voice-match-entry > svg:last-child { width: 18px; height: 18px; stroke: #aaa; }
.voice-match-entry span { min-width: 0; display: grid; gap: 3px; }
.voice-match-entry small { color: #888; }

.voice-match-screen,
.friend-request-profile {
  min-height: 100%;
  padding: 48px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.voice-match-orbit {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 12px rgba(7, 193, 96, .08), 0 0 0 26px rgba(7, 193, 96, .04);
}

.voice-match-orbit svg { width: 48px; height: 48px; stroke: #07c160; }
.voice-match-orbit .avatar { width: 80px; height: 80px; }
.voice-match-screen h2 { margin: 42px 0 8px; font-size: 20px; }
.voice-match-screen p { margin: 0; color: #888; }
.voice-match-actions { width: min(100%, 320px); margin-top: 30px; display: grid; gap: 10px; }

.user-moments-hero {
  min-height: 220px;
  padding: 118px 18px 18px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  color: #fff;
  background-color: #555;
  background-position: center;
  background-size: cover;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
}

.user-moments-avatar { width: 72px; height: 72px; border: 2px solid #fff; }
.user-moments-hero h2 { margin: 0 0 5px; font-size: 20px; }
.user-moments-hero p,
.user-moments-hero small { margin: 0; color: #fff; }
.load-more-button { width: calc(100% - 32px); margin: 14px 16px 24px; }

.friend-request-avatar { width: 88px; height: 88px; }
.friend-request-profile h2 { margin: 16px 0 8px; }
.friend-request-profile p { margin: 4px 0; color: #777; }
.friend-request-profile .primary-button { width: min(100%, 320px); margin-top: 24px; }
.presence-settings .selected { color: #07c160; }

@media (max-width: 420px) {
  .emoji-grid {
    grid-template-columns: repeat(7, minmax(36px, 1fr));
  }

  .chat-composer {
    grid-template-columns: 38px minmax(0, 1fr) 38px 38px auto;
    gap: 3px;
  }

  .message-stack {
    max-width: calc(100vw - 102px);
  }
}

/* v33 QR, favorites, and integrated feature pages */
.qr-profile-page,
.qr-scanner-page,
.favorites-page,
.favorite-detail {
  min-height: 100%;
  background: #ededed;
  padding: 16px;
  box-sizing: border-box;
}

.qr-profile-card {
  width: min(100%, 420px);
  margin: 8px auto 16px;
  padding: 20px;
  box-sizing: border-box;
  background: #fff;
  border-radius: 6px;
}

.qr-profile-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.qr-profile-head .avatar { width: 48px; height: 48px; }
.qr-profile-head div { min-width: 0; display: grid; gap: 4px; }
.qr-profile-head strong { font-size: 17px; }
.qr-profile-head small { color: #777; overflow-wrap: anywhere; }
.qr-image-shell { position: relative; width: min(100%, 330px); aspect-ratio: 1; margin: 0 auto; background: #fff; }
.qr-image-shell > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.qr-center-avatar { position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; transform: translate(-50%, -50%); border: 4px solid #fff; border-radius: 6px; background: #5bbbd4; color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .16); }
.qr-profile-card > p { margin: 12px 0 0; text-align: center; color: #888; font-size: 13px; }
.qr-actions { width: min(100%, 420px); margin: 0 auto; display: grid; gap: 10px; }
.qr-actions button,
.qr-actions .button-like { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 7px; box-sizing: border-box; }
.qr-actions svg { width: 19px; height: 19px; }
.qr-camera-frame { position: relative; width: min(100%, 420px); aspect-ratio: 3 / 4; margin: 0 auto 16px; overflow: hidden; border-radius: 6px; background: #151515; }
.qr-camera-frame video { width: 100%; height: 100%; object-fit: cover; }
.qr-scan-corners { position: absolute; inset: 17%; border: 2px solid rgba(255, 255, 255, .9); box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); pointer-events: none; }
.qr-manual { width: min(100%, 420px); margin: 18px auto 0; display: grid; gap: 8px; }
.qr-manual label { color: #666; font-size: 13px; }
.qr-manual textarea { min-height: 78px; resize: none; border: 1px solid #d6d6d6; border-radius: 4px; padding: 10px; box-sizing: border-box; font: inherit; overflow-wrap: anywhere; }

.favorite-search { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border-radius: 6px; }
.favorite-search svg { width: 18px; height: 18px; color: #888; }
.favorite-search input { min-width: 0; border: 0; outline: 0; font: inherit; }
.favorite-search button { padding: 6px 10px; border: 0; background: transparent; color: #07c160; }
.favorite-filters { display: flex; gap: 4px; margin: 12px -2px; overflow-x: auto; scrollbar-width: none; }
.favorite-filters::-webkit-scrollbar { display: none; }
.favorite-filters button { flex: 0 0 auto; padding: 7px 12px; border: 0; background: transparent; color: #666; }
.favorite-filters button.active { color: #111; border-bottom: 2px solid #07c160; font-weight: 600; }
.favorite-list { display: grid; gap: 1px; background: #dcdcdc; }
.favorite-item { position: relative; display: grid; grid-template-columns: 24px 68px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 90px; padding: 10px 12px; box-sizing: border-box; background: #fff; }
.favorite-select { display: grid; place-items: center; }
.favorite-select input { width: 18px; height: 18px; accent-color: #07c160; }
.favorite-preview { position: relative; width: 68px; height: 68px; display: grid; place-items: center; overflow: hidden; border-radius: 4px; background: #f2f2f2; }
.favorite-preview img,
.favorite-preview video { width: 100%; height: 100%; object-fit: cover; }
.favorite-preview svg { width: 28px; height: 28px; color: #777; }
.favorite-play { position: absolute; color: #fff; filter: drop-shadow(0 1px 2px #000); }
.favorite-body { min-width: 0; display: grid; gap: 5px; }
.favorite-body strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favorite-body p { margin: 0; color: #555; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.favorite-body small { color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favorite-batch { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 8px 12px; box-sizing: border-box; background: #fff; border-top: 1px solid #ddd; }
.favorite-detail { display: grid; align-content: start; gap: 16px; }
.favorite-detail-source { color: #888; font-size: 13px; }
.favorite-detail-text { padding: 16px; background: #fff; border-radius: 6px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.favorite-detail-media { display: grid; gap: 8px; }
.favorite-detail-media img,
.favorite-detail-media video { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; object-fit: contain; background: #111; }
.favorite-tags { display: flex; flex-wrap: wrap; gap: 8px; color: #777; }
.favorite-tags span { padding: 4px 7px; border-radius: 4px; background: #fff; }
.favorite-detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.favorite-detail-actions .danger { grid-column: 1 / -1; }

@media (max-width: 360px) {
  .qr-profile-page,
  .qr-scanner-page,
  .favorites-page,
  .favorite-detail { padding: 10px; }
  .favorite-item { grid-template-columns: 20px 58px minmax(0, 1fr); gap: 8px; padding-inline: 8px; }
  .favorite-preview { width: 58px; height: 58px; }
}

/* === WeiX app-mode WeChat layout alignment: P1-P8 (2026-08-21) === */
/* P1: restrained top bar and a centered, independent presence line. */
body.app-mode .app-topbar {
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  border-bottom: 1px solid #e4ecf1;
  box-shadow: none;
}

body.app-mode .app-topbar h1 {
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}

body.app-mode .topbar-side {
  min-width: 48px;
}

body.app-mode .topbar-icon {
  width: 48px;
  height: 48px;
}

body.app-mode #appTitle > span {
  display: block;
  width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-mode #appTitle .chat-top-presence {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #9aa9bb;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.15;
  text-align: center;
}

body.app-mode #appTitle .chat-top-presence .presence-text {
  color: #9aa9bb;
  font-size: 11px;
}

/* P2-P4: full-height conversations, quiet receipts, bubbles and composer. */
body.app-mode.chat-input-focused .app-shell {
  grid-template-rows: 54px minmax(0, 1fr);
}

body.app-mode.chat-input-focused .app-content,
body.app-mode.chat-input-focused .chat-screen {
  min-height: 0;
  height: 100%;
}

body.app-mode .chat-screen {
  min-height: 0;
  overflow: hidden;
}

body.app-mode .message-list {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

body.app-mode .message-receipt.group {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #b6c2ce;
  background: transparent;
  box-shadow: none;
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.4;
  appearance: none;
}

body.app-mode .message-row {
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
}

body.app-mode .message-row.mine {
  grid-template-columns: minmax(0, 1fr) 40px;
}

body.app-mode .chat-message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px;
}

body.app-mode .message-stack,
body.app-mode .message-stack.has-media {
  width: 100%;
  max-width: 100%;
}

body.app-mode .message {
  width: fit-content;
  max-width: 68%;
  padding: 10px 12px;
  border: 1px solid #e4ecf1;
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  box-shadow: none;
  font-size: 16px;
  line-height: 1.5;
}

body.app-mode .message-row.mine .message {
  border-color: #dff7f9;
  border-bottom-right-radius: 3px;
  background: #dff7f9;
  box-shadow: none;
}

body.app-mode .message:not(.media-only)::before,
body.app-mode .message-row.mine .message:not(.media-only)::before {
  display: none;
}

body.app-mode .message.media-only,
body.app-mode .message-row.mine .message.media-only {
  padding: 0;
  border: 0;
  background: transparent;
}

body.app-mode .message-time {
  justify-self: center;
  padding: 0;
  border-radius: 0;
  color: #b2b2b2;
  background: transparent;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
}

body.app-mode .chat-message-media,
body.app-mode .chat-media-open {
  border-radius: 6px;
}

body.app-mode .chat-voice-message {
  height: 24px;
  min-height: 24px;
  padding: 0;
}

body.app-mode .chat-compose-shell {
  align-self: end;
  border-top: 1px solid #e4ecf1;
  background: #fff;
}

body.app-mode .chat-composer {
  min-height: 60px;
  padding: 8px 10px;
  grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
  gap: 4px;
}

body.app-mode .chat-tool,
body.app-mode .chat-send {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
}

body.app-mode .chat-input-slot,
body.app-mode .chat-input-slot > input,
body.app-mode .chat-voice-hold {
  height: 40px;
  min-height: 40px;
}

body.app-mode .chat-input-slot > input,
body.app-mode .chat-voice-hold {
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: #f5f7f9;
  box-shadow: none;
}

body.app-mode .chat-voice-hold {
  font-weight: 550;
}

body.app-mode .chat-send {
  border-radius: 8px;
  color: #fff;
  background: var(--green);
}

/* P5: icon metadata, separate likes and line-by-line comments. */
body.app-mode .moment-meta {
  min-width: 0;
  min-height: 44px;
  gap: 10px;
}

body.app-mode .moment-actions {
  min-width: 0;
  gap: 12px;
}

body.app-mode .moment-actions button {
  min-width: 0;
  min-height: 44px;
  padding: 0;
  gap: 4px;
  color: #9aa9bb;
  font-size: 12px;
}

body.app-mode .moment-actions svg {
  width: 14px;
  height: 14px;
  color: #9aa9bb;
  stroke: currentColor;
}

body.app-mode .moment-actions button span {
  color: #9aa9bb;
  font-size: 12px;
}

body.app-mode .moment-actions button.active svg {
  color: var(--coral);
}

body.app-mode .moment-meta time {
  margin-left: auto;
  color: #b2b2b2;
  font-size: 12px;
  white-space: nowrap;
}

body.app-mode .moment-reactions {
  padding: 0;
  display: grid;
  gap: 2px;
  border: 0;
  background: transparent;
}

body.app-mode .moment-likes {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: #576b95;
  background: #f7f9fa;
}

body.app-mode .moment-comment {
  display: block;
  padding: 4px 10px;
  text-align: left;
}

body.app-mode .moment-item {
  border-bottom: 1px solid #e4ecf1;
}

body.app-mode .moments-cover {
  margin-bottom: 36px;
  border-bottom: 0;
}

body.app-mode .moments-profile {
  gap: 8px;
}

body.app-mode .moments-profile strong {
  line-height: 1.2;
}

/* P6: white contact groups separated by an 8px app-background gutter. */
body.app-mode .contact-shortcuts {
  margin: 0 0 8px;
  background: #fff;
}

body.app-mode .contact-search-area {
  padding-top: 8px;
}

body.app-mode .contact-row .row-main small {
  color: #9aa9bb;
  font-size: 11px;
}

/* P7: compact quota cells, 96px composer and primary/secondary actions. */
body.app-mode .quota-strip {
  min-height: 60px;
  padding: 8px 12px;
  gap: 8px;
  border-bottom: 0;
  background: var(--bg);
}

body.app-mode .quota-strip > div,
body.app-mode .quota-strip > div:first-child,
body.app-mode .quota-strip > div:last-child {
  min-height: 44px;
  padding: 0 8px;
  gap: 6px;
  border: 1px solid #e4ecf1;
  border-radius: 6px;
  background: #fff;
  white-space: nowrap;
}

body.app-mode .quota-strip > div + div {
  border-left: 1px solid #e4ecf1;
}

body.app-mode .quota-strip svg {
  width: 18px;
  height: 18px;
}

body.app-mode .quota-strip span {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-size: 12px;
  white-space: nowrap;
}

body.app-mode .quota-strip strong {
  font-size: 18px;
  font-weight: 700;
}

body.app-mode .bottle-composer {
  margin: 12px 0;
  border: 0;
  box-shadow: none;
}

body.app-mode .bottle-composer textarea {
  min-height: 96px;
}

body.app-mode .page-actions {
  gap: 12px;
  padding: 0 16px 16px;
}

body.app-mode .page-actions .primary-button,
body.app-mode .page-actions .outline-button {
  width: 100%;
  height: 48px;
  min-height: 48px;
  border-radius: 8px;
  box-shadow: none;
}

body.app-mode .page-actions .primary-button {
  border: 1px solid var(--green);
  color: #fff;
  background: var(--green);
}

body.app-mode .page-actions .outline-button {
  border: 1px solid var(--green);
  color: var(--green-dark);
  background: #fff;
}

body.app-mode .picked-bottle-section {
  margin: 0;
}

body.app-mode .bottle-empty {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

body.app-mode .bottle-empty img {
  margin-bottom: 6px;
}

body.app-mode .bottle-empty strong {
  color: var(--text-strong, #20314a);
  font-size: 15px;
}

body.app-mode .bottle-empty span {
  color: #9aa9bb;
  font-size: 12px;
}

/* P8: preserve 78px rows, inset dividers and one-line previews. */
body.app-mode .conversation-row {
  min-height: 78px;
}

body.app-mode .conversation-row::after {
  left: 74px;
}

body.app-mode .conversation-preview {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

body.app-mode .conversation-preview > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 360px) {
  body.app-mode .quota-strip {
    padding-inline: 8px;
    gap: 6px;
  }

  body.app-mode .quota-strip > div,
  body.app-mode .quota-strip > div:first-child,
  body.app-mode .quota-strip > div:last-child {
    padding-inline: 5px;
    gap: 4px;
  }

  body.app-mode .quota-strip span {
    font-size: 11px;
  }
}
/* === End WeiX app-mode WeChat layout alignment: P1-P8 === */

/* === WeiX app-mode secondary-page alignment: S1-S7 (2026-08-21) === */
body.app-mode {
  --s-page: #f5f9fc;
  --s-surface: #ffffff;
  --s-aqua: #19b7c6;
  --s-aqua-pressed: #0793a6;
  --s-aqua-soft: #dff7f9;
  --s-navy: #20314a;
  --s-muted: #6f7f95;
  --s-faint: #9aa9bb;
  --s-line: #e4ecf1;
  --s-control-line: #cadce7;
  --s-secondary-line: #d5e0e8;
  --s-danger: #e85164;
  --s-danger-soft: #fdeef0;
  --s-sunny: #ffd65a;
}

/* S1: secondary-page content blocks and card rhythm. */
body.app-mode :where(
  .secondary-card,
  .qr-profile-card,
  .invite-center,
  .invite-ranking,
  .admin-panel,
  .voice-match-screen
) {
  border: 0;
  border-radius: 8px;
  background: var(--s-surface);
  box-shadow: none;
}

body.app-mode :where(
  .contact-shortcuts,
  .friend-request-list,
  .friend-list,
  .group-create-section,
  .group-list,
  .group-manage-section,
  .friend-request-profile,
  .admin-panel,
  .voice-match-screen
) {
  margin: 8px 12px;
}

body.app-mode :where(
  .contact-shortcuts,
  .friend-request-list,
  .friend-list,
  .group-list,
  .favorite-list,
  .moments-feed,
  .user-moments-feed,
  .invite-ranking
) {
  overflow: hidden;
  border-radius: 8px;
}

body.app-mode :where(.qr-profile-page, .favorites-page, .favorite-detail) {
  padding: 12px;
  background: var(--s-page);
}

body.app-mode .qr-profile-card {
  margin: 0 auto 8px;
  border: 1px solid var(--s-line);
  border-radius: 8px;
}

body.app-mode .moment-composer {
  margin: 8px 12px;
  padding: 12px;
  border: 0;
  border-radius: 8px;
}

body.app-mode :where(.moments-feed, .user-moments-feed) {
  margin: 8px 12px;
  background: var(--s-surface);
}

body.app-mode .admin-panel {
  padding: 12px;
}

body.app-mode .invite-center,
body.app-mode .invite-ranking {
  margin: 8px 12px;
}

/* S2: primary, secondary, ghost, danger and inline action buttons. */
body.app-mode :where(
  .group-create-section > .primary-button,
  .group-manage-section #inviteMembers,
  .friend-request-profile .primary-button,
  .qr-actions button,
  .favorite-detail-actions button,
  .favorite-batch button,
  .invite-center #shareInviteLink,
  .voice-match-actions button,
  .admin-panel .form-grid > button
) {
  height: 44px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  box-shadow: none;
  font-size: 15px;
  font-weight: 600;
}

body.app-mode :where(
  .group-create-section > .primary-button,
  .group-manage-section #inviteMembers,
  .friend-request-profile .primary-button,
  .qr-actions .primary-button,
  .invite-center #shareInviteLink,
  .voice-match-actions .primary-button,
  .admin-panel .form-grid > button
) {
  border: 1px solid var(--s-aqua);
  color: #ffffff;
  background: var(--s-aqua);
}

body.app-mode :where(
  .group-manage-section .secondary,
  .friend-request-profile .secondary,
  .qr-actions .secondary,
  .favorite-detail-actions .secondary,
  .voice-match-actions .secondary,
  .admin-panel .secondary
) {
  border: 1px solid var(--s-secondary-line);
  color: var(--s-navy);
  background: #ffffff;
}

body.app-mode :where(
  .group-manage-section .ghost,
  .qr-actions .ghost,
  .voice-match-actions .ghost,
  .admin-panel .ghost
) {
  border: 1px solid transparent;
  color: var(--s-muted);
  background: transparent;
}

body.app-mode :where(
  .group-manage-section .danger,
  .favorite-detail-actions .danger,
  .favorite-batch .danger,
  .voice-match-actions .danger,
  .admin-panel .danger
) {
  border: 1px solid transparent;
  color: var(--s-danger);
  background: var(--s-danger-soft);
}

body.app-mode :where(
  .group-admin-bar .row-actions button,
  .member-remove,
  .friend-request-accept,
  .invite-link-box button,
  .admin-panel .row-actions button
) {
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
}

body.app-mode .friend-request-accept {
  border: 1px solid var(--s-aqua);
  color: #ffffff;
  background: var(--s-aqua);
}

body.app-mode .invite-link-box button {
  border: 1px solid var(--s-secondary-line);
  color: var(--s-navy);
  background: #ffffff;
}

body.app-mode :where(.admin-panel .row-actions .danger, .member-remove) {
  border: 1px solid transparent;
  color: var(--s-danger);
  background: var(--s-danger-soft);
}

body.app-mode .member-remove {
  top: -6px;
  right: -4px;
  width: 36px;
  padding: 0;
}

body.app-mode :where(
  .secondary-card,
  .qr-profile-page,
  .favorites-page,
  .favorite-detail,
  .invite-center,
  .invite-ranking,
  .admin-panel,
  .s3-segments,
  .moments-segmented,
  .user-moments-hero,
  .call-controls,
  .action-sheet
) button:focus-visible {
  outline: 3px solid rgba(25, 183, 198, 0.34);
  outline-offset: 2px;
}

body.app-mode :where(
  .secondary-card,
  .qr-profile-page,
  .favorites-page,
  .favorite-detail,
  .invite-center,
  .invite-ranking,
  .admin-panel,
  .s3-segments,
  .moments-segmented,
  .user-moments-hero,
  .call-controls,
  .action-sheet
) button:active {
  transform: none;
  opacity: 0.78;
}

/* S3: text segments with a 3px aqua indicator. */
body.app-mode .s3-segments {
  border: 0;
  background: transparent;
}

body.app-mode .s3-segments > button {
  position: relative;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  color: var(--s-muted);
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

body.app-mode .s3-segments > button.active {
  border: 0;
  color: var(--s-navy);
  background: transparent;
  font-weight: 700;
}

body.app-mode .s3-segments > button.active::after {
  content: "";
  position: absolute;
  left: 24%;
  right: 24%;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--s-aqua);
}

body.app-mode .subnav {
  height: 44px;
  margin: 0 12px 8px;
  padding: 0;
  gap: 8px;
}

body.app-mode .moments-segmented {
  height: 44px;
  background: transparent;
}

body.app-mode .favorite-filters {
  min-width: 0;
  margin: 8px 0;
  gap: 0;
  overflow-x: auto;
  background: transparent;
}

body.app-mode .favorite-filters button {
  flex: 1 0 auto;
  padding: 0 12px;
}

body.app-mode .moment-segment-field {
  min-width: 0;
  padding-top: 6px;
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--s-line);
}

body.app-mode .moment-segment-field > span {
  color: var(--s-muted);
  font-size: 13px;
}

body.app-mode .moment-option-segments {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

body.app-mode .moment-option-segments.visibility-segments {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.app-mode .moment-option-segments > button {
  min-width: 0;
  padding: 0 2px;
}

/* S4: secondary-page form fields. Chat and bottle inputs remain untouched. */
body.app-mode .app-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not(.chat-input-slot > input),
body.app-mode .app-content textarea:not(.bottle-composer textarea) {
  height: 46px;
  min-height: 46px;
  border: 1px solid var(--s-control-line);
  border-radius: 8px;
  color: var(--s-navy);
  background: #ffffff;
  box-shadow: none;
}

body.app-mode :where(.moment-composer, .admin-panel, .favorite-detail) textarea {
  height: auto;
}

body.app-mode .moment-composer textarea {
  min-height: 76px;
  padding: 10px 12px;
}

body.app-mode .admin-panel textarea {
  min-height: 112px;
}

body.app-mode .app-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not(.chat-input-slot > input):focus-visible,
body.app-mode .app-content textarea:not(.bottle-composer textarea):focus-visible {
  border-color: var(--s-aqua);
  outline: 0;
  box-shadow: 0 0 0 2px rgba(25, 183, 198, 0.22);
}

body.app-mode :where(.form-grid, .qr-manual) label {
  color: var(--s-muted);
  font-size: 13px;
}

body.app-mode .search-line {
  height: auto;
  padding-left: 0;
  background: transparent;
}

body.app-mode .search-line > svg {
  margin-left: 10px;
}

body.app-mode .search-line input {
  height: 46px;
  padding: 0 10px;
}

body.app-mode .favorite-search {
  padding: 0 10px;
  border: 1px solid var(--s-line);
  border-radius: 8px;
}

body.app-mode .favorite-search input {
  border: 0;
  box-shadow: none;
}

/* S5: pale, pill-shaped badges. */
body.app-mode .badge {
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--s-aqua-pressed);
  background: var(--s-aqua-soft);
  font-size: 12px;
  line-height: 1.25;
}

body.app-mode .danger-badge {
  color: var(--s-danger);
  background: var(--s-danger-soft);
}

/* S6: 56-64px rows, inset dividers, aligned text and actions. */
body.app-mode :where(
  .contact-row,
  .group-row,
  #friendRequests .wechat-row,
  .search-results .wechat-row
) {
  min-height: 64px;
  padding: 8px 12px;
}

body.app-mode :where(
  .contact-row,
  .group-row,
  #friendRequests .wechat-row,
  .search-results .wechat-row
)::after {
  left: 70px;
  background: var(--s-line);
}

body.app-mode :where(.contact-row, .group-row, #friendRequests .wechat-row, .search-results .wechat-row) .row-main strong,
body.app-mode :where(.contact-row, .group-row) .row-title {
  color: var(--s-navy);
  font-size: 16px;
}

body.app-mode :where(.contact-row, .group-row, #friendRequests .wechat-row, .search-results .wechat-row) .row-main small {
  color: var(--s-muted);
  font-size: 13px;
}

body.app-mode .s6-list {
  gap: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
}

body.app-mode .s6-list .check-row {
  min-height: 56px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--s-line);
  color: var(--s-navy);
  background: #ffffff;
  font-size: 16px;
}

body.app-mode .s6-list .check-row:last-child {
  border-bottom: 0;
}

body.app-mode .s6-list .check-row > span {
  min-width: 0;
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-mode .s6-list .check-row > input {
  order: 2;
  margin-left: auto;
}

body.app-mode .favorite-list {
  gap: 0;
  background: #ffffff;
}

body.app-mode .favorite-item {
  position: relative;
  grid-template-columns: 22px 48px minmax(0, 1fr);
  gap: 10px;
  min-height: 64px;
  padding: 8px 12px;
}

body.app-mode .favorite-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 102px;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--s-line);
}

body.app-mode .favorite-preview {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

body.app-mode .favorite-body {
  gap: 2px;
}

body.app-mode .favorite-body strong {
  color: var(--s-navy);
  font-size: 16px;
}

body.app-mode .favorite-body p,
body.app-mode .favorite-body small {
  overflow: hidden;
  color: var(--s-muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-mode .invite-rank-row {
  position: relative;
  min-height: 64px;
  padding: 6px 12px;
  border-bottom: 0;
}

body.app-mode .invite-rank-row:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 102px;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--s-line);
}

body.app-mode .invite-rank-main strong {
  color: var(--s-navy);
  font-size: 16px;
}

body.app-mode .invite-rank-main small {
  color: var(--s-muted);
  font-size: 13px;
}

body.app-mode .admin-panel .row-item {
  position: relative;
  min-height: 64px;
  padding: 6px 0;
  grid-template-columns: 40px minmax(70px, 1fr) auto;
  gap: 8px;
  border-bottom: 0;
}

body.app-mode .admin-panel .row-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 48px;
  right: -12px;
  bottom: 0;
  height: 1px;
  background: var(--s-line);
}

body.app-mode .admin-panel .row-item > .avatar {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
}

body.app-mode .admin-panel .row-title {
  overflow: hidden;
  color: var(--s-navy);
  font-size: 16px;
  line-height: 18px;
  white-space: nowrap;
}

body.app-mode .admin-panel .row-sub {
  color: var(--s-muted);
  font-size: 13px;
  line-height: 15px;
}

body.app-mode .admin-panel .row-actions {
  align-self: center;
  flex-wrap: nowrap;
  gap: 4px;
}

body.app-mode .admin-panel .row-actions button {
  min-width: 38px;
  padding-inline: 6px;
}

body.app-mode .row-actions {
  align-items: center;
}

/* S7: centered illustration with 15px/13px copy hierarchy. */
body.app-mode .empty-state {
  min-height: 220px;
  padding: 48px 16px;
  align-content: center;
  gap: 10px;
}

body.app-mode .empty-state > svg {
  width: 52px;
  height: 52px;
  color: var(--s-faint);
  stroke: currentColor;
}

body.app-mode .empty-state > div {
  color: var(--s-navy);
  font-size: 15px;
}

body.app-mode .empty-state > span {
  color: var(--s-muted);
  font-size: 13px;
}

/* Page 1: group details. */
body.app-mode .group-manage-section {
  padding: 12px;
}

body.app-mode .member-grid {
  gap: 12px 8px;
}

body.app-mode .member .avatar {
  width: 48px;
  height: 48px;
  margin-bottom: 5px;
}

body.app-mode .member-name {
  color: var(--s-navy);
  font-size: 13px;
  line-height: 18px;
}

body.app-mode .member-role {
  color: var(--s-muted);
  font-size: 11px;
  line-height: 15px;
}

body.app-mode .group-info-row {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: #f1f8fb;
}

body.app-mode #inviteBox {
  margin-top: 12px;
}

/* Page 4: QR actions. */
body.app-mode .qr-actions {
  gap: 8px;
}

/* Page 5: favorites. */
body.app-mode .favorite-batch {
  min-height: 60px;
  border-top: 1px solid var(--s-line);
  border-radius: 8px 8px 0 0;
}

body.app-mode .favorite-detail-media {
  overflow: hidden;
  border-radius: 8px;
}

body.app-mode .favorite-detail-media :where(img, video) {
  border-radius: 8px;
}

/* Page 6: invite center. */
body.app-mode .invite-center {
  padding: 24px 12px 16px;
}

body.app-mode .invite-link-box {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--s-line);
  border-radius: 8px;
  background: #ffffff;
}

body.app-mode .invite-stat-grid {
  gap: 8px;
  border: 0;
  background: transparent;
}

body.app-mode .invite-stat-grid > div {
  padding: 12px 4px;
  border: 1px solid var(--s-line);
  border-radius: 8px;
  background: #ffffff;
}

body.app-mode .invite-stat-grid > div + div {
  border-left: 1px solid var(--s-line);
}

body.app-mode .invite-stat-grid strong {
  color: var(--s-navy);
  font-size: 20px;
  font-weight: 750;
}

body.app-mode .invite-stat-grid span {
  color: var(--s-muted);
  font-size: 12px;
}

/* Page 8: discover composer and sunny publish action. */
body.app-mode #publishMoment {
  height: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--s-sunny);
  border-radius: 8px;
  color: var(--s-navy);
  background: var(--s-sunny);
  font-size: 14px;
  font-weight: 700;
}

/* Page 9: voice match. */
body.app-mode .voice-match-screen {
  min-height: calc(100% - 16px);
  padding: 48px 24px 24px;
}

body.app-mode .voice-match-actions {
  gap: 8px;
}

/* Page 10: user moments use the discover feed rhythm with a tighter cover. */
body.app-mode .user-moments-hero {
  min-height: 164px;
  margin: 8px 12px 36px;
  padding: 74px 12px 12px;
  border-radius: 8px;
}

body.app-mode .user-moments-hero > div {
  min-width: 0;
}

body.app-mode .user-moments-hero :where(h2, p, small) {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-mode .user-moments-feed .moment-item:last-child {
  border-bottom: 0;
}

/* Page 11: equal white call controls with navy icons. */
body.app-mode .call-controls {
  gap: 4px;
}

body.app-mode .call-control {
  width: 56px;
  min-width: 56px;
  color: #ffffff;
}

body.app-mode .call-control-icon,
body.app-mode .call-control.hangup .call-control-icon,
body.app-mode .call-control.off .call-control-icon,
body.app-mode .call-control.active .call-control-icon {
  width: 52px;
  height: 52px;
  color: var(--s-navy);
  background: #ffffff;
  backdrop-filter: none;
}

body.app-mode .call-control:active .call-control-icon {
  transform: none;
  opacity: 0.78;
}

/* Page 12: shared media/action/share panels. */
body.app-mode .action-sheet {
  width: min(calc(100% - 24px), 720px);
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background: var(--s-page);
}

body.app-mode :where(.action-sheet-title, .action-sheet-option, .action-sheet-cancel) {
  min-height: 56px;
  border-bottom: 1px solid var(--s-line);
}

body.app-mode :where(.action-sheet-option.danger, .action-sheet-option[data-danger="true"]) {
  color: var(--s-danger);
  background: #ffffff;
}

body.app-mode .chat-media-viewer-stage {
  padding: 12px;
}

body.app-mode .chat-media-viewer-content {
  overflow: hidden;
  border-radius: 12px;
}

body.app-mode :where(.share-panel, .share-sheet, .media-viewer-panel) {
  overflow: hidden;
  border-radius: 12px;
  background: #ffffff;
}

body.app-mode :where(.share-panel, .share-sheet, .media-viewer-panel) > :where(button, [role="button"]) {
  min-height: 56px;
  border-bottom: 1px solid var(--s-line);
}

body.app-mode :where(.share-panel, .share-sheet, .media-viewer-panel) > .danger {
  color: var(--s-danger);
  background: #ffffff;
}

@media (max-width: 360px) {
  body.app-mode .admin-panel .row-item {
    grid-template-columns: 40px minmax(70px, 1fr) auto;
  }

  body.app-mode .admin-panel .row-item > .row-actions {
    grid-column: auto;
    justify-content: flex-end;
  }

  body.app-mode .admin-panel .row-actions button {
    min-width: 36px;
    padding-inline: 5px;
  }

  body.app-mode .moment-composer > .avatar {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  body.app-mode .moment-composer {
    gap: 8px;
  }

  body.app-mode .invite-center {
    padding-inline: 8px;
  }
}

body.app-mode .danger {
  border: 1px solid rgba(232, 81, 100, 0.35);
  color: #e85164;
  background: #fdeef0;
}

body.app-mode .danger:active {
  background: #fadfe3;
}

/* === End WeiX app-mode secondary-page alignment: S1-S7 === */
