/* ══════════════════════════════════════════════════════════════
   Channel Chat — bottom-sheet modal
   Reuses cp-* bubble classes from comments.css.
   ══════════════════════════════════════════════════════════════ */

/* ── Backdrop ── */
.ch-backdrop {
  position: fixed;
  inset: 0;
  z-index: 639;
  background: rgba(0, 0, 0, 0.30);
  -webkit-backdrop-filter: blur(8px) brightness(0.82);
  backdrop-filter: blur(8px) brightness(0.82);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}
.ch-backdrop.ch-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Panel ── */
.ch-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 640;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0.32s;
  will-change: transform;
}
.ch-panel.ch-open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0s;
}

/* ── Header ── */
.ch-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: calc(10px + var(--full-panel-safe-top, 0px)) 12px 10px;
  background: transparent;
  flex-shrink: 0;
  min-height: 54px;
  z-index: 10;
}
html[data-tg-mini-app="1"] .ch-header {
  padding-top: max(0px, calc(10px + var(--full-panel-safe-top, 0px) - 13px));
}
.ch-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(242,239,242,0.85) 0%, rgba(242,239,242,0) 100%);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  -webkit-mask-image: linear-gradient(to bottom, black 35%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 35%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}
html.ios-pwa-edge .ch-panel.ch-open .ch-header::before {
  background: linear-gradient(to bottom, rgba(0,0,0,0.20) 0%, rgba(242,239,242,0.90) 40%, rgba(242,239,242,0) 100%);
}

/* ── Channel header avatar (48×48, right side) ── */
.ch-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  background: #bbb;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 0 0 2.5px rgba(255,255,255,0.60), 0 1px 8px rgba(0,0,0,0.14);
}
.ch-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ch-header-btn {
  width: 44px;
  height: 44px;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #1a1a1a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  background: rgba(255,255,255,0.60);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: 0 1px 8px rgba(0,0,0,0.14);
  transition: background 0.15s;
}
.ch-header-btn:active { background: rgba(255,255,255,0.85); }
.ch-header-center {
  flex: 1;
  min-width: 0;
  text-align: center;
  max-width: 50%;
  margin: 0 auto;
  background: rgba(255,255,255,0.60);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: 0 1px 8px rgba(0,0,0,0.14);
  border-radius: 999px;
  height: 44px;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.ch-header-center:active {
  background: rgba(255,255,255,0.85);
}
.ch-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  max-width: 100%;
}
.ch-subtitle {
  font-size: 12px;
  color: #888;
  line-height: 1.2;
  margin-top: 1px;
}

/* ── Loading / empty ── */
.ch-loading {
  text-align: center;
  padding: 40px 16px;
  color: #888;
  font-size: 14px;
}

/* ── Load-more indicator ── */
.ch-load-more-spinner {
  text-align: center;
  padding: 10px;
  color: #aaa;
  font-size: 13px;
}

