/* ==========================================================================
   phase3.css — استایل صفحه‌های کانال بازدیدکننده (فهرست کانال‌ها و یک کانال)
   فقط از توکن‌های تعریف‌شده در app.css استفاده می‌کند تا تم روشن، تم تاریک و
   حالت موبایل بدون تکرار رنگ‌ها هماهنگ بمانند.
   ========================================================================== */

/* ------------------------------------------------------- پوستهٔ صفحه */
.channels-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 900px;
  margin: 0 auto;
  background: var(--surface);
  border-inline: 1px solid var(--line);
  box-shadow: 0 0 60px rgba(16, 26, 46, .06);
}

[data-theme="dark"] .channels-shell {
  box-shadow: 0 0 60px rgba(0, 0, 0, .45);
}

/* سرصفحه مثل chat-head: ثابت می‌ماند و فقط بدنه اسکرول می‌شود */
.channels-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  min-height: var(--header-h);
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  z-index: 5;
}

.channels-head-main {
  flex: 1 1 auto;
  min-width: 0;
}

.channels-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
}

/* نام کانال ممکن است بلند باشد؛ به‌جای سرریز، می‌شکند */
.channels-title > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.channels-sub {
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.channels-sub:empty {
  display: none;
}

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

/* بدنهٔ اسکرول‌شونده؛ پس‌زمینهٔ ملایم مثل chat-body */
.channels-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px 10px;
  background:
    radial-gradient(700px 300px at 50% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
}

/* پانویس ثابت؛ دکمهٔ به‌روزرسانی و وضعیت اتصال زنده این‌جا می‌نشینند */
.channels-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-faint);
}

.channels-foot__note {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------- نشان کانال */
/* نشان کوچک «اطلاع‌رسانی» در سرصفحهٔ هر دو صفحه */
.broadcast-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.9;
  white-space: nowrap;
  user-select: none;
}

/* ------------------------------------------------------ فهرست کانال‌ها */
.channel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.channel-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease,
    transform .08s ease, background-color .15s ease;
}

.channel-card:hover,
.channel-card:focus-visible {
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
}

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

.channel-card:active {
  transform: translateY(0);
}

.channel-card__main {
  flex: 1 1 auto;
  min-width: 0;
}

.channel-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
}

.channel-card__name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.channel-card__desc {
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text-dim);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.channel-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-faint);
}

.channel-card__dot {
  opacity: .7;
}

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

/* نشان تعداد پست‌های خوانده‌نشدهٔ هر کانال */
.channel-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* در تم تاریک لهجه روشن‌تر است؛ متن سفید روی آن خوانا می‌ماند */
[data-theme="dark"] .channel-unread {
  color: #fff;
}

.channel-card__arrow {
  color: var(--text-faint);
  font-size: 18px;
  line-height: 1;
}

/* --------------------------------------------------------- پست‌های کانال */
.channel-post-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.channel-post {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

/* فقط پست تازه‌ای که از رویداد زنده می‌رسد انیمیشن ورود دارد */
.channel-post.is-new {
  animation: channel-post-in .24s cubic-bezier(.22, 1, .36, 1);
}

.channel-post__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.channel-post__author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.channel-post__author::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--accent);
}

.channel-post__time {
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
}

/* متن پست؛ whitespace خطوط متن مدیر را حفظ می‌کند */
.channel-post__body {
  font-size: 14px;
  line-height: 1.95;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@keyframes channel-post-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------- حالت خالی */
.channel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 46px 22px;
  text-align: center;
  color: var(--text-faint);
}

.channel-empty__icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 2px;
  border-radius: 50%;
  background: var(--surface-3);
  font-size: 26px;
}

.channel-empty__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dim);
}

.channel-empty__text {
  max-width: 340px;
  font-size: 12.5px;
  line-height: 1.9;
}

.channel-empty .btn {
  margin-top: 8px;
}

/* ------------------------------------------------- وضعیت اتصال زنده */
.channel-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.channel-live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--text-faint);
  transition: background-color .15s ease, box-shadow .15s ease;
}

