/* PulseBot v21.9.4 — final cleanup for community modules.
   Fixes the module switch geometry and removes the remaining template-like styling. */

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) {
  --pbc94-blue: #3478e5;
  --pbc94-blue-hover: #3d82ef;
  --pbc94-blue-soft: rgba(52,120,229,.055);
  --pbc94-blue-line: rgba(52,120,229,.30);
  --pbc94-surface: #0e1218;
  --pbc94-surface-head: #10151c;
  --pbc94-input: #0a0e13;
  --pbc94-line: rgba(255,255,255,.072);
  --pbc94-line-strong: rgba(255,255,255,.12);
  --pbc94-text: #edf1f7;
  --pbc94-muted: #8e98a5;
}

/* Tighter page rhythm — no large empty bands. */
body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .module-headline {
  min-height: 78px !important;
  margin-bottom: 16px !important;
  padding: 14px 2px 18px !important;
  gap: 18px !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .module-heading-icon {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  border-color: var(--pbc94-line-strong) !important;
  border-radius: 9px !important;
  background: rgba(255,255,255,.025) !important;
  color: #a9c9ff !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .module-form {
  gap: 14px !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .module-panel-special {
  padding: 14px 16px !important;
  border-left-width: 2px !important;
  border-radius: 0 9px 9px 0 !important;
  background: rgba(255,255,255,.018) !important;
}

/* Flat, compact sections matching the established core modules. */
body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .module-form > .form-section,
body#pulsebot-app.dashboard-active-selfrole .selfrole-section {
  border-color: var(--pbc94-line) !important;
  border-radius: 12px !important;
  background: var(--pbc94-surface) !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .form-section-head {
  padding: 13px 16px !important;
  background: var(--pbc94-surface-head) !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .form-section-body {
  padding: 16px !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .field {
  margin-bottom: 12px !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea,.multi-picker-trigger) {
  border-radius: 8px !important;
  background: var(--pbc94-input) !important;
}

/* Complete switch reset. The old parent was 52x30 while the track was 42x24. */
body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .module-form > .form-section:first-of-type .form-section-body {
  padding: 10px 16px !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .switch-row {
  min-height: 48px !important;
  display: grid !important;
  grid-template-columns: minmax(0,1fr) auto !important;
  align-items: center !important;
  gap: 18px !important;
  padding: 0 !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .switch-copy {
  min-width: 0 !important;
  display: grid !important;
  gap: 3px !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .switch-copy strong {
  color: #cbd2dc !important;
  font-size: .78rem !important;
  font-weight: 550 !important;
  line-height: 1.3 !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .switch-copy span {
  margin: 0 !important;
  color: var(--pbc94-muted) !important;
  font-size: .69rem !important;
  line-height: 1.45 !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .switch-control {
  min-width: 118px !important;
  display: grid !important;
  grid-template-columns: 62px 44px !important;
  gap: 12px !important;
  align-items: center !important;
  justify-content: end !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .switch-state,
body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .module-panel.is-disabled .switch-state {
  min-width: 0 !important;
  width: 62px !important;
  display: block !important;
  color: var(--pbc94-muted) !important;
  font-size: .7rem !important;
  font-weight: 550 !important;
  line-height: 1 !important;
  text-align: right !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .module-panel.is-enabled .switch-state,
body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .switch-control:has(input:checked) .switch-state,
body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .switch-state.on {
  color: #82b0fb !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .toggle {
  position: relative !important;
  width: 44px !important;
  height: 24px !important;
  min-width: 44px !important;
  min-height: 24px !important;
  flex: 0 0 44px !important;
  display: block !important;
  margin: 0 !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .toggle input,
body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .toggle input[type="checkbox"] {
  position: absolute !important;
  inset: 0 !important;
  z-index: 2 !important;
  width: 44px !important;
  height: 24px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  appearance: none !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .toggle > .toggle-track,
body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .toggle > span {
  position: absolute !important;
  inset: 0 !important;
  width: 44px !important;
  height: 24px !important;
  min-width: 44px !important;
  min-height: 24px !important;
  display: block !important;
  border: 1px solid #38424d !important;
  border-radius: 999px !important;
  background: #20262e !important;
  background-image: none !important;
  box-shadow: none !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .toggle > .toggle-track::after,
body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .toggle > span::after {
  content: "" !important;
  position: absolute !important;
  top: 2px !important;
  left: 2px !important;
  width: 18px !important;
  height: 18px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #aeb7c4 !important;
  box-shadow: none !important;
  transform: none !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .toggle input:checked + .toggle-track,
body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .toggle input:checked + span {
  border-color: var(--pbc94-blue) !important;
  background: var(--pbc94-blue) !important;
  background-image: none !important;
  box-shadow: none !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .toggle input:checked + .toggle-track::after,
body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .toggle input:checked + span::after {
  background: #fff !important;
  transform: translateX(20px) !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .toggle input:hover + .toggle-track,
body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .toggle input:hover + span {
  border-color: #4a5664 !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .toggle input:focus-visible + .toggle-track,
body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) .toggle input:focus-visible + span {
  outline: 2px solid rgba(52,120,229,.44) !important;
  outline-offset: 3px !important;
}

/* Remove remaining stylized states and excessive decoration. */
body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) :is(.embed-builder-card,.embed-preview-card,.boost-preview-card,.message-rule-card,.selfrole-item,.notice-card) {
  border-color: var(--pbc94-line) !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,.015) !important;
  background-image: none !important;
  box-shadow: none !important;
}

body#pulsebot-app:is(
  .dashboard-active-welcome,
  .dashboard-active-goodbye,
  .dashboard-active-selfrole,
  .dashboard-active-boosts,
  .dashboard-active-suggestions
) :is(.btn,.variable-copy,.message-rule-card,.selfrole-item):hover {
  transform: none !important;
  box-shadow: none !important;
}

@media (max-width: 640px) {
  body#pulsebot-app:is(
    .dashboard-active-welcome,
    .dashboard-active-goodbye,
    .dashboard-active-selfrole,
    .dashboard-active-boosts,
    .dashboard-active-suggestions
  ) .switch-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  body#pulsebot-app:is(
    .dashboard-active-welcome,
    .dashboard-active-goodbye,
    .dashboard-active-selfrole,
    .dashboard-active-boosts,
    .dashboard-active-suggestions
  ) .switch-control {
    min-width: 0 !important;
    justify-content: start !important;
  }
}
