/* Leave enough scroll room to bring the last footer/consent links above the seal. */
body[data-community] { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
body.circle-build-mode[data-community] { padding-bottom: 0; }
.community-launcher {
  position: fixed;
  z-index: 8;
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  font-family: var(--font);
  color: var(--ink);
}
.community-launcher[hidden],
.circle-build-mode .community-launcher,
.community-editing .community-launcher { display: none; }
/* Also yield to form editing when JavaScript is unavailable. */
body:has(input:focus, textarea:focus, select:focus, [contenteditable="true"]:focus) .community-launcher { display: none; }
.community-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: max-content;
  max-width: 140px;
  min-width: 80px;
  min-height: 88px;
  padding: 2px 6px 4px;
  border-radius: 12px;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.community-trigger::-webkit-details-marker { display: none; }
.community-trigger::marker { content: ""; }
.community-mascot {
  display: block;
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  transform-origin: 50% 82%;
  transition: transform 160ms cubic-bezier(.23, 1, .32, 1);
}
.community-launcher[data-welcome] .community-mascot { animation: community-hello 680ms cubic-bezier(.23, 1, .32, 1) 1; }
.community-caption {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  box-shadow: 0 2px 0 rgb(23 63 52 / 8%);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}
.community-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(336px, calc(100vw - 36px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  max-height: calc(100vh - 140px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  max-height: calc(100dvh - 140px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 10px 32px rgb(23 63 52 / 20%), 0 2px 0 rgb(23 63 52 / 12%);
  text-align: left;
}
.community-panel p { margin: 0; }
.community-panel .community-kicker {
  max-width: calc(100% - 20px);
  margin: 0 12px 10px 0;
  color: #d5e3c8;
  font-size: 12px;
  line-height: 1.5;
}
.community-panel h2 {
  margin: 0 0 10px;
  color: var(--paper);
  font-family: var(--display);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.5px;
}
.community-panel .community-description { margin-bottom: 20px; font-size: 15px; line-height: 1.55; }
.community-panel a { color: var(--paper); text-underline-offset: 3px; }
.community-panel a:hover { color: #d5e3c8; }
.community-panel .community-discord {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--paper);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 120ms cubic-bezier(.23, 1, .32, 1);
}
.community-panel .community-discord:hover { background: var(--selected); color: var(--ink); }
.community-discord span { font-size: 20px; line-height: 1; }
.community-panel .community-note { margin-top: 9px; color: #d5e3c8; font-size: 12px; line-height: 1.5; }
.community-email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 6px;
  margin-top: 17px;
  padding-top: 11px;
  border-top: 1px solid rgb(255 254 248 / 22%);
  font-size: 14px;
}
.community-email a, .community-contact { display: inline-flex; align-items: center; min-height: 44px; }
.community-contact { font-size: 13px; }
.community-close, .community-dismiss {
  appearance: none;
  border: 0;
  color: var(--paper);
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.community-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 26px;
  line-height: 1;
}
.community-dismiss {
  display: block;
  min-height: 44px;
  margin-top: 6px;
  padding: 6px 0;
  background: transparent;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.community-close[hidden], .community-dismiss[hidden] { display: none; }
.community-close:hover { background: rgb(255 254 248 / 10%); }
.community-dismiss:hover { color: #d5e3c8; }
.community-trigger:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.community-panel :is(a, button):focus-visible { outline: 2px solid #bde394; outline-offset: 3px; }
.community-trigger:focus-visible .community-mascot { animation: none; transition: none; transform: none; }
.community-panel :is(a, button):focus-visible { transition: none; }
@media (hover: hover) and (pointer: fine) {
  .community-trigger:hover .community-mascot { transform: translateY(-2px) rotate(-6deg); }
}
.community-trigger:active .community-mascot { transform: scale(.96); }
.community-discord:active { transform: scale(.98); }
@keyframes community-hello {
  0%, 100% { transform: none; }
  35% { transform: translateY(-3px) rotate(-8deg); }
  65% { transform: rotate(4deg); }
}
@media (max-width: 540px) {
  .community-launcher { right: max(12px, env(safe-area-inset-right, 0px)); bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
  .community-panel { width: min(336px, calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))); padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .community-launcher[data-welcome] .community-mascot, .community-mascot, .community-discord { animation: none; transition: none; }
  .community-trigger:is(:hover, :active) .community-mascot, .community-discord:active { transform: none; }
}
@media print {
  .community-launcher { display: none; }
  body[data-community] { padding-bottom: 0; }
}
