:root {
  --accent: #0a84ff;
  --text: #1c1c1e;
  --secondary-text: #8e8e93;
  --background: #f2f2f7;
  --surface: rgba(242, 242, 247, 0.94);
  --card: #ffffff;
  --soft: #f7f7fa;
  --separator: rgba(60, 60, 67, 0.18);
  --segment-bg: transparent;
  --segment-inactive: #6a6a70;
  --row-divider: rgba(60, 60, 67, 0.08);
  --row-hover: rgba(0, 0, 0, 0.035);
  --card-elevated-border: rgba(60, 60, 67, 0.1);
  --chip-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  --msg-other: #ffffff;
  --msg-mine-bg: #e7f2ff;
  --msg-meta: rgba(60, 60, 67, 0.55);
  --search-bg: #fff;
  --danger: #d92d20;
  --label-muted: #6a7291;
  --sheet-surface: #ffffff;
  --sheet-elevated: rgba(255, 255, 255, 0.7);
  --sheet-bg: linear-gradient(180deg, #f8f9ff 0%, #eff1fb 100%);
  --sheet-title: #1b2340;
  --sheet-body: #1f2846;
  --sheet-muted: #5f6786;
  --sheet-field-label: #7a82a2;
  --sheet-placeholder: #a1a8c1;
  --sheet-divider: #edf0f8;
  --btn-surface: #ffffff;
  --btn-text: #2f3755;
  --quick-action-text: #4c5578;
  --quick-action-bg: rgba(255, 255, 255, 0.75);
  --disabled-text: #9ca4c0;
  --disabled-bg: #e9edf7;
  --context-menu-bg: rgba(255, 255, 255, 0.96);
  --chevron: #c7c7cc;
  --avatar-img-bg: #e8e8ed;
  --on-accent: #ffffff;
  --tab-icon-inactive: #818c99;
  --tab-icon-active: var(--accent);
  --info-panel-bg: #ffffff;
  --info-body-bg: #f0f2f6;
  --info-card-bg: #ffffff;
  --info-hero-gradient: linear-gradient(145deg, #5c6b7a 0%, #7d8fa3 45%, #9aabb9 100%);
  --info-icon-muted: #707579;
  --composer-bar-bg: #ffffff;
  --composer-input-bg: #f0f2f5;
  --composer-input-border: rgba(60, 60, 67, 0.12);
  --chat-wallpaper: url("./assets/wallpapers/cora-arcs-light.jpg");
  --profile-hero-gradient: linear-gradient(
    100deg,
    #dcd6ff 0%,
    #ebe4ff 24%,
    #f5e6ff 48%,
    #ffe8f3 74%,
    #fff8fb 100%
  );
  --profile-hero-btn-bg: rgba(255, 255, 255, 0.78);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --tab-icon-inactive: #8b95a5;
  --text: #f0f2f5;
  --secondary-text: #8b95a5;
  --background: #121421;
  --surface: rgba(26, 31, 46, 0.96);
  --card: #1a1f2e;
  --soft: #232838;
  --separator: rgba(255, 255, 255, 0.08);
  --segment-bg: transparent;
  --segment-inactive: #8b95a5;
  --row-divider: rgba(255, 255, 255, 0.06);
  --row-hover: rgba(255, 255, 255, 0.04);
  --card-elevated-border: rgba(255, 255, 255, 0.06);
  --chip-shadow: none;
  --msg-other: #232838;
  --msg-mine-bg: #2b5278;
  --msg-meta: rgba(235, 235, 245, 0.52);
  --search-bg: #1a1f2e;
  --label-muted: #8b95a5;
  --sheet-surface: #1a1f2e;
  --sheet-elevated: #232838;
  --sheet-bg: linear-gradient(180deg, #1a1f2e 0%, #121421 100%);
  --sheet-title: #f0f2f5;
  --sheet-body: #f0f2f5;
  --sheet-muted: #8b95a5;
  --sheet-field-label: #8b95a5;
  --sheet-placeholder: #636b7a;
  --sheet-divider: rgba(255, 255, 255, 0.08);
  --btn-surface: #232838;
  --btn-text: #f0f2f5;
  --quick-action-text: #f0f2f5;
  --quick-action-bg: #232838;
  --disabled-text: #636b7a;
  --disabled-bg: #232838;
  --context-menu-bg: rgba(26, 31, 46, 0.98);
  --chevron: #636b7a;
  --avatar-img-bg: #232838;
  --info-panel-bg: #1a1f2e;
  --info-body-bg: #121421;
  --info-card-bg: #232838;
  --info-hero-gradient: linear-gradient(145deg, #2a3548 0%, #3a4a60 50%, #4a5a72 100%);
  --info-icon-muted: #8b95a5;
  --composer-bar-bg: #1a1f2e;
  --composer-input-bg: #232838;
  --composer-input-border: rgba(255, 255, 255, 0.1);
  --chat-wallpaper: url("./assets/wallpapers/evening-gold.jpg");
  --profile-hero-gradient: linear-gradient(
    100deg,
    #2f2860 0%,
    #252245 28%,
    #1e2238 56%,
    #171b2c 100%
  );
  --profile-hero-btn-bg: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .profile-ios-row:active {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .theme-card.is-active {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

html[data-theme="dark"] .tab-bar {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}


html[data-accent="green"] { --accent: #34c759; }
html[data-accent="purple"] { --accent: #af52de; }
html[data-accent="orange"] { --accent: #ff9500; }
html[data-accent="red"] { --accent: #ff3b30; }

* {
  box-sizing: border-box;
}

html {
  overscroll-behavior: none;
  overflow-x: hidden;
  touch-action: pan-y pinch-zoom;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--background);
  color: var(--text);
  overscroll-behavior: none;
  overflow-x: hidden;
  touch-action: pan-y pinch-zoom;
}

input,
textarea,
button {
  color: inherit;
}

input::placeholder,
textarea::placeholder {
  color: var(--secondary-text);
}

h1,
h2,
h3,
p,
strong {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 14px 92px;
  position: relative;
  touch-action: pan-y pinch-zoom;
}

.app-shell:has(.chat-room-layout),
.app-shell.has-chat-info {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.tab-content {
  min-height: calc(100vh - 128px);
  position: relative;
  z-index: 1;
  touch-action: pan-y pinch-zoom;
}

.tab-content.is-swipe-dragging {
  transition: none;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.tab-content.is-swipe-releasing,
.tab-content.is-swipe-animating {
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.app-shell:has(.chat-room-layout) {
  display: flex;
  flex-direction: column;
  padding-bottom: 12px;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  box-sizing: border-box;
  overflow: hidden;
}

.tab-content:has(.chat-room-layout) {
  flex: 1;
  min-height: 0;
  height: calc(100vh - 24px);
  height: calc(100dvh - 24px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
}

.screen {
  display: grid;
  gap: 12px;
}

.screen-header h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ——— Feed tab ——— */
.feed-screen {
  gap: 14px;
  width: 100%;
}

.feed-screen-heading {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.feed-toolbar {
  display: grid;
  gap: 12px;
}

.feed-search {
  height: 50px;
  border-radius: 16px;
  background: var(--soft);
  border: 1px solid color-mix(in srgb, var(--separator) 22%, transparent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  padding: 0 14px;
}

html[data-theme="dark"] .feed-search {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

.feed-subs-fallback {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary, #6b7280);
}

.feed-stream {
  display: grid;
  gap: 14px;
}

.feed-card.is-search-hidden {
  display: none;
}

.feed-empty--search {
  margin-top: 2px;
}

.feed-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 16px;
  background: var(--soft);
  border: 0;
  box-shadow: none;
  transition: transform 0.18s ease;
}

html[data-theme="dark"] .feed-card {
  background: color-mix(in srgb, var(--soft) 88%, #000);
}

.feed-card--stream {
  animation: feed-card-in 0.42s ease both;
  animation-delay: calc(min(var(--feed-card-i, 0), 8) * 45ms);
}

@keyframes feed-card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feed-card.card--clickable:hover {
  transform: translateY(-1px);
}

.feed-card.card--clickable:active {
  transform: translateY(0) scale(0.995);
}

.feed-card-head {
  margin: 0;
  padding: 0;
}

.feed-card-meta {
  flex: 1;
  min-width: 0;
}

.feed-card-handle {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-card-handle .username-line {
  display: inline-flex;
}

.feed-card-name {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-card-time {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--secondary-text);
}

.post-head.feed-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar.avatar--feed {
  width: 44px;
  height: 44px;
  font-size: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.feed-card-content {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.feed-card-body {
  margin: 0;
  padding: 0;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text);
}

.feed-translate-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.feed-translate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.feed-translate-btn:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.feed-translate-btn.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.feed-translate-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: block;
}

.feed-translated-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary-text);
}

.feed-card-media {
  margin: 0;
  border-radius: 24px;
  overflow: hidden;
  background: color-mix(in srgb, var(--separator) 10%, var(--card));
}

.feed-card-media--single .feed-media-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.feed-card-media--single .feed-media-img {
  display: block;
  width: 100%;
  max-height: 420px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.feed-card-media--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}

.feed-card-media--grid.feed-card-media--n3 .feed-media-btn:first-child {
  grid-column: 1 / -1;
}

.feed-card-media--grid .feed-media-btn {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.feed-card-media--grid .feed-media-img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.feed-card-video {
  display: block;
  width: 100%;
  max-height: 420px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #000;
}

.feed-card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 12px 0 0;
  padding: 6px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--separator) 8%, var(--card));
  border-top: 0;
}

.feed-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    transform 0.12s ease;
}

.feed-action:focus {
  outline: none;
}

.feed-action:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .feed-action:hover {
    background: transparent;
    color: var(--text);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--secondary-text) 16%, transparent);
  }

  .feed-action.action-like:hover {
    color: #ff3b30;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, #ff3b30 30%, transparent);
  }

  .feed-action.action-comments:hover {
    color: var(--text);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent);
  }

  .feed-action.action-like.is-liked:hover {
    background: color-mix(in srgb, #ff3b30 5%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, #ff3b30 34%, transparent);
  }
}

.feed-action:active {
  transform: scale(0.96);
}

.feed-action-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}

.feed-action.action-like.is-liked {
  color: #ff3b30;
  background: transparent;
  box-shadow: none;
}

.feed-action.action-like.is-liked .feed-action-icon {
  fill: color-mix(in srgb, #ff3b30 24%, transparent);
  stroke: #ff3b30;
}

.feed-action.action-share {
  min-width: 36px;
  padding: 0 8px;
}

.feed-empty {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 28px 20px;
  border-radius: 24px;
  background: var(--soft);
  border: 0;
}

.feed-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--soft));
}

.feed-empty-icon .feed-hero-icon {
  width: 26px;
  height: 26px;
}

.feed-empty-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.feed-empty-hint {
  margin: 0;
  max-width: 28ch;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--secondary-text);
}

@media (prefers-reduced-motion: reduce) {
  .feed-card--stream {
    animation: none;
  }

  .feed-card.card--clickable:hover {
    transform: none;
  }
}

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

.chats-screen-heading {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.chats-settings-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color 0.18s ease, transform 0.12s ease;
}

.chats-settings-btn:hover {
  background: rgba(10, 132, 255, 0.12);
}

.chats-settings-btn:active {
  transform: scale(0.94);
}

.chats-settings-icon {
  display: block;
  pointer-events: none;
}

.chats-settings-page {
  display: grid;
  gap: 12px;
}

.chats-settings-top {
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr minmax(72px, auto);
  align-items: center;
}

.chats-settings-top-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  text-align: center;
}

.chats-settings-top-spacer {
  display: block;
  min-width: 72px;
}

.chats-settings-lead {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--secondary-text);
  letter-spacing: 0;
}

.chats-settings-static-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.chats-settings-nav-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.chats-settings-nav-row:active {
  opacity: 0.72;
}

.chats-settings-nav-text {
  flex: 1;
  min-width: 0;
}

.chats-settings-nav-row .profile-ios-chevron {
  flex-shrink: 0;
  color: var(--secondary-text);
  opacity: 0.55;
}

.chats-settings-static-icon {
  font-size: 20px;
  line-height: 1.2;
  margin-top: 2px;
}

.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

@media (min-width: 560px) {
  .wallpaper-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.wallpaper-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  overflow: hidden;
}

.wallpaper-tile-img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  background: var(--soft);
}

.wallpaper-tile-label {
  font-size: 12px;
  font-weight: 600;
  padding: 0 4px 2px;
  color: var(--secondary-text);
}

.wallpaper-tile.is-selected {
  border-color: var(--accent);
}

.wallpaper-tile.is-selected .wallpaper-tile-label {
  color: var(--text);
}

.wallpaper-tile-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent, #fff);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  border: 1px solid transparent;
  border-radius: 28px;
  padding: 0 14px;
  background: var(--search-bg);
  color: var(--secondary-text);
}

.search-input {
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  font: inherit;
  color: var(--text);
}

.search-input::placeholder {
  color: var(--secondary-text);
}

.search-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--secondary-text);
}

.chats-toolbar {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.chats-toolbar .chats-search-wrap {
  flex: 1;
  min-width: 0;
}

.chats-favorites-btn {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 26px;
  border: 1px solid transparent;
  background: var(--soft);
  color: var(--secondary-text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
}

.chats-favorites-btn:hover {
  color: var(--text);
  background: rgba(10, 132, 255, 0.06);
}

.chats-favorites-btn:active {
  transform: scale(0.96);
}

.chats-favorites-btn.is-active {
  color: var(--on-accent);
  border-color: transparent;
  background: linear-gradient(155deg, #ffcc00 0%, #ff9500 55%, #ff7a00 100%);
  box-shadow: 0 6px 16px rgba(255, 149, 0, 0.38);
}

.chats-favorites-btn.is-active:hover {
  color: var(--on-accent);
  box-shadow: 0 8px 20px rgba(255, 149, 0, 0.45);
}

.chats-favorites-icon {
  display: block;
  pointer-events: none;
}

.segment {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  background: var(--segment-bg);
  border-radius: 0;
  width: 100%;
  max-width: none;
}

.segment.segment--quad button {
  font-size: 13px;
}

.segment button {
  flex: 0 1 auto;
  min-width: 0;
  border: 0;
  border-radius: 20px;
  background: var(--soft);
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--segment-inactive);
  cursor: pointer;
  box-shadow: none;
}

.segment button.is-active {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: none;
}

.feed-segment-bar.segment--feed {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  padding: 3px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--separator) 28%, var(--soft));
  width: 100%;
}

.feed-segment-bar.segment--feed button {
  flex: 1 1 0;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: transparent;
  color: var(--secondary-text);
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
}

.feed-segment-bar.segment--feed button.is-active {
  background: var(--card);
  color: var(--text);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.06);
}

html[data-theme="dark"] .feed-segment-bar.segment--feed {
  background: color-mix(in srgb, var(--separator) 22%, var(--soft));
}

html[data-theme="dark"] .feed-segment-bar.segment--feed button.is-active {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.28),
    0 2px 8px rgba(0, 0, 0, 0.22);
}

.card--clickable {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease;
}

.card--clickable:active {
  transform: scale(0.99);
}

.card--clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.actions button {
  border: 0;
  background: transparent;
  padding: 4px 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.actions .action-like.is-liked {
  color: var(--accent);
}

.card {
  background: var(--card);
  border: 1px solid var(--card-elevated-border);
  border-radius: 30px;
  padding: 16px;
  color: var(--text);
  box-shadow: var(--chip-shadow);
}

.post-head,
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-head {
  margin-bottom: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--on-accent);
  font-weight: 700;
  font-size: 14px;
}

.avatar.blue {
  background: #0a84ff;
}
.avatar.purple {
  background: #af52de;
}
.avatar.green {
  background: #34c759;
}

.avatar.avatar--img {
  padding: 0;
  overflow: hidden;
  background: var(--avatar-img-bg);
}

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

.avatar.avatar--header {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.meta {
  display: grid;
  gap: 2px;
}

.meta strong {
  font-size: 14px;
  color: var(--text);
}

.meta span,
.muted {
  color: var(--secondary-text);
  font-size: 12px;
  font-weight: 600;
}

.post-body {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  color: var(--text);
}

.actions {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary-text);
}

.chat-live {
  background: var(--card);
  border-radius: 22px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.chat-status {
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary-text);
}

.msg-list {
  display: flex;
  flex-direction: column;
  align-content: flex-start;
  gap: 8px;
  overflow: auto;
}

