/* =========================================================================
   B360 "New connection" wizard  (utils/connection_wizard.py)
   A parallel, self-contained modal. All classes are prefixed `b360-wiz`.
   Behaviour lives in assets/connection_wizard.js.
   ========================================================================= */

:root {
  --wiz-primary: #6D4AFF;
  --wiz-primary-ink: #5a37e6;
  --wiz-primary-soft: #f3f0ff;
  --wiz-ink: #14142b;
  --wiz-text: #2b2b3a;
  --wiz-muted: #6b7280;
  --wiz-faint: #9ca3af;
  --wiz-border: #e7e7ee;
  --wiz-line: #ececf2;
  --wiz-radius: 14px;
}

/* ── Overlay ─────────────────────────────────────────────────────────── */
.b360-wiz-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(24, 20, 46, 0.42);
  backdrop-filter: blur(3px);
  animation: b360WizFade 0.18s ease;
}
.b360-wiz-overlay.is-hidden { display: none; }

@keyframes b360WizFade { from { opacity: 0; } to { opacity: 1; } }

/* ── Card ────────────────────────────────────────────────────────────── */
.b360-wiz {
  position: relative;
  display: flex;
  width: min(1040px, 100%);
  height: min(820px, 94vh);
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(20, 16, 45, 0.35);
  font-family: inherit;
  color: var(--wiz-text);
}