/* ── Strict open skeleton (zero-jump placeholder) ── */
.ch-skeleton {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ch-skel-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-self: flex-start;
  max-width: 82%;
}
.ch-skel-line,
.ch-skel-media {
  background: #e9e9e9;
  background-image: linear-gradient(100deg, #e9e9e9 30%, #f3f3f3 50%, #e9e9e9 70%);
  background-size: 220% 100%;
  animation: ch-skel-shimmer 1.3s ease-in-out infinite;
  border-radius: 8px;
}
.ch-skel-title { width: 38%; height: 13px; border-radius: 6px; }
.ch-skel-media { width: 100%; max-width: min(100%, 90vw); border-radius: 13px; }
.ch-skel-cap-1 { width: 92%; height: 11px; }
.ch-skel-cap-2 { width: 58%; height: 11px; }
@keyframes ch-skel-shimmer {
  0%   { background-position: 220% 0; }
  100% { background-position: -220% 0; }
}
@media (prefers-color-scheme: dark) {
  .ch-skel-line,
  .ch-skel-media {
    background: #2a2a2a;
    background-image: linear-gradient(100deg, #2a2a2a 30%, #353535 50%, #2a2a2a 70%);
    background-size: 220% 100%;
  }
}

/* ── Reserved-box video (fills aspect-ratio wrap, no load jump) ── */
.ch-reserved-vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

/* ── Messages area ── */
.ch-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(54px + var(--full-panel-safe-top, 0px) + 12px) 12px 80px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Channel mode: force ALL bubbles left regardless of cp-msg-own */
.ch-mode-channel .cp-msg-own {
  align-self: flex-start;
  flex-direction: row;
  margin-left: 0;
  margin-right: auto;
}
.ch-mode-channel .cp-msg-own .cp-bubble {
  background: var(--cp-bubble-other, #fdf7f6);
  border-radius: 16px 16px 16px 4px;
}

/* Date separator */
.ch-date-sep {
  align-self: center;
  font-size: 12px;
  color: #fff;
  background: rgba(0,0,0,0.35);
  border-radius: 10px;
  padding: 3px 10px;
  margin: 8px 0 4px;
  pointer-events: none;
  flex-shrink: 0;
}

/* ── «Новые сообщения» разделитель ── */
.ch-new-messages-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 16px;
  color: var(--tg-theme-button-color, #2481cc);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.ch-new-messages-sep::before,
.ch-new-messages-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--tg-theme-button-color, #2481cc);
  opacity: 0.35;
}

/* ── Unread badge on FAB ── */
.ch-unread-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  display: none;
  pointer-events: none;
  box-sizing: border-box;
}

/* ── Scroll-to-bottom FAB ── */
.ch-scroll-bottom {
  position: absolute;
  overflow: visible;
  bottom: calc(100% + 14px);
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #555;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
  z-index: 1;
}
.ch-scroll-bottom.ch-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Join capsule ── */
.ch-join-btn {
  display: block;
  width: 40%;
  margin: 15px auto 30px;
  padding: 10px 0;
  background: #e03030;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 28px;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.ch-join-btn:active { opacity: .82; }
.ch-join-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Mute/notify capsule ── */
.ch-mute-btn {
  display: block;
  width: 40%;
  margin: 15px auto 30px;
  padding: 10px 0;
  background: rgba(255,255,255,0.60);
  backdrop-filter: blur(20px) saturate(1.8);
  border: 1px solid rgba(0, 0, 0, 0.13) !important;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.14);
  color: #1a1a1a;
  font-size: 16px;
  font-weight: 500;
  border: none;
  border-radius: 28px;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.ch-mute-btn:active { opacity: .75; }
.ch-mute-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Compose area ── */
.ch-compose {
  position: absolute;
  bottom: var(--keyboard-height, 0px);
  left: 0;
  right: 0;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(242,239,242,0) 0%, rgba(242,239,242,0.85) 100%);
}
.ch-compose-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 12px 12px;
  padding-bottom: max(30px, env(safe-area-inset-bottom, 12px));
  background: linear-gradient(to bottom, rgba(242,239,242,0) 0%, rgba(242,239,242,0.85) 100%);
}

html[data-android="1"][data-env="tg"] .ch-compose-row,
html[data-android="1"][data-env="web"] .ch-compose-row {
  padding-bottom: max(60px, calc(env(safe-area-inset-bottom, 12px) + 30px));
}

.ch-input-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.60);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: 0 1px 8px rgba(0,0,0,0.14);
  border-radius: 22px;
  border: none;
  overflow: hidden;
  min-height: 42px;
}
/* Inner row: input + toggle + emoji + send */
.ch-input-row {
  display: flex;
  align-items: flex-end;
  padding: 9px 12px;
  gap: 8px;
}
/* Format bar: hidden by default, slides open inside the pill */
.ch-fmt-bar {
  display: flex;
  align-items: center;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.22s ease, padding 0.18s ease, border-color 0.18s;
  padding: 0 8px;
  border-bottom: 1px solid transparent;
}
.ch-fmt-bar--visible {
  max-height: 52px;
  padding: 4px 8px;
  border-bottom-color: rgba(0,0,0,0.07);
}
/* Format toggle button (A-with-underline icon, next to emoji) */
.ch-fmt-toggle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, background 0.12s;
  margin-bottom: 2px;
}
.ch-fmt-toggle--active { color: #007aff; }
.ch-fmt-toggle:active  { background: rgba(0,0,0,0.07); }
/* Format buttons inside the bar */
.ch-fmt-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: none;
  background: none;
  color: #3c3c3e;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
}
.ch-fmt-btn:active           { background: rgba(0,0,0,0.09); }
.ch-fmt-btn.ch-fmt-active    { color: #007aff; }
/* Label spans for B/I/U/S buttons */
.ch-fmt-label    { pointer-events: none; line-height: 1; }
.ch-fmt-bold     { font-size: 17px; font-weight: 800; }
.ch-fmt-italic   { font-size: 17px; font-style: italic; }
.ch-fmt-underline{ font-size: 16px; text-decoration: underline; text-underline-offset: 2px; }
.ch-fmt-strike   { font-size: 16px; text-decoration: line-through; }
.ch-fmt-btn svg  { pointer-events: none; }
.ch-fmt-sep {
  width: 1px;
  height: 20px;
  background: rgba(0,0,0,0.12);
  margin: 0 4px;
  flex-shrink: 0;
}
.ch-input {
  flex: 1;
  min-height: 22px;
  /* 10 lines × (15px font × 1.45 line-height) ≈ 218px */
  max-height: 218px;
  overflow-y: auto;
  outline: none;
  font-size: 15px;
  line-height: 1.45;
  color: #1a1a1a;
  word-break: break-word;
  -webkit-overflow-scrolling: touch;
  background: none;
  border: none;
  /* keep 5px breathing room so bottom-aligned buttons look centred on 1 line */
  margin-bottom: 4px;
}
.ch-input:empty::before {
  content: attr(data-placeholder);
  color: #b0b0b0;
  pointer-events: none;
}
.ch-send-btn {
  background: rgba(64,167,227,0.88);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: 0 1px 8px rgba(0,0,0,0.18);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.ch-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ch-send-btn:not(:disabled):active { opacity: 0.8; }

/* ── Group avatars (32×32 beside bubbles) ── */
.ch-avatar {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  border-radius: 50%;
  font-size: 12px;
}

/* ── Channel bubble: no avatar placeholder space ── */
.ch-mode-channel .cp-msg-other {
  padding-left: 0;
}
.ch-mode-channel .cp-msg-other .cp-avatar {
  display: none;
}

/* ── Attach button ── */
.ch-attach-btn {
  background: rgba(255,255,255,0.60);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: 0 1px 8px rgba(0,0,0,0.14);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}
.ch-attach-btn:active { color: #333; opacity: 0.8; }

/* ── Media preview in compose ── */
.ch-media-preview {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 4px;
  position: relative;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
}
.ch-media-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #ddd;
  display: block;
  flex-shrink: 0;
}
.ch-media-label {
  font-size: 13px;
  color: #555;
  flex: 1;
}
.ch-media-remove {
  background: rgba(0,0,0,0.5);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ── Reply bar ── */
.ch-reply-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 4px;
  border-top: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.75);
}
.ch-reply-bar-line {
  width: 3px;
  min-height: 34px;
  border-radius: 2px;
  background: #0583c7;
  flex-shrink: 0;
}
.ch-reply-bar-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ch-reply-bar-name {
  font-size: 12px;
  font-weight: 600;
  color: #0583c7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-reply-bar-preview {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-reply-cancel {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #aaa;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.ch-reply-cancel:active { color: #555; }

/* ══════════════════════════════════════════════════════════════
   Channel Info Panel
   ══════════════════════════════════════════════════════════════ */

.ch-info-panel {
  position: fixed;
  inset: 0;
  z-index: 641;
  background: #f4eff5;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0.32s;
  will-change: transform;
  overflow: hidden;
}
.ch-info-panel.ch-info-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0s;
}

/* ── Info panel header ── */
.ch-info-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: calc(10px + var(--full-panel-safe-top, 0px)) 12px 10px;
  background: transparent;
  min-height: 54px;
  z-index: 10;
}
.ch-info-back {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.60);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: 0 1px 8px rgba(0,0,0,0.14);
  transition: background 0.15s;
}
.ch-info-back svg {
  width: 25px;
  height: 25px;
  stroke: #000000;
  stroke-width: 1.5;
  transform: translateX(-1px);
}
.ch-info-back:active {
  background: rgba(255,255,255,0.85);
}
.ch-info-header-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
}
.ch-info-header-space {
  width: 34px;
  flex-shrink: 0;
}