.msg {
  position: relative;
  max-width: min(82%, 520px);
  width: fit-content;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14.2px;
  line-height: 19px;
  letter-spacing: 0.01em;
  color: var(--text);
  word-break: break-word;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.msg-bubble {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.msg-bubble-core {
  position: absolute;
  inset: 0;
  background: var(--msg-other);
  border-radius: 17px;
  border-bottom-left-radius: 0;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.08);
}

.msg-bubble-tail {
  position: absolute;
  bottom: -3px;
  display: block;
  width: 9px;
  height: 20px;
  overflow: visible;
}

.msg-bubble-tail--other {
  left: -8px;
}

.msg-bubble-tail--mine {
  right: -8px;
}

.msg-bubble-tail-shadow {
  fill: rgba(11, 20, 26, 0.14);
}

.msg-bubble-tail-fill {
  fill: var(--msg-other);
}

.msg.mine .msg-bubble-core {
  background: var(--msg-mine-bg);
  border-radius: 17px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 17px;
}

.msg.mine .msg-bubble-tail-fill {
  fill: var(--msg-mine-bg);
}

html[data-theme="dark"] .msg-bubble-tail-shadow {
  fill: rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .msg.other .msg-bubble-core {
  border-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .msg.mine {
  color: #e9edef;
}

.msg-body {
  position: relative;
  z-index: 1;
  padding: 5px 10px 7px 12px;
}

.msg-content {
  display: block;
  min-width: 0;
}

.msg-main {
  display: block;
}

.msg-text {
  display: inline;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-link {
  color: #2481cc;
  text-decoration: underline;
  text-decoration-color: rgba(36, 129, 204, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  word-break: break-all;
}

.msg-link:hover {
  color: #1a6fb3;
}

.msg.mine .msg-link,
.msg.other .msg-link {
  color: #2481cc;
  text-decoration-color: rgba(36, 129, 204, 0.45);
}

.msg-link-preview {
  display: block;
  width: 100%;
  min-width: 240px;
  max-width: min(100%, 340px);
  margin-top: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-decoration: none;
  color: #111;
  box-shadow: none;
}

.msg-link-preview-inner {
  display: grid;
  gap: 5px;
  padding: 1px 0 1px 10px;
  border-left: 3px solid #63c956;
}

.msg-link-preview-site {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: #4fae4a;
}

.msg-link-preview-site--loading {
  color: #4fae4a;
}

.msg-link-preview-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.28;
  color: #111;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.msg-link-preview-desc {
  font-size: 13px;
  line-height: 1.34;
  color: #111;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}

.msg-link-preview-desc .msg-link {
  color: #2481cc;
}

.msg-link-preview-media {
  width: 100%;
  margin-top: 2px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.06);
}

.msg-link-preview-img {
  display: block;
  width: 100%;
  max-height: 196px;
  object-fit: cover;
  border-radius: 8px;
}

html[data-theme="dark"] .msg-link-preview {
  color: #f2f2f7;
}

html[data-theme="dark"] .msg-link-preview-title,
html[data-theme="dark"] .msg-link-preview-desc {
  color: #f2f2f7;
}

html[data-theme="dark"] .msg-link-preview-site,
html[data-theme="dark"] .msg-link-preview-site--loading {
  color: #7dca78;
}

html[data-theme="dark"] .msg-link-preview-inner {
  border-left-color: #7dca78;
}

.msg-inline--link-preview {
  width: 100%;
  min-width: 240px;
}

.msg-inline--link-preview .msg-link-preview {
  margin-top: 0;
}

.msg-inline--link-preview .msg-text + .msg-link-preview {
  margin-top: 6px;
}

.msg-inline--link-preview .msg-footer {
  margin-top: 2px;
}

.msg.msg--has-link-preview {
  max-width: min(88%, 360px);
}

.msg.msg--link-only-preview {
  min-width: 240px;
}

.msg-inline--link-preview .msg-text {
  display: block;
  margin-bottom: 2px;
}

.msg-inline--link-preview .msg-link-preview {
  margin-top: 2px;
}

.msg-link-preview:hover .msg-link-preview-title {
  opacity: 0.92;
}

.msg-link-preview--pending {
  margin-top: 2px;
  pointer-events: none;
  cursor: default;
}

.msg-link-preview-media--skeleton {
  width: 100%;
  min-height: 148px;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0.08) 50%,
    rgba(0, 0, 0, 0.05) 100%
  );
  background-size: 200% 100%;
  animation: msg-link-preview-shimmer 1.1s ease-in-out infinite;
}

.msg-link-preview-skeleton-line {
  height: 10px;
  width: 88%;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.07);
  animation: msg-link-preview-shimmer 1.1s ease-in-out infinite;
  background-size: 200% 100%;
}

.msg-link-preview-skeleton-line--title {
  width: 72%;
  height: 12px;
}

html[data-theme="dark"] .msg-link-preview-media--skeleton,
html[data-theme="dark"] .msg-link-preview-skeleton-line {
  background: rgba(255, 255, 255, 0.08);
}

@keyframes msg-link-preview-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.msg-inline .msg-link-preview {
  clear: both;
}

.msg-inline {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-end;
  column-gap: 6px;
  row-gap: 1px;
  max-width: 100%;
  width: fit-content;
  min-width: min(100%, 48px);
}

.msg-inline .msg-text {
  display: block;
  flex: 1 1 auto;
  min-width: min(100%, 3ch);
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-inline .msg-link-preview {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
}

.msg-inline .msg-footer {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  margin-left: auto;
  align-self: flex-end;
  float: none;
  position: static;
  top: auto;
  margin-top: 0;
  white-space: nowrap;
  user-select: none;
}

.msg-footer {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  user-select: none;
}

.msg-time {
  font-size: 11px;
  line-height: 15px;
  font-weight: 400;
  color: var(--msg-meta);
  font-variant-numeric: tabular-nums;
}

.msg--has-reply .msg-body {
  padding-top: 4px;
}

.msg-reply {
  display: flex;
  align-items: stretch;
  margin: 0 0 6px;
  border-radius: 8px;
  overflow: hidden;
  max-width: 100%;
}

.msg-reply-accent {
  flex: 0 0 4px;
  width: 4px;
  background: var(--accent);
  border-radius: 4px 0 0 4px;
}

.msg-reply-body {
  flex: 1;
  min-width: 0;
  padding: 5px 10px 6px 8px;
}

.msg.mine .msg-reply-body {
  background: rgba(10, 132, 255, 0.16);
}

.msg.other .msg-reply-body {
  background: rgba(10, 132, 255, 0.1);
}

html[data-theme="dark"] .msg.mine .msg-reply-body {
  background: rgba(10, 132, 255, 0.24);
}

html[data-theme="dark"] .msg.other .msg-reply-body {
  background: rgba(10, 132, 255, 0.16);
}

.msg-reply-author {
  display: block;
  font-weight: 700;
  font-size: 13px;
  line-height: 16px;
  color: var(--accent);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-reply-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 14px;
  line-height: 18px;
  font-weight: 400;
  color: var(--text);
  opacity: 0.88;
  word-break: break-word;
}

.msg-edited {
  color: var(--msg-meta);
  font-size: 11px;
  line-height: 15px;
}

.msg-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  width: 16px;
  min-width: 16px;
  line-height: 0;
  margin-left: 1px;
}

.msg-status-icon {
  display: block;
  flex-shrink: 0;
}

.msg-status--sent {
  color: var(--msg-meta);
  opacity: 0.72;
}

.msg-status--delivered {
  color: var(--msg-meta);
}

.msg-status--read {
  color: var(--accent);
}

.msg.mine {
  margin-left: auto;
}

.msg.other {
  background: transparent;
}

.msg.other .msg-bubble-core {
  border: 1px solid rgba(11, 20, 26, 0.05);
}

.msg-date {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--secondary-text);
  margin: 8px 0 4px;
  letter-spacing: 0.02em;
}

html[data-theme="light"] .msg-date {
  color: #ffffff;
}

.msg-row {
  display: flex;
  align-items: flex-start;
  width: 100%;
  flex-shrink: 0;
}

.msg-row.mine {
  justify-content: flex-end;
  padding-right: 9px;
}

.msg-row.other {
  padding-left: 9px;
}

.msg-reaction-quick {
  position: absolute;
  top: -34px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--separator);
  border-radius: 999px;
  background: var(--context-menu-bg);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(0.96);
  transition: opacity 0.12s ease, transform 0.12s ease;
  backdrop-filter: blur(10px);
}

.msg.other .msg-reaction-quick {
  left: 0;
}

.msg.mine .msg-reaction-quick {
  right: 0;
}

.msg:hover .msg-reaction-quick,
.msg:focus-within .msg-reaction-quick {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.msg-reaction-quick-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.msg-reaction-quick-btn:hover,
.msg-reaction-quick-btn:focus {
  background: rgba(10, 132, 255, 0.12);
}

.msg-reactions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.msg.mine .msg-reactions {
  justify-content: flex-end;
}

.msg-reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--separator));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
  color: var(--text);
  font-size: 13px;
  line-height: 16px;
  font-weight: 700;
  cursor: pointer;
}

.msg-reaction-chip.is-active {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--separator));
  background: color-mix(in srgb, var(--accent) 18%, var(--card));
  color: var(--accent);
}

.msg-reaction-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.msg.is-selected .msg-bubble-core {
  box-shadow:
    0 0 0 2px rgba(52, 199, 89, 0.82),
    0 1px 0.5px rgba(11, 20, 26, 0.08);
}

.msg.is-search-hit .msg-bubble-core {
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent) 54%, transparent),
    0 8px 24px color-mix(in srgb, var(--accent) 18%, transparent);
}

.msg.is-search-match .msg-bubble-core {
  background: color-mix(in srgb, #ffd60a 16%, var(--msg-other));
}

.msg.mine.is-search-match .msg-bubble-core {
  background: color-mix(in srgb, #ffd60a 18%, var(--msg-mine-bg));
}

.msg-search-mark {
  padding: 0 1px;
  border-radius: 3px;
  background: color-mix(in srgb, #ffd60a 72%, transparent);
  color: inherit;
}

.msg.mine.is-selected .msg-bubble-core {
  background: color-mix(in srgb, #34c759 14%, var(--msg-mine-bg));
}

.msg.other.is-selected .msg-bubble-core {
  background: color-mix(in srgb, #34c759 10%, var(--msg-other));
}

.msg.mine.is-selected .msg-bubble-tail-fill {
  fill: color-mix(in srgb, #34c759 14%, var(--msg-mine-bg));
}

.msg-row.is-selected {
  position: relative;
}

.chat-room-footer {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--composer-bar-bg);
  border-top: 1px solid var(--separator);
}

.chat-room-composer-panel {
  display: flex;
  flex-direction: column;
}

.chat-room-composer-panel.is-hidden,
.chat-room-conversation.is-selection-mode .chat-room-composer-panel {
  display: none !important;
}

.chat-selection-bar {
  flex: 0 0 auto;
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 12px 16px;
  background: var(--composer-bar-bg);
}

.chat-selection-bar.is-hidden {
  display: none !important;
}

.chat-room-conversation.is-selection-mode .chat-selection-bar,
.chat-selection-bar:not(.is-hidden) {
  display: flex !important;
}

.chat-selection-delete {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: #e87070;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-selection-delete:disabled {
  opacity: 0.4;
  cursor: default;
}

.chat-selection-delete:not(:disabled):hover {
  color: #d85a5a;
  background: transparent;
}

.chat-selection-delete:focus {
  outline: none;
}

.chat-selection-delete:focus-visible {
  outline: 2px solid rgba(232, 112, 112, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

.chat-selection-delete .icon-trash {
  display: block;
  width: 22px;
  height: auto;
  flex-shrink: 0;
}

.chat-selection-delete-label {
  font-size: 16px;
  font-weight: 500;
}

.chat-selection-count {
  margin-left: auto;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

.chat-typing {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  padding: 0 14px 6px;
  min-height: 0;
  background: var(--soft);
}

.chat-typing:empty {
  display: none;
  padding: 0;
}

.composer {
  display: flex;
  gap: 8px;
}

.composer input {
  flex: 1;
  border: 1px solid var(--separator);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  background: var(--soft);
  color: var(--text);
}

.composer input::placeholder {
  color: var(--secondary-text);
}

.composer button {
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0 12px;
  font-weight: 700;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}

.modal.is-open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 16, 0.22);
}

.confirm-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 10, 16, 0.42);
}

.confirm-dialog-panel {
  width: min(360px, 100%);
  padding: 20px 18px 16px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--separator);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.confirm-dialog-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  text-align: center;
}

.confirm-dialog-message {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}

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

.confirm-dialog-btn {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.confirm-dialog-btn--cancel {
  background: var(--soft);
  color: var(--text);
}

.confirm-dialog-btn--ok {
  background: var(--accent);
  color: var(--on-accent);
}

.confirm-dialog-btn--danger {
  background: #d92d20;
  color: #fff;
}

.confirm-dialog-btn--cancel:hover {
  filter: brightness(0.97);
}

.confirm-dialog-btn--ok:hover {
  filter: brightness(1.05);
}

.confirm-dialog-btn--danger:hover {
  filter: brightness(1.06);
}

.add-contact-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  border-radius: 30px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(10, 132, 255, 0.16), rgba(10, 132, 255, 0) 45%),
    var(--sheet-bg);
  border: 1px solid var(--separator);
  color: var(--text);
  padding: 16px;
  box-shadow: 0 28px 64px rgba(15, 24, 48, 0.26);
}

.add-contact-page {
  min-height: calc(100vh - 24px);
  display: flex;
}

.add-contact-page .add-contact-sheet {
  position: relative;
  inset: auto;
  left: auto;
  top: auto;
  transform: none;
  width: 100%;
  max-height: none;
}

.sheet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sheet-top-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--label-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sheet-cancel,
.sheet-close {
  border: 0;
  height: 38px;
  border-radius: 21px;
  padding: 0 14px;
  background: var(--btn-surface);
  color: var(--btn-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(31, 42, 77, 0.08);
}

.sheet-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--sheet-title);
}

.sheet-label {
  color: var(--sheet-muted);
  font-size: 14px;
  font-weight: 700;
  margin: 8px 0 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sheet-subtitle {
  color: var(--sheet-muted);
  font-size: 13px;
  line-height: 1.35;
  margin: 4px 0 0;
}

.contact-hero {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  align-items: center;
  background: var(--sheet-elevated);
  border: 1px solid var(--separator);
  border-radius: 22px;
  padding: 12px;
  margin-bottom: 12px;
}

.contact-avatar {
  width: 70px;
  height: 70px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--on-accent);
  background: linear-gradient(140deg, #0a84ff 0%, #5a63ff 100%);
  box-shadow: 0 10px 24px rgba(10, 132, 255, 0.35);
}

.sheet-fields {
  border-radius: 24px;
  background: var(--sheet-surface);
  overflow: hidden;
  border: 1px solid var(--separator);
  box-shadow: 0 10px 26px rgba(26, 38, 80, 0.08);
}

.sheet-field-wrap {
  padding: 9px 14px 10px;
}

.sheet-field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--sheet-field-label);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sheet-field {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--sheet-body);
  padding: 2px 0 1px;
}

.sheet-field::placeholder {
  color: var(--sheet-placeholder);
}

.sheet-fields .divider {
  height: 1px;
  background: var(--sheet-divider);
  margin-left: 16px;
}

.sheet-save {
  margin-top: 14px;
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 700;
  color: var(--on-accent);
  background: linear-gradient(135deg, #0a84ff 0%, #5964ff 100%);
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(10, 132, 255, 0.28);
}

.contact-quick-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick-action {
  border: 1px solid var(--separator);
  border-radius: 14px;
  background: var(--quick-action-bg);
  height: 40px;
  font-size: 12px;
  font-weight: 700;
  color: var(--quick-action-text);
  cursor: pointer;
}

.sheet-save.is-disabled {
  color: var(--disabled-text);
  background: var(--disabled-bg);
  box-shadow: none;
  cursor: default;
}

@media (max-width: 700px) {
  .add-contact-sheet {
    top: 0;
    left: 0;
    transform: none;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    padding: 16px;
  }

  .sheet-title { font-size: 32px; }
  .contact-hero {
    grid-template-columns: 58px 1fr;
  }
  .contact-avatar {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    font-size: 20px;
  }
}

.list-card {
  background: var(--card);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--card-elevated-border);
  box-shadow: var(--chip-shadow);
}

.list-card--chats {
  background: transparent;
  border-radius: 0;
  overflow: visible;
  border: 0;
  box-shadow: none;
}

.list-card--chats .row {
  padding: 14px 4px;
}

.row {
  padding: 12px 14px;
}

