/* Чаты — личные и группы. */

.chats-page {
  min-height: 100%;
  background: var(--yaqin-bg);
  padding: var(--yaqin-space-2) var(--yaqin-gutter) 0;
  position: relative;
  color: var(--yaqin-text);
}
.search-page,
.settings-page {
  min-height: 100%;
  background: var(--yaqin-bg);
  padding: var(--yaqin-space-2) var(--yaqin-gutter) 120px;
  position: relative;
  color: var(--yaqin-text);
}

.chats-page .chats-search {
  margin: 4px 0 10px;
}
.chats-head h1 {
  color: var(--yaqin-text);
}
.chats-head button {
  /* plain icon — layout.css */
}

.chats-section {
  margin: 22px 0 14px;
  font-size: var(--yaqin-fs-secondary);
  font-weight: 500;
  color: var(--yaqin-text-tertiary);
}

.new-friends {
  display: flex;
  gap: 14px;
  padding-bottom: 8px;
}
.new-friend {
  position: relative;
  width: 72px;
}
.new-friend img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--yaqin-yellow);
}
.new-friend b {
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  background: var(--yaqin-yellow);
  color: var(--yaqin-yellow-ink);
  border-radius: var(--yaqin-radius-pill);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
}

.chat-tabs {
  display: flex;
  gap: 8px;
  margin: 22px 0 12px;
}
.chat-tabs button {
  border: 0;
  border-radius: var(--yaqin-radius-pill);
  background: var(--yaqin-bg-subtle);
  color: var(--yaqin-text);
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 500;
  position: relative;
}
.chat-tabs button.active {
  background: var(--yaqin-ink);
  color: var(--yaqin-ink-inverse);
}
.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 4px;
  border-radius: 9px;
  background: var(--yaqin-danger);
  color: var(--yaqin-ink-inverse);
  font-size: 11px;
  font-weight: 600;
  padding: 0 5px;
}

