.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.community-main [hidden],
.community-dialog [hidden] { display: none !important; }

body:has(dialog[open]) { overflow: hidden; }

.community-main { min-height: calc(100vh - 320px); background: #fff; }

.community-heading {
  padding: 116px 0 38px;
  background: #f5f7fb;
  border-bottom: 1px solid var(--line);
}

.community-heading-inner {
  display: block;
}

.community-heading h1 {
  max-width: 760px;
  font-size: 34px;
  letter-spacing: 0;
}

.community-heading p:not(.eyebrow) {
  max-width: 720px;
  margin-top: 12px;
  color: var(--muted);
}

.community-section { padding: 40px 0 88px; }

.community-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 42px;
  align-items: start;
}

.community-categories {
  position: sticky;
  top: 92px;
  padding-right: 24px;
  border-right: 1px solid var(--line);
}

.community-categories h2 {
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--muted);
}

.category-list { display: grid; gap: 3px; }

.category-button {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--body);
  font: inherit;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
}

.category-button:hover { background: var(--soft); color: var(--brand); }
.category-button.is-active { background: var(--brand-50); color: var(--brand-dark); font-weight: 600; }

.community-content { min-width: 0; }

.community-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 30px;
}

.community-toolbar {
  display: flex;
  width: min(600px, 100%);
  gap: 10px;
}

.community-toolbar-action { flex: 0 0 auto; box-shadow: none; }

.search-field { flex: 1; }

.search-field input,
.mobile-category-select select,
.community-form input,
.community-form select,
.community-form textarea,
.review-note {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-field input { height: 44px; padding: 9px 14px; }

.search-field input:focus,
.mobile-category-select select:focus,
.community-form input:focus,
.community-form select:focus,
.community-form textarea:focus,
.review-note:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(27, 91, 215, 0.12);
}

.community-result-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  min-height: 50px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-strong);
}

.community-result-head h2 { font-size: 20px; }
.community-result-head p { margin-top: 3px; color: var(--faint); font-size: 13px; }
.mobile-category-select { display: none; }
.mobile-category-select select { height: 40px; padding: 7px 32px 7px 11px; }

.community-list { display: grid; }

.community-post {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 23px 2px;
  border-bottom: 1px solid var(--line);
}

.community-post-main { min-width: 0; }

.community-post-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.community-tag,
.official-badge,
.pin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1;
}

.community-tag { background: var(--brand-50); color: var(--brand-dark); }
.pin-badge { background: var(--accent-50); color: var(--accent-dark); }
.official-badge { background: var(--green-50); color: var(--green); font-weight: 600; }

.community-post h3 {
  min-width: 0;
  font-size: 18px;
  line-height: 1.45;
}

.community-post h3 a:hover { color: var(--brand); }

.community-post-excerpt {
  display: -webkit-box;
  margin-top: 9px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.community-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 12px;
  color: var(--faint);
  font-size: 12.5px;
}

.community-post-counts {
  display: grid;
  grid-template-columns: repeat(2, 58px);
  gap: 8px;
  align-content: center;
  text-align: center;
}

.community-post-counts span {
  padding: 8px 4px;
  border-left: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}

.community-post-counts strong { display: block; color: var(--body); font-size: 15px; }

.community-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

.community-state strong { color: var(--ink); font-size: 17px; }
.community-state span { font-size: 14px; }

.community-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 30px;
}

.page-button {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--body);
  cursor: pointer;
}

.page-button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.page-button.is-active { border-color: var(--brand); background: var(--brand); color: #fff; }
.page-button:disabled { cursor: not-allowed; opacity: 0.45; }

.community-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 56px));
  max-height: min(760px, calc(100dvh - 56px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.compose-dialog { overflow-y: auto; }
.compose-dialog .community-form textarea { height: 130px; }

.community-dialog::backdrop { background: rgba(14, 27, 54, 0.58); backdrop-filter: blur(2px); }

.detail-dialog { width: min(760px, calc(100vw - 40px)); }

.dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--line);
}

