:root {
  --community-positive: #1f8f62;
  --community-negative: #c92e3b;
  --community-neutral: #f0b429;
}

.community-mobile-find {
  display: none;
}

@media (max-width: 819px) {
  body.community-mobile-find-enabled:not(.community-mobile-find-home):not(.community-mobile-find-trail) {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom));
  }

  body.community-mobile-find-home #results {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom));
  }

  .community-mobile-find {
    position: fixed;
    z-index: 10040;
    right: max(.7rem, env(safe-area-inset-right));
    bottom: max(.75rem, env(safe-area-inset-bottom));
    left: max(.7rem, env(safe-area-inset-left));
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .72rem 1.1rem;
    color: #fff;
    background: var(--accent, #e8442e);
    border: 3px solid var(--ink, #1a1a1a);
    border-radius: 999px;
    box-shadow: 6px 6px 0 var(--ink, #1a1a1a);
    font-family: inherit;
    font-size: clamp(.95rem, 4.2vw, 1.08rem);
    font-weight: 950;
    line-height: 1;
    letter-spacing: -.015em;
    text-align: center;
    text-decoration: none;
    transform: translateZ(0);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  }

  .community-mobile-find i {
    flex: 0 0 auto;
    font-size: 1.25em;
  }

  .community-mobile-find:hover,
  .community-mobile-find:focus-visible {
    background: color-mix(in srgb, var(--accent, #e8442e) 88%, #ffcf3f);
    box-shadow: 7px 7px 0 var(--ink, #1a1a1a);
    transform: translate(-1px, -1px);
  }

  .community-mobile-find:active {
    box-shadow: 2px 2px 0 var(--ink, #1a1a1a);
    transform: translate(4px, 4px);
  }

  .community-toast {
    bottom: calc(5.8rem + env(safe-area-inset-bottom));
  }
}

@media print {
  .community-mobile-find { display: none !important; }
}

.community-card {
  margin: .78rem 0 .82rem;
  padding: .72rem;
  background: color-mix(in srgb, var(--bg, #fff8e7) 72%, #fff);
  border: 2px solid var(--ink, #1a1a1a);
  border-radius: 14px;
}

.community-card[aria-busy="true"] { opacity: .72; }

.community-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
}

.community-score {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: .48rem;
  font-size: .78rem;
  font-weight: 900;
  line-height: 1.2;
}

.community-score-number {
  display: inline-flex;
  min-width: 2.35rem;
  min-height: 2.1rem;
  align-items: center;
  justify-content: center;
  padding: .22rem .45rem;
  background: #fff;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: .92rem;
}

.community-score[data-tone="positive"] { color: var(--community-positive); }
.community-score[data-tone="negative"] { color: var(--community-negative); }
.community-score[data-tone="neutral"] { color: #805700; }
.community-score[data-tone="empty"] { color: color-mix(in srgb, var(--ink, #1a1a1a) 62%, transparent); }

.community-open {
  flex: 0 0 auto;
  min-height: 40px;
  padding: .48rem .7rem;
  color: var(--ink, #1a1a1a);
  background: #fff;
  border: 2px solid var(--ink, #1a1a1a);
  border-radius: 999px;
  font: inherit;
  font-size: .75rem;
  font-weight: 900;
  line-height: 1.1;
  cursor: pointer;
}

.community-open:hover,
.community-open:focus-visible {
  color: #fff;
  background: var(--accent, #e8442e);
}

.community-featured {
  margin-top: .62rem;
  padding-top: .56rem;
  border-top: 2px dashed color-mix(in srgb, var(--ink, #1a1a1a) 42%, transparent);
}

.community-featured-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--accent, #e8442e);
  font-size: .67rem;
  font-weight: 950;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.community-featured blockquote {
  display: -webkit-box;
  overflow: hidden;
  margin-top: .28rem;
  color: var(--ink, #1a1a1a);
  font-size: .82rem;
  font-weight: 720;
  line-height: 1.36;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.community-featured-meta {
  margin-top: .32rem;
  font-size: .67rem;
  font-weight: 800;
  opacity: .6;
}

.community-polarized {
  display: inline-flex;
  margin-top: .46rem;
  padding: .2rem .45rem;
  color: #fff;
  background: var(--accent, #e8442e);
  border: 1.5px solid var(--ink, #1a1a1a);
  border-radius: 999px;
  font-size: .64rem;
  font-weight: 950;
}

.community-toast {
  position: fixed;
  z-index: 10050;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(350px, calc(100vw - 2rem));
  padding: .82rem 1rem;
  color: #fff;
  background: var(--ink, #1a1a1a);
  border: 3px solid var(--ink, #1a1a1a);
  border-radius: 14px;
  box-shadow: 5px 5px 0 var(--accent, #e8442e);
  font-size: .83rem;
  font-weight: 850;
  transform: translateY(130%);
  opacity: 0;
  transition: transform .32s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
}

.community-toast.is-visible { transform: translateY(0); opacity: 1; }

.community-dialog {
  width: min(680px, calc(100% - 1rem));
  max-height: min(88dvh, 820px);
  margin: auto auto max(.5rem, env(safe-area-inset-bottom));
  padding: 0;
  overflow: hidden;
  color: var(--ink, #1a1a1a);
  background: var(--bg, #fff8e7);
  border: 3px solid var(--ink, #1a1a1a);
  border-radius: 24px 24px 18px 18px;
  box-shadow: 8px 8px 0 var(--ink, #1a1a1a);
}

.community-dialog::backdrop {
  background: rgba(18, 16, 12, .62);
  backdrop-filter: blur(7px);
}

.community-dialog[open] {
  animation: community-sheet-in .42s cubic-bezier(.16, 1, .3, 1);
}

@keyframes community-sheet-in {
  from { transform: translateY(35px) scale(.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.community-dialog-shell {
  display: flex;
  max-height: min(88dvh, 820px);
  flex-direction: column;
}

.community-dialog-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .85rem;
  align-items: start;
  padding: 1rem 1rem .86rem;
  background: color-mix(in srgb, var(--bg, #fff8e7) 92%, transparent);
  border-bottom: 3px solid var(--ink, #1a1a1a);
  backdrop-filter: blur(14px);
}

.community-dialog-kicker {
  color: var(--accent, #e8442e);
  font-size: .7rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.community-dialog h2 {
  max-width: 28ch;
  margin-top: .15rem;
  font-size: clamp(1.22rem, 5vw, 1.72rem);
  line-height: 1.08;
  letter-spacing: -.025em;
  text-transform: none;
}

.community-dialog-close {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid var(--ink, #1a1a1a);
  border-radius: 50%;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 900;
  cursor: pointer;
}

.community-dialog-body {
  overflow-y: auto;
  padding: 1rem;
  overscroll-behavior: contain;
}

.community-quick-title,
.community-score-title,
.community-comments-title {
  font-size: .83rem;
  font-weight: 950;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.community-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  margin-top: .55rem;
}

.community-quick {
  display: flex;
  min-height: 82px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  padding: .65rem .42rem;
  color: var(--ink, #1a1a1a);
  background: #fff;
  border: 2.5px solid var(--ink, #1a1a1a);
  border-radius: 15px;
  box-shadow: 3px 3px 0 var(--ink, #1a1a1a);
  font: inherit;
  font-weight: 900;
  line-height: 1.15;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.community-quick strong { font-size: 1.02rem; }
.community-quick small { font-size: .66rem; opacity: .65; }
.community-quick[data-score="-5"] { --quick-color: #f5a7ae; }
.community-quick[data-score="0"] { --quick-color: #ffd84d; }
.community-quick[data-score="5"] { --quick-color: #9ee7c6; }

.community-quick:hover,
.community-quick:focus-visible,
.community-quick[aria-pressed="true"] {
  background: var(--quick-color);
  box-shadow: 5px 5px 0 var(--ink, #1a1a1a);
  transform: translate(-2px, -2px);
}

.community-score-panel {
  margin-top: 1rem;
  padding: .85rem;
  background: #fff;
  border: 2.5px solid var(--ink, #1a1a1a);
  border-radius: 16px;
}

.community-score-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
}

.community-score-readout {
  display: inline-flex;
  min-width: 58px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--ink, #1a1a1a);
  border-radius: 12px;
  font-size: 1.25rem;
  font-weight: 950;
}

.community-score-hint {
  margin-top: .35rem;
  font-size: .76rem;
  font-weight: 700;
  opacity: .66;
}

.community-range {
  width: 100%;
  height: 34px;
  margin-top: .7rem;
  background: transparent;
  accent-color: var(--accent, #e8442e);
  cursor: grab;
}

.community-range:active { cursor: grabbing; }

.community-range::-webkit-slider-runnable-track {
  height: 12px;
  background: linear-gradient(90deg, #d83a43 0%, #f2c24d 50%, #2d9d70 100%);
  border: 2px solid var(--ink, #1a1a1a);
  border-radius: 999px;
}

.community-range::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  margin-top: -10px;
  appearance: none;
  background: #fff;
  border: 3px solid var(--ink, #1a1a1a);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink, #1a1a1a);
}

.community-range::-moz-range-track {
  height: 10px;
  background: linear-gradient(90deg, #d83a43 0%, #f2c24d 50%, #2d9d70 100%);
  border: 2px solid var(--ink, #1a1a1a);
  border-radius: 999px;
}

.community-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: #fff;
  border: 3px solid var(--ink, #1a1a1a);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink, #1a1a1a);
}

.community-range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: -.15rem;
  font-size: .68rem;
  font-weight: 900;
  opacity: .66;
}

.community-comment-field { margin-top: 1rem; }
.community-comment-field label { display: block; font-size: .85rem; font-weight: 950; }

.community-comment-field textarea {
  width: 100%;
  min-height: 112px;
  margin-top: .45rem;
  resize: vertical;
  padding: .75rem;
  color: var(--ink, #1a1a1a);
  background: #fff;
  border: 2.5px solid var(--ink, #1a1a1a);
  border-radius: 14px;
  font: inherit;
  line-height: 1.4;
}

.community-field-foot {
  display: flex;
  justify-content: space-between;
  gap: .7rem;
  margin-top: .32rem;
  font-size: .68rem;
  font-weight: 720;
  opacity: .63;
}

.community-guideline {
  margin-top: .75rem;
  padding-left: .7rem;
  border-left: 4px solid var(--accent, #e8442e);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.4;
}

.community-form-actions {
  display: flex;
  gap: .6rem;
  margin-top: .85rem;
}

.community-submit,
.community-cancel,
.community-delete {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: .65rem .9rem;
  border: 2.5px solid var(--ink, #1a1a1a);
  border-radius: 999px;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.community-submit {
  flex: 1;
  color: #fff;
  background: var(--accent, #e8442e);
  box-shadow: 4px 4px 0 var(--ink, #1a1a1a);
}

.community-cancel { background: #fff; }
.community-delete { margin-top: .7rem; color: #8f1824; background: transparent; }
.community-delete[hidden] { display: none; }

.community-review-list {
  display: grid;
  gap: .62rem;
  margin-top: .62rem;
}

.community-review {
  padding: .75rem;
  background: #fff;
  border: 2px solid var(--ink, #1a1a1a);
  border-radius: 14px;
}

.community-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.community-review-user { font-size: .78rem; font-weight: 950; }
.community-review-score { font-size: .82rem; font-weight: 950; }
.community-review p { margin-top: .42rem; font-size: .84rem; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }

.community-review-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  margin-top: .52rem;
  font-size: .68rem;
  opacity: .62;
}

.community-report {
  padding: .3rem;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 850;
  text-decoration: underline;
  cursor: pointer;
}

.community-empty {
  padding: .8rem;
  background: rgba(255, 255, 255, .65);
  border: 2px dashed var(--ink, #1a1a1a);
  border-radius: 14px;
  font-size: .82rem;
  font-weight: 750;
}

.community-trail-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: .55rem .86rem;
  color: var(--ink, #1a1a1a);
  background: var(--yellow, #ffd84d);
  border: 2.5px solid var(--ink, #1a1a1a);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink, #1a1a1a);
  font-weight: 900;
  text-decoration: none;
}

.results-community-nav {
  display: flex;
  justify-content: flex-end;
  margin: .55rem 0 .9rem;
}

@media (min-width: 720px) {
  .community-dialog { margin: auto; border-radius: 24px; }
}

@media (max-width: 420px) {
  .community-summary-row { align-items: flex-start; }
  .community-score { align-items: flex-start; }
  .community-score > span:last-child { max-width: 8.5rem; }
  .community-open { max-width: 9rem; }
  .community-quick { min-height: 88px; padding-inline: .22rem; }
  .community-quick strong { font-size: .84rem; overflow-wrap: anywhere; }
  .community-form-actions { flex-direction: column; }
  .community-submit, .community-cancel { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .community-dialog[open],
  .community-quick,
  .community-toast,
  .community-mobile-find { animation: none; transition: none; }
}