.row-btn {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.chat-row.row-btn {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.list-card--chats .row + .row {
  border-top: 1px solid var(--row-divider);
}

.list-card--chats .row-btn:hover {
  background: var(--row-hover);
  border-radius: 14px;
}

.list-card .row + .row {
  border-top: 1px solid var(--row-divider);
}

.chats-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary-text);
  letter-spacing: 0.02em;
}

.chats-section-icon {
  font-size: 14px;
  line-height: 1;
}

/* ——— Contacts tab ——— */

.contacts-screen {
  gap: 14px;
}

.contacts-search {
  margin-top: 2px;
}

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

.contacts-quick-action {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: var(--soft);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease;
}

html[data-theme="light"] .contacts-quick-action {
  border-color: var(--card-elevated-border);
  box-shadow: var(--chip-shadow);
}

.contacts-quick-action:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--soft));
}

.contacts-quick-action:active {
  transform: scale(0.98);
}

.contacts-quick-action-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--accent);
}

.contacts-quick-action span {
  min-width: 0;
  line-height: 1.25;
}

.contacts-section-header {
  padding: 4px 4px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary-text);
}

.list-card--contacts {
  background: transparent;
  border-radius: 0;
  overflow: visible;
  border: 0;
  box-shadow: none;
}

.list-card--contacts .contact-row {
  padding: 14px 4px;
}

.list-card--contacts .contact-row + .contact-row {
  border-top: 1px solid var(--row-divider);
}

.contact-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.contact-avatar-wrap .avatar {
  width: 50px;
  height: 50px;
  font-size: 16px;
}

.contact-online-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #34c759;
  border: 2px solid var(--background);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.contact-status--online {
  color: #34c759 !important;
  font-weight: 600;
}

.contact-status--typing {
  color: var(--accent) !important;
  font-weight: 600;
}

.contact-row--empty {
  justify-content: center;
}

.row .title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.row .subtitle {
  color: var(--secondary-text);
  font-size: 13px;
}

.chat-title-with-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chat-row-meta {
  margin-left: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.chat-row-time {
  white-space: nowrap;
}

.chat-unread-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent, #fff);
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.chat-row.has-unread .title {
  font-weight: 700;
}

.chat-badge {
  font-size: 12px;
  line-height: 1;
  opacity: 0.85;
}

.chat-kind-hint {
  display: inline-block;
  margin-right: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--secondary-text);
  letter-spacing: 0.02em;
}

.context-menu {
  position: fixed;
  z-index: 400;
  min-width: 200px;
  padding: 6px;
  border-radius: 14px;
  background: var(--context-menu-bg);
  border: 1px solid var(--separator);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
}

.context-menu button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.context-menu button:hover {
  background: rgba(10, 132, 255, 0.1);
}

.context-menu-reactions {
  display: flex;
  gap: 4px;
  padding: 4px 4px 7px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--separator);
}

.context-menu .context-menu-reactions button {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  text-align: center;
  font-size: 17px;
  line-height: 32px;
}

.reaction-popover {
  position: fixed;
  z-index: 420;
  min-width: 190px;
  max-width: min(280px, calc(100vw - 16px));
  padding: 8px;
  border: 1px solid var(--separator);
  border-radius: 16px;
  background: var(--context-menu-bg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  color: var(--text);
  backdrop-filter: blur(12px);
}

.reaction-popover-title {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--secondary-text);
}

.reaction-popover-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 6px;
  border-radius: 12px;
}

.reaction-popover-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, var(--card));
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.reaction-popover-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}

.context-menu button.context-menu-danger {
  color: #d92d20;
}

.context-menu button.context-menu-danger:hover {
  background: rgba(217, 45, 32, 0.1);
}

.profile-screen {
  gap: 14px;
}

.profile-hero {
  margin: 0;
  padding: 10px 14px 20px;
  background: var(--profile-hero-gradient);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

html[data-theme="light"] .profile-hero {
  border-color: rgba(60, 60, 67, 0.1);
}

html[data-theme="dark"] .profile-hero {
  border-color: rgba(255, 255, 255, 0.08);
}

.profile-hero-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.profile-hero-top-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.profile-hero-icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--profile-hero-btn-bg);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
}

.profile-hero-icon-btn .chats-settings-icon {
  width: 22px;
  height: 22px;
}

.profile-identity {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.profile-identity-text {
  min-width: 0;
  flex: 1;
  padding-top: 4px;
}

.profile-handle {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
}

.profile-display-name {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.profile-bio {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--secondary-text);
}

.profile-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  flex-shrink: 0;
  overflow: hidden;
  display: block;
}

.profile-avatar-shell {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
}

.profile-avatar-add-btn {
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.profile-avatar-add-btn:hover {
  filter: brightness(1.06);
}

.profile-avatar-add-icon {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
}

.profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-online-dot {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #34c759;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.profile-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  margin-top: 16px;
}

.profile-bio--empty {
  opacity: 0.55;
}

.peer-profile-screen .profile-hero-top {
  justify-content: space-between;
}

.profile-action-row > * {
  min-width: 0;
}

.profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  min-height: 46px;
  max-width: 100%;
  padding: 0 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.profile-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-btn-glyph {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}

.profile-btn-glyph--accent {
  color: var(--accent);
}

.profile-btn--primary {
  min-width: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

.profile-btn--primary:hover {
  filter: brightness(1.06);
}

.profile-btn--primary .profile-btn-glyph {
  color: #fff;
}

.profile-btn--secondary {
  min-width: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

html[data-theme="light"] .profile-btn--secondary {
  color: var(--text);
  border-color: rgba(60, 60, 67, 0.16);
  background: rgba(255, 255, 255, 0.45);
}

.profile-btn--secondary:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="light"] .profile-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(60, 60, 67, 0.22);
}

.profile-btn--icon {
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 14px;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

html[data-theme="light"] .profile-btn--icon {
  color: var(--text);
  border-color: rgba(60, 60, 67, 0.16);
  background: rgba(255, 255, 255, 0.45);
}

.profile-btn--icon:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="light"] .profile-btn--icon:hover {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(60, 60, 67, 0.22);
}

@media (max-width: 520px) {
  .profile-action-row {
    grid-template-columns: 1fr;
  }

  .profile-btn {
    font-size: 13px;
    padding: 0 14px;
  }

  .profile-btn--primary span,
  .profile-btn--secondary span {
    overflow: visible;
    text-overflow: clip;
  }
}

.profile-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--card);
  border: 1px solid var(--card-elevated-border);
  border-radius: 20px;
  box-shadow: var(--chip-shadow);
  padding: 14px 6px;
}

.profile-stat {
  position: relative;
  text-align: center;
  padding: 0 4px;
}

.profile-stat + .profile-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--separator);
}

.profile-stat strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.profile-stat span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--secondary-text);
}

.profile-icon-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-icon-nav-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-icon-nav-row--compose {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.profile-media-item {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 12px;
  overflow: hidden;
  max-width: none;
  line-height: 0;
}

.profile-media-thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--soft);
  max-width: none;
  max-height: none;
  border-radius: 0;
}

.profile-icon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--chip-shadow);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.profile-icon-pill:hover {
  filter: brightness(1.03);
}

.profile-icon-pill.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

.profile-icon-glyph {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: block;
}

.profile-icon-glyph--stroke {
  stroke-width: 2;
}

.profile-icon-pill.is-active .profile-icon-glyph--stroke {
  stroke-width: 2.15;
}

.profile-tabs {
  display: flex;
  align-items: stretch;
  gap: 24px;
  border-bottom: 1px solid var(--separator);
  padding: 0 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.profile-tab {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  padding: 10px 0 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--secondary-text);
  cursor: pointer;
  position: relative;
}

.profile-tab.is-active {
  color: var(--accent);
}

.profile-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
}

.profile-content {
  display: grid;
  gap: 12px;
}

.profile-content .profile-channel-card {
  margin: 0;
}

.profile-post-card {
  padding: 16px;
}

.profile-posts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-compose-cta {
  margin-top: 10px;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.profile-btn--compose .profile-btn-glyph--accent {
  color: var(--accent);
}

.feed-compose-page .feed-compose-card {
  background: var(--card);
  border: 1px solid var(--card-elevated-border);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--chip-shadow);
}

.feed-compose-author {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.feed-compose-text {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 17px;
  line-height: 1.45;
  outline: none;
}

.feed-compose-text::placeholder {
  color: var(--muted);
}

.feed-compose-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.feed-compose-preview {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 12px;
  overflow: hidden;
}

.feed-compose-preview--video {
  width: 140px;
  height: 88px;
}

.feed-compose-preview--audio {
  width: auto;
  min-width: 160px;
  max-width: 100%;
  height: auto;
  overflow: visible;
}

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

.feed-compose-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.feed-compose-tools {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--card-elevated-border);
}

.feed-compose-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--composer-input-bg);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.feed-compose-tool .chat-composer-glyph {
  width: 20px;
  height: 20px;
}

.feed-compose-publish {
  width: 100%;
}

.profile-post-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.profile-post-top .post-head {
  margin-bottom: 0;
  min-width: 0;
}

.profile-post-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.profile-post-tool {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--secondary-text);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.profile-post-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 4px;
}

.profile-post-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.profile-post-action:focus {
  outline: none;
}

.profile-post-action:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .profile-post-action:hover {
    color: var(--text);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--secondary-text) 16%, transparent);
  }

  .profile-post-action:first-child:hover {
    color: #ff3b30;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, #ff3b30 30%, transparent);
  }

  .profile-post-action:nth-child(2):hover {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent);
  }
}

.profile-post-action svg {
  width: 18px;
  height: 18px;
}

.profile-header {
  background: var(--card);
  border: 1px solid var(--card-elevated-border);
  border-radius: 36px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--chip-shadow);
}

.profile-avatar-block {
  flex-shrink: 0;
}

.profile-avatar-btn {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 30px;
  line-height: 0;
}

.profile-avatar-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.profile-avatar-circle {
  width: 86px;
  height: 86px;
  border-radius: 30px;
  display: block;
}

.profile-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-edit-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--separator);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
}

.profile-header .meta strong,
.profile-username {
  color: var(--text);
}

.profile-username {
  font-size: 22px;
}

.username-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  line-height: 0;
  vertical-align: middle;
}

.verified-badge-svg {
  width: 1.15em;
  height: 1.15em;
  display: block;
}

.meta strong .verified-badge-svg,
.info-detail-primary .verified-badge-svg {
  width: 18px;
  height: 18px;
}

.profile-username .verified-badge-svg {
  width: 22px;
  height: 22px;
}

.profile-header .meta > span {
  color: var(--secondary-text);
}

.profile-settings-link .title {
  text-align: left;
}

.profile-settings-link .subtitle {
  text-align: left;
}

.profile-settings-link--danger .title {
  color: #d92d20;
}

.profile-settings-link--danger .subtitle {
  color: rgba(217, 45, 32, 0.75);
}

.tg-settings-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: calc(100vh - 24px);
  padding: 4px 0 28px;
  color: var(--text);
  background: transparent;
}

.tg-settings-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.tg-settings-done {
  width: 44px;
  height: 44px;
  justify-self: end;
  border: 0;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  position: relative;
}

.tg-settings-done::before {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.tg-settings-done svg {
  position: relative;
  z-index: 1;
  color: #fff;
}

.tg-settings-done:active {
  transform: scale(0.94);
}

.tg-settings-done:active::before {
  opacity: 0.88;
}

.tg-settings-header-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--text);
}

.tg-settings-header-spacer {
  display: block;
  width: 44px;
  height: 44px;
}

.tg-settings-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tg-settings-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
}

.tg-settings-profile-row,
.tg-settings-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0 14px 0 14px;
}

.tg-settings-profile-row {
  min-height: 76px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.tg-settings-profile-row:active,
.tg-settings-row:active {
  background: var(--row-hover);
}

.tg-settings-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
  background: #cfc4ef;
}

.tg-settings-avatar--letter {
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 600;
  color: #5b4b8a;
  background: #d8cff3;
}

.tg-settings-profile-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tg-settings-profile-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.tg-settings-profile-phone {
  font-size: 14px;
  color: var(--secondary-text);
  line-height: 1.25;
}

.tg-settings-row {
  min-height: 48px;
  padding-left: 16px;
  padding-right: 12px;
}

.tg-settings-row-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--text);
  opacity: 0.92;
}

.tg-settings-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.tg-settings-row-main {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--row-divider);
}

.tg-settings-row:last-child .tg-settings-row-main {
  border-bottom: 0;
}

.tg-settings-row-title {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.tg-settings-chevron {
  color: var(--chevron);
  opacity: 0.9;
}

.tg-settings-page,
.settings-sub-page {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.profile-settings-ios {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 8px;
}

.profile-ios-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-ios-section-title {
  margin: 0;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--secondary-text);
  letter-spacing: 0;
}

.profile-ios-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.profile-ios-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 16px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background 0.15s ease;
}

.profile-ios-row:active {
  background: rgba(0, 0, 0, 0.045);
}

.profile-ios-row-icon {
  width: 29px;
  height: 29px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--accent);
}

.profile-ios-row-icon--accent {
  color: var(--accent);
}

.profile-ios-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.profile-ios-icon--muted {
  opacity: 0.55;
}

.profile-ios-row-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.profile-ios-row-title {
  font-size: 17px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.profile-ios-row-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--secondary-text);
  line-height: 1.3;
}

.profile-ios-chevron {
  flex-shrink: 0;
  color: var(--chevron);
}

.profile-ios-row--danger .profile-ios-row-title {
  color: #d92d20;
}

.profile-ios-row--danger .profile-ios-row-sub {
  color: rgba(217, 45, 32, 0.75);
}

.profile-ios-row--danger .profile-ios-row-icon {
  color: #d92d20;
}

.profile-empty {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary-text);
  padding: 18px 14px;
}

.profile-empty--boxed {
  background: var(--card);
  border-radius: 22px;
  border: 1px dashed rgba(60, 60, 67, 0.2);
}

.profile-sub-list .row {
  padding: 12px 14px;
}

.profile-likes-stack {
  display: grid;
  gap: 12px;
}

.profile-like-card .actions {
  justify-content: space-between;
}

.profile-like-check {
  color: var(--accent);
  font-weight: 700;
}

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

.chip {
  background: var(--card);
  border: 1px solid var(--card-elevated-border);
  border-radius: 22px;
  text-align: center;
  padding: 12px 8px;
  box-shadow: var(--chip-shadow);
}

.chip strong {
  display: block;
  font-size: 16px;
}

.chip span {
  font-size: 11px;
  font-weight: 600;
  color: var(--secondary-text);
}

.slide-left {
  animation: slide-left 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.slide-right {
  animation: slide-right 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tab-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 8px;
  width: min(832px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-radius: 28px;
  border: 1px solid var(--separator);
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  z-index: 50;
}

.tab-bar.is-hidden {
  display: none;
}

.chat-room-layout {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: min(860px, calc(100vw - 28px));
  max-width: 860px;
  transform: translateX(-50%);
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: visible;
  z-index: 1;
}

.chat-room-page {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  width: 100%;
  max-width: 860px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--separator);
  background: var(--card);
}

.chat-room-conversation {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  background: var(--card);
  border-radius: 0 0 16px 16px;
  overflow: hidden;
  border: 0;
}

.chat-room-conversation::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--chat-wallpaper);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  pointer-events: none;
}

.chat-room-conversation.is-drag-over::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  border: 2px dashed var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  pointer-events: none;
}

.chat-drop-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  transform: translate(-50%, -50%);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--separator);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  pointer-events: none;
}

.chat-drop-hint.is-hidden {
  display: none;
}

.chat-room-header {
  --chat-accent: hsl(var(--chat-accent-h, 210) 58% 48%);
  flex-shrink: 0;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--chat-accent) 14%, var(--soft)) 0%,
    var(--card) 100%
  );
  border-bottom: 1px solid var(--separator);
}

html[data-theme="dark"] .chat-room-header {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--chat-accent) 22%, var(--card)) 0%,
    var(--card) 100%
  );
}

.chat-room-header-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 56px;
  padding: 6px 8px 8px;
}

