:root {
  --stx-community-ink: #172528;
  --stx-community-muted: #5b696c;
  --stx-community-line: #dce4e2;
  --stx-community-paper: #ffffff;
  --stx-community-soft: #f4f8f7;
  --stx-community-green: #147a63;
  --stx-community-green-dark: #0e5d4b;
  --stx-community-danger: #a33b36;
  --stx-community-warning: #9a6716;
  --stx-community-shadow: 0 16px 42px rgba(25, 51, 49, 0.09);
}

[data-stx-auth],
[data-stx-comments] {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--stx-community-ink);
}

.stx-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.72rem 1rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.stx-btn:hover {
  transform: translateY(-1px);
}

.stx-btn:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.stx-btn-primary {
  background: var(--stx-community-green);
  color: #fff;
}

.stx-btn-primary:hover {
  background: var(--stx-community-green-dark);
}

.stx-btn-quiet {
  background: transparent;
  border-color: var(--stx-community-line);
  color: var(--stx-community-ink);
}

.stx-btn-google {
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
  background: #fff;
  border-color: #cfd8d6;
  color: #263335;
  box-shadow: 0 4px 14px rgba(20, 48, 45, 0.08);
}

.stx-google-g {
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #f1f4f4;
  color: #315fbb;
  font-weight: 900;
}

.stx-community-auth {
  position: relative;
  max-width: 720px;
}

.stx-auth-member,
.stx-auth-identity,
.stx-auth-actions,
.stx-composer-user,
.stx-comment-author {
  display: flex;
  align-items: center;
}

.stx-auth-member {
  justify-content: space-between;
  gap: 0.8rem;
}

.stx-auth-identity,
.stx-composer-user,
.stx-comment-author {
  gap: 0.68rem;
}

.stx-auth-identity span:last-child,
.stx-comment-author span:last-child {
  display: grid;
  gap: 0.1rem;
}

.stx-auth-identity small,
.stx-comment-author small {
  color: var(--stx-community-muted);
  font-size: 0.72rem;
  text-transform: capitalize;
}

.stx-auth-actions {
  gap: 0.4rem;
}

.stx-community-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  overflow: hidden;
  border: 1px solid #d5dfdc;
  border-radius: 50%;
  background: #e7f0ed;
  color: var(--stx-community-green-dark);
  font-size: 0.75rem;
  font-weight: 900;
}

.stx-community-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stx-profile-editor {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.7fr);
  gap: 0.8rem;
  margin-top: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--stx-community-line);
  border-radius: 14px;
  background: var(--stx-community-paper);
  box-shadow: var(--stx-community-shadow);
}

.stx-profile-editor[hidden] {
  display: none;
}

.stx-profile-editor label {
  display: grid;
  gap: 0.35rem;
  color: var(--stx-community-muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.stx-profile-editor input,
.stx-profile-editor select,
.stx-comment-composer textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cfdad7;
  border-radius: 10px;
  background: #fff;
  color: var(--stx-community-ink);
  font: inherit;
}

.stx-profile-editor input,
.stx-profile-editor select {
  min-height: 2.65rem;
  padding: 0.65rem 0.75rem;
}

.stx-profile-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
}

.stx-comments-heading,
.stx-comment-login,
.stx-composer-footer,
.stx-comment header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

[data-stx-comments] {
  max-width: 860px;
  margin: 3rem auto;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--stx-community-line);
  border-radius: 20px;
  background: var(--stx-community-paper);
  box-shadow: var(--stx-community-shadow);
}

.stx-comments-heading {
  align-items: flex-end;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--stx-community-line);
}

.stx-community-eyebrow {
  margin: 0 0 0.35rem;
  color: var(--stx-community-green);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.stx-comments-heading h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  letter-spacing: -0.035em;
}

.stx-comments-heading p:not(.stx-community-eyebrow) {
  margin: 0.35rem 0 0;
  color: var(--stx-community-muted);
  line-height: 1.55;
}

