:root {
  --rum-yellow: #f7b731;
  --rum-yellow-dark: #f39c12;
  --rum-ink: #111827;
  --rum-ink-soft: #4b5563;
  --rum-sand: #e9eff6;
  --rum-card: #ffffff;
  --rum-border: rgba(148, 163, 184, 0.4);
  --rum-accent: #2a6db0;
  --rum-lunar: #dce7f7;
  --rum-lunar-soft: rgba(148, 163, 184, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--rum-ink);
  background: radial-gradient(circle at top, #f5f7fb 0%, #e6eef8 45%, #d9e4f3 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 12% 20%, rgba(15, 23, 42, 0.25) 0, transparent 45%),
    radial-gradient(1px 1px at 34% 78%, rgba(15, 23, 42, 0.22) 0, transparent 40%),
    radial-gradient(1.5px 1.5px at 78% 32%, rgba(15, 23, 42, 0.2) 0, transparent 50%),
    radial-gradient(1px 1px at 65% 60%, rgba(15, 23, 42, 0.18) 0, transparent 40%);
  opacity: 0.55;
  pointer-events: none;
  z-index: -1;
}

body::after {
  content: "";
  position: fixed;
  width: 120px;
  height: 120px;
  left: -140px;
  top: 20%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%231f2a44' stroke-width='2'%3E%3Ccircle cx='60' cy='52' r='20' fill='%23ffffff'/%3E%3Ccircle cx='60' cy='52' r='9' fill='%23dce7f7'/%3E%3Crect x='46' y='72' width='28' height='22' rx='8' fill='%23ffffff'/%3E%3Crect x='28' y='78' width='16' height='10' rx='5' fill='%23ffffff'/%3E%3Crect x='76' y='78' width='16' height='10' rx='5' fill='%23ffffff'/%3E%3Ccircle cx='40' cy='95' r='7' fill='%23ffffff'/%3E%3Ccircle cx='80' cy='95' r='7' fill='%23ffffff'/%3E%3Cpath d='M88 40c10 2 20 8 26 18'/%3E%3Cpath d='M32 40c-10 2-20 8-26 18'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.6;
  pointer-events: none;
  z-index: -1;
  animation: rum-astronaut 28s linear infinite;
}

body.consultant-panel::after {
  content: none;
  animation: none;
}

.community-page {
  padding: 96px 20px 48px;
  max-width: 1200px;
  margin: 0 auto;
}

.community-hero {
  background: #ffffff;
  border-radius: 24px;
  padding: 36px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
  position: relative;
  overflow: hidden;
}

.community-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(226, 232, 240, 0.6), transparent 55%);
  opacity: 1;
  pointer-events: none;
}

.community-hero h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin-bottom: 12px;
}

.community-hero p {
  color: #374151;
  font-size: 1.05rem;
  max-width: 720px;
}

.community-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.community-button {
  background: linear-gradient(135deg, #2a6db0, #1e4f80);
  color: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.community-button.secondary {
  background: #ffffff;
  color: #111827;
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: none;
}

.community-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(42, 109, 176, 0.22);
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.section-card {
  background: var(--rum-card);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.section-card h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.section-card p {
  color: #4b5563;
  font-size: 0.95rem;
}

.search-panel {
  margin-top: 32px;
  background: #ffffff;
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  display: grid;
  gap: 16px;
  color: var(--rum-ink);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.search-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.search-row label {
  font-size: 0.9rem;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
  color: #111827;
}

.search-row input,
.search-row select,
.search-row textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  font-size: 0.95rem;
  background: #ffffff;
}

.search-row textarea {
  resize: vertical;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #111827;
}

.list-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.list-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  display: grid;
  gap: 12px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.list-card h4 {
  font-size: 1.05rem;
}

.list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #4b5563;
  font-size: 0.9rem;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.panel-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.panel-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #2a6db0, #9fb3d9, #f7b731);
  opacity: 0.9;
}

.panel-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.12);
}

.panel-card ul {
  margin-top: 10px;
  padding-left: 18px;
  color: #4b5563;
  font-size: 0.92rem;
  display: grid;
  gap: 6px;
}

.panel-callout {
  margin-top: 26px;
  background: #ffffff;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  color: #4b5563;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.community-footer-links {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.community-footer-links a {
  text-decoration: none;
  color: #1e3a8a;
  font-weight: 600;
}

.community-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2000;
}

.community-modal.is-open {
  display: flex;
}

.community-modal-content {
  background: #ffffff;
  border-radius: 20px;
  padding: 22px;
  max-width: 520px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
  background-image: radial-gradient(circle at top right, rgba(226, 232, 240, 0.65), transparent 55%);
}

.community-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

.community-modal-header h3 {
  margin-bottom: 4px;
}

.modal-subtitle {
  color: var(--rum-ink-soft);
  font-size: 0.9rem;
}

.community-modal-close {
  border: none;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--rum-ink-soft);
}

.invite-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.invite-item {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
  display: grid;
  gap: 6px;
}

.invite-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.invite-date {
  font-size: 0.75rem;
  color: #1f2937;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  padding: 2px 8px;
}

.invite-item h4 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.invite-meta {
  color: #4b5563;
  font-size: 0.9rem;
}

.invite-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.community-button.ghost {
  background: #ffffff;
  color: #111827;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  box-shadow: none;
}

.community-button.danger {
  background: #ef4444;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.25);
}

.invite-empty {
  background: #ffffff;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 12px;
  color: #4b5563;
}

@keyframes rum-astronaut {
  0% {
    transform: translateX(-200px) translateY(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  50% {
    transform: translateX(55vw) translateY(40px) rotate(10deg);
    opacity: 0.8;
  }
  100% {
    transform: translateX(120vw) translateY(-20px) rotate(18deg);
    opacity: 0;
  }
}

@media (max-width: 640px) {
  .community-page {
    padding: 88px 16px 32px;
  }
}