/* Community Hub v9.7.3 — shared action contrast harmonization.
   Loaded after all existing theme and feature styles, for web, mobile web and Android WebView.
   Avoid broad `button` overrides so icon-only and custom toolbar controls retain their design. */

/* Default light appearance: subtle neutral secondary actions, high-contrast labels. */
:root {
  --hcm973-secondary-bg: #edf4ef;
  --hcm973-secondary-border: #adc6b8;
  --hcm973-secondary-text: #173d30;
  --hcm973-primary-bg: #176b52;
  --hcm973-primary-border: #176b52;
  --hcm973-primary-text: #ffffff;
  --hcm973-danger-bg: #fff0ed;
  --hcm973-danger-border: #d59b91;
  --hcm973-danger-text: #8d302c;
}
/* Explicit user preference. */
html[data-theme="dark"] {
  --hcm973-secondary-bg: #203a30;
  --hcm973-secondary-border: #456a57;
  --hcm973-secondary-text: #e8f6ed;
  --hcm973-primary-bg: #23775c;
  --hcm973-primary-border: #3f9977;
  --hcm973-primary-text: #ffffff;
  --hcm973-danger-bg: #412b2a;
  --hcm973-danger-border: #89534d;
  --hcm973-danger-text: #ffd3cb;
}
/* Follow device theme if member selects System. */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]),
  html[data-theme="system"] {
    --hcm973-secondary-bg: #203a30;
    --hcm973-secondary-border: #456a57;
    --hcm973-secondary-text: #e8f6ed;
    --hcm973-primary-bg: #23775c;
    --hcm973-primary-border: #3f9977;
    --hcm973-primary-text: #ffffff;
    --hcm973-danger-bg: #412b2a;
    --hcm973-danger-border: #89534d;
    --hcm973-danger-text: #ffd3cb;
  }
}

/* Standard action controls across content pages and modal forms. */
:where(.content, .authform, [role="dialog"])
:is(button.small, a.smallbtn, button.smallbtn, .smallbtn, button:not([class])[type="submit"]) {
  background: var(--hcm973-secondary-bg) !important;
  color: var(--hcm973-secondary-text) !important;
  border: 1px solid var(--hcm973-secondary-border) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  -webkit-text-fill-color: currentColor;
}
:where(.content, .authform, [role="dialog"])
:is(.primary, .linkbtn, button[type="submit"].primary, a.primary) {
  background: var(--hcm973-primary-bg) !important;
  color: var(--hcm973-primary-text) !important;
  border-color: var(--hcm973-primary-border) !important;
  -webkit-text-fill-color: currentColor;
  text-shadow: none !important;
}
/* In-app alerts: destructive action remains distinct without a white button. */
.hcm972-community-actions form:has(button[name="action"][value="leave_group"]) button,
.hcm972-community-actions form:has(input[name="action"][value="leave_group"]) button {
  background:var(--hcm973-danger-bg) !important;
  color:var(--hcm973-danger-text) !important;
  border:1px solid var(--hcm973-danger-border) !important;
}
/* Other destructive controls with explicit semantic classes. */
:where(.content, [role="dialog"]) :is(.danger,.btn-danger,button.destructive,a.destructive) {
  background:var(--hcm973-danger-bg) !important;
  color:var(--hcm973-danger-text) !important;
  border:1px solid var(--hcm973-danger-border) !important;
}
/* Give group owner controls a consistent silhouette. */
.hcm972-community-actions :is(.small,.smallbtn){
  display:inline-flex;align-items:center;justify-content:center;
  min-height:38px;padding:8px 14px;border-radius:9px;
  font-weight:750;text-decoration:none;
}
:where(.content, .authform, [role="dialog"]) :is(button.small,a.smallbtn,button.smallbtn,.primary,.linkbtn):focus-visible{
  outline:2px solid #61bd91 !important;
  outline-offset:3px;
}
:where(.content, .authform, [role="dialog"]) :is(button.small,a.smallbtn,button.smallbtn,.primary,.linkbtn):disabled{
  opacity:.55;cursor:not-allowed;
}