.chat-row {
  width: 100%;
  border: 0;
  background: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  text-align: left;
  color: inherit;
}
.chat-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--yaqin-sep);
  display: grid;
  place-items: center;
  font-size: 24px;
}
.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chat-avatar.team {
  background: var(--yaqin-yellow);
  color: var(--yaqin-yellow-ink);
}
.chat-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.chat-copy-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.chat-copy strong {
  font-size: 17px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.chat-row.unread .chat-copy strong {
  font-weight: 700;
}
.chat-row.unread .chat-copy span {
  color: var(--yaqin-text);
  font-weight: 500;
}
.chat-copy span {
  font-size: 14px;
  color: var(--yaqin-text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-kind-inline {
  flex: 0 0 auto;
  margin: 0;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--yaqin-text-tertiary);
}
.chat-row-meta {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 8px;
  min-width: 36px;
  flex: 0 0 auto;
}
.chat-row-meta time {
  font-size: 12px;
  line-height: 1.2;
  color: var(--yaqin-text-tertiary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chat-row.unread .chat-row-meta time {
  color: var(--yaqin-link);
  font-weight: 600;
}
.chat-row-meta-spacer {
  display: block;
  height: 14px;
}
.unread-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yaqin-link);
  flex: 0 0 auto;
}
.chat-pin {
  font-size: 14px;
  color: var(--yaqin-text-tertiary);
  line-height: 1;
}

.compose {
  position: fixed;
  right: max(var(--yaqin-gutter), calc(50% - 221px + var(--yaqin-gutter)));
  bottom: calc(var(--yaqin-nav-pill-h) + var(--yaqin-nav-float-inset) + 12px);
  width: var(--yaqin-fab-size);
  height: var(--yaqin-fab-size);
  border: 0;
  border-radius: 50%;
  background: var(--yaqin-ink);
  color: var(--yaqin-ink-inverse);
  font-size: 22px;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  z-index: 5;
}

.chats-empty {
  text-align: center;
  padding: 80px 20px 40px;
}
.chats-empty.compact {
  padding-top: 120px;
}
.chats-empty .empty-badge,
.groups-empty .empty-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 14px;
  background: var(--yaqin-yellow);
  color: var(--yaqin-yellow-ink);
  display: grid;
  place-items: center;
  font-size: 28px;
}
.chats-empty h2,
.groups-empty h2 {
  margin: 0;
  font-size: var(--yaqin-fs-title-sm);
  font-weight: 700;
}
.chats-empty p,
.groups-empty p {
  margin: 10px auto 0;
  max-width: 260px;
  color: var(--yaqin-text-secondary);
  font-size: 15px;
  line-height: 1.4;
}
.chats-empty .empty-primary {
  margin: 22px auto 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-box {
  height: 48px;
  border-radius: 14px;
  background: var(--yaqin-bg-subtle);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  margin-top: 8px;
}
.search-box input {
  border: 0;
  background: none;
  outline: 0;
  flex: 1;
  font-size: 16px;
}
.search-box input[type='search']::-webkit-search-cancel-button,
.search-box input[type='search']::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.search-box button {
  border: 0;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  background: var(--yaqin-text-tertiary);
  color: var(--yaqin-ink-inverse);
}
.search-none {
  color: var(--yaqin-text-tertiary);
  padding: 24px 0;
}

/* Conversation */
.chat-page {
  height: 100%;
  background: var(--yaqin-bg);
  display: flex;
  flex-direction: column;
}
.chat-top {
  height: auto;
  min-height: var(--yaqin-header-h);
  flex-shrink: 0;
  box-sizing: border-box;
  border-bottom: 1px solid var(--yaqin-sep-soft);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 var(--yaqin-gutter);
  background: color-mix(in srgb, var(--yaqin-bg) 72%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 15;
}
.chat-top > button:not(.chat-peer-btn),
.chat-top > .chat-back,
.chat-top > .head-spacer,
.chat-top > .chat-top-menu-wrap {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
}
.chat-top button {
  border: 0;
  background: none;
  font-size: 22px;
  color: var(--yaqin-text);
}
.chat-back {
  position: relative;
  display: grid;
  place-items: center;
}
.back-badge {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--yaqin-danger);
  color: var(--yaqin-ink-inverse);
  font-size: 10px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.chat-peer,
.chat-peer-btn {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.chat-peer-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 40px;
  background: var(--yaqin-bg-subtle);
}
.chat-peer-copy {
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}
.chat-peer h1,
.chat-peer-btn h1 {
  margin: 0;
  font-size: var(--yaqin-fs-modal);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-peer p,
.chat-peer-btn p {
  margin: 1px 0 0;
  font-size: var(--yaqin-fs-caption);
  color: var(--yaqin-text-tertiary);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-peer-status.on {
  color: var(--yaqin-green, #34c759);
}
.chat-peer-status i,
.chat-peer p i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px var(--yaqin-gutter) 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}
.chat-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 18px 16px 16px;
}
.chat-intro .chat-pill {
  background: var(--yaqin-bg);
}
.chat-photo {
  width: 120px;
  height: 160px;
  object-fit: cover;
  border-radius: 18px;
}
.chat-meta {
  margin: 0;
  color: var(--yaqin-text-tertiary);
  font-size: 14px;
}
.chat-pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--yaqin-radius-pill);
  background: var(--yaqin-bg-subtle);
  font-size: 14px;
}
.chat-bubble {
  width: auto;
  max-width: min(88%, 320px);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  align-self: flex-start;
}
.chat-bubble .chat-avatar {
  display: none;
}
.bubble-name {
  margin: 0 0 4px;
  padding: 0 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--yaqin-link);
  line-height: 1.2;
}
.chat-bubble.mine .bubble-name {
  display: none;
}
.bubble-head {
  display: none;
}
.chat-bubble p {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.message-bar {
  flex-shrink: 0;
  min-height: 56px;
  border-top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px max(10px, env(safe-area-inset-bottom, 10px));
  background: var(--yaqin-bg);
  color: var(--yaqin-link);
}
.chat-composer {
  flex-shrink: 0;
  background: var(--yaqin-bg);
  border-top: 1px solid var(--yaqin-sep);
  display: flex;
  flex-direction: column;
}
.chat-composer > .attach-menu,
.chat-composer > .attach-pick-sheet {
  margin: 10px 12px 0;
}
.chat-composer > .composer-draft {
  margin: 0;
}
.chat-composer > .message-bar {
  padding-top: 8px;
}
.message-bar button {
  border: 0;
  background: none;
  color: var(--yaqin-link);
  font-size: 20px;
  padding: 0;
}
.msg-add {
  width: 32px;
  height: 32px;
  border-radius: 50% !important;
  background: var(--yaqin-link) !important;
  color: var(--yaqin-ink-inverse) !important;
  display: grid;
  place-items: center;
}
.msg-field {
  flex: 1;
  height: 40px;
  border: 1.5px solid var(--yaqin-sep);
  border-radius: var(--yaqin-radius-pill);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
}
.msg-field input {
  border: 0;
  outline: 0;
  flex: 1;
  background: none;
  font-size: 15px;
  color: var(--yaqin-text);
}
.msg-emoji {
  border: 0;
  background: none;
  color: var(--yaqin-text-tertiary);
  font-size: 22px;
  padding: 0;
  display: grid;
  place-items: center;
}


/* Search + new DM — 06-match-chat/chats-search--170, new-dm--148 */
body[data-route='search'] .nav,
body[data-route='new-dm'] .nav {
  display: none;
}
body[data-route='search'] .view,
body[data-route='new-dm'] .view {
  padding: 0 !important;
  background: var(--yaqin-bg);
}

.modal-head {
  /* floating pills — see layout.css */
}
.modal-head h1 {
  color: var(--yaqin-text);
}
.modal-head > button:not(.head-action),
.modal-head > span {
  /* size/pill from layout.css */
}
.modal-head .head-action {
  color: var(--yaqin-link);
}
.modal-head .head-action.on {
  color: var(--yaqin-link);
}
.modal-head .head-action:disabled {
  opacity: 1;
}

.search-page,
.new-dm-page {
  min-height: 100%;
  background: var(--yaqin-bg);
  padding: 4px 0 40px;
}
.search-box {
  margin: 8px 16px 0;
  height: 40px;
  border-radius: 12px;
  background: var(--yaqin-bg-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--yaqin-text-tertiary);
}
.search-box input {
  flex: 1;
  border: 0;
  outline: 0;
  background: none;
  font-size: 16px;
  color: var(--yaqin-text);
}
/* type=search рисует свой крестик — оставляем только наш button */
.search-box input[type='search']::-webkit-search-cancel-button,
.search-box input[type='search']::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.search-box button {
  border: 0;
  background: var(--yaqin-text-tertiary);
  color: var(--yaqin-ink-inverse);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
}
.search-results {
  margin-top: 8px;
  padding: 0 8px;
}
.search-none {
  text-align: center;
  color: var(--yaqin-text-tertiary);
  padding: 40px 20px;
}
.chats-empty.compact {
  min-height: 52vh;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 14px;
  padding: 40px 24px;
}
.chats-empty.compact h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
}

.invite-title {
  margin: 18px 20px 8px;
  font-size: 22px;
  font-weight: 700;
}
.plain-search {
  width: calc(100% - 40px);
  margin: 0 20px 18px;
  border: 0;
  border-bottom: 1px solid var(--yaqin-sep-soft);
  outline: 0;
  background: none;
  font-size: 17px;
  padding: 10px 0;
  color: var(--yaqin-text);
}
.list-label {
  margin: 18px 20px 6px;
  font-size: 17px;
  font-weight: 700;
}
.pick-row {
  width: 100%;
  border: 0;
  background: var(--yaqin-bg);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  text-align: left;
}
.pick-row img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--yaqin-sep);
}
.pick-row div {
  flex: 1;
  display: grid;
  gap: 2px;
  min-width: 0;
}
.pick-row strong {
  font-size: 16px;
  font-weight: 600;
}
.pick-row span {
  font-size: 13px;
  color: var(--yaqin-text-tertiary);
}
.pick-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--yaqin-text-tertiary);
  display: block;
}
.pick-circle.on {
  border-color: var(--yaqin-link);
  background: var(--yaqin-link);
  box-shadow: inset 0 0 0 3px var(--yaqin-bg);
}