.chat-room-back,
.chat-room-search-btn {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.chat-room-back:hover,
.chat-room-search-btn:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.chat-room-search-btn.is-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.chat-room-nav-glyph {
  width: 24px;
  height: 24px;
}

.chat-room-search-btn .search-icon {
  width: 22px;
  height: 22px;
  color: currentColor;
}

.chat-room-info-glyph {
  width: 22px;
  height: 22px;
  color: currentColor;
}

.chat-room-info-btn.is-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.chat-room-peer {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 8px 6px 6px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  color: inherit;
  text-align: left;
  transition: background 0.15s ease;
}

.chat-room-peer:hover {
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.chat-room-peer[aria-expanded="true"] {
  background: color-mix(in srgb, var(--chat-accent) 12%, transparent);
}

.chat-room-peer-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.chat-room-peer-chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--secondary-text);
  opacity: 0.65;
}

.chat-room-title {
  min-width: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-room-status {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--secondary-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar.avatar--header {
  width: 40px;
  height: 40px;
  font-size: 14px;
  flex-shrink: 0;
}

.chat-search-panel {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  padding: 10px 12px 8px;
  background: color-mix(in srgb, var(--card) 90%, transparent);
  border-bottom: 1px solid var(--separator);
  backdrop-filter: blur(10px);
}

.chat-room-conversation.is-search-open .chat-room-messages {
  padding-top: 8px;
}

.chat-search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-search-input-wrap {
  flex: 1;
  min-width: 0;
  height: 42px;
  border-radius: 22px;
  background: var(--soft);
}

.chat-search-counter {
  flex-shrink: 0;
  min-width: 42px;
  padding: 0 4px;
  color: var(--secondary-text);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.chat-search-nav,
.chat-search-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--secondary-text);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.chat-search-nav:hover,
.chat-search-close:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
}

.chat-search-results {
  display: grid;
  gap: 4px;
  max-height: 190px;
  overflow: auto;
  padding: 2px;
}

.chat-search-count,
.chat-search-empty {
  padding: 2px 8px;
  color: var(--secondary-text);
  font-size: 12px;
  font-weight: 700;
}

.chat-search-result {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.chat-search-result:hover,
.chat-search-result.is-active {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--separator));
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
}

.chat-search-result-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.chat-search-result-meta {
  color: var(--secondary-text);
  font-size: 11px;
  font-weight: 600;
}

.chat-room-status.is-online {
  color: color-mix(in srgb, var(--chat-accent) 70%, #22c55e 30%);
}

.chat-room-status.is-offline {
  color: var(--secondary-text);
}

.chat-room-messages {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  height: 0;
  max-height: 100%;
  background: transparent;
  border-radius: 0;
  padding: 14px 12px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.chat-empty-state {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 100%;
  min-height: 100%;
  margin: 0;
  text-align: center;
  pointer-events: none;
}

.chat-typing,
.chat-composer-meta,
.chat-composer-wrap {
  position: relative;
  z-index: 1;
}

.chat-composer-meta {
  flex-shrink: 0;
  background: var(--composer-bar-bg);
  border-radius: 0;
  border: 0;
  border-top: 1px solid var(--separator);
  padding: 8px 10px;
}

.chat-composer-meta.is-hidden {
  display: none;
}

.composer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.composer-meta-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.composer-meta-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.composer-meta--reply {
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  margin-left: -2px;
}

.composer-meta--edit .composer-meta-title {
  color: #ff9500;
}

.composer-meta-preview {
  font-size: 13px;
  color: var(--secondary-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-meta-cancel {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: var(--soft);
  color: var(--secondary-text);
  cursor: pointer;
  flex-shrink: 0;
}

.composer-meta--attachment {
  align-items: flex-start;
}

.composer-meta--attachment .composer-meta-text {
  min-width: 0;
}

.composer-pending-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.composer-pending-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  max-width: min(220px, 72vw);
  padding: 6px 8px 6px 6px;
  border-radius: 12px;
  background: var(--soft);
}

.composer-pending-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.composer-pending-thumb--file {
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

.composer-pending-thumb--file .chat-composer-glyph {
  width: 20px;
  height: 20px;
}

.composer-pending-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.composer-pending-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-pending-size {
  font-size: 11px;
  color: var(--secondary-text);
}

.composer-pending-remove {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--secondary-text);
  cursor: pointer;
  flex-shrink: 0;
}

.composer-pending-remove:hover {
  background: rgba(0, 0, 0, 0.06);
}

.composer-meta-cancel--solo {
  margin-left: auto;
}

.chat-composer-wrap {
  position: relative;
  flex-shrink: 0;
  background: var(--composer-bar-bg);
  border-top: 1px solid var(--separator);
  border-radius: 0;
  padding: 8px 10px 10px;
}

.chat-composer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.chat-composer-meta {
  border-radius: 14px 14px 0 0;
  margin-bottom: 0;
}

.chat-composer-meta:not(.is-hidden) + .chat-composer-wrap {
  border-top: 0;
}

.chat-composer-meta:not(.is-hidden) ~ .chat-composer-wrap,
.chat-composer-meta:not(.is-hidden) {
  background: var(--composer-bar-bg);
}

.chat-composer-icon-btn {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--info-icon-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.chat-composer-icon-btn--side {
  width: 42px;
  height: 42px;
  border-radius: 999px;
}

.chat-composer-icon-btn--side:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--secondary-text);
}

html[data-theme="dark"] .chat-composer-icon-btn--side:hover {
  background: rgba(255, 255, 255, 0.06);
}

.chat-composer-icon-btn--inline {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  margin-right: 2px;
}

.chat-composer-icon-btn--inline:hover {
  background: rgba(0, 0, 0, 0.05);
}

html[data-theme="dark"] .chat-composer-icon-btn--inline:hover {
  background: rgba(255, 255, 255, 0.08);
}

.chat-composer-glyph {
  width: 23px;
  height: 23px;
  display: block;
  stroke-width: 1.65;
}

.chat-composer-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  padding: 0 4px 0 16px;
  border-radius: 24px;
  background: var(--composer-input-bg);
  border: 1px solid var(--composer-input-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chat-composer-field:focus-within {
  border-color: rgba(10, 132, 255, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 0 0 3px rgba(10, 132, 255, 0.12);
}

html[data-theme="dark"] .chat-composer-field {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .chat-composer-field:focus-within {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 3px rgba(10, 132, 255, 0.22);
}

.chat-composer-field input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 11px 4px 11px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 20px;
  color: var(--text);
  outline: none;
}

.chat-composer-field input::placeholder {
  color: var(--secondary-text);
  opacity: 0.72;
}

.chat-composer-send {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.28);
}

.chat-composer-send.is-hidden {
  display: none;
}

.chat-composer-send:hover {
  filter: brightness(1.06);
}

.chat-composer-send:active {
  transform: scale(0.94);
}

.chat-composer-send .chat-composer-glyph {
  width: 20px;
  height: 20px;
}

.chat-composer-field-wrap {
  flex: 1;
  min-width: 0;
}

.chat-composer-field-wrap.is-hidden {
  display: none;
}

.chat-composer-voice {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: background 0.15s ease, transform 0.12s ease, color 0.15s ease;
}

.chat-composer-voice.is-hidden {
  display: none;
}

.chat-composer-voice.is-recording,
.chat-composer-voice:active {
  background: var(--accent);
  color: var(--on-accent);
  transform: scale(1.04);
}

.chat-composer-recording {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  min-height: 44px;
  --voice-bar: rgba(10, 132, 255, 0.28);
  --voice-bar-played: var(--accent);
}

html[data-theme="dark"] .chat-composer-recording {
  --voice-bar: rgba(10, 132, 255, 0.38);
}

.chat-voice-cancel-btn {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 2px;
  transition: transform 0.12s ease;
}

.chat-voice-cancel-btn:hover,
.chat-voice-cancel-btn:focus {
  background: transparent;
}

.chat-voice-cancel-btn:focus {
  outline: none;
}

.chat-voice-cancel-btn:focus-visible {
  outline: 2px solid rgba(255, 59, 48, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

.chat-voice-cancel-btn:active {
  transform: scale(0.96);
}

.chat-voice-cancel-btn .icon-trash {
  display: block;
  width: 24px;
  height: auto;
}

.chat-composer-recording.is-hidden {
  display: none;
}

.chat-voice-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff3b30;
  flex-shrink: 0;
  animation: chat-voice-pulse 1.1s ease-in-out infinite;
}

@keyframes chat-voice-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.82);
  }
}

.chat-voice-timer {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  min-width: 2.5em;
}

.chat-voice-live-wave {
  flex: 1;
  min-width: 0;
  position: relative;
  height: 34px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-top: 2px;
}

.chat-voice-live-wave::-webkit-scrollbar {
  display: none;
}

.chat-voice-live-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 100%;
  width: max-content;
  pointer-events: none;
}

.chat-voice-live-bars .msg-voice-bar {
  flex: 0 0 2px;
  background: var(--voice-bar);
}

.msg--voice .msg-body {
  padding: 5px 10px 7px 12px;
}

.msg-voice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 210px;
  max-width: min(280px, 100%);
  padding: 2px 2px 0;
  --voice-accent: var(--accent);
  --voice-bar: rgba(10, 132, 255, 0.28);
  --voice-bar-played: var(--accent);
  --voice-duration: var(--msg-meta);
}

html[data-theme="dark"] .msg-voice {
  --voice-bar: rgba(10, 132, 255, 0.38);
}

.msg-voice-play {
  --voice-play-btn: 46px;
  flex-shrink: 0;
  width: var(--voice-play-btn);
  height: var(--voice-play-btn);
  margin-top: 1px;
  border: 0;
  border-radius: 50%;
  background: var(--voice-accent);
  color: var(--on-accent, #fff);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.msg-voice-play:hover {
  filter: brightness(1.06);
}

.msg-voice-play:active {
  transform: scale(0.94);
}

.msg-voice-glyph {
  color: #fff;
  fill: currentColor;
  flex-shrink: 0;
}

.msg-voice-glyph--play {
  --voice-play-triangle: calc(var(--voice-play-btn) * 0.38);
  width: calc(var(--voice-play-triangle) * 24 / 12);
  height: calc(var(--voice-play-triangle) * 24 / 12);
}

.msg-voice-glyph--pause {
  width: calc(var(--voice-play-btn) * 0.34);
  height: calc(var(--voice-play-btn) * 0.34);
}

.msg-voice-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 2px;
}

.msg-voice-wave {
  position: relative;
  height: 34px;
  width: 100%;
  padding: 2px 0 0;
  --voice-progress: 0;
}

.msg-voice-bars {
  position: absolute;
  inset: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}

.msg-voice-bars--base .msg-voice-bar {
  background: var(--voice-bar);
}

.msg-voice-bars--played {
  clip-path: inset(0 calc((1 - var(--voice-progress)) * 100%) 0 0);
  will-change: clip-path;
}

.msg-voice-bars--played .msg-voice-bar {
  background: var(--voice-bar-played);
}

.msg-voice-bar {
  flex: 1 1 2px;
  width: 2px;
  min-height: 4px;
  max-height: 28px;
  border-radius: 2px;
  align-self: center;
}

.msg-voice-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 16px;
  margin-top: 0;
  padding-top: 1px;
}

.msg-voice-duration {
  flex-shrink: 0;
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--voice-duration);
  letter-spacing: 0.01em;
}

.msg-voice-speed {
  flex-shrink: 0;
  min-width: 34px;
  height: 20px;
  padding: 0 7px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--voice-accent) 14%, transparent);
  color: var(--voice-accent);
  font-size: 11px;
  line-height: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.msg-voice-speed:active {
  transform: scale(0.96);
}

.msg-voice-meta {
  flex-shrink: 0;
  margin-left: auto;
}

.msg-voice-meta .msg-footer {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  float: none;
  margin: 0;
  top: 0;
  position: static;
  vertical-align: baseline;
}

.msg-voice-meta .msg-time {
  font-size: 11px;
  line-height: 16px;
  color: var(--msg-meta);
}

.msg-voice-meta .msg-status {
  line-height: 0;
}

.emoji-picker {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--separator);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

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

.emoji-picker-item {
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  padding: 6px 0;
  cursor: pointer;
  transition: background 0.12s ease;
}

.emoji-picker-item:hover {
  background: var(--soft);
}

.msg--has-attachment .msg-body {
  padding-bottom: 5px;
}

.msg--image .msg-body {
  padding: 2px;
}

.msg.is-sending {
  opacity: 1;
}

.msg.is-sending .msg-image-btn.is-uploading .msg-image:not(.msg-image--placeholder) {
  filter: brightness(0.92);
}

.msg-image-btn.is-uploading {
  min-width: min(220px, 72vw);
  min-height: 220px;
  background: color-mix(in srgb, var(--soft, #e8ecf2) 70%, #9aa3b2);
  cursor: default;
}

.msg-image-btn.is-uploading .msg-image {
  width: 100%;
  min-width: min(220px, 72vw);
  min-height: 220px;
  max-width: min(280px, 72vw);
  max-height: min(360px, 48vh);
  object-fit: cover;
}

.msg-image--placeholder {
  display: block;
  width: min(220px, 72vw);
  height: 220px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 50%),
    color-mix(in srgb, var(--soft, #e8ecf2) 55%, #7b8798);
}

.msg-image-upload-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(15, 20, 28, 0.32);
  pointer-events: none;
}

.msg-image-upload-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: msg-upload-spin 0.75s linear infinite;
}

@keyframes msg-upload-spin {
  to {
    transform: rotate(360deg);
  }
}

.msg-media-footer {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 7px 3px 8px;
  border-radius: 11px;
  background: rgba(11, 20, 26, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  user-select: none;
}

.msg-status--sending {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
}

.msg-status-sending-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55);
  animation: msg-sending-pulse 1s ease-out infinite;
}

@keyframes msg-sending-pulse {
  70% {
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.msg-media-footer .msg-status--sending .msg-status-sending-dot {
  background: #fff;
}

.msg.mine.msg--image .msg-body {
  padding: 2px;
}

.msg--image.msg--has-reply .msg-body {
  padding-top: 4px;
}

.msg-media {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  vertical-align: top;
}

.msg-media-footer .msg-footer {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  float: none;
  margin: 0;
  top: 0;
  position: static;
  vertical-align: middle;
}

.msg-media-footer .msg-time {
  font-size: 11px;
  line-height: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95);
}

.msg-media-footer .msg-edited {
  font-size: 11px;
  line-height: 14px;
  color: rgba(255, 255, 255, 0.78);
}

.msg-media-footer .msg-status {
  margin-left: 0;
  line-height: 0;
}

.msg-media-footer .msg-status--sent,
.msg-media-footer .msg-status--delivered,
.msg-media-footer .msg-status--read {
  color: rgba(255, 255, 255, 0.95);
}

.msg-media-footer .msg-status-icon {
  filter: drop-shadow(0 0 0 transparent);
}

.msg--image .msg-caption {
  margin-top: 6px;
  padding: 0 5px 2px;
  line-height: 1.35;
}

.msg-image-btn {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  line-height: 0;
  border-radius: 12px;
  overflow: hidden;
  max-width: min(280px, 72vw);
}

.msg-image-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.msg-image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(280px, 72vw);
  max-height: min(360px, 48vh);
  object-fit: contain;
  border-radius: 12px;
}

.msg--video .msg-body,
.msg.mine.msg--video .msg-body {
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.msg-media--video {
  position: relative;
}

.msg-video-wrap {
  position: relative;
  display: inline-block;
  max-width: min(280px, 72vw);
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
  background: #0b0b0b;
}

.msg-video-wrap.is-uploading .msg-video {
  opacity: 0.55;
}

.msg-video {
  display: block;
  width: 100%;
  max-width: min(280px, 72vw);
  max-height: min(360px, 48vh);
  border-radius: 12px;
  background: #000;
}

.msg-video--placeholder {
  display: block;
  width: min(240px, 70vw);
  height: 160px;
  background: color-mix(in srgb, var(--separator) 35%, transparent);
}

.msg--song .msg-body {
  min-width: min(260px, 78vw);
}

.msg-song {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(240px, 72vw);
  max-width: min(300px, 82vw);
  padding: 8px 10px;
  box-sizing: border-box;
}

.msg-song-play {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  cursor: pointer;
}

.msg.mine .msg-song-play {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.msg-song-play-icon {
  display: grid;
  place-items: center;
}

.msg-song-play-icon .msg-voice-glyph {
  width: 18px;
  height: 18px;
}

.msg-song-note {
  display: none;
}

.msg-song-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.msg-song-title {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-song-progress {
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--separator) 55%, transparent);
  overflow: hidden;
}

.msg.mine .msg-song-progress {
  background: rgba(255, 255, 255, 0.28);
}

.msg-song-progress-bar {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--accent);
}

.msg.mine .msg-song-progress-bar {
  background: #fff;
}

.msg-song-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--secondary-text);
}

.msg.mine .msg-song-meta {
  color: rgba(255, 255, 255, 0.78);
}