/* ── Left rail ───────────────────────────────────────────────────────── */
.b360-wiz-aside {
  position: relative;
  flex: 0 0 320px;
  padding: 34px 30px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 60% at 0% 0%, #efe9ff 0%, rgba(239, 233, 255, 0) 60%),
    linear-gradient(180deg, #f7f5ff 0%, #ffffff 62%);
  border-right: 1px solid var(--wiz-line);
}
.b360-wiz-brand { font-size: 14px; color: var(--wiz-ink); margin-bottom: 26px; }
.b360-wiz-brand span { color: var(--wiz-muted); }
.b360-wiz-aside__title {
  font-size: 30px; font-weight: 700; line-height: 1.1;
  color: var(--wiz-ink); margin: 0 0 12px;
}
.b360-wiz-brand-accent { color: var(--wiz-primary); }
.b360-wiz-aside__sub { font-size: 13.5px; color: var(--wiz-muted); line-height: 1.5; margin: 0 0 30px; }

/* Stepper */
.b360-wiz-steps { display: flex; flex-direction: column; gap: 4px; }
.b360-wiz-step {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 8px 0;
}
/* Connecting line */
.b360-wiz-step::before {
  content: "";
  position: absolute;
  left: 13px; top: 34px; bottom: -6px;
  width: 2px;
  background: #e3e0ef;
}
.b360-wiz-step:last-child::before { display: none; }
.b360-wiz-step.is-done::before { background: var(--wiz-primary); }

.b360-wiz-step__marker {
  position: relative;
  flex: 0 0 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border: 2px solid #dcd8ea;
  color: var(--wiz-faint);
  font-size: 12.5px; font-weight: 700;
  z-index: 1;
}
.b360-wiz-step__check { display: none; font-size: 11px; }
.b360-wiz-step.is-active .b360-wiz-step__marker {
  background: var(--wiz-primary); border-color: var(--wiz-primary); color: #fff;
  box-shadow: 0 0 0 4px rgba(109, 74, 255, 0.15);
}
.b360-wiz-step.is-done .b360-wiz-step__marker {
  background: #fff; border-color: var(--wiz-primary); color: var(--wiz-primary);
}
.b360-wiz-step.is-done .b360-wiz-step__num { display: none; }
.b360-wiz-step.is-done .b360-wiz-step__check { display: inline; }

.b360-wiz-step__eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.7px;
  color: var(--wiz-faint); text-transform: uppercase;
}
.b360-wiz-step.is-active .b360-wiz-step__eyebrow { color: var(--wiz-primary); }
.b360-wiz-step__label { font-size: 14.5px; font-weight: 600; color: #40404f; margin-top: 1px; }
.b360-wiz-step.is-active .b360-wiz-step__label { color: var(--wiz-ink); }

/* Steps not part of the current flow (e.g. Configure + Tables for a
   files-only connection) render muted so the jump reads as "skipped". */
.b360-wiz-step.is-skipped { opacity: 0.4; }

/* Rail steps are clickable jump targets (both add and edit) at the connection
   level — but only steps already completed (.is-done) or the current one
   (.is-active). Upcoming steps and disabled sub-steps (Configure + Tables) are
   not interactive. Hover feedback only (no layout shift) so the connecting line
   + markers stay aligned. */
.b360-wiz-overlay.is-nav .b360-wiz-step.is-done,
.b360-wiz-overlay.is-nav .b360-wiz-step.is-active { cursor: pointer; }
.b360-wiz-overlay.is-nav .b360-wiz-step.is-done:hover .b360-wiz-step__label,
.b360-wiz-overlay.is-nav .b360-wiz-step.is-active:hover .b360-wiz-step__label { color: var(--wiz-primary); }
.b360-wiz-overlay.is-nav .b360-wiz-step.is-done:hover .b360-wiz-step__marker,
.b360-wiz-overlay.is-nav .b360-wiz-step.is-active:hover .b360-wiz-step__marker { border-color: var(--wiz-primary); }

.b360-wiz-aside__hint {
  margin-top: auto; padding-top: 22px;
  font-size: 12px; color: var(--wiz-faint);
}
.b360-wiz-aside__hint kbd {
  display: inline-block; padding: 1px 6px; margin: 0 1px;
  border: 1px solid #d9d5e8; border-bottom-width: 2px; border-radius: 5px;
  background: #fff; font-size: 11px; color: var(--wiz-muted); font-family: inherit;
}

/* ── Right column ────────────────────────────────────────────────────── */
.b360-wiz-main { position: relative; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.b360-wiz-close {
  position: absolute; top: 18px; right: 18px; z-index: 2;
  width: 32px; height: 32px; border: none; border-radius: 8px;
  background: transparent; color: var(--wiz-faint); cursor: pointer;
  font-size: 16px; transition: background 0.15s, color 0.15s;
}
.b360-wiz-close:hover { background: #f3f3f7; color: var(--wiz-text); }

.b360-wiz-body {
  flex: 1; overflow-y: auto;
  padding: 30px 54px 20px;
}

/* Panels — only the active one shows */
.b360-wiz-panel { display: none; animation: b360WizPanel 0.22s ease; }
.b360-wiz-panel.is-active { display: block; }
.b360-wiz-panel--center.is-active {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding-top: 30px;
}
@keyframes b360WizPanel { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Panel header */
.b360-wiz-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: var(--wiz-primary); text-transform: uppercase; margin-bottom: 10px;
}
.b360-wiz-title { font-size: 28px; font-weight: 700; color: var(--wiz-ink); margin: 0 0 8px; line-height: 1.15; }
.b360-wiz-title--center { margin-top: 8px; }
.b360-wiz-cfg-db { color: var(--wiz-ink); }
.b360-wiz-sub { font-size: 13.5px; color: var(--wiz-muted); line-height: 1.45; margin: 0; max-width: 640px; }
.b360-wiz-sub--center { margin: 0 auto; }
.b360-wiz-rule { border: none; border-top: 1px solid var(--wiz-line); margin: 14px 0 16px; }

/* Section labels */
.b360-wiz-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
  color: var(--wiz-faint); text-transform: uppercase; margin: 16px 0 10px;
}
.b360-wiz-section-label--row { display: flex; align-items: center; gap: 10px; }
.b360-wiz-cfg-db-inline { color: var(--wiz-ink); text-transform: none; letter-spacing: 0; font-size: 13px; }

/* ── Disclosure card ─────────────────────────────────────────────────── */
.b360-wiz-disclose {
  border: 1px solid var(--wiz-border); border-radius: var(--wiz-radius);
  background: #fbfbfd; margin-bottom: 16px; overflow: hidden;
}
.b360-wiz-disclose__summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px; font-weight: 600; color: var(--wiz-ink); font-size: 14px;
}
.b360-wiz-disclose__summary::-webkit-details-marker { display: none; }
.b360-wiz-disclose__title { display: inline-flex; align-items: center; gap: 10px; }
.b360-wiz-disclose__title i { color: var(--wiz-primary); }
.b360-wiz-disclose__chev { color: var(--wiz-faint); transition: transform 0.2s; font-size: 12px; }
.b360-wiz-disclose[open] .b360-wiz-disclose__chev { transform: rotate(180deg); }
.b360-wiz-disclose__body { padding: 0 16px 12px; }
.b360-wiz-disclose__body p { font-size: 13px; color: var(--wiz-muted); line-height: 1.45; margin: 0 0 6px; }
.b360-wiz-disclose__body p:last-child { margin-bottom: 0; }

/* ── Inputs ──────────────────────────────────────────────────────────── */
.b360-wiz-label { display: block; font-size: 13.5px; font-weight: 600; color: #33333f; margin: 0 0 6px; }
.b360-wiz-label__opt { color: var(--wiz-faint); font-weight: 500; }
.b360-wiz-req { color: #dc2626; font-weight: 700; }
.b360-wiz-input, .b360-wiz-textarea {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--wiz-border); border-radius: 10px;
  padding: 12px 14px; font-size: 14px; color: var(--wiz-text);
  background: #fff; font-family: inherit; transition: border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 14px;
}
.b360-wiz-textarea { min-height: 62px; resize: vertical; }
.b360-wiz-textarea--mono { min-height: 150px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; margin-bottom: 8px; }
.b360-wiz-hint { display: block; font-size: 12.5px; color: var(--wiz-faint); margin-bottom: 4px; }

/* Context step — section dividers */
.b360-wiz-adv-head { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; }
.b360-wiz-adv-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
  color: var(--wiz-faint); text-transform: uppercase; white-space: nowrap;
}
.b360-wiz-adv-line { flex: 1; height: 1px; background: var(--wiz-line); }
.b360-wiz-input:focus, .b360-wiz-textarea:focus {
  outline: none; border-color: var(--wiz-primary);
  box-shadow: 0 0 0 3px rgba(109, 74, 255, 0.14);
}
.b360-wiz-input::placeholder, .b360-wiz-textarea::placeholder { color: #b5b5c1; }
.b360-wiz-input.is-invalid { border-color: #dc2626; }
.b360-wiz-input.is-invalid:focus { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14); }
.b360-wiz-error {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: #dc2626; margin: -6px 0 12px;
}
/* Panel-level variant — backend test/save failures (testing + review) */
.b360-wiz-error--panel {
  margin: 14px 0 0; padding: 11px 14px; font-size: 13px;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px;
  align-items: flex-start; text-align: left; line-height: 1.45;
}
.b360-wiz-error--panel i { margin-top: 2px; }
/* Oversize / unreadable upload chip */
.b360-wiz-chip--error { background: #fef2f2; color: #b91c1c; }
.b360-wiz-chip--error .b360-wiz-chip__x { color: #b91c1c; }

.b360-wiz-field { margin-bottom: 0; }
.b360-wiz-field .b360-wiz-input { margin-bottom: 16px; }
.b360-wiz-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.b360-wiz-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }

/* Brand icon beside the "CONFIGURE <db>" label */
.b360-wiz-cfg-icon { display: inline-flex; align-items: center; }
.b360-wiz-cfg-icon img { width: 18px; height: 18px; object-fit: contain; }
.b360-wiz-cfg-icon i { font-size: 15px; color: #00a1e0; }

/* Salesforce per-user-auth note on the Configure step */
.b360-wiz-sf-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: #e8f4fd; border: 1px solid #b3d9f2; color: #1a4971;
  padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5;
}
.b360-wiz-sf-note i { color: #0070d2; margin-top: 2px; }
/* ECA install banner — shown above the SF environment select, parity with
   the legacy modal's "install the package first" hint. */
.b360-wiz-sf-eca {
  display: flex; gap: 10px; align-items: flex-start;
  background: #e8f4fd; border: 1px solid #b3d9f2; color: #1a4971;
  padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  margin-bottom: 16px;
}
.b360-wiz-sf-eca i { color: #0070d2; margin-top: 2px; }
.b360-wiz-sf-eca a { color: #0070d2; font-weight: 600; text-decoration: underline; }

/* ── Connection mode cards ───────────────────────────────────────────── */
.b360-wiz-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.b360-wiz-mode {
  border: 1.5px solid var(--wiz-border); border-radius: var(--wiz-radius);
  padding: 13px 14px; cursor: pointer; background: #fff;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.b360-wiz-mode:hover { border-color: #cdbcff; }
.b360-wiz-mode.is-selected {
  border-color: var(--wiz-primary); background: var(--wiz-primary-soft);
  box-shadow: 0 0 0 3px rgba(109, 74, 255, 0.1);
}
/* Locked once a database is attached (mode can't change mid-build). */
.b360-wiz-mode.is-disabled {
  opacity: 0.5; cursor: not-allowed; pointer-events: none;
  border-color: var(--wiz-border); background: #fafafc; box-shadow: none;
}
.b360-wiz-mode__top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.b360-wiz-mode__icon { color: var(--wiz-primary); font-size: 15px; }
.b360-wiz-mode__name { font-size: 15px; font-weight: 700; color: var(--wiz-ink); }
.b360-wiz-mode__desc { font-size: 12.5px; color: var(--wiz-muted); line-height: 1.5; margin: 0; }

.b360-wiz-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 3px 8px;
  border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.2px; white-space: nowrap;
}
.b360-wiz-badge--green { background: #e6f7ed; color: #17794a; }
.b360-wiz-badge--amber { background: #fdf1dc; color: #96660f; }
.b360-wiz-badge--purple { background: var(--wiz-primary); color: #fff; margin-left: 0; }

/* ── Network access note ─────────────────────────────────────────────── */
.b360-wiz-note {
  background: #f4f1ff; border: 1px solid #e4dcff; border-radius: var(--wiz-radius);
  padding: 15px 18px; margin-bottom: 8px;
}
.b360-wiz-note__head { display: flex; align-items: center; gap: 9px; font-weight: 700; color: #3a2f7a; font-size: 14px; margin-bottom: 8px; }
.b360-wiz-note__head i { color: var(--wiz-primary); }
.b360-wiz-note__body { font-size: 13px; color: #55507a; line-height: 1.55; padding-left: 26px; }
.b360-wiz-note__line { margin-bottom: 4px; }
.b360-wiz-ip {
  background: #fff; border: 1px solid #ddd4fb; border-radius: 5px;
  padding: 1px 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: #3a2f7a;
}
.b360-wiz-link { color: var(--wiz-primary); font-weight: 600; text-decoration: underline; }
.b360-wiz-note--inline { margin: 12px 0 4px; }

/* ── Connection option cards (screen between source pick and Configure) ── */
.b360-wiz-conn-opts { display: flex; flex-direction: column; gap: 10px; }
.b360-wiz-conn-opt {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px; border: 1.5px solid var(--wiz-border);
  border-radius: var(--wiz-radius); background: #fff; cursor: pointer;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.b360-wiz-conn-opt:hover:not(.is-disabled):not(.is-selected) { border-color: #c9bdff; }
.b360-wiz-conn-opt.is-selected {
  border-color: var(--wiz-primary); background: var(--wiz-primary-soft);
  box-shadow: 0 0 0 3px rgba(109, 74, 255, 0.12);
}
.b360-wiz-conn-opt.is-disabled { opacity: 0.55; cursor: not-allowed; background: #fafafc; }
.b360-wiz-conn-opt__icon {
  flex: 0 0 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--wiz-primary-soft); color: var(--wiz-primary); font-size: 16px;
}
.b360-wiz-conn-opt.is-disabled .b360-wiz-conn-opt__icon { background: #f0f0f4; color: #9ca3af; }
.b360-wiz-conn-opt.is-selected .b360-wiz-conn-opt__icon { background: var(--wiz-primary); color: #fff; }
.b360-wiz-conn-opt__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.b360-wiz-conn-opt__title {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-weight: 700; font-size: 14.5px; color: var(--wiz-ink);
}
.b360-wiz-conn-opt__desc { font-size: 12.5px; color: var(--wiz-faint); line-height: 1.45; }
.b360-wiz-conn-opt__rec {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase;
  color: #16a34a; background: #e7f7ee; border-radius: 6px; padding: 2px 7px;
}
.b360-wiz-conn-opt__soon {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase;
  color: var(--wiz-faint); background: #f0f0f4; border-radius: 6px; padding: 2px 7px;
}

/* ── Upload dropzone ─────────────────────────────────────────────────── */
.b360-wiz-drop {
  border: 1.5px dashed #d6d3e2; border-radius: var(--wiz-radius);
  background: #fafafc; padding: 26px; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.b360-wiz-drop:hover { border-color: var(--wiz-primary); background: var(--wiz-primary-soft); }
.b360-wiz-drop__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; background: #fff;
  border: 1px solid var(--wiz-border); color: var(--wiz-muted); margin-bottom: 10px;
}
.b360-wiz-drop__title { font-size: 14.5px; font-weight: 600; color: var(--wiz-ink); }
.b360-wiz-drop__hint { font-size: 12.5px; color: var(--wiz-faint); margin-top: 3px; }
.b360-wiz-file-hidden { display: none; }
.b360-wiz-upload-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.b360-wiz-upload-chips:empty { margin-top: 0; }

.b360-wiz-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #ecfdf5; color: #065f46; border-radius: 999px;
  padding: 4px 6px 4px 10px; font-size: 12px; font-weight: 600;
}
.b360-wiz-chip__x {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; color: #065f46; cursor: pointer;
  padding: 0 2px; margin-left: 1px; font-size: 11px; line-height: 1;
  opacity: 0.65; transition: opacity 0.12s;
}
.b360-wiz-chip__x:hover { opacity: 1; }

/* ── Search ──────────────────────────────────────────────────────────── */
.b360-wiz-search {
  display: flex; align-items: center; gap: 10px; margin-top: 18px;
  border: 1px solid var(--wiz-border); border-radius: 10px; padding: 0 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.b360-wiz-search:focus-within { border-color: var(--wiz-primary); box-shadow: 0 0 0 3px rgba(109, 74, 255, 0.14); }
.b360-wiz-search i { color: var(--wiz-faint); font-size: 14px; }
.b360-wiz-search__input { flex: 1; border: none; outline: none; padding: 12px 0; font-size: 14px; background: transparent; font-family: inherit; color: var(--wiz-text); }

/* ── Database grid ───────────────────────────────────────────────────── */
.b360-wiz-db-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px; margin-bottom: 8px;
}
.b360-wiz-db {
  position: relative; border: 1.5px solid var(--wiz-border); border-radius: var(--wiz-radius);
  background: #fff; padding: 18px 10px 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.b360-wiz-db:hover { border-color: #cdbcff; }
.b360-wiz-db.is-selected {
  border-color: var(--wiz-primary); background: var(--wiz-primary-soft);
  box-shadow: 0 0 0 3px rgba(109, 74, 255, 0.1);
}
.b360-wiz-db.is-hidden { display: none; }
/* Direct SQL already holds its single database → other types inert. */
.b360-wiz-db.is-disabled {
  opacity: 0.45; cursor: not-allowed; pointer-events: none;
  border-color: var(--wiz-border); background: #fafafc; box-shadow: none;
}
/* Type already attached → green check + tint; click to edit that source. */
.b360-wiz-db.is-attached { border-color: #9fdcbb; background: #f0faf4; }
.b360-wiz-db.is-attached:hover { border-color: #17794a; }
.b360-wiz-db.is-attached .b360-wiz-db__check { opacity: 1; color: #17794a; }
.b360-wiz-db__check { position: absolute; top: 8px; right: 8px; color: var(--wiz-primary); font-size: 15px; opacity: 0; transition: opacity 0.12s; }
.b360-wiz-db.is-selected .b360-wiz-db__check { opacity: 1; }
.b360-wiz-db__img { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; }
img.b360-wiz-db__img { display: block; object-fit: contain; }
.b360-wiz-db__img--placeholder { font-size: 26px; }
.b360-wiz-db__label { font-size: 12.5px; font-weight: 600; color: #3a3a48; text-align: center; line-height: 1.25; }

/* ── SSL toggle ──────────────────────────────────────────────────────── */
.b360-wiz-ssl { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 6px 0 4px; }
.b360-wiz-ssl__title { font-size: 14px; font-weight: 600; color: var(--wiz-ink); }
.b360-wiz-ssl__hint { font-size: 12.5px; color: var(--wiz-muted); margin-top: 2px; }
.b360-wiz-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; cursor: pointer; }
.b360-wiz-switch__cb { position: absolute; opacity: 0; width: 0; height: 0; }
.b360-wiz-switch__slider {
  position: absolute; inset: 0; border-radius: 999px; background: #d5d2e0;
  transition: background 0.18s;
}
.b360-wiz-switch__slider::before {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.18s;
}
.b360-wiz-switch.is-on .b360-wiz-switch__slider { background: var(--wiz-primary); }
.b360-wiz-switch.is-on .b360-wiz-switch__slider::before { transform: translateX(20px); }

/* ── Testing screen ──────────────────────────────────────────────────── */
.b360-wiz-spinner {
  width: 58px; height: 58px; border-radius: 50%;
  border: 4px solid #e9e5fb; border-top-color: #17794a;
  animation: b360WizSpin 0.9s linear infinite; margin-bottom: 22px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px;
}
.b360-wiz-spinner i { display: none; }
@keyframes b360WizSpin { to { transform: rotate(360deg); } }
/* All steps done → the ring fills like the row check marks (green disc + ✓);
   a failed test fills red with a ✗. Small pop for the state change. */
.b360-wiz-spinner.is-complete,
.b360-wiz-spinner.is-error {
  animation: b360WizPop 0.25s ease-out;
}
.b360-wiz-spinner.is-complete { background: #17794a; border-color: #17794a; }
.b360-wiz-spinner.is-error { background: #b91c1c; border-color: #b91c1c; }
.b360-wiz-spinner.is-complete i,
.b360-wiz-spinner.is-error i { display: inline; }
@keyframes b360WizPop {
  0% { transform: scale(0.82); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.b360-wiz-checklist {
  width: 100%; max-width: 640px; margin-top: 26px;
  background: #fafafc; border: 1px solid var(--wiz-line); border-radius: var(--wiz-radius);
  overflow: hidden; text-align: left;
}
.b360-wiz-check {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--wiz-line);
}
.b360-wiz-check:last-child { border-bottom: none; }
.b360-wiz-check__mark {
  flex: 0 0 20px; height: 20px; border-radius: 50%;
  border: 2px solid #d9d6e6; background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px;
}
.b360-wiz-check__mark i { display: none; }
.b360-wiz-check__label { flex: 1; font-size: 14px; font-weight: 500; color: var(--wiz-faint); }
.b360-wiz-check__meta { font-size: 12.5px; color: var(--wiz-faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.b360-wiz-check.is-active .b360-wiz-check__mark { border-color: var(--wiz-primary); }
.b360-wiz-check.is-active .b360-wiz-check__label { color: var(--wiz-ink); font-weight: 600; }
.b360-wiz-check.is-active .b360-wiz-check__meta { color: var(--wiz-primary); }
.b360-wiz-check.is-done .b360-wiz-check__mark { background: #17794a; border-color: #17794a; }
.b360-wiz-check.is-done .b360-wiz-check__mark i { display: inline; }
.b360-wiz-check.is-done .b360-wiz-check__label { color: var(--wiz-ink); }
.b360-wiz-check.is-done .b360-wiz-check__meta { color: #17794a; }
/* Real test failure — the row where the backend reported the error */
.b360-wiz-check.is-failed .b360-wiz-check__mark { background: #b91c1c; border-color: #b91c1c; }
.b360-wiz-check.is-failed .b360-wiz-check__mark i { display: inline; }
.b360-wiz-check.is-failed .b360-wiz-check__label { color: #b91c1c; font-weight: 600; }
.b360-wiz-check.is-failed .b360-wiz-check__meta { color: #b91c1c; }

/* ── Placeholder (steps 4/5) ─────────────────────────────────────────── */
.b360-wiz-soon {
  width: 60px; height: 60px; border-radius: 50%; background: var(--wiz-primary-soft);
  color: var(--wiz-primary); display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 18px;
}

/* ── Step 6 — Schedule refresh ───────────────────────────────────────── */
/* Daily / Weekly segmented control */
.b360-wiz-sched-seg { display: inline-flex; gap: 6px; margin-bottom: 4px; }
.b360-wiz-sched-seg__btn {
  border: 1.5px solid var(--wiz-border); background: #fff; color: var(--wiz-ink);
  border-radius: 10px; padding: 9px 20px; font-size: 13.5px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.b360-wiz-sched-seg__btn:hover { border-color: var(--wiz-primary); }
.b360-wiz-sched-seg__btn.is-on {
  background: var(--wiz-primary-soft); border-color: var(--wiz-primary); color: var(--wiz-primary-ink);
}

/* Weekly day toggles */
.b360-wiz-sched-days { display: flex; flex-wrap: wrap; gap: 8px; }
.b360-wiz-sched-day {
  border: 1.5px solid var(--wiz-border); background: #fff; color: var(--wiz-ink);
  border-radius: 9px; width: 44px; height: 40px; font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.b360-wiz-sched-day:hover { border-color: var(--wiz-primary); }
.b360-wiz-sched-day.is-on {
  background: var(--wiz-primary); border-color: var(--wiz-primary); color: #fff;
}

/* Time + timezone row */
.b360-wiz-sched-grid {
  display: grid; grid-template-columns: minmax(150px, 200px) minmax(200px, 1fr);
  gap: 18px; align-items: start;
}
.b360-wiz-sched-time, .b360-wiz-sched-tz {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1.5px solid var(--wiz-border); border-radius: 12px; background: #fff;
  font-size: 13.5px; font-family: inherit; color: var(--wiz-ink); outline: none;
}
.b360-wiz-sched-time:focus, .b360-wiz-sched-tz:focus {
  border-color: var(--wiz-primary); box-shadow: 0 0 0 3px rgba(109, 74, 255, 0.14);
}
.b360-wiz-sched-tz { cursor: pointer; appearance: auto; }

/* Plain-language recap */
.b360-wiz-sched-summary {
  margin-top: 18px; font-size: 13.5px; font-weight: 600; color: var(--wiz-ink);
  min-height: 18px;
}
.b360-wiz-sched-summary::before {
  content: "\f017"; font-family: "Font Awesome 6 Free"; font-weight: 900;
  color: var(--wiz-primary); margin-right: 8px;
}

/* "Skip for now" / "Remove schedule" action row */
.b360-wiz-sched-actions { display: flex; align-items: center; gap: 18px; margin-top: 22px; }
.b360-wiz-sched-skip {
  border: none; background: none; color: var(--wiz-faint);
  font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
  padding: 6px 2px; transition: color 0.12s;
}
.b360-wiz-sched-skip:hover { color: var(--wiz-primary); }
/* "Remove schedule" — destructive ghost, shown only when editing a
   connection that already has a schedule (toggled in connection_wizard.js). */
.b360-wiz-sched-remove {
  align-items: center; border: none; background: none; color: #dc2626;
  font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
  padding: 6px 2px; transition: color 0.12s;
}
.b360-wiz-sched-remove:hover { color: #b91c1c; text-decoration: underline; }

/* ── Review & save ───────────────────────────────────────────────────── */
.b360-wiz-rev-card { border: 1px solid var(--wiz-line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.b360-wiz-rev-card__head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; background: #fafafc; border-bottom: 1px solid var(--wiz-line);
}
.b360-wiz-rev-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--wiz-primary-soft); color: var(--wiz-primary);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.b360-wiz-rev-title { font-weight: 700; color: var(--wiz-ink); font-size: 14.5px; }
.b360-wiz-rev-edit { margin-left: auto; color: var(--wiz-primary); font-weight: 600; font-size: 13px; cursor: pointer; }
.b360-wiz-rev-edit:hover { text-decoration: underline; }
.b360-wiz-rev-card__body { padding: 14px 16px; }
.b360-wiz-rev-row { display: flex; gap: 16px; padding: 4px 0; font-size: 14px; }
.b360-wiz-rev-row .k { flex: 0 0 110px; color: var(--wiz-muted); }
.b360-wiz-rev-row .v { color: var(--wiz-ink); }
/* Each attached database in Review — stacked, separated when several. */
.b360-wiz-rev-srcblock { padding: 6px 0; }
.b360-wiz-rev-srcblock + .b360-wiz-rev-srcblock {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--wiz-line);
}
.b360-wiz-rev-src { display: flex; align-items: center; gap: 12px; }
.b360-wiz-rev-src img { width: 30px; height: 30px; object-fit: contain; flex: 0 0 auto; }
.b360-wiz-rev-src i { font-size: 22px; }
.b360-wiz-rev-src__text { flex: 1; min-width: 0; }
.b360-wiz-rev-src__name { font-size: 15px; font-weight: 700; color: var(--wiz-ink); }
.b360-wiz-rev-src__sub { font-size: 12.5px; color: var(--wiz-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin-top: 1px; }
.b360-wiz-rev-src__x {
  flex: 0 0 auto; border: none; background: none; color: var(--wiz-muted);
  cursor: pointer; font-size: 15px; padding: 6px 8px; border-radius: 7px;
  opacity: 0.75; transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.b360-wiz-rev-src__x:hover { opacity: 1; color: #b91c1c; background: #fef2f2; }
.b360-wiz-rev-pill {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  background: #e6f7ed; color: #17794a; border-radius: 8px;
  padding: 9px 12px; font-size: 13px; font-weight: 500;
}
.b360-wiz-rev-chip {
  display: inline-flex; align-items: center; gap: 5px; background: #eef0f4; color: #3a3a48;
  border-radius: 6px; padding: 3px 5px 3px 9px; font-size: 12px; font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0 4px 4px 0;
}
.b360-wiz-rev-chip__x {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; color: #6b7280; cursor: pointer;
  padding: 0 2px; font-size: 11px; line-height: 1;
  opacity: 0.7; transition: opacity 0.12s, color 0.12s;
}
.b360-wiz-rev-chip__x:hover { opacity: 1; color: #b91c1c; }
.b360-wiz-rev-more { font-size: 12.5px; color: var(--wiz-faint); }
.b360-wiz-rev-ctx {
  white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; color: var(--wiz-text); line-height: 1.5; margin: 0;
}
/* Labelled subsections inside a review card (Context / External policy). */
.b360-wiz-rev-sublabel {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--wiz-muted); margin-bottom: 7px;
}
.b360-wiz-rev-sublabel--spaced {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--wiz-line);
}
.b360-wiz-rev-empty { font-size: 13px; color: var(--wiz-faint); }
.b360-wiz-rev-chips { display: flex; flex-wrap: wrap; margin-top: 10px; }
/* Muted variant of the status pill for the "policy disabled" state. */
.b360-wiz-rev-pill--off { background: #f1f1f4; color: #6b7280; }
.b360-wiz-rev-pill i { flex: 0 0 auto; }

/* ── Success overlay ─────────────────────────────────────────────────── */
.b360-wiz-success {
  position: absolute; inset: 0; z-index: 6; background: #ffffff; border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.b360-wiz-success.is-hidden { display: none; }
.b360-wiz-success__check {
  width: 66px; height: 66px; border-radius: 50%; background: #1f9d4d; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 27px; margin-bottom: 22px;
}
.b360-wiz-success__title { font-size: 30px; font-weight: 700; color: var(--wiz-ink); margin: 0 0 8px; }
.b360-wiz-success__sub { font-size: 14px; color: var(--wiz-muted); margin: 0; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.b360-wiz-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 30px; border-top: 1px solid var(--wiz-line); background: #fff;
}
.b360-wiz-foot__count { font-size: 13px; color: var(--wiz-faint); }
.b360-wiz-foot__actions { display: flex; gap: 10px; }
.b360-wiz-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; font-family: inherit;
  transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.b360-wiz-btn--ghost { background: #fff; border-color: var(--wiz-border); color: var(--wiz-text); }
.b360-wiz-btn--ghost:hover:not(:disabled) { background: #f6f6fa; }
.b360-wiz-btn--primary { background: var(--wiz-primary); color: #fff; box-shadow: 0 4px 12px rgba(109, 74, 255, 0.3); }
.b360-wiz-btn--primary:hover:not(:disabled) { background: var(--wiz-primary-ink); }
.b360-wiz-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* ── Opener button on the connections page ───────────────────────────── */
.b360-wiz-open-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--wiz-primary); color: #fff; border: none;
  border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.b360-wiz-open-btn:hover { background: var(--wiz-primary-ink); }

/* ── Step 4 — Choose tables ──────────────────────────────────────────── */
.b360-wiz-tbl-label {
  font-size: 14px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 4px;
}
.b360-wiz-tbl-label__main { font-weight: 700; color: var(--wiz-ink); }

/* Add all / Clear bulk controls, pushed to the right of the label row */
.b360-wiz-tbl-bulk { margin-left: auto; display: flex; gap: 6px; }
.b360-wiz-tbl-bulk__btn {
  border: 1px solid var(--wiz-border); background: #fff; color: var(--wiz-primary-ink, #4c2fd6);
  border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: background 0.12s, border-color 0.12s, opacity 0.12s;
}
.b360-wiz-tbl-bulk__btn:hover:not(:disabled) { background: var(--wiz-primary-soft); border-color: var(--wiz-primary); }
.b360-wiz-tbl-bulk__btn:disabled { opacity: 0.45; cursor: default; }

/* "+N more" summary row in the menu and the chips box (full-width so it
   drops to its own line inside the flex-wrap chipbox) */
.b360-wiz-tbl-menu__more {
  flex-basis: 100%; width: 100%;
  padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--wiz-faint);
  border-top: 1px solid var(--wiz-line); margin-top: 4px;
}

/* Search box (own row); the dropdown menu anchors to it */
.b360-wiz-tbl-picker {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 46px;
  border: 1.5px solid var(--wiz-border); border-radius: 12px; background: #fff;
  cursor: text; margin-bottom: 12px;
}
.b360-wiz-tbl-picker:focus-within {
  border-color: var(--wiz-primary);
  box-shadow: 0 0 0 3px rgba(109, 74, 255, 0.14);
}
.b360-wiz-tbl-picker__icon { color: #b5b5c1; font-size: 13px; }
.b360-wiz-tbl-search {
  flex: 1; border: none; outline: none;
  font-size: 13.5px; font-family: inherit; color: var(--wiz-ink);
  background: transparent; padding: 4px 0;
}
.b360-wiz-tbl-search::placeholder { color: #b5b5c1; }

/* Selected-table chips in their own box below the search */
.b360-wiz-tbl-chipbox {
  display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start;
  min-height: 58px; padding: 12px;
  border: 1.5px solid var(--wiz-border); border-radius: 12px; background: #fff;
  margin-bottom: 26px;
  transition: border-color 0.15s, background 0.15s;
}
/* How-to line under the chips, pulled up tight against the chip box. */
.b360-wiz-tbl-colhint {
  display: flex; align-items: flex-start; gap: 8px;
  margin: -18px 0 22px; padding: 10px 12px;
  border: 1px solid var(--wiz-line); border-radius: 10px;
  background: var(--wiz-primary-soft, #f5f2ff);
  font-size: 12.5px; line-height: 1.5; color: var(--wiz-faint, #55566a);
}
.b360-wiz-tbl-colhint > i { color: var(--wiz-primary, #6d4aff); margin-top: 2px; }
.b360-wiz-tbl-colhint span i {
  color: var(--wiz-primary, #6d4aff); font-size: 11.5px;
  padding: 0 2px; vertical-align: baseline;
}
.b360-wiz-tbl-chipbox.is-dragover {
  border-color: var(--wiz-primary); border-style: dashed;
  background: var(--wiz-primary-soft);
}

/* Purple chip — used in the picker AND the Selected Tables panel */
.b360-wiz-tbl-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #ece9fe; color: var(--wiz-primary-ink, #4c2fd6);
  border: 1px solid #dcd5fb; border-radius: 8px;
  padding: 5px 7px 5px 11px; font-size: 12.5px; font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: grab; user-select: none;
}
.b360-wiz-tbl-chip__x {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; color: inherit; cursor: pointer;
  padding: 0 2px; font-size: 11px; line-height: 1;
  opacity: 0.6; transition: opacity 0.12s;
}
.b360-wiz-tbl-chip__x:hover { opacity: 1; }
/* Chip "Columns" button — opens the Visible/Anonymise picker for that table. */
.b360-wiz-tbl-chip__cols {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; color: inherit; cursor: pointer;
  padding: 0 3px; font-size: 11px; line-height: 1; position: relative;
  opacity: 0.55; transition: opacity 0.12s;
}
.b360-wiz-tbl-chip__cols:hover,
.b360-wiz-tbl-chip__cols.is-active { opacity: 1; }
/* A dot marks a table whose columns the admin has customised. */
.b360-wiz-tbl-chip__cols.is-customised::after {
  content: ""; position: absolute; top: -1px; right: -1px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--wiz-primary); border: 1px solid #ece9fe;
}

/* ── Per-table column controls (Visible / Anonymise) ──────────────────── */
.b360-wiz-col-panel {
  border: 1.5px solid var(--wiz-border); border-radius: 12px; background: #fff;
  margin: -14px 0 26px; overflow: hidden;
}
.b360-wiz-col-panel__bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--wiz-line);
  background: #faf9ff;
}
.b360-wiz-col-panel__title {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--wiz-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px;
}
.b360-wiz-col-panel__title i { color: var(--wiz-primary); }
.b360-wiz-col-search-wrap {
  flex: 1; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--wiz-border); border-radius: 8px;
  padding: 6px 10px; background: #fff; max-width: 360px;
}
.b360-wiz-col-search-wrap i { color: var(--wiz-faint); font-size: 12px; }
.b360-wiz-col-search {
  flex: 1; border: none; outline: none; background: none;
  font-size: 13px; color: var(--wiz-ink); font-family: inherit;
}
.b360-wiz-col-close {
  border: none; background: none; color: var(--wiz-faint); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 2px 4px; transition: color 0.12s;
}
.b360-wiz-col-close:hover { color: var(--wiz-ink); }
.b360-wiz-col-body { max-height: 340px; overflow-y: auto; }
/* Grid: name column takes the slack, two fixed checkbox columns. */
.b360-wiz-col-head, .b360-wiz-col-row {
  display: grid; grid-template-columns: 1fr 96px 96px; align-items: center;
  padding: 7px 14px;
}
.b360-wiz-col-head {
  position: sticky; top: 0; background: #fff; z-index: 1;
  border-bottom: 1px solid var(--wiz-line);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--wiz-faint); font-weight: 700;
}
.b360-wiz-col-row { border-bottom: 1px solid #f4f4f8; }
.b360-wiz-col-row:last-child { border-bottom: none; }
.b360-wiz-col-name {
  font-size: 13px; color: var(--wiz-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-right: 10px;
}
.b360-wiz-col-head__name { color: var(--wiz-faint); font-family: inherit; }
.b360-wiz-col-cell {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  cursor: pointer; user-select: none;
}
.b360-wiz-col-head__lbl { font-size: 11px; }
.b360-wiz-col-cell input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--wiz-primary); cursor: pointer;
}
.b360-wiz-col-cell input[type="checkbox"]:disabled { cursor: not-allowed; opacity: 0.4; }
.b360-wiz-col-foot {
  padding: 8px 14px; border-top: 1px solid var(--wiz-line);
  font-size: 12px; color: var(--wiz-faint); background: #fafafd;
}
.b360-wiz-col-foot.is-warn { color: #b45309; background: #fffbeb; }
.b360-wiz-col-foot.is-warn i { margin-right: 5px; }
.b360-wiz-col-note {
  padding: 18px 14px; font-size: 13px; color: var(--wiz-faint); text-align: center;
}
.b360-wiz-col-note.is-error { color: #b91c1c; }
.b360-wiz-col-note.is-loading { color: var(--wiz-primary); }
.b360-wiz-col-retry {
  margin-left: 6px; border: 1px solid var(--wiz-border); border-radius: 6px;
  background: #fff; color: var(--wiz-primary); font-size: 12px;
  padding: 2px 10px; cursor: pointer;
}
/* Sheet picker for an uploaded workbook: the column panel with one tick column. */
.b360-wiz-sheet-panel { margin: 10px 0 0; }
.b360-wiz-sheet-panel .b360-wiz-col-row { grid-template-columns: 1fr 96px; }
.b360-wiz-sheet-panel .b360-wiz-col-close { margin-left: auto; }
.b360-wiz-sheet-panel .b360-wiz-col-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* Dropdown of not-yet-selected tables */
.b360-wiz-tbl-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: #fff; border: 1px solid var(--wiz-line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(23, 15, 60, 0.14);
  max-height: 220px; overflow-y: auto; padding: 6px;
}
.b360-wiz-tbl-menu__item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--wiz-ink);
}
.b360-wiz-tbl-menu__item i { font-size: 11px; color: var(--wiz-primary); opacity: 0.7; }
.b360-wiz-tbl-menu__item:hover { background: var(--wiz-primary-soft); }
/* Already-selected rows in the search menu: green check + a right-aligned
   "Remove" hint that turns red on hover, so trimming reads as destructive. */
.b360-wiz-tbl-menu__item.is-selected i { color: #16a34a; opacity: 0.9; }
.b360-wiz-tbl-menu__item.is-selected:hover { background: #fdecec; }
.b360-wiz-tbl-menu__hint {
  margin-left: auto; font-size: 11px; font-weight: 600; color: var(--wiz-faint);
  font-family: inherit;
}
.b360-wiz-tbl-menu__item.is-selected:hover .b360-wiz-tbl-menu__hint { color: #dc2626; }
.b360-wiz-tbl-menu__empty { padding: 10px 12px; font-size: 12.5px; color: var(--wiz-faint); }

/* Side-by-side All / Selected panels */
.b360-wiz-tbl-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.b360-wiz-tbl-col__title { font-size: 14px; font-weight: 700; color: var(--wiz-ink); margin-bottom: 10px; }
.b360-wiz-tbl-box {
  display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start;
  min-height: 180px; max-height: 260px; overflow-y: auto;
  border: 1.5px solid var(--wiz-border); border-radius: 12px;
  padding: 12px; background: #fff;
  transition: border-color 0.15s, background 0.15s;
}
.b360-wiz-tbl-box.is-dragover {
  border-color: var(--wiz-primary); border-style: dashed;
  background: var(--wiz-primary-soft);
}

/* Gray pill in the All Tables panel; purple-tinted once picked */
.b360-wiz-tbl-pill {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  background: #eceaf1; color: var(--wiz-ink);
  border: 1px solid transparent; border-radius: 8px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: pointer; user-select: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.b360-wiz-tbl-pill:hover { background: #e2dff0; }
.b360-wiz-tbl-pill.is-picked {
  background: #f4f1ff; color: var(--wiz-primary-ink, #4c2fd6);
  border-color: #dcd5fb;
}
.b360-wiz-tbl-pill.is-picked i { font-size: 10px; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .b360-wiz { flex-direction: column; height: 94vh; }
  .b360-wiz-aside { flex-basis: auto; border-right: none; border-bottom: 1px solid var(--wiz-line); }
  .b360-wiz-steps { flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .b360-wiz-step::before { display: none; }
  .b360-wiz-aside__hint { display: none; }
  .b360-wiz-body { padding: 30px 24px 20px; }
  .b360-wiz-tbl-cols { grid-template-columns: 1fr; }
}

/* ── Step 4 — Salesforce AI object advisor ───────────────────────────── */
.b360-wiz-sf-suggest {
  margin-top: 16px; padding: 14px 16px;
  border: 1px solid var(--wiz-border, #e3e3ec); border-radius: 12px;
  background: var(--wiz-primary-soft, #f3f0ff);
}
.b360-wiz-sf-suggest__intro {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--wiz-faint, #55566a); margin-bottom: 10px;
}
.b360-wiz-sf-suggest__intro i { color: var(--wiz-primary, #6d4aff); margin-top: 2px; }
.b360-wiz-sf-suggest__input {
  width: 100%; min-height: 66px; resize: vertical; margin-bottom: 10px;
}
.b360-wiz-sf-suggest__btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: 8px; padding: 8px 14px;
  background: var(--wiz-primary, #6d4aff); color: #fff;
  font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background 0.12s, opacity 0.12s;
}
.b360-wiz-sf-suggest__btn:hover:not(:disabled) { background: var(--wiz-primary-ink, #4c2fd6); }
.b360-wiz-sf-suggest__btn:disabled { opacity: 0.55; cursor: default; }
/* Suggest button + model picker sit on one row. `stretch` makes the picker
   take its height from the row — i.e. from the button — so the two match
   exactly without hard-coding a height that would drift if the button's
   padding ever changes. */
.b360-wiz-sf-suggest__controls {
  display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap;
}
.b360-wiz-sf-suggest__model {
  /* Override .b360-wiz-input: it is full-width with its own bottom margin,
     which is what made the picker stretch across the modal. */
  width: auto; flex: 0 0 auto; max-width: 320px;
  margin: 0; padding: 0 12px;
  font-size: 13px; border-radius: 8px;
}
.b360-wiz-sf-suggest__out {
  margin-top: 12px; padding: 4px 14px;
  background: #fff; border: 1px solid var(--wiz-line, #ececf3); border-radius: 10px;
  font-size: 13px; line-height: 1.5; color: var(--wiz-ink, #23233a);
  max-height: 340px; overflow-y: auto;
}
.b360-wiz-sf-suggest__out.is-loading { color: var(--wiz-faint, #55566a); font-style: italic; }
.b360-wiz-sf-suggest__out.is-error { color: #b91c1c; border-color: #f3c9c9; background: #fef4f4; }
.b360-wiz-sf-suggest__out h4, .b360-wiz-sf-suggest__out h5, .b360-wiz-sf-suggest__out h6 {
  margin: 12px 0 6px; font-size: 13px; font-weight: 700; color: var(--wiz-ink, #23233a);
}
.b360-wiz-sf-suggest__out p { margin: 6px 0; }
.b360-wiz-sf-suggest__out ul { margin: 6px 0; padding-left: 20px; }
.b360-wiz-sf-suggest__out li { margin: 3px 0; }
.b360-wiz-sf-suggest__out code {
  background: var(--wiz-primary-soft, #f3f0ff); color: var(--wiz-primary-ink, #4c2fd6);
  padding: 1px 5px; border-radius: 5px; font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.b360-wiz-sf-suggest__out blockquote {
  margin: 8px 0; padding: 4px 12px; border-left: 3px solid var(--wiz-border, #e3e3ec);
  color: var(--wiz-faint, #55566a);
}

/* ── Step 5 — External data policy ───────────────────────────────────── */
.b360-wiz-extpol { margin-bottom: 18px; }
.b360-wiz-extpol__desc {
  font-size: 13px; line-height: 1.5; color: var(--wiz-faint, #55566a);
  margin: 0 0 10px;
}
.b360-wiz-extpol__toggle { display: block; margin-bottom: 10px; }
.b360-wiz-extpol__cb label { display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--wiz-ink, #23233a); cursor: pointer; }
.b360-wiz-extpol__cb input[type="checkbox"] { margin-top: 2px; cursor: pointer; }
.b360-wiz-extpol__sites-wrap { margin-top: 8px; }
.b360-wiz-extpol__sites { width: 100%; min-height: 96px; resize: vertical; }