.chat-thread.start {
  justify-content: center;
  padding-top: 48px;
}
.chat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
button.chat-bubble {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.message-menu-overlay {
  align-items: flex-end;
}
.message-menu-stack {
  width: min(100%, 390px);
  display: grid;
  gap: 10px;
  padding: 0 8px 12px;
}
.reaction-bar {
  margin: 0 auto;
  background: var(--yaqin-bg);
  border-radius: var(--yaqin-radius-pill);
  padding: 8px 10px;
  display: flex;
  gap: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.reaction-bar button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--yaqin-bg-subtle);
  font-size: 22px;
  display: grid;
  place-items: center;
}
.message-sheet {
  background: var(--yaqin-bg);
  border-radius: 18px;
  overflow: hidden;
}
.message-sheet button {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--yaqin-sep-soft);
  background: var(--yaqin-bg);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  text-align: left;
  font-size: 17px;
  color: var(--yaqin-text);
}
.message-sheet button:first-child { border-top: 0; }
.reply-icon {
  position: relative;
  width: 36px;
  height: 36px;
}
.reply-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.reply-icon i {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--yaqin-link);
  color: var(--yaqin-ink-inverse);
  font-size: 12px;
  display: grid;
  place-items: center;
}
.sheet-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--yaqin-ink-inverse);
  font-size: 18px;
}
.sheet-icon.blue { background: var(--yaqin-link); }
.sheet-icon.red { background: var(--yaqin-danger); }

.radio {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--yaqin-text-tertiary);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-style: normal;
}
.radio.on {
  border-color: var(--yaqin-blue);
  background: var(--yaqin-blue);
  color: var(--yaqin-ink-inverse);
  font-size: 14px;
}
.radio .ti { font-size: 14px; }
.group-title {
  margin: 8px 4px 0;
  font-weight: 600;
  color: var(--yaqin-text);
}
body[data-route='group-notifications'] .nav { display: none; }
body[data-route='group-notifications'] .view { padding: 0 !important; background: var(--yaqin-bg); }
body[data-route='group-notifications'] .settings-row.toggle input:checked { background: var(--yaqin-blue); }

.bubble-head b.accent { color: var(--yaqin-link); }
.bubble-body {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}
.bubble-quote {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1.5px solid var(--yaqin-sep);
  border-radius: 12px;
  color: var(--yaqin-text-secondary);
  font-size: 13px;
}
.bubble-quote img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}
.bubble-quote i { color: var(--yaqin-link); font-size: 14px; }
.bubble-image {
  display: block;
  width: min(100%, 220px);
  border-radius: 14px;
  margin-top: 8px;
  object-fit: cover;
}
.bubble-reply {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--yaqin-link);
  border-radius: 8px;
  background: var(--yaqin-bg-subtle);
  display: grid;
  gap: 2px;
}
.bubble-reply small {
  font-size: 11px;
  color: var(--yaqin-text-tertiary);
}
.bubble-reply span {
  font-size: 13px;
  color: var(--yaqin-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-card {
  margin-top: 8px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--yaqin-bg-subtle);
  text-align: left;
  max-width: 280px;
}
.link-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}
.link-card div { padding: 12px 14px; display: grid; gap: 4px; }
.link-card small { color: var(--yaqin-text-tertiary); font-size: 12px; }
.link-card strong { font-size: 15px; }
.link-card span { font-size: 13px; color: var(--yaqin-text-secondary); }
.bubble-reactions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bubble-reactions span {
  background: var(--yaqin-bg-subtle);
  color: var(--yaqin-text);
  border-radius: var(--yaqin-radius-pill);
  padding: 4px 10px;
  font-size: 13px;
}
.bubble-reactions i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--yaqin-bg-subtle);
  display: grid;
  place-items: center;
  color: var(--yaqin-text-tertiary);
}

