/* ==========================================================================
   Qanoonak — Legal Community
   Apple liquid glass · RTL · account-aware
   ========================================================================== */

.community-page {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(1000px 540px at 88% 8%, rgba(37, 99, 235, 0.08), transparent 64%),
    radial-gradient(820px 480px at 8% 28%, rgba(217, 180, 74, 0.06), transparent 62%),
    linear-gradient(180deg, #f6f9fd 0%, #f2f6fb 60%, #f7fafc 100%);
}

.community-container {
  width: min(100%, 1280px);
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 640px) {
  .community-container { padding-inline: 1.5rem; }
}
@media (min-width: 1024px) {
  .community-container { padding-inline: 2rem; }
}

.community-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.community-ambient__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.38;
}
.community-ambient__orb--blue {
  top: 26rem; right: -12rem;
  width: 34rem; height: 34rem;
  background: rgba(59, 130, 246, 0.2);
}
.community-ambient__orb--gold {
  top: 58rem; left: -14rem;
  width: 30rem; height: 30rem;
  background: rgba(217, 180, 74, 0.14);
}
.community-ambient__orb--mint {
  bottom: -12rem; right: 30%;
  width: 26rem; height: 26rem;
  background: rgba(16, 185, 129, 0.12);
}
.community-ambient__grid {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(to left, rgba(148, 163, 184, 0.11) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.11) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 12%, #000 5%, transparent 72%);
  mask-image: radial-gradient(ellipse 90% 60% at 50% 12%, #000 5%, transparent 72%);
}

.community-page main,
.community-page footer,
.community-nav-avatar,
.community-menu-avatar { position: relative; z-index: 1; }

/* --------------------------------------------------------------------------
   Header additions
   -------------------------------------------------------------------------- */
.community-nav-avatar,
.community-menu-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(145deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
  font-weight: 900;
}
.community-nav-avatar { width: 2.25rem; height: 2.25rem; font-size: 0.7rem; box-shadow: 0 0 0 2px rgba(255,255,255,.75); }
.community-menu-avatar { width: 2.75rem; height: 2.75rem; border-radius: 0.95rem; font-size: 0.8rem; }
.community-nav-avatar img,
.community-menu-avatar img { width: 100%; height: 100%; object-fit: cover; }

#communityGuestActions,
#communityUserActions { display: none !important; }
@media (min-width: 1024px) {
  #communityGuestActions:not(.is-hidden),
  #communityUserActions:not(.is-hidden) { display: flex !important; }
}

.mobile-link-icon--gold {
  border-color: rgba(253, 230, 138, 0.85) !important;
  background: linear-gradient(145deg, #fef3c7, #fde68a) !important;
  color: #a16207 !important;
}

.community-page .nav-link > svg { width: 0.9rem; height: 0.9rem; }

#communityMobileMenu {
  max-height: 0;
  margin-top: 0;
  border-width: 0;
  box-shadow: none;
  visibility: hidden;
  overflow: hidden;
  transition: max-height .45s cubic-bezier(.22,1,.36,1), visibility .4s ease, margin .3s ease;
}
#communityMobileMenu.is-open {
  max-height: calc(100dvh - 6.5rem);
  margin-top: .5rem;
  border-width: 1px;
  visibility: visible;
  overflow-y: auto;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.community-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 0 0 2.75rem 2.75rem;
  background:
    radial-gradient(900px 540px at 88% -12%, rgba(37, 99, 235, 0.38), transparent 63%),
    radial-gradient(760px 480px at 4% 4%, rgba(14, 165, 233, 0.15), transparent 58%),
    radial-gradient(680px 400px at 48% 112%, rgba(217, 180, 74, 0.11), transparent 64%),
    linear-gradient(157deg, #070c17 0%, #0f172a 47%, #122342 100%);
}
.community-hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}
.community-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 36%;
  opacity: 0.2;
  filter: saturate(0.8) contrast(1.05);
  transform: scale(1.03);
}
.community-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 12, 23, 0.94) 10%, rgba(7, 12, 23, 0.62) 50%, rgba(7, 12, 23, 0.34)),
    linear-gradient(180deg, rgba(7, 12, 23, 0.58), transparent 34%, rgba(7, 12, 23, 0.8));
}
.community-hero__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to left, rgba(148, 163, 184, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.1) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(ellipse 76% 72% at 50% 32%, #000 18%, transparent 78%);
  mask-image: radial-gradient(ellipse 76% 72% at 50% 32%, #000 18%, transparent 78%);
}
.community-hero__orb {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.community-hero__orb--one {
  top: 8%; left: -8rem;
  width: 22rem; height: 22rem;
  background: rgba(37, 99, 235, 0.28);
}
.community-hero__orb--two {
  bottom: -9rem; right: 12%;
  width: 25rem; height: 25rem;
  background: rgba(217, 180, 74, 0.11);
}

.community-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #dbeafe;
  font-size: 0.66rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}
.community-eyebrow__dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12);
  animation: community-pulse 2.1s ease-out infinite;
}
.community-eyebrow__sep { width: 1px; height: 0.72rem; background: rgba(255,255,255,.2); }
@keyframes community-pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.42); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
}