.channel-live.is-online::before {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .18);
}

[data-theme="dark"] .channel-live.is-online::before {
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .18);
}

/* --------------------------------------------------------------- موبایل */
@media (max-width: 640px) {
  .channels-shell {
    border-inline: 0;
    box-shadow: none;
  }

  .channels-head {
    gap: 8px;
    padding: 10px 12px;
  }

  .channels-title {
    font-size: 15px;
  }

  .channels-head-actions {
    gap: 4px;
  }

  .channels-head-actions .btn {
    padding: 5px 9px;
    font-size: 11.5px;
  }

  .channels-body {
    gap: 10px;
    padding: 12px 10px 8px;
  }

  .channel-card {
    gap: 8px;
    padding: 12px;
  }

  .channel-card__desc {
    -webkit-line-clamp: 3;
  }

  .channel-post {
    padding: 11px 12px;
  }

  .channel-post__body {
    font-size: 13.5px;
  }

  .channels-foot {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    font-size: 11.5px;
  }
}

@media (max-width: 420px) {
  .channels-foot {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .channels-foot .btn {
    align-self: center;
  }

  /* فلش ردیف کانال هم آیکون است؛ به‌جای پنهان‌شدن فقط کوچک‌تر می‌شود */
  .channel-card__arrow {
    flex: 0 0 auto;
    font-size: 15px;
  }
}

/* اگر کاربر انیمیشن کمتر خواسته باشد، حرکت‌ها خاموش می‌شوند */
@media (prefers-reduced-motion: reduce) {
  .channel-card,
  .channel-live::before {
    transition: none;
  }

  .channel-post.is-new {
    animation: none;
  }
}

/* ======================================================
   فهرست کانال به سبک تلگرام
   فقط در صفحهٔ /channels استفاده می‌شود: ردیف‌های چسبیده با خط جداکنندهٔ
   نازک، آواتار دایره‌ای، نام و زمان نسبی، پیش‌نمایش یک‌خطی و نشان
   خوانده‌نشده. قاعده‌ها بعد از استایل‌های قبلی آمده‌اند تا فقط فهرست
   کانال‌ها را بازنویسی کنند و به کارت‌های صفحه‌های دیگر کاری نداشته باشند.
   ====================================================== */

.channel-list {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.channel-list .channel-card {
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.channel-list .channel-card:last-child {
  border-bottom: 0;
}

.channel-list .channel-card:hover,
.channel-list .channel-card:focus-visible {
  border-color: transparent;
  border-bottom-color: var(--line);
  background: var(--surface-2);
  box-shadow: none;
  transform: none;
}

.channel-list .channel-card:last-child:hover,
.channel-list .channel-card:last-child:focus-visible {
  border-bottom-color: transparent;
}

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

.channel-list .channel-card:active {
  transform: none;
}

/* آواتار دایره‌ای با حرف اول نام؛ چهار رنگ ملایم بر اساس شناسهٔ کانال */
.channel-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

.channel-avatar--2 {
  background: var(--ok-soft);
  color: var(--ok);
}

.channel-avatar--3 {
  background: var(--warn-soft);
  color: var(--warn);
}

.channel-avatar--4 {
  background: var(--danger-soft);
  color: var(--danger);
}

.channel-list .channel-card__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.channel-list .channel-card__title {
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  font-size: 14.5px;
  line-height: 1.5;
}

.channel-list .channel-card__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
}

.channel-card__time {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-faint);
  white-space: nowrap;
}

.channel-card__preview {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.channel-list .channel-card__desc {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
}

.channel-list .channel-unread {
  flex: 0 0 auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 10.5px;
}

@media (max-width: 640px) {
  .channel-list {
    border-radius: var(--radius);
  }

  .channel-list .channel-card {
    gap: 9px;
    padding: 9px 10px;
  }

  .channel-avatar {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .channel-list .channel-card__title {
    font-size: 14px;
  }

  .channel-list .channel-card__desc {
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .channel-card__time {
    font-size: 10px;
  }

  .channel-list .channel-card {
    gap: 8px;
    padding: 8px 9px;
  }

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

/* ======================================================
   صفحهٔ کانال به سبک تلگرام — بخش تازه (task-19)
   فقط در /channel استفاده می‌شود: خط وضعیت اعضا، برچسب «خصوصی»،
   دکمه‌های اعضا/ترک، شمارندهٔ بازدید، مودال اعضا و کارت کانال خصوصی.
   قاعده‌ها بعد از استایل‌های قبلی آمده‌اند تا صفحهٔ فهرست کانال‌ها
   دست‌نخورده بماند و همه‌چیز از توکن‌های app.css ارث ببرد.
   ====================================================== */

/* سرصفحه: نام و توضیح، سپس خط وضعیت و دکمه‌های عضویت */
.channel-page .channels-head {
  align-items: flex-start;
}

.channel-page .channels-head-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.channel-page .channels-title {
  margin: 0;
}

.channel-page .channel-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-faint);
}

.channel-meta__members {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* برچسب «خصوصی» کنار تعداد اعضا */
.channel-private {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.8;
  white-space: nowrap;
  user-select: none;
}

.channel-private::before {
  content: "🔒";
  font-size: 10px;
  line-height: 1;
}

/* دکمه‌های «اعضا» و «ترک کانال» زیر خط وضعیت */
.channel-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.channel-actions .btn {
  padding: 5px 12px;
  font-size: 12px;
}

/* پیام غیرعضو کانال عمومی */
.channel-join-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  line-height: 1.8;
}

.channel-join-hint::before {
  content: "🔗";
  flex: 0 0 auto;
  font-size: 13px;
  line-height: 1;
}

/* پای پست: شمارندهٔ بازدید با 👁 و ارقام فارسی */
.channel-post__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}

.channel-post__views {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1;
  user-select: none;
}

.channel-post__eye {
  font-size: 12.5px;
  line-height: 1;
}

.channel-post__views-count {
  font-variant-numeric: tabular-nums;
  letter-spacing: .2px;
}

/* کارت کانال خصوصی (پاسخ ۴۰۳) */
.channel-empty--locked {
  align-self: center;
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 38px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.channel-empty--locked .channel-empty__icon {
  background: var(--warn-soft);
}

/* فهرست اعضا در مودال */
.channel-members {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.channel-members__status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 4px;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.8;
  text-align: center;
}

.channel-members__count {
  margin: 0 0 6px;
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1.7;
}

.channel-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
}

.channel-member:last-child {
  border-bottom: 0;
}

.channel-member__avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

.channel-member__main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.channel-member__name {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.channel-member__joined {
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.7;
}

/* متن و خطای مودال تأیید ترک کانال */
.channel-confirm__text {
  margin: 0 0 10px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.95;
}

.channel-confirm__text:last-of-type {
  margin-bottom: 0;
}

.channel-confirm__error {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.8;
}

/* موبایل: سرصفحهٔ کانال جمع‌وجورتر می‌شود */
@media (max-width: 640px) {
  .channel-page .channels-head {
    align-items: center;
  }

  .channel-page .channel-meta {
    margin-top: 4px;
    font-size: 11px;
  }

  .channel-page .channel-actions {
    margin-top: 7px;
  }

  .channel-actions .btn {
    padding: 4px 10px;
    font-size: 11.5px;
  }

  .channel-join-hint {
    padding: 8px 11px;
    font-size: 11.5px;
  }

  .channel-empty--locked {
    padding: 30px 16px;
  }
}

/* ------------------------------------------------- ریشهٔ مودال صفحهٔ کانال */
/* این عنصر فقط نگه‌دارنده است؛ با display:contents خودش جعبه نمی‌سازد تا
   لایهٔ تمام‌صفحهٔ .modal-back همان‌طور که در app.css تعریف شده کار کند و
   کلاس .hidden هم بتواند کل مجموعه را پنهان کند. */
.channel-modal-root {
  display: contents;
}

/* ==========================================================================
   نسخهٔ ۲.۵ — عکس و پروفایل کانال، نوار سنجاق، پیوست پست و پخش‌کنندهٔ صوتی
   --------------------------------------------------------------------------
   همهٔ قاعده‌های این بخش فقط در انتهای فایل افزوده شده‌اند؛ هیچ قاعدهٔ موجودی
   تغییر نکرده است. رنگ، شعاع و سایه فقط از توکن‌های app.css خوانده می‌شود تا
   تم روشن، تم تاریک و حالت موبایل خودکار هماهنگ بمانند. کلاس‌های پروفایل هم
   به شکل BEM (channel-profile__*) و هم به شکل تخت (channel-profile-*) پوشش
   داده شده‌اند تا مارک‌آپ ثابت و مارک‌آپ پویا هر دو یکسان دیده شوند.
   ========================================================================== */

/* ------------------------------------------------ آواتار/عکس کانال */
/* دایرهٔ آواتار در سرصفحهٔ کانال؛ تصویر با object-fit:cover پر می‌شود و
   نبود تصویر با حرف اول (channel-photo__letter) جایگزین می‌شود. */
.channel-photo,
.channel-photo--letter {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

img.channel-photo {
  object-fit: cover;
  cursor: pointer;
}

.channel-photo__img,
.channel-photo > img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: inherit;
  object-fit: cover;
}

.channel-photo__letter {
  display: block;
  max-width: 100%;
  padding: 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-photo:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.channel-photo:active {
  transform: scale(.96);
}

.channel-photo:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

/* ------------------------------------------------- پروفایل کانال */
/* صفحهٔ کامل پروفایل روی همان ستون میانی (عرض ۹۰۰px مثل .channels-shell)؛
   نه پنل کنارِ نیمه‌کاره. کلاس .hidden که در app.css تعریف شده همچنان آن را
   کامل پنهان می‌کند. */
.channel-profile {
  position: fixed;
  inset-block: 0;
  inset-inline: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
  padding: 24px 18px;
  border-inline: 1px solid var(--line);
  background:
    radial-gradient(700px 320px at 50% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: channel-profile-fade .16s ease-out;
}

@keyframes channel-profile-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes channel-profile-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: none; }
}

/* ستون محتوای پروفایل؛ صفحهٔ کامل است، پس قاب کارت لازم ندارد و فقط
   محتوا را وسط ستون می‌چیند. */
.channel-profile__sheet,
.channel-profile-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(420px, 100%);
  max-height: 100%;
  margin: 0 auto;
  padding: 24px 22px;
  border: 0;
  border-radius: var(--radius-xl);
  background: transparent;
  text-align: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: channel-profile-in .2s cubic-bezier(.22, 1, .36, 1);
}

/* ردیف بالای کارت (در صورت استفاده از مارک‌آپ تخت) */
.channel-profile-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* عکس بزرگ پروفایل: دایره‌ای با قاب نازک و سایهٔ ملایم */
.channel-profile__photo,
.channel-profile-photo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 108px;
  height: 108px;
  margin: 2px 0 4px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-sm);
  user-select: none;
}