.attach-menu {
  margin: 0 12px 8px;
  background: var(--yaqin-surface-raised);
  border: 1px solid var(--yaqin-sep-soft);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.attach-menu button {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--yaqin-sep-soft);
  background: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  font-size: 16px;
  color: var(--yaqin-text);
}
.attach-menu button:first-child { border-top: 0; }
.attach-menu button:active { background: var(--yaqin-bg-subtle); }
.attach-menu i { color: var(--yaqin-link); font-size: 20px; }

.attach-pick-sheet {
  margin: 0 12px 8px;
  background: var(--yaqin-surface-raised);
  border: 1px solid var(--yaqin-sep-soft);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  max-height: min(42vh, 360px);
  display: flex;
  flex-direction: column;
}
.attach-pick-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--yaqin-sep-soft);
}
.attach-pick-sheet header b {
  font-size: 15px;
  font-weight: 700;
}
.attach-pick-sheet header button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--yaqin-bg-subtle);
  color: var(--yaqin-text);
  display: grid;
  place-items: center;
  font-size: 16px;
}
.attach-pick-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
}
.attach-pick-row {
  width: 100%;
  border: 0;
  background: none;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  text-align: left;
  color: var(--yaqin-text);
  font: inherit;
}
.attach-pick-row:active { background: var(--yaqin-bg-subtle); }
.attach-pick-row img {
  width: 40px;
  aspect-ratio: var(--yaqin-content-ratio, 4 / 5);
  height: auto;
  border-radius: var(--yaqin-content-radius, 12px);
  object-fit: cover;
  display: block;
  background: var(--yaqin-bg-subtle);
}
.attach-pick-row span {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.attach-pick-row strong {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attach-pick-row small {
  font-size: 12px;
  color: var(--yaqin-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attach-pick-empty {
  margin: 0;
  padding: 24px 16px;
  text-align: center;
  color: var(--yaqin-text-tertiary);
  font-size: 14px;
}

.composer-draft {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 8px;
  background: color-mix(in srgb, var(--yaqin-bg-subtle) 70%, var(--yaqin-bg));
  border-bottom: 1px solid var(--yaqin-sep-soft);
}
.composer-draft-thumb {
  width: 44px;
  aspect-ratio: var(--yaqin-content-ratio, 4 / 5);
  height: auto;
  border-radius: var(--yaqin-content-radius, 12px);
  object-fit: cover;
  display: block;
  flex: 0 0 auto;
  background: var(--yaqin-bg-subtle);
}
.composer-draft-icon {
  width: 44px;
  aspect-ratio: var(--yaqin-content-ratio, 4 / 5);
  border-radius: var(--yaqin-content-radius, 12px);
  background: var(--yaqin-bg-subtle);
  color: var(--yaqin-link);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex: 0 0 auto;
}
.composer-draft-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.composer-draft-copy b {
  font-size: 13px;
  font-weight: 700;
  color: var(--yaqin-link);
}
.composer-draft-copy span {
  font-size: 14px;
  color: var(--yaqin-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.composer-draft-clear {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--yaqin-bg-subtle);
  color: var(--yaqin-text-tertiary);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex: 0 0 auto;
}

.share-card {
  margin-top: 6px;
  width: auto;
  max-width: 148px;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--yaqin-bg-subtle);
  text-align: left;
  color: inherit;
  font: inherit;
  padding: 0;
  display: grid;
}
.share-card.is-group,
.share-card.is-event {
  max-width: 148px;
}
.share-card-media {
  display: block;
  width: 100%;
  aspect-ratio: var(--yaqin-content-ratio, 4 / 5);
  overflow: hidden;
  background: var(--yaqin-bg-subtle);
  position: relative;
}
.share-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.share-card-copy {
  padding: 8px 10px 10px;
  display: grid;
  gap: 2px;
  min-width: 0;
}
.share-card-copy small {
  color: var(--yaqin-link);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.share-card-copy strong {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--yaqin-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.share-card-copy > span {
  font-size: 11px;
  line-height: 1.3;
  color: var(--yaqin-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chat-bubble.mine .share-card {
  background: color-mix(in srgb, var(--yaqin-link) 10%, var(--yaqin-bg));
}
.share-card > img {
  width: 100%;
  aspect-ratio: var(--yaqin-content-ratio, 4 / 5);
  height: auto;
  object-fit: cover;
  display: block;
}
.share-card > div {
  padding: 8px 10px 10px;
  display: grid;
  gap: 2px;
}

.draft-attach {
  display: none;
}
.draft-attach img { display: none; }
.draft-attach button { display: none; }

.msg-add.open {
  background: var(--yaqin-text-tertiary) !important;
}
.msg-send {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--yaqin-link);
  color: var(--yaqin-ink-inverse);
  display: grid;
  place-items: center;
  font-size: 18px;
}

.audio-bubble,
.draft-audio {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--yaqin-link);
  color: var(--yaqin-ink-inverse);
  border-radius: 18px;
  padding: 12px 14px;
  max-width: 280px;
  margin-top: 6px;
  position: relative;
}
.audio-bubble i,
.draft-audio > i {
  font-size: 18px;
}
.audio-bubble div,
.draft-audio div {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}
.audio-track {
  display: block;
  height: 2px;
  background: rgba(255,255,255,.85);
  border-radius: 2px;
}
.audio-bubble small,
.draft-audio small {
  font-size: 12px;
  opacity: .92;
}
.audio-bubble time,
.draft-audio time {
  font-size: 13px;
  white-space: nowrap;
}
.draft-audio {
  margin: 0 12px 8px;
  max-width: none;
}
.draft-audio button {
  position: absolute;
  top: -8px;
  right: -4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: var(--yaqin-bg);
  color: var(--yaqin-text);
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.record-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 14px;
  background: var(--yaqin-bg);
}
.record-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: var(--yaqin-radius-pill);
  background: var(--yaqin-link);
  color: var(--yaqin-ink-inverse);
  font-size: 15px;
  font-weight: 600;
}
.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yaqin-bg);
  display: block;
}
.record-pill.live .rec-dot {
  background: var(--yaqin-danger);
  box-shadow: 0 0 0 3px rgba(255,59,48,.25);
}
.rec-wave {
  flex: 1;
  height: 18px;
  margin-left: 8px;
  background:
    linear-gradient(var(--yaqin-bg),var(--yaqin-bg)) 0 50%/3px 6px no-repeat,
    linear-gradient(var(--yaqin-bg),var(--yaqin-bg)) 8px 50%/3px 14px no-repeat,
    linear-gradient(var(--yaqin-bg),var(--yaqin-bg)) 16px 50%/3px 9px no-repeat,
    linear-gradient(var(--yaqin-bg),var(--yaqin-bg)) 24px 50%/3px 16px no-repeat,
    linear-gradient(var(--yaqin-bg),var(--yaqin-bg)) 32px 50%/3px 7px no-repeat,
    linear-gradient(var(--yaqin-bg),var(--yaqin-bg)) 40px 50%/3px 12px no-repeat,
    linear-gradient(var(--yaqin-bg),var(--yaqin-bg)) 48px 50%/3px 15px no-repeat,
    linear-gradient(var(--yaqin-bg),var(--yaqin-bg)) 56px 50%/3px 8px no-repeat,
    linear-gradient(var(--yaqin-bg),var(--yaqin-bg)) 64px 50%/3px 13px no-repeat,
    linear-gradient(var(--yaqin-bg),var(--yaqin-bg)) 72px 50%/3px 10px no-repeat;
  opacity: .95;
}
.record-stop {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--yaqin-link);
  color: var(--yaqin-ink-inverse);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(59,110,245,.35);
}
.stop-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--yaqin-bg);
  display: block;
}
.stop-sq {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--yaqin-danger);
  display: block;
}

