:root {
  --sidebar-width: 270px;
  --topbar-height: 56px;
  --pubble-orange: #d93900;
  --pubble-brand: #007fff;
  --pubble-brand-hover: #0066cc;
  --pubble-action: #005fcc;
  --pubble-action-hover: #004aa8;
  --pubble-action-active: #003f8f;
  --pubble-blue: #7193ff;
  --pubble-dark: #1a1a1b;
  --pubble-gray-dark: #272729;
  --pubble-gray-light: #f6f8f9;
  --pubble-gray-weak: #576f76;
  --pubble-text: #1a1a1b;
  --pubble-muted: #7c7c7c;
  --pubble-border: #ccc;
  --pubble-button-border: #7b7c7d;
  --pubble-orange-hover: #AE2C00;
  --pubble-grey-hover: #dbe4e9;
  --pubble-header-color: #333d42;
  --pubble-input-background: #e5ebee;
  --color-neutral-background-selected: #e5ebee;
  --pubble-button-grey: #eaedef;
  --pubble-font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  --font-mono: Noto Mono, Menlo, Monaco, Consolas, monospace;
  --bs-border-radius-rounded-pill: 50rem;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background-color: white;
  color: var(--pubble-text);
  font-family: var(--pubble-font-sans);
}

.page-wrapper {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.modal-open {
  padding-right: 0px !important;
}

/* ===== top menu ===== */
.top-navbar {
  height: var(--topbar-height);
  background: white !important;
  z-index: 1040;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.top-navbar .form-control {
  background-color: var(--pubble-gray-light);
  border: 1px solid #444;
  color: var(--pubble-text);
}

.top-navbar .form-control::placeholder {
  color: #888;
}

.top-navbar .form-control:focus {
  border-color: var(--pubble-orange);
  box-shadow: none;
}

/* ===== Side menu ===== */

.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: white;
  overflow-y: auto;
  z-index: 1030;
  transition: transform 0.3s ease;
  border-right: 1px solid rgba(0, 0, 0, 0.2);
}

.sidebar .nav-link {
  align-items: center;
  border-radius: 0.5rem;
  border-left: 3px solid transparent;
  color: var(--pubble-text);
  display: flex;
  font-size: 14px;
  height: 40px;
  padding: 0.25rem 1.5rem;
  transition: all 0.2s;
  text-align: left;
}

.sidebar .nav-link:hover {
  color: var(--pubble-text);
  background: #f6f8f9;
}

.sidebar .nav-link.active {
  color: var(--pubble-text);
  background: #e5ebee;
}

.sidebar .nav-link i {
  width: 1.5rem;
  margin-right: 0.5rem;
}

.sidebar-heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #576f76;
  padding: 1rem 1rem 0.5rem;
  font-weight: 600;
}

.sidebar-accordion {
  --bs-accordion-active-color: #576f76;
  --bs-accordion-color: #576f76;
  --bs-accordion-icon-color: var(--pubble-gray-weak);
  --bs-accordion-btn-color: var(--pubble-gray-weak);
  border: 1px solid #dee2e6;
}

/* ===== Main content ===== */

.main-grid {
  display: grid;
  margin-top: calc(var(--topbar-height)) ;
  grid-template-columns: var(--sidebar-width) 1fr;
  column-gap: 1rem;
}

/* Фикс горизонтального скролла на мобильных: не даём контенту
   (баннеры, длинные ссылки) распирать сетку и колонки шире экрана */
.main-grid > .container-xl,
.community-container {
  min-width: 0;
}