.msg-song-footer {
  margin-left: auto;
}

.msg-song-footer .msg-footer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.composer-pending-thumb--video {
  object-fit: cover;
  background: #111;
}

.composer-pending-thumb--audio {
  color: var(--accent);
}

.composer-pending-thumb--audio .msg-song-glyph {
  width: 18px;
  height: 18px;
}

.channel-post-song {
  margin-top: 8px;
}

.channel-post-song .msg-song {
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--separator) 12%, var(--card));
}

.feed-card-audio {
  margin-top: 10px;
}

.feed-card-audio .msg-song {
  padding: 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--separator) 10%, var(--card));
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

.feed-compose-preview video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-compose-preview--audio {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  min-height: 88px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}

.feed-compose-preview--audio .msg-song-glyph {
  width: 22px;
  height: 22px;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  box-sizing: border-box;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.image-viewer.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.44);
  cursor: zoom-out;
}

.image-viewer-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
  z-index: 3;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  transition: background 0.15s ease, transform 0.15s ease;
}

.image-viewer-close:hover {
  background: rgba(255, 255, 255, 0.32);
}

.image-viewer-close:active {
  transform: scale(0.94);
}

.image-viewer-close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

.image-viewer-frame {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(92vw, 900px);
  max-height: min(84vh, 900px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-viewer-img {
  display: block;
  max-width: min(92vw, 900px);
  max-height: min(84vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
  cursor: zoom-out;
  transform: scale(0.97);
  transition: transform 0.2s ease;
}

.image-viewer.is-open .image-viewer-img {
  transform: scale(1);
}

body.has-image-viewer {
  overflow: hidden;
}

.avatar-viewer {
  position: fixed;
  inset: 0;
  z-index: 420;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(28px, env(safe-area-inset-top, 0px)) 20px max(28px, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.avatar-viewer.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.avatar-viewer-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: zoom-out;
}

.avatar-viewer-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
  z-index: 3;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
}

.avatar-viewer-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.avatar-viewer-topbar {
  position: absolute;
  top: max(18px, env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: none;
}

.avatar-viewer-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.avatar-viewer-counter {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}

.avatar-viewer-frame {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(92vw, 900px);
  max-height: min(78vh, 900px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-viewer-img {
  display: block;
  max-width: min(92vw, 900px);
  max-height: min(78vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
  cursor: zoom-out;
  transform: scale(0.97);
  transition: transform 0.2s ease, opacity 0.15s ease;
}

.avatar-viewer.is-open .avatar-viewer-img {
  transform: scale(1);
}

.avatar-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
}

.avatar-viewer-nav:hover {
  background: rgba(255, 255, 255, 0.24);
}

.avatar-viewer-nav--prev {
  left: max(12px, env(safe-area-inset-left, 0px));
}

.avatar-viewer-nav--next {
  right: max(12px, env(safe-area-inset-right, 0px));
}

.avatar-viewer-thumbs {
  position: absolute;
  left: 50%;
  bottom: calc(max(84px, env(safe-area-inset-bottom, 0px)) + 56px);
  z-index: 3;
  display: flex;
  gap: 10px;
  max-width: min(92vw, 420px);
  padding: 0 4px;
  overflow-x: auto;
  transform: translateX(-50%);
  scrollbar-width: none;
}

.avatar-viewer-thumbs::-webkit-scrollbar {
  display: none;
}

.avatar-viewer-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
}

.avatar-viewer-thumb.is-active {
  border-color: #fff;
}

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

.avatar-viewer-toolbar {
  position: absolute;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(360px, calc(100vw - 40px));
  transform: translateX(-50%);
}

.avatar-viewer-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.avatar-viewer-action:hover {
  background: rgba(255, 255, 255, 0.22);
}

.avatar-viewer-action.is-disabled,
.avatar-viewer-action:disabled {
  opacity: 0.45;
  cursor: default;
}

.avatar-viewer-action--danger {
  color: #ff6961;
}

body.has-avatar-viewer {
  overflow: hidden;
}

.msg-file--legacy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
  text-decoration: none;
  max-width: 260px;
}

html[data-theme="dark"] .msg-file--legacy {
  background: rgba(255, 255, 255, 0.08);
}

.msg-file--legacy .msg-file-icon {
  display: grid;
  place-items: center;
  color: var(--accent);
}

.msg-file--legacy .msg-file-icon .chat-composer-glyph {
  width: 20px;
  height: 20px;
}

.msg-file--legacy .msg-file-name {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg--file .msg-body {
  padding: 8px 10px 7px;
}

.msg-file-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: fit-content;
  max-width: min(320px, 100%);
  min-width: 200px;
  padding-right: 2px;
  padding-bottom: 2px;
}

.msg-file-action {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #3390ec;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  overflow: visible;
}

.msg-file-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.msg-file-action-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(#fff 0deg, #fff calc(var(--file-progress, 0) * 3.6deg), transparent calc(var(--file-progress, 0) * 3.6deg));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.msg-file-action.is-downloading .msg-file-action-ring {
  opacity: 0.45;
}

.msg-file-action-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
}

.msg-file-glyph {
  display: block;
  width: 22px;
  height: 22px;
}

.msg-file-body {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.msg-file-title {
  font-size: 15px;
  line-height: 18px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

.msg-file-meta {
  margin-top: 3px;
  font-size: 13px;
  line-height: 16px;
  color: var(--msg-meta);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.msg-file-size {
  color: var(--msg-meta);
  white-space: nowrap;
}

.msg-file-sep {
  color: var(--msg-meta);
}

.msg-file-link {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #3390ec;
  font: inherit;
  font-size: 13px;
  line-height: 16px;
  cursor: pointer;
}

.msg-file-link:hover {
  text-decoration: underline;
}

.msg-file-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  pointer-events: none;
  user-select: none;
}

.msg-file-footer .msg-footer {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  float: none;
  margin: 0;
  top: 0;
  position: static;
}

.msg-file-footer .msg-time {
  font-size: 11px;
  line-height: 14px;
}

.msg-caption {
  display: block;
  margin-top: 4px;
  font-size: 14.2px;
  line-height: 19px;
  white-space: pre-wrap;
}


.chat-info-panel {
  position: absolute;
  top: 0;
  left: calc(100% + 14px);
  width: 380px;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--info-panel-bg);
  border-radius: 18px;
  border: 1px solid var(--separator);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
}

.chat-info-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.chat-info-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  flex-shrink: 0;
  padding: 6px 8px;
  background: var(--info-panel-bg);
  border-bottom: 1px solid var(--separator);
  z-index: 2;
}

.chat-info-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  letter-spacing: -0.01em;
}

.chat-info-icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--secondary-text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chat-info-icon-btn:hover {
  background: var(--soft);
  color: var(--text);
}

.chat-info-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 32px 20px 28px;
  background: var(--info-hero-gradient);
  overflow: hidden;
  flex-shrink: 0;
}

.chat-info-hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.45) 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 28px 28px, 36px 36px;
  pointer-events: none;
}