.community-gradient-text {
  display: inline-block;
  margin-inline: 0.2rem;
  background: linear-gradient(110deg, #fef3c7 0%, #fde68a 30%, #e6c76a 58%, #fef9e7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.community-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  min-height: 2.9rem;
  padding: 0.6rem 1.05rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 200ms ease, background 200ms ease, border-color 200ms ease, color 200ms ease;
}
.community-btn svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
.community-btn:hover { transform: translateY(-2px); }
.community-btn:active { transform: translateY(0) scale(0.98); }
.community-btn:focus-visible { outline: 3px solid rgba(147, 197, 253, 0.8); outline-offset: 3px; }
.community-btn--primary {
  border: 1px solid rgba(191, 219, 254, 0.35);
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8 58%, #1e40af);
  box-shadow: 0 16px 34px -18px rgba(37, 99, 235, 0.75), inset 0 1px 0 rgba(255,255,255,.22);
}
.community-btn--primary:hover { box-shadow: 0 22px 46px -20px rgba(37, 99, 235, 0.9), inset 0 1px 0 rgba(255,255,255,.28); }
.community-btn--glass {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  background: linear-gradient(145deg, rgba(255,255,255,.14), rgba(255,255,255,.055));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 10px 26px -20px rgba(2,6,23,.8);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}
.community-btn--glass:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.community-btn--gold {
  border: 1px solid rgba(255, 237, 160, 0.42);
  color: #3a2a05;
  background: linear-gradient(135deg, #fef3c7, #fde68a 36%, #e7b928 76%, #d4a017);
  box-shadow: 0 16px 32px -18px rgba(202, 138, 4, 0.72), inset 0 1px 0 rgba(255,255,255,.72);
}
.community-btn--gold:hover { box-shadow: 0 0 24px rgba(234, 179, 8, 0.3), 0 20px 38px -18px rgba(202,138,4,.8); }

.community-hero-card {
  position: relative;
  overflow: hidden;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1.7rem;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(253, 230, 138, 0.12), transparent 50%),
    linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.045));
  box-shadow:
    0 32px 80px -40px rgba(2, 6, 23, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
}
.community-hero-card__shine {
  position: absolute;
  top: -5rem; left: -3rem;
  width: 12rem; height: 12rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 67%);
  pointer-events: none;
}
.community-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.25rem 0.52rem;
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 999px;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.1);
  font-size: 0.55rem;
  font-weight: 900;
}
.community-live-pill__dot {
  width: 0.32rem; height: 0.32rem;
  border-radius: 50%;
  background: #34d399;
  animation: community-pulse 2.1s ease-out infinite;
}
.community-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 4.15rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}
.community-stat strong { color: #fff; font-size: 1.25rem; font-weight: 900; line-height: 1.1; }
.community-stat span { margin-top: 0.22rem; color: #94a3b8; font-size: 0.55rem; font-weight: 700; }
.community-role-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.26rem;
  padding: 0.28rem 0.48rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  color: #cbd5e1;
  font-size: 0.55rem;
  font-weight: 800;
}
.community-role-mini svg { width: 0.72rem; height: 0.72rem; }
.community-role-mini[data-role="lawyer"] { color: #93c5fd; border-color: rgba(96,165,250,.22); }
.community-role-mini[data-role="notary"] { color: #fcd34d; border-color: rgba(251,191,36,.22); }
.community-role-mini[data-role="bailiff"] { color: #6ee7b7; border-color: rgba(52,211,153,.22); }
.community-role-mini[data-role="business"] { color: #c4b5fd; border-color: rgba(167,139,250,.22); }
.community-role-mini[data-role="student"] { color: #7dd3fc; border-color: rgba(56,189,248,.22); }

/* --------------------------------------------------------------------------
   Main layout
   -------------------------------------------------------------------------- */
.community-main {
  position: relative;
  z-index: 2;
  padding-block: 2rem 4rem;
}
@media (min-width: 1024px) {
  .community-main { padding-block: 2.5rem 5rem; }
}
.community-layout {
  display: grid;
  gap: 1.35rem;
  align-items: start;
}
@media (min-width: 1120px) {
  .community-layout { grid-template-columns: minmax(0, 1fr) 21rem; gap: 1.6rem; }
}
.community-primary { min-width: 0; display: flex; flex-direction: column; gap: 1.1rem; }

/* Composer */
.community-composer {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  border-radius: 1.55rem !important;
}
.community-composer::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), transparent);
}
@media (min-width: 640px) {
  .community-composer { padding: 1.15rem 1.25rem; }
}
.composer-head { display: flex; align-items: flex-start; gap: 0.7rem; }
.composer-avatar {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 2.75rem;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(191, 219, 254, 0.75);
  border-radius: 0.95rem;
  background: linear-gradient(145deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 8px 18px -14px rgba(37,99,235,.45), inset 0 1px 0 rgba(255,255,255,.9);
}
.composer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.composer-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 999px;
  color: #b45309;
  background: rgba(254, 243, 199, 0.58);
  font-size: 0.52rem;
  font-weight: 900;
  white-space: nowrap;
}
.composer-status.is-ready {
  color: #047857;
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(209, 250, 229, 0.62);
}
.composer-privacy {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  padding: 0.42rem 0.58rem;
  border: 1px solid rgba(217, 180, 74, 0.3);
  border-radius: 0.7rem;
  color: #a16207;
  background: rgba(254, 243, 199, 0.42);
  font-family: inherit;
  font-size: 0.56rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 170ms ease, transform 170ms ease;
}
.composer-privacy:hover { background: rgba(254, 243, 199, 0.85); transform: translateY(-1px); }
.composer-privacy span { display: none; }
@media (min-width: 640px) { .composer-privacy span { display: inline; } }

.composer-textarea {
  width: 100%;
  min-height: 7.2rem;
  margin-top: 0.85rem;
  padding: 0.9rem 1rem;
  resize: vertical;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 1rem;
  outline: 0;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.66);
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.85;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.035), inset 0 1px 0 rgba(255,255,255,.8);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.composer-textarea::placeholder { color: #94a3b8; font-weight: 500; }
.composer-textarea:focus {
  border-color: rgba(96, 165, 250, 0.75);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.09), inset 0 1px 2px rgba(15,23,42,.03);
}

.composer-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.7rem;
}
@media (min-width: 760px) {
  .composer-toolbar { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}
.composer-fields { display: flex; flex: 1; flex-wrap: wrap; align-items: flex-end; gap: 0.55rem; min-width: 0; }
.composer-field { display: flex; flex-direction: column; gap: 0.24rem; min-width: 10rem; }
.composer-field > span { color: #64748b; font-size: 0.55rem; font-weight: 800; }
.composer-field select {
  min-height: 2.35rem;
  padding: 0 0.65rem;
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 0.72rem;
  outline: 0;
  color: #334155;
  background: rgba(255,255,255,.78);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 170ms ease, box-shadow 170ms ease;
}
.composer-field select:focus { border-color: rgba(96,165,250,.8); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }

.composer-anonymous {
  display: flex;
  align-items: center;
  gap: 0.48rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 0.78rem;
  background: rgba(255,255,255,.56);
  cursor: pointer;
}
.composer-anonymous.hidden { display: none; }
.composer-anonymous input { position: absolute; opacity: 0; pointer-events: none; }
.composer-switch {
  position: relative;
  width: 2rem;
  height: 1.1rem;
  flex: 0 0 2rem;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 180ms ease;
}
.composer-switch > span {
  position: absolute;
  top: 0.13rem;
  right: 0.13rem;
  width: 0.84rem;
  height: 0.84rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15,23,42,.22);
  transition: transform 180ms ease;
}
.composer-anonymous input:checked + .composer-switch { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.composer-anonymous input:checked + .composer-switch > span { transform: translateX(-0.9rem); }
.composer-anonymous strong { display: block; color: #475569; font-size: 0.59rem; font-weight: 900; }
.composer-anonymous small { display: block; margin-top: 0.06rem; color: #94a3b8; font-size: 0.48rem; font-weight: 600; }

.composer-actions { display: flex; align-items: center; gap: 0.65rem; }
.composer-count { color: #94a3b8; font-size: 0.55rem; font-weight: 700; white-space: nowrap; direction: ltr; }
.composer-actions .community-btn { min-height: 2.55rem; padding-inline: 0.9rem; font-size: 0.7rem; }
.composer-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.65rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(226, 232, 240, 0.72);
  color: #94a3b8;
  font-size: 0.54rem;
  font-weight: 600;
}

.btn-spinner {
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: community-spin .65s linear infinite;
}
@keyframes community-spin { to { transform: rotate(360deg); } }

/* Filter panel */
.community-filter-panel {
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 1.45rem;
  background: linear-gradient(145deg, rgba(255,255,255,.85), rgba(255,255,255,.6));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 18px 44px -36px rgba(15,23,42,.38);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}
.community-filter-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.community-result-count {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.55rem;
  border: 1px solid rgba(191, 219, 254, 0.8);
  border-radius: 999px;
  color: #2563eb;
  background: rgba(239, 246, 255, 0.75);
  font-size: 0.56rem;
  font-weight: 900;
  white-space: nowrap;
}
.community-tabs {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.8rem;
  padding-bottom: 0.18rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.community-tabs::-webkit-scrollbar { display: none; }
.community-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  padding: 0.48rem 0.66rem;
  border: 1px solid rgba(203, 213, 225, 0.66);
  border-radius: 999px;
  color: #64748b;
  background: rgba(255,255,255,.48);
  font-family: inherit;
  font-size: 0.62rem;
  font-weight: 800;
  cursor: pointer;
  transition: color 170ms ease, background 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}
.community-tab:hover { color: #1d4ed8; border-color: rgba(147,197,253,.7); background: #eff6ff; }
.community-tab.is-active {
  color: #fff;
  border-color: rgba(29, 78, 216, 0.55);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 9px 20px -14px rgba(37,99,235,.8), inset 0 1px 0 rgba(255,255,255,.2);
}
.community-tab--saved { margin-inline-start: auto; }
.community-tab--saved.is-active { background: linear-gradient(135deg, #b8860b, #8a6107); border-color: rgba(120,78,0,.4); }
.community-filter-row {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.7rem;
}
@media (min-width: 720px) {
  .community-filter-row { grid-template-columns: minmax(0,1fr) 11.2rem 8.6rem; }
}
.community-search,
.community-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.55rem;
  padding: 0 0.7rem;
  border: 1px solid rgba(203, 213, 225, 0.75);
  border-radius: 0.82rem;
  background: rgba(255,255,255,.65);
  transition: border-color 170ms ease, box-shadow 170ms ease, background 170ms ease;
}
.community-search:focus-within,
.community-select-wrap:focus-within {
  border-color: rgba(96,165,250,.75);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.07);
}
.community-search > svg,
.community-select-wrap > svg { flex: 0 0 auto; color: #94a3b8; }
.community-search input,
.community-select-wrap select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #334155;
  background: transparent;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
}
.community-search input::placeholder { color: #94a3b8; font-weight: 500; }
.community-search kbd {
  flex: 0 0 auto;
  padding: 0.1rem 0.32rem;
  border: 1px solid rgba(203,213,225,.8);
  border-radius: 0.35rem;
  color: #94a3b8;
  background: #f8fafc;
  font-size: 0.5rem;
  font-weight: 800;
  direction: ltr;
}
.community-select-wrap select { cursor: pointer; }

/* --------------------------------------------------------------------------
   Posts
   -------------------------------------------------------------------------- */
.community-posts { display: flex; flex-direction: column; gap: 0.95rem; }
.post-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 1.45rem;
  background:
    radial-gradient(100% 70% at 100% 0%, rgba(239, 246, 255, 0.42), transparent 52%),
    linear-gradient(145deg, rgba(255,255,255,.9), rgba(255,255,255,.68));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.92),
    0 22px 46px -38px rgba(15,23,42,.38);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}
.post-card:hover {
  border-color: rgba(255,255,255,.98);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 26px 56px -38px rgba(15,23,42,.46);
}
.post-card.is-highlighted {
  animation: community-highlight 2.4s ease;
}
@keyframes community-highlight {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.92), 0 22px 46px -38px rgba(15,23,42,.38); }
  26% { box-shadow: 0 0 0 4px rgba(37,99,235,.16), 0 28px 64px -34px rgba(37,99,235,.5); }
}
.post-card__accent {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  opacity: .75;
}
.post-card[data-author-role="lawyer"] .post-card__accent { background: linear-gradient(180deg, #3b82f6, #1d4ed8); }
.post-card[data-author-role="notary"] .post-card__accent { background: linear-gradient(180deg, #d9b44a, #92400e); }
.post-card[data-author-role="bailiff"] .post-card__accent { background: linear-gradient(180deg, #34d399, #047857); }
.post-card[data-author-role="business"] .post-card__accent { background: linear-gradient(180deg, #a78bfa, #6d28d9); }
.post-card[data-author-role="student"] .post-card__accent { background: linear-gradient(180deg, #38bdf8, #0369a1); }
.post-card[data-author-role="client"] .post-card__accent { background: linear-gradient(180deg, #cbd5e1, #64748b); }
.post-card__inner { padding: 1rem; }
@media (min-width: 640px) { .post-card__inner { padding: 1.1rem 1.2rem; } }

.post-head { display: flex; align-items: flex-start; gap: 0.65rem; }
.post-avatar {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  flex: 0 0 2.65rem;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 0.9rem;
  color: #334155;
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
  box-shadow: 0 8px 18px -14px rgba(15,23,42,.4), inset 0 1px 0 rgba(255,255,255,.9);
  font-size: 0.72rem;
  font-weight: 900;
}
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-avatar[data-role="lawyer"] { color: #1d4ed8; background: linear-gradient(145deg, #eff6ff, #bfdbfe); }
.post-avatar[data-role="notary"] { color: #92400e; background: linear-gradient(145deg, #fffbeb, #fde68a); }
.post-avatar[data-role="bailiff"] { color: #047857; background: linear-gradient(145deg, #ecfdf5, #a7f3d0); }
.post-avatar[data-role="business"] { color: #6d28d9; background: linear-gradient(145deg, #f5f3ff, #ddd6fe); }
.post-avatar[data-role="student"] { color: #0369a1; background: linear-gradient(145deg, #f0f9ff, #bae6fd); }
.post-avatar[data-role="client"] { color: #475569; background: linear-gradient(145deg, #f8fafc, #e2e8f0); }
.post-avatar.is-anonymous { color: #475569; background: linear-gradient(145deg, #f1f5f9, #cbd5e1); }

.post-author { min-width: 0; flex: 1; }
.post-author__name-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.38rem; }
.post-author__name { color: #0f172a; font-size: 0.78rem; font-weight: 900; line-height: 1.35; }
.post-author__you {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.32rem;
  border-radius: 999px;
  color: #2563eb;
  background: #eff6ff;
  font-size: 0.47rem;
  font-weight: 900;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.38rem;
  margin-top: 0.24rem;
  color: #94a3b8;
  font-size: 0.54rem;
  font-weight: 600;
}
.post-meta svg { width: 0.7rem; height: 0.7rem; }
.post-meta__dot { width: 2px; height: 2px; border-radius: 50%; background: #cbd5e1; }
.post-specialty {
  display: inline-flex;
  align-items: center;
  gap: 0.26rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid rgba(191, 219, 254, 0.75);
  border-radius: 999px;
  color: #2563eb;
  background: rgba(239, 246, 255, 0.74);
  font-size: 0.52rem;
  font-weight: 800;
}
.post-specialty svg { width: 0.7rem; height: 0.7rem; }

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  color: #475569;
  background: rgba(248, 250, 252, 0.84);
  font-size: 0.5rem;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
}
.role-badge svg { width: 0.66rem; height: 0.66rem; }
.role-badge[data-role="lawyer"] { color: #1d4ed8; border-color: rgba(96,165,250,.38); background: rgba(239,246,255,.9); }
.role-badge[data-role="notary"] { color: #92400e; border-color: rgba(217,180,74,.4); background: rgba(255,251,235,.94); }
.role-badge[data-role="bailiff"] { color: #047857; border-color: rgba(52,211,153,.36); background: rgba(236,253,245,.92); }
.role-badge[data-role="business"] { color: #6d28d9; border-color: rgba(167,139,250,.38); background: rgba(245,243,255,.92); }
.role-badge[data-role="student"] { color: #0369a1; border-color: rgba(56,189,248,.35); background: rgba(240,249,255,.92); }
.role-badge[data-role="client"] { color: #475569; border-color: rgba(148,163,184,.28); background: rgba(248,250,252,.9); }
.role-badge[data-role="anonymous"] { color: #475569; border-color: rgba(100,116,139,.25); background: rgba(241,245,249,.95); }

.post-body {
  margin-top: 0.7rem;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.9;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.post-body strong { color: #0f172a; font-weight: 800; }
.post-body a { color: #2563eb; text-decoration: underline; text-underline-offset: 2px; }
.post-reference {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding: 0.58rem 0.68rem;
  border: 1px solid rgba(217, 180, 74, 0.28);
  border-radius: 0.75rem;
  color: #8a6107;
  background: rgba(255, 251, 235, 0.7);
  font-size: 0.61rem;
  font-weight: 700;
  line-height: 1.65;
}
.post-reference svg { flex: 0 0 auto; width: 0.85rem; height: 0.85rem; margin-top: 0.1rem; }

.post-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(226, 232, 240, 0.72);
  color: #94a3b8;
  font-size: 0.54rem;
  font-weight: 700;
}
.post-stats span { display: inline-flex; align-items: center; gap: 0.24rem; }
.post-stats svg { width: 0.72rem; height: 0.72rem; }
.post-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.45rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(226, 232, 240, 0.62);
}
.post-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  flex: 1;
  min-height: 2.15rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid transparent;
  border-radius: 0.62rem;
  color: #64748b;
  background: transparent;
  font-family: inherit;
  font-size: 0.59rem;
  font-weight: 800;
  cursor: pointer;
  transition: color 170ms ease, background 170ms ease, border-color 170ms ease, transform 170ms ease;
}
.post-action svg { width: 0.9rem; height: 0.9rem; }
.post-action:hover { color: #1d4ed8; background: #eff6ff; border-color: rgba(191,219,254,.55); }
.post-action:active { transform: scale(.97); }
.post-action.is-active { color: #1d4ed8; background: #eff6ff; }
.post-action[data-community-action="save-post"].is-active { color: #a16207; background: #fffbeb; border-color: rgba(253,230,138,.7); }
.post-action[data-community-action="like-post"].is-active svg { fill: currentColor; }
.post-action__count { color: #94a3b8; font-size: 0.5rem; font-weight: 800; direction: ltr; }
.post-action.is-active .post-action__count { color: inherit; }

/* Comments */
.comments-section {
  margin-top: 0.15rem;
  padding: 0.8rem 1rem 1rem;
  border-top: 1px solid rgba(226, 232, 240, 0.72);
  background: linear-gradient(180deg, rgba(248,250,252,.64), rgba(255,255,255,.26));
}
.comments-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.comments-head h3 { color: #334155; font-size: 0.65rem; font-weight: 900; }
.comments-head span { color: #94a3b8; font-size: 0.52rem; font-weight: 700; }
.comment-list { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.62rem; }
.comment-card {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.65rem;
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: 0.85rem;
  background: rgba(255,255,255,.7);
}
.comment-card.is-professional {
  border-color: rgba(147, 197, 253, 0.66);
  background: linear-gradient(145deg, rgba(239,246,255,.9), rgba(255,255,255,.75));
  box-shadow: inset 3px 0 0 #3b82f6;
}
.comment-avatar {
  display: grid;
  width: 1.9rem;
  height: 1.9rem;
  flex: 0 0 1.9rem;
  place-items: center;
  overflow: hidden;
  border-radius: 0.62rem;
  color: #475569;
  background: #f1f5f9;
  font-size: 0.55rem;
  font-weight: 900;
}
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-avatar[data-role="lawyer"] { color: #1d4ed8; background: #dbeafe; }
.comment-avatar[data-role="notary"] { color: #92400e; background: #fef3c7; }
.comment-avatar[data-role="bailiff"] { color: #047857; background: #d1fae5; }
.comment-avatar[data-role="business"] { color: #6d28d9; background: #ede9fe; }
.comment-avatar[data-role="student"] { color: #0369a1; background: #e0f2fe; }
.comment-body { min-width: 0; flex: 1; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.32rem; }
.comment-name { color: #1e293b; font-size: 0.64rem; font-weight: 900; }
.comment-time { color: #94a3b8; font-size: 0.49rem; font-weight: 600; }
.comment-trust {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-inline-start: 0.1rem;
  padding: 0.12rem 0.34rem;
  border: 1px solid rgba(96, 165, 250, 0.32);
  border-radius: 999px;
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.66);
  font-size: 0.45rem;
  font-weight: 900;
}
.comment-trust svg { width: 0.6rem; height: 0.6rem; }
.comment-text { margin-top: 0.3rem; color: #475569; font-size: 0.68rem; font-weight: 500; line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; }
.comment-form { display: flex; align-items: flex-end; gap: 0.45rem; margin-top: 0.62rem; }
.comment-form .comment-avatar { margin-bottom: 0.1rem; }
.comment-input-wrap { display: flex; flex: 1; align-items: center; gap: 0.35rem; min-height: 2.35rem; padding: 0 0.55rem; border: 1px solid rgba(203,213,225,.78); border-radius: 0.72rem; background: rgba(255,255,255,.82); transition: border-color 170ms ease, box-shadow 170ms ease; }
.comment-input-wrap:focus-within { border-color: rgba(96,165,250,.8); box-shadow: 0 0 0 3px rgba(37,99,235,.07); }
.comment-input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #334155; font-family: inherit; font-size: 0.66rem; font-weight: 600; }
.comment-input::placeholder { color: #94a3b8; font-weight: 500; }
.comment-submit {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  flex: 0 0 2.1rem;
  place-items: center;
  border: 1px solid rgba(37,99,235,.28);
  border-radius: 0.65rem;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  cursor: pointer;
  transition: transform 170ms ease, box-shadow 170ms ease;
}
.comment-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -12px rgba(37,99,235,.8); }
.comment-submit svg { width: 0.9rem; height: 0.9rem; }
.comment-guest-note { margin-top: 0.6rem; color: #94a3b8; font-size: 0.55rem; font-weight: 600; text-align: center; }

.community-empty {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  padding: 3rem 1rem;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 1.3rem;
  background: rgba(255,255,255,.5);
  text-align: center;
}
.community-empty__icon { display: grid; width: 3.3rem; height: 3.3rem; place-items: center; border: 1px solid rgba(191,219,254,.8); border-radius: 1rem; color: #2563eb; background: #eff6ff; }
.community-empty__icon svg { width: 1.4rem; height: 1.4rem; }
.community-empty h3 { color: #334155; font-size: 0.86rem; font-weight: 900; }
.community-empty p { max-width: 24rem; margin: 0; color: #64748b; font-size: 0.68rem; line-height: 1.8; }
.community-empty .community-btn { margin-top: 0.35rem; min-height: 2.4rem; }
.community-empty .community-btn--primary { color: #fff; }

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.community-sidebar { display: flex; flex-direction: column; gap: 0.85rem; }
.side-card {
  padding: 0.95rem;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgba(255,255,255,.86), rgba(255,255,255,.62));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 18px 42px -36px rgba(15,23,42,.35);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}
.side-card-head { display: flex; align-items: flex-start; gap: 0.55rem; }
.side-card-icon { display: grid; width: 2.1rem; height: 2.1rem; flex: 0 0 2.1rem; place-items: center; border-radius: 0.68rem; }
.side-card-icon svg { width: 0.95rem; height: 0.95rem; }
.side-card-icon--blue { color: #1d4ed8; background: #eff6ff; border: 1px solid #dbeafe; }
.side-card-icon--gold { color: #a16207; background: #fffbeb; border: 1px solid #fde68a; }
.side-card-icon--mint { color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; }
.side-card-head h2 { color: #1e293b; font-size: 0.74rem; font-weight: 900; line-height: 1.35; }
.side-card-head p { margin-top: 0.1rem; color: #94a3b8; font-size: 0.52rem; font-weight: 600; }
.side-account { position: relative; overflow: hidden; }
.side-account::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #60a5fa, #d9b44a);
}
.side-account__top { display: flex; align-items: center; gap: 0.6rem; }
.side-account__avatar { display: grid; width: 2.8rem; height: 2.8rem; flex: 0 0 2.8rem; place-items: center; overflow: hidden; border-radius: 0.85rem; color: #1d4ed8; background: linear-gradient(145deg,#eff6ff,#bfdbfe); font-size: 0.75rem; font-weight: 900; box-shadow: inset 0 1px 0 rgba(255,255,255,.9); }
.side-account__avatar img { width: 100%; height: 100%; object-fit: cover; }
.side-account__name { color: #0f172a; font-size: 0.74rem; font-weight: 900; }
.side-account__meta { margin-top: 0.18rem; }
.side-account__text { margin-top: 0.7rem; color: #64748b; font-size: 0.62rem; line-height: 1.75; }
.side-account__actions { display: grid; gap: 0.4rem; margin-top: 0.75rem; }
.side-account__actions .community-btn { min-height: 2.35rem; font-size: 0.66rem; }
.side-account__note { display: flex; align-items: center; gap: 0.3rem; margin-top: 0.65rem; color: #94a3b8; font-size: 0.5rem; font-weight: 600; }
.side-account__note svg { width: 0.7rem; height: 0.7rem; }

.hot-topic {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(226,232,240,.78);
  border-radius: 0.72rem;
  color: #475569;
  background: rgba(255,255,255,.55);
  font-family: inherit;
  font-size: 0.62rem;
  font-weight: 800;
  text-align: right;
  cursor: pointer;
  transition: color 170ms ease, background 170ms ease, border-color 170ms ease, transform 170ms ease;
}
.hot-topic:hover { color: #1d4ed8; border-color: rgba(147,197,253,.62); background: #eff6ff; transform: translateX(-2px); }
.hot-topic span { display: inline-flex; align-items: center; gap: 0.35rem; }
.hot-topic svg { width: 0.78rem; height: 0.78rem; color: #2563eb; }
.hot-topic em { display: inline-flex; align-items: center; justify-content: center; min-width: 1.35rem; height: 1.2rem; padding-inline: 0.28rem; border-radius: 999px; color: #64748b; background: #f1f5f9; font-size: 0.5rem; font-style: normal; font-weight: 900; }

.side-guidelines ul li { display: flex; align-items: flex-start; gap: 0.48rem; }
.side-guidelines ul li > span {
  display: grid;
  width: 1.28rem;
  height: 1.28rem;
  flex: 0 0 1.28rem;
  place-items: center;
  margin-top: 0.08rem;
  border: 1px solid rgba(253,230,138,.8);
  border-radius: 0.4rem;
  color: #a16207;
  background: #fffbeb;
  font-size: 0.45rem;
  font-weight: 900;
}
.side-guidelines ul li p { color: #64748b; font-size: 0.59rem; font-weight: 600; line-height: 1.7; }
.community-sources { display: flex; flex-direction: column; gap: 0.22rem; }
.community-sources a {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.46rem 0.5rem;
  border-radius: 0.6rem;
  color: #475569;
  font-size: 0.61rem;
  font-weight: 700;
  transition: color 170ms ease, background 170ms ease;
}
.community-sources a:hover { color: #1d4ed8; background: #eff6ff; }
.community-sources a svg { width: 0.8rem; height: 0.8rem; color: #94a3b8; }
.community-sources a svg:first-child { color: #2563eb; }
.community-sources a svg:last-child { margin-inline-start: auto; width: 0.68rem; height: 0.68rem; }
.community-sidebar-note {
  display: flex;
  align-items: flex-start;
  gap: 0.32rem;
  padding-inline: 0.2rem;
  color: #94a3b8;
  font-size: 0.51rem;
  font-weight: 600;
  line-height: 1.7;
}
.community-sidebar-note svg { flex: 0 0 auto; margin-top: 0.1rem; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.community-footer {
  position: relative;
  overflow: hidden;
  background: #070c17;
  color: #94a3b8;
  padding-block: 3.5rem 1.5rem;
}
.community-footer__glow {
  position: absolute;
  top: -8rem; right: 22%;
  width: 25rem; height: 25rem;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.09);
  filter: blur(70px);
}
.community-footer .footer-heading { color: #e2e8f0; }
.community-footer .footer-link { color: #94a3b8; font-size: 0.72rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.42rem; transition: color .2s ease; text-align: right; }
.community-footer .footer-link:hover { color: #93c5fd; }
.community-footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.55rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  color: #94a3b8;
  background: rgba(255,255,255,.035);
  font-size: 0.52rem;
  font-weight: 700;
}
.community-footer-badge svg { width: 0.75rem; height: 0.75rem; color: #34d399; }
.community-footer__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 2.8rem; padding-top: 1.2rem; border-top: 1px solid rgba(30,41,59,.9); color: #64748b; font-size: 0.6rem; font-weight: 600; }

/* --------------------------------------------------------------------------
   Golden floating legal library
   -------------------------------------------------------------------------- */
.community-library-fab {
  position: fixed;
  left: 1.2rem;
  bottom: 1.2rem;
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.45rem;
  padding: 0.48rem 0.55rem 0.48rem 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 237, 160, 0.74);
  border-radius: 999px;
  color: #2b1d02;
  background:
    linear-gradient(115deg, rgba(255,255,255,.54), transparent 32%),
    linear-gradient(135deg, #fde68a 0%, #e7b928 28%, #c69212 58%, #f7d76c 78%, #b9820b 100%);
  box-shadow:
    0 20px 44px -18px rgba(120, 78, 0, 0.62),
    0 6px 18px -10px rgba(202, 138, 4, 0.6),
    inset 0 1px 0 rgba(255,255,255,.8),
    inset 0 -1px 0 rgba(120,70,0,.24);
  cursor: pointer;
  animation: community-fab-glow 3.6s ease-in-out infinite;
  transition: transform 220ms cubic-bezier(.22,1,.36,1), box-shadow 220ms ease, filter 220ms ease;
}
.community-library-fab:hover {
  transform: translateY(-3px) scale(1.035);
  filter: saturate(115%) brightness(1.04);
  box-shadow: 0 0 25px rgba(234,179,8,.5), 0 26px 54px -20px rgba(120,78,0,.72), inset 0 1px 0 rgba(255,255,255,.9);
}
.community-library-fab:active { transform: translateY(-1px) scale(.99); }
.community-library-fab:focus-visible { outline: 3px solid rgba(147,197,253,.8); outline-offset: 4px; }
.community-library-fab__glow {
  position: absolute;
  inset: -60% auto auto -12%;
  width: 9rem; height: 9rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.78), transparent 66%);
  opacity: .65;
  pointer-events: none;
  animation: community-fab-shimmer 5.5s ease-in-out infinite;
}
@keyframes community-fab-glow {
  0%, 100% { box-shadow: 0 20px 44px -18px rgba(120,78,0,.62), 0 6px 18px -10px rgba(202,138,4,.6), 0 0 0 rgba(234,179,8,0); }
  50% { box-shadow: 0 20px 44px -18px rgba(120,78,0,.62), 0 6px 18px -10px rgba(202,138,4,.6), 0 0 22px rgba(234,179,8,.22); }
}
@keyframes community-fab-shimmer {
  0%, 100% { transform: translate(-10%,-8%) scale(.9); opacity: .4; }
  50% { transform: translate(18%,6%) scale(1.12); opacity: .78; }
}
.community-library-fab__icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 2.5rem; height: 2.5rem;
  flex: 0 0 2.5rem;
  place-items: center;
  border-radius: 50%;
  color: #ffe9a1;
  background: linear-gradient(145deg, #3b2b08, #1c1505);
  box-shadow: 0 7px 16px -8px rgba(28,20,3,.75), inset 0 1px 0 rgba(255,240,180,.28);
}
.community-library-fab__icon svg { width: 1.2rem; height: 1.2rem; }
.community-library-fab__copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.16; }
.community-library-fab__copy strong { font-size: 0.78rem; font-weight: 900; letter-spacing: -.01em; }
.community-library-fab__copy small { margin-top: 0.16rem; color: rgba(63,43,3,.76); font-size: 0.53rem; font-weight: 700; }
.community-library-fab__count {
  position: absolute;
  top: -0.22rem; right: -0.16rem;
  z-index: 2;
  display: grid;
  min-width: 1.25rem; height: 1.25rem;
  place-items: center;
  border: 2px solid #f8e7a2;
  border-radius: 999px;
  color: #fff;
  background: #1d4ed8;
  font-size: 0.58rem;
  font-weight: 900;
}
.community-library-fab__count[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */
.community-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 220ms ease, visibility 220ms ease;
}
.community-modal.is-open { visibility: visible; opacity: 1; }
.community-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 12, 23, 0.68);
  backdrop-filter: blur(12px) saturate(125%);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
}
.community-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 1.7rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(219,234,254,.5), transparent 42%),
    linear-gradient(150deg, rgba(255,255,255,.98), rgba(248,250,255,.95));
  box-shadow: 0 42px 110px -32px rgba(2,6,23,.8), inset 0 1px 0 rgba(255,255,255,.95);
  transform: translateY(14px) scale(.985);
  transition: transform 260ms cubic-bezier(.22,1,.36,1);
}
.community-modal.is-open .community-modal__dialog { transform: translateY(0) scale(1); }
.community-modal__close {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  z-index: 3;
  display: grid;
  width: 2rem; height: 2rem;
  place-items: center;
  border: 1px solid rgba(203,213,225,.7);
  border-radius: 0.65rem;
  color: #64748b;
  background: rgba(255,255,255,.75);
  cursor: pointer;
  transition: background 170ms ease, color 170ms ease, transform 170ms ease;
}
.community-modal__close:hover { transform: rotate(90deg); color: #0f172a; background: #fff; }
.community-modal__close--gold { color: #fef3c7; border-color: rgba(253,230,138,.26); background: rgba(255,255,255,.08); }
.community-modal__close--gold:hover { color: #fff; background: rgba(255,255,255,.16); }

.community-auth-dialog { padding: 2rem 1.5rem 1.4rem; text-align: center; }
.community-auth-icon {
  display: grid;
  width: 3.5rem; height: 3.5rem;
  margin: 0 auto 0.8rem;
  place-items: center;
  border: 1px solid rgba(147,197,253,.55);
  border-radius: 1.1rem;
  color: #1d4ed8;
  background: linear-gradient(145deg, #eff6ff, #dbeafe);
  box-shadow: 0 18px 38px -24px rgba(37,99,235,.6), inset 0 1px 0 rgba(255,255,255,.9);
}
.community-auth-dialog .card-eyebrow { display: block; }
.community-auth-dialog h2 { max-width: 22rem; margin: 0.4rem auto 0; color: #0f172a; font-size: 1.12rem; font-weight: 900; line-height: 1.55; }
.community-auth-dialog p { max-width: 24rem; margin: 0.6rem auto 0; color: #64748b; font-size: 0.72rem; font-weight: 500; line-height: 1.85; }
.community-auth-actions { display: grid; gap: 0.5rem; margin-top: 1.15rem; }
.community-auth-actions .community-btn { min-height: 2.8rem; text-decoration: none; }
.community-auth-note { display: flex; align-items: center; justify-content: center; gap: 0.3rem; margin-top: 1rem !important; color: #94a3b8 !important; font-size: 0.52rem !important; }

.community-library-dialog {
  width: min(980px, 100%);
  border-color: rgba(217, 180, 74, 0.55);
  background:
    radial-gradient(circle at 100% 0%, rgba(253,230,138,.34), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(202,138,4,.12), transparent 44%),
    linear-gradient(150deg, rgba(255,254,249,.99), rgba(254,250,235,.97));
  box-shadow: 0 44px 110px -32px rgba(50,35,4,.62), 0 0 60px -24px rgba(234,179,8,.45), inset 0 1px 0 rgba(255,255,255,.96);
}
.community-library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(217,180,74,.38);
  background: linear-gradient(135deg, rgba(35,28,12,.99), rgba(58,45,15,.95) 62%, rgba(90,66,11,.92));
}
.community-library-head__copy { display: flex; align-items: flex-start; gap: 0.65rem; padding-left: 1.8rem; }
.community-library-head__icon {
  display: grid;
  width: 2.3rem; height: 2.3rem;
  flex: 0 0 2.3rem;
  place-items: center;
  border-radius: 0.75rem;
  color: #3a2a05;
  background: linear-gradient(145deg, #fef3c7, #fbbf24 44%, #d4a017);
  box-shadow: 0 12px 26px -16px rgba(202,138,4,.9), inset 0 1px 0 rgba(255,255,255,.8);
}
.community-library-head h2 { color: #fff7d6; font-size: 0.96rem; font-weight: 900; line-height: 1.35; }
.community-library-head p { margin-top: 0.2rem; color: rgba(254,240,191,.7); font-size: 0.56rem; font-weight: 600; line-height: 1.6; }
.community-library-body { display: flex; flex-direction: column; gap: 0.62rem; padding: 0.9rem 1rem 1rem; }
.community-library-toolbar { display: flex; align-items: stretch; gap: 0.5rem; }
.community-library-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0 0.72rem;
  border: 1px solid rgba(202,138,4,.3);
  border-radius: 0.9rem;
  background: rgba(255,255,255,.74);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 12px 26px -24px rgba(120,78,0,.55);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.community-library-search:focus-within { border-color: rgba(217,180,74,.8); background: #fff; box-shadow: 0 0 0 4px rgba(234,179,8,.12); }
.community-library-search > svg { width: 1rem; height: 1rem; flex: 0 0 auto; color: #b8860b; }
.community-library-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #292014; font-family: inherit; font-size: 0.72rem; font-weight: 700; }
.community-library-search input::placeholder { color: #a18052; font-weight: 600; }
.community-library-search kbd { flex: 0 0 auto; padding: .12rem .35rem; border: 1px solid rgba(180,140,55,.26); border-radius: .35rem; color: #9a7426; background: rgba(254,243,199,.7); font-size: .5rem; font-weight: 800; direction: ltr; }
.community-library-fav-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  padding: 0 0.75rem;
  border: 1px solid rgba(202,138,4,.28);
  border-radius: 0.9rem;
  color: #79520b;
  background: rgba(255,255,255,.62);
  font-family: inherit;
  font-size: 0.64rem;
  font-weight: 900;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}
.community-library-fav-filter svg { width: .85rem; height: .85rem; }
.community-library-fav-filter:hover { background: rgba(254,243,199,.92); border-color: rgba(202,138,4,.55); }
.community-library-fav-filter.is-active { color: #fffbea; border-color: rgba(120,78,0,.4); background: linear-gradient(135deg,#b8860b,#8a6107); }
.community-library-chips { display: flex; gap: .3rem; overflow-x: auto; padding-bottom: .12rem; scrollbar-width: none; }
.community-library-chips::-webkit-scrollbar { display: none; }
.community-library-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  flex: 0 0 auto;
  padding: .42rem .6rem;
  border: 1px solid rgba(202,184,148,.42);
  border-radius: 999px;
  color: #786345;
  background: rgba(255,255,255,.48);
  font-family: inherit;
  font-size: .58rem;
  font-weight: 800;
  cursor: pointer;
  transition: color 170ms ease, background 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}
.community-library-chip svg { width: .72rem; height: .72rem; }
.community-library-chip:hover { color: #7b5409; border-color: rgba(202,138,4,.4); background: rgba(255,251,235,.92); }
.community-library-chip.is-active { color: #fffbea; border-color: rgba(120,78,0,.42); background: linear-gradient(135deg,#a97a0b,#7b5409); box-shadow: 0 9px 18px -14px rgba(70,45,2,.74); }
.community-library-meta { display: flex; align-items: center; justify-content: space-between; gap: .55rem; color: #7b6a50; font-size: .56rem; font-weight: 800; }
.community-library-meta span:last-child { display: inline-flex; align-items: center; gap: .28rem; color: #a1844c; font-weight: 600; }
.community-library-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: .55rem;
  max-height: min(47vh, 510px);
  overflow-y: auto;
  padding: .08rem .12rem .12rem .08rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(202,138,4,.4) transparent;
}
.community-library-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: .45rem;
  padding: .75rem;
  border: 1px solid rgba(214,195,156,.55);
  border-radius: .9rem;
  background: linear-gradient(145deg, rgba(255,255,255,.86), rgba(255,252,242,.7));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 18px 32px -30px rgba(92,62,9,.55);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.community-library-card:hover { transform: translateY(-2px); border-color: rgba(202,138,4,.46); box-shadow: 0 0 0 1px rgba(253,230,138,.4), 0 24px 44px -30px rgba(92,62,9,.62); }
.community-library-card__head { display: flex; align-items: flex-start; gap: .48rem; }
.community-library-card__icon { display: grid; width: 2rem; height: 2rem; flex: 0 0 2rem; place-items: center; border: 1px solid rgba(217,180,74,.35); border-radius: .62rem; color: #8a6107; background: linear-gradient(145deg,rgba(254,243,199,.95),rgba(251,230,152,.6)); }
.community-library-card__icon svg { width: .9rem; height: .9rem; }
.community-library-card__title { min-width: 0; flex: 1; }
.community-library-card__cat { display: block; color: #a17b2b; font-size: .48rem; font-weight: 900; }
.community-library-card__title h3 { margin: .13rem 0 0; color: #2f2411; font-size: .72rem; font-weight: 900; line-height: 1.45; }
.community-library-card__title small { display: block; margin-top: .12rem; color: #98825c; font-size: .51rem; font-weight: 700; line-height: 1.5; }
.community-library-card > p { margin: 0; color: #6a5b43; font-size: .6rem; font-weight: 500; line-height: 1.72; }
.community-library-star {
  display: grid;
  width: 1.7rem; height: 1.7rem;
  flex: 0 0 1.7rem;
  place-items: center;
  border: 1px solid rgba(199,175,124,.48);
  border-radius: .55rem;
  color: #a48a58;
  background: rgba(255,255,255,.65);
  cursor: pointer;
  transition: color 170ms ease, background 170ms ease, border-color 170ms ease, transform 170ms ease;
}
.community-library-star svg { width: .8rem; height: .8rem; }
.community-library-star:hover { transform: translateY(-1px); color: #a97a0b; background: #fffbeb; }
.community-library-star.is-active { color: #fff8dd; border-color: rgba(120,78,0,.45); background: linear-gradient(145deg,#d4a017,#9a6d08); }
.community-library-tags { display: flex; flex-wrap: wrap; gap: .22rem; }
.community-library-tags span { padding: .14rem .34rem; border: 1px solid rgba(221,206,176,.54); border-radius: 999px; color: #826b45; background: rgba(255,253,246,.72); font-size: .48rem; font-weight: 700; }
.community-library-card__foot { display: flex; align-items: center; justify-content: space-between; gap: .35rem; margin-top: auto; padding-top: .42rem; border-top: 1px solid rgba(221,206,176,.48); }
.community-library-card__foot a,
.community-library-card__foot span { display: inline-flex; align-items: center; gap: .22rem; font-size: .51rem; font-weight: 800; }
.community-library-card__foot a { color: #8a6107; }
.community-library-card__foot a:hover { color: #4c3504; text-decoration: underline; text-underline-offset: 2px; }
.community-library-card__foot span { color: #a08a61; font-weight: 600; }
.community-library-card__foot svg { width: .65rem; height: .65rem; }
.community-library-empty { grid-column: 1/-1; display: grid; justify-items: center; gap: .4rem; padding: 2rem 1rem; text-align: center; }
.community-library-empty__icon { display: grid; width: 3.2rem; height: 3.2rem; place-items: center; border: 1px solid rgba(217,180,74,.4); border-radius: .95rem; color: #a97a0b; background: rgba(254,243,199,.62); }
.community-library-empty strong { color: #3f3117; font-size: .82rem; font-weight: 900; }
.community-library-empty p { max-width: 21rem; margin: 0; color: #8b7858; font-size: .63rem; line-height: 1.75; }
.community-library-footnote { display: flex; align-items: flex-start; gap: .3rem; padding-top: .5rem; border-top: 1px solid rgba(217,180,74,.26); color: #9a8766; font-size: .53rem; font-weight: 600; line-height: 1.65; }
.community-library-footnote svg { flex: 0 0 auto; width: .7rem; height: .7rem; margin-top: .08rem; color: #b8860b; }

/* Toast */
.community-toast {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 180;
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: .72rem .8rem;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 1rem;
  color: #fff;
  background: rgba(15,23,42,.95);
  box-shadow: 0 24px 60px -24px rgba(2,6,23,.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateY(1.3rem);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform .28s cubic-bezier(.22,1,.36,1), opacity .28s ease, visibility .28s ease;
}
.community-toast.is-visible { transform: translateY(0); opacity: 1; visibility: visible; }
.community-toast__icon { display: grid; width: 1.9rem; height: 1.9rem; flex: 0 0 1.9rem; place-items: center; border-radius: .55rem; color: #bfdbfe; background: rgba(59,130,246,.2); }
.community-toast__icon svg { width: .9rem; height: .9rem; }
.community-toast[data-type="success"] .community-toast__icon { color: #a7f3d0; background: rgba(16,185,129,.18); }
.community-toast[data-type="warning"] .community-toast__icon { color: #fde68a; background: rgba(245,158,11,.18); }
.community-toast[data-type="error"] .community-toast__icon { color: #fecdd3; background: rgba(244,63,94,.18); }
.community-toast__copy { min-width: 0; }
.community-toast__copy strong { display: block; font-size: .67rem; font-weight: 900; line-height: 1.35; }
.community-toast__copy span { display: block; margin-top: .1rem; color: #94a3b8; font-size: .54rem; font-weight: 500; line-height: 1.55; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1119px) {
  .community-sidebar { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); align-items: start; }
  .community-sidebar > .community-sidebar-note { grid-column: 1/-1; }
}
@media (max-width: 700px) {
  .community-hero { border-radius: 0 0 1.8rem 1.8rem; }
  .community-hero-card { padding: 1rem; }
  .community-stat { min-height: 3.7rem; }
  .community-stat strong { font-size: 1.08rem; }
  .community-composer { padding: .85rem; }
  .composer-head { flex-wrap: wrap; }
  .composer-privacy { display: none; }
  .composer-toolbar { gap: .55rem; }
  .composer-fields { align-items: stretch; }
  .composer-field { width: 100%; }
  .composer-anonymous { width: 100%; }
  .composer-actions { justify-content: space-between; }
  .composer-actions .community-btn { flex: 1; }
  .community-filter-panel { padding: .8rem; }
  .community-filter-head { flex-direction: column; gap: .35rem; }
  .community-filter-row { grid-template-columns: 1fr; }
  .community-sidebar { grid-template-columns: 1fr; }
  .community-sidebar > .community-sidebar-note { grid-column: auto; }
  .community-tabs { margin-inline: -.1rem; padding-inline: .1rem; }
  .community-library-fab { left: .8rem; bottom: .8rem; min-height: 3.2rem; padding: .42rem; border-radius: 50%; }
  .community-library-fab__copy { display: none; }
  .community-library-fab__icon { width: 2.4rem; height: 2.4rem; flex-basis: 2.4rem; }
  .community-library-fab__count { top: -.2rem; right: -.15rem; }
  .community-toast { right: .7rem; bottom: .7rem; max-width: calc(100vw - 1.4rem); }
  .community-library-dialog { max-height: 92vh; }
  .community-library-toolbar { flex-direction: column; }
  .community-library-fav-filter { justify-content: center; min-height: 2.45rem; }
  .community-library-search kbd { display: none; }
  .community-library-results { grid-template-columns: 1fr; max-height: 52vh; }
  .community-library-meta { align-items: flex-start; flex-direction: column; gap: .18rem; }
  .community-library-head__copy { padding-left: 1.5rem; }
  .community-library-head p { display: none; }
  .community-footer__bottom { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 460px) {
  .post-actions { flex-wrap: wrap; }
  .post-action { flex: 1 1 40%; }
  .comment-form { flex-wrap: wrap; }
  .comment-form .comment-avatar { display: none; }
  .community-tab--saved { margin-inline-start: 0; }
  .community-auth-dialog { padding: 1.8rem 1.1rem 1.2rem; }
  .community-library-body { padding: .75rem; }
  .community-library-card { padding: .65rem; }
  .community-library-results { max-height: 50vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}
