/* ---------- Layout: one centered column ---------- */
#subPrefs {
  margin: 40px 0 !important;
}

#subPrefs > div > div {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

/* Every preference row (overrides the inline flex centering) */
#subPrefs > div > div > div[style] {
  display: block !important;
  margin-bottom: 20px;
}

/* Same as above, but finds rows by content in case nesting differs */
#subPrefs div:has(> .form-check),
#subPrefs div:has(> fieldset) {
  display: block !important;
  margin-bottom: 20px;
}

/* ---------- Checkbox rows ---------- */
#subPrefs .form-check-inline {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

#subPrefs .form-check .row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
}

#subPrefs .form-check .row > [class*="col"] {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  padding: 0;
}

#subPrefs .form-check .row > .col {
  flex: 1 1 auto;
  min-width: 0;
}

#subPrefs .form-check .row label {
  margin: 0;
  line-height: 1.4;
  cursor: pointer;
}

/* Keep a required asterisk on the same line as the label text */
#subPrefs .form-check .row label > div {
  display: inline;
}

/* ---------- Inputs ---------- */
#subPrefs input[type="checkbox"],
#subPrefs input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex-shrink: 0;
  position: static;
  cursor: pointer;
}

/* ---------- Question fieldsets ---------- */
#subPrefs fieldset {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

#subPrefs legend.col-form-label {
  width: 100%;
  padding: 0;
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
}

/* Radio options: wrap neatly side by side on desktop */
#subPrefs fieldset .form-check-inline {
  display: inline-flex;
  width: auto;
  margin: 0 24px 8px 0;
  vertical-align: top;
}

#subPrefs fieldset .form-check-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  line-height: 1.4;
  cursor: pointer;
}

/* ---------- Mobile: stack radio options ---------- */
@media (max-width: 576px) {
  #subPrefs > div > div {
    padding: 0 12px;
  }

  #subPrefs fieldset .form-check-inline {
    display: flex;
    width: 100%;
    margin: 0 0 10px;
  }
}