.chat-info-hero-avatar {
  position: relative;
  z-index: 1;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  font-size: 34px;
  border: 4px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.chat-info-hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.chat-info-name {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.2;
}

.chat-info-sub {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
}

.chat-info-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 12px 18px;
  background: var(--info-body-bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

/* Cards must not shrink — otherwise overflow:hidden clips the last rows (e.g. Уведомления). */
.chat-info-body > * {
  flex-shrink: 0;
}

.chat-info-danger-zone {
  margin-top: 6px;
  padding-top: 4px;
}

.chat-info-delete-btn {
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--card);
  color: #e53935;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chat-info-delete-btn:hover {
  background: color-mix(in srgb, #e53935 8%, var(--card));
}

.chat-info-delete-btn:active {
  background: color-mix(in srgb, #e53935 14%, var(--card));
}

html[data-theme="dark"] .chat-info-delete-btn {
  color: #ff6b6b;
}

.chat-info-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 6px 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary-text);
}

.chat-info-section-kind {
  color: var(--text);
  font-weight: 600;
  min-width: 0;
}

.chat-info-section-meta {
  min-width: 0;
  text-align: right;
}

.info-card {
  background: var(--info-card-bg);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.info-card--details {
  overflow: visible;
}

.info-card--flush {
  padding: 0;
}

.info-card--pad {
  padding: 12px;
}

.info-card--preview {
  padding: 12px 14px;
}

.info-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.info-preview-avatar {
  width: 48px;
  height: 48px;
  font-size: 16px;
  flex-shrink: 0;
}

.info-preview-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.info-preview-primary {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.info-preview-label {
  font-size: 14px;
  color: var(--secondary-text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.info-detail-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  min-height: 56px;
}

.info-detail-row + .info-detail-row {
  border-top: 1px solid rgba(60, 60, 67, 0.08);
}

html[data-theme="dark"] .info-detail-row + .info-detail-row {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.info-detail-row--link {
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.info-detail-row--link:hover {
  background: rgba(10, 132, 255, 0.06);
}

.info-detail-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--info-icon-muted);
}

.info-detail-icon--phone,
.info-detail-icon--at {
  color: var(--info-icon-muted);
}

.info-detail-icon .info-glyph-svg {
  width: 24px;
  height: 24px;
  display: block;
  overflow: visible;
}

.info-detail-icon--at .info-glyph-svg {
  width: 24px;
  height: 24px;
}

.info-detail-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-detail-primary {
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.25;
}

.info-detail-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--secondary-text);
  line-height: 1.2;
}

.chat-info-switch {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
}

.chat-info-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.chat-info-switch-ui {
  position: absolute;
  inset: 0;
  border-radius: 31px;
  background: var(--segment-bg);
  transition: background 0.2s ease;
  cursor: pointer;
}

.chat-info-switch-ui::before {
  content: "";
  position: absolute;
  width: 27px;
  height: 27px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.chat-info-switch input:checked + .chat-info-switch-ui {
  background: var(--accent);
}

.chat-info-switch input:checked + .chat-info-switch-ui::before {
  transform: translateX(20px);
}

.chat-info-tabs-shell {
  background: var(--info-card-bg);
  border-radius: 22px;
  padding: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.chat-info-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-info-tabs::-webkit-scrollbar {
  display: none;
}

.chat-info-tab {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 18px;
  padding: 10px 8px;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  color: var(--secondary-text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.chat-info-tab.is-active {
  background: rgba(10, 132, 255, 0.12);
  color: var(--accent);
  font-weight: 600;
}

.chat-info-tab-body {
  min-height: 48px;
}

.info-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  min-height: 60px;
}

.info-member-row + .info-member-row {
  border-top: 1px solid rgba(60, 60, 67, 0.08);
}

html[data-theme="dark"] .info-member-row + .info-member-row {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.info-member-avatar {
  width: 48px;
  height: 48px;
  font-size: 16px;
  flex-shrink: 0;
}

.info-member-text {
  flex: 1;
  min-width: 0;
}

.info-member-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.info-member-status {
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary-text);
  margin-top: 2px;
}

.info-member-status.is-online {
  color: var(--accent);
}

.info-role-badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.info-role-badge--owner {
  background: rgba(175, 82, 222, 0.16);
  color: #af52de;
}

.info-role-badge--member {
  background: rgba(52, 199, 89, 0.16);
  color: #34c759;
}

.chat-info-empty {
  text-align: center;
  padding: 28px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary-text);
  background: var(--info-card-bg);
  border-radius: 22px;
}

.chat-info-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.chat-info-media-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: var(--text);
}

.chat-info-media-thumb {
  aspect-ratio: 1;
  border-radius: 12px;
  background: var(--soft);
  overflow: hidden;
}

.chat-info-media-thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: var(--soft);
}

.chat-info-media-thumb--0 { background: linear-gradient(135deg, #667eea, #764ba2); }
.chat-info-media-thumb--1 { background: linear-gradient(135deg, #f093fb, #f5576c); }
.chat-info-media-thumb--2 { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.chat-info-media-thumb--3 { background: linear-gradient(135deg, #43e97b, #38f9d7); }

.chat-info-media-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--secondary-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .chat-info-panel {
    width: 340px;
    left: calc(100% + 10px);
  }
}

@media (max-width: 860px) {
  .chat-room-layout.is-info-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    z-index: 35;
    pointer-events: none;
  }

  .chat-info-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100vw;
    max-height: none;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    z-index: 120;
    border-radius: 0;
    box-shadow: none;
    transform: translateX(100%);
    padding-top: env(safe-area-inset-top, 0px);
  }

  .chat-info-panel.is-open {
    transform: translateX(0);
  }

  .chat-info-hero {
    padding: 20px 16px 18px;
    gap: 8px;
  }

  .chat-info-hero-avatar {
    width: 88px;
    height: 88px;
    font-size: 28px;
  }

  .chat-info-name {
    font-size: 20px;
  }

  .chat-info-body {
    padding: 12px 12px calc(24px + env(safe-area-inset-bottom, 0px));
  }
}

.tab-button {
  border: 0;
  background: transparent;
  border-radius: 12px;
  min-height: 52px;
  color: var(--tab-icon-inactive);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.tab-button.is-active {
  color: var(--tab-icon-active);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 20px;
}

.tab-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  position: relative;
}

.tab-badge {
  position: absolute;
  top: -5px;
  right: -8px;
  z-index: 2;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  letter-spacing: -0.02em;
  box-shadow: 0 0 0 2px var(--card, #fff);
  pointer-events: none;
}

html[data-theme="dark"] .tab-badge {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--card) 88%, #000);
}

.tab-glyph {
  grid-area: 1 / 1;
  width: 28px;
  height: 28px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.tab-icon--feed .tab-glyph--outline {
  -webkit-mask-image: url("./assets/tab-icons/feed.png");
  mask-image: url("./assets/tab-icons/feed.png");
}
.tab-icon--feed .tab-glyph--filled {
  -webkit-mask-image: url("./assets/tab-icons/feed-fill.png");
  mask-image: url("./assets/tab-icons/feed-fill.png");
}
.tab-icon--contacts .tab-glyph--outline {
  -webkit-mask-image: url("./assets/tab-icons/contacts.png");
  mask-image: url("./assets/tab-icons/contacts.png");
}
.tab-icon--contacts .tab-glyph--filled {
  -webkit-mask-image: url("./assets/tab-icons/contacts-fill.png");
  mask-image: url("./assets/tab-icons/contacts-fill.png");
}
.tab-icon--chats .tab-glyph--outline {
  -webkit-mask-image: url("./assets/tab-icons/chats.png");
  mask-image: url("./assets/tab-icons/chats.png");
}
.tab-icon--chats .tab-glyph--filled {
  -webkit-mask-image: url("./assets/tab-icons/chats-fill.png");
  mask-image: url("./assets/tab-icons/chats-fill.png");
}
.tab-icon--profile .tab-glyph--outline {
  -webkit-mask-image: url("./assets/tab-icons/profile.png");
  mask-image: url("./assets/tab-icons/profile.png");
}
.tab-icon--profile .tab-glyph--filled {
  -webkit-mask-image: url("./assets/tab-icons/profile-fill.png");
  mask-image: url("./assets/tab-icons/profile-fill.png");
}

.tab-glyph--filled {
  display: none;
}

.tab-button.is-active .tab-glyph--outline {
  display: none;
}

.tab-button.is-active .tab-glyph--filled {
  display: block;
}

.tab-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.tab-button.is-active .tab-title {
  font-weight: 700;
}

/* Mobile: icon-only floating dock (blue active circle) */
@media (max-width: 700px) {
  .tab-bar {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 999px;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--card) 82%, transparent);
    border: 1px solid color-mix(in srgb, var(--separator) 90%, transparent);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(24px) saturate(1.35);
    -webkit-backdrop-filter: blur(24px) saturate(1.35);
  }

  html[data-theme="dark"] .tab-bar {
    background: rgba(28, 32, 44, 0.72);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
  }

  .tab-button {
    position: relative;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 52px;
    padding: 0;
    gap: 0;
    border-radius: 50%;
    background: transparent;
  }

  .tab-button.is-active {
    color: var(--on-accent);
    background: transparent;
    border-radius: 50%;
  }

  .tab-button.is-active .tab-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
  }

  .tab-button.is-active .tab-badge {
    top: 0;
    right: 0;
    box-shadow: 0 0 0 2px var(--accent);
  }

  .tab-button.is-active .tab-glyph {
    width: 24px;
    height: 24px;
  }

  .tab-button.is-active .tab-glyph--outline {
    display: block;
  }

  .tab-button.is-active .tab-glyph--filled {
    display: none;
  }

  .tab-title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@keyframes slide-left {
  from {
    opacity: 0.72;
    transform: translate3d(28px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slide-right {
  from {
    opacity: 0.72;
    transform: translate3d(-28px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide-left,
  .slide-right {
    animation-duration: 0.01ms;
  }

  .tab-content.is-swipe-dragging,
  .tab-content.is-swipe-releasing,
  .tab-content.is-swipe-animating {
    transition: none !important;
  }
}

.toast-root {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--separator);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  animation: toast-in 0.22s ease;
}

.toast--error {
  border-color: rgba(217, 45, 32, 0.35);
  color: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(10, 10, 16, 0.35);
}

.sheet-panel {
  width: min(560px, 100vw);
  max-height: 85vh;
  overflow: auto;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 12px 16px 24px;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
}

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

.sheet-panel-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.comment-row {
  padding: 10px 0;
  border-bottom: 1px solid rgba(60, 60, 67, 0.08);
}

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

.comment-author {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.comment-text {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text);
}

.comments-sheet-panel {
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  overflow: hidden;
  padding: 12px 16px 0;
}

.comments-sheet-list {
  flex: 1;
  min-height: 140px;
  max-height: none;
  overflow: auto;
  padding: 4px 2px 12px;
  -webkit-overflow-scrolling: touch;
}

.comments-sheet-list.is-empty,
.comments-sheet-list .post-comments-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  text-align: center;
}

.comments-sheet-composer {
  position: static;
  left: auto;
  transform: none;
  width: auto;
  margin: 0;
  padding: 10px 0 calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 0;
  background: transparent;
  box-shadow: none;
}

.forward-sheet-panel {
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  padding-bottom: 12px;
}

.forward-sheet-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  min-width: 72px;
  text-align: right;
}

.forward-search-wrap {
  margin-bottom: 10px;
}

.forward-chat-list {
  flex: 1;
  min-height: 120px;
  max-height: 52vh;
  overflow: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

.forward-section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 4px 6px;
}

.forward-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 6px;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.forward-row:hover,
.forward-row.is-selected {
  background: var(--soft);
}

.forward-row-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forward-row-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--separator);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
}

.forward-row.is-selected .forward-row-check {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.forward-empty {
  padding: 24px 8px;
  text-align: center;
}

.forward-send-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
}

.forward-send-form input {
  flex: 1;
  border: 1px solid var(--separator);
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 15px;
  background: var(--soft);
  color: var(--text);
}

.forward-send-form button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.forward-send-form button:disabled {
  opacity: 0.45;
  cursor: default;
}

.post-detail-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 24px);
  margin: -12px -14px 0;
  padding: 0 14px;
  position: relative;
}

.post-detail-header {
  flex-shrink: 0;
  padding-top: 2px;
}

.post-detail-scroll {
  flex: 1;
  overflow: auto;
  padding: 4px 0 calc(88px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

.post-detail-card {
  margin-bottom: 4px;
}

.post-comments-block {
  padding: 8px 2px 0;
}

.post-comments-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.post-comments-count {
  color: var(--secondary-text);
  font-weight: 500;
}

.post-comments-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-comments-empty {
  padding: 28px 12px;
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
  color: var(--secondary-text);
}

.post-comment-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.post-comment-avatar {
  width: 36px;
  height: 36px;
  font-size: 13px;
  flex-shrink: 0;
  border-radius: 50%;
}

.post-comment-body {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 18px;
  background: var(--soft);
  border: 1px solid var(--row-divider);
}

.post-comment-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.post-comment-text {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  word-break: break-word;
}

.post-comment-composer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: 12;
  width: min(832px, calc(100vw - 28px));
  padding: 0 0 calc(12px + env(safe-area-inset-bottom, 0px));
  background: transparent;
  border-top: 0;
  box-shadow: none;
  pointer-events: none;
}

.post-comment-composer::before {
  content: "";
  position: absolute;
  left: -14px;
  right: -14px;
  bottom: 0;
  height: 104px;
  background: linear-gradient(
    to top,
    var(--background) 14%,
    color-mix(in srgb, var(--background) 88%, transparent) 48%,
    transparent 100%
  );
  pointer-events: none;
  z-index: -1;
}

.post-comment-form {
  width: 100%;
  margin: 0;
  padding: 6px 8px 6px 6px;
  gap: 8px;
  align-items: center;
  pointer-events: auto;
  background: var(--card);
  border: 1px solid var(--card-elevated-border);
  border-radius: 26px;
  box-shadow:
    0 10px 32px rgba(15, 24, 48, 0.1),
    0 2px 10px rgba(15, 24, 48, 0.06);
}

html[data-theme="dark"] .post-comment-form {
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.38),
    0 2px 10px rgba(0, 0, 0, 0.22);
}

.post-comment-composer-avatar {
  width: 36px;
  height: 36px;
  font-size: 13px;
  flex-shrink: 0;
  border-radius: 50%;
}

.post-comment-form .chat-composer-field-wrap {
  min-width: 0;
}

.post-comment-form .chat-composer-field {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border-color: transparent;
  background: var(--composer-input-bg);
  box-shadow: none;
}

.post-comment-form .chat-composer-field:focus-within {
  border-color: rgba(10, 132, 255, 0.28);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.12);
}

html[data-theme="dark"] .post-comment-form .chat-composer-field:focus-within {
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

.post-comment-form .chat-composer-field input {
  padding-top: 9px;
  padding-bottom: 9px;
  font-size: 15px;
}

.post-comment-form .chat-composer-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

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

.theme-card {
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  background: var(--soft);
  color: var(--text);
}

.theme-card.is-active {
  border-color: var(--accent);
  background: rgba(10, 132, 255, 0.12);
}

.accent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  width: 100%;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.accent-row + .accent-row {
  border-top: 1px solid rgba(60, 60, 67, 0.08);
}

.accent-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

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

.toggle-row-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.toggle-row + .toggle-row {
  border-top: 1px solid rgba(60, 60, 67, 0.08);
}

.settings-switch {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
  cursor: pointer;
}

.settings-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.settings-switch-ui {
  position: absolute;
  inset: 0;
  border-radius: 31px;
  background: #e3e3e8;
  transition: background 0.22s ease;
  pointer-events: none;
}

.settings-switch-ui::before {
  content: "";
  position: absolute;
  width: 27px;
  height: 27px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
  transition: transform 0.22s ease;
}

.settings-switch input:checked + .settings-switch-ui {
  background: #34c759;
}

.settings-switch input:checked + .settings-switch-ui::before {
  transform: translateX(20px);
}

html[data-theme="dark"] .settings-switch-ui {
  background: #48484a;
}

html[data-theme="dark"] .settings-switch-ui::before {
  background: #f2f2f7;
}

.settings-sub-page {
  display: grid;
  gap: 12px;
  color: var(--text);
}

.member-pick-list {
  max-height: min(52vh, 420px);
  overflow: auto;
}

.member-pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(60, 60, 67, 0.08);
}

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

.member-pick-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.member-pick-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.member-pick-text .title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.member-pick-text .subtitle {
  font-size: 13px;
  color: var(--secondary-text);
}

.list-card,
.profile-header,
.chip {
  color: var(--text);
}

.chip span {
  color: var(--secondary-text);
}

.accent-row span:not(.accent-dot) {
  color: var(--text);
}

.toggle-row .title {
  font-size: 17px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.toggle-row .subtitle {
  font-size: 13px;
  font-weight: 400;
  color: var(--secondary-text);
  line-height: 1.3;
}

/* Settings screens — Inter / SF-like reference typography */
.chats-settings-page,
.settings-sub-page,
.profile-settings-page-ios {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.chats-settings-page .row .title,
.settings-sub-page .accent-row span:not(.accent-dot) {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.chats-settings-page .row .subtitle {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
}

.sheet-close {
  color: var(--text);
  background: var(--soft);
}

.auth-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--background);
}

.auth-root[hidden] {
  display: none !important;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.auth-brand {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.auth-subtitle {
  margin: 0 0 24px;
  color: var(--secondary-text);
  font-size: 15px;
  line-height: 1.45;
}

.auth-field {
  margin-bottom: 14px;
}

.auth-label {
  display: block;
  font-size: 13px;
  color: var(--sheet-field-label);
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--separator);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  background: var(--soft);
  color: var(--text);
}

.auth-hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--secondary-text);
}

.auth-hint code {
  font-family: ui-monospace, monospace;
  background: var(--segment-bg);
  padding: 2px 6px;
  border-radius: 6px;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-primary {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
}

.auth-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.auth-secondary {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  padding: 8px;
  cursor: pointer;
}

.app-shell.is-locked {
  visibility: hidden;
  pointer-events: none;
}

/* ——— Channels (Cora) ——— */

.chats-screen-title-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chats-new-channel-btn {
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  font-weight: 500;
}

.profile-channel-card {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px 12px;
  align-items: center;
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 1px 0 var(--separator);
}

.profile-channel-card--cta {
  grid-template-columns: auto 1fr auto;
}

.profile-channel-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 14%, var(--soft));
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-channel-card-icon .channel-glyph {
  width: 24px;
  height: 24px;
}

.profile-channel-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-channel-card-text strong {
  font-size: 16px;
}

.profile-channel-card-text span {
  font-size: 13px;
  color: var(--secondary-text);
}

.profile-channel-card-btn {
  border: none;
  background: var(--soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
}

.profile-channel-card-btn--accent {
  background: var(--accent);
  color: var(--on-accent);
}

.channel-wizard-hero {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
  color: var(--accent);
}

.channel-wizard-hero .channel-glyph {
  width: 56px;
  height: 56px;
}

.sheet-field--area {
  min-height: 88px;
  resize: vertical;
}

.channel-type-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  cursor: pointer;
}

.channel-type-row input {
  margin-top: 4px;
}

.channel-room-layout {
  /* наследует .chat-room-layout: рамка, инфо-панель справа */
}

.chat-room-search-btn--spacer {
  visibility: hidden;
  pointer-events: none;
  width: 44px;
  flex-shrink: 0;
}

.channel-conversation .channel-posts-list {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.channel-conversation .channel-posts-list:has(.channel-empty) {
  justify-content: center;
  align-items: center;
  padding: 20px 16px 28px;
}

.channel-post-card {
  background: var(--msg-other);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  border: 1px solid color-mix(in srgb, var(--separator) 65%, transparent);
}

html[data-theme="dark"] .channel-post-card {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.channel-post-pin {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.channel-post-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.channel-post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.channel-post-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.channel-post-meta span {
  font-size: 12px;
  color: var(--secondary-text);
}

.channel-post-body {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.channel-post-media {
  display: block;
  border-radius: 14px;
  overflow: hidden;
}

.channel-post-media img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.channel-empty {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0;
  width: min(100%, 340px);
  padding: 32px 28px 28px;
  border-radius: 24px;
  background:
    radial-gradient(90% 70% at 50% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 72%),
    color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px dashed color-mix(in srgb, var(--accent) 32%, var(--separator));
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--card) 80%, transparent),
    0 12px 40px color-mix(in srgb, var(--accent) 8%, transparent);
  backdrop-filter: blur(8px);
}

.channel-empty--compact {
  padding: 24px 20px;
}

.channel-empty-orbit {
  position: absolute;
  inset: 14px;
  pointer-events: none;
}

.channel-empty-orbit-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 45%, transparent);
  opacity: 0.55;
}

.channel-empty-orbit-dot--1 {
  top: 18%;
  right: 14%;
}

.channel-empty-orbit-dot--2 {
  bottom: 22%;
  left: 12%;
  width: 4px;
  height: 4px;
  opacity: 0.35;
}

.channel-empty-orbit-dot--3 {
  top: 38%;
  left: 20%;
  width: 5px;
  height: 5px;
  opacity: 0.4;
}

.channel-empty-icon {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  margin-bottom: 4px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent) 18%, var(--soft)),
    color-mix(in srgb, var(--accent) 6%, var(--card))
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 6px 20px color-mix(in srgb, var(--accent) 18%, transparent);
}

html[data-theme="dark"] .channel-empty-icon {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 6px 24px color-mix(in srgb, var(--accent) 22%, transparent);
}

.channel-empty-glyph {
  width: 32px;
  height: 32px;
}

.channel-empty-eyebrow {
  margin: 10px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 72%, var(--secondary-text));
}

.channel-empty-title {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

.channel-empty-hint {
  margin: 10px 0 0;
  max-width: 28ch;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--secondary-text);
}

.channel-empty-cta {
  margin-top: 18px;
  border: none;
  border-radius: 14px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.channel-empty-cta:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 42%, transparent);
}

.channel-empty-cta:active {
  transform: scale(0.98);
}

@media (prefers-reduced-motion: no-preference) {
  .channel-empty {
    animation: channel-empty-in 0.45s ease both;
  }

  .channel-empty-orbit-dot--1 {
    animation: channel-empty-float 4s ease-in-out infinite;
  }

  .channel-empty-orbit-dot--2 {
    animation: channel-empty-float 5s ease-in-out 0.6s infinite;
  }

  .channel-empty-orbit-dot--3 {
    animation: channel-empty-float 4.5s ease-in-out 1.2s infinite;
  }
}

@keyframes channel-empty-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes channel-empty-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.channel-footer-hint,
.channel-subscribe-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  font-size: 14px;
  color: var(--secondary-text);
}

.channel-footer-hint {
  flex-direction: row;
  justify-content: center;
  gap: 8px;
}

.channel-footer-hint .channel-glyph {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.channel-subscribe-bar .sheet-save {
  max-width: 280px;
  width: 100%;
}

.info-detail-icon--channel .channel-glyph {
  width: 22px;
  height: 22px;
}

.channel-posts-profile-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.channel-loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
}

.channel-post-menu-btn {
  border: none;
  background: transparent;
  color: var(--secondary-text);
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  margin-left: auto;
}

.channel-post-edited {
  font-size: 12px;
  color: var(--secondary-text);
}

.channel-post-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--soft);
  text-decoration: none;
  color: var(--text);
  margin-top: 8px;
}

.channel-post-file span {
  font-size: 14px;
  font-weight: 500;
}

.channel-post-video {
  display: block;
  width: 100%;
  max-height: 360px;
  border-radius: 14px;
  margin-top: 8px;
  background: #000;
}

.channel-post-voice .msg-voice {
  max-width: 100%;
}

.channel-conversation .chat-composer-recording {
  position: absolute;
  left: 52px;
  right: 52px;
  bottom: 0;
  top: 0;
}

/* ── Action screens (contacts flows) — match reference mockups ── */
.action-page {
  --action-bg: #0a0d14;
  --action-card: #1c222d;
  --action-field: #141925;
  --action-field-border: rgba(255, 255, 255, 0.06);
  --action-muted: #8b95a5;
  --action-glow-blue: rgba(10, 132, 255, 0.22);
  --action-glow-purple: rgba(124, 108, 255, 0.28);
  min-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  margin: -12px -14px 0;
  padding: 12px 16px 108px;
  background: var(--action-bg);
  color: #f0f2f5;
  position: relative;
  overflow-x: hidden;
}

html[data-theme="light"] .action-page {
  --action-bg: #eef1f8;
  --action-card: #ffffff;
  --action-field: #f3f5fa;
  --action-field-border: rgba(60, 60, 67, 0.12);
  --action-muted: #6a7291;
  color: #1c1c1e;
}

.action-page--group {
  background:
    radial-gradient(ellipse 90% 45% at 50% -5%, var(--action-glow-purple), transparent 60%),
    radial-gradient(ellipse 60% 30% at 80% 0%, var(--action-glow-blue), transparent 55%),
    var(--action-bg);
}

.action-page--contact::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(175, 82, 222, 0.35), rgba(255, 107, 157, 0.12) 55%, transparent 70%);
  pointer-events: none;
}

.action-page--phone {
  background:
    radial-gradient(ellipse 80% 50% at 50% 38%, rgba(10, 132, 255, 0.14), transparent 65%),
    var(--action-bg);
}

.action-page--invite {
  background: var(--action-bg);
}

/* Topbar */
.action-topbar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  padding: 10px 0 14px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, var(--action-bg) 65%, transparent);
}

.action-topbar--phone {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  grid-template-columns: none;
}

.action-back-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #f0f2f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

html[data-theme="light"] .action-back-btn {
  color: #1c1c1e;
}

.action-back-btn--plain {
  background: transparent;
  box-shadow: none;
}

.action-back-btn--square {
  background: #1c222d;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  flex-shrink: 0;
}

html[data-theme="light"] .action-back-btn--square {
  background: #fff;
  border-color: rgba(60, 60, 67, 0.12);
}