/* ── Scrollable body ── */
.ch-info-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 16px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
html[data-tg-mini-app="1"] .ch-info-scroll {
  padding-top: 39px;
}

/* ── Avatar ── */
.ch-info-avatar-wrap {
  margin-bottom: 14px;
}
.ch-info-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 700;
  color: #fff;
  background: #bbb;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}
.ch-info-avatar:active { opacity: 0.8; }
.ch-info-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Name & subscribers ── */
.ch-info-name {
  font-size: 25px;
  font-weight: 500;
  color: #1a1a1a;
  text-align: center;
  line-height: 1.2;
  margin-bottom: 4px;
  word-break: break-word;
}
.ch-info-subs {
  font-size: 14px;
  color: #888;
  text-align: center;
  margin-bottom: 20px;
}

/* ── 4 action buttons ── */
.ch-info-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  margin-bottom: 20px;
}
.ch-info-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  background: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 2px 4px 7px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.ch-info-action:active { background: #ebebeb; }
.ch-info-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0583c7;
}
.ch-info-action-label {
  font-size: 11px;
  color: #333;
  text-align: center;
  line-height: 1.2;
}

/* ── Notification context menu ── */
.ch-info-notif-overlay {
  position: fixed;
  inset: 0;
  z-index: 650;
  visibility: hidden;
  pointer-events: none;
}
.ch-info-notif-overlay.ch-notif-menu-open {
  visibility: visible;
  pointer-events: auto;
}
.ch-info-notif-menu {
  position: fixed;
  z-index: 651;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  transform-origin: top left;
  transform: scale(0.88);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.18s cubic-bezier(0.32,0.72,0,1),
              opacity 0.16s ease,
              visibility 0s linear 0.18s;
}
.ch-info-notif-menu.ch-notif-menu-open {
  transform: scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.18s cubic-bezier(0.32,0.72,0,1),
              opacity 0.16s ease,
              visibility 0s linear 0s;
}
.ch-info-notif-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  font-size: 16px;
  color: #1a1a1a;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}
.ch-info-notif-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ch-info-notif-svg {
  flex-shrink: 0;
  color: #1a1a1a;
  opacity: 0.75;
}
.ch-info-notif-item + .ch-info-notif-item {
  border-top: 0.5px solid rgba(0,0,0,0.09);
}
.ch-info-notif-item:active { background: #f0f0f0; }
.ch-info-notif-check {
  opacity: 0;
  color: #0583c7;
  flex-shrink: 0;
  transition: opacity 0.12s;
}
.ch-info-notif-check.ch-notif-active {
  opacity: 1;
}

/* ── Info card (link + description) ── */
.ch-info-card {
  width: 100%;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 20px;
}
.ch-info-desc-row {
  display: flex;
  flex-direction: column;
  padding: 10px 14px 12px;
}
.ch-info-link-row {
  display: flex;
  flex-direction: column;
  padding: 10px 14px 12px;
}
.ch-info-link-row-inner {
  display: flex;
  align-items: center;
  gap: 0;
}
.ch-info-card-label {
  font-size: 12px;
  color: #000000;
  font-weight: 400;
  margin-bottom: 3px;
  line-height: 1.3;
}
.ch-info-link {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  color: #0583c7;
  text-decoration: none;
  word-break: break-all;
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: rgba(5,131,199,0.12);
}
.ch-info-link:active { opacity: 0.65; }
.ch-info-desc {
  font-size: 15px;
  color: #1a1a1a;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.ch-info-card-divider {
  height: 1px;
  background: rgba(0,0,0,0.07);
  margin: 0 14px;
}

/* ── Tab pill switcher ── */
.ch-info-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.07);
  border-radius: 10px;
  padding: 3px;
  width: 100%;
  margin-bottom: 16px;
}
.ch-info-tab {
  flex: 1;
  padding: 7px 4px;
  border: none;
  background: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-info-tab.ch-info-tab-active {
  background: #ffffff;
  color: #1a1a1a;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* ── Tab content ── */
.ch-info-tab-content {
  width: 100%;
  min-height: 120px;
}

/* Spinner while tab loads */
.ch-info-tab-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80px;
}
.ch-info-tab-spinner::after {
  content: "";
  width: 22px;
  height: 22px;
  border: 2px solid rgba(0,0,0,0.12);
  border-top-color: #888;
  border-radius: 50%;
  animation: ch-spin 0.7s linear infinite;
}
@keyframes ch-spin { to { transform: rotate(360deg); } }

/* ── Media tab: 3-column square grid ── */
.ch-info-media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 100%;
}
.ch-info-media-item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #e8e8e8;
  border-radius: 2px;
  cursor: pointer;
}
.ch-info-media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ch-info-media-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.28);
}
.ch-info-media-play svg {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.ch-info-media-empty {
  grid-column: 1 / -1;
  padding: 32px 0;
  text-align: center;
  color: #999;
  font-size: 13px;
}

/* ── Links tab ── */
.ch-info-links-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
}
.ch-info-link-card {
  padding: 10px 4px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
}
.ch-info-link-card:last-child { border-bottom: none; }
.ch-info-link-url {
  font-size: 13px;
  font-weight: 500;
  color: #0088cc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-info-link-snippet {
  font-size: 12px;
  color: #666;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ch-info-links-empty {
  padding: 32px 0;
  text-align: center;
  color: #999;
  font-size: 13px;
}
.ch-info-tab-stub {
  padding: 32px 0;
  text-align: center;
  color: #bbb;
  font-size: 13px;
}

