.page-community {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg-primary, #0b0d11);
  color: var(--color-text-primary, #f5f5f5);
  font-family: var(--app-font-family, 'SF Pro Display', 'PingFang SC', system-ui, sans-serif);
  --community-accent-orange: #ff6b35;
  --community-accent-amber: #f59e0b;
  --community-accent-green: #4cc68a;
  --community-preview-overlay: rgba(0, 0, 0, 0.65);
  --community-preview-bg: rgba(20, 20, 20, 0.98);
  --community-preview-text: #ffffff;
  --community-preview-muted: rgba(255,255,255,0.75);
  --community-preview-soft: rgba(255,255,255,0.6);
  --community-preview-border: rgba(255,255,255,0.1);
  --community-preview-border-strong: rgba(255,255,255,0.25);
  --community-preview-card-bg: rgba(255,255,255,0.03);
  --community-preview-thumb-bg: rgba(255,255,255,0.08);
  --community-preview-tag-bg: rgba(255,255,255,0.1);
  --community-preview-tag-color: #ffffff;
  --community-preview-badge-bg: rgba(255,255,255,0.15);
  --community-preview-badge-muted: rgba(255,255,255,0.08);
  --community-preview-node-bg: rgba(0, 0, 0, 0.25);
  --community-preview-link-bg: rgba(0, 0, 0, 0.3);
  --community-preview-script-bg: rgba(0, 0, 0, 0.5);
  --community-preview-placeholder: rgba(255,255,255,0.75);
  --community-preview-error: #ffb4a2;
  --community-preview-link-type-color: rgba(255,255,255,0.65);
  --community-preview-close-hover: rgba(255,255,255,0.12);
  --community-topology-process: #ff8a5c;
  --community-topology-object: #4cb2ff;
  --community-topology-state: #ffd257;
  --community-topology-condition: #c58dff;
  --community-topology-result: #63d1c7;
  --community-topology-goal: #ffb347;
  --community-topology-default: #8893a7;
  --community-topology-link: rgba(255,255,255,0.45);
  --community-star-color: #ffd257;
  --community-pill-bg: rgba(255,255,255,0.05);
  --community-pill-border: rgba(255,255,255,0.12);
  --community-import-color: var(--community-accent-orange);
  --community-view-color: var(--community-accent-amber);
}

.page-community * {
  box-sizing: border-box;
}

.page-community .home-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--color-border-light);
  background: color-mix(in srgb, var(--color-bg-primary) 95%, transparent);
  backdrop-filter: blur(6px);
}

.page-community .home-header-inner {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.page-community .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
}

.page-community .brand-logo {
  width: 38px;
  height: 38px;
}

.page-community .brand-text {
  font-size: 1.12rem;
}

.page-community .nav {
  display: inline-flex;
  gap: 0.85rem;
  margin-left: 1.2rem;
}

.page-community .nav a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: var(--font-weight-medium);
  border-bottom: 2px solid transparent;
  padding: 0.3rem 0.1rem;
}

.page-community .nav a:hover,
.page-community .nav a[aria-current="page"] {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.page-community .header-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.page-community .header-actions.auth-pending {
  visibility: hidden;
}

.page-community .menu-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--color-border-light) 60%, transparent);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  padding: 8px;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.page-community .menu-toggle span {
  width: 100%;
  height: 2px;
  background: var(--color-text-primary);
}

.page-community .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.68rem 0.95rem;
  font-size: 0.88rem;
  font-weight: var(--font-weight-semibold);
  border: 1px solid transparent;
  color: var(--color-text-primary);
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.page-community .btn:hover {
  transform: translateY(-1px);
}

.page-community .btn.primary {
  border-color: transparent;
  color: #1a140f;
  background: color-mix(in srgb, var(--color-primary) 86%, var(--color-bg-primary));
}

.page-community .btn.ghost {
  background: color-mix(in srgb, var(--color-bg-secondary) 25%, transparent);
  border-color: color-mix(in srgb, var(--color-border-light) 45%, transparent);
}

.page-community .btn.ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