.dialog-head span { color: var(--brand); font-size: 12.5px; font-weight: 600; }
.dialog-head h2 { margin-top: 3px; font-size: 21px; }

.dialog-close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover { border-color: var(--line-strong); color: var(--ink); background: var(--soft); }

.community-form {
  display: grid;
  gap: 17px;
  padding: 24px 28px 28px;
}

.community-form label { display: grid; gap: 6px; }
.community-form label > span { color: var(--ink); font-size: 13px; font-weight: 600; }
.community-form input, .community-form select { height: 43px; padding: 8px 12px; }
.community-form textarea { min-height: 112px; padding: 10px 12px; resize: vertical; line-height: 1.65; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.captcha-field { max-width: 260px; }
.captcha-field b { color: var(--accent-dark); }
.community-form-status { min-height: 20px; color: var(--muted); font-size: 13px; }
.community-form-status.is-error { color: #c73535; }
.community-form-status.is-success { color: var(--green); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

.detail-scroll {
  max-height: calc(100vh - 185px);
  max-height: calc(100dvh - 185px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 20px 28px 0; color: var(--faint); font-size: 13px; }
.detail-content { padding: 20px 28px 28px; color: var(--body); white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-section { border-top: 8px solid var(--soft); }
.reply-heading { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px 10px; }
.reply-heading h3, .reply-form-heading h3 { font-size: 17px; }
.reply-heading span { color: var(--faint); font-size: 13px; }
.reply-list { padding: 0 28px 8px; }
.reply-item { padding: 17px 0; border-top: 1px solid var(--line); }
.reply-item:first-child { border-top: 0; }
.reply-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--faint); font-size: 12.5px; }
.reply-item-head strong { color: var(--ink); font-size: 14px; }
.reply-item p { margin-top: 8px; color: var(--body); white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-empty { padding: 18px 0 24px; color: var(--faint); font-size: 14px; }
.reply-form-section { border-top: 8px solid var(--soft); }
.reply-form-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 28px; }
.reply-form-toggle { min-height: 38px; padding: 8px 16px; box-shadow: none; }
.reply-form { padding-top: 20px; border-top: 1px solid var(--line); }
.reply-form .btn { justify-self: start; }
.noscript-message { padding: 16px; background: #fff2e8; color: #9a3d08; text-align: center; }

@media (max-width: 960px) {
  .community-heading .header-actions { display: none; }
  .community-layout { grid-template-columns: 1fr; gap: 20px; }
  .community-categories { display: none; }
  .mobile-category-select { display: block; }
}

@media (max-width: 640px) {
  .community-heading { padding: 104px 0 28px; }
  .community-heading h1 { font-size: 26px; }
  .community-section { padding: 26px 0 60px; }
  .community-toolbar-row { display: grid; gap: 12px; margin-bottom: 22px; }
  .community-toolbar .btn { padding-inline: 18px; }
  .community-toolbar-action { justify-self: start; }
  .community-result-head { align-items: center; }
  .community-result-head h2 { font-size: 18px; }
  .mobile-category-select select { max-width: 124px; }
  .community-post { grid-template-columns: 1fr; padding: 20px 0; }
  .community-post h3 { width: 100%; font-size: 17px; }
  .community-post-counts { grid-template-columns: repeat(2, 1fr); }
  .community-post-counts span { border-left: 0; border-top: 1px solid var(--line); text-align: left; }
  .community-post-counts strong { display: inline; margin-right: 4px; }
  .community-dialog {
    width: calc(100vw - 20px);
    max-width: none;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    margin: auto;
    border-width: 1px;
    border-radius: 8px;
  }
  .dialog-head { padding: 20px; }
  .dialog-head h2 { font-size: 18px; }
  .community-form { padding: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .detail-scroll {
    max-height: calc(100vh - 128px);
    max-height: calc(100dvh - 128px);
  }
  .detail-meta { padding: 18px 20px 0; }
  .detail-content { padding: 18px 20px 24px; }
  .reply-heading { padding: 20px 20px 8px; }
  .reply-list { padding-inline: 20px; }
  .reply-form-heading { padding-inline: 20px; }
}