/* ── Media full-screen overlay ── */
.ch-media-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.ch-media-overlay.ch-media-overlay-open {
  display: flex;
}
.ch-media-overlay-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top, 16px));
  right: 16px;
  background: rgba(0,0,0,0.4);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
}
.ch-media-overlay-media {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 3px;
}

/* ── Long-press context menu ── */

/* Backdrop blur overlay — blurs everything beneath it */
.ch-ctx-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 641;
  background: rgba(0,0,0,0.18);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

/* Ghost: sharp clone of the tapped bubble, floats above the blur */
.ch-ctx-ghost {
  display: none;
  position: fixed;
  z-index: 642;
  pointer-events: none;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.28));
}

/* The menu itself */
.ch-ctx-menu {
  display: none;
  position: fixed;
  z-index: 643;
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(22px) saturate(1.8);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.6);
  overflow: hidden;
  min-width: 210px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22), 0 1px 0 rgba(0,0,0,0.06);
}

/* Menu items: SVG icon + label */
.ch-ctx-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 18px;
  background: none;
  border: none;
  font-size: 16px;
  font-family: inherit;
  color: #111;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ch-ctx-item svg {
  flex-shrink: 0;
  color: rgba(0,0,0,0.55);
}
.ch-ctx-item + .ch-ctx-item {
  border-top: 1px solid rgba(0,0,0,0.07);
}
.ch-ctx-item:active { background: rgba(0,0,0,0.06); }
.ch-ctx-danger       { color: #e53e3e !important; }
.ch-ctx-danger svg   { color: #e53e3e; }

/* ── Edit-mode bar (above compose area, mirrors reply-bar) ── */
.ch-edit-bar {
  display: none;
  align-items: center;
  padding: 6px 12px;
  background: #f0f7ff;
  border-top: 1px solid rgba(5,131,199,0.15);
  gap: 8px;
}
.ch-edit-bar.ch-edit-bar-active { display: flex; }
.ch-edit-bar-label {
  flex: 1;
  font-size: 13px;
  color: #0583c7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-edit-bar-cancel {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #888;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  -webkit-tap-highlight-color: transparent;
}

/* ── "изменено" badge inside bubble ── */
.cp-edited-badge {
  font-size: 11px;
  color: rgba(0,0,0,0.4);
  margin-left: 4px;
  white-space: nowrap;
  margin-right: 6px;
}
.cp-msg-own .cp-edited-badge { color: rgba(0,0,0,0.35); }

/* ── Album viewer: "⋯" action menu ── */
.ch-av-menu-btn {
  position: absolute;
  top: 14px;
  right: 56px;
  z-index: 2;
  background: rgba(0,0,0,0.45);
  border: none;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  letter-spacing: 0;
  -webkit-tap-highlight-color: transparent;
}
.ch-av-dropdown {
  position: absolute;
  top: 60px;
  right: 12px;
  z-index: 3;
  background: rgba(30,30,30,0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 12px;
  overflow: hidden;
  min-width: 160px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}
.ch-av-dropdown-item {
  display: block;
  width: 100%;
  padding: 13px 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ch-av-dropdown-item + .ch-av-dropdown-item {
  border-top: 1px solid rgba(255,255,255,0.1);
}
.ch-av-dropdown-item:active { background: rgba(255,255,255,0.1); }
.ch-av-dropdown-item.ch-av-danger { color: #ff6b6b; }

/* ═══════════════════════════════════════════════════════
   Media row (inside pill, above input)
═══════════════════════════════════════════════════════ */
.ch-media-row {
  display: flex;
  align-items: center;
  padding: 5px 8px 4px 10px;
  gap: 6px;
  border-bottom: 1px solid #d4e4fa;
}
.ch-media-track {
  display: flex;
  gap: 5px;
  align-items: center;
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  min-width: 0;
}
.ch-media-track::-webkit-scrollbar { display: none; }
.ch-media-item {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 7px;
  overflow: hidden;
  background: #e0e8f5;
}
.ch-media-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ch-media-video {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #222;
  color: #fff;
  font-size: 16px;
}
.ch-media-video .ch-media-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ch-media-video-icon {
  position: relative;
  z-index: 1;
  font-size: 13px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  pointer-events: none;
}
.ch-media-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.ch-media-remove:active { opacity: 0.7; }
.ch-media-cancel {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #555;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.ch-media-cancel:active { opacity: 0.6; }

/* ── Override bubble max-width when it contains an album ── */
.cp-bubble-media.cp-bubble-album {
  max-width: min(100%, var(--message-media-max-width, 90vw)) !important;
}

/* ── Channel media posts: flat bottom corners on media ─────────
   The bubble switches to overflow:visible so its border-radius
   only paints the white background; actual image clipping is done
   by .cp-media-wrap and .ch-album, each of which keeps its own
   overflow:hidden.

   Logic:
   • Media followed by a caption (.cp-media-caption) → flat bottom
     corners on the media so the transition to text is seamless.
   • Media-only (last child, no caption) → restore all-corner rounding
     so the image respects the bubble's own border-radius. */
.ch-mode-channel .cp-bubble-media {
  overflow: visible !important;
}
/* Default: flat bottom (caption follows) */
.ch-mode-channel .cp-bubble-media .cp-media-wrap {
  border-radius: 13px 13px 0 0;
}
.ch-mode-channel .cp-bubble-media .ch-album {
  border-radius: 15px 15px 0 0;
}
/* Media-only (last child): restore full rounding on all 4 corners */
.ch-mode-channel .cp-bubble-media .cp-media-wrap:last-child {
  border-radius: 13px;
}
.ch-mode-channel .cp-bubble-media .ch-album:last-child {
  border-radius: 12px;
}

/* ═══════════════════════════════════════════════════════
   Album photo grid (inside a message bubble)
═══════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════
   Fullscreen album viewer (swipeable)
═══════════════════════════════════════════════════════ */
.ch-album-viewer {
  position: fixed;
  inset: 0;
  z-index: 850;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}
.ch-album-viewer-img {
  max-width: 100%;
  max-height: 100vh;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.ch-album-viewer-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top, 14px));
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.18);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
}
.ch-album-viewer-counter {
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  background: rgba(0,0,0,0.35);
  border-radius: 20px;
  padding: 4px 12px;
  pointer-events: none;
}
.ch-album-viewer-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.18);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  z-index: 1;
}
.ch-album-viewer-prev { left: 14px; }
.ch-album-viewer-next { right: 14px; }

/* ── Tombstone: deleted-message placeholder ── */
.ch-tombstone {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  margin: 2px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.04);
  color: rgba(0,0,0,0.38);
  font-size: 13px;
  font-style: italic;
  width: fit-content;
  max-width: 72%;
  pointer-events: none;
  user-select: none;
}