[data-theme="light"] .page-community {
  --community-accent-orange: #f97316;
  --community-accent-amber: #f59e0b;
  --community-accent-green: #22c55e;
  --community-preview-overlay: rgba(15, 23, 42, 0.35);
  --community-preview-bg: #ffffff;
  --community-preview-text: #1f2933;
  --community-preview-muted: rgba(31,41,55,0.75);
  --community-preview-soft: rgba(31,41,55,0.55);
  --community-preview-border: rgba(15,23,42,0.1);
  --community-preview-border-strong: rgba(15,23,42,0.2);
  --community-preview-card-bg: rgba(15,23,42,0.04);
  --community-preview-thumb-bg: rgba(15,23,42,0.08);
  --community-preview-tag-bg: rgba(249,115,22,0.18);
  --community-preview-tag-color: #b45309;
  --community-preview-badge-bg: rgba(249,115,22,0.22);
  --community-preview-badge-muted: rgba(31,41,55,0.08);
  --community-preview-node-bg: rgba(15,23,42,0.04);
  --community-preview-link-bg: rgba(249,115,22,0.12);
  --community-preview-script-bg: rgba(226,232,240,0.8);
  --community-preview-placeholder: rgba(31,41,55,0.75);
  --community-preview-error: #c24040;
  --community-preview-link-type-color: rgba(31,41,55,0.65);
  --community-preview-close-hover: rgba(15,23,42,0.08);
  --community-topology-process: #fa8249;
  --community-topology-object: #2c7be5;
  --community-topology-state: #d97706;
  --community-topology-condition: #c026d3;
  --community-topology-result: #0d9488;
  --community-topology-goal: #f97316;
  --community-topology-default: #94a3b8;
  --community-topology-link: rgba(31,41,55,0.4);
  --community-star-color: #d97706;
  --community-pill-bg: rgba(15,23,42,0.05);
  --community-pill-border: rgba(15,23,42,0.12);
  --community-import-color: var(--community-accent-orange);
  --community-view-color: var(--community-accent-amber);
}

.community-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.community-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 48px;
  padding: clamp(32px, 5vw, 64px) clamp(24px, 4vw, 48px);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.14), rgba(76, 198, 138, 0.12));
  min-height: 360px;
  position: relative;
}

.community-hero-text {
  flex: 1 1 460px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  text-align: center;
}

.community-hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  margin: 0;
  color: var(--color-text-secondary, rgba(255,255,255,0.5));
}

.community-hero-text h1 {
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.3;
  margin: 0;
}

.community-hero-text p {
  margin: 0;
  line-height: 1.7;
  color: var(--color-text-secondary, rgba(255,255,255,0.75));
}

.community-hero-stats {
  display: flex;
  gap: 24px;
  margin: 12px 0 8px;
  justify-content: center;
}

.community-stat {
  min-width: 120px;
}

.community-stat-value {
  font-size: 36px;
  font-weight: 600;
  color: var(--community-accent-orange);
}

.community-stat-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
}

[data-theme="light"] .page-community .community-hero-text p {
  color: rgba(36, 42, 61, 0.78);
}


.community-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: absolute;
  top: 24px;
  right: 24px;
}

.community-back-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--color-border-light, rgba(255,255,255,0.15));
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.community-back-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.25);
}

.community-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--color-border-light, rgba(255,255,255,0.2));
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255,255,255,0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.community-action-btn.icon-only {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

.community-action-icon {
  display: block;
}

.community-action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.community-action-btn.primary {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.85), rgba(245, 158, 11, 0.75));
  border-color: transparent;
}

.community-action-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: -44px;
  right: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 15, 15, 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.08s ease, transform 0.08s ease;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.community-action-btn[data-tooltip]::before {
  content: '';
  position: absolute;
  top: -16px;
  right: 16px;
  border-width: 6px;
  border-style: solid;
  border-color: rgba(15, 15, 15, 0.9) transparent transparent transparent;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.08s ease, transform 0.08s ease;
  pointer-events: none;
}

.community-action-btn[data-tooltip]:hover::after,
.community-action-btn[data-tooltip]:hover::before,
.community-action-btn[data-tooltip]:focus-visible::after,
.community-action-btn[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translateY(0);
}

[data-theme="light"] .community-action-btn[data-tooltip]::after {
  background: rgba(17, 24, 39, 0.95);
}

[data-theme="light"] .community-action-btn[data-tooltip]::before {
  border-color: rgba(17, 24, 39, 0.95) transparent transparent transparent;
}

@media (max-width: 720px) {
  .community-header-actions {
    position: static;
    width: 100%;
    justify-content: center;
  }
}