.channel-profile__img,
.channel-profile__photo > img,
.channel-profile-photo > img,
.channel-profile-photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: inherit;
  object-fit: cover;
}

.channel-profile__letter,
.channel-profile-photo__letter {
  display: block;
  max-width: 100%;
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* نام، تعداد اعضا، توضیح و نشان کانال خصوصی */
.channel-profile__name,
.channel-profile-name {
  margin: 0;
  max-width: 100%;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  overflow-wrap: anywhere;
}

.channel-profile__members,
.channel-profile-members {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.9;
  white-space: nowrap;
}

.channel-profile__desc,
.channel-profile-desc {
  width: 100%;
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.95;
  text-align: center;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* اگر توضیح خالی بود، فضای اضافه نگیرد */
.channel-profile__desc:empty,
.channel-profile-desc:empty {
  display: none;
}

.channel-profile__badge,
.channel-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.9;
  white-space: nowrap;
}

/* دکمهٔ بستن پروفایل: گرد، گوشهٔ بالای کارت (در RTL سمت چپ) */
.channel-profile__close,
.channel-profile-close {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-end: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-dim);
  font: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background .14s ease, color .14s ease, transform .14s ease;
}

.channel-profile__close:hover,
.channel-profile-close:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.channel-profile__close:active,
.channel-profile-close:active {
  transform: scale(.95);
}

