.post-banner-plugin-stack {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.post-banner-plugin__carousel-module {
  border: 1px solid hsl(var(--border) / 0.85);
  border-radius: 0;
  background: hsl(var(--card));
  overflow: hidden;
}

.post-banner-plugin__carousel-shell {
  padding: 0;
}

.post-banner-plugin__carousel {
  width: 100%;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background: transparent;
}

.post-banner-plugin__carousel-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 5;
  max-height: 220px;
  min-height: 120px;
  overflow: hidden;
  background: hsl(var(--card));
}

.post-banner-plugin__carousel-slide {
  height: 100%;
}

.post-banner-plugin__carousel-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 640px) {
  .post-banner-plugin-stack--flush {
    margin-top: 0 !important;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    width: calc(100% + 0.5rem);
  }

  .post-banner-plugin-stack--flush .post-banner-plugin__carousel-module {
    border-left: none;
    border-right: none;
    border-top: none;
    border-radius: 0;
  }

  .post-banner-plugin-stack--flush .post-banner-plugin {
    border-radius: 0;
  }

  .post-banner-plugin__carousel-viewport {
    aspect-ratio: 2.2 / 1;
    max-height: 200px;
    min-height: 110px;
  }

  .post-banner-plugin__carousel-nav,
  .post-banner-plugin__carousel-dots {
    display: none !important;
  }
}

.post-banner-plugin {
  margin-bottom: 1.25rem;
  border: 1px solid hsl(var(--border) / 0.85);
  border-radius: 0.75rem;
  background: hsl(var(--card));
  overflow: hidden;
  --post-banner-icon-size: 65px;
  --post-banner-icon-size-mobile: 52px;
  --post-banner-item-title-size: 11px;
  --post-banner-grid-btn-size: 12px;
  --post-banner-section-label-size: 13px;
}

.post-banner-plugin__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.375rem;
  padding: 0.5rem;
  border-bottom: 1px solid hsl(var(--border) / 0.75);
}

.post-banner-plugin__grid:last-child {
  border-bottom: none;
}

.post-banner-plugin__grid-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32.5px;
  min-height: 32.5px;
  padding: 0 0.5rem;
  border-radius: 0.375rem;
  font-size: var(--post-banner-grid-btn-size);
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
  word-break: break-word;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.post-banner-plugin__grid-btn:hover {
  opacity: 0.9;
}

.post-banner-plugin__section {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid hsl(var(--border) / 0.75);
}

.post-banner-plugin__section:last-child {
  border-bottom: none;
}

.post-banner-plugin__section-aside {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  padding: 0.625rem 0.375rem;
  border-right: 1px solid hsl(var(--border) / 0.75);
  background: hsl(var(--muted) / 0.35);
}

.post-banner-plugin__section-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: var(--post-banner-section-label-size);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.12em;
  color: hsl(var(--foreground));
  white-space: nowrap;
}

.post-banner-plugin__item-grid {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.625rem 0.375rem;
  padding: 0.625rem 0.5rem;
}

.post-banner-plugin__grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.125rem;
  text-decoration: none;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease;
}

.post-banner-plugin__grid-item:hover {
  background: hsl(var(--muted) / 0.35);
}

.post-banner-plugin__grid-item-icon {
  width: var(--post-banner-icon-size);
  height: var(--post-banner-icon-size);
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
  background: hsl(var(--muted));
}

.post-banner-plugin__grid-item-icon--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--post-banner-icon-size) * 0.28);
  color: hsl(var(--muted-foreground));
}

.post-banner-plugin__grid-item-title {
  width: 100%;
  font-size: var(--post-banner-item-title-size);
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  word-break: break-word;
}

.post-banner-plugin .post-banner-plugin__stats {
  display: none;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.875rem;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-top: 1px solid hsl(var(--border) / 0.85);
  background: linear-gradient(90deg, hsl(210 60% 98%) 0%, hsl(250 35% 97%) 55%, hsl(220 30% 96%) 100%);
  font-size: 0.8125rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dark .post-banner-plugin .post-banner-plugin__stats {
  background: linear-gradient(90deg, hsl(var(--card)) 0%, hsl(var(--muted) / 0.25) 100%);
}

.post-banner-plugin__stats--desktop {
  display: none !important;
}

.post-banner-plugin__stats--mobile {
  display: none !important;
}

@media (min-width: 641px) {
  .post-banner-plugin__stats.post-banner-plugin__stats--desktop {
    display: flex !important;
  }
}

@media (max-width: 640px) {
  .post-banner-plugin__stats.post-banner-plugin__stats--mobile {
    display: flex !important;
  }
}

.post-banner-plugin__stats-metric {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.post-banner-plugin__stats-icon {
  display: inline-flex;
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.post-banner-plugin__stats-icon svg {
  width: 100%;
  height: 100%;
}

.post-banner-plugin__stats-metric--topic,
.post-banner-plugin__stats-metric--topic .post-banner-plugin__stats-label,
.post-banner-plugin__stats-metric--topic .post-banner-plugin__stats-value {
  color: #8f3d67;
}

.post-banner-plugin__stats-metric--reply,
.post-banner-plugin__stats-metric--reply .post-banner-plugin__stats-label,
.post-banner-plugin__stats-metric--reply .post-banner-plugin__stats-value {
  color: #5f4b93;
}

.post-banner-plugin__stats-metric--user,
.post-banner-plugin__stats-metric--user .post-banner-plugin__stats-label,
.post-banner-plugin__stats-metric--user .post-banner-plugin__stats-value {
  color: #3f4f92;
}

.post-banner-plugin__stats-label {
  color: inherit;
}

.post-banner-plugin__stats-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: inherit;
}

.post-banner-plugin__stats-info {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
}

.post-banner-plugin__stats-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
}

.post-banner-plugin__stats-info-btn::-webkit-details-marker {
  display: none;
}

.post-banner-plugin__stats-icon--info {
  width: 1rem;
  height: 1rem;
}

.post-banner-plugin__stats-info[open] .post-banner-plugin__stats-info-btn {
  color: hsl(var(--foreground));
}

.post-banner-plugin__stats-info-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 20;
  width: min(18rem, 70vw);
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  padding: 0.75rem 0.875rem;
  box-shadow: 0 8px 24px hsl(0 0% 0% / 0.12);
}