.community-container .row > *,
.feed-wrapper > * {
  min-width: 0;
}


  .main-content {
    #float: left;
    #margin: calc(var(--topbar-height)) 0px 0px var(--sidebar-width);
    #width: 100%;
    #margin: calc(var(--topbar-height)) auto 0px auto;
    /* min-height: calc(100vh - var(--topbar-height)); */
    display: grid;
    grid-template-columns: var(--sidebar-width) 752px 1fr;
    column-gap: 1rem;
  }

  .community-container {
    #padding: calc(var(--topbar-height)) 7px 45px calc(var(--sidebar-width) - 10px);
    max-width: 1120px;
  }

  .pubble-fs-12 {
    font-size: 0.75rem !important;
  }

  .pubble-fs-14 {
    font-size: 0.875rem !important;
  }

  .btn-pubble {
    background-color: transparent;
    border-color: #0f1a1c;
    white-space: nowrap;
    color: rgb(42, 6, 30);
    border: 0px;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: all 0.15s ease;
    padding: 16px 12px;
  }

  .btn-pubble:hover {
    background-color: oklch(from #f6f8f9 calc(l - 0.15) c h);
    border-color: #0f1a1c;
  }

  .btn-pubble-reply {
    background-color: transparent;
    border-color: #0f1a1c;
    white-space: nowrap;
    color: rgb(42, 6, 30);
    border: 0px;
    font-size: 0.75rem !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.15s ease;
  }

  .btn-pubble-reply:hover {
    background-color: #dbe4e9;
    border-color: #0f1a1c;
  }

  .btn-pubble-reply:active {
    background-color: #bac1c6;
    border-color: #0f1a1c;
  }

  .btn-pubble-red {
    background-color: #eb001f;
    border-color: #0f1a1c;
    white-space: nowrap;
    color: white;
    border: 1px solid transparent;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: all 0.15s ease;
  }

  .btn-pubble-red:hover {
    background-color: oklch(from #eb001f calc(l - 0.15) c h);
    color: white;
  }

  .btn-pubble-red:active {
    background-color: #0a2f6c !important;
    color: white !important;
    transform: scale(0.98);
  }

  .btn-pubble-red:focus-visible {
    outline: 2px solid #0079d3;
    outline-offset: 2px;
  }

  .btn-pubble-join {
    background-color: #e5ebee;
    color: black;
    border-color: #0f1a1c;
    white-space: nowrap;
    border: none;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    transition: all 0.15s ease;
    z-index: 2;
  }

  .btn-pubble-join:hover {
    background-color: oklch(from #e5ebee calc(l - 0.15) c h);
    border-color: #0f1a1c;
  }

  .btn-pubble-vk {
    background-color: #0077ff;
    border-color: #0f1a1c;
    border-radius: 8px;
    white-space: nowrap;
    color: white;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.15s ease;
    width: 100%;
    height: 44px;
    padding: 8px;
  }

  .btn-pubble-vk:hover {
    background-color: oklch(from #0077ff calc(l - 0.15) c h);
    color: white;
  }

  .btn-pubble-vk:active {
    background-color: #0077ff !important;
    color: white !important;
    transform: scale(0.98);
  }

  .btn-pubble-vk:focus-visible {
    outline: 2px solid #0079d3;
    outline-offset: 2px;
  }

  .feed-wrapper {
    max-width: 732px;
  }

  /* ===== Post ===== */
  .post-card {
    background: #fff;
    border: none;
    border-radius: 1rem;
    transition:
            border-color 0.2s,
            box-shadow 0.2s;
  }

  .post-card:hover {
    background: #f6f8f9;
    border-color: #999;
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0.06);
  }

  /* Клик по фону карточки открывает пост (см. feed.js) */
  .post-card[data-post-url] {
    cursor: pointer;
  }

  /* Медиа-превью открывает lightbox, а не пост */
  .post-card[data-post-url] .slider-container {
    cursor: zoom-in;
  }

  .post-card[data-post-url] .slider-container video {
    cursor: default;
  }

  .post-card-comment {
    border: none;
  }

  .post-title-comment {
    font-size: 24px;
    font-weight: 600;
    color: var(--pubble-text);
    line-height: 1.3;
  }

  .vote-col {
    min-width: 40px;
  }

  .vote-btn {
    cursor: pointer;
    transition: color 0.2s;
  }

  .vote-actions.upvoted>.downvoted {
    color: white;
  }

  .vote-actions.upvoted>.downvoted:hover, .vote-actions.upvoted>.upvoted:hover {
    color: white;
    background: var(--pubble-orange-hover) !important;
  }

  .vote-actions.downvoted>.upvoted {
    color: white;
  }

  .vote-actions.downvoted>.upvoted:hover, .vote-actions.downvoted>.downvoted:hover {
    color: white;
    background: #523DFF !important;
  }

  .vote-actions {
    background: #e5ebee;
    border: none;
    color: black;
    font-size: 0.75rem;
    border-radius: 20px;
    font-weight: 600;
  }

  .vote-actions.upvoted {
    background: var(--pubble-orange);
    color: white;
  }

  .vote-actions.downvoted {
    background: #6A5CFF;
    color: white;
  }

  .vote-btn:hover {
    color: var(--pubble-orange);
  }

  .vote-btn.upvoted:hover {
    color: var(--pubble-orange);
  }

  .vote-btn.upvoted.active {
    background: var(--pubble-orange);
    color: white;
  }

  .vote-btn.downvoted:hover {
    color: #6A5CFF;
  }

  .vote-btn.downvoted.active {
    background: #6A5CFF;
    color: white;
  }

  .vote-btn:disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
  }

  .comment .vote-col .vote-btn {
    background: transparent;
    border: none;
  }

  .comment .vote-col .vote-btn.upvoted.active {
    background: transparent;
    color: var(--pubble-orange);
  }

  .comment .vote-col .vote-btn.downvoted.active {
    background: transparent;
    color: #6A5CFF;
  }

  .vote-count {
    font-size: 0.75rem;
    margin: 2px 0;
  }

  .comment-count {
    font-size: 0.75rem;
    font-weight: 600;
  }

  .post-meta {
    font-size: 0.8rem;
  }
  .post-meta a {
    color: var(--pubble-text);
    text-decoration: none;
  }
  .post-meta a:hover {
    text-decoration: underline;
  }

  .post-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.25rem 0 0.5rem;
    color: var(--pubble-text);
    line-height: 1.3;
  }

  .post-body {
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 0.75rem;
  }

  .post-text-preview {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .post-text-preview-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /*
  .post-actions .btn {
    background: #f0f2f5;
    border: none;
    color: var(--pubble-muted);
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
    border-radius: 20px;
    font-weight: 500;
  }

  .post-actions .btn:hover {
    background: #e4e6eb;
    color: var(--pubble-text);
  }
  */

  .feed-col {
    flex: 0 0 auto;
    width: 66.66666667%;
  }

  .feed-col .post-actions {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  /* ===== Ряд действий под постом: равная высота кнопок =====
     Пилюля комментариев подгоняется под высоту круглых кнопок (32px),
     кнопка «Пожаловаться» остаётся круглой 32x32. */
  .post-actions .vote-actions {
    min-height: 32px;
  }

  .post-actions .btn-pubble-secondary {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  /* ===== Меню поста (редактирование / удаление) ===== */
  .post-menu-dropdown .dropdown-item.post-menu-item {
    font-size: 14px;
    color: rgb(20, 4, 75);
  }

  .post-menu-dropdown .dropdown-item.post-menu-item:hover,
  .post-menu-dropdown .dropdown-item.post-menu-item:focus {
    font-size: 14px;
    color: rgb(20, 4, 75);
    background-color: var(--bs-tertiary-bg);
  }

  /* ===== Adaptive ===== */
  @media (max-width: 992px) {
    .sidebar {
      transform: translateX(-100%);
    }

    .sidebar.show {
      transform: translateX(0);
    }

    .main-content {
      margin-left: 0;
      padding-left: 0.5rem;
      padding-right: 0.5rem;
      width: 100%;
    }

    .feed-wrapper {
      max-width: 100%;
    }

    .main-grid {
      display: grid;
      margin-top: calc(var(--topbar-height)) ;
      grid-template-columns: 1fr;
      column-gap: 0rem;
    }
  }

  @media (max-width: 768px) {
    .feed-col {
      width: 100%;
    }
  }

  @media (max-width: 576px) {
    .post-actions .btn {
      font-size: 0.7rem;
      padding: 0.25rem 0.4rem;
    }
    .post-actions .btn i {
      font-size: 0.8rem;
    }
    .post-title {
      font-size: 1rem;
    }
  }

  /* Pubble-стиль для кнопки входа */
  .btn-pubble-login {
    background-color: var(--pubble-brand);
    color: white;
    border: 1px solid transparent;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-pubble-login:hover {
    background-color: var(--pubble-brand-hover);
    color: white;
  }

  .btn-pubble-login:active {
    transform: scale(0.98);
  }

  .btn-pubble-login:focus-visible {
    outline: 2px solid #0079d3;
    outline-offset: 2px;
  }

  /* Pubble-стиль для кнопки создать в меню */
  .btn-pubble-create-post {
    background-color: transparent;
    color: #181c1f;
    transform: scale(0.98);
  }

  /* Pubble-стиль для кнопки создать в меню */
  .btn-pubble-create-post:hover {
    background-color: #dbe4e9;
  }

  .btn-pubble-create-post:active {
    background-color: oklch(from #e5ebee calc(l - 0.15) c h) !important;
    transform: scale(0.98);
  }

  /* Создание сообщества */
  .modal-create-community-step:not(.active) {
    display: none;
  }

  .pubble-modal-community-button {
    background-color: rgba(var(--bs-white-rgb), var(--bs-bg-opacity));
    border: 1px solid #00000033;
    border-radius: 0.5rem;
  }

  .pubble-modal-community-button:hover {
    background-color: #dbe4e9;
    border-color: #00000033;
  }

  .pubble-modal-community-button.active {
    background-color: #c9d7de;
    border-color: #00000033;
  }

  .choose-community-type * {
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .choose-community-type:hover {
    background-color: #f6f8f9 !important;
  }

  .choose-community-type.active {
    background-color: var(--color-neutral-background-selected) !important;
    border-color: #00000033 !important;
  }

  .pubble-modal-community-input {
    background-color: #e5ebee;
    border: 1px solid #00000033;
    border-radius: 1.25rem;
    color: black;
  }

  .pubble-modal-community-input:hover {
    background-color: #dbe4e9;
  }

  .pubble-modal-community-input:focus {
    background-color: #dbe4e9;
    border: 1px solid rgba(0, 125, 215, 0.8);
    box-shadow: 0 0 0 0rem;
  }

  .invalid-feedback.pubble-invalid-placeholder-align {
    padding-left: 0.75rem;
  }

  .pubble-modal-community-preview {
    border-radius: 1.25rem;
  }

  .pubble-modal-community-preview-top {
    background-color: #eef1f3;
    border-top-left-radius: 1.25rem;
    border-top-right-radius: 1.25rem;
    height: 92px;
  }

  .pubble-modal-community-preview-text {
    font-size: 0.75rem;
    line-height: 1rem;
  }

  /* Страница сообщества */

  .community-banner {
    --bs-alert-bg: #eaedef;
    --bs-alert-padding-x: 0rem;
    --bs-alert-padding-y: 0rem;
    --bs-alert-margin-bottom: 0.5rem;
    --bs-alert-color: var(--bs-dark-text-emphasis);
    --bs-alert-border-color: var(--bs-dark-border-subtle);
    --bs-alert-border: var(--bs-border-width) solid var(--bs-alert-border-color);
    --bs-alert-border-radius: var(--bs-border-radius);
    --bs-alert-link-color: var(--bs-dark-text-emphasis);
    padding: var(--bs-alert-padding-y) var(--bs-alert-padding-x);
    margin-bottom: var(--bs-alert-margin-bottom);
    color: var(--bs-alert-color);
    background-color: var(--bs-alert-bg);
    border: none;
    border-radius: var(--bs-alert-border-radius);
    min-height: 64px;
    max-height: 128px;
    height: auto;
    overflow: hidden;
    position: relative;
  }

  .community-banner-preview {
    --bs-alert-bg: #eaedef;
    --bs-alert-padding-x: 0rem;
    --bs-alert-padding-y: 0rem;
    --bs-alert-margin-bottom: 0.5rem;
    --bs-alert-color: var(--bs-dark-text-emphasis);
    --bs-alert-border-color: var(--bs-dark-border-subtle);
    --bs-alert-border: var(--bs-border-width) solid var(--bs-alert-border-color);
    --bs-alert-border-radius: var(--bs-border-radius);
    --bs-alert-link-color: var(--bs-dark-text-emphasis);
    padding: var(--bs-alert-padding-y) var(--bs-alert-padding-x);
    margin-bottom: 0;
    color: var(--bs-alert-color);
    background-color: var(--bs-alert-bg);
    border: var(--bs-alert-border);
    border-radius: var(--bs-alert-border-radius);
    max-height: 40px;
    max-width: 400px;
    height: auto;
    overflow: hidden;
    position: relative;
  }

  .community-banner img {
    object-fit: cover;
    width: 100%;
    min-height: 64px;
    max-height: 128px;
    display: block;
  }

  .community-banner-preview img {
    object-fit: cover;
    max-width: 400px;
    max-height: 40px;
    display: block;
  }

  .community-banner-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #e0e0e0 0%, #c0c0c0 100%);
  }

  .banner-edit-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 2;

    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.8);
    color: black;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .community-banner:hover .banner-edit-btn {
    opacity: 1;
    transform: scale(1);
  }

  .banner-edit-btn:hover {
    background: #dbe4e9;
  }

  .banner-edit-btn:active {
    background: #bac1c6;
  }

  .banned-alert {
    background: transparent;
    color: #5c6c74;
    font-size: 14px;
    line-height: 20px;
    padding: 1rem;
    margin-top: -1.25rem;
    margin-bottom: 2rem;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
  }

  .banned-tooltip-wrapper {
    cursor: not-allowed;
  }

  .banned-create-post-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
  }

  .banned-vote-wrapper {
    cursor: not-allowed;
  }

  .banned-tooltip .tooltip-inner {
    font-size: 12px;
    line-height: 1.4;
  }

  .community-details {
    background-color: #f6f8f9;
    border-radius: 0.5rem;
  }

  .community-details small {
    font-size: 0.75rem;
  }

  .accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0, 0, 0, 0.125);
  }

  .pubble-list-group {
    --bs-body-color: #212529;
    --bs-list-group-color: var(--bs-body-color);
    --bs-list-group-item-padding-x: 1rem;
    --bs-list-group-item-padding-y: 0.5rem;
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    border-radius: var(--bs-border-radius);
    border: none;
    outline: none;
  }

  .pubble-list-group-item {
    position: relative;
    display: block;
    padding: var(--bs-list-group-item-padding-y)
    var(--bs-list-group-item-padding-x);
    color: var(--bs-list-group-color);
    text-decoration: none;
    border-radius: var(--bs-border-radius);
    border: none;
    outline: none;
  }

  .pubble-list-group-item:hover {
    background: #f6f8f9;
    border-radius: var(--bs-border-radius-lg);
  }

  .rotate-90 {
    --tw-rotate: 90deg;
    --tw-translate-x: 0;
    --tw-translate-y: 0;
    --tw-skew-x: 0;
    --tw-skew-y: 0;
    --tw-scale-x: 1;
    --tw-scale-y: 1;
    transform: rotate(90deg);
  }

  .a-back-link {
    color: #5c6c74;
    font-size: 0.875rem;
    text-decoration: none;
  }

  .a-back-link:hover {
    text-decoration: underline;
  }

  .community-card-info {
    min-width: 0;
  }

  .community-card-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #181c1f;
    line-height: 1rem;
  }

  .community-card-text {
    font-size: 0.75rem !important;
    color: #5c6c74;
    line-height: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .community-card-description {
    min-height: 2rem;
  }

  .community-card {
    background-color: white;
  }

  .community-card:hover {
    background-color: #f6f8f9;
  }

  .community-avatar {
    display: inline;
    vertical-align: middle;
    width: 40px;
    height: 40px;
    margin-right: 8px;
    margin-bottom: 0px;
  }

  .community-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
  }

  .community-avatar-big {
    display: inline;
    vertical-align: middle;
    width: 80px;
    height: 80px;
    margin-right: 8px;
    margin-bottom: 0px;
    margin-top: -2.5rem !important;
    position: relative;
    display: inline-block;
    overflow: hidden;
    border-radius: 50%;
    background-color: #fff;
  }

  .community-avatar-big img {
    width: 80px;
    height: 100%;
    border: 4px solid white;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px rgba(124, 166, 247, 0.4);
    display: block;
    object-fit: cover;
    background-color: #fff;
  }

  .avatar-edit-btn {
    position: absolute;
    inset: 0;
    margin: auto;

    width: 90%;
    height: 90%;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    opacity: 0;
  }

  .community-avatar-big:hover .avatar-edit-btn {
    opacity: 0.7;
    transform: scale(1);
  }

  .avatar-edit-btn:hover {
    background: rgba(0, 0, 0, 0.7);
  }

  .community-avatar-md {
    display: inline;
    vertical-align: middle;
    width: 32px;
    height: 32px;
    margin-right: 8px;
    margin-bottom: 0px;
  }

  .community-avatar-md img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
  }

  .community-avatar-sm {
    display: inline;
    vertical-align: middle;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    margin-bottom: 0px;
  }

  .community-avatar-sm img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
  }

  .comment-input {
    background: transparent;
    border: none !important;
    color: #0f1a1c;
  }

  /* Свёрнутый редактор комментария не должен показывать скроллбар */
  .comment-input .ql-editor {
    overflow-y: hidden;
  }

  /* Фикс прыжка высоты collapsed-редактора (#175): лочим коробку на финальные 38px.
     Снимается при раскрытии (is-active), на печать/реплаи не влияет. */
  #comment-wrapper:not(.is-active) #editor-container {
    min-height: 38px;
    max-height: 38px;
    overflow: hidden;
  }

  .comment-thread {
    width: 700px;
    max-width: 100%;
    margin: auto;
    padding: 0px;
    background-color: transparent;
    border: 1px solid transparent; /* Removes margin collapse */
  }

  .comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
  }

  .comment-author {
    color: #0f1a1c;
    font-weight: bold;
    font-size: 0.75rem;
    line-height: 1rem;
    text-decoration: none;
  }

  .comment-author:hover {
    text-decoration: underline;
  }

  .comment-time {
    color: #576f76;
    font-size: 12px;
  }

  .sr-only {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  /* Comment */

  .comment {
    position: relative;
    margin: 20px auto;
    min-width: 0;
  }

  .comment-heading {
    display: flex;
    align-items: center;
    height: 36px;
    font-size: 14px;
  }

  .comment-footer {
    display: flex;
    align-items: center;
    height: 32px;
    font-size: 14px;
    padding-left: 2rem;
  }

  /* ===== Футер комментария: высота кнопок как у поста (32px) ===== */
  .comment-footer .btn-pubble-reply {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .comment .vote-col .vote-btn {
    height: 32px;
  }

  .comment-footer .vote-col .vote-btn,
  .profile-comment-footer .vote-col .vote-btn,
  .comment-footer .vote-count,
  .profile-comment-footer .vote-count,
  .comment-footer .btn-pubble-reply,
  .profile-comment-footer .btn-pubble-reply {
    color: #5c6c74;
  }

  .comment-footer .btn-pubble-transparent-circle,
  .profile-comment-footer .btn-pubble-transparent-circle {
    --bs-btn-color: #5c6c74;
    color: #5c6c74;
  }

  .comment-footer .btn-pubble-reply:hover,
  .profile-comment-footer .btn-pubble-reply:hover,
  .comment-footer .btn-pubble-transparent-circle:hover,
  .profile-comment-footer .btn-pubble-transparent-circle:hover {
    --bs-btn-hover-color: black;
    color: black;
  }

  .comment-footer .vote-col .vote-btn:hover,
  .profile-comment-footer .vote-col .vote-btn:hover,
  .comment-footer .vote-col .vote-btn.upvoted:hover,
  .profile-comment-footer .vote-col .vote-btn.upvoted:hover {
    color: var(--pubble-orange);
  }

  .comment-footer .vote-col .vote-btn.downvoted:hover,
  .profile-comment-footer .vote-col .vote-btn.downvoted:hover {
    color: #6A5CFF;
  }

  .comment-info {
    color: rgba(0, 0, 0, 0.5);
    margin-left: 10px;
  }

  .replies {
    margin-left: 20px;
  }

  /* Adjustments for the comment border links */

  .comment-border-link {
    display: block;
    position: absolute;
    top: 50px;
    left: 0;
    width: 12px;
    height: calc(100% - 50px);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    background-color: rgba(0, 0, 0, 0.1);
    background-clip: padding-box;
  }

  .comment-border-link:hover {
    background-color: rgba(0, 0, 0, 0.3);
  }

  .comment-body {
    padding: 0px;
    margin-left: 2.5rem;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }
  .comment-body img,
  .comment-body pre,
  .comment-body blockquote,
  .comment-body iframe,
  .comment-body video {
    max-width: 100%;
  }
  .comment-body pre {
    white-space: pre-wrap;
  }
  .comment-deleted-text {
    color: var(--pubble-blue);
  }
  .comment .vote-btn:disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
  }
  .comment > .replies {
    position: relative;
    margin-left: 28px;
  }

  .comment > .replies > .comment::after {
    content: "";
    display: block;
    position: absolute;
    left: -12.5px;
    top: 6px;
    bottom: -10px;
    width: 1px;
    background: #ccc;
  }

.comment > .replies > .comment:first-of-type::after {
  top: var(--reach, -72px);
}

  .comment > .replies > .comment:last-of-type::after {
    display: none;
  }

.comment > .replies > .comment:first-of-type:last-of-type::after {
  display: block;
  top: var(--reach, -72px);
  bottom: auto;
  height: calc(6px - var(--reach, -72px));
}

  .comment > .replies > .comment::before {
    content: "";
    position: absolute;
    left: -12.5px;
    top: -10px;
    width: 22px;
    height: 28px;
    border-left: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    border-bottom-left-radius: 10px;
  }

  .comment:not(.has-replies) .thread-toggle {
    display: none;
  }

  .comment-thread > .comment > .thread-line {
    display: none;
  }

  .reply-editor-wrapper {
    margin-left: 32px;
  }

  .comment-edit-wrapper {
    margin-left: 32px;
  }

  .comment > .replies > .comment > .thread-line {
    position: absolute;
    left: -20px;
    top: -10px;
    bottom: -10px;
    width: 16px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 1;
  }

  .comment > .replies > .comment:first-of-type > .thread-line {
    top: var(--reach, -72px);
  }

  .comment > .replies > .comment:first-of-type:last-of-type > .thread-line {
    bottom: auto;
    height: calc(6px - var(--reach, -72px));
  }

  .comment > .replies > .comment:last-of-type:not(:first-of-type) > .thread-line {
    display: none;
  }

  .replies.thread-hover > .comment::after {
    background: #000;
  }

  .replies.thread-hover > .comment::before {
    border-color: #000;
  }

  .thread-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #000;
    cursor: pointer;
    flex-shrink: 0;
  }

