:root {
  --bg: #f5f6f1;
  --ink: #1c2421;
  --muted: #69736f;
  --panel: #ffffff;
  --line: #dde5df;
  --deep: #18241f;
  --green: #1e7a53;
  --green-soft: #e6f3ec;
  --blue: #2b63b7;
  --blue-soft: #e7f0fc;
  --gold: #8d6817;
  --gold-soft: #fbf0d5;
  --red: #b5485f;
  --red-soft: #fae9ed;
  --shadow: 0 16px 38px rgba(23, 35, 31, 0.08);
  --app-viewport-height: 100dvh;
  --app-viewport-offset-top: 0px;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  overflow-x: hidden;
}

#app,
.app-shell,
.sidebar,
.main,
.panel,
.card,
.row,
.stat,
.topbar,
.grid,
.form,
.message-layout,
.taxonomy,
.taxonomy-item,
.catalog-row,
.actions {
  min-width: 0;
}

input,
select,
textarea,
button {
  min-width: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease, color 120ms ease;
  -webkit-tap-highlight-color: transparent;
}

button.tap-feedback {
  transform: scale(0.98);
  opacity: 0.86;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  background: var(--deep);
  color: #fff;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  min-width: 0;
}

.brand > div:last-child {
  min-width: 0;
}

.mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #8dd6a8;
  color: var(--deep);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 246, 241, 0.94)),
    var(--bg);
}

.auth-card {
  width: min(560px, 100%);
  display: grid;
  gap: 18px;
}

.auth-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 4px;
}

.auth-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--deep);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: var(--shadow);
}

.auth-hero h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 52px);
  line-height: 1;
}

.auth-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.auth-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 34px rgba(23, 35, 31, 0.07);
}

.auth-panel-primary {
  border-color: rgba(30, 122, 83, 0.22);
}

.auth-panel .form {
  grid-template-columns: 1fr;
  gap: 12px;
}

.auth-actions {
  margin-top: 16px;
}

.auth-rule {
  margin: 10px 0 0;
  line-height: 1.7;
}

@media (max-width: 760px) {
  .auth-shell {
    place-items: start center;
    padding: 20px 14px 32px;
  }

  .auth-card {
    gap: 14px;
  }

  .auth-hero {
    padding: 4px 2px 0;
  }

  .auth-mark {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    font-size: 17px;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    padding: 18px;
    border-radius: 10px;
  }
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 22px;
}

.brand p {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.67);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  position: relative;
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 13px;
  text-align: left;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.mobile-tabbar {
  display: none;
}

.side-note {
  margin-top: auto;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  line-height: 1.7;
}