.chat-top-menu-wrap {
  position: relative;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}
.chat-top-menu-wrap > button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}
.chat-menu-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 200px;
  background: var(--yaqin-surface-raised);
  color: var(--yaqin-text);
  border: 1px solid var(--yaqin-sep-soft);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  padding: 6px 0;
}
.chat-menu-pop button {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 12px 16px;
  font-size: 16px;
  color: var(--yaqin-text);
}
.chat-menu-pop button.danger {
  color: var(--yaqin-danger);
}
.chat-menu-pop button:active { background: var(--yaqin-bg-subtle); }
.chat-page { position: relative; }

.chat-bubble.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-bubble.mine .bubble-body {
  align-items: flex-end;
  text-align: right;
}
.chat-bubble.mine .bubble-head {
  flex-direction: row-reverse;
}
.chat-bubble.mine .bubble-head b { color: var(--yaqin-link); }
.chat-bubble.mine > .bubble-body > p {
  background: var(--yaqin-bg-subtle);
  border-radius: 16px 16px 4px 16px;
  padding: 10px 12px;
}
.chat-bubble.mine .bubble-image {
  margin-left: auto;
}

.chats-pills {
  display: flex;
  gap: 8px;
  margin: 4px 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chats-pills::-webkit-scrollbar { display: none; }
.chats-pills button {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--yaqin-bg-subtle);
  color: var(--yaqin-text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
}
.chats-pills button.on {
  background: var(--yaqin-ink);
  color: var(--yaqin-ink-inverse);
}
.chats-inline-search {
  margin: 4px 0 10px;
}
.chat-kind {
  display: none;
}

/* Group hub — отступы как у person/event (~20px) */
.group-hub-page {
  min-height: 100%;
  background: var(--yaqin-bg);
  color: var(--yaqin-text);
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  position: relative;
}
.group-hub-top {
  position: absolute;
  top: max(12px, calc(var(--yaqin-safe-top, 0px) + 4px));
  left: var(--person-gutter, 20px);
  right: var(--person-gutter, 20px);
  z-index: 3;
  display: flex;
  justify-content: flex-start;
}
.group-hub-top button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  backdrop-filter: blur(8px);
}
/* Legacy cover (не person-hero): оставляем компактный вариант */
.group-hub-cover:not(.person-hero) {
  width: 100%;
  max-height: min(62dvh, 480px);
  border-radius: 0;
}
.person-hero.group-hub-cover {
  max-height: none;
}
.group-hub-body {
  margin-top: -28px;
  position: relative;
  z-index: 2;
  background: var(--yaqin-bg);
  border-radius: var(--yaqin-radius-xl) var(--yaqin-radius-xl) 0 0;
  padding: 20px var(--person-gutter, 20px) 28px;
}
.group-hub-city {
  display: block;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--yaqin-text-tertiary);
  margin-bottom: 6px;
}
.group-guest-page .people-going-wrap {
  margin: 0 var(--person-gutter, 20px) 12px;
}
.group-guest-page {
  padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
}
.group-hub-body h1 {
  margin: 0 0 8px;
  font-size: var(--yaqin-fs-title-sm);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.group-hub-about {
  margin: 0 0 8px;
  font-size: var(--yaqin-fs-body-rg);
  color: var(--yaqin-text-secondary);
  line-height: 1.4;
}
.group-hub-meta {
  margin: 0 0 20px;
  font-size: var(--yaqin-fs-caption);
  color: var(--yaqin-text-tertiary);
}
.group-hub-panel {
  margin-bottom: 12px;
}
.group-hub-body .people-going-wrap {
  margin-top: 4px;
  margin-left: 0;
  margin-right: 0;
}
.group-hub-body h3 {
  margin: 0 0 12px;
  font-size: var(--yaqin-fs-secondary);
  font-weight: 700;
}
.group-join-requests {
  display: grid;
  gap: 8px;
  margin: 0;
}
.group-join-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px 6px 6px 6px;
  border-radius: 14px;
  background: var(--yaqin-bg);
}
.group-join-hit {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 16px;
  gap: 10px;
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 6px 4px 6px 6px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.group-join-hit img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.group-join-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.group-join-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--yaqin-text);
}
.group-join-copy span {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  color: var(--yaqin-text-tertiary);
}
.group-join-hit > .ti {
  font-size: 16px;
  color: var(--yaqin-text-tertiary);
}
.group-join-row img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.group-join-row .group-join-accept,
.group-join-row .group-join-reject {
  margin-top: 0;
}
.group-join-row strong {
  display: block;
  font-size: 14px;
}
.group-join-row span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--yaqin-text-tertiary);
  white-space: normal;
}
.join-request-message {
  margin: 0 0 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--yaqin-bg-subtle);
  color: var(--yaqin-text);
  font-size: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.join-request-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  align-items: stretch;
}
.group-join-reject.sheet {
  width: 100%;
  height: auto;
  min-height: 52px;
  border-radius: var(--yaqin-radius-pill);
  padding: 14px 16px;
  font-size: var(--yaqin-fs-body);
  font-weight: 700;
}
.group-join-accept {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--yaqin-yellow);
  color: var(--yaqin-yellow-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}