.replies > .thread-toggle {
  position: absolute;
  left: -20px;
  top: -44px;
  background: #fff;
  z-index: 2;
}

  .thread-toggle .thread-toggle-add {
    display: none;
  }

  .comment.collapsed > .comment-body,
  .comment.collapsed > .comment-footer,
  .comment.collapsed > .replies,
  .comment.collapsed > .reply-editor-wrapper,
  .comment.collapsed > .comment-edit-wrapper {
    display: none;
  }

  .comment > .comment-heading .thread-expand {
    display: none;
  }

  .comment.collapsed > .comment-heading .thread-expand {
    display: inline-flex;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    margin-right: 8px;
  }

  .comment.collapsed > .comment-heading .comment-avatar {
    display: none;
  }

  .comment.collapsed .thread-toggle .thread-toggle-add {
    display: block;
  }

  .comment.collapsed .thread-toggle .thread-toggle-sub {
    display: none;
  }

  /* Adjustments for toggleable comments */

  details.comment summary {
    position: relative;
    list-style: none;
    cursor: pointer;
  }
  details.comment summary::-webkit-details-marker {
    display: none;
  }
  details.comment:not([open]) .comment-heading {
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  }
  .comment-heading::after {
    display: inline-block;
    position: absolute;
    right: 5px;
    align-self: center;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.55);
  }
  details.comment[open] .comment-heading::after {
    content: "Click to hide";
  }
  details.comment:not([open]) .comment-heading::after {
    content: "Click to show";
  }

  /* Adjustment for Internet Explorer */

  @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    /* Resets cursor, and removes prompt text on Internet Explorer */
    .comment-heading {
      cursor: default;
    }
    details.comment[open] .comment-heading::after,
    details.comment:not([open]) .comment-heading::after {
      content: " ";
    }
  }

  /* Styling the reply to comment form */

  .reply-form textarea {
    font-family:
            -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
            sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    font-size: 16px;
    width: 100%;
    max-width: 100%;
    margin-top: 15px;
    margin-bottom: 5px;
  }

  /* Quill comment */
  .ql-toolbar.ql-snow {
    display: none;
    border: none;
    background: transparent;
  }

  /* 2. Стилизуем контейнер редактора под обычный Bootstrap Input */
  .ql-container.ql-snow {
    color: #0f1a1c;
    border: none !important;
    min-height: 38px; /* Высота стандартного input в Bootstrap */
    height: 38px;
    transition:
            height 0.2s ease-in-out,
            border-color 0.15s ease-in-out,
            box-shadow 0.15s ease-in-out;
    font-size: 1rem;
    font-weight: 400;
  }

  /* Корректируем внутренние отступы, чтобы Quill в свернутом виде выглядел как input */
  .ql-editor {
    padding: 7px 12px !important;
    line-height: 2 !important;
  }

  .ql-editor.ql-blank::before {
    font-style: normal;
    font-family: inherit; /* or your preferred standard font like sans-serif */
  }

  .is-active .ql-toolbar.ql-snow {
    display: block;
  }

  /* 3. Состояние «АКТИВНО» (когда поле в фокусе или заполнено) */
  .comment-box-container.is-active .ql-toolbar.ql-snow {
    display: block; /* Показываем тулбар */
  }

  .is-active .ql-editor {
    min-height: 90px; /* Минимальная высота в фокусе (примерно 3 строки) */
    max-height: 450px; /* Максимальная высота (примерно 5 строк текста) */
    overflow-y: auto; /* Включаем скроллбар, если текст превысил 5 строк */
  }

  .comment-box-container.is-active .ql-editor {
    min-height: 90px; /* Минимальная высота в фокусе (примерно 3 строки) */
    max-height: 450px; /* Максимальная высота (примерно 5 строк текста) */
    overflow-y: auto; /* Включаем скроллбар, если текст превысил 5 строк */
  }

  .is-active .ql-container.ql-snow {
    height: auto;
    border: none !important;
  }

  .comment-box-container.is-active .ql-container.ql-snow {
    height: auto;
    border: none !important;
  }

  /* Скрываем кнопки управления, пока редактор свернут */
  #action-buttons {
    display: none;
  }

  .comment-box-container.is-active #action-buttons {
    display: flex !important;
  }

  /* Красивые отступы для текста внутри отображаемых комментариев */
  .comment-text p {
    margin-bottom: 0.5rem;
  }

  .comment-text p:last-child {
    margin-bottom: 0;
  }
  /* Убираем фон при наведении */
  .ql-container:focus-within {
    background-color: transparent !important;
  }

  .ql-toolbar:focus-within {
    background-color: transparent !important;
  }

  /* Для всего редактора */
  .quill-wrapper:hover {
    background-color: transparent !important;
  }

  .quill-wrapper-hover:hover {
    background: #f6f8f9;
    border-color: #808080 !important;
  }

  .quill-wrapper-hover:focus-within {
    background-color: #f6f8f9 !important;
    border-color: #808080 !important;
  }

  .quill-wrapper-hover.is-active:hover {
    background-color: transparent !important;
    border: 1px solid #00000033;
  }

  .comment-wrapper.is-active:hover {
    background-color: transparent !important;
  }

  .comment-input.is-active:hover {
    background-color: transparent !important;
  }

  /* Скрываем кнопки управления, пока редактор свернут */
  #action-buttons {
    display: none;
  }
  .comment-box-container.is-active #action-buttons {
    display: flex !important;
  }

  /* Красивые отступы для текста внутри отображаемых комментариев */
  .comment-text p {
    margin-bottom: 0.5rem;
  }
  .comment-text p:last-child {
    margin-bottom: 0;
  }

  .slider-container {
    position: relative;
    width: 100%;
    /*  max-width: 600px;*/
    margin: 0 auto;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--pubble-border);
  }

  .vk-video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 540px;
    margin: 0 auto;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--pubble-border);
    background-color: #000;
  }

  .vk-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
  }

  .slide-item {
    width: 100%;
    height: 100%;
    margin: auto;
    flex: 0 0 100%;
  }

  .slides {
    display: flex;
    height: auto;
    position: static;
  }

  .slide {
    width: 100%;
    height: auto;
    max-height: 540px;
    visibility: hidden;
    object-fit: contain;
    position: relative;
    transition: transform 0.4s ease-in-out;
  }

  /* Резервируем место под видео до загрузки метаданных,
     иначе высота бокса прыгает после loadedmetadata */
  video.slide {
    aspect-ratio: 16 / 9;
    background-color: #000;
    display: block;
  }

  .slide-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    visibility: hidden;
    position: absolute;
    inset: 0;
    opacity: 0.3;
    filter: blur(10px);
    transform: translateX(calc(var(--slide-index, 0) * 100%));
    transition: transform 0.4s ease-in-out;
  }

  .slide.active {
    visibility: visible;
    display: block;
    animation: fadeIn 0.4s ease-in-out;
  }

  .slide-bg.active {
    display: block;
    visibility: visible;
    animation: fadeIn 0.4s ease-in-out;
  }

  .slider-controls {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 10;
    border-radius: 5px;
  }

  .dots {
    display: flex;
    gap: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .dot {
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .dot.active {
    background-color: white;
    transform: scale(1.3);
  }

  .dot.hidden {
    display: none;
  }

  .dot.edge {
    transform: scale(0.7);
  }

  .slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    opacity: 1;
    pointer-events: none;
  }

  .post-body[data-initialized] .slider-arrow {
    /* opacity: 1; */
    pointer-events: auto;
  }

  .slider-arrow-prev {
    left: 16px;
  }

  .slider-arrow-next {
    right: 16px;
  }

  .slider-arrow:hover:not(.disabled) {
    background-color: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
  }

  .slider-arrow:active:not(.disabled) {
    transform: translateY(-50%) scale(0.95);
  }

  .slider-arrow.disabled {
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
  }

  .slider-arrow svg {
    width: 20px;
    height: 20px;
  }

  .link-preview-card {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    height: 100px;
    min-height: 100px;
    max-height: 100px;
  }

  .link-preview-card:hover {
    border-color: #b0b0b0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }

  .link-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    height: 100%;
    overflow: hidden;
  }

  .link-domain {
    font-size: 12px;
    color: #888;
    text-transform: lowercase;
    font-weight: 500;
    letter-spacing: 0.5px;
  }

  .link-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .link-description {
    font-size: 14px;
    color: #555;
    margin: 0;
    line-height: 1.4;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .link-image-wrapper {
    width: 128px;
    min-width: 128px;
    height: 96px;
    flex-shrink: 0;
    position: relative;
    background-color: #f0f0f0;
    overflow: hidden;
  }

  .link-preview-img {
    width: 128px;
    height: 96px;
    object-fit: contain;
    display: block;
  }

  @media (max-width: 480px) {
    .link-image-wrapper {
      width: 100px;
      min-width: 100px;
      height: 75px;
    }

    .link-preview-img {
      width: 100px;
      height: 75px;
    }

    .link-content {
      padding: 12px;
    }

    .link-title {
      font-size: 14px;
    }

    .link-description {
      font-size: 12px;
      -webkit-line-clamp: 2;
    }
  }

  .link-preview-large {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  .link-preview-large:hover {
    border-color: #b0b0b0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }

  .link-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 220px;
    max-height: max(300px, calc(100vh - 306px));
    background-color: #f0f0f0;
    overflow: hidden;
  }

  .link-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .external-link-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
  }

  .external-link-badge svg {
    width: 16px;
    height: 16px;
  }

  .link-content-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    gap: 16px;
  }

  .link-text-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .link-domain {
    font-size: 12px;
    color: #888;
    text-transform: lowercase;
    font-weight: 500;
  }

  .link-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .link-action-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: #f0f2f5;
    color: #1a1a1a;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
  }

  @media (max-width: 480px) {
    .link-content-container {
      flex-direction: column;
      align-items: flex-start;
      gap: 12px;
    }

    .link-action-button {
      width: 100%;
      justify-content: center;
    }
  }

  .post-card .flex-grow-1,
  .post-card .post-body {
    min-width: 0;
    overflow: hidden;
    border: none;
  }

  /* Перенос длинных слов и URL, чтобы посты не выходили за экран */
  .post-title,
  .post-title-comment,
  .post-body,
  .comment-body,
  .link-domain,
  .link-description {
    overflow-wrap: anywhere;
  }


  /* ===== Лайтбокс ===== */
  .lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  .lightbox.is-open {
    display: flex;
    opacity: 1;
  }

  .lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(4px);
  }

  .lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 92vw;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .lightbox-content img,
  .lightbox-content video {
    max-width: 92vw;
    max-height: 88vh;
    display: block;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  }

  .lightbox-caption {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    z-index: 2;
    text-align: center;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    max-width: 80%;
  }

  .lightbox-close,
  .lightbox-nav {
    position: absolute;
    z-index: 3;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
  }

  .lightbox-close:hover,
  .lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
  }

  .lightbox-close {
    top: 20px;
    right: 20px;
  }

  .lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
  }

  .lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
  }

  .lightbox-prev.disabled,
  .lightbox-next.disabled {
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
  }

  .lightbox[data-count="1"] .lightbox-nav {
    display: none;
  }

  .slide-item img {
    cursor: zoom-in;
  }

  .lightbox-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
  }

  .lightbox-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition:
            background 0.2s,
            transform 0.2s;
    border: none;
    padding: 0;
  }

  .lightbox-dot:hover {
    background: rgba(255, 255, 255, 0.7);
  }

  .lightbox-dot.active {
    background: #fff;
    transform: scale(1.3);
  }

  .lightbox[data-count="1"] .lightbox-dots {
    display: none;
  }

  .invalid-feedback.has-error {
    display: block;
  }

  #errorContainer {
    position: fixed;
    top: calc(var(--topbar-height) + 5px);
    left: calc(var(--sidebar-width) + 5px);
    right: 5px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 20px;
  }

  @media (max-width: 991.98px) {
    #errorContainer {
      left: 5px;
      right: 5px;
      padding: 0 10px;
    }
  }

  .error-notification {
    background-color: #c81e1e;
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease-in-out;
    border-radius: 16px;
  }

  @keyframes slideDown {
    from {
      transform: translateY(-20px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .error-notification.show {
    transform: translateY(0);
  }

  .error-content {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .error-icon {
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .error-icon::before {
    content: "!";
    color: #c81e1e;
    font-weight: bold;
    font-size: 16px;
  }

  .error-message {
    font-size: 14px;
    line-height: 1.4;
  }

  .close-button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
  }

  .close-button:hover {
    opacity: 1;
  }

  .trigger-button {
    margin-top: 50px;
    padding: 12px 24px;
    background-color: #c81e1e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
  }

  .trigger-button:hover {
    background-color: #a01818;
  }

  .profile-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    overflow: hidden;
    flex: 0 0 auto;
    border-radius: 50%;
    transition:
            box-shadow 0.2s ease,
            transform 0.2s ease;
  }

  .profile-icon-link:hover,
  .profile-icon-link:focus-visible {
    box-shadow: 0 0 0 3px rgba(124, 166, 247, 0.4);
    transform: translateY(-1px);
  }

  .profile-icon-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
  }

  .profile-icon-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #adb5bd;
    display: block;
  }

  .profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    overflow: hidden;
    flex: 0 0 auto;
    border-radius: 50%;
    transition:
            box-shadow 0.2s ease,
            transform 0.2s ease;
  }

  .profile-avatar:hover,
  .profile-avatar:focus-visible {
    box-shadow: 0 0 0 3px rgba(124, 166, 247, 0.4);
    transform: translateY(-1px);
  }

  .profile-avatar-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
  }

  .profile-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: #adb5bd;
    display: block;
  }

  .profile-details {
    background-color: rgb(246, 248, 249);
    border-radius: 1rem;
  }

  .profile-details small {
    font-size: 0.75rem;
  }

  .profile-details-number {
    font-weight: 600;
    font-size: 0.875rem;
    color: #181c1f;
    line-height: 1.25rem;
  }

  .profile-details-text {
    font-size: 0.75rem;
    color: #5c6c74;
    line-height: 1rem;
  }

  .community-details .profile-details-text > span {
    line-height: 1;
    transform: translateY(1px);
  }

  .profile-details-config-header {
    font-size: 0.875rem;
    font-weight: 400;
    color: #21272a;
    line-height: 1.25rem;
  }

  .text-neutral-content-weak {
    color: #5c6c74;
  }

  .post-submit-footer a:hover {
    color: #000000;
    text-decoration: underline;
  }

  .create-post-nav .nav-link {
    color: var(--pubble-text);
    border-radius: 0rem;
    font-size: 14px;
    font-weight: 600;
    padding: 0.85rem 1.1rem;
  }

  .create-post-nav .nav-link.active {
    background: #ffffff;
  }

  .create-post-nav .nav-link span {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
  }

  .create-post-nav .nav-link.active span {
    border: none !important;
    background-clip: padding-box;
    position: relative;
    background: transparent;
  }

  .create-post-nav .nav-link.active span::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--pubble-action, #005fcc);
    border-radius: 10px;
    /* 🔵 скругленные концы */
  }

  .create-post-nav .nav-link:hover {
    background: var(--pubble-grey-hover);
  }

  .pubble-input {
    background: transparent;
    color: #0f1a1c;
    border: 1px solid #00000033;
    font-size: 1rem;
    padding: 16px;
  }

  .pubble-input:hover {
    background: #f6f8f9;
    border-color: #0000007f;
  }

  .auto-expand {
    resize: none; /* убираем ручной ресайз */
    overflow-y: hidden; /* скрываем скролл */
    min-height: 48px !important; /* минимальная высота как у input */
    max-height: 300px; /* максимальная высота */
    line-height: 1.5;
    padding: 16px;
  }

  .btn-select-community {
    border-color: var(--pubble-button-border);
    padding: 8px 16px;
    font-size: 14px;
  }

  .btn-select-community:hover {
    border-color: #181c1f;
    background: transparent;
  }

  .btn-select-community.selected {
    border-color: #181c1f !important;
    padding: 8px 16px;
    font-size: 14px;
    background-color: #c9d7de !important;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: var(--pubble-header-color) !important;
    font-weight: 600;
  }

  .modal-noborder {
    border: none;
  }

  .modal-body .community-list {
    height: 55vh;
  }

  .modal-content {
    border-radius: 1rem;
  }

  input {
    border-radius: 1.25rem !important;
  }

  .pubble-textarea {
    border-radius: 1.25rem !important;
  }

  .input-with-bg {
    background: var(--pubble-input-background);
  }

  .community-title {
    font-size: 14px;
    color: #21272a;
    font-weight: 350;
  }

  .community-users {
    font-size: 12px;
    color: #576f76;
    font-weight: 350;
  }

  .community-description {
    font-size: 12px;
    color: var(--pubble-header-color);
    font-weight: 350;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
  }

  .community-info {
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .list-group-communities {
    height: 55vh;
    overflow-y: auto;
  }

  .community-avatar-small {
    display: inline;
    vertical-align: middle;
    width: 32px;
    height: 32px;
    margin: 0;
  }

  .community-avatar-small img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
  }

  .list-group-item-community {
    padding-left: 0;
    cursor: pointer;
  }

  .select-community-icon {
    margin-right: -4px;
  }

  .community-avatar-selected {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
  }

  /* Когда контейнер пустой — он невидим и не занимает место */
  .community-avatar-selected:empty {
    display: none;
  }

  /* Когда есть картинка — показываем */
  .community-avatar-selected:not(:empty) {
    display: inline-flex;
    width: 22px;
    height: 22px;
    margin-right: 8px;
    opacity: 1;
  }

  .community-avatar-selected img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
  }

  .community-rules {
    color: #5d6c75 !important;
    font-size: small;
  }

  .accordion {
    border: none;
    --bs-accordion-btn-icon: url("data:image/svg+xml,<svg fill='%23576F76' height='20' icon-name='caret-down' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M10 13.7a.897.897 0 01-.636-.264l-4.6-4.6a.9.9 0 111.272-1.273L10 11.526l3.964-3.963a.9.9 0 011.272 1.273l-4.6 4.6A.897.897 0 0110 13.7z'></path></svg>");
    --bs-accordion-btn-active-icon: url("data:image/svg+xml,<svg fill='%23576F76' height='20' icon-name='caret-down' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M10 13.7a.897.897 0 01-.636-.264l-4.6-4.6a.9.9 0 111.272-1.273L10 11.526l3.964-3.963a.9.9 0 011.272 1.273l-4.6 4.6A.897.897 0 0110 13.7z'></path></svg>");
  }

  .accordion-item {
    border: none !important;
    background-color: transparent !important;
  }

  .accordion-header {
    border: none !important;
  }

  .accordion-button {
    border: none !important;
    box-shadow: none !important; /* Убирает тень при фокусе */
  }

  .accordion-body {
    border: none !important;
  }

  /* Убираем нижнюю границу у последнего элемента */
  .accordion-item:last-of-type {
    border-bottom: none !important;
  }

  .community-rules-accordion-body {
    padding: 8px 0px 8px 32px;
  }

  .accordion-button .community-rules {
    min-width: 28px;
    text-align: center;
    flex-shrink: 0; /* Не сжимается */
  }

  .quill-wrapper {
    border: 1px solid #00000033 !important;
    border-radius: 1.25rem;
    overflow: hidden;
    transition: border-color 0.2s ease;
    background-color: transparent;
  }

  .quill-wrapper-hover {
    border: 1px solid #00000033 !important;
    border-radius: 1.25rem;
    overflow: hidden;
    transition: border-color 0.2s ease;
    background-color: transparent;
  }

  .quill-wrapper.is-active {
    background-color: transparent !important;
  }

  .quill-wrapper:focus-within {
    background-color: transparent !important;
    border-color: #808080 !important; /* или любой другой цвет */
  }

  /* Ваш файл стилей, подключенный после bootstrap.min.css */
  .btn-secondary {
    --bs-btn-color: #000;
    --bs-btn-bg: #eaedef;
    --bs-btn-border-color: #eaedef;
    --bs-btn-hover-color: #000;
    --bs-btn-hover-bg: #e2e7e9;
    --bs-btn-hover-border-color: #e2e7e9;
  }

  /* ===== Убираем синий бордер у всех полей ===== */
  .pubble-input:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: #808080 !important;
  }

  .btn-pubble-primary,
  .btn-pubble-secondary,
  .btn-pubble-danger,
  .btn-pubble-light,
  .btn-pubble-transparent,
  .btn-pubble-transparent-grey {
    --bs-btn-color: #fff;
    --bs-btn-bg: #0a449b;
    --bs-btn-border-color: #0d6efd;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #0a2f6c;
    --bs-btn-hover-border-color: #0a58ca;
    --bs-btn-focus-shadow-rgb: 49, 132, 253;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #0a2f6c;
    --bs-btn-active-border-color: #0a53be;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #b7b7b7;
    --bs-btn-disabled-bg: #f3f3f3;
    --bs-btn-disabled-border-color: #f3f3f3;
    border-radius: var(--bs-border-radius-rounded-pill);
    white-space: nowrap;
    border: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.15s ease;
    padding: 8px 12px !important;
  }

  .btn-pubble-primary {
    border: 1px solid transparent;
    --bs-btn-bg: var(--pubble-action, #005fcc);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-bg: var(--pubble-action-hover, #004aa8);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-focus-shadow-rgb: 0, 95, 204;
    --bs-btn-focus-box-shadow: 0 0 0 0.25rem rgba(var(--bs-btn-focus-shadow-rgb), 0.5);
    --bs-btn-active-bg: var(--pubble-action-active, #003f8f);
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-border-color: transparent;
  }

  .btn-pubble-danger {
    --bs-btn-bg: #eb001f;
    --bs-btn-border-color: #eb001f;
    --bs-btn-hover-bg: #a00014;
    --bs-btn-hover-border-color: #a00014;
    --bs-btn-active-bg: #a00014;
    --bs-btn-active-border-color: #a00014;
  }

  .btn-pubble-secondary {
    --bs-btn-color: black;
    --bs-btn-bg: #eaedef;
    --bs-btn-border-color: #0f1a1c;
    --bs-btn-hover-color: black;
    --bs-btn-hover-bg: #dbe4e9;
    --bs-btn-hover-border-color: #0f1a1c;
    --bs-btn-focus-shadow-rgb: 49, 132, 253;
    --bs-btn-active-color: black;
    --bs-btn-active-bg: #bac1c6;
    --bs-btn-active-border-color: #0f1a1c;
  }

  .btn-pubble-secondary-circle {
    --bs-btn-color: black;
    --bs-btn-bg: #e5ebee;
    --bs-btn-border-color: #0f1a1c;
    --bs-btn-hover-color: black;
    --bs-btn-hover-bg: #dbe4e9;
    --bs-btn-hover-border-color: #0f1a1c;
    --bs-btn-focus-shadow-rgb: 49, 132, 253;
    --bs-btn-active-color: black;
    --bs-btn-active-bg: #bac1c6;
    --bs-btn-active-border-color: #0f1a1c;
    align-items: center;
    border: none;
    border-radius: 50%;
    color: black;
    cursor: pointer;
    display: flex;
    justify-content: center;
    height: 32px;
    padding: 0.25rem;
    transition: all 0.15s ease;
    width: 32px;
    white-space: nowrap;
  }

  .btn-pubble-transparent-circle {
    --bs-btn-bg: transparent;
  }

  .btn-pubble-danger-circle {
    --bs-btn-color: black;
    --bs-btn-bg: #eb001f;
    --bs-btn-border-color: #0f1a1c;
    --bs-btn-hover-color: white;
    --bs-btn-hover-bg: #a00014;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-focus-shadow-rgb: 49, 132, 253;
    --bs-btn-active-color: white;
    --bs-btn-active-bg: #a00014;
    --bs-btn-active-border-color: #0f1a1c;
    align-items: center;
    border: 0px solid transparent;
    border-radius: 50%;
    color: black;
    cursor: pointer;
    display: flex;
    justify-content: center;
    height: 32px;
    padding: 0.25rem;
    transition: all 0.15s ease;
    width: 32px;
    white-space: nowrap;
  }

  .btn-pubble-light {
    --bs-btn-color: #181c1f;
    --bs-btn-bg: transparent;
    --bs-btn-border-color: #0f1a1c;
    --bs-btn-hover-color: #181c1f;
    --bs-btn-hover-bg: #dbe4e9;
    --bs-btn-hover-border-color: #0f1a1c;
    --bs-btn-focus-shadow-rgb: 49, 132, 253;
    --bs-btn-active-color: #181c1f;
    --bs-btn-active-bg: #c9d7de;
    --bs-btn-active-border-color: #0f1a1c;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #b7b7b7;
    --bs-btn-disabled-bg: #f3f3f3;
    --bs-btn-disabled-border-color: #f3f3f3;
  }

  .btn-pubble-transparent {
    --bs-btn-color: rgb(20, 4, 75);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--pubble-button-border);
    --bs-btn-hover-color: #181c1f;
    --bs-btn-hover-bg: transparent;
    --bs-btn-hover-border-color: #181c1f;
    --bs-btn-focus-shadow-rgb: 49, 132, 253;
    --bs-btn-active-color: #181c1f;
    --bs-btn-active-bg: #c9d7de;
    --bs-btn-active-border-color: #0f1a1c;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #b7b7b7;
    --bs-btn-disabled-bg: #f3f3f3;
    --bs-btn-disabled-border-color: #f3f3f3;
    border: 1px solid var(--bs-btn-border-color);
  }

  .btn-pubble-transparent-grey {
    --bs-btn-color: rgb(20, 4, 75);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--pubble-button-border);
    --bs-btn-hover-color: #181c1f;
    --bs-btn-hover-bg: #dbe4e9;
    --bs-btn-hover-border-color: #181c1f;
    --bs-btn-focus-shadow-rgb: 49, 132, 253;
    --bs-btn-active-color: #181c1f;
    --bs-btn-active-bg: oklch(from #e5ebee calc(l - 0.15) c h) !important;
    --bs-btn-active-border-color: #0f1a1c;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #b7b7b7;
    --bs-btn-disabled-bg: #f3f3f3;
    --bs-btn-disabled-border-color: #f3f3f3;
    border: 1px solid var(--bs-btn-border-color);
  }

  #sidebarToggle {
    color: #212529 !important;
  }

  #sidebarToggle:hover {
    background-color: #dbe4e9;
  }

  #sidebarToggle:active {
    background-color: oklch(from #e5ebee calc(l - 0.15) c h) !important;
  }

  .modal-pubble-title {
    color: rgb(51, 61, 66);
  }

  .post-body > .ql-editor {
    min-height: 120px;
  }

  /* Редактор текста поста: раскрывается по высоте текста без скролла */
  .post-edit-wrapper .ql-editor {
    min-height: 90px;
    max-height: none;
    overflow-y: hidden;
  }

  .pubble-input-group > .is-valid {
    border-color: #00000033;
  }

  .btn-edit-carousel:hover {
    background: rgba(0, 0, 0, 0.8) !important;
    transform: scale(1.1);
  }

  /* ===== DROP ZONE ===== */
  .drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 1.25rem;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
  }

  .drop-zone:hover {
    border-color: #0d6efd;
    background: #f0f8ff;
  }

  .drop-zone.dragover {
    border-color: #0d6efd;
    background: #e7f1ff;
  }

  .drop-zone-icon {
    font-size: 2.5rem;
    color: #6c757d;
    margin-bottom: 10px;
  }

  .drop-zone-text {
    margin: 10px 0 5px;
  }

  .drop-zone-hint {
    font-size: 0.875rem;
    color: #6c757d;
  }

  /* ===== КАРУСЕЛЬ ===== */
  .media-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 1.25rem;
    background: #f8f9fa;
    aspect-ratio: 16 / 9;
  }

  .media-carousel-slides {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease;
  }

  .media-carousel-slide {
    flex: 0 0 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .media-carousel-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(20px);
    opacity: 0.8;
    scale: 1.1;
    background: #f0f0f0;
  }

  .media-carousel-slide.video-slide .media-carousel-bg {
    background: #000;
    filter: none;
    opacity: 1;
    scale: 1;
  }

  .media-carousel-media {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    position: relative;
    z-index: 2;
  }

  /* ===== СТРЕЛКИ КАРУСЕЛИ ===== */
  .carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .carousel-arrow:hover {
    background-color: rgba(0, 0, 0, 0.8);
  }

  .carousel-arrow:disabled {
    opacity: 0.3;
    pointer-events: none;
  }

  .carousel-arrow-prev {
    left: 10px;
  }

  .carousel-arrow-next {
    right: 10px;
  }

  .carousel-arrow svg {
    width: 16px;
    height: 16px;
  }

  /* ===== ТОЧКИ КАРУСЕЛИ ===== */
  .carousel-controls {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
  }

  .carousel-dots {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 20px;
  }

  .carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
  }

  .carousel-dot.active {
    background: white;
    transform: scale(1.2);
  }

  .carousel-dot:hover {
    transform: scale(1.3);
  }

  /* ===== ПАНЕЛЬ ИНСТРУМЕНТОВ КАРУСЕЛИ ===== */
  .carousel-toolbar {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 50;
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .carousel-toolbar-btn {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 999px;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    padding: 0 10px;
  }

  .carousel-toolbar-btn:hover {
    background: rgba(0, 0, 0, 0.8);
  }

  .carousel-toolbar-btn i {
    font-size: 14px;
  }

  .carousel-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 50;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .carousel-edit-btn:hover,
  .carousel-delete-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    opacity: 1;
  }

  .carousel-edit-btn i {
    font-size: 14px;
  }

  .carousel-edit-btn {
    left: 10px;
  }

  .carousel-delete-btn {
    right: 10px;
  }

  /* ===== ГАЛЕРЕЯ В МОДАЛКЕ (Sortable) ===== */
  .edit-modal-item {
    cursor: grab;
    transition: none;
  }

  .edit-modal-item .card {
    overflow: hidden;
    border-radius: 1.25rem;
    border: 1px solid #dee2e6;
    aspect-ratio: 4 / 3;
  }

  .edit-modal-item .media-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .edit-modal-item .delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
  }

  .edit-modal-item:hover .delete-btn {
    opacity: 1;
  }

  .edit-modal-item .delete-btn:hover {
    background: rgba(0, 0, 0, 0.8);
  }

  .edit-modal-item .delete-btn i {
    font-size: 14px;
  }

  .edit-modal-item .index-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    background: rgba(13, 110, 253, 0.9);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
  }

  .edit-modal-item .media-info {
    padding: 8px;
  }

  .edit-modal-item .media-name {
    font-size: 0.8rem;
    color: #6c757d;
    display: block;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
  }

  .edit-modal-item .media-size {
    font-size: 0.7rem;
    color: #6c757d;
  }

  .edit-modal-item .media-type {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e9ecef;
  }

  .edit-modal-item .video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 5;
    opacity: 0.85;
  }

  .edit-modal-item:hover .video-play-icon {
    opacity: 1;
  }

  /* Sortable.js ghost */
  .sortable-ghost {
    opacity: 0.4;
    transform: scale(0.95);
  }

  .sortable-chosen {
    cursor: grabbing;
  }

  .gallery-card {
    position: relative;
    z-index: 2;
  }

  .gallery-card.video-thumb:not([src]) {
    background: #1a1a1a;
  }

  .gallery-card-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(20px);
    opacity: 0.8;
    scale: 1.1;
  }

  .video-thumb + .video-play-icon + .gallery-card-bg {
    background: #000;
    filter: none;
    opacity: 1;
    scale: 1;
  }

  .border-neutral-border-weak {
    border-color: rgba(0, 0, 0, 0.4);
  }

  .pubble-gray-weak {
    color: var(--pubble-gray-weak);
  }

  .comment-body p {
    margin-bottom: 0 !important;
  }

  .pubble-toast {
    background-color: #181c1f;
    color: #f6f8f9;
  }

  .navbar-brand {
    margin-left: 8px;
  }

  /* Report / Complaint Styles */
  .report-reason-option {
    cursor: pointer;
    transition: all 0.15s ease;
    border-color: #dee2e6;
  }

  .report-reason-option:hover {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.04);
  }

  .report-reason-option input[type="radio"] {
    accent-color: #0d6efd;
  }

  .report-reason-option.border-primary {
    background-color: rgba(13, 110, 253, 0.08);
  }

  .report-card {
    border: 1px solid #dee2e6;
    transition: border-color 0.15s ease;
  }

  .report-card:hover {
    border-color: #adb5bd;
  }

  .report-filter-btn {
    border: 1px solid #dee2e6;
    color: #495057;
    background: white;
    font-size: 0.85rem;
  }

  .report-filter-btn.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
  }

  .report-filter-btn:hover:not(.active) {
    background-color: #f8f9fa;
  }

  /* Profile comments tab */
  .profile-comment-card {
    background: #fff;
    border: none;
    border-radius: 1rem;
    position: relative;
    cursor: pointer;
    transition:
            border-color 0.2s,
            box-shadow 0.2s;
  }

  .profile-comment-heading a,
  .profile-comment-footer .vote-btn {
    position: relative;
    z-index: 2;
  }

  .profile-comment-card:hover {
    background: #f6f8f9;
    border-color: #999;
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0.06);
  }

  .profile-comment-heading a,
  .profile-comment-heading a figure {
    margin-bottom: 0;
  }

  .profile-comment-heading > a[href*='/p/'] {
    text-decoration: none;
    color: inherit;
  }

  .profile-comment-heading > a[href*='/p/']:hover {
    text-decoration: underline;
  }

  .profile-comment-heading .fw-bold {
    font-size: 0.8rem;
  }

  .profile-comment-heading a.profile-details-text {
    color: #5c6c74;
    text-decoration: none;
  }

  .profile-comment-heading a.profile-details-text:hover {
    color: #0f1a1c;
    text-decoration: underline;
  }

  .profile-comment-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profile-comment-text {
    color: #0f1a1c;
  }

  .profile-comment-card > a {
    margin-left: 2rem;
  }

  .profile-comment-footer {
    height: auto;
    padding-left: 24px;
  }

  .profile-comment-footer .vote-btn {
    background: transparent;
    border: none;
  }

  .profile-comment-footer .vote-btn.upvoted.active {
    background: transparent;
    color: var(--pubble-orange);
  }

  .profile-comment-footer .vote-btn.downvoted.active {
    background: transparent;
    color: #6A5CFF;
  }

  .profile-empty-img {
    max-width: 100px;
  }

  .profile-empty-title {
    margin-bottom: 0;
  }

  .comment-highlight {
    background-color: rgba(113, 147, 255, 0.15);
    border-radius: 0.5rem;
    transition: background-color 0.5s ease;
  }

  .cookie-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1080;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background-color: #ffffff;
    border-top: 1px solid #e3e3e6;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  }

  .cookie-consent-text {
    font-size: 0.9rem;
    color: #2c2c34;
    margin: 0;
  }

  .cookie-consent-text a {
    color: #007fff;
    text-decoration: underline;
  }

  .cookie-consent-actions {
    flex-shrink: 0;
  }

  @media (max-width: 768px) {
    .cookie-consent-banner {
      flex-direction: column;
      align-items: flex-start;
    }
  }