/* ── Media-only bubble: reactions appear below the media container ── */
.ch-media-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.cp-msg-own .ch-media-col {
  align-items: flex-end;
}
.cp-reactions-floating {
  background: transparent;
  padding: 0 4px;
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════
   Channel Settings Panel (admin)
   ══════════════════════════════════════════════════════════════ */

/* "Изм." button in info panel header */
.ch-info-edit-btn {
  border-radius: 14px;
  border: none;
  background: rgba(255, 255, 255, 0.7);
  color: #000000;
  font-size: 15px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 1px 8px rgba(0,0,0,0.14);
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s;
}
.ch-info-edit-btn:active {
  background: rgba(255, 255, 255, 0.90);
}

/* Panel container — slides over info panel from the right */
.ch-settings-panel {
  position: fixed;
  inset: 0;
  z-index: 645;
  background: #f4eff5;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0.32s;
  will-change: transform;
  overflow: hidden;
}
.ch-settings-panel.ch-settings-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0s;
}

/* Header: Отмена | [Avatar centered] | Готово */
.ch-settings-header {
  display: flex;
  align-items: center;
  padding: calc(var(--full-panel-safe-top, 0px) + 10px) 4px 14px;
  background: #f4eff5;
  flex-shrink: 0;
}
html[data-tg-mini-app="1"] .ch-settings-header {
  padding-top: max(0px, calc(10px + var(--full-panel-safe-top, 0px) - 13px));
}
.ch-settings-cancel {
  background: rgba(255,255,255,0.60);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: 0 1px 8px rgba(0,0,0,0.14);
  border-radius: 999px;
  border: none;
  height: 34px;
  font-size: 15px;
  font-weight: 500;
  color: #3c3c43;
  padding: 0 16px;
  cursor: pointer;
  min-width: 72px;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  flex-shrink: 0;
}
.ch-settings-cancel:active { background: rgba(255,255,255,0.85); }
.ch-settings-done {
  background: rgba(255,255,255,0.60);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: 0 1px 8px rgba(0,0,0,0.14);
  border-radius: 999px;
  border: none;
  height: 34px;
  font-size: 15px;
  font-weight: 700;
  color: #007aff;
  padding: 0 16px;
  cursor: pointer;
  min-width: 72px;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  flex-shrink: 0;
}
.ch-settings-done:disabled { opacity: 0.4; cursor: not-allowed; }
.ch-settings-done:not(:disabled):active { background: rgba(255,255,255,0.85); }
.ch-settings-header-av-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Avatar in header — 100×100 circle */
.ch-settings-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 700;
  color: #fff;
  background: #bbb;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.ch-settings-avatar:active { opacity: 0.8; }
.ch-settings-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Scrollable body */
.ch-settings-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 16px 40px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* "Выбрать фотографию" link */
.ch-settings-photo-btn {
  background: none;
  border: none;
  color: #007aff;
  font-size: 15px;
  text-align: center;
  padding: 6px 0 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}