.action-back-btn svg {
  width: 22px;
  height: 22px;
}

.action-topbar-title {
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: inherit;
}

.action-topbar-title--left {
  text-align: left;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
}

.action-topbar-stack {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.action-topbar-sub {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--action-muted);
  font-weight: 500;
}

.action-topbar-spacer {
  width: 40px;
}

.action-page-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

/* New group hero */
.ng-hero-art {
  position: relative;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 4px;
}

.ng-hero-orb {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 108, 255, 0.55) 0%, rgba(10, 132, 255, 0.25) 45%, transparent 70%);
  filter: blur(8px);
}

.ng-hero-people {
  position: relative;
  width: min(100%, 280px);
  height: auto;
}

/* Cards & fields */
.action-form-card {
  border-radius: 20px;
  background: var(--action-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px;
}

html[data-theme="light"] .action-form-card {
  border-color: rgba(60, 60, 67, 0.1);
  box-shadow: 0 8px 28px rgba(15, 24, 48, 0.06);
}

.action-form-card--group {
  padding: 16px 16px 14px;
}

.action-form-card--inset {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ng-form-top {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 12px;
  align-items: stretch;
}

.ng-form-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.ng-photo-side {
  border: 1.5px dashed rgba(10, 132, 255, 0.45);
  border-radius: 16px;
  background: rgba(10, 132, 255, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px;
  cursor: pointer;
  text-align: center;
  min-height: 132px;
}

.ng-photo-side-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(10, 132, 255, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ng-photo-side-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--action-muted);
  line-height: 1.3;
}

.action-field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.action-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--action-muted);
}

.action-field-optional,
.action-field-optional-inline {
  font-size: 12px;
  font-weight: 500;
  color: var(--action-muted);
  opacity: 0.85;
}

.action-field-input,
.action-field-textarea {
  width: 100%;
  border: 1px solid var(--action-field-border);
  border-radius: 14px;
  background: var(--action-field);
  color: inherit;
  font-size: 16px;
  font-weight: 500;
  padding: 13px 14px;
  outline: none;
  font-family: inherit;
}

.action-field-input--dark,
.action-field-textarea--dark {
  background: var(--action-field);
}

.action-field-textarea {
  min-height: 72px;
  resize: none;
  line-height: 1.4;
}

.action-field-counter {
  text-align: right;
  font-size: 12px;
  color: var(--action-muted);
  margin-top: 2px;
}

.action-field-box {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--action-field-border);
  border-radius: 14px;
  background: var(--action-field);
  padding: 0 14px;
  min-height: 52px;
}

.action-field-box--grow {
  flex: 1;
  min-width: 0;
}

.action-field-icon {
  width: 20px;
  height: 20px;
  color: var(--action-muted);
  flex-shrink: 0;
}

.action-field-icon--star {
  color: #ffd60a;
}

.action-field-box-input {
  flex: 1;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 16px;
  font-weight: 500;
  outline: none;
  min-width: 0;
  padding: 14px 0;
  font-family: inherit;
}

.action-field-box-input::placeholder {
  color: var(--action-muted);
  opacity: 0.75;
}

.action-phone-split {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 8px;
}

.action-country-select {
  border: 1px solid var(--action-field-border);
  border-radius: 14px;
  background: var(--action-field);
  color: inherit;
  font-size: 15px;
  font-weight: 600;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 0 8px;
}

.action-country-flag {
  font-size: 16px;
}

.action-chevron {
  width: 14px;
  height: 14px;
  color: var(--action-muted);
}

.action-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] .action-section-head {
  border-top-color: rgba(60, 60, 67, 0.08);
}

.action-section-title {
  font-size: 15px;
  font-weight: 700;
}