.side-note p {
  margin: 0 0 12px;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legal-links a,
.legal-consent a,
.legal-back {
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.sidebar .legal-links a {
  color: #bde8cc;
}

.legal-consent {
  margin: 12px 0 0;
}

.main {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.topbar h2 {
  margin: 0;
  font-size: 29px;
}

.topbar p {
  margin: 8px 0 0;
  color: var(--muted);
}

.mobile-logout {
  display: none;
}

.grid {
  display: grid;
  gap: 16px;
}

.two {
  grid-template-columns: minmax(0, 1fr) 360px;
}

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

.panel,
.card,
.row,
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

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

.section-title h3 {
  margin: 0;
  font-size: 17px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.profile-head,
.person-top {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.profile-head > div,
.person-top > div {
  min-width: 0;
}

.profile-open {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.profile-open-text {
  min-width: 0;
  display: block;
  flex: 1 1 auto;
  max-width: 100%;
}

.profile-open-text h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.avatar {
  width: 62px;
  height: 62px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  flex: 0 0 auto;
  overflow: hidden;
}

.avatar.large {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  font-size: 28px;
}

.avatar.preview {
  width: min(72vw, 320px);
  height: min(72vw, 320px);
  border-radius: 22px;
}

.default-avatar {
  position: relative;
  background: #e3e7e4;
  color: transparent;
}

.default-avatar span,
.default-avatar::before,
.default-avatar::after {
  display: block;
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #a8b1ac;
}

.default-avatar::before {
  top: 24%;
  width: 28%;
  height: 28%;
  border-radius: 50%;
}

.default-avatar::after {
  bottom: 18%;
  width: 52%;
  height: 34%;
  border-radius: 999px 999px 8px 8px;
}

.default-avatar.preview::before {
  top: 22%;
}

.default-avatar.preview::after {
  bottom: 17%;
}

.match-board {
  position: relative;
  display: grid;
  gap: 14px;
}

.match-tabs {
  display: flex;
  gap: 8px;
  min-height: 48px;
  padding: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  cursor: grab;
  user-select: none;
  touch-action: pan-x;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(23, 35, 31, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 10px 24px rgba(23, 35, 31, 0.045);
}

.match-tabs.dragging {
  cursor: grabbing;
}

.match-tabs::-webkit-scrollbar {
  display: none;
}

.match-tabs button {
  flex: 0 0 auto;
  min-width: 58px;
  min-height: 36px;
  border-radius: 15px;
  padding: 8px 13px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.match-tag-menu-button {
  flex: 0 0 auto;
  width: 42px;
  min-width: 42px;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  border: 1px solid rgba(23, 35, 31, 0.08);
}

.match-tag-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 79;
  background: transparent;
}

.match-tag-menu-panel {
  position: absolute;
  top: 48px;
  right: 0;
  width: min(320px, calc(100vw - 28px));
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 80;
}

.match-tag-menu-panel .tag-add-controls {
  grid-template-columns: 1fr;
}

.match-tag-action-backdrop {
  position: fixed;
  inset: 0;
  z-index: 78;
  background: transparent;
}

.match-tag-action-popover {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 81;
  width: min(220px, calc(100vw - 28px));
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.match-tag-action-popover strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.my-tag-action-backdrop {
  position: fixed;
  inset: 0;
  z-index: 118;
  background: rgba(15, 21, 19, 0.18);
}

.my-tag-action-popover {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 119;
  width: min(420px, calc(100vw - 28px));
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(23, 35, 31, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 52px rgba(23, 35, 31, 0.18);
}

.my-tag-action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.my-tag-action-head strong {
  font-size: 17px;
  overflow-wrap: anywhere;
}

.my-tag-status-picker {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: #f6f8f6;
}

.my-tag-status-picker > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.my-tag-status-picker > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.my-tag-status-picker button {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.my-tag-status-picker button.active {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(24, 130, 92, 0.18);
}

.match-tabs button.active {
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(23, 35, 31, 0.10);
  box-shadow: 0 10px 18px rgba(23, 35, 31, 0.08);
}

.match-focus-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(23, 35, 31, 0.10);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.70);
  box-shadow: 0 12px 26px rgba(23, 35, 31, 0.045);
}

.match-focus-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.match-focus-head > div {
  display: grid;
  gap: 2px;
}

.match-focus-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.match-focus-panel strong {
  font-size: 17px;
  font-weight: 950;
}

.match-focus-panel span,
.match-focus-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.match-focus-refresh {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--green);
  border: 1px solid rgba(30, 122, 83, 0.16);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(23, 35, 31, 0.055);
}

.match-focus-refresh.secondary {
  background: rgba(246, 248, 246, 0.88);
  color: var(--muted);
  border-color: rgba(23, 35, 31, 0.10);
}

.match-focus-panel .tags {
  gap: 7px;
}

.match-focus-panel .tag {
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 12px;
  border: 1px solid rgba(23, 35, 31, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  font-weight: 850;
}

.match-focus-panel .tag button {
  margin-left: 6px;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 35, 31, 0.08);
  color: inherit;
  font-size: 12px;
  line-height: 1;
}

.match-focus-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.match-focus-add input {
  min-width: 0;
  min-height: 40px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(23, 35, 31, 0.08);
}

.match-focus-add .btn {
  min-height: 40px;
  border-radius: 14px;
  padding-inline: 14px;
}

.match-focus-search {
  background: var(--green);
  color: #fff;
}

.tag-dynamics {
  display: grid;
  gap: 8px;
}

.discover-search-block {
  display: grid;
  gap: 8px;
}

.tag-detail-actions {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin-top: 2px;
}

.tag-detail-actions:empty {
  display: none;
}

.tag-detail-title {
  margin-bottom: 0;
  align-items: center;
  padding: 14px 16px;
  border-radius: 22px;
  border: 1px solid rgba(23, 35, 31, 0.10);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(23, 35, 31, 0.045);
}

.tag-detail-title h3 {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.tag-detail-title .mini-btn {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
}

.tag-detail-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.tag-detail-status.muted-status {
  background: #eef0f2;
  color: var(--muted);
}

.tag-post-composer,
.tag-post-card,
.tag-post-empty {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(23, 35, 31, 0.10);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(23, 35, 31, 0.055);
}

.tag-post-actions {
  background: rgba(250, 252, 250, 0.78);
  border-radius: 0 0 22px 22px;
}

.tag-post-menu {
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(23, 35, 31, 0.14);
}

.tag-post-menu button {
  border-radius: 10px;
}

.tag-comment-card {
  border-radius: 20px;
}

.tag-comment-body {
  background: rgba(248, 250, 248, 0.80);
  border-radius: 18px;
}

.tag-comment-replies {
  border-radius: 18px;
  background: rgba(248, 250, 248, 0.62);
}

.tag-replies-toggle {
  border-radius: 999px;
}

.tag-post-empty {
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.tag-post-composer {
  position: fixed;
  left: 50%;
  bottom: calc(82px + env(safe-area-inset-bottom));
  width: min(520px, calc(100vw - 24px));
  transform: translateX(-50%);
  z-index: 24;
  display: block;
  padding: 8px;
  backdrop-filter: blur(14px);
}

.tag-post-composer textarea {
  width: 100%;
  min-height: 58px;
  max-height: 94px;
  resize: none;
  border: 0;
  border-radius: 16px;
  background: rgba(245, 248, 245, 0.92);
  font-size: 15px;
  line-height: 1.45;
  padding: 11px 82px 11px 12px;
}

.tag-post-composer .btn {
  position: absolute;
  right: 16px;
  bottom: 16px;
  min-width: 58px;
  height: 34px;
  padding: 0 12px;
  border-radius: 13px;
}

.tag-post-list {
  display: grid;
  gap: 10px;
}

.tag-dynamics {
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

.discover-dynamics {
  padding-bottom: 12px;
}

.tag-post-card {
  padding: 12px 0 0;
  overflow: visible;
  position: relative;
}

.tag-post-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 34px;
  align-items: start;
  gap: 10px;
  padding: 0 12px;
}

.tag-post-avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.tag-post-author {
  min-width: 0;
  display: grid;
  justify-items: start;
  text-align: left;
  background: transparent;
  padding: 0;
}

.tag-post-author strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.tag-post-author span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.tag-post-more {
  width: 30px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
  line-height: 1;
}

.tag-post-menu-wrap {
  position: relative;
}

.tag-post-menu {
  position: absolute;
  top: 32px;
  right: 0;
  z-index: 38;
  min-width: 112px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(23, 35, 31, 0.14);
}

.tag-post-menu button {
  width: 100%;
  justify-content: flex-start;
  min-height: 34px;
  padding: 0 10px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  border-radius: 10px;
}

.tag-post-body {
  padding: 10px 12px 14px 64px;
  color: var(--ink);
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.tag-post-source {
  justify-self: start;
  min-height: 24px;
  margin: 8px 12px 0 64px;
  padding: 3px 8px;
  border-radius: 7px;
  background: #eef5ff;
  color: #456b9a;
  font-size: 12px;
  font-weight: 900;
}

.tag-post-actions {
  min-height: 42px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  background: rgba(250, 252, 250, 0.78);
  border-radius: 0 0 22px 22px;
}

.tag-post-actions button {
  min-width: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  border-right: 1px solid var(--line);
}

.tag-post-actions button:last-child {
  border-right: 0;
}

.tag-post-actions button span:not(.action-icon) {
  margin-right: 5px;
}

.tag-post-actions button.liked {
  color: var(--green);
}

.tag-comments-page {
  display: grid;
  gap: 10px;
  padding-bottom: calc(130px + env(safe-area-inset-bottom));
}

.tag-comments-back {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: #edf3ee;
  color: var(--green);
  font-weight: 900;
}

.tag-comment-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tag-comment-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.tag-comment-card > .profile-open {
  align-self: start;
  margin-top: 0;
}

.tag-comment-card.level-3,
.tag-comment-card.level-4,
.tag-comment-card.level-5 {
  padding: 10px 0 0;
  border-bottom: 0;
}

.tag-comment-card:last-child {
  border-bottom: 0;
}

.tag-comment-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.tag-comment-headline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: start;
  gap: 8px;
}

.tag-comment-body {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tag-comment-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
}

.tag-comment-meta button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tag-comment-replies {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f7faf7;
}

.tag-replies-toggle {
  justify-self: start;
  min-height: 28px;
  padding: 0;
  background: transparent;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.tag-reply-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 7px;
  background: #eef5ef;
  color: var(--muted);
  font-size: 12px;
}

.tag-reply-target button {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--green);
  font-size: 12px;
}

.action-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
  margin-right: 5px;
  vertical-align: -3px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.comment-icon {
  background-image: url("./icons/comment.png");
}

.share-icon {
  background-image: url("./icons/share.png");
}

.heart-icon {
  background-image: url("./icons/like.png");
}

.comment-icon::after,
.share-icon::before,
.share-icon::after,
.heart-icon::before {
  content: none;
}

.tag-comment-meta button.liked,
.tag-comment-post-actions button.liked {
  color: var(--green);
}

.tag-comment-bottom {
  position: sticky;
  bottom: calc(74px + env(safe-area-inset-bottom));
  z-index: 26;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -10px 28px rgba(20, 35, 27, 0.08);
  backdrop-filter: blur(12px);
}

.tag-comment-input-wrap {
  position: relative;
}

.tag-comment-input-wrap input {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: #f5f7f4;
  padding: 0 76px 0 12px;
  font-size: 14px;
}

.tag-comment-input-wrap .btn {
  position: absolute;
  right: 6px;
  top: 5px;
  min-width: 56px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
}

.tag-comment-post-actions {
  min-height: 34px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.tag-comment-post-actions button {
  min-width: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.tag-post-empty {
  padding: 34px 16px;
  color: var(--muted);
  text-align: center;
}

.tag-forward-modal {
  max-height: min(76vh, 620px);
  overflow: auto;
}

.tag-forward-preview {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-radius: 8px;
  background: #f5f7f4;
  color: var(--muted);
}

.tag-forward-preview span {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tag-forward-section {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.tag-forward-section h4 {
  margin: 0;
  font-size: 14px;
}

.tag-forward-row {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  text-align: left;
}

.tag-forward-row .avatar,
.tag-forward-row .group-avatar {
  width: 38px;
  height: 38px;
}

.password-reset-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.avatar-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(24, 36, 31, 0.76);
}

.avatar-preview-sheet {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  color: #fff;
}

.avatar-preview-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 24px;
}

.avatar-preview-image .avatar {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

.avatar-preview-name {
  font-weight: 900;
  font-size: 18px;
}

.group-avatar {
  width: 62px;
  height: 62px;
  border-radius: 12px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  background: #eef2ef;
  overflow: hidden;
  flex: 0 0 auto;
}

.group-avatar-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  border-radius: 4px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
}

.group-avatar-cell.default-cell {
  background: #d8ded9;
}

.group-avatar-cell.default-cell::before,
.group-avatar-cell.default-cell::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #9fa9a4;
}

.group-avatar-cell.default-cell::before {
  top: 23%;
  width: 30%;
  height: 30%;
  border-radius: 50%;
}

.group-avatar-cell.default-cell::after {
  bottom: 17%;
  width: 54%;
  height: 35%;
  border-radius: 999px 999px 3px 3px;
}

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

.image-avatar {
  background: #eef2ef;
}

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

.avatar-editor {
  margin-bottom: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}

.avatar-editor-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.avatar-upload {
  position: relative;
  width: fit-content;
  overflow: hidden;
}

.avatar-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.avatar-upload.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.avatar-crop-modal {
  width: min(460px, 100%);
}

.avatar-crop-stage {
  position: relative;
  width: min(320px, 76vw);
  aspect-ratio: 1;
  margin: 14px auto;
  overflow: hidden;
  border-radius: 12px;
  background: #eef2ef;
  border: 1px solid var(--line);
  touch-action: none;
  user-select: none;
}

.avatar-crop-dim {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: brightness(0.42);
}

.avatar-crop-box {
  position: absolute;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.12), 0 10px 28px rgba(0, 0, 0, 0.22);
  cursor: move;
  touch-action: none;
}

.avatar-crop-box img {
  position: absolute;
  object-fit: cover;
  max-width: none;
}

.avatar-crop-handle {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid #fff;
  background: rgba(30, 122, 83, 0.92);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  cursor: nwse-resize;
}

.avatar-crop-help {
  margin: 0 auto;
  max-width: 320px;
  text-align: center;
}

.card {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.match-person-card {
  position: relative;
  gap: 12px;
  border-radius: 24px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(23, 35, 31, 0.10);
  box-shadow: 0 12px 28px rgba(23, 35, 31, 0.055);
  overflow: visible;
}

.match-person-card:has(.action-menu[open]) {
  z-index: 50;
}

.match-skeleton-card {
  pointer-events: none;
}

.skeleton-block {
  display: block;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(228, 236, 231, 0.72), rgba(247, 250, 247, 0.96), rgba(228, 236, 231, 0.72));
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.15s ease-in-out infinite;
}

.skeleton-avatar {
  width: 74px;
  height: 74px;
  border-radius: 18px;
  flex: 0 0 auto;
}

.skeleton-title {
  width: 118px;
  height: 24px;
  margin-bottom: 10px;
}

.skeleton-line {
  width: 160px;
  height: 16px;
}

.skeleton-line.short {
  width: 112px;
}

.skeleton-summary {
  width: min(420px, 72%);
  height: 34px;
  margin: 18px 0;
}

.skeleton-chip {
  width: 72px;
  height: 30px;
  border-radius: 999px;
}

.skeleton-score {
  min-height: 92px;
  border-radius: 22px;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.match-card-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 14px;
  align-items: start;
}

.match-card-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.match-card-main .match-person-top {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
  min-width: 0;
}

.match-card-main .person-top {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.match-card-main .person-top.match-person-top {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 11px;
}

.match-card-main .person-top > .profile-open:first-child {
  width: 62px;
  min-width: 62px;
}

.match-card-main .person-top .avatar {
  width: 62px;
  height: 62px;
}

.match-card-main .match-person-top > .profile-open:first-child {
  width: 56px;
  min-width: 56px;
}

.match-card-main .match-person-top .avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
}

.match-card-main .person-top .profile-open-text {
  overflow: hidden;
}

.match-card-main .person-top .profile-open-text h3 {
  line-height: 1.22;
  word-break: break-word;
}

.match-card-main .text {
  margin: 0;
}

.match-card-title-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 4px 0 5px;
}

.match-card-title-badges .special-nameplate {
  margin-left: 0;
}

.match-card-more {
  align-self: start;
  justify-self: end;
  min-width: 0;
  position: relative;
  z-index: 4;
}

.match-card-more .action-menu summary {
  min-width: 48px;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  color: #526057;
  border: 1px solid rgba(23, 35, 31, 0.12);
  font-size: 12px;
  font-weight: 850;
}

.match-card-more .menu-list {
  min-width: 118px;
  max-width: calc(100vw - 28px);
  white-space: nowrap;
  z-index: 1200;
}

.match-card-summary {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  padding: 10px 12px;
  color: #4f5d55;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid rgba(23, 35, 31, 0.06);
}

.match-tag-wall {
  display: grid;
  gap: 8px;
}

.match-tag-wall-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #53615a;
  font-size: 12px;
  font-weight: 900;
}

.match-tag-wall .tags {
  gap: 7px;
}

.match-tag-wall .tag {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 850;
}

.match-dual-scores {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.match-perspective-card {
  min-height: 100px;
  border-radius: 22px;
  padding: 13px 14px;
  background: #eef3f0;
  color: #33473f;
  border: 1px solid rgba(51, 71, 63, 0.10);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

.match-perspective-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
}

.match-perspective-card span {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 950;
}

.match-perspective-card p {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  font-weight: 650;
}

.match-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.actions.match-card-actions .btn {
  width: 100%;
  min-height: 40px;
  justify-content: center;
  border-radius: 14px;
}

.card h3,
.profile-head h3 {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  overflow-wrap: anywhere;
}

.score {
  margin-left: auto;
  min-width: 86px;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
  font-size: 18px;
}

.match-card-side {
  margin-left: auto;
  display: grid;
  justify-items: end;
  gap: 8px;
  width: 86px;
  min-width: 86px;
}

.match-card-side .score {
  width: 86px;
  min-width: 86px;
  min-height: 42px;
  margin-left: 0;
}

.match-profile-link {
  width: 86px;
  min-height: 42px;
  padding: 7px 8px;
  border-radius: 8px;
  background: #fff;
  color: var(--green);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 900;
}

.side-special-nameplates {
  width: 86px;
  display: grid;
  gap: 8px;
}

.side-special-nameplates .special-nameplate {
  width: 100%;
  height: 21px;
  min-height: 21px;
  justify-content: center;
  margin-left: 0;
  border-radius: 8px;
  padding: 2px 8px;
}

.text {
  line-height: 1.65;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-head + .tags,
.mini-profile-badges + .mini-profile-tags {
  margin-top: 14px;
}

.tag {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.tag.important {
  background: var(--gold-soft);
  color: var(--gold);
}

.static-tag {
  pointer-events: none;
}

.tag.pending {
  background: #eef0f2;
  color: #646c70;
}

.tag.important.pending {
  background: var(--gold-soft);
  color: var(--gold);
}

.tag-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(24, 130, 92, 0.10);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.my-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.tag button {
  padding: 0 2px;
  background: transparent;
  color: inherit;
  font-weight: 900;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #eef2ef;
  border-radius: 8px;
  margin-bottom: 14px;
}

.segmented button {
  min-height: 36px;
  border-radius: 7px;
  padding: 8px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segmented button.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 4px 14px rgba(23, 35, 31, 0.08);
}

.btn {
  min-height: 40px;
  border-radius: 8px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.btn.secondary {
  background: #eef2ef;
  color: var(--ink);
}

.link-btn {
  text-decoration: none;
}

.btn.danger {
  background: var(--red);
}

.btn:disabled {
  color: var(--muted);
  background: #eef2ef;
  cursor: default;
}

.btn.link {
  background: transparent;
  color: var(--green);
  padding-inline: 4px;
}

.action-menu {
  position: relative;
}

.action-menu summary {
  min-height: 40px;
  border-radius: 8px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2ef;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 1000;
  min-width: 132px;
  max-width: calc(100vw - 32px);
  padding: 6px;
  display: grid;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.menu-list button {
  min-height: 36px;
  border-radius: 6px;
  padding: 8px 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.menu-list button:hover {
  background: #eef2ef;
}

.menu-list button:disabled {
  color: var(--muted);
  cursor: default;
}

.menu-list button:disabled:hover {
  background: transparent;
}

.notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  background: #fff8e8;
  color: var(--gold);
  font-size: 13px;
  line-height: 1.55;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

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

input:focus,
textarea:focus {
  border-color: #82bc9c;
  box-shadow: 0 0 0 3px rgba(30, 122, 83, 0.12);
}

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

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

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

.taxonomy {
  display: grid;
  gap: 10px;
}

.taxonomy-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.taxonomy-item strong {
  display: block;
  margin-bottom: 8px;
}

.taxonomy-item summary {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 140px 28px;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.taxonomy-item summary strong {
  margin-bottom: 0;
}

.catalog-count {
  justify-self: center;
  text-align: center;
}

.taxonomy-item summary::-webkit-details-marker {
  display: none;
}

.taxonomy-item summary::after {
  content: "+";
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eef2ef;
  color: var(--green);
  font-weight: 900;
  justify-self: end;
}

.taxonomy-item[open] summary::after {
  content: "-";
}

.catalog-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.catalog-row {
  padding: 10px 0;
  border-bottom: 1px solid #edf1ee;
}

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

.row {
  padding: 14px;
}

button.row {
  text-align: left;
}

.row.active {
  border-color: #82bc9c;
}

.message-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  height: min(680px, calc(100vh - 150px));
  min-height: 520px;
}

.group-message-layout.no-active-group {
  height: auto;
  min-height: 0;
}

.group-message-layout.no-active-group .message-list-panel {
  min-height: 0;
}

.group-message-layout.no-active-group .message-list {
  min-height: 0;
  overflow: visible;
}

.message-list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 0;
  min-height: 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.group-message-layout .message-list-panel {
  grid-template-rows: none;
}

.message-list-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: #f3f5f4;
  border-bottom: 1px solid var(--line);
}

.message-search {
  min-width: 0;
}

.message-search input {
  width: 100%;
  min-height: 38px;
  border-radius: 8px;
  background: #fff;
  border-color: transparent;
}

.message-list-header .message-tabs {
  margin: 0;
  padding: 3px;
  width: 96px;
  min-width: 96px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: #e7ece9;
}

.message-list-header .message-tabs button {
  position: relative;
  min-height: 32px;
  min-width: 0;
  padding: 0;
  font-size: 13px;
}

.group-entry .btn {
  width: 100%;
  border-radius: 0;
}

.group-entry-bottom {
  position: sticky;
  bottom: 0;
  z-index: 18;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.group-entry-bottom .btn {
  border-radius: 8px;
}

.message-list-panel > .panel {
  padding: 16px;
  box-shadow: none;
}

.create-group-panel {
  max-height: min(520px, calc(100vh - 260px));
  overflow: auto;
}

.create-group-form {
  grid-template-columns: 1fr;
  gap: 12px;
}

.create-group-form .field {
  gap: 6px;
}

.message-list {
  display: grid;
  align-content: start;
  gap: 0;
  min-height: 0;
  overflow: auto;
  padding-right: 0;
  background: #fff;
}

.message-item {
  width: 100%;
  min-height: 84px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 0;
  border-bottom: 1px solid #edf0ee;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.message-item > .avatar,
.message-avatar-wrap > .avatar,
.message-avatar-wrap > .group-avatar {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  flex: 0 0 auto;
  font-size: 18px;
}

.message-avatar-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.message-item:hover,
.message-item.active {
  background: #f5f7f6;
}

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

.message-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.message-item-top strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
}

.mute-mark {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #edf1ef;
  color: #7b8580;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.message-item-top > span {
  flex: 0 0 auto;
}

.nav-dot,
.inline-dot,
.tab-dot,
.unread-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e3364a;
  color: #fff;
  box-shadow: 0 0 0 2px #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.nav-dot {
  position: absolute;
  top: 5px;
  right: 6px;
}

.inline-dot {
  flex: 0 0 auto;
}

.tab-dot {
  position: absolute;
  top: -7px;
  right: -7px;
}

.message-avatar-wrap .unread-badge {
  position: absolute;
  top: -6px;
  right: -7px;
}

.system-admin-badge,
.special-nameplate {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 4px;
  border: 1px solid rgba(166, 123, 32, 0.18);
  background: linear-gradient(135deg, #fff7df, #f0f7e9);
  color: #86621b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.system-admin-badge.block,
.special-nameplate.block {
  display: flex;
  width: fit-content;
  margin: 2px auto 4px;
}

.special-nameplate.self-badge {
  background: #eef0f2;
  color: var(--muted);
}

.system-admin-badge.self-badge {
  background: #ecefed;
  color: #68716c;
}

.message-item-top span,
.message-preview {
  color: var(--muted);
  font-size: 14px;
}

.message-preview {
  margin-top: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-panel {
  display: flex;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
}

.chat-head {
  position: relative;
  z-index: 120;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.chat-title {
  min-width: 0;
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-title .avatar {
  flex: 0 0 auto;
}

.chat-title .group-avatar {
  flex: 0 0 auto;
  display: grid;
}

.chat-title-text {
  min-width: 0;
}

.direct-chat-head .chat-title-text {
  text-align: center;
}

.chat-title-text .special-nameplate.block {
  display: inline-flex;
  width: auto;
  margin: 0 4px 4px 0;
  vertical-align: middle;
}

.chat-special-nameplates {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 4px;
}

.chat-special-nameplates .special-nameplate.block {
  margin: 0;
}

.chat-head h3 {
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-head-menu {
  margin-left: auto;
  flex: 0 0 auto;
  position: relative;
  z-index: 140;
}

.chat-back {
  display: none;
}

.chat {
  min-height: 0;
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.bubble {
  align-self: flex-start;
  width: fit-content;
  min-width: 44px;
  max-width: 74%;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef2ef;
  font-size: 15px;
  line-height: 1.48;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bubble.me {
  align-self: flex-end;
  background: var(--green);
  color: #fff;
}

.bubble.sending {
  opacity: 0.72;
}

.message-sender {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 3px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.message-sender .special-nameplate {
  margin-left: 0;
}

.message-meta {
  margin-top: 4px;
  opacity: 0.72;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
}

.chat-date-divider {
  align-self: center;
  margin: 8px auto 4px;
  color: #a4aaa6;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.group-system-message {
  align-self: center;
  max-width: 86%;
  margin: 4px auto;
  color: #9aa39d;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.group-removed-compose {
  width: 100%;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.bubble.me .message-meta {
  text-align: right;
}

.group-message-row {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.group-message-row.me {
  justify-content: flex-end;
}

.group-message-row.other {
  justify-content: flex-start;
}

.group-message-stack {
  min-width: 0;
  max-width: min(74%, 620px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.group-message-row.me .group-message-stack {
  align-items: flex-end;
}

.group-message-avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  flex: 0 0 auto;
  font-size: 15px;
}

.group-bubble {
  display: inline-block;
  width: max-content;
  min-width: 0;
  max-width: min(100%, 360px);
  white-space: normal;
}

.message-body {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}

.group-chat-count {
  margin-left: 2px;
  font-weight: 800;
}

.group-header-tags {
  margin-top: 5px;
  justify-content: center;
  gap: 4px;
}

.group-header-tags .tag {
  min-height: 20px;
  max-width: 88px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.25;
}

.group-chat-compose {
  margin-top: 14px;
  flex-wrap: nowrap;
}

.group-chat-compose input {
  min-width: 0;
  flex: 1;
}

.group-compose-icon {
  width: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
}

.group-settings-menu {
  width: min(380px, calc(100vw - 28px));
  padding: 0;
}

.group-settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 82px) 12px calc(env(safe-area-inset-bottom, 0px) + 16px);
  background: rgba(247, 250, 247, 0.92);
}

.group-settings-sheet {
  width: min(456px, 100%);
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 112px);
  overflow: auto;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 16px 42px rgba(23, 35, 31, 0.18);
  -webkit-overflow-scrolling: touch;
}

@supports (height: 100svh) {
  .group-settings-sheet {
    max-height: calc(100svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 112px);
  }
}

.group-settings-menu .group-control-panel,
.group-settings-sheet .group-control-panel {
  margin: 0;
  border: 0;
  box-shadow: none;
}

.group-settings-menu .group-control-panel summary,
.group-settings-sheet .group-control-panel summary {
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0;
  writing-mode: horizontal-tb;
  width: auto;
  min-height: 44px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  padding: 11px 12px;
}

.stat strong {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
}

.admin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.admin-console-body {
  background: #f4f7f3;
}

.admin-console-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-login-card {
  width: min(520px, 100%);
}

.admin-console-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.admin-console-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-console-main {
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.admin-console-topbar {
  align-items: center;
}

.admin-console-section {
  display: grid;
  gap: 16px;
}

.admin-user-search {
  display: grid;
  gap: 8px;
}

.admin-user-search input {
  width: min(560px, 100%);
  min-height: 38px;
  border-radius: 8px;
  background: #eef2ef;
  border-color: transparent;
}

.admin-user-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-user-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  max-height: 560px;
  overflow-y: auto;
}

.admin-user-row {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.admin-user-row.active {
  background: #eaf4ee;
}

.admin-user-pick {
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.admin-user-row span {
  color: var(--muted);
  font-size: 12px;
}

.admin-user-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.admin-user-preview {
  display: grid;
  gap: 8px;
}

.admin-user-preview-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.admin-user-table-wrap {
  max-height: 452px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-user-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-user-table th,
.admin-user-table td {
  height: 44px;
  padding: 7px 10px;
  border-bottom: 1px solid #edf1ee;
  text-align: left;
  white-space: nowrap;
}

.admin-user-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f7f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-user-table tr.suspended td {
  color: var(--muted);
  background: #fbf0f2;
}

.admin-inline-edit {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-inline-edit input {
  width: 86px;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 8px;
}

.admin-title-editor {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.admin-title-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.admin-title-chip {
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.admin-title-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
}

.admin-title-add input {
  width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 8px;
}

.admin-console-grid {
  align-items: start;
}

.admin-work-panel {
  padding: 0;
  overflow: hidden;
}

.admin-work-panel > summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.admin-work-panel > summary::-webkit-details-marker,
.admin-work-item > summary::-webkit-details-marker {
  display: none;
}

.admin-work-panel > summary span {
  font-size: 16px;
  font-weight: 800;
}

.admin-work-panel > summary strong {
  color: var(--primary);
}

.admin-work-list {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.admin-graph-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.admin-graph-grid .stat {
  min-height: 74px;
}

.admin-graph-rules {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-graph-rules span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-work-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.admin-work-item > summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  cursor: pointer;
  list-style: none;
}

.admin-work-item > summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-work-item > summary em {
  flex: 0 0 auto;
  font-style: normal;
  color: var(--muted);
  font-size: 13px;
}

.admin-work-detail {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}

.admin-report-context {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.admin-report-context div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 13px;
}

.admin-report-context span {
  color: var(--muted);
}

.admin-report-context strong {
  color: var(--text);
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.admin-tag-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}

.admin-tag-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-tag-row > div:first-child {
  min-width: 0;
}

.admin-tag-row .actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.inline-toast {
  position: static;
  transform: none;
  width: fit-content;
  max-width: 100%;
}

@media (max-width: 760px) {
  .admin-console-main {
    padding: 14px;
  }

  .admin-graph-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-user-layout {
    grid-template-columns: 1fr;
  }
}

.choice-list {
  display: grid;
  gap: 0;
  max-height: 150px;
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}

.choice-list.empty-choice {
  max-height: none;
  border: 0;
  background: transparent;
}

.choice-empty {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px dashed rgba(23, 35, 31, 0.12);
  border-radius: 12px;
  background: rgba(245, 248, 246, 0.92);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.choice-row {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
}

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

.choice-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-tools {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  width: min(560px, 100%);
}

.friend-tools input {
  width: min(360px, 100%);
  min-height: 42px;
  border-radius: 8px;
  background: #eef2ef;
  border-color: transparent;
}

.request-drawer {
  position: relative;
  flex: 0 0 auto;
}

.request-drawer > summary {
  min-height: 42px;
  border-radius: 8px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.request-drawer > summary::-webkit-details-marker {
  display: none;
}

.request-dot {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  background: #e3364a;
  color: #fff;
  font-size: 12px;
}

.request-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 12;
  width: min(620px, calc(100vw - 36px));
  max-height: min(620px, calc(100vh - 160px));
  overflow: auto;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.drawer-subtitle {
  margin-top: 18px;
}

.request-fold {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.request-fold + .request-fold {
  margin-top: 10px;
}

.request-fold > summary {
  min-height: 44px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px 18px;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-weight: 900;
}

.request-fold > summary::-webkit-details-marker {
  display: none;
}

.request-fold > summary::after {
  content: ">";
  grid-column: 3;
  justify-self: end;
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
}

.request-fold[open] > summary::after {
  transform: rotate(90deg);
}

.request-fold > summary span {
  grid-column: 2;
  justify-self: center;
  width: 24px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #eef2ef;
  color: var(--green);
  font-size: 12px;
}

.request-fold > summary span:empty {
  display: none;
}

.request-fold-content {
  padding: 10px;
  border-top: 1px solid var(--line);
}

.contact-panel {
  position: relative;
  padding: 0;
  overflow: visible;
}

.contact-section-label {
  padding: 10px 20px;
  background: #eef2ef;
  color: var(--muted);
  font-weight: 900;
}

.contact-list {
  display: grid;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  will-change: scroll-position;
}

.contact-section {
  scroll-margin-top: 126px;
}

.contact-index {
  display: none;
}

.contact-row {
  min-height: 76px;
  padding: 12px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #edf1ee;
}

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

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

.contact-main strong {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.contact-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.contact-tags .tag {
  min-height: 24px;
  padding: 3px 7px;
  font-size: 12px;
}

.contact-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
}

.profile-page {
  position: relative;
  overflow: visible;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(135deg, #f8fbf7 0%, #eef7f0 46%, #f4f7ff 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(23, 35, 31, 0.08);
}

.profile-cover {
  min-height: 96px;
  padding: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  border-radius: 14px 14px 0 0;
  background: transparent;
}

.profile-cover-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 72%;
}

.profile-cover-tags .tag {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.profile-page-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 0 18px 16px;
  margin-top: -30px;
}

.profile-page-main .avatar {
  margin-top: 0;
  border: 4px solid #fff;
  box-shadow: 0 10px 22px rgba(23, 35, 31, 0.12);
}

.profile-page-title {
  min-width: 0;
  flex: 1;
  padding-right: 92px;
}

.profile-page-title h2 {
  margin: 0 0 6px;
  font-size: 24px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-meta-line {
  color: var(--muted);
  line-height: 1.55;
}

.profile-meta-line.small {
  font-size: 13px;
}

.profile-side-stack {
  position: absolute;
  top: 126px;
  right: 18px;
  display: grid;
  gap: 7px;
  justify-items: end;
  z-index: 2;
}

.profile-score {
  min-width: 72px;
  min-height: 48px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  place-items: center;
  align-items: center;
  justify-content: center;
  background: var(--green-soft);
  color: var(--green);
  font-size: 19px;
  font-weight: 900;
}

.profile-score span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.profile-bio {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--muted);
  line-height: 1.7;
}

.profile-posts-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.profile-posts-list {
  display: grid;
  gap: 8px;
}

.profile-post-item {
  width: 100%;
  display: grid;
  gap: 6px;
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.profile-post-item div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-post-item span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.profile-post-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.profile-match-reasons {
  margin: 0 18px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfa;
  overflow: hidden;
}

.profile-match-reasons-head {
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 900;
}

.profile-match-more > summary::-webkit-details-marker {
  display: none;
}

.profile-match-reasons-head strong {
  color: var(--green);
}

.profile-match-reason-list {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.profile-match-reason-list div {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f1f5f2;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.profile-match-more > summary {
  padding: 4px 2px 0;
  list-style: none;
  cursor: pointer;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 18px;
}

.profile-actions .action-menu {
  flex: 0 0 auto;
}

.profile-actions .menu-list {
  left: auto;
  right: 0;
  max-width: calc(100vw - 32px);
  z-index: 18;
}

.profile-tags-panel {
  margin-top: 12px;
  border-radius: 14px;
}

.profile-tag-list {
  display: grid;
  gap: 8px;
}

.profile-tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid rgba(23, 35, 31, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.profile-tag-row .tag {
  flex: 0 1 auto;
}

.load-more-wrap {
  display: grid;
  place-items: center;
  padding: 18px 0 4px;
}

.onboarding-page {
  min-height: auto;
  display: grid;
  place-items: center;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

.onboarding-card {
  width: min(560px, 100%);
  max-width: 100%;
  display: grid;
  gap: 16px;
  overflow: visible;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  border-radius: 28px;
  background:
    radial-gradient(circle at 86% 0%, rgba(230, 243, 236, 0.9), transparent 40%),
    rgba(255, 255, 255, 0.84);
}

.onboarding-progress {
  position: relative;
  display: grid;
  grid-template-columns: 28px repeat(3, 28px) 28px;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.onboarding-progress button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
  background: #eef2ef;
  color: var(--muted);
  font-weight: 900;
}

.onboarding-progress button.active {
  background: var(--green);
  color: #fff;
}

.onboarding-slider {
  overflow: hidden;
  position: relative;
  padding: 0;
  min-width: 0;
  max-width: 100%;
  touch-action: pan-y;
}

.onboarding-track {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: flex-start;
  transform: translateX(calc(var(--onboarding-step, 0) * -100%));
  transition: transform 240ms ease;
}

.onboarding-slide {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex: 0 0 100%;
  display: grid;
  gap: 16px;
  align-content: start;
  overflow: visible;
}

.onboarding-card.onboarding-step-1 .onboarding-slide:nth-child(n + 2),
.onboarding-card.onboarding-step-2 .onboarding-slide:not(:nth-child(2)),
.onboarding-card.onboarding-step-3 .onboarding-slide:not(:nth-child(3)) {
  height: 0;
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.onboarding-slide .section-title h3 {
  font-size: 22px;
  line-height: 1.35;
}

.onboarding-title-center {
  justify-content: center;
  text-align: center;
}

.onboarding-title-center h3 {
  width: 100%;
  text-align: center;
}

.onboarding-arrow {
  position: static;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  box-shadow: none;
  font-size: 20px;
  line-height: 1;
}

.onboarding-arrow:disabled {
  opacity: 0.22;
  pointer-events: none;
}

.onboarding-sample {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: #fbfdfb;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(23, 35, 31, 0.06);
}

.onboarding-sample .profile-head {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  flex-wrap: nowrap;
}

.onboarding-sample .profile-head > div {
  min-width: 0;
  flex: 1 1 auto;
}

.onboarding-sample .profile-head h3 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.onboarding-sample .avatar.large {
  width: 88px;
  height: 88px;
  min-width: 88px;
  aspect-ratio: 1 / 1;
  align-self: center;
}

.onboarding-sample .muted {
  line-height: 1.38;
}

.onboarding-sample .text {
  margin: 12px 0;
  font-size: 15px;
  line-height: 1.5;
}

.onboarding-bio-placeholder {
  color: #8f9b96;
  border: 1px dashed rgba(28, 36, 33, 0.14);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(245, 249, 246, 0.78);
}

.onboarding-sample .mini-profile-tags {
  max-height: none;
  overflow: visible;
}

.onboarding-sample .tag {
  font-size: 13px;
  min-height: 28px;
  padding: 4px 8px;
}

.onboarding-lead,
.onboarding-copy {
  margin: 0;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.55;
  font-weight: 800;
}

.onboarding-lead-lines {
  display: grid;
  gap: 7px;
  text-align: center;
  line-height: 1.45;
}

.onboarding-lead-lines span {
  display: inline-block;
  width: auto;
  max-width: 100%;
  white-space: nowrap;
  min-width: 0;
}

.onboarding-copy {
  text-align: center;
  font-size: 22px;
}

.onboarding-copy span {
  display: inline-block;
  width: auto;
  max-width: 100%;
  white-space: nowrap;
  min-width: 0;
}

.onboarding-hero {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.onboarding-hero h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0;
}

.onboarding-slogan {
  margin: 0;
  width: fit-content;
  max-width: 100%;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--green);
  font-size: 17px;
  font-weight: 950;
  background: linear-gradient(135deg, rgba(230, 243, 236, 0.96), rgba(251, 240, 213, 0.7));
  border: 1px solid rgba(30, 122, 83, 0.14);
}

.onboarding-subcopy {
  max-width: 360px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 800;
}

.onboarding-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.onboarding-feature-grid > div {
  min-height: 78px;
  padding: 11px 8px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.onboarding-feature-grid strong {
  display: block;
  color: var(--green);
  font-size: 14px;
  margin-bottom: 5px;
}

.onboarding-feature-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 750;
}

.onboarding-note {
  margin: -2px 0 0;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
  font-weight: 750;
}

.onboarding-note strong {
  color: var(--ink);
  font-weight: 950;
}

.onboarding-age-field {
  display: grid;
  gap: 8px;
}

.onboarding-compare {
  display: grid;
  gap: 12px;
}

.onboarding-sample.self {
  background: #fff;
  border-color: rgba(25, 121, 80, 0.22);
}

.onboarding-actions {
  display: grid;
  gap: 10px;
}

.onboarding-actions.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.onboarding-actions .span-all {
  grid-column: 1 / -1;
}

.onboarding-tag-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.onboarding-tag-controls input {
  grid-column: 1 / -1;
}

.onboarding-tags {
  min-height: 68px;
  align-content: start;
}

.onboarding-standard-preview {
  display: grid;
  gap: 9px;
}

.onboarding-standard-preview > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: center;
  padding: 11px 13px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.onboarding-standard-preview strong {
  font-size: 15px;
}

.onboarding-standard-preview span {
  grid-column: 1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.onboarding-standard-preview em {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.onboarding-preview-grid {
  display: grid;
  gap: 14px;
}

.onboarding-basic-form {
  padding: 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.onboarding-preview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 950;
}

.onboarding-preview-title span {
  color: var(--green);
}

.onboarding-real-note {
  margin: 0;
  padding: 11px 13px;
  border-radius: 16px;
  background: var(--green-soft);
  border: 1px solid rgba(30, 122, 83, 0.12);
  color: #315a49;
  text-align: left;
  font-size: 13px;
  line-height: 1.55;
}

.profile-tags-fold summary {
  min-height: 40px;
  border-radius: 8px;
  padding: 9px 12px;
  display: inline-flex;
  align-items: center;
  background: #eef2ef;
  color: var(--green);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
  margin-bottom: 12px;
}

.profile-tags-fold summary::-webkit-details-marker {
  display: none;
}

.me-card,
.me-tags-panel {
  margin-bottom: 16px;
  border-radius: 24px;
  border: 1px solid rgba(23, 35, 31, 0.10);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 28px rgba(23, 35, 31, 0.055);
  overflow: hidden;
}

.me-card {
  overflow: visible;
}

.me-card .section-title,
.me-tags-panel .section-title {
  margin-bottom: 12px;
}

.me-card .profile-head {
  align-items: center;
  padding: 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(251, 255, 250, 0.92), rgba(242, 248, 246, 0.86));
  border: 1px solid rgba(23, 35, 31, 0.07);
}

.me-card .profile-head .avatar {
  width: 76px;
  height: 76px;
  border-radius: 18px;
}

.me-tags-panel .tag-add-controls {
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(23, 35, 31, 0.07);
  background: rgba(248, 251, 248, 0.78);
}

.me-tags-panel .tag-add-controls input,
.me-tags-panel .tag-add-controls .btn {
  min-height: 42px;
  border-radius: 14px;
}

.settings-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 35, 31, 0.10);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 28px rgba(23, 35, 31, 0.055);
}

.settings-group-title {
  padding: 12px 18px;
  background: rgba(242, 247, 243, 0.92);
  color: var(--muted);
  font-weight: 900;
}

.settings-item {
  border-bottom: 1px solid #edf1ee;
}

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

.settings-item summary {
  min-height: 58px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-size: 17px;
  font-weight: 900;
}

.settings-item summary::-webkit-details-marker {
  display: none;
}

.settings-item summary::after {
  content: ">";
  color: var(--muted);
  font-size: 22px;
  font-weight: 400;
}

.settings-item[open] summary::after {
  transform: rotate(90deg);
}

.settings-content {
  padding: 0 18px 18px;
  background: rgba(255, 255, 255, 0.76);
}

.settings-sublist {
  display: grid;
  gap: 0;
  margin: 0 -18px -18px;
  border-top: 1px solid #edf1ee;
}

.settings-sublist .settings-group-title {
  padding: 10px 18px;
  font-size: 13px;
}

.settings-sublist .settings-item summary {
  min-height: 50px;
  font-size: 15px;
  font-weight: 850;
}

.settings-content > .topbar {
  display: none;
}

.settings-content > .panel,
.nested-panel {
  padding: 0;
  border: 0;
  box-shadow: none;
}

.title-manager-list {
  display: grid;
  gap: 8px;
}

.title-manager-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.title-manager-row .special-nameplate {
  margin-left: 0;
}

.title-manager-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.tag-add-controls {
  display: grid;
  gap: 10px;
}

.tag-add-controls input,
.tag-add-controls .btn {
  width: 100%;
}

.tag-suggest-panel {
  display: none;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(23, 35, 31, 0.08);
  overflow: hidden;
}

.tag-suggest-panel.active {
  display: grid;
}

.tag-suggest-row {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(221, 229, 223, 0.72);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

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

.tag-suggest-row span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tag-suggest-row strong,
.tag-suggest-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-suggest-row strong {
  font-size: 14px;
}

.tag-suggest-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.tag-suggest-row small {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.tag-suggest-row.custom small {
  background: var(--gold-soft);
  color: var(--gold);
}

.tag-suggest-empty {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.tag-add-controls.compact {
  grid-template-columns: minmax(0, 1fr) auto;
}

.group-create-tags {
  margin-top: 10px;
}

.group-control-panel {
  margin: 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
  overflow: hidden;
  flex: 0 0 auto;
}

.group-control-head {
  min-height: 42px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-weight: 900;
  border-bottom: 1px solid var(--line);
}

.group-control-head span {
  color: var(--green);
  font-size: 12px;
}

.group-control-panel summary {
  min-height: 40px;
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  font-weight: 900;
}

.group-setting-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.group-setting-row {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.group-setting-row span {
  color: var(--muted);
  font-weight: 400;
}

.group-setting-step + .group-setting-step {
  margin-top: 10px;
}

.group-setting-step.nested-setting {
  margin: 10px 12px 10px;
  background: #fafbf9;
}

.group-setting-step > summary + .group-setting-step.nested-setting {
  margin-top: 12px;
}

.group-setting-step > summary {
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
  font-weight: 900;
}

.group-setting-step > summary::-webkit-details-marker {
  display: none;
}

.group-setting-step > summary::after {
  content: ">";
  color: var(--muted);
  font-weight: 400;
}

.group-setting-step[open] > summary::after {
  transform: rotate(90deg);
}

.group-setting-step > .form,
.group-setting-step > .choice-list,
.group-setting-step > .empty,
.group-setting-step > .btn,
.group-setting-step > .group-leave-note {
  margin: 0 12px 12px;
}

.group-leave-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}

.group-control-panel summary span {
  color: var(--green);
  font-size: 12px;
}

.group-control-body {
  display: grid;
  gap: 12px;
  max-height: min(420px, calc(100vh - 300px));
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.group-member-list {
  max-height: none;
  overflow: visible;
}

.contact-invite-notice {
  margin: 0 0 10px;
}

.invite-pick-row {
  cursor: pointer;
}

.group-member-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.group-member-row .avatar,
.group-friend-invite-list .avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 13px;
}

.group-member-row > span,
.group-friend-invite-list span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.group-member-info {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.group-member-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.group-member-name strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.group-member-row .special-nameplate {
  height: 16px;
  min-height: 16px;
  margin-left: 0;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1;
}

.group-member-row em,
.group-friend-invite-list em,
.create-selected-friends em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.create-selected-friends .avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 13px;
}

.group-invite-card {
  margin-top: 8px;
  padding: 10px;
  display: grid;
  gap: 5px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(28, 36, 33, 0.1);
}

.group-invite-card span,
.group-invite-card em {
  color: inherit;
  opacity: 0.72;
  font-size: 12px;
  font-style: normal;
}

.group-invite-card .btn {
  width: fit-content;
}

.tag-forward-message-card {
  width: min(240px, 100%);
  display: grid;
  gap: 5px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(28, 36, 33, 0.1);
  color: inherit;
  text-align: left;
}

.tag-forward-message-card strong,
.tag-forward-message-card span,
.tag-forward-message-card em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-forward-message-card strong {
  font-size: 13px;
}

.tag-forward-message-card span {
  opacity: 0.7;
  font-size: 12px;
}

.tag-forward-message-card em {
  opacity: 0.82;
  font-size: 12px;
  font-style: normal;
}

.mini-btn {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
  flex: 0 0 auto;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1600;
  background: var(--deep);
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 360px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 18, 16, 0.46);
}

.modal {
  width: min(520px, 100%);
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 24, 20, 0.32);
}

.confirm-sheet {
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.confirm-sheet h3 {
  margin: 0;
  font-size: 18px;
}

.confirm-sheet p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.conversation-action-backdrop {
  position: fixed;
  inset: 0;
  z-index: 78;
  display: grid;
  align-items: end;
  padding: 16px;
  background: rgba(16, 24, 20, 0.18);
}

.conversation-action-sheet {
  width: min(420px, 100%);
  margin: 0 auto calc(env(safe-area-inset-bottom, 0px) + 8px);
  display: grid;
  gap: 10px;
}

.conversation-action-title,
.conversation-action-item,
.conversation-action-cancel {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
  text-align: center;
  box-shadow: var(--shadow);
}

.conversation-action-title {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  box-shadow: none;
}

.conversation-action-item.danger {
  color: #b83d59;
}

.conversation-action-cancel {
  color: var(--muted);
}

.busy-toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  max-width: min(360px, calc(100% - 28px));
  padding: 10px 14px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(20, 31, 26, 0.92);
  color: #fff;
  font-weight: 800;
  text-align: center;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.legal-page {
  width: min(880px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 56px;
  line-height: 1.75;
}

.legal-page h1 {
  margin: 18px 0 6px;
  font-size: 32px;
}

.legal-page h2 {
  margin: 28px 0 8px;
  font-size: 20px;
}

.legal-page section {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.legal-page p {
  margin: 8px 0;
}

.user-mobile-only {
  background: #e8ede9;
}

.user-mobile-only #app {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
}

.user-mobile-only.chat-active {
  position: fixed;
  inset: 0;
  width: 100%;
  height: var(--app-viewport-height);
  overflow: hidden;
  overscroll-behavior: none;
}

.user-mobile-only.chat-active #app,
.user-mobile-only.chat-active .app-shell {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--app-viewport-offset-top);
  bottom: auto;
  width: 100%;
  height: var(--app-viewport-height);
  min-height: 0;
  overflow: hidden;
}

@supports (height: 100svh) {
  .user-mobile-only.chat-active,
  .user-mobile-only.chat-active #app,
  .user-mobile-only.chat-active .app-shell {
    height: var(--app-viewport-height, 100svh);
  }
}

@media (min-width: 481px) {
  .user-mobile-only #app {
    box-shadow: 0 0 0 1px rgba(29, 45, 38, 0.05), 0 22px 70px rgba(29, 45, 38, 0.18);
  }

  .user-mobile-only .mobile-tabbar {
    left: 50%;
    right: auto;
    width: 452px;
    transform: translateX(-50%);
  }

  .user-mobile-only .toast {
    left: calc(50% - 226px);
    right: calc(50% - 226px);
  }

  .user-mobile-only .modal-backdrop {
    left: 50%;
    right: auto;
    width: 480px;
    transform: translateX(-50%);
  }

  .user-mobile-only .confirm-backdrop {
    left: 50%;
    right: auto;
    width: 480px;
    transform: translateX(-50%);
  }
}

@media (max-width: 920px) {
  .user-mobile-only {
    background: var(--bg);
  }
}

@media (min-width: 0) {
  body.onboarding-active {
    height: var(--app-viewport-height);
    overflow: hidden;
    overscroll-behavior: none;
  }

  .onboarding-active .app-shell {
    min-height: var(--app-viewport-height);
    height: var(--app-viewport-height);
    overflow: hidden;
  }

  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    display: none;
  }

  .main {
    max-width: 100%;
    padding: 18px 18px calc(92px + env(safe-area-inset-bottom));
  }

  .onboarding-active .main {
    min-height: var(--app-viewport-height);
    height: var(--app-viewport-height);
    display: grid;
    align-items: start;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  .onboarding-active .mobile-tabbar {
    display: none;
  }

  .onboarding-page {
    min-height: auto;
    width: 100%;
    padding: 0;
    place-items: center;
  }

  .onboarding-card {
    gap: 14px;
    border-radius: 24px;
  }

  .onboarding-progress {
    gap: 6px;
  }

  .onboarding-slide {
    gap: 12px;
  }

  .onboarding-hero {
    gap: 8px;
  }

  .onboarding-hero h2 {
    font-size: 24px;
  }

  .onboarding-slogan {
    font-size: 15px;
    padding: 8px 12px;
  }

  .onboarding-subcopy {
    font-size: 14px;
    line-height: 1.45;
  }

  .onboarding-sample {
    padding: 12px;
    border-radius: 18px;
  }

  .onboarding-sample .profile-head {
    gap: 10px;
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .onboarding-sample .avatar.large {
    width: 76px;
    height: 76px;
    min-width: 76px;
    border-radius: 16px;
  }

  .onboarding-sample .profile-head h3 {
    font-size: 18px;
  }

  .onboarding-sample .muted {
    font-size: 13px;
  }

  .onboarding-sample .text {
    font-size: 14px;
    margin: 10px 0;
  }

  .onboarding-sample .mini-profile-tags {
    gap: 6px;
    max-height: none;
  }

  .onboarding-lead,
  .onboarding-copy {
    line-height: 1.45;
  }

  .onboarding-copy {
    font-size: 18px;
  }

  .onboarding-feature-grid {
    gap: 7px;
  }

  .onboarding-feature-grid > div {
    min-height: 68px;
    padding: 9px 6px;
    border-radius: 14px;
  }

  .onboarding-feature-grid strong {
    font-size: 12px;
  }

  .onboarding-feature-grid span {
    font-size: 11px;
  }

  .onboarding-tag-controls {
    gap: 8px;
  }

  .onboarding-tag-controls .btn {
    min-height: 46px;
    font-size: 14px;
  }

  .onboarding-tags {
    min-height: 54px;
  }

  .onboarding-standard-preview {
    gap: 7px;
  }

  .onboarding-standard-preview > div {
    padding: 9px 11px;
  }

  .onboarding-basic-form {
    padding: 12px;
    border-radius: 18px;
  }

  .onboarding-preview-card .profile-head {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .onboarding-preview-card .avatar.large {
    width: 70px;
    height: 70px;
    min-width: 70px;
  }

  .onboarding-real-note {
    padding: 10px 12px;
    font-size: 12px;
  }

  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    width: min(452px, calc(100% - 28px));
    margin: 0 auto;
    padding: 8px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(23, 35, 31, 0.10);
    border-radius: 24px;
    box-shadow: 0 16px 28px rgba(23, 35, 31, 0.08);
    backdrop-filter: blur(16px);
  }

  .mobile-tabbar button {
    position: relative;
    min-width: 0;
    min-height: 50px;
    border-radius: 17px;
    background: transparent;
    color: var(--muted);
    font-weight: 900;
  }

  .mobile-tabbar button.active {
    background: #fff;
    color: var(--ink);
    border: 1px solid rgba(23, 35, 31, 0.14);
    box-shadow: 0 10px 18px rgba(23, 35, 31, 0.07);
  }

  .toast {
    left: 14px;
    right: 14px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    max-width: none;
    text-align: center;
  }

  .modal-backdrop {
    padding: 18px 14px calc(96px + env(safe-area-inset-bottom));
  }

  .confirm-backdrop {
    align-items: end;
    padding: 14px 14px calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .confirm-sheet {
    border-radius: 14px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar h2 {
    font-size: 25px;
  }

  .topbar .actions {
    width: 100%;
  }

  .friend-tools {
    width: 100%;
  }

  .friend-tools input {
    flex: 1 1 auto;
  }

  .friends-page {
    margin: 0;
    width: 100vw;
    max-width: 100vw;
    height: var(--app-viewport-height, 100dvh);
    min-height: 0;
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    background: #f3f3f3;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: pan-y;
  }

  .friends-active,
  .friends-active #app,
  .friends-active .app-shell {
    height: var(--app-viewport-height, 100dvh);
    min-height: 0;
    overflow: hidden;
  }

  .friends-active .main {
    height: var(--app-viewport-height, 100dvh);
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .friends-active .friends-page {
    margin: 0;
    height: var(--app-viewport-height, 100dvh);
    min-height: 0;
  }

  .friends-page > .topbar {
    position: relative;
    flex: 0 0 auto;
    z-index: 12;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 6px 8px;
    background: rgba(243, 243, 243, 0.96);
    border-bottom: 1px solid #e1e1e1;
    backdrop-filter: blur(12px);
  }

  .friends-page > .topbar > div:first-child {
    grid-column: 1;
    text-align: left;
  }

  .friends-page > .topbar h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0;
  }

  .friends-page > .topbar p {
    display: none;
  }

  .friends-page > .topbar .actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
    width: 100%;
  }

  .friends-page .friend-tools {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
  }

  .friends-page .invite-tools {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .friends-page .invite-tools .btn {
    width: auto;
    min-width: 56px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 850;
    white-space: nowrap;
  }

  .friends-page.contact-pick-mode > .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 58px;
    padding: 6px 8px;
  }

  .friends-page.contact-pick-mode > .topbar h2 {
    font-size: 17px;
    line-height: 1;
    font-weight: 900;
    white-space: nowrap;
  }

  .friends-page.contact-pick-mode > .topbar .actions {
    grid-column: 2 / 4;
  }

  .friends-page.contact-pick-mode .invite-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .friends-page.contact-pick-mode .invite-tools input {
    min-height: 34px;
    font-size: 14px;
  }

  .friends-page.contact-pick-mode .contact-invite-notice {
    margin: 10px 10px 8px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
  }

  .friends-page .request-drawer {
    position: static;
  }

  .friends-page .friend-tools input {
    position: static;
    width: 100%;
    min-height: 34px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    padding: 0 11px;
    font-size: 14px;
    box-shadow: 0 8px 22px rgba(23, 35, 31, 0.07);
  }

  .friends-page .request-drawer > summary {
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: transparent;
    font-size: 0;
    border: 0;
    position: relative;
  }

  .friends-page .request-drawer > summary::before {
    content: "...";
    position: absolute;
    inset: 50% auto auto 50%;
    color: #222;
    font-size: 15px;
    line-height: 1;
    letter-spacing: 1px;
    background: transparent;
    transform: translate(-50%, -50%);
  }

  .friends-page .request-drawer > summary::after {
    content: none;
  }

  .friends-page .request-dot {
    position: absolute;
    top: -7px;
    right: -7px;
  }

  .friends-page .request-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 74px;
    z-index: 1200;
    width: auto;
    max-height: calc(100dvh - 220px);
    overflow: auto;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 16px 42px rgba(23, 35, 31, 0.18);
  }

  .friends-page .request-panel input {
    position: static;
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
  }

  .friends-page .request-panel .form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  .friends-page .contact-panel {
    flex: 1 1 auto;
    margin: 0;
    padding-top: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    width: 100%;
    max-width: 100vw;
    margin-left: 0;
    margin-right: 0;
  }

  .friends-page .contact-list {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    width: 100%;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    transform: translateZ(0);
    will-change: scroll-position;
    scrollbar-width: none;
  }

  .friends-page .contact-list::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  .friends-page .contact-row,
  .friends-page .contact-row button,
  .friends-page .contact-main,
  .friends-page .profile-open {
    touch-action: pan-y;
  }

  .friends-page .contact-avatar-hit {
    flex: 0 0 auto;
    display: block;
  }

  .friends-page .contact-section-label {
    min-height: 24px;
    padding: 3px 28px 3px 10px;
    background: #ededed;
    color: #7b7b7b;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
  }

  .friends-page .contact-row {
    width: 100%;
    min-height: 70px;
    padding: 9px 26px 9px 10px;
    gap: 10px;
    border-bottom: 1px solid #ededed;
  }

  .friends-page .contact-row .avatar {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    font-size: 15px;
  }

  .friends-page .contact-main strong {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.25;
  }

  .friends-page .contact-main .muted,
  .friends-page .contact-actions {
    display: none;
  }

  .friends-page .contact-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    margin-top: 5px;
    overflow: hidden;
  }

  .friends-page .contact-tags .tag {
    flex: 0 1 auto;
    min-height: 18px;
    max-width: 68px;
    padding: 2px 5px;
    font-size: 10.5px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .friends-page .contact-index {
    position: fixed;
    top: 96px;
    right: 0;
    bottom: calc(98px + env(safe-area-inset-bottom));
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    pointer-events: auto;
  }

  .friends-page .contact-index button {
    min-width: 18px;
    min-height: 16px;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    background: transparent;
    color: #555;
    font-size: 11px;
    font-weight: 700;
  }

  .request-panel {
    right: 0;
    width: calc(100vw - 28px);
    max-height: min(620px, calc(100vh - 190px));
  }

  .desktop-logout {
    display: none;
  }

  .mobile-logout {
    display: block;
    margin-top: 18px;
    padding-bottom: 8px;
  }

  .mobile-logout .btn {
    width: 100%;
  }

  .two,
  .three,
  .form {
    grid-template-columns: 1fr;
  }

  .taxonomy-item summary {
    grid-template-columns: minmax(0, 1fr) auto 28px;
  }

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

  .message-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 112px - env(safe-area-inset-bottom));
    min-height: 480px;
  }

  .group-message-layout:not(.chat-open) {
    height: calc(100vh - 112px - env(safe-area-inset-bottom));
    min-height: 0;
  }

  .tag-add-controls.compact {
    grid-template-columns: 1fr;
  }

  .group-message-layout.no-active-group {
    height: calc(100vh - 112px - env(safe-area-inset-bottom));
    min-height: 0;
  }

  .group-message-layout.no-active-group .message-list-panel {
    min-height: 0;
  }

  .group-message-layout.no-active-group .message-list {
    min-height: 0;
    overflow: auto;
  }

  .message-list-panel {
    border-radius: 0;
    margin: -4px -12px 0;
  }

  .message-list-header {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 8px 10px;
  }

  .message-search input {
    min-height: 34px;
    font-size: 14px;
  }

  .message-list-header .message-tabs {
    width: 88px;
    min-width: 88px;
  }

  .message-list-header .message-tabs button {
    min-height: 30px;
    font-size: 12px;
  }

  .message-item {
    min-height: 76px;
    gap: 12px;
    padding: 10px 12px;
  }

  .message-item > .avatar,
  .message-avatar-wrap > .avatar,
  .message-avatar-wrap > .group-avatar {
    width: 50px;
    height: 50px;
    border-radius: 9px;
    font-size: 16px;
  }

  .message-item-top strong {
    font-size: 15px;
  }

  .message-item-top span,
  .message-preview {
    font-size: 12px;
  }

  .message-preview {
    margin-top: 5px;
  }

  .message-layout:not(.chat-open) .chat-panel {
    display: none;
  }

  .message-layout.chat-open .message-list-panel {
    display: none;
  }

  .chat-panel {
    min-height: 0;
    height: 100%;
  }

  .chat-head {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    gap: 8px;
    align-items: center;
    margin: -4px -4px 12px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--line);
  }

  .chat-title {
    justify-content: center;
    gap: 8px;
  }

  .chat-title .avatar {
    width: 40px;
    height: 40px;
    font-size: 15px;
  }

  .chat-title-text {
    flex: 0 1 auto;
    max-width: min(210px, 100%);
    text-align: center;
  }

  .chat-title-text .small {
    display: none;
  }

  .chat-head h3 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 15px;
    line-height: 1.2;
  }

  .chat .bubble {
    max-width: 78%;
    padding: 9px 11px;
    font-size: 13px;
    line-height: 1.45;
  }

  .chat-back {
    display: inline-flex;
    width: 52px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
    background: transparent;
    color: var(--ink);
  }

  .chat-head-menu {
    margin-left: 0;
    justify-self: end;
    position: relative;
    z-index: 520;
  }

  .chat-head .action-menu > summary {
    width: 52px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
    background: transparent;
    color: var(--ink);
  }

  .chat-head .action-menu > .menu-list {
    left: auto;
    right: 0;
  }

  .group-chat-open .direct-chat-head .action-menu > .menu-list {
    position: fixed;
    top: calc(var(--app-viewport-offset-top) + 46px);
    right: 12px;
    z-index: 1200;
  }

  .chat {
    max-height: none;
  }

  .chat-active .mobile-tabbar,
  .chat-active .main > .topbar {
    display: none;
  }

  .chat-active .main {
    position: fixed;
    inset: var(--app-viewport-offset-top) 0 auto 0;
    height: var(--app-viewport-height);
    padding: 0;
    overflow: hidden;
    background: var(--bg);
  }

  .message-layout.chat-open {
    display: block;
    height: var(--app-viewport-height);
    min-height: 0;
    margin: 0;
  }

  .message-layout.chat-open .chat-panel {
    position: fixed;
    inset: var(--app-viewport-offset-top) 0 auto 0;
    display: flex;
    flex-direction: column;
    z-index: 70;
    width: 100%;
    max-width: 480px;
    height: var(--app-viewport-height);
    min-height: 0;
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--bg);
  }

  .message-layout.chat-open .chat {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 15px 11px 14px;
  }

  .message-layout.chat-open .chat-panel > .actions,
  .message-layout.chat-open .group-chat-compose {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    gap: 10px;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .message-layout.chat-open .chat-panel > .actions input,
  .message-layout.chat-open .group-chat-compose input {
    min-height: 42px;
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    border-radius: 8px;
    background: #eef2ef;
    color: var(--ink);
    font-size: 14px;
  }

  .message-layout.chat-open .chat-panel > .actions .btn,
  .message-layout.chat-open .group-chat-compose .btn {
    flex: 0 0 84px;
    min-height: 42px;
    border-radius: 8px;
    font-size: 14px;
  }

  .group-chat-open .sidebar,
  .group-chat-open .mobile-tabbar,
  .group-chat-open .main > .topbar,
  .group-chat-open .message-tabs {
    display: none;
  }

  .group-chat-open {
    background: var(--bg);
  }

  .group-chat-open .main {
    position: fixed;
    inset: var(--app-viewport-offset-top) 0 auto 0;
    height: var(--app-viewport-height);
    padding: 0;
    overflow: hidden;
    background: var(--bg);
  }

  .group-chat-open .group-message-layout.chat-open {
    display: block;
    height: var(--app-viewport-height);
    min-height: 0;
    margin: 0;
  }

  .group-chat-open .chat-panel {
    position: fixed;
    inset: var(--app-viewport-offset-top) 0 auto 0;
    display: flex;
    flex-direction: column;
    z-index: 70;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    transform: none;
    height: var(--app-viewport-height);
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--bg);
    color: var(--ink);
  }

  @supports (height: 100svh) {
    .group-chat-open .chat-panel {
      height: var(--app-viewport-height, 100svh);
    }
  }

  .group-chat-open .group-chat-head {
    position: relative;
    z-index: 500;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    min-height: 52px;
    height: auto;
    margin: 0;
    padding: 4px 10px;
    border-bottom: 1px solid var(--line);
    background: rgba(247, 250, 247, 0.96);
    color: var(--ink);
    backdrop-filter: blur(12px);
    overflow: visible;
  }

  .group-chat-open .group-chat-back {
    width: 38px;
    min-height: 38px;
    color: var(--ink);
    font-size: 15px;
    line-height: 1;
  }

  .group-chat-open .group-chat-avatar {
    display: grid;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    padding: 3px;
  }

  .group-chat-open .group-chat-avatar .group-avatar-cell {
    border-radius: 3px;
    font-size: 6px;
  }

  .group-chat-open .direct-chat-avatar {
    display: none;
  }

  .group-chat-open .chat-title-text {
    max-width: 100%;
  }

  .group-chat-open .chat-title-text h3 {
    margin: 0;
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
  }

  .group-chat-open .group-header-tags {
    max-width: min(260px, 100%);
    margin-top: 3px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
  }

  .group-chat-open .group-header-tags .tag {
    flex: 0 1 auto;
    min-height: 18px;
    max-width: 82px;
    padding: 1px 6px;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .group-chat-open .group-chat-more-button {
    width: 34px;
    min-height: 34px;
    padding: 0;
    border: 0;
    justify-content: center;
    background: transparent;
    color: var(--ink);
    font-size: 0;
    letter-spacing: 0;
    font-weight: 900;
    cursor: pointer;
  }

  .group-chat-open .group-chat-more-button::before {
    content: "...";
    color: var(--ink);
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
  }

  .friends-page .request-drawer > summary,
  .group-chat-open .group-chat-more-button,
  .group-chat-open .direct-chat-head .chat-head-menu .action-menu > summary {
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
  }

  .group-chat-open .direct-chat-head .chat-head-menu .action-menu > summary {
    width: 38px;
    min-height: 38px;
    font-size: 0;
    letter-spacing: 1px;
  }

  .group-chat-open .direct-chat-head .chat-head-menu .action-menu > summary::before {
    content: "...";
    color: var(--ink);
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
  }

  .group-chat-open .group-control-body {
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 206px);
    background: #fff;
  }

  @supports (height: 100svh) {
    .group-chat-open .group-control-body {
      max-height: calc(100svh - env(safe-area-inset-top, 0px) - 206px);
    }
  }

  .group-chat-open .group-chat-thread {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 15px 11px 14px;
    gap: 12px;
    background: var(--bg);
  }

  .group-chat-open .direct-chat-thread {
    background: var(--bg);
  }

  .group-chat-open .group-chat-thread .empty {
    color: var(--muted);
    border-color: var(--line);
  }

  .group-chat-open .group-message-stack {
    max-width: min(60%, calc(100% - 66px));
  }

  .group-chat-open .group-message-avatar {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #dce6df;
    color: #fff;
  }

  .group-chat-open .message-sender {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }

  .group-chat-open .group-bubble {
    display: inline-block;
    width: max-content;
    min-width: 0;
    max-width: min(100%, 196px);
    padding: 9px 11px;
    border-radius: 7px;
    background: #eef2ef;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.45;
    white-space: normal;
    position: relative;
    z-index: 1;
  }

  .group-chat-open .group-bubble.me {
    background: var(--green);
    color: #fff;
  }

  .group-chat-open .message-meta {
    display: block;
    margin-top: 4px;
    color: inherit;
    font-size: 9.5px;
    line-height: 1.2;
    opacity: 0.45;
  }

  .group-chat-open .group-chat-compose {
    margin: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    gap: 10px;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .group-chat-open .group-chat-compose input {
    min-height: 42px;
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    border-radius: 8px;
    background: #eef2ef;
    color: var(--ink);
    font-size: 14px;
  }

  .group-chat-open .group-chat-compose input::placeholder {
    color: var(--muted);
  }

  .group-chat-open .group-chat-compose .btn {
    flex: 0 0 84px;
    min-height: 42px;
    border-radius: 8px;
    font-size: 14px;
  }

  .group-chat-open .group-compose-icon {
    border-radius: 50%;
    background: transparent;
    border-color: var(--line);
    color: var(--ink);
    font-size: 24px;
  }

  .group-control-panel[open] {
    max-height: min(62vh, 520px);
  }

  .group-control-body {
    max-height: min(52vh, 430px);
  }

  .me-sections {
    display: grid;
    gap: 16px;
    margin-top: 16px;
  }

  .me-actions .btn,
  .me-actions .link-btn {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 14px 14px calc(88px + env(safe-area-inset-bottom));
  }

  .topbar .actions:empty {
    display: none;
  }

  .panel,
  .card,
  .row,
  .stat {
    box-shadow: none;
  }

  .panel,
  .card {
    padding: 16px;
  }

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

  .stat {
    padding: 13px;
  }

  .stat strong {
    font-size: 22px;
  }

  .profile-head,
  .person-top {
    align-items: flex-start;
  }

  .score {
    min-width: 68px;
    min-height: 38px;
    padding: 7px 10px;
    font-size: 16px;
  }

  .match-card-layout {
    grid-template-columns: minmax(0, 1fr) 82px;
    gap: 12px;
  }

  .match-card-main .person-top {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
  }

  .match-card-main .person-top.match-person-top {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .match-card-main .person-top > .profile-open:first-child {
    width: 56px;
    min-width: 56px;
  }

  .match-card-main .person-top .avatar {
    width: 56px;
    height: 56px;
    border-radius: 10px;
  }

  .match-card-side,
  .side-special-nameplates {
    width: 82px;
    min-width: 82px;
  }

  .match-card-side .score,
  .match-profile-link {
    width: 82px;
    min-width: 82px;
    min-height: 40px;
  }

  .side-special-nameplates .special-nameplate {
    height: 20px;
    min-height: 20px;
  }

  .bubble {
    max-width: 88%;
  }

  .actions {
    width: 100%;
  }

  .actions input,
  .actions .btn {
    flex: 1 1 100%;
  }

  .actions.match-card-actions .btn {
    flex: 1 1 0;
  }

  .actions .action-menu {
    flex: 1 1 100%;
  }

  .action-menu summary {
    width: 100%;
  }

  .menu-list {
    left: 0;
    right: 0;
  }

  .match-card-more .menu-list {
    left: auto;
    right: 0;
    width: 132px;
    max-width: calc(100vw - 36px);
  }

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

  .friend-tools {
    align-items: stretch;
  }

  .request-drawer > summary {
    min-width: 72px;
    justify-content: center;
  }

  .friends-page .request-drawer > summary {
    min-width: 42px;
    width: 42px;
  }

  .friends-page .request-panel {
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100dvh - 218px);
  }

  .contact-row {
    padding: 12px 14px;
  }

  .contact-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-actions .btn {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
  }

  .profile-page-main {
    grid-template-columns: 78px minmax(0, 1fr) 78px;
    gap: 10px;
    align-items: center;
    padding: 0 14px 12px;
    margin-top: -22px;
  }

  .profile-cover {
    min-height: 78px;
    padding: 12px 14px;
  }

  .profile-cover-tags {
    max-width: calc(100% - 108px);
    gap: 5px;
  }

  .profile-cover-tags .tag {
    min-height: 22px;
    padding: 2px 7px;
    font-size: 11px;
    line-height: 1.25;
  }

  .profile-page-main .avatar {
    width: 78px;
    height: 78px;
    border-width: 3px;
    border-radius: 16px;
  }

  .profile-page-title {
    padding-right: 0;
  }

  .profile-page-title h2 {
    display: block;
    max-width: 100%;
    margin-bottom: 5px;
    font-size: 20px;
    line-height: 1.16;
    overflow-wrap: anywhere;
  }

  .profile-meta-line {
    font-size: 13px;
    line-height: 1.38;
  }

  .profile-meta-line.small {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profile-side-stack {
    position: static;
    width: 78px;
    justify-self: end;
    align-self: center;
    gap: 5px;
  }

  .profile-score {
    width: 78px;
    min-width: 78px;
    min-height: 38px;
    font-size: 16px;
  }

  .profile-score span {
    font-size: 10px;
    line-height: 1.1;
  }

  .profile-side-stack .side-special-nameplates,
  .profile-side-stack .side-special-nameplates .special-nameplate {
    width: 78px;
    min-width: 78px;
  }

  .profile-side-stack .special-nameplate {
    min-height: 18px;
    padding: 1px 5px;
    font-size: 10px;
    line-height: 1.1;
  }

  .profile-bio,
  .profile-actions {
    padding-left: 14px;
    padding-right: 14px;
  }

  .profile-bio {
    padding-top: 2px;
    padding-bottom: 12px;
    font-size: 14px;
    line-height: 1.48;
  }

  .profile-match-reasons {
    margin: 0 14px 14px;
  }

  .profile-match-reasons-head {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 15px;
  }

  .profile-match-reasons-head strong {
    font-size: 16px;
  }

  .profile-match-reason-list div {
    padding: 7px 9px;
    font-size: 12px;
    line-height: 1.35;
  }

  .profile-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .profile-actions .action-menu {
    width: 100%;
  }

  .profile-actions > .btn,
  .profile-actions .action-menu summary {
    width: 100%;
    min-height: 42px;
  }

  .profile-actions .menu-list {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
  }

  .taxonomy-item summary {
    grid-template-columns: minmax(0, 1fr) auto 28px;
  }

  .catalog-count {
    justify-self: start;
  }

  .legal-page {
    width: min(100% - 28px, 880px);
    padding-top: 24px;
  }

  .legal-page h1 {
    font-size: 26px;
  }

  .message-layout.chat-open .chat-panel > .actions {
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .message-layout.chat-open .chat-panel > .actions input {
    flex: 1 1 auto;
  }

  .message-layout.chat-open .chat-panel > .actions .btn {
    flex: 0 0 92px;
  }

  .match-focus-add {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .match-focus-add .btn {
    padding-inline: 10px;
  }

  .onboarding-card.panel {
    padding: 16px;
  }

  .onboarding-slide .section-title h3 {
    font-size: 20px;
  }

  .onboarding-feature-grid > div {
    min-height: auto;
    text-align: center;
  }

  .onboarding-standard-preview {
    display: none;
  }
}

@media (max-width: 390px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .taxonomy-item summary {
    grid-template-columns: minmax(0, 1fr) 28px;
  }

  .catalog-count {
    grid-column: 1 / -1;
  }

  .onboarding-active .main {
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .onboarding-card.panel {
    padding: 14px;
  }

  .onboarding-progress {
    gap: 5px;
  }

  .onboarding-progress button,
  .onboarding-arrow {
    width: 26px;
    min-width: 26px;
    height: 26px;
    min-height: 26px;
  }

  .onboarding-hero h2 {
    font-size: 22px;
  }

  .onboarding-slogan {
    font-size: 14px;
  }

  .onboarding-sample .profile-head {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .onboarding-sample .avatar.large,
  .onboarding-preview-card .avatar.large {
    width: 64px;
    min-width: 64px;
    height: 64px;
  }

  .onboarding-sample .profile-head h3 {
    font-size: 17px;
  }

  .onboarding-tag-controls {
    grid-template-columns: 1fr;
  }

  .onboarding-actions.two-col {
    grid-template-columns: 1fr;
  }
}