.community-toolbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 960px;
  margin: 0 auto 24px;
  text-align: center;
}

.community-search {
  flex: none;
  min-width: 220px;
  width: min(520px, 100%);
  margin: 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--color-border-light, rgba(255,255,255,0.15));
  background: rgba(255,255,255,0.04);
}

.community-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: inherit;
  outline: none;
  font-size: 14px;
}

.community-chip-bar {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: center;
  text-align: center;
}

.community-chip-heading {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--color-text-secondary, rgba(255,255,255,0.75));
  white-space: nowrap;
}

.community-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 0 1 auto;
  justify-content: center;
}

.community-chip {
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

[data-theme="light"] .page-community .community-chip {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .page-community .community-chip.active {
  background: rgba(249, 115, 22, 0.22);
  border-color: rgba(249, 115, 22, 0.55);
  color: #b45309;
}

.community-chip.active {
  background: rgba(255, 107, 53, 0.22);
  border-color: rgba(255, 107, 53, 0.5);
  color: var(--community-accent-orange);
}

.community-chip.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  border-style: dashed;
}

.community-chip span {
  opacity: 0.6;
  margin-left: 4px;
  font-size: 11px;
}

@media (max-width: 720px) {
  .community-toolbar {
    flex-wrap: wrap;
  }

  .community-chip-bar {
    flex: 1 1 100%;
    min-width: 260px;
    justify-content: center;
    text-align: center;
  }

  .community-chip-group {
    justify-content: center;
  }
}

.community-toolbar button {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  background: var(--color-primary, #ff6b35);
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.community-toolbar button:hover {
  opacity: 0.85;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.community-card {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0,0,0,0.18);
  min-height: 220px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.community-card:hover,
.community-card:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

.community-card:focus-visible {
  outline: 2px solid var(--color-primary, #ff6b35);
  outline-offset: 3px;
}

.community-card-thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}

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

.community-card-thumb-placeholder {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
}

.community-card-body {
  padding: 16px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.community-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.community-card-tags {
  display: none;
}

.community-card-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 12px;
}

[data-theme="light"] .page-community .community-card-tag {
  background: rgba(15, 23, 42, 0.08);
  color: #1f2933;
}

.community-card p {
  margin: 0;
  color: var(--color-text-secondary, rgba(255,255,255,0.7));
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.community-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-secondary, rgba(255,255,255,0.7));
  gap: 8px;
  padding: 10px 16px 14px;
  flex-wrap: wrap;
  margin-top: auto;
}

.community-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.community-card-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.community-card-actions .community-card-metrics {
  flex: 1 1 auto;
}

.community-card-import-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  background: var(--community-import-color, #4cc68a) !important;
  border-color: transparent !important;
  color: #fff !important;
}

.community-card-import-btn:hover {
  opacity: 0.92;
}

.community-card-import-btn svg {
  width: 16px;
  height: 16px;
}

.community-metric-pill,
.community-star-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1;
  min-width: 44px;
  justify-content: center;
}

.community-metric-pill {
  border: none;
  background: transparent;
  color: var(--color-text-secondary, rgba(255,255,255,0.75));
  font-weight: 600;
  padding: 6px 0;
}

.community-metric-pill svg,
.community-star-btn svg {
  width: 16px;
  height: 16px;
}

.community-metric-pill span,
.community-star-btn span {
  font-weight: 600;
}

.community-metric-pill--large,
.community-star-btn--large {
  font-size: 14px;
  min-width: 52px;
}

.community-metric-pill--large {
  padding: 7px 0;
}

.community-import-pill svg {
  color: var(--community-import-color, #4cc68a);
}

.community-view-pill svg {
  color: var(--community-view-color, #f59e0b);
}

.community-star-btn {
  padding: 6px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.03);
  color: var(--community-star-color, #ffd257);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.community-star-btn--large {
  padding: 7px 8px;
}

.community-star-btn svg {
  color: currentColor;
}

.community-star-btn:is(:hover,:focus-visible) {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,205,87,0.15);
}

.community-star-btn.is-starred {
  border-color: rgba(255,205,87,0.45);
  background: rgba(255,205,87,0.2);
}

.community-star-btn.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.community-highlight-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.community-highlight-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.community-highlight-note {
  font-size: 12px;
  color: var(--color-text-secondary, rgba(255,255,255,0.65));
  width: 100%;
}

.community-card-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.community-card-icon-btn.primary {
  background: var(--color-primary, #ff6b35);
  border-color: transparent;
  color: #fff;
}

.community-card-icon-btn:not(.primary):hover {
  background: rgba(255,255,255,0.08);
}

.community-card-icon-btn.primary:hover {
  opacity: 0.95;
  background: var(--color-primary, #ff6b35);
}

.community-card [data-action] {
  cursor: pointer;
}

.community-empty {
  text-align: center;
  padding: 80px 20px;
  border-radius: 24px;
  border: 1px dashed rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
}

.community-empty h3 {
  margin-bottom: 12px;
}

.community-empty p {
  margin: 0 auto;
  max-width: 520px;
}

.community-meta {
  font-size: 12px;
  color: var(--color-text-secondary, rgba(255,255,255,0.65));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.community-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.community-meta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: currentColor;
  stroke: currentColor;
  fill: none;
}

body.community-preview-open {
  overflow: hidden;
}

.community-preview-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 24px;
}

.community-preview-modal.visible {
  pointer-events: auto;
  opacity: 1;
}

.community-preview-backdrop {
  position: absolute;
  inset: 0;
  background: var(--community-preview-overlay, rgba(0, 0, 0, 0.65));
  backdrop-filter: blur(4px);
}

.community-preview-dialog {
  position: relative;
  width: min(960px, 92vw);
  max-height: 100vh;
  height: 90vh;
  overflow: hidden;
  background: var(--community-preview-bg, rgba(20, 20, 20, 0.98));
  border-radius: 18px;
  border: 1px solid var(--community-preview-border, rgba(255,255,255,0.1));
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  padding: 24px 44px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 0;
  z-index: 1;
  color: var(--community-preview-text, #fff);
  margin: auto;
  overscroll-behavior: contain;
}

.community-preview-dialog::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.community-preview-fullscreen {
  position: absolute;
  top: 18px;
  right: 60px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--community-preview-border-strong, rgba(255,255,255,0.25));
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.community-preview-fullscreen:hover {
  background: var(--community-preview-close-hover, rgba(255,255,255,0.12));
  border-color: var(--community-preview-border-strong, rgba(255,255,255,0.25));
}

.community-preview-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--community-preview-border-strong, rgba(255,255,255,0.25));
  background: transparent;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.community-preview-close svg {
  width: 18px;
  height: 18px;
}

.community-preview-close:hover {
  background: var(--community-preview-close-hover, rgba(255,255,255,0.12));
  border-color: var(--community-preview-border-strong, rgba(255,255,255,0.25));
}

.community-preview-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  min-height: 0;
}

.community-preview-static {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.community-preview-scroll-shell {
  display: block;
}

.community-preview-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 92px;
}

.community-preview-heading h2 {
  margin: 6px 0 0;
  font-size: 22px;
  color: var(--community-preview-text, #fff);
}

.community-preview-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.community-preview-title-row h2 {
  margin: 6px 0 0;
  flex: 1 1 auto;
}

.community-preview-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.community-preview-actions .community-star-btn,
.community-preview-actions .community-metric-pill {
  flex-shrink: 0;
}

.community-preview-eyebrow {
  color: var(--community-preview-soft, rgba(255,255,255,0.6));
  letter-spacing: 0.1em;
  font-size: 12px;
  margin: 0;
  text-transform: uppercase;
}

.community-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.community-preview-tag {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--community-preview-tag-bg, rgba(255,255,255,0.1));
  font-size: 12px;
  color: var(--community-preview-tag-color, #fff);
}

.community-preview-import-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: var(--community-import-color, #4cc68a);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.community-preview-import-btn svg {
  width: 18px;
  height: 18px;
}

.community-preview-import-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.community-preview-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  font-size: 13px;
  color: var(--community-preview-muted, rgba(255,255,255,0.75));
}

.community-preview-meta strong {
  display: block;
  color: var(--community-preview-text, #fff);
  font-size: 15px;
  margin-top: 3px;
}

.community-preview-meta .meta-label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--community-preview-soft, rgba(255,255,255,0.55));
}

.community-preview-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.community-preview-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--community-preview-card-bg, rgba(255,255,255,0.03));
  border-radius: 14px;
  border: 1px solid var(--community-preview-border, rgba(255,255,255,0.08));
  padding: 16px;
}