.channel-profile__close:focus-visible,
.channel-profile-close:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* ردیف دکمه‌های پروفایل (در مارک‌آپ تخت پنل هم قابل استفاده است) */
.channel-profile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}

.channel-profile-actions .btn {
  flex: 1 1 auto;
  justify-content: center;
  min-width: 120px;
}

/* --------------------------------------------- نوار پست سنجاق‌شده */
.channel-pinned {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.7;
  text-align: start;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease;
}

.channel-pinned:hover {
  border-color: var(--accent);
}

.channel-pinned:active {
  transform: translateY(1px);
}

.channel-pinned:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.channel-pinned__icon,
.channel-pinned-icon {
  flex: 0 0 auto;
  font-size: 13px;
  line-height: 1;
}

.channel-pinned__label,
.channel-pinned-label {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.channel-pinned__text,
.channel-pinned-text {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------- پست سنجاق‌شده و نشان «ویرایش‌شده» */
/* پست سنجاق‌شده با حاشیهٔ مشخص از بقیه جدا می‌شود (کلاس پویای channel.js) */
.channel-post--pinned {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, var(--accent-soft), transparent 72%),
    var(--surface);
}

.channel-post-edited,
.channel-post__edited {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  margin-inline-start: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.8;
  white-space: nowrap;
}

/* ------------------------------------ پیوست پست: تصویر، فایل و صدا */
.channel-post-media {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 6px;
  border-radius: var(--radius);
}

/* تصویر پست: کارت گرد و کلیک‌پذیر برای بزرگ‌نمایی */
.channel-post-media--image {
  border: 1px solid var(--line);
  background: var(--surface-2);
  overflow: hidden;
  cursor: zoom-in;
}

.channel-post-media--image:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.channel-post-media__img,
.channel-post-media--image > img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 340px;
  border-radius: inherit;
  object-fit: cover;
}