.ch-settings-photo-btn:active { opacity: 0.55; }
.ch-settings-delete-btn { color: #ff3b30; display: none; padding-top: 0; }
.ch-settings-delete-btn.ch-vis { display: block; }

/* White rounded bubble */
.ch-settings-bubble {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

/* Input/textarea field */
.ch-settings-field {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: none;
  border: none;
  outline: none;
  font-size: 16px;
  color: #1a1a1a;
  font-family: inherit;
  padding: 13px 16px;
  resize: none;
  line-height: 1.45;
}
.ch-settings-field::placeholder { color: #c7c7cc; }
.ch-settings-title-input {
  height: 48px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 48px;
}
.ch-settings-desc-input {
  min-height: calc(2 * 16px * 1.45 + 26px);
  max-height: calc(12 * 16px * 1.45 + 26px);
  overflow-y: auto;
  resize: none;
}

/* Gray iOS-style separator inside bubble */
.ch-settings-sep {
  height: 1px;
  background: rgba(60,60,67,0.18);
  margin: 0 16px;
}

/* Rows bubble (second bubble): info rows */
.ch-settings-rows-bubble .ch-settings-row:first-child {
  border-top: none;
}

/* Single settings row */
.ch-settings-row {
  display: flex;
  align-items: center;
  padding: 10px 14px 10px 12px;
  gap: 12px;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  min-height: 50px;
}

/* Separator between rows — iOS-style (inset after icon) */
.ch-settings-row-sep {
  border-top: 1px solid rgba(60,60,67,0.12);
  margin-top: 0;
}

/* iOS squircle icon (44×44 rounded square) */
.ch-settings-row-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Row label */
.ch-settings-row-label {
  flex: 1;
  font-size: 16px;
  color: #1a1a1a;
  line-height: 1.2;
}

/* Row value (gray, on right) */
.ch-settings-row-value {
  font-size: 15px;
  color: #8e8e93;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chevron */
.ch-settings-row-chevron {
  font-size: 20px;
  color: #c7c7cc;
  line-height: 1;
  margin-left: 4px;
  flex-shrink: 0;
}

/* ── Clickable settings row ──────────────────────────────────── */
.ch-settings-row-tappable {
  cursor: pointer;
}
.ch-settings-row-tappable:active {
  background: rgba(0,0,0,0.05);
}

/* ═══════════════════════════════════════════════════════════════
   Admins sub-panel
   ═══════════════════════════════════════════════════════════════ */

.ch-admins-panel {
  position: fixed;
  inset: 0;
  z-index: 646;
  background: #f2f2f7;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0.32s;
  will-change: transform;
  overflow: hidden;
}
.ch-admins-panel.ch-admins-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0s;
}

/* Header */
.ch-admins-header {
  display: flex;
  align-items: center;
  padding: calc(var(--full-panel-safe-top, 0px) + 10px) 4px 14px;
  background: #f2f2f7;
  flex-shrink: 0;
}
.ch-admins-back {
  background: none;
  border: none;
  font-size: 17px;
  color: #007aff;
  padding: 6px 12px;
  cursor: pointer;
  min-width: 80px;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}
.ch-admins-back:active { opacity: 0.55; }
.ch-admins-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
}

/* Scrollable body */
.ch-admins-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px 0;
}

/* Admin row card */
.ch-admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 12px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 2px;
  min-height: 58px;
}
.ch-admin-row:first-child { border-radius: 12px 12px 0 0; }
.ch-admin-row:last-child  { border-radius: 0 0 12px 12px; }
.ch-admin-row:only-child  { border-radius: 12px; }
.ch-admin-row + .ch-admin-row {
  border-radius: 0;
  border-top: 1px solid rgba(60,60,67,0.12);
  margin-top: 0;
}

.ch-admin-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.ch-admin-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ch-admin-info {
  flex: 1;
  min-width: 0;
}
.ch-admin-name {
  font-size: 16px;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-admin-date {
  font-size: 12px;
  color: #8e8e93;
  margin-top: 2px;
}
.ch-admin-remove-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #ff3b30;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  border-radius: 50%;
  flex-shrink: 0;
}
.ch-admin-remove-btn:active { opacity: 0.55; }
.ch-admin-owner-badge {
  font-size: 12px;
  color: #8e8e93;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Empty state */
.ch-admins-empty {
  text-align: center;
  color: #8e8e93;
  font-size: 15px;
  padding: 32px 16px;
}

/* Footer: add button */
.ch-admins-footer {
  padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
  flex-shrink: 0;
}
.ch-admins-add-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  color: #007aff;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
}
.ch-admins-add-btn:active { opacity: 0.6; }

/* ═══════════════════════════════════════════════════════════════
   Add-admin picker (bottom-sheet)
   ═══════════════════════════════════════════════════════════════ */

.ch-add-admin-modal {
  position: fixed;
  inset: 0;
  z-index: 660;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.ch-add-admin-modal.ch-add-admin-open {
  opacity: 1;
  pointer-events: auto;
}
.ch-add-admin-sheet {
  width: 100%;
  max-height: 72vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.ch-add-admin-modal.ch-add-admin-open .ch-add-admin-sheet {
  transform: translateY(0);
}
.ch-add-admin-sheet-header {
  display: flex;
  align-items: center;
  padding: 16px 12px 10px 16px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(60,60,67,0.12);
}
.ch-add-admin-sheet-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
}
.ch-add-admin-close {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #8e8e93;
  display: flex;
  -webkit-tap-highlight-color: transparent;
  border-radius: 50%;
}
.ch-add-admin-close:active { opacity: 0.55; }
.ch-add-admin-search-wrap {
  padding: 10px 16px 8px;
  flex-shrink: 0;
}
.ch-add-admin-search {
  width: 100%;
  box-sizing: border-box;
  background: rgba(118,118,128,0.12);
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 15px;
  color: #1a1a1a;
  font-family: inherit;
  outline: none;
}
.ch-add-admin-search::placeholder { color: #8e8e93; }
.ch-add-admin-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 8px;
}
.ch-add-admin-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ch-add-admin-item:active { background: rgba(0,0,0,0.04); }
.ch-add-admin-item-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.ch-add-admin-item-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ch-add-admin-item-info {
  flex: 1;
  min-width: 0;
}
.ch-add-admin-item-name {
  font-size: 16px;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-add-admin-item-username {
  font-size: 13px;
  color: #8e8e93;
  margin-top: 1px;
}
.ch-add-admin-item.is-admin .ch-add-admin-item-name::after {
  content: " ·";
}
.ch-add-admin-already {
  font-size: 13px;
  color: #34c759;
  flex-shrink: 0;
  white-space: nowrap;
}
.ch-add-admin-list-empty {
  text-align: center;
  color: #8e8e93;
  font-size: 15px;
  padding: 24px 16px;
}
.ch-add-admin-loading {
  text-align: center;
  color: #8e8e93;
  font-size: 15px;
  padding: 24px 16px;
}

/* ═══════════════════════════════════════════════════════════════
   Type sub-panel
   ═══════════════════════════════════════════════════════════════ */

.ch-type-panel {
  position: fixed;
  inset: 0;
  z-index: 646;
  background: #f2f2f7;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0.32s;
  will-change: transform;
  overflow: hidden;
}
.ch-type-panel.ch-type-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0s;
}

.ch-type-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--full-panel-safe-top, 0px) + 10px) 4px 14px;
  background: #f2f2f7;
  flex-shrink: 0;
}
.ch-type-cancel {
  background: none; border: none;
  font-size: 17px; color: #007aff;
  padding: 6px 12px; cursor: pointer;
  min-width: 70px; text-align: left;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}