.action-link-text {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.action-participants-scroll {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scrollbar-width: none;
}

.action-participants-scroll::-webkit-scrollbar {
  display: none;
}

.action-participant-wrap {
  position: relative;
  flex-shrink: 0;
}

.action-participant-chip {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.action-participant-chip.green { background: linear-gradient(145deg, #3ddc84, #28a745); }
.action-participant-chip.blue { background: linear-gradient(145deg, #4dabff, #0a84ff); }
.action-participant-chip.purple { background: linear-gradient(145deg, #c77dff, #9b59b6); }

.action-participant-remove {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: #2a3140;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.action-participant-add {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.action-search {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  background: var(--action-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0 14px;
  min-height: 50px;
}

.action-search--pill {
  border-radius: 999px;
}

.action-search svg {
  width: 18px;
  height: 18px;
  color: var(--action-muted);
  flex-shrink: 0;
}

.action-search-input {
  flex: 1;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 16px;
  outline: none;
  min-width: 0;
}

.action-search-input::placeholder {
  color: var(--action-muted);
}

.action-pick-list {
  border-radius: 20px;
  background: var(--action-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.action-pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

html[data-theme="light"] .action-pick-row {
  border-bottom-color: rgba(60, 60, 67, 0.08);
}

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

.action-pick-row .avatar {
  width: 48px;
  height: 48px;
  font-size: 16px;
}

.action-pick-row .member-pick-text .title {
  font-size: 16px;
  font-weight: 600;
}

.action-pick-row .member-pick-text .subtitle {
  font-size: 13px;
  color: var(--action-muted);
}

.action-pick-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.15s;
}

.action-pick-row.is-selected .action-pick-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.action-pick-check svg {
  width: 16px;
  height: 16px;
}

.action-pick-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Add contact avatar */
.ac-avatar-stage {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 12px 0 20px;
}

.ac-avatar-rings {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ac-avatar-rings::before,
.ac-avatar-rings::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.05);
  inset: -16px;
}

.ac-avatar-rings::after {
  inset: -32px;
  opacity: 0.6;
}

.action-avatar-ring {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #0a84ff, #af52de 55%, #ff6b9d);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 32px rgba(124, 108, 255, 0.25);
}

.action-avatar-ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--action-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 300;
  color: var(--accent);
}

.action-favorite-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.action-favorite-label {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
}

.action-fav-toggle {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.action-fav-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.action-fav-toggle-ui {
  width: 52px;
  height: 32px;
  border-radius: 999px;
  background: #2a3140;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 3px;
  transition: background 0.2s, justify-content 0.2s;
}

.action-fav-toggle-ui svg {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: transparent;
  padding: 5px;
  box-sizing: border-box;
  transition: color 0.2s;
}

.action-fav-toggle input:checked + .action-fav-toggle-ui {
  background: var(--accent);
  justify-content: flex-end;
}

.action-fav-toggle input:checked + .action-fav-toggle-ui svg {
  color: var(--accent);
}

/* Phone screen */
.action-phone-display {
  text-align: center;
  font-size: clamp(30px, 8vw, 38px);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  min-height: 52px;
  padding: 16px 0 8px;
}

html[data-theme="light"] .action-phone-display {
  color: #1c1c1e;
}

.action-phone-display.is-empty {
  color: var(--action-muted);
  opacity: 0.45;
}

.action-phone-cursor {
  display: inline-block;
  width: 2px;
  height: 0.88em;
  background: var(--accent);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: action-cursor-blink 1s step-end infinite;
}

@keyframes action-cursor-blink {
  50% { opacity: 0; }
}

.action-phone-country-wrap {
  text-align: center;
  margin-bottom: 8px;
}

.action-country-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #1c222d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 16px;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
}

html[data-theme="light"] .action-country-chip {
  background: #fff;
  border-color: rgba(60, 60, 67, 0.12);
}

.action-country-chip .action-chevron {
  width: 16px;
  height: 16px;
}

.action-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 340px;
  margin: 8px auto 0;
  padding: 8px 0;
}

.action-key {
  border: 0;
  border-radius: 14px;
  min-height: 58px;
  background: #1c222d;
  color: #fff;
  font-size: 26px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.12s, transform 0.1s;
}

html[data-theme="light"] .action-key {
  background: #fff;
  color: #1c1c1e;
  border: 1px solid rgba(60, 60, 67, 0.08);
}

.action-key:active {
  transform: scale(0.97);
  background: #252b38;
}

.action-key--muted {
  color: var(--action-muted);
  font-size: 28px;
}

.action-key--icon {
  color: var(--action-muted);
}

.action-key-main {
  font-size: 26px;
}

.action-key-sub {
  font-size: 11px;
  font-weight: 700;
  color: var(--action-muted);
  margin-top: 2px;
}

.action-key-glyph {
  width: 24px;
  height: 24px;
}

.action-link-line {
  text-align: center;
  font-size: 14px;
  color: var(--action-muted);
  margin: 8px 0 0;
}

.action-link-inline {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

/* Invite screen */
.inv-promo-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  border-radius: 20px;
  background: linear-gradient(115deg, #3d2a7a 0%, #5c3d9e 35%, #c45c3e 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.inv-promo-qr-art {
  flex-shrink: 0;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.25));
}

.inv-promo-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.inv-promo-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
}

.action-section-kicker {
  margin: 4px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--action-muted);
}

.inv-link-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  background: var(--action-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 8px 8px 16px;
}

.inv-link-pill-text {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

html[data-theme="light"] .inv-link-pill-text {
  color: #1c1c1e;
}

.inv-link-accent {
  color: var(--accent);
}

.inv-link-copy-square {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.action-invite-qr {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}

.action-invite-qr--glow img {
  width: 220px;
  height: 220px;
  border-radius: 20px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.15), 0 12px 40px rgba(10, 132, 255, 0.2);
}

.action-share-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.action-share-btn {
  border: 0;
  border-radius: 16px;
  background: transparent;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--action-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.action-share-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-share-icon--tg { background: #229ed9; color: #fff; }
.action-share-icon--wa { background: #25d366; color: #fff; }
.action-share-icon--mail { background: #7c5cff; color: #fff; }
.action-share-icon--copy { background: rgba(10, 132, 255, 0.15); color: var(--accent); }

.inv-social-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--action-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.inv-social-avatars {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.inv-social-av,
.inv-social-av-more {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--action-card);
  margin-left: -10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.inv-social-av:first-child,
.inv-social-av-more:first-child {
  margin-left: 0;
}

.inv-social-av.green { background: linear-gradient(145deg, #3ddc84, #28a745); }
.inv-social-av.blue { background: linear-gradient(145deg, #4dabff, #0a84ff); }
.inv-social-av.purple { background: linear-gradient(145deg, #c77dff, #9b59b6); }

.inv-social-av-more {
  background: #2a3140;
  font-size: 11px;
  color: var(--action-muted);
}

.inv-social-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.inv-social-text strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.inv-social-text span {
  font-size: 12px;
  color: var(--action-muted);
}

/* Footer & buttons */
.action-footer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(560px, 100vw);
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, var(--action-bg) 30%);
  z-index: 10;
}

.action-footer--dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-btn-primary {
  width: 100%;
  border: 0;
  border-radius: 16px;
  min-height: 54px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-btn-primary--wide {
  border-radius: 16px;
}

.action-btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.action-btn-primary:disabled,
.action-btn-primary.is-disabled {
  opacity: 0.4;
  cursor: default;
}

.action-btn-ghost {
  width: 100%;
  border: 1.5px solid var(--accent);
  border-radius: 16px;
  min-height: 54px;
  background: transparent;
  color: var(--accent);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-btn-ghost--wide {
  border-radius: 16px;
}

.action-btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.action-invite-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

@media (max-width: 380px) {
  .ng-form-top {
    grid-template-columns: 1fr;
  }

  .ng-photo-side {
    min-height: 96px;
    flex-direction: row;
    justify-content: flex-start;
    padding: 14px 16px;
  }

  .action-phone-split {
    grid-template-columns: 96px 1fr;
  }

  .action-share-btn {
    font-size: 10px;
  }

  .action-share-icon {
    width: 46px;
    height: 46px;
  }
}

/* ── Phone dial screen (reference-accurate) ── */
.phone-dial-page {
  --phone-bg: #050a0e;
  --phone-key: #1c252e;
  --phone-key-active: #2e3b4d;
  --phone-muted: #8e8e93;
  --phone-accent: #007aff;
  --phone-edge-fade: 36px;
  min-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  margin: -12px -14px 0;
  padding: 8px 20px 100px;
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(
      90deg,
      var(--background) 0%,
      transparent var(--phone-edge-fade),
      transparent calc(100% - var(--phone-edge-fade)),
      var(--background) 100%
    ),
    radial-gradient(ellipse 90% 55% at 50% 42%, rgba(10, 132, 255, 0.11), transparent 62%),
    var(--phone-bg);
  color: #fff;
  font-family: inherit;
}

html[data-theme="light"] .phone-dial-page {
  --phone-bg: #f2f2f7;
  --phone-key: #ffffff;
  --phone-key-active: #e5e5ea;
  --phone-muted: #8e8e93;
  color: #1c1c1e;
}

.phone-dial-header {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  grid-template-rows: auto auto;
  column-gap: 8px;
  padding: 4px 0 20px;
}

.phone-dial-back {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: #141a22;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

html[data-theme="light"] .phone-dial-back {
  background: #fff;
  border-color: rgba(60, 60, 67, 0.12);
  color: #1c1c1e;
}

.phone-dial-back svg {
  width: 20px;
  height: 20px;
}

.phone-dial-title {
  margin: 0 0 8px;
  grid-column: 2;
  grid-row: 1;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: inherit;
}

.phone-dial-subtitle {
  margin: 0 auto;
  grid-column: 2;
  grid-row: 2;
  text-align: center;
  max-width: 320px;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 400;
  color: var(--phone-muted);
}

.phone-dial-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
}

.phone-dial-display {
  width: 100%;
  text-align: center;
  font-size: clamp(32px, 9vw, 40px);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: #fff;
  min-height: 48px;
  padding: 12px 0 20px;
  white-space: nowrap;
}

html[data-theme="light"] .phone-dial-display {
  color: #1c1c1e;
}

.phone-dial-display.is-empty {
  color: var(--phone-muted);
  opacity: 0.55;
}

.phone-dial-cursor {
  display: inline-block;
  width: 2px;
  height: 0.92em;
  background: var(--phone-accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: phone-dial-cursor-blink 1s step-end infinite;
}

@keyframes phone-dial-cursor-blink {
  50% { opacity: 0; }
}

.phone-dial-country-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.phone-dial-country {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #141a22;
  color: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

html[data-theme="light"] .phone-dial-country {
  background: #fff;
  border-color: rgba(60, 60, 67, 0.12);
}

.phone-dial-flag {
  font-size: 18px;
  line-height: 1;
}

.phone-dial-country-code {
  letter-spacing: 0.02em;
}

.phone-dial-country .action-chevron {
  width: 14px;
  height: 14px;
  color: var(--phone-muted);
  margin-left: 2px;
}

.phone-dial-keypad {
  width: 100%;
  max-width: 400px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 auto;
}

.phone-dial-key {
  border: 0;
  border-radius: 12px;
  min-height: 56px;
  background: var(--phone-key);
  color: #fff;
  font-size: 28px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

html[data-theme="light"] .phone-dial-key {
  color: #1c1c1e;
  border: 1px solid rgba(60, 60, 67, 0.08);
}

.phone-dial-key:active,
.phone-dial-key.is-pressed {
  background: var(--phone-key-active);
}

.phone-dial-key--symbol {
  font-size: 30px;
  font-weight: 300;
}

.phone-dial-key--zero {
  gap: 0;
}

.phone-dial-key-num {
  font-size: 28px;
  line-height: 1;
}

.phone-dial-key-plus {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 1px;
  line-height: 1;
}

html[data-theme="light"] .phone-dial-key-plus {
  color: var(--phone-muted);
}

.phone-dial-key--delete {
  color: rgba(255, 255, 255, 0.75);
}

html[data-theme="light"] .phone-dial-key--delete {
  color: var(--phone-muted);
}

.phone-dial-key-delete {
  width: 28px;
  height: 20px;
  display: block;
}

.phone-dial-help {
  margin: 28px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--phone-muted);
  line-height: 1.4;
}

.phone-dial-help-link {
  border: 0;
  background: transparent;
  color: var(--phone-accent);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.phone-dial-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 0 20px calc(16px + env(safe-area-inset-bottom, 0px));
  background: transparent;
  pointer-events: none;
  z-index: 10;
}

.phone-dial-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 112px;
  background: linear-gradient(to top, var(--phone-bg) 8%, rgba(5, 10, 14, 0.72) 42%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

html[data-theme="light"] .phone-dial-footer::before {
  background: linear-gradient(to top, var(--phone-bg) 8%, rgba(242, 242, 247, 0.82) 42%, transparent 100%);
}

.phone-dial-cta {
  width: min(520px, calc(100vw - 40px));
  pointer-events: auto;
  border: 0;
  border-radius: 14px;
  min-height: 54px;
  background: var(--phone-accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: none;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.phone-dial-cta:hover:not(:disabled) {
  filter: brightness(1.05);
}

.phone-dial-cta:disabled,
.phone-dial-cta.is-disabled {
  opacity: 0.38;
  cursor: default;
}

@media (max-width: 380px) {
  .phone-dial-page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .phone-dial-title {
    font-size: 22px;
  }

  .phone-dial-key {
    min-height: 52px;
    font-size: 26px;
  }
}

/* ── New group screen (reference-accurate) ── */
.ng-page {
  --ng-bg: #0b0e11;
  --ng-card: #161b22;
  --ng-field: #1c2128;
  --ng-muted: #8b949e;
  --ng-accent: #007aff;
  --ng-border: rgba(255, 255, 255, 0.06);
  --ng-edge-fade: 36px;
  min-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  margin: -12px -14px 0;
  padding: 8px 16px 108px;
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(
      90deg,
      var(--background) 0%,
      transparent var(--ng-edge-fade),
      transparent calc(100% - var(--ng-edge-fade)),
      var(--background) 100%
    ),
    radial-gradient(ellipse 85% 40% at 50% 0%, rgba(124, 108, 255, 0.18), transparent 58%),
    radial-gradient(ellipse 50% 25% at 75% 5%, rgba(10, 132, 255, 0.12), transparent 55%),
    var(--ng-bg);
  color: #fff;
}

html[data-theme="light"] .ng-page {
  --ng-bg: #eef1f8;
  --ng-card: #ffffff;
  --ng-field: #f3f5fa;
  --ng-muted: #6a7291;
  --ng-border: rgba(60, 60, 67, 0.1);
  color: #1c1c1e;
}

.ng-header {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 6px 0 4px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, var(--ng-bg) 70%, transparent);
}

.ng-back {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.ng-back svg {
  width: 22px;
  height: 22px;
}

.ng-header-title {
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ng-header-spacer {
  width: 40px;
}

.ng-hero {
  position: relative;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 12px;
}

.ng-hero-glow {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 108, 255, 0.45) 0%, rgba(10, 132, 255, 0.2) 45%, transparent 72%);
  filter: blur(10px);
}

.ng-hero-svg {
  position: relative;
  width: min(100%, 300px);
  height: auto;
}

.ng-card {
  border-radius: 16px;
  background: var(--ng-card);
  border: 1px solid var(--ng-border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: visible;
  position: relative;
  box-shadow:
    -24px 0 28px -28px var(--ng-bg),
    24px 0 28px -28px var(--ng-bg);
}

html[data-theme="light"] .ng-card {
  box-shadow:
    -24px 0 28px -28px var(--ng-bg),
    24px 0 28px -28px var(--ng-bg),
    0 8px 32px rgba(15, 24, 48, 0.07);
}

.ng-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ng-muted);
  margin-bottom: 8px;
}

.ng-form-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 16px 12px;
  align-items: stretch;
  margin-bottom: 18px;
}

.ng-field-block {
  min-width: 0;
}

.ng-field-block--title {
  grid-column: 1;
  grid-row: 1;
  width: 75%;
}

.ng-field-block--desc {
  grid-column: 1;
  grid-row: 2;
  width: 90%;
}

.ng-photo-btn {
  grid-column: 2;
  grid-row: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  align-self: stretch;
  min-width: 0;
  padding: 10px 14px 10px 0;
  margin: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.ng-photo-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: visible;
  display: block;
  flex-shrink: 0;
  background-color: transparent;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: transform 0.15s ease;
}

.ng-photo-circle::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.15s ease;
  background: radial-gradient(
    circle at 50% 50%,
    color-mix(in srgb, var(--ng-accent) 50%, transparent) 0%,
    color-mix(in srgb, var(--ng-accent) 32%, transparent) 42%,
    color-mix(in srgb, var(--ng-accent) 12%, transparent) 62%,
    transparent 72%
  );
}

.ng-photo-circle-face {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  z-index: 1;
  transition: filter 0.15s ease;
}

.ng-photo-circle:hover {
  transform: scale(1.06);
}

.ng-photo-circle:hover::after {
  opacity: 1;
}

.ng-photo-circle:active {
  transform: scale(0.97);
}

.ng-photo-menu {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.58);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.ng-photo-btn.has-image .ng-photo-circle:hover .ng-photo-menu,
.ng-photo-btn.has-image .ng-photo-circle:focus-within .ng-photo-menu,
.ng-photo-btn.has-image .ng-photo-circle.is-menu-open .ng-photo-menu {
  opacity: 1;
  pointer-events: auto;
}

.ng-photo-circle:hover .ng-photo-circle-face {
  filter: brightness(1.04);
}

.ng-photo-menu-btn {
  border: 0;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.96);
  color: #1c1c1e;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.12s ease,
    filter 0.12s ease,
    background 0.12s ease,
    box-shadow 0.12s ease;
}

.ng-photo-menu-btn--danger {
  background: rgba(255, 59, 48, 0.94);
  color: #fff;
}

.ng-photo-menu-btn:hover {
  transform: scale(1.06);
  filter: brightness(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.ng-photo-menu-btn:active {
  transform: scale(0.96);
}

.ng-photo-default {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  border-radius: 50%;
}

.ng-photo-circle.has-image .ng-photo-default {
  display: none;
}

.ng-photo-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ng-input,
.ng-textarea {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--ng-field);
  color: inherit;
  font-size: 16px;
  font-weight: 500;
  padding: 14px 14px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.ng-input {
  min-height: 52px;
}

.ng-input::placeholder,
.ng-textarea::placeholder {
  color: var(--ng-muted);
  opacity: 0.75;
}

.ng-textarea-wrap {
  position: relative;
}

.ng-textarea {
  min-height: 88px;
  resize: none;
  line-height: 1.45;
  padding-bottom: 28px;
}

.ng-counter {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 12px;
  color: var(--ng-muted);
  pointer-events: none;
}

.ng-participants-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ng-participants-title {
  font-size: 15px;
  font-weight: 700;
}

.ng-participants-add {
  border: 0;
  background: transparent;
  color: var(--ng-accent);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.ng-chips-outer {
  overflow: visible;
  margin: 0 -16px;
}

.ng-chips-scroll {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 16px 16px 16px;
  margin-bottom: 4px;
  scrollbar-width: none;
}

.ng-chips-scroll::-webkit-scrollbar {
  display: none;
}

.ng-chip-wrap {
  position: relative;
  flex-shrink: 0;
  /* keep hit target for × without clipping sibling layout */
  padding-top: 2px;
  padding-right: 2px;
}

.ng-chip {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.ng-chip-remove {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: #3d4450;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ng-chip-add-wrap {
  position: relative;
  flex-shrink: 0;
  padding: 12px 12px 12px 0;
  margin: -12px 0;
}

.ng-chip-add {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--ng-accent);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  overflow: visible;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease, filter 0.15s ease;
}

.ng-chip-add::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.15s ease;
  background: radial-gradient(
    circle at 50% 50%,
    color-mix(in srgb, var(--ng-accent) 50%, transparent) 0%,
    color-mix(in srgb, var(--ng-accent) 32%, transparent) 42%,
    color-mix(in srgb, var(--ng-accent) 12%, transparent) 62%,
    transparent 72%
  );
}

.ng-chip-add:hover {
  transform: scale(1.06);
  background: color-mix(in srgb, var(--ng-accent) 90%, #fff);
  filter: brightness(1.04);
}

.ng-chip-add:hover::after {
  opacity: 1;
}

.ng-chip-add:active {
  transform: scale(0.96);
}

.ng-chip-add-icon {
  width: 20px;
  height: 20px;
  position: relative;
  z-index: 1;
  display: block;
}

.ng-search {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  background: var(--ng-field);
  border: 1px solid var(--ng-border);
  padding: 0 14px;
  min-height: 46px;
  margin-bottom: 4px;
}

.ng-search svg {
  width: 18px;
  height: 18px;
  color: var(--ng-muted);
  flex-shrink: 0;
}

.ng-search-input {
  flex: 1;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 16px;
  outline: none;
  min-width: 0;
}

.ng-search-input::placeholder {
  color: var(--ng-muted);
}

.ng-contacts {
  margin: 0 -16px -16px;
  border-top: 1px solid var(--ng-border);
}

.ng-contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--ng-border);
  position: relative;
}

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

.ng-contact-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ng-contact-avatar {
  width: 40px;
  height: 40px;
  font-size: 14px;
  flex-shrink: 0;
}

.ng-contact-name {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  min-width: 0;
}

.ng-contact-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.15s;
}

.ng-contact-row.is-selected .ng-contact-check {
  background: var(--ng-accent);
  border-color: var(--ng-accent);
  color: #fff;
}

.ng-contact-check svg {
  width: 14px;
  height: 14px;
}

.ng-contacts-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--ng-muted);
}

.ng-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 0 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: transparent;
  pointer-events: none;
  z-index: 10;
}

.ng-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 112px;
  background: linear-gradient(to top, var(--ng-bg) 8%, rgba(11, 14, 17, 0.72) 42%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

html[data-theme="light"] .ng-footer::before {
  background: linear-gradient(to top, var(--ng-bg) 8%, rgba(238, 241, 248, 0.82) 42%, transparent 100%);
}

.ng-cta {
  width: min(528px, calc(100vw - 32px));
  pointer-events: auto;
  border: 0;
  border-radius: 14px;
  min-height: 54px;
  background: var(--ng-accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s, opacity 0.15s;
}

.ng-cta:hover:not(:disabled) {
  filter: brightness(1.05);
}

.ng-cta:disabled,
.ng-cta.is-disabled {
  opacity: 0.38;
  cursor: default;
}

@media (max-width: 380px) {
  .ng-page {
    padding-left: 14px;
    padding-right: 14px;
  }

  .ng-form-top {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 12px;
  }

  .ng-field-block--title,
  .ng-field-block--desc {
    grid-column: 1;
    width: 100%;
  }

  .ng-field-block--title {
    grid-row: 1;
  }

  .ng-field-block--desc {
    grid-row: 2;
  }

  .ng-form-top .ng-photo-btn {
    grid-column: 1;
    grid-row: 3;
    justify-content: flex-start;
  }
}

/* ── Add contact screen (reference-accurate) ── */
.ac-page {
  --ac-bg: #0a0d14;
  --ac-card: #1c222d;
  --ac-field: #141925;
  --ac-muted: #8b95a5;
  --ac-accent: #007aff;
  --ac-border: rgba(255, 255, 255, 0.06);
  --ac-edge-fade: 36px;
  min-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  margin: -12px -14px 0;
  padding: 8px 16px 108px;
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(
      90deg,
      var(--background) 0%,
      transparent var(--ac-edge-fade),
      transparent calc(100% - var(--ac-edge-fade)),
      var(--background) 100%
    ),
    radial-gradient(ellipse 52% 42% at 88% 6%, rgba(175, 82, 222, 0.34), transparent 68%),
    radial-gradient(ellipse 38% 28% at 78% 10%, rgba(255, 107, 157, 0.14), transparent 62%),
    var(--ac-bg);
  color: #f0f2f5;
  font-family: inherit;
}

html[data-theme="light"] .ac-page {
  --ac-bg: #eef1f8;
  --ac-card: #ffffff;
  --ac-field: #f3f5fa;
  --ac-muted: #6a7291;
  --ac-border: rgba(60, 60, 67, 0.1);
  color: #1c1c1e;
}

.ac-header {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 0 6px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, var(--ac-bg) 72%, transparent);
}

.ac-back {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.ac-back svg {
  width: 22px;
  height: 22px;
}

.ac-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.ac-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 4px 0 12px;
}

.ac-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 148px;
}

.ac-avatar-rings {
  position: absolute;
  width: 156px;
  height: 156px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ac-avatar-rings::before,
.ac-avatar-rings::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.06);
  inset: -18px;
}

.ac-avatar-rings::after {
  inset: -36px;
  opacity: 0.55;
}

html[data-theme="light"] .ac-avatar-rings {
  border-color: rgba(60, 60, 67, 0.12);
}

html[data-theme="light"] .ac-avatar-rings::before,
html[data-theme="light"] .ac-avatar-rings::after {
  border-color: rgba(60, 60, 67, 0.08);
}

.ac-avatar-ring {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(160deg, #af52de 0%, #0a84ff 58%, #5ac8fa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 36px rgba(124, 108, 255, 0.28);
}

.ac-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--ac-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
  color: #fff;
}

html[data-theme="light"] .ac-avatar-inner {
  color: var(--ac-muted);
}

.ac-card {
  border-radius: 16px;
  background: var(--ac-card);
  border: 1px solid var(--ac-border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow:
    -24px 0 28px -28px var(--ac-bg),
    24px 0 28px -28px var(--ac-bg);
}

html[data-theme="light"] .ac-card {
  box-shadow:
    -24px 0 28px -28px var(--ac-bg),
    24px 0 28px -28px var(--ac-bg),
    0 8px 32px rgba(15, 24, 48, 0.07);
}

.ac-field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ac-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ac-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ac-muted);
}

.ac-field-optional {
  font-size: 12px;
  font-weight: 500;
  color: var(--ac-muted);
  opacity: 0.85;
}

.ac-field-box {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--ac-border);
  border-radius: 14px;
  background: var(--ac-field);
  padding: 0 14px;
  min-height: 52px;
}

.ac-field-box--grow {
  flex: 1;
  min-width: 0;
}

.ac-field-icon {
  width: 20px;
  height: 20px;
  color: var(--ac-muted);
  flex-shrink: 0;
}

.ac-field-input {
  flex: 1;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 16px;
  font-weight: 500;
  outline: none;
  min-width: 0;
  padding: 14px 0;
  font-family: inherit;
}

.ac-field-input::placeholder {
  color: var(--ac-muted);
  opacity: 0.75;
}

.ac-phone-split {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 8px;
}

.ac-country-select {
  border: 1px solid var(--ac-border);
  border-radius: 14px;
  background: var(--ac-field);
  color: inherit;
  font-size: 15px;
  font-weight: 600;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 0 8px;
}

.ac-country-flag {
  font-size: 16px;
  line-height: 1;
}

.ac-country-select .action-chevron {
  width: 14px;
  height: 14px;
  color: var(--ac-muted);
}

.ac-favorite-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.ac-fav-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 214, 10, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ac-fav-star {
  width: 18px;
  height: 18px;
  color: #ffd60a;
}

.ac-fav-label {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
}

.ac-fav-toggle {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  flex-shrink: 0;
}

.ac-fav-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ac-fav-toggle-ui {
  width: 52px;
  height: 32px;
  border-radius: 999px;
  background: #2a3140;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 3px;
  transition: background 0.2s, justify-content 0.2s;
}

html[data-theme="light"] .ac-fav-toggle-ui {
  background: #e5e5ea;
}

.ac-fav-toggle-ui svg {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: transparent;
  padding: 5px;
  box-sizing: border-box;
  transition: color 0.2s;
}

.ac-fav-toggle input:checked + .ac-fav-toggle-ui {
  background: var(--ac-accent);
  justify-content: flex-end;
}

.ac-fav-toggle input:checked + .ac-fav-toggle-ui svg {
  color: var(--ac-accent);
}

.ac-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 0 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: transparent;
  pointer-events: none;
  z-index: 10;
}

.ac-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 112px;
  background: linear-gradient(to top, var(--ac-bg) 8%, rgba(10, 13, 20, 0.72) 42%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

html[data-theme="light"] .ac-footer::before {
  background: linear-gradient(to top, var(--ac-bg) 8%, rgba(238, 241, 248, 0.82) 42%, transparent 100%);
}

.ac-footer-actions {
  width: min(528px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  pointer-events: auto;
}

.ac-btn {
  width: 100%;
  min-height: 54px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s ease, opacity 0.15s ease;
  box-shadow: none;
}

.ac-btn--ghost {
  border: 1.5px solid var(--ac-accent);
  background: transparent;
  color: var(--ac-accent);
}

.ac-btn--ghost:hover {
  filter: brightness(1.08);
}

.ac-btn--primary {
  border: 0;
  background: var(--ac-accent);
  color: #fff;
}

.ac-btn--primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.ac-btn--primary:disabled,
.ac-btn--primary.is-disabled {
  opacity: 0.38;
  cursor: default;
}

@media (max-width: 380px) {
  .ac-page {
    padding-left: 14px;
    padding-right: 14px;
  }

  .ac-phone-split {
    grid-template-columns: 96px 1fr;
  }
}