/* میزبان پخش‌کنندهٔ صوتی؛ قاب اضافه لازم ندارد */
.channel-post-media--audio {
  border: 0;
  background: transparent;
}

/* فایل/آرشیو پیوست: ردیف قابل دانلود با آیکون، نام و حجم */
.channel-post-media.channel-post-file,
.channel-post-file {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  transition: background .14s ease, border-color .14s ease;
}

.channel-post-file:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
}

.channel-post-file:active {
  transform: translateY(1px);
}

.channel-post-file:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.channel-post-file__icon,
.channel-post-file-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
}

.channel-post-file__info,
.channel-post-file-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.channel-post-file__name,
.channel-post-file-name {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-post-file__size,
.channel-post-file-size {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
}

/* ------------------------------------------------ پخش‌کنندهٔ صوتی */
/* پخش‌کنندهٔ کوچک RTL: دکمهٔ گرد پخش/توقف + نوار پیشرفت + زمان سپری‌شده.
   بدون هیچ کتابخانه‌ای و فقط با کلاس‌های قرارداد ساخته می‌شود. */
.voice-player {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  margin: 2px 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  direction: rtl;
}

.voice-player.is-disabled {
  opacity: .62;
}

/* دکمهٔ گرد پخش/توقف */
.voice-play {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent-grad);
  color: var(--accent-contrast);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: filter .14s ease, transform .14s ease;
}

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

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

.voice-play:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.voice-play:disabled {
  cursor: not-allowed;
  filter: none;
  opacity: .55;
}

/* نوار پیشرفت؛ پرشدن آن با .voice-bar__fill انجام می‌شود */
.voice-bar {
  position: relative;
  flex: 1 1 auto;
  min-width: 48px;
  height: 7px;
  border-radius: 999px;
  background: var(--line-strong);
  overflow: hidden;
  cursor: pointer;
}