.community-preview-description {
  margin: 0;
  color: var(--community-preview-muted, rgba(255,255,255,0.75));
  font-size: 13px;
  line-height: 1.5;
}

.community-preview-iframe {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--community-preview-border, rgba(255,255,255,0.08));
  background: var(--community-preview-card-bg, rgba(255,255,255,0.02));
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  touch-action: pinch-zoom;
  -ms-touch-action: pinch-zoom;
  overscroll-behavior: none;
}

.community-preview-iframe iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  display: block;
  touch-action: pinch-zoom;
  -ms-touch-action: pinch-zoom;
  -webkit-overflow-scrolling: touch;
}

.preview-iframe-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--community-preview-placeholder, rgba(255,255,255,0.75));
  z-index: 2;
  transition: opacity 0.2s ease;
}

.community-preview-iframe[data-preview-state="loaded"] .preview-iframe-status {
  opacity: 0;
  pointer-events: none;
}

.community-preview-iframe[data-preview-state="error"] .preview-iframe-status {
  background: rgba(0, 0, 0, 0.55);
  color: var(--community-preview-error, #ffb4a2);
}

.community-preview-modal.is-fullscreen {
  padding: 0;
}

.community-preview-modal.is-fullscreen .community-preview-dialog {
  width: 100%;
  height: 100%;
  max-height: 100vh;
  border-radius: 0;
  padding: 20px 32px 24px;
}

.community-preview-modal.is-fullscreen .community-preview-iframe,
.community-preview-modal.is-fullscreen .community-preview-iframe iframe {
  height: 100%;
}

.preview-iframe-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  animation: community-spin 1s linear infinite;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--community-preview-soft, rgba(255,255,255,0.6));
}

