.community-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid rgba(70,58,46,0.14);
  border-radius: 50%;
  background: rgba(255,255,255,0.84);
  color: #2d2823;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(42,35,30,0.05);
  backdrop-filter: blur(12px);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.community-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 22px rgba(42,35,30,0.1);
}

.community-icon:focus-visible,
.community-dialog button:focus-visible,
.community-dialog input:focus-visible,
.community-dialog textarea:focus-visible {
  outline: 2px solid #a96743;
  outline-offset: 3px;
}

.community-icon svg {
  width: 19px;
  height: 19px;
}

.mobile-nav-links button {
  width: 100%;
  display: block;
  padding: 0.65rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #332d28;
  cursor: pointer;
  font: 0.8rem var(--sans);
  text-align: left;
}

.mobile-nav-links button:hover {
  background: #f4eee5;
}

.community-dialog {
  width: min(520px, calc(100% - 2rem));
  max-width: none;
  padding: 0;
  border: none;
  border-radius: 22px;
  background: transparent;
  color: var(--text);
  overflow: visible;
}

.community-dialog::backdrop {
  background: rgba(24,20,17,0.5);
  backdrop-filter: blur(4px);
}

.community-panel {
  position: relative;
  max-height: min(760px, calc(100vh - 2rem));
  overflow-y: auto;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    radial-gradient(circle at 90% 0, rgba(185,116,19,0.11), transparent 14rem),
    var(--surface);
  box-shadow: 0 28px 90px rgba(33,27,22,0.25);
}

.community-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 1.35rem;
}

.community-close:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.community-identity {
  min-height: 1rem;
  margin-bottom: 0.55rem;
  color: var(--text-tertiary);
  font-size: 0.67rem;
}

.community-kicker {
  margin-bottom: 0.4rem;
  color: var(--warm-accent);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.community-panel h2 {
  max-width: 410px;
  margin-bottom: 1.25rem;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
}

.community-panel form > label,
.rating-fieldset legend {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
}

.rating-fieldset {
  margin-bottom: 1rem;
  border: none;
}

.star-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 0.2rem;
}

.star-rating input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.star-rating label {
  color: #c7c0b7;
  cursor: pointer;
  font-size: 1.85rem;
  line-height: 1;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
  color: #c18120;
}

.community-panel textarea,
.community-panel input[type='search'] {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: 0.82rem var(--sans);
  outline: none;
}

.community-panel textarea {
  resize: vertical;
}

.community-primary,
.community-secondary,
.community-search-row button {
  min-height: 42px;
  border: none;
  border-radius: 10px;
  background: var(--warm-accent);
  color: #fff;
  cursor: pointer;
  font: 600 0.78rem var(--sans);
}

.community-primary,
.community-secondary {
  width: 100%;
  margin-top: 0.8rem;
}

.community-primary:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.community-secondary {
  background: var(--text);
}

.community-error {
  min-height: 1rem;
  margin-top: 0.55rem;
  color: #a33f38;
  font-size: 0.72rem;
}

.community-success {
  padding: 1.25rem 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.community-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.community-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.community-search-row button {
  padding: 0 1rem;
}

.suggestion-results {
  display: grid;
  gap: 0.5rem;
  max-height: 330px;
  overflow-y: auto;
  margin-top: 1rem;
}

.suggestion-result {
  width: 100%;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.suggestion-result:hover,
.suggestion-result.selected {
  border-color: var(--warm-accent);
  background: var(--surface-muted);
}

.suggestion-result img {
  width: 42px;
  height: 62px;
  object-fit: contain;
}

.suggestion-result strong {
  display: block;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.15;
}

.suggestion-result span {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-tertiary);
  font-size: 0.67rem;
}

@media (max-width: 900px) {
  .community-desktop-action {
    display: none;
  }
}

@media (max-width: 700px) {
  .community-dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }

  .community-panel {
    max-height: calc(100vh - 1rem);
    padding: 1.7rem 1.1rem calc(1.2rem + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
  }
}