.voice-bar:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.voice-bar__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-grad);
  transition: width .12s linear;
}

.voice-time {
  flex: 0 0 auto;
  min-width: 62px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------- تم تاریک */
[data-theme="dark"] .channel-profile {
  border-color: var(--line);
  background:
    radial-gradient(700px 320px at 50% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
}

[data-theme="dark"] .channel-photo {
  border-color: var(--line-strong);
}

[data-theme="dark"] .channel-profile__photo,
[data-theme="dark"] .channel-profile-photo {
  border-color: var(--surface);
  box-shadow: 0 0 0 1px var(--line-strong), var(--shadow);
}

[data-theme="dark"] .channel-pinned {
  background: var(--accent-soft);
}

[data-theme="dark"] .channel-post-file:hover {
  background: var(--surface-3);
}

[data-theme="dark"] .voice-play {
  color: var(--accent-contrast);
}

/* ------------------------------------------------------ موبایل */
@media (max-width: 640px) {
  .channel-photo,
  .channel-photo--letter {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  /* در موبایل پروفایل تمام‌صفحه می‌شود، مثل صفحهٔ کامل تلگرام */
  .channel-profile {
    align-items: stretch;
    padding: 0;
    border-inline: 0;
  }

  .channel-profile__sheet,
  .channel-profile-sheet {
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    max-height: none;
    padding: 52px 18px 30px;
    border: 0;
    border-radius: 0;
    justify-content: center;
  }

  .channel-profile__photo,
  .channel-profile-photo {
    width: 96px;
    height: 96px;
    font-size: 34px;
  }

  .channel-profile__name,
  .channel-profile-name {
    font-size: 17.5px;
  }

  .channel-profile__desc,
  .channel-profile-desc {
    font-size: 13px;
    line-height: 1.9;
  }

  .channel-profile__close,
  .channel-profile-close {
    inset-block-start: 10px;
    inset-inline-end: 10px;
    width: 36px;
    height: 36px;
  }

  .channel-pinned {
    gap: 6px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .channel-pinned__label,
  .channel-pinned-label {
    font-size: 11.5px;
  }

  .channel-pinned__text,
  .channel-pinned-text {
    font-size: 11.5px;
  }

  .channel-post-media__img,
  .channel-post-media--image > img {
    max-height: 260px;
  }

  .channel-post-file {
    padding: 9px 10px;
  }

  .voice-player {
    gap: 8px;
    padding: 6px 8px;
  }

  .voice-play {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .voice-time {
    min-width: 58px;
    font-size: 10.5px;
  }
}

@media (max-width: 420px) {
  .channel-profile__sheet,
  .channel-profile-sheet {
    padding: 48px 14px 26px;
  }

  /* برچسب سنجاق و ایموجی 📌 هرگز پنهان نمی‌شوند؛ فقط جمع‌وجورتر می‌شوند */
  .channel-pinned__label,
  .channel-pinned-label {
    font-size: 10.5px;
    line-height: 1.8;
  }

  .voice-time {
    min-width: 0;
  }
}

/* احترام به تنظیم «کاهش انیمیشن» کاربر */
@media (prefers-reduced-motion: reduce) {
  .channel-profile,
  .channel-profile__sheet,
  .channel-profile-sheet,
  .channel-photo,
  .channel-pinned,
  .channel-post-file,
  .voice-play,
  .voice-bar__fill {
    animation: none;
    transition: none;
  }
}

/* ==========================================================================
   ریسپانسیو آیکون‌ها و زوم (task-54)
   --------------------------------------------------------------------------
   فقط افزودنی؛ هیچ قاعدهٔ پیشینی پنهان نمی‌شود. هدف:
   ۱) دکمه‌های آیکونی نوارهای همین فایل (channels-head، channels-foot،
      channel-meta، channel-pinned، channel-post__head) فشرده یا بریده
      نشوند و والدشان آن‌ها را نبرد؛
   ۲) ایموجی‌ها (📢 🔒 🔗 👁 📌 ✕) کامل دیده شوند و دکمه‌های فقط‌آیکون
      دست‌کم ۳۰px جای انگشت داشته باشند؛
   ۳) در بریک‌پوینت‌های ۱۲۰۰/۱۰۲۴/۸۶۰/۶۴۰ فقط فاصله و فونت کم شود و
      هیچ آیکونی با display:none پنهان نشود؛
   ۴) چیپ‌ها و متادیتاها با max-width:100% و min-width:0 و ellipsis بیرون
      نزنند.
   ========================================================================== */

/* ---------- سرصفحهٔ صفحات کانال: دکمه‌های آیکونی و نشان‌ها ---------- */
.channels-head {
  flex-wrap: wrap;
  min-width: 0;
  overflow: visible;
}
.channels-head-main { min-width: 0; max-width: 100%; }
.channels-head-actions {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
}
.channels-head-actions .icon-btn {
  flex: 0 0 auto;
  min-width: 32px;
  min-height: 32px;
  line-height: 1.2;
  font-variant-emoji: emoji;
}
.channels-head-actions .btn {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.channels-title { min-width: 0; max-width: 100%; }
.channels-title > * { min-width: 0; }
.channels-title > span:last-child { max-width: 100%; }
.broadcast-badge {
  flex: 0 0 auto;
  max-width: 100%;
  line-height: 1.9;
  font-variant-emoji: emoji;
}
.channel-photo {
  flex: 0 0 auto;
  min-width: 34px;
  min-height: 34px;
  line-height: 1.2;
  font-variant-emoji: emoji;
}

/* ---------- پانویس: دکمهٔ به‌روزرسانی و وضعیت زنده ---------- */
.channels-foot {
  flex-wrap: wrap;
  min-width: 0;
  overflow: visible;
  row-gap: 6px;
}
.channels-foot__note {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.channels-foot .btn {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 30px;
  white-space: nowrap;
}

/* ---------- کارت/ردیف فهرست کانال‌ها ---------- */
.channel-card {
  min-width: 0;
  max-width: 100%;
}
.channel-card__main { min-width: 0; }
.channel-card__title {
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
}
.channel-card__name { min-width: 0; max-width: 100%; }
.channel-card__time { flex: 0 0 auto; }
.channel-card__side { max-width: 100%; }
.channel-card__arrow {
  flex: 0 0 auto;
  line-height: 1.3;
  font-variant-emoji: emoji;
}
.channel-unread { flex: 0 0 auto; }
.channel-card__meta { min-width: 0; max-width: 100%; }

/* ---------- سر و پای پست‌ها ---------- */
.channel-post {
  min-width: 0;
  max-width: 100%;
}
.channel-post__head {
  min-width: 0;
  overflow: visible;
  row-gap: 4px;
}
.channel-post__author {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-post__time { flex: 0 0 auto; }
.channel-post__pin {
  flex: 0 0 auto;
  line-height: 1.4;
  font-variant-emoji: emoji;
}
.channel-post__foot {
  flex-wrap: wrap;
  row-gap: 4px;
  min-width: 0;
}
.channel-post__views {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  line-height: 1.6;
  font-variant-emoji: emoji;
}
.channel-post__eye {
  flex: 0 0 auto;
  line-height: 1.4;
  font-variant-emoji: emoji;
}

/* ---------- نوار پست سنجاق‌شده: 📌 و برچسب و متن ---------- */
.channel-pinned {
  flex-wrap: wrap;
  row-gap: 2px;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  line-height: 1.8;
}
.channel-pinned__icon {
  flex: 0 0 auto;
  max-width: 100%;
  line-height: 1.4;
  font-variant-emoji: emoji;
}
.channel-pinned__label {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.9;
  font-variant-emoji: emoji;
}
.channel-pinned__text { max-width: 100%; }

/* ---------- وضعیت عضویت، نشان «خصوصی» و راهنمای عضویت ---------- */
.channel-meta {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}
.channel-meta__members {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-emoji: emoji;
}
.channel-private {
  flex: 0 0 auto;
  max-width: 100%;
  line-height: 1.9;
  font-variant-emoji: emoji;
}
.channel-private::before {
  flex: 0 0 auto;
  line-height: 1.4;
  font-variant-emoji: emoji;
}
.channel-actions { max-width: 100%; }
.channel-actions .btn {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 30px;
  max-width: 100%;
}
.channel-join-hint {
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.channel-join-hint::before {
  flex: 0 0 auto;
  line-height: 1.4;
  font-variant-emoji: emoji;
}

/* ---------- پروفایل کانال ---------- */
.channel-profile,
.channel-profile__sheet,
.channel-profile-sheet {
  min-width: 0;
  max-width: 100%;
}
.channel-profile-head { min-width: 0; max-width: 100%; }
.channel-profile__name,
.channel-profile-name { max-width: 100%; }
.channel-profile__members,
.channel-profile-members {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.9;
  font-variant-emoji: emoji;
}
.channel-profile__badge,
.channel-profile-badge {
  max-width: 100%;
  line-height: 1.9;
  font-variant-emoji: emoji;
}
.channel-profile__close,
.channel-profile-close {
  flex: 0 0 auto;
  min-width: 32px;
  min-height: 32px;
  line-height: 1.2;
  font-variant-emoji: emoji;
}
.channel-profile-actions {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}
.channel-profile-actions .btn {
  flex: 1 1 auto;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  font-variant-emoji: emoji;
}

/* ---------- آواتار، حرف جایگزین و اعضای مودال ---------- */
.channel-photo__letter,
.channel-profile__letter,
.channel-profile-photo__letter {
  line-height: 1.2;
  font-variant-emoji: emoji;
}
.channel-member__avatar,
.channel-avatar,
.channel-avatar--photo {
  flex: 0 0 auto;
  line-height: 1.2;
}
.channel-member { min-width: 0; max-width: 100%; }
.channel-member__main { min-width: 0; }
.channel-member__name { max-width: 100%; }
.channel-empty__icon {
  flex: 0 0 auto;
  line-height: 1.2;
  font-variant-emoji: emoji;
}

/* ---------- پخش‌کنندهٔ صوتی: دکمهٔ ▶/⏸ دست‌کم ۳۰px ---------- */
.voice-play {
  min-width: 30px;
  min-height: 30px;
  font-variant-emoji: emoji;
}

/* ---------- بریک‌پوینت‌های میانی: فقط فاصله و فونت کم می‌شود ---------- */
@media (min-width: 1025px) and (max-width: 1200px) {
  .channels-head { gap: 10px; }
  .channel-card { gap: 10px; }
  .channel-post__head { gap: 8px; }
}

@media (min-width: 861px) and (max-width: 1024px) {
  .channels-head { gap: 8px; padding: 11px 16px; }
  .channels-body { padding: 16px 14px 10px; }
  .channel-card { gap: 10px; padding: 13px 14px; }
  .channel-card__title { font-size: 14.5px; }
  .channel-post { padding: 12px 14px; }
  .channels-foot {
    gap: 8px;
    padding: 9px 14px calc(9px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 641px) and (max-width: 860px) {
  .channels-head { gap: 7px; padding: 10px 14px; }
  .channels-body { padding: 14px 12px 10px; }
  .channel-card { gap: 9px; padding: 12px 13px; }
  .channel-card__title { font-size: 14px; }
  .channel-post { padding: 11px 12px; }
  .channel-actions .btn { padding: 4px 10px; font-size: 11.5px; }
  .channels-foot { gap: 7px; }
}

@media (max-width: 640px) {
  .channels-head-actions .icon-btn { min-width: 34px; min-height: 34px; }
  .channel-profile__close,
  .channel-profile-close { min-width: 34px; min-height: 34px; }
  .channel-pinned { gap: 5px; }
  .channel-post__foot { gap: 8px; }
  .channel-profile-actions .btn { font-size: 12px; }
}