.section-heading h4 {
  margin: 0;
  font-size: 16px;
  color: var(--community-preview-text, #fff);
}

.community-preview-placeholder {
  padding: 40px;
  text-align: center;
  color: var(--community-preview-placeholder, rgba(255,255,255,0.75));
}

.community-preview-placeholder.error {
  color: var(--community-preview-error, #ffb4a2);
}

.community-preview-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  margin: 0 auto 16px;
  animation: community-spin 1s linear infinite;
}

.community-preview-retry {
  margin-top: 18px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--community-preview-border-strong, rgba(255,255,255,0.4));
  background: transparent;
  color: inherit;
  cursor: pointer;
}

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

@media (max-width: 768px) {
  .community-preview-modal {
    padding: 16px;
  }

  .community-preview-dialog {
    padding: 20px 36px 24px;
    width: 96vw;
  }
}

@media (max-width: 600px) {
  .community-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .community-shell {
    padding: 24px 16px 60px;
  }

  .community-hero {
    padding: 28px 18px;
    min-height: auto;
  }

  .community-hero-text {
    min-width: 0;
  }

  .community-hero-eyebrow {
    letter-spacing: 0.12em;
    font-size: 11px;
  }

  .community-hero-text h1 {
    font-size: clamp(24px, 7vw, 32px);
    overflow-wrap: anywhere;
  }

  .community-hero-text p {
    font-size: 14px;
  }

  .community-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .community-grid {
    grid-template-columns: 1fr;
  }

  .page-community {
  }
}

@media (max-width: 720px) {
  .page-community .home-header-inner {
    position: relative;
    flex-wrap: wrap;
    row-gap: 0.55rem;
    padding: 0.55rem 0;
  }

  .page-community .brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .page-community .brand-text {
    font-size: 1.02rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-community .menu-toggle {
    display: inline-flex;
  }

  .page-community .nav,
  .page-community .header-actions {
    display: none;
  }

  .page-community .home-header.is-open .nav,
  .page-community .home-header.is-open .header-actions {
    display: flex;
    position: static;
    width: 100%;
    border: none;
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-bg-primary) 96%, var(--color-bg-secondary));
    box-shadow: none;
    padding: 0.8rem;
  }

  .page-community .home-header.is-open .nav {
    order: 3;
    flex-direction: column;
    gap: 0.55rem;
    margin-left: 0;
  }

  .page-community .home-header.is-open .header-actions {
    order: 4;
    margin-left: 0;
    justify-content: flex-start;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.45rem;
  }
}