.ch-type-cancel:active { opacity: 0.55; }
.ch-type-title {
  font-size: 17px; font-weight: 600; color: #1a1a1a;
}
.ch-type-done {
  background: none; border: none;
  font-size: 17px; color: #007aff; font-weight: 600;
  padding: 6px 12px; cursor: pointer;
  min-width: 70px; text-align: right;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}
.ch-type-done:active { opacity: 0.55; }
.ch-type-done:disabled { color: #c7c7cc; cursor: default; }

.ch-type-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px 0;
}

.ch-type-radio-bubble { padding: 0 !important; }
.ch-type-radio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ch-type-radio-row:active { background: rgba(0,0,0,0.04); }
.ch-type-radio-info { flex: 1; min-width: 0; }
.ch-type-radio-label { font-size: 16px; color: #1a1a1a; }
.ch-type-radio-sub   { font-size: 13px; color: #8e8e93; margin-top: 2px; }
.ch-type-check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #c7c7cc; flex-shrink: 0;
  position: relative; background: #fff;
  transition: background 0.15s, border-color 0.15s;
}
.ch-type-check.checked {
  background: #007aff; border-color: #007aff;
}
.ch-type-check.checked::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px; right: 3px; bottom: 3px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 8l3.5 3.5 6.5-7' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

.ch-type-link-bubble { padding: 0 !important; }
.ch-type-link-section-label {
  font-size: 12px; color: #8e8e93; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.4px;
  padding: 10px 16px 0;
}
.ch-type-link-row {
  display: flex; align-items: center;
  padding: 10px 16px 12px;
  gap: 0;
}
.ch-type-link-prefix {
  font-size: 16px; color: #8e8e93; flex-shrink: 0;
  font-family: inherit;
  user-select: none;
}
.ch-type-link-input {
  flex: 1; border: none; outline: none; background: none;
  font-size: 16px; color: #1a1a1a;
  font-family: inherit; min-width: 0;
  padding: 0; margin: 0;
}
.ch-type-link-input::placeholder { color: #c7c7cc; }
.ch-type-link-input:read-only { color: #8e8e93; }
.ch-type-link-status {
  font-size: 18px; flex-shrink: 0; margin-left: 8px;
  font-weight: 700; min-width: 22px; text-align: center;
}
.ch-type-link-hint {
  font-size: 13px; color: #8e8e93;
  padding: 4px 16px 16px;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════
   Discussion bottom-sheet modal
   ═══════════════════════════════════════════════════════════════ */

.ch-discussion-modal {
  position: fixed; inset: 0; z-index: 646;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s;
}
.ch-discussion-modal.ch-discussion-open {
  opacity: 1; pointer-events: auto;
}
.ch-discussion-sheet {
  width: 100%; background: #fff;
  border-radius: 14px 14px 0 0;
  max-height: 70vh; display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
}
.ch-discussion-modal.ch-discussion-open .ch-discussion-sheet {
  transform: translateY(0);
}
.ch-discussion-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(60,60,67,0.12);
  flex-shrink: 0;
}
.ch-discussion-title {
  font-size: 17px; font-weight: 600; color: #1a1a1a;
}
.ch-discussion-close {
  background: none; border: none; padding: 4px; cursor: pointer;
  color: #8e8e93;
  -webkit-tap-highlight-color: transparent;
}
.ch-discussion-close:active { opacity: 0.55; }
.ch-discussion-list {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.ch-discussion-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ch-discussion-item:active { background: rgba(0,0,0,0.04); }
.ch-discussion-item-av {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff;
}
.ch-discussion-item-av img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ch-discussion-item-info { flex: 1; min-width: 0; }
.ch-discussion-item-name {
  font-size: 16px; color: #1a1a1a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ch-discussion-item-type { font-size: 13px; color: #8e8e93; margin-top: 2px; }
.ch-discussion-check {
  font-size: 18px; color: #007aff; font-weight: 700; flex-shrink: 0;
}
.ch-discussion-footer {
  padding: 8px 16px 10px; flex-shrink: 0;
  border-top: 1px solid rgba(60,60,67,0.12);
  display: flex; flex-direction: column; gap: 8px;
}
.ch-discussion-create-btn {
  width: 100%; padding: 12px; background: #f0f6ff;
  border: none; border-radius: 10px;
  font-size: 16px; color: #007aff; font-weight: 600;
  cursor: pointer; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.ch-discussion-create-btn:active { opacity: 0.75; }
.ch-discussion-unlink-btn {
  width: 100%; padding: 12px; background: #fff1f0;
  border: none; border-radius: 10px;
  font-size: 16px; color: #ff3b30; font-weight: 600;
  cursor: pointer; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.ch-discussion-unlink-btn:active { opacity: 0.75; }
.ch-discussion-empty, .ch-discussion-loading {
  text-align: center; color: #8e8e93;
  font-size: 15px; padding: 24px 16px;
}

/* ═══════════════════════════════════════════════════════════════
   QR-код: кнопка + bottom-sheet + toast
   ═══════════════════════════════════════════════════════════════ */

/* ── QR-кнопка рядом со ссылкой ── */
.ch-qr-btn {
  background: none;
  border: none;
  padding: 5px;
  margin-left: 6px;
  color: #8e8e93;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.ch-qr-btn:active { background: rgba(0,0,0,0.07); }

/* ── Modal backdrop ── */
.ch-qr-modal {
  position: fixed;
  inset: 0;
  z-index: 650;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s;
  display: flex;
  align-items: flex-end;
}
.ch-qr-modal.ch-qr-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Bottom sheet ── */
.ch-qr-sheet {
  width: 100%;
  max-height: 80vh;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
}
.ch-qr-modal.ch-qr-open .ch-qr-sheet {
  transform: translateY(0);
}

/* ── Semi-transparent overlay inside sheet ── */
.ch-qr-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0,0,0,0.35);
  min-height: 100%;
  padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
}

/* ── Sheet header ── */
.ch-qr-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 12px;
}
.ch-qr-header-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.ch-qr-close {
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  flex-shrink: 0;
}
.ch-qr-close:active { background: rgba(255,255,255,0.35); }

/* ── QR card ── */
.ch-qr-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  margin: 0 24px 8px;
  max-width: 300px;
  width: calc(100% - 48px);
}
.ch-qr-card canvas,
.ch-qr-card img {
  display: block;
  max-width: 100%;
  height: auto;
}
.ch-qr-url {
  font-size: 13px;
  color: #555;
  text-align: center;
  word-break: break-all;
  line-height: 1.4;
}

/* ── QR action buttons (Share / Download) ── */
.ch-qr-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}
.ch-qr-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: #f0f0f0;
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  white-space: nowrap;
}
.ch-qr-action-btn:active { background: #ddd; }
@media (prefers-color-scheme: dark) {
  .ch-qr-action-btn { background: #2c2c2e; color: #f0f0f0; }
  .ch-qr-action-btn:active { background: #3a3a3c; }
}

/* ── Copy toast ── */
.ch-copy-toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(30,30,30,0.88);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 20px;
  border-radius: 20px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 700;
}
.ch-copy-toast.ch-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* (floating toolbar removed — formatting is inside ch-input-wrap now) */

/* ── Formatting inside message bubbles ── */
.cp-text b, .cp-text strong { font-weight: 700; }
.cp-text i, .cp-text em    { font-style: italic; }
.cp-text u                  { text-decoration: underline; }
.cp-text s, .cp-text del    { text-decoration: line-through; }
.cp-text code {
  font-family: ui-monospace, "Roboto Mono", monospace;
  font-size: 0.88em;
  background: rgba(0, 122, 255, 0.10);
  color: #0066cc;
  border-radius: 4px;
  padding: 2px 5px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, color 0.12s;
  word-break: break-all;
}
.cp-text code:active,
.cp-text code.ch-code-copied { background: rgba(0, 122, 255, 0.22); color: #004eaa; }
/* Copied toast badge */
.ch-code-toast {
  position: fixed;
  z-index: 99999;
  background: rgba(30,30,30,0.88);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  padding: 7px 14px;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  transition: opacity 0.3s ease;
}
.ch-code-toast--out { opacity: 0; }
.cp-text a { color: #007aff; text-decoration: none; }
.cp-text a:hover { text-decoration: underline; }
.cp-media-caption .cp-text code {
  background: rgba(255,255,255,0.20);
  color: rgba(255,255,255,0.92);
}

@media (prefers-color-scheme: dark) {
  .ch-info-notif-menu {
    background: #1c1c1e;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.30);
  }
  .ch-info-notif-item {
    color: #f2f2f7;
  }
  .ch-info-notif-item + .ch-info-notif-item {
    border-top-color: rgba(255,255,255,0.10);
  }
  .ch-info-notif-item:active { background: #2c2c2e; }
  .ch-info-notif-check { color: #3e9bdc; }
}

/* ── Pin-row: shows the pinned prompt before the compose input ── */
.ch-pin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 6px;
  background: #f0f6ff;
  border-top: 1px solid #d4e4fa;
  border-bottom: 1px solid #d4e4fa;
}
.ch-pin-row-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e0e8f5;
}
.ch-pin-row-label {
  flex: 1;
  font-size: 13px;
  color: #1a5fa8;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-pin-row-cancel {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #6b8ab5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ch-pin-row-cancel:active { opacity: 0.6; }

.ch-repeat-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 10px 10px 10px;
  padding: 9px 12px 9px 10px;
  background: #ffedef;
  border-radius: 14px;
}
.ch-repeat-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.ch-repeat-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: #e60023;
}
.ch-repeat-label {
  font-size: 12px;
  line-height: 1.35;
  color: #555;
}
.ch-repeat-label b {
  font-weight: 700;
  color: #222;
}
.ch-repeat-btn {
  flex-shrink: 0;
  padding: 7px 18px;
  background: transparent;
  color: #e60023;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid #e60023;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.ch-repeat-btn:active {
  background: #e60023;
  color: #fff;
}

/* ── Channel picker row ── */
.ch-pin-picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}
.ch-pin-picker-row:active { background: #f5f5f5; }
.ch-pin-picker-av {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  background: #007aff;
  color: #fff;
}
.ch-pin-picker-av img { width: 100%; height: 100%; object-fit: cover; }
.ch-pin-picker-info { flex: 1; min-width: 0; }
.ch-pin-picker-title { font-size: 15px; font-weight: 600; color: #111; line-height: 1.2; }
.ch-pin-picker-sub { font-size: 12px; color: #888; margin-top: 1px; }
