/*
 * Theater Radar 4.4.1 — theme-adaptive frontend surfaces.
 *
 * These rules intentionally avoid assuming a light or dark theme. Neutral
 * translucent surfaces blend with the theme behind them, while text and form
 * controls inherit the theme's foreground color.
 */

:where(
  .tr-profile-v44,
  .tr-community-settings-panel,
  .tr-member-table,
  .tr-mod-tabs,
  .tr-report-form,
  .ccr-profile-update-form,
  .ccr-public-profile
) {
  color: inherit;
}

/* Public employee profile/sidebar cards. */
.tr-profile-v44 .tr-profile-card,
.tr-profile-v44 .tr-profile-section {
  background: rgba(127, 127, 127, .075) !important;
  color: inherit !important;
  border-color: rgba(127, 127, 127, .32) !important;
  box-shadow: none;
}

.tr-profile-v44 .tr-profile-card h1,
.tr-profile-v44 .tr-profile-card h2,
.tr-profile-v44 .tr-profile-card h3,
.tr-profile-v44 .tr-profile-card p,
.tr-profile-v44 .tr-profile-card span,
.tr-profile-v44 .tr-profile-card strong,
.tr-profile-v44 .tr-profile-card small,
.tr-profile-v44 .tr-profile-section h1,
.tr-profile-v44 .tr-profile-section h2,
.tr-profile-v44 .tr-profile-section h3,
.tr-profile-v44 .tr-profile-section p,
.tr-profile-v44 .tr-profile-section span,
.tr-profile-v44 .tr-profile-section strong,
.tr-profile-v44 .tr-profile-section small {
  color: inherit;
}

.tr-profile-v44 .tr-profile-mini-stats > span,
.tr-profile-v44 .tr-profile-score > div,
.tr-profile-v44 .tr-profile-stats > div,
.tr-profile-v44 .tr-profile-gamification {
  background: rgba(127, 127, 127, .075) !important;
  color: inherit !important;
  border-color: rgba(127, 127, 127, .25) !important;
}

/* Community member list and moderation rows. */
.tr-member-table {
  background: rgba(127, 127, 127, .18) !important;
  border: 1px solid rgba(127, 127, 127, .24);
}

.tr-member-row {
  background: rgba(127, 127, 127, .065) !important;
  color: inherit !important;
}

.tr-member-row.tr-member-head {
  background: rgba(127, 127, 127, .12) !important;
}

.tr-member-row a,
.tr-member-row em,
.tr-member-row small,
.tr-member-row span,
.tr-mod-item,
.tr-mod-item a,
.tr-mod-item span,
.tr-mod-item small,
.tr-mod-log,
.tr-mod-log a,
.tr-mod-log span,
.tr-mod-log small {
  color: inherit;
}

/* Community settings + moderation forms. */
.tr-community-settings-panel input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.tr-community-settings-panel textarea,
.tr-community-settings-panel select,
.tr-member-row input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.tr-member-row textarea,
.tr-member-row select,
.tr-mod-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.tr-mod-form textarea,
.tr-mod-form select,
.tr-report-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.tr-report-form textarea,
.tr-report-form select {
  background: rgba(127, 127, 127, .065) !important;
  color: inherit !important;
  border-color: rgba(127, 127, 127, .38) !important;
  box-shadow: none;
}

.tr-community-settings-panel input::placeholder,
.tr-community-settings-panel textarea::placeholder,
.tr-member-row input::placeholder,
.tr-mod-form input::placeholder,
.tr-mod-form textarea::placeholder,
.tr-report-form input::placeholder,
.tr-report-form textarea::placeholder {
  color: currentColor;
  opacity: .58;
}

/* Keep native select menus readable even when a theme does not style options. */
.tr-community-settings-panel option,
.tr-member-row option,
.tr-mod-form option,
.tr-report-form option,
.ccr-profile-update-form option {
  background: Canvas;
  color: CanvasText;
}

.tr-report-form {
  background: rgba(127, 127, 127, .08) !important;
  color: inherit !important;
}

/* Existing member profile edit form. */
.ccr-profile-update-form.ccr-average-card,
.ccr-themed-form.ccr-profile-update-form {
  --ccr-form-card-bg: rgba(127, 127, 127, .065);
  --ccr-form-card-text: inherit;
  --ccr-form-card-border: rgba(127, 127, 127, .30);
  --ccr-form-input-bg: rgba(127, 127, 127, .065);
  --ccr-form-input-text: inherit;
  --ccr-form-input-border: rgba(127, 127, 127, .38);
  background: rgba(127, 127, 127, .065) !important;
  color: inherit !important;
  border-color: rgba(127, 127, 127, .30) !important;
}

.ccr-profile-update-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.ccr-profile-update-form textarea,
.ccr-profile-update-form select {
  background: rgba(127, 127, 127, .065) !important;
  color: inherit !important;
  border-color: rgba(127, 127, 127, .38) !important;
}

.ccr-profile-update-form input::placeholder,
.ccr-profile-update-form textarea::placeholder {
  color: currentColor;
  opacity: .58;
}

/* Legacy public profile card also follows the active theme. */
.ccr-public-profile__card {
  background: rgba(127, 127, 127, .065) !important;
  color: inherit !important;
  border-color: rgba(127, 127, 127, .30) !important;
}

/* Keyboard focus remains visible without forcing a light-theme focus style. */
.tr-community-settings-panel :is(input, textarea, select):focus,
.tr-member-row :is(input, textarea, select):focus,
.tr-mod-form :is(input, textarea, select):focus,
.tr-report-form :is(input, textarea, select):focus,
.ccr-profile-update-form :is(input, textarea, select):focus {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}
