/* =====================================================
   Church brand editor (Settings → Appearance)
   Theme variables only — this panel has to stay legible in every theme,
   including a half-finished brand the admin is mid-way through building.
   ===================================================== */

.be-body { display: flex; flex-direction: column; gap: var(--sp-6); padding: var(--sp-2) 0 var(--sp-4); }
.be-body.is-off { opacity: .55; }
.be-body.is-off .be-sec:not(:first-child) { pointer-events: none; }

.be-off-note {
  margin: 0; padding: var(--sp-3) var(--sp-4);
  border: 1px dashed var(--line-strong); border-radius: var(--r-2);
  background: var(--surface-2); color: var(--text-2);
  font-size: 12.5px; line-height: 1.5;
}

.be-sec { display: flex; flex-direction: column; gap: var(--sp-3); }
.be-sec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.be-h { margin: 0; font: 600 13px/1.3 var(--font-sans); color: var(--text); }
.be-sub { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-3); max-width: 62ch; }
.be-sub strong { color: var(--text-2); }

.be-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-3); }

.be-fld { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.be-fld > span { font-size: 12px; color: var(--text-2); }
.be-fld select {
  width: 100%; padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line); border-radius: var(--r-1);
  background: var(--surface-2); color: var(--text);
  font: 400 13px/1.3 var(--font-sans);
}
.be-fld select:focus { outline: none; border-color: var(--accent-ring); }

.be-seg { flex: 0 0 auto; }

/* ── Derive-from-one-colour ────────────────────────── */
.be-derive { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.be-derive input[type="color"] {
  width: 52px; height: 36px; padding: 2px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-1);
  background: var(--surface-2);
}

/* ── Token grid ────────────────────────────────────── */
.be-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.be-group-h {
  font: 700 10px/1.6 var(--font-sans); text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3);
}
.be-tokens { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-2); }

.be-token {
  display: grid; grid-template-columns: 36px 1fr 22px; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2); border: 1px solid var(--line); border-radius: var(--r-2);
  background: var(--surface-2);
}
.be-token.is-set { border-color: var(--accent-ring); }
.be-token.is-inherited { opacity: .78; }

.be-token input[type="color"] {
  width: 36px; height: 28px; padding: 2px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-1);
  background: var(--surface);
}
.be-token-txt { min-width: 0; display: flex; flex-direction: column; }
.be-token-name {
  font: 500 12.5px/1.3 var(--font-sans); color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.be-token-hint {
  font: 400 10.5px/1.4 var(--font-mono); color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.be-token-clear {
  width: 22px; height: 22px; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-1);
  background: transparent; color: var(--text-3);
  font: 400 14px/1 var(--font-sans);
}
.be-token-clear:hover { color: var(--text); border-color: var(--line-strong); }

/* ── Logo ──────────────────────────────────────────── */
.be-logo { display: flex; align-items: center; gap: var(--sp-3); }
.be-logo-prev {
  width: 96px; height: 48px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r-2);
  background: var(--surface-2); overflow: hidden;
}
.be-logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.be-logo-prev.is-empty { border-style: dashed; color: var(--text-3); font-size: 11px; }
.be-logo-btns { display: flex; flex-direction: column; gap: var(--sp-2); }

/* ── Contrast warnings ─────────────────────────────── */
.be-warn {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--warn); border-radius: var(--r-2);
  background: var(--warn-soft); color: var(--text-2);
  font-size: 12.5px; line-height: 1.55;
}
.be-warn strong { display: block; color: var(--text); margin-bottom: var(--sp-1); }
.be-warn ul { margin: 0; padding-left: var(--sp-5); }
.be-warn b { color: var(--warn); }
.be-warn-note { display: block; margin-top: var(--sp-2); color: var(--text-3); font-size: 11.5px; }

/* ── Footer ────────────────────────────────────────── */
.be-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2);
  padding-top: var(--sp-4); margin-top: var(--sp-2);
  border-top: 1px solid var(--line);
}
.be-status { margin-right: auto; font-size: 12px; color: var(--warn); }