.stx-comment-count {
  flex: 0 0 auto;
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  background: var(--stx-community-soft);
  color: var(--stx-community-muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.stx-comment-composer {
  margin: 1.15rem 0;
}

.stx-comment-login {
  padding: 1rem;
  border: 1px solid var(--stx-community-line);
  border-radius: 14px;
  background: var(--stx-community-soft);
}

.stx-comment-login p {
  margin: 0.25rem 0 0;
  color: var(--stx-community-muted);
  font-size: 0.84rem;
}

.stx-comment-composer form {
  padding: 1rem;
  border: 1px solid var(--stx-community-line);
  border-radius: 14px;
  background: var(--stx-community-soft);
}

.stx-composer-user {
  margin-bottom: 0.75rem;
  color: var(--stx-community-muted);
  font-size: 0.8rem;
}

.stx-comment-composer textarea {
  min-height: 7.5rem;
  resize: vertical;
  padding: 0.85rem;
  line-height: 1.55;
}

.stx-comment-composer textarea:focus,
.stx-profile-editor input:focus,
.stx-profile-editor select:focus {
  outline: 3px solid rgba(20, 122, 99, 0.13);
  border-color: var(--stx-community-green);
}

.stx-composer-footer {
  margin-top: 0.7rem;
}

.stx-composer-footer small {
  max-width: 460px;
  color: var(--stx-community-muted);
  line-height: 1.35;
}

.stx-comment-list {
  display: grid;
  gap: 0.8rem;
}

.stx-comment {
  padding: 1rem;
  border: 1px solid var(--stx-community-line);
  border-radius: 14px;
  background: #fff;
}

.stx-comment-author strong {
  font-size: 0.9rem;
}

.stx-comment-body {
  margin: 0.85rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.62;
}

.stx-status-badge {
  padding: 0.38rem 0.58rem;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 900;
}

.stx-status-pending {
  background: #fff1d8;
  color: var(--stx-community-warning);
}

.stx-status-hidden,
.stx-status-rejected {
  background: #f7e2e0;
  color: var(--stx-community-danger);
}

.stx-comments-empty {
  padding: 2rem 1rem;
  border: 1px dashed #c8d5d2;
  border-radius: 14px;
  text-align: center;
  color: var(--stx-community-muted);
}

.stx-comments-empty p {
  margin: 0.35rem 0 0;
}

.stx-inline-message {
  margin: 0.65rem 0;
  padding: 0.7rem 0.8rem;
  border-radius: 9px;
  background: var(--stx-community-soft);
  color: var(--stx-community-muted);
  font-size: 0.8rem;
}

.stx-inline-message[data-type="error"] {
  background: #f8e8e6;
  color: var(--stx-community-danger);
}

.stx-inline-message[data-type="success"] {
  background: #e7f4ef;
  color: var(--stx-community-green-dark);
}

.stx-setup-warning {
  padding: 0.75rem 0.9rem;
  border: 1px solid #efd6a6;
  border-radius: 10px;
  background: #fff7e6;
  color: #735015;
  font-size: 0.82rem;
}

.stx-setup-warning code {
  font-weight: 800;
}

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

.stx-moderation-shell {
  width: min(1050px, calc(100% - 2rem));
  margin: 2rem auto 4rem;
}

.stx-moderation-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.stx-moderation-card {
  padding: 1rem;
  border: 1px solid var(--stx-community-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(25, 51, 49, 0.06);
}

.stx-moderation-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.stx-moderation-card p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.stx-moderation-meta {
  color: var(--stx-community-muted);
  font-size: 0.75rem;
}

.stx-moderation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

@media (max-width: 680px) {
  .stx-comments-heading,
  .stx-comment-login,
  .stx-composer-footer,
  .stx-auth-member {
    align-items: stretch;
    flex-direction: column;
  }

  .stx-comment-count {
    align-self: flex-start;
  }

  .stx-profile-editor {
    grid-template-columns: 1fr;
  }

  .stx-auth-actions,
  .stx-profile-actions {
    flex-wrap: wrap;
  }
}