.group-join-reject {
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--yaqin-bg-subtle);
  color: var(--yaqin-text);
  display: grid;
  place-items: center;
}
.group-hub-cta.two {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.group-hub-cta.one {
  grid-template-columns: 1fr;
}
.group-guest-page.event-detail-view {
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
}
.group-guest-page.event-detail-view:has(.sticky-page-cta > :nth-child(2)) {
  padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px));
}
.group-hub-cta .taneesh-buy-block {
  background: var(--yaqin-yellow) !important;
  color: var(--yaqin-yellow-ink) !important;
  -webkit-text-fill-color: var(--yaqin-yellow-ink) !important;
  font-size: 16px !important;
  font-weight: 700;
}
.group-hub-cta .taneesh-buy-block.ghost {
  background: var(--yaqin-bg-subtle) !important;
  color: var(--yaqin-text) !important;
  -webkit-text-fill-color: var(--yaqin-text) !important;
  box-shadow: inset 0 0 0 1px var(--yaqin-sep);
}

body[data-route='group'] .nav {
  display: none !important;
}
body[data-route='group'] .view {
  padding: 0 !important;
  overflow-y: auto !important;
}
.host-group-page {
  padding-bottom: 40px;
}
.host-group-page .people-going-wrap {
  margin-left: var(--person-gutter, 20px);
  margin-right: var(--person-gutter, 20px);
}
.host-group-page .me-mini-row {
  grid-template-columns: 36px 1fr 18px;
}
.host-group-page .me-mini-row .settings-icon {
  width: 36px;
  height: 36px;
  font-size: 18px;
  border-radius: 10px;
}
.chats-pills button b {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--yaqin-danger, #ff3b30);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.chats-pills button.on b {
  background: rgba(255,255,255,0.24);
}
.chats-compose-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.chats-compose-sheet {
  width: min(100%, 430px);
  background: var(--yaqin-bg);
  border-radius: 20px 20px 0 0;
  padding: 8px 16px calc(24px + var(--yaqin-safe-bottom, 0px));
}
.chats-compose-sheet h2 {
  margin: 8px 4px 14px;
  font-size: 20px;
}
.chats-compose-sheet > button[data-action] {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 0;
  background: var(--yaqin-surface-raised, #fff);
  border-radius: 14px;
  padding: 14px 12px;
  margin-bottom: 8px;
  font: inherit;
  color: var(--yaqin-text);
}
.chats-compose-sheet > button[data-action] span:nth-child(2) {
  flex: 1;
}
.chats-compose-sheet > button[data-action] small {
  display: block;
  margin-top: 2px;
  color: var(--yaqin-text-tertiary);
  font-weight: 400;
}
.chats-compose-cancel {
  width: 100%;
  margin-top: 8px;
  border: 0;
  background: transparent;
  padding: 14px;
  font: inherit;
  font-weight: 600;
  color: var(--yaqin-text-secondary);
}
.empty-badge.yellow {
  background: var(--yaqin-yellow);
}
body[data-route="group-chat"] .nav { display: none; }
body[data-route="group-chat"] .view { padding: 0 !important; }
.group-chat-lite .message-bar {
  flex-shrink: 0;
}
.group-chat-lite .chat-peer-photo {
  width: 36px;
  height: auto;
  aspect-ratio: var(--yaqin-content-ratio, 4 / 5);
  border-radius: 10px;
  flex: 0 0 36px;
}

.chat-content-thumb {
  width: 44px;
  flex-basis: 44px;
}

/* Вкладка Группы */
.groups-tab-page {
  min-height: 100%;
  background: var(--yaqin-bg);
  padding: var(--yaqin-space-2) var(--yaqin-gutter) 0;
  position: relative;
  color: var(--yaqin-text);
}
.groups-tab-page .groups-search {
  margin: 4px 0 10px;
}
.groups-pills {
  margin: 0 0 12px;
}
.groups-tab-list {
  display: grid;
  gap: 0;
  margin-top: 0;
  align-content: start;
  align-items: stretch;
  height: auto;
  min-height: 0;
}
.group-tab-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  align-self: start;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 10px 0;
  color: inherit;
  font: inherit;
  border-bottom: 1px solid var(--yaqin-sep-soft);
  box-sizing: border-box;
}
.group-tab-row:last-child {
  border-bottom: 0;
}
.group-tab-avatar {
  position: relative;
  width: 44px;
  aspect-ratio: var(--yaqin-content-ratio, 4 / 5);
  height: auto;
  border-radius: var(--yaqin-content-radius, 12px);
  overflow: hidden;
  background: var(--yaqin-bg-subtle);
}
.group-tab-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: block;
}
.group-tab-lock {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--yaqin-surface-raised);
  color: var(--yaqin-text);
  font-size: 11px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px var(--yaqin-bg);
}
.group-tab-row strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
}
.group-privacy {
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  color: var(--yaqin-text-tertiary);
}
.group-tab-row span {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: var(--yaqin-text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.groups-tab-empty {
  text-align: center;
  padding: 80px 20px 40px;
}
.groups-tab-empty h2 {
  margin: 0 0 8px;
  font-size: var(--yaqin-fs-title-sm);
}
.groups-tab-empty p {
  margin: 0 0 20px;
  color: var(--yaqin-text-secondary);
  line-height: 1.4;
}

.group-tab-copy { min-width: 0; }
.group-tab-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.group-tab-you {
  margin: 0;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--yaqin-link);
  flex: 0 0 auto;
}
.group-tab-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 36px;
}
.group-tab-meta time {
  font-size: 12px;
  color: var(--yaqin-text-tertiary);
  white-space: nowrap;
}
.group-privacy { display: none; }