.post-banner-plugin__stats-info-popover-title {
  margin: 0 0 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.post-banner-plugin__stats-info-popover-text {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
}

.post-banner-plugin__welcome {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.875rem;
  padding: 0.5rem 0.875rem 0.625rem;
  border-top: 1px solid hsl(var(--border) / 0.45);
  background: linear-gradient(90deg, #f4f9ff 0%, #f6f4fb 55%, #f3f5f8 100%);
  font-size: 0.75rem;
  overflow-x: auto;
}

.post-banner-plugin__welcome-left {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
}

.post-banner-plugin__welcome-left .post-banner-plugin__stats-icon {
  color: #8f3d67 !important;
}

.post-banner-plugin__welcome-label {
  color: #8f3d67 !important;
}

.post-banner-plugin__welcome-member {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.post-banner-plugin__welcome-member-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.post-banner-plugin__welcome-member-link:hover {
  text-decoration: underline;
}

.post-banner-plugin__welcome-avatar-wrap {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.post-banner-plugin__welcome-name {
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-banner-plugin__welcome-avatar {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.post-banner-plugin__welcome-avatar--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--muted));
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1;
  color: hsl(var(--muted-foreground));
}

.post-banner-plugin__custom-html {
  padding: 0.5rem 0.625rem 0.625rem;
  border-top: 1px solid hsl(var(--border) / 0.45);
  background: hsl(var(--card));
}

.post-banner-plugin__custom-html .gradient-text {
  background: linear-gradient(90deg, #900c3f 0, #004ec5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 14px;
  font-weight: bold;
}

.post-banner-plugin__custom-html .fox-alert-light,
.post-banner-plugin__custom-html .alert.alert-light {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.5rem;
  padding: 0.625rem 0.75rem 0.625rem 2rem;
  border: 1px solid hsl(var(--border) / 0.75);
  border-radius: 0.5rem;
  background: hsl(var(--muted) / 0.35);
  overflow: hidden;
}

.post-banner-plugin__custom-html .fox-alert-light:last-child,
.post-banner-plugin__custom-html .alert.alert-light:last-child {
  margin-bottom: 0;
}

.post-banner-plugin__custom-html .close {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  float: none !important;
  margin: 0 !important;
  margin-top: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}

.post-banner-plugin__custom-html .close:hover {
  color: hsl(var(--foreground));
}

.post-banner-plugin__custom-html .download-left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  flex: 1 1 auto;
}

.post-banner-plugin__custom-html .download-logo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.375rem;
  object-fit: cover;
  flex-shrink: 0;
}

.post-banner-plugin__custom-html .download-text {
  min-width: 0;
}

.post-banner-plugin__custom-html .download-text .line-1 {
  margin: 0;
}

.post-banner-plugin__custom-html .download-right {
  flex: 0 0 auto;
}

.post-banner-plugin__custom-html .download-btn a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #900c3f 0, #004ec5);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.post-banner-plugin__custom-html .download-btn a:hover {
  opacity: 0.92;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .post-banner-plugin__item-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.375rem 0.25rem;
    padding: 0.5rem 0.375rem;
  }

  .post-banner-plugin__grid-item-icon {
    width: var(--post-banner-icon-size-mobile);
    height: var(--post-banner-icon-size-mobile);
  }

  .post-banner-plugin__grid-item-icon--placeholder {
    font-size: calc(var(--post-banner-icon-size-mobile) * 0.28);
  }

  .post-banner-plugin__grid-item-title {
    font-size: max(8px, calc(var(--post-banner-item-title-size) - 1px));
  }

  .post-banner-plugin .post-banner-plugin__stats {
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    font-size: 0.75rem;
  }

  .post-banner-plugin__stats-icon {
    width: 0.875rem;
    height: 0.875rem;
  }

  .post-banner-plugin__welcome {
    gap: 0.625rem;
    padding: 0.4375rem 0.625rem 0.5rem;
    font-size: 0.6875rem;
  }
}