.group-tab-row-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  border-bottom: 1px solid var(--yaqin-sep-soft);
}
.group-tab-row-wrap.with-chat {
  grid-template-columns: minmax(0, 1fr) 36px;
}
.group-tab-row-wrap:last-child { border-bottom: 0; }
.group-tab-row-wrap .group-tab-row {
  border-bottom: 0;
  padding-right: 4px;
}
.group-tab-row-wrap.unread .group-tab-copy strong {
  font-weight: 700;
}
.group-tab-row-wrap.unread .group-tab-copy > span {
  color: var(--yaqin-text);
  font-weight: 500;
}
.group-tab-row-wrap.unread .group-tab-meta time {
  color: var(--yaqin-link);
  font-weight: 600;
}
.group-tab-you.pending {
  color: var(--yaqin-text-tertiary);
}
.group-tab-activity {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  color: var(--yaqin-text-tertiary);
  white-space: nowrap;
}
.group-tab-flags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 14px;
}
.group-req-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}
.group-tab-chat {
  border: 0;
  background: none;
  color: var(--yaqin-text-tertiary);
  font-size: 18px;
  display: grid;
  place-items: center;
  padding: 0;
}
.group-tab-chat:active {
  color: var(--yaqin-link);
}
.group-tab-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.group-tab-tags em {
  margin: 0;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--yaqin-text-secondary);
  background: var(--yaqin-bg-subtle);
  border-radius: 999px;
  padding: 3px 8px;
}
.group-tab-tags em.district {
  color: var(--yaqin-link);
}
.groups-topic-chips {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.groups-topic-chips::-webkit-scrollbar { display: none; }
.groups-topic-chips button {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: transparent;
  color: var(--yaqin-text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px var(--yaqin-sep-soft);
}
.groups-topic-chips button.on {
  background: var(--yaqin-bg-subtle);
  color: var(--yaqin-text);
  box-shadow: inset 0 0 0 1px transparent;
}
.groups-empty-actions {
  display: grid;
  gap: 10px;
  justify-items: center;
  max-width: 280px;
  margin: 0 auto;
}
.groups-tab-empty.compact {
  padding-top: 48px;
}
.empty-secondary {
  border: 0;
  background: none;
  color: var(--yaqin-link);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 12px;
}

.chat-requests {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}
.chat-section { margin: 0 0 12px; }
.chat-section-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--yaqin-text-tertiary);
}
.chat-row-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: stretch;
  border-bottom: 1px solid var(--yaqin-sep-soft);
}
.chat-row-wrap:last-child { border-bottom: 0; }
.chat-row-wrap .chat-row {
  border: 0;
  padding-right: 4px;
}
.chat-row-more {
  border: 0;
  background: none;
  color: var(--yaqin-text-tertiary);
  font-size: 18px;
  display: grid;
  place-items: center;
}
.chat-row-flags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 14px;
}
.chat-mute-icon {
  font-size: 14px;
  color: var(--yaqin-text-tertiary);
}
.chat-compose-pop {
  margin: 0 0 10px;
  padding: 6px;
  border-radius: 14px;
  background: var(--yaqin-surface-raised);
  border: 1px solid var(--yaqin-sep-soft);
  display: grid;
  gap: 2px;
}
.chat-compose-pop button {
  border: 0;
  background: none;
  color: var(--yaqin-text);
  text-align: left;
  padding: 12px;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-compose-pop button:active { background: var(--yaqin-bg-subtle); }
.chat-compose-pop i { color: var(--yaqin-link); font-size: 18px; }
.chat-request-row {
  width: 100%;
  border: 0;
  background: var(--yaqin-bg-subtle);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  grid-template-columns: 36px 1fr 18px;
  gap: 12px;
  align-items: center;
  text-align: left;
  color: inherit;
  font: inherit;
  margin-bottom: 8px;
}
.chat-request-row strong { display: block; font-size: 15px; }
.chat-request-row small {
  display: block;
  margin-top: 2px;
  color: var(--yaqin-text-tertiary);
  font-size: 13px;
}
.chat-sheet-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 40;
}
.chat-action-sheet {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 41;
  background: var(--yaqin-surface-raised);
  border-radius: 18px;
  padding: 8px;
  display: grid;
  gap: 2px;
}
.chat-action-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 12px;
}
.chat-action-sheet header strong { font-size: 16px; }
.chat-action-sheet header button,
.chat-action-sheet > button {
  border: 0;
  background: none;
  color: var(--yaqin-text);
  font: inherit;
  text-align: left;
  padding: 14px 12px;
  border-radius: 12px;
}
.chat-action-sheet > button.danger { color: var(--yaqin-danger); }
.chat-action-sheet > button:active { background: var(--yaqin-bg-subtle); }
.chat-day-chip {
  margin: 14px auto 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--yaqin-bg-subtle);
  color: var(--yaqin-text-tertiary);
  font-size: 12px;
  font-weight: 600;
  width: fit-content;
}
.chat-system-msg {
  display: flex;
  justify-content: center;
  margin: 8px 16px;
}
.chat-system-msg span {
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
  color: var(--yaqin-text-tertiary);
  max-width: 280px;
}
.chat-reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid var(--yaqin-sep-soft);
  background: var(--yaqin-bg);
}
.chat-reply-bar div {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
  border-left: 3px solid var(--yaqin-link);
  padding-left: 10px;
}
.chat-reply-bar small {
  font-size: 12px;
  font-weight: 700;
  color: var(--yaqin-link);
}
.chat-reply-bar span {
  font-size: 13px;
  color: var(--yaqin-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-reply-bar button {
  border: 0;
  background: none;
  color: var(--yaqin-text-tertiary);
  font-size: 18px;
}
.message-react-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px 4px;
}
.message-react {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--yaqin-surface-raised);
  font-size: 22px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}
.bubble-reactions {
  margin-top: 6px;
  display: inline-flex;
  gap: 4px;
}
.bubble-reactions span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--yaqin-bg-subtle);
  font-size: 14px;
}
