/* ==========================================================================
   CF7 Cost Calculator — Formula Builder
   Everything is scoped to .cf7cc-fb so WP admin styles don't leak in/out.
   ========================================================================== */

.cf7cc-fb {
  --cc-bg: #f4f6fb;
  --cc-surface: #ffffff;
  --cc-surface-2: #f7f9fd;
  --cc-border: #e3e8f1;
  --cc-border-strong: #d3dbea;
  --cc-text: #0f1d3a;
  --cc-muted: #56657f;
  --cc-subtle: #8593aa;
  --cc-primary: #2463eb;
  --cc-primary-600: #1b52cf;
  --cc-primary-soft: #ebf2ff;
  --cc-primary-softer: #f4f8ff;
  --cc-ring: 0 0 0 3px rgba(36, 99, 235, 0.18);
  --cc-success: #0f9d58;
  --cc-success-soft: #eaf8f0;
  --cc-success-border: #c7ecd7;
  --cc-danger: #d92d20;
  --cc-danger-soft: #fef0ef;
  --cc-amber: #f4a51c;
  --cc-radius: 12px;
  --cc-radius-sm: 8px;
  --cc-shadow: 0 1px 2px rgba(16, 29, 58, 0.04), 0 4px 16px rgba(16, 29, 58, 0.04);
  --cc-shadow-pop: 0 12px 32px rgba(16, 29, 58, 0.14), 0 2px 6px rgba(16, 29, 58, 0.08);
  --cc-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  container-type: inline-size;
  color: var(--cc-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  font-size: 14px;
  line-height: 1.45;
  background: var(--cc-bg);
  border-radius: 16px;
  padding: 16px;
  margin: 8px 0 0;
  -webkit-font-smoothing: antialiased;
}

.cf7cc-fb *,
.cf7cc-fb *::before,
.cf7cc-fb *::after {
  box-sizing: border-box;
}

.cf7cc-fb h2,
.cf7cc-fb h3,
.cf7cc-fb h4,
.cf7cc-fb p {
  margin: 0;
  padding: 0;
  color: inherit;
}

.cf7cc-fb .cf7cc-icon {
  flex: none;
  display: block;
}

.cf7cc-fb code {
  font-family: var(--cc-mono);
  background: none;
  padding: 0;
  margin: 0;
  font-size: 0.92em;
}

.cf7cc-fb .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.cf7cc-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 268px;
  gap: 16px;
  align-items: start;
}

.cf7cc-side,
.cf7cc-main,
.cf7cc-fields {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: 16px;
  box-shadow: var(--cc-shadow);
}

.cf7cc-main {
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.cf7cc-fb .cf7cc-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--cc-radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--cc-text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.cf7cc-fb .cf7cc-btn:active:not(:disabled) {
  transform: translateY(1px);
}
.cf7cc-fb .cf7cc-btn:focus-visible {
  outline: none;
  box-shadow: var(--cc-ring);
}
.cf7cc-fb .cf7cc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.cf7cc-fb .cf7cc-btn.is-sm {
  height: 34px;
  padding: 0 13px;
  font-size: 13px;
}
.cf7cc-fb .cf7cc-btn.is-block {
  width: 100%;
}
.cf7cc-fb .cf7cc-btn.is-primary {
  background: var(--cc-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(36, 99, 235, 0.3);
}
.cf7cc-fb .cf7cc-btn.is-primary:hover:not(:disabled) {
  background: var(--cc-primary-600);
  color: #fff;
}
.cf7cc-fb .cf7cc-btn.is-outline {
  background: var(--cc-surface);
  border-color: var(--cc-border-strong);
  color: var(--cc-text);
}
.cf7cc-fb .cf7cc-btn.is-outline:hover:not(:disabled) {
  border-color: var(--cc-primary);
  color: var(--cc-primary);
  background: var(--cc-primary-softer);
}
.cf7cc-fb .cf7cc-btn.is-ghost {
  color: var(--cc-muted);
  padding: 0 10px;
}
.cf7cc-fb .cf7cc-btn.is-ghost:hover:not(:disabled) {
  background: var(--cc-surface-2);
  color: var(--cc-text);
}
.cf7cc-fb .cf7cc-btn.is-link {
  color: var(--cc-primary);
  padding: 0 4px;
  height: 28px;
}
.cf7cc-fb .cf7cc-btn.is-link:hover:not(:disabled) {
  color: var(--cc-primary-600);
}

/* Pills ------------------------------------------------------------------ */
.cf7cc-fb .cf7cc-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--cc-primary-soft);
  color: var(--cc-primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
}
.cf7cc-fb .cf7cc-pill.is-soft {
  height: 24px;
  padding: 0 11px;
  font-weight: 500;
  font-size: 13px;
  vertical-align: 3px;
  margin-left: 6px;
}

.cf7cc-fb .cf7cc-crown {
  color: var(--cc-amber);
}

/* --------------------------------------------------------------------------
   Left sidebar
   -------------------------------------------------------------------------- */

.cf7cc-side {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 46px;
}

.cf7cc-fb .cf7cc-nav {
  list-style: none;
  margin: 0;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--cc-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cf7cc-fb .cf7cc-nav li {
  margin: 0;
}
.cf7cc-fb .cf7cc-nav button {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #33415c;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.cf7cc-fb .cf7cc-nav button .cf7cc-icon {
  color: #6b7a94;
}
.cf7cc-fb .cf7cc-nav button:hover {
  background: var(--cc-surface-2);
  color: var(--cc-text);
}
.cf7cc-fb .cf7cc-nav button:focus-visible {
  outline: none;
  box-shadow: var(--cc-ring);
}
.cf7cc-fb .cf7cc-nav button.is-active {
  background: var(--cc-primary-soft);
  color: var(--cc-primary);
  font-weight: 600;
}
.cf7cc-fb .cf7cc-nav button.is-active .cf7cc-icon {
  color: var(--cc-primary);
}
.cf7cc-fb .cf7cc-nav .cf7cc-nav-lock {
  margin-left: auto;
  color: var(--cc-subtle) !important;
}

.cf7cc-side-pro-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  padding: 0 6px;
}
.cf7cc-side-pro-head .cf7cc-pill {
  margin-left: auto;
}
.cf7cc-fb .cf7cc-side-pro ul {
  list-style: none;
  margin: 14px 0 0;
  padding: 0 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cf7cc-fb .cf7cc-side-pro li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--cc-subtle);
  font-size: 13.5px;
}
.cf7cc-fb .cf7cc-side-pro li .cf7cc-icon {
  color: #a7b2c5;
}

.cf7cc-upgrade {
  margin-top: 8px;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--cc-border);
  background: linear-gradient(180deg, #f6f9ff 0%, #f1f5fd 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cf7cc-fb .cf7cc-upgrade h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--cc-primary-600);
  margin-top: 4px;
}
.cf7cc-fb .cf7cc-upgrade p {
  color: var(--cc-muted);
  font-size: 13.5px;
  line-height: 1.6;
  margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   Header & target bar
   -------------------------------------------------------------------------- */

.cf7cc-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 4px;
}
.cf7cc-logo {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(160deg, #3b7bff 0%, #2463eb 100%);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 6px 16px rgba(36, 99, 235, 0.28);
}
.cf7cc-header-text {
  flex: 1;
  min-width: 0;
}
.cf7cc-fb .cf7cc-header h2 {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 2px;
}
.cf7cc-fb .cf7cc-header p {
  margin-top: 8px;
  color: var(--cc-muted);
  font-size: 14.5px;
}
.cf7cc-fb .cf7cc-howto {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cc-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  padding: 8px 4px;
  white-space: nowrap;
}
.cf7cc-fb .cf7cc-howto:hover {
  color: var(--cc-primary-600);
  text-decoration: underline;
}

.cf7cc-target {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 10px 12px 10px 16px;
  border-radius: var(--cc-radius);
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
}
.cf7cc-fb .cf7cc-target > label {
  font-weight: 600;
  font-size: 13.5px;
}
.cf7cc-target-empty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cc-muted);
}
.cf7cc-save {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cf7cc-save-state {
  font-size: 12.5px;
  color: var(--cc-subtle);
}
.cf7cc-save-state.is-dirty {
  color: #b7791f;
}
.cf7cc-save-state.is-saved {
  color: var(--cc-success);
}
.cf7cc-save-state.is-error {
  color: var(--cc-danger);
}

.cf7cc-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--cc-radius-sm);
  background: #fff8eb;
  border: 1px solid #fbe3b3;
  color: #7a5212;
  font-size: 13px;
}
.cf7cc-fb .cf7cc-note a {
  color: inherit;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.cf7cc-card {
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  padding: 18px;
  background: var(--cc-surface);
  transition: box-shadow 0.3s, border-color 0.3s;
}
.cf7cc-card.is-tight {
  padding: 16px 16px 14px;
}
.cf7cc-card.is-flash {
  border-color: var(--cc-primary);
  box-shadow: var(--cc-ring);
}
.cf7cc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.cf7cc-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cf7cc-fb .cf7cc-step-title {
  font-size: 15.5px;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.cf7cc-fb .cf7cc-step-title em {
  font-style: normal;
  font-weight: 400;
  color: var(--cc-muted);
  font-size: 14px;
}
.cf7cc-fb .cf7cc-card-title {
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cf7cc-help {
  color: var(--cc-subtle);
  font-size: 13px;
}
.cf7cc-inline-error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px !important;
  color: var(--cc-danger);
  font-size: 13px;
}

/* Templates -------------------------------------------------------------- */
.cf7cc-templates {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.cf7cc-fb .cf7cc-template {
  appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 124px;
  padding: 18px 16px 16px;
  border: 1px solid var(--cc-border);
  border-radius: 10px;
  background: var(--cc-surface);
  color: var(--cc-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.cf7cc-fb .cf7cc-template:hover {
  border-color: #b9cdf8;
  box-shadow: 0 4px 14px rgba(36, 99, 235, 0.08);
  transform: translateY(-1px);
}
.cf7cc-fb .cf7cc-template:focus-visible {
  outline: none;
  box-shadow: var(--cc-ring);
}
.cf7cc-fb .cf7cc-template.is-selected {
  border-color: var(--cc-primary);
  background: var(--cc-primary-softer);
  box-shadow: 0 0 0 1px var(--cc-primary) inset;
}
.cf7cc-template-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--cc-primary-soft);
  color: var(--cc-primary);
  margin-bottom: 10px;
}
.cf7cc-fb .cf7cc-template strong {
  font-size: 14px;
  font-weight: 600;
}
.cf7cc-fb .cf7cc-template small {
  font-size: 12.5px;
  color: var(--cc-subtle);
}
.cf7cc-fb .cf7cc-template .cf7cc-pill {
  position: absolute;
  top: 12px;
  right: 12px;
}
.cf7cc-fb .cf7cc-template.is-pro .cf7cc-template-icon {
  background: #fff4dc;
  color: #c47f07;
}

/* --------------------------------------------------------------------------
   Builder canvas & tokens
   -------------------------------------------------------------------------- */

.cf7cc-builder {
  border: 1px solid var(--cc-border);
  border-radius: 10px;
  padding: 16px;
  background: var(--cc-surface);
}
.cf7cc-canvas {
  position: relative;
  min-height: 74px;
  padding: 8px;
  margin: -8px -8px 0;
  border-radius: 10px;
  border: 1.5px dashed transparent;
  transition: border-color 0.15s, background-color 0.15s;
}
.cf7cc-canvas.is-empty {
  border-color: var(--cc-border-strong);
  background: var(--cc-surface-2);
  display: grid;
  place-items: center;
}
.cf7cc-canvas.is-drop {
  border-color: var(--cc-primary);
  background: var(--cc-primary-softer);
}
.cf7cc-canvas-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cc-subtle);
  font-size: 13.5px;
  pointer-events: none;
  text-align: center;
}
.cf7cc-canvas.is-empty .cf7cc-tokens {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cf7cc-tokens {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
}
.cf7cc-token-slot {
  position: relative;
  display: flex;
}
.cf7cc-token-slot.is-dragging {
  opacity: 0.35;
}
.cf7cc-token-slot.drop-before::before,
.cf7cc-token-slot.drop-after::after {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 3px;
  background: var(--cc-primary);
}
.cf7cc-token-slot.drop-before::before {
  left: -9px;
}
.cf7cc-token-slot.drop-after::after {
  right: -9px;
}

.cf7cc-token {
  position: relative;
  display: flex;
  cursor: grab;
}
.cf7cc-token:active {
  cursor: grabbing;
}

.cf7cc-fb .cf7cc-token-field,
.cf7cc-fb .cf7cc-token-op,
.cf7cc-fb .cf7cc-token-paren,
.cf7cc-fb .cf7cc-token-fn,
.cf7cc-fb .cf7cc-token-number {
  appearance: none;
  display: inline-flex;
  align-items: center;
  height: 50px;
  border: 1px solid var(--cc-border-strong);
  border-radius: 8px;
  background: var(--cc-surface);
  color: var(--cc-text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 29, 58, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.cf7cc-fb .cf7cc-token-field {
  gap: 12px;
  padding: 0 14px 0 10px;
  min-width: 190px;
}
.cf7cc-fb .cf7cc-token-field:hover,
.cf7cc-fb .cf7cc-token-op:hover,
.cf7cc-fb .cf7cc-token-paren:hover,
.cf7cc-fb .cf7cc-token-fn:hover,
.cf7cc-fb .cf7cc-token-number:hover {
  border-color: #a9c0f2;
}
.cf7cc-fb .cf7cc-token-field:focus-visible,
.cf7cc-fb .cf7cc-token-op:focus-visible,
.cf7cc-fb .cf7cc-token-paren:focus-visible,
.cf7cc-fb .cf7cc-token-fn:focus-visible,
.cf7cc-fb .cf7cc-token-number:focus-within,
.cf7cc-fb .cf7cc-token-field[aria-expanded='true'],
.cf7cc-fb .cf7cc-token-op[aria-expanded='true'] {
  outline: none;
  border-color: var(--cc-primary);
  box-shadow: var(--cc-ring);
}
.cf7cc-token-label {
  flex: 1;
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.cf7cc-fb .cf7cc-chev {
  color: var(--cc-muted);
  margin-left: 6px;
}
.cf7cc-fb .cf7cc-token-op {
  width: 38px;
  height: 42px;
  justify-content: center;
  margin: 4px 0;
}
.cf7cc-fb .cf7cc-token-paren {
  width: 30px;
  justify-content: center;
  font-family: var(--cc-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--cc-primary);
  background: var(--cc-primary-softer);
  border-color: #cfdcf8;
}
.cf7cc-fb .cf7cc-token-fn {
  padding: 0 12px;
  gap: 2px;
  font-family: var(--cc-mono);
  font-weight: 600;
  color: #6d3fd1;
  background: #f5f0ff;
  border-color: #ddd0fa;
}
.cf7cc-fb .cf7cc-token-fn span {
  font-size: 18px;
  font-weight: 500;
}
.cf7cc-fb .cf7cc-token-number {
  padding: 0 4px;
  cursor: text;
}
.cf7cc-fb .cf7cc-token-number input {
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  min-height: 0;
  height: 40px;
  padding: 0 8px;
  margin: 0;
  font: inherit;
  font-family: var(--cc-mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--cc-text);
  text-align: center;
  min-width: 44px;
}

.cf7cc-token.has-error .cf7cc-token-field,
.cf7cc-token.has-error .cf7cc-token-op,
.cf7cc-token.has-error .cf7cc-token-paren,
.cf7cc-token.has-error .cf7cc-token-fn,
.cf7cc-token.has-error .cf7cc-token-number {
  border-color: #f3a39d;
  background: var(--cc-danger-soft);
}

.cf7cc-fb .cf7cc-token-remove {
  appearance: none;
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--cc-border-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--cc-muted);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.12s, transform 0.12s, background-color 0.12s, color 0.12s;
  z-index: 2;
}
.cf7cc-token:hover .cf7cc-token-remove,
.cf7cc-token:focus-within .cf7cc-token-remove {
  opacity: 1;
  transform: scale(1);
}
.cf7cc-fb .cf7cc-token-remove:hover,
.cf7cc-fb .cf7cc-token-remove:focus-visible {
  background: var(--cc-danger);
  border-color: var(--cc-danger);
  color: #fff;
  outline: none;
}

/* Field icon tile (shared) */
.cf7cc-ficon {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--cc-primary-soft);
  color: var(--cc-primary);
}
.cf7cc-ficon.is-sm {
  width: 26px;
  height: 26px;
}
.cf7cc-ficon.is-danger {
  background: #fde3e1;
  color: var(--cc-danger);
}

.cf7cc-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* Token animations */
.cf7cc-tok-enter-active,
.cf7cc-tok-leave-active {
  transition: opacity 0.18s, transform 0.18s;
}
.cf7cc-tok-enter-from,
.cf7cc-tok-leave-to {
  opacity: 0;
  transform: scale(0.92);
}
.cf7cc-tok-leave-active {
  position: absolute;
}
.cf7cc-tok-move {
  transition: transform 0.2s;
}

/* Text mode */
.cf7cc-fb .cf7cc-label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
}
.cf7cc-fb textarea.cf7cc-code {
  width: 100%;
  min-height: 84px;
  padding: 12px 14px;
  border: 1px solid var(--cc-border-strong);
  border-radius: 8px;
  background: var(--cc-surface-2);
  color: var(--cc-text);
  font-family: var(--cc-mono);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  box-shadow: none;
}
.cf7cc-fb textarea.cf7cc-code:focus {
  outline: none;
  border-color: var(--cc-primary);
  box-shadow: var(--cc-ring);
  background: #fff;
}
.cf7cc-textmode .cf7cc-help {
  margin-top: 8px;
}
.cf7cc-textmode .cf7cc-help code {
  color: var(--cc-text);
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
  border-radius: 4px;
  padding: 1px 5px;
}

/* --------------------------------------------------------------------------
   Popover menus
   -------------------------------------------------------------------------- */

.cf7cc-pop {
  position: relative;
  display: inline-flex;
}
.cf7cc-menu {
  position: absolute;
  top: calc(100% + 6px);
  z-index: 100;
  padding: 6px;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--cc-border);
  border-radius: 10px;
  box-shadow: var(--cc-shadow-pop);
}
.cf7cc-menu.is-left {
  left: 0;
}
.cf7cc-menu.is-right {
  right: 0;
}
.cf7cc-fb .cf7cc-menu-item {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--cc-text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.cf7cc-fb .cf7cc-menu-item:hover,
.cf7cc-fb .cf7cc-menu-item:focus-visible {
  background: var(--cc-surface-2);
  outline: none;
}
.cf7cc-fb .cf7cc-menu-item.is-active {
  background: var(--cc-primary-softer);
}
.cf7cc-menu-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cf7cc-menu-text strong {
  font-weight: 500;
}
.cf7cc-menu-text small {
  color: var(--cc-subtle);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cf7cc-fb .cf7cc-menu-check {
  color: var(--cc-primary);
}
.cf7cc-op-glyph {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
  font-weight: 600;
  font-size: 15px;
  color: var(--cc-text);
}
.cf7cc-op-glyph.is-num {
  font-size: 11px;
  font-family: var(--cc-mono);
}
.cf7cc-op-glyph.is-fn {
  color: #6d3fd1;
  background: #f5f0ff;
  border-color: #e4d9fb;
  font-style: italic;
}
.cf7cc-menu-sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--cc-border);
}
.cf7cc-menu-note {
  padding: 6px 10px 4px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cc-subtle);
}
.cf7cc-menu-empty {
  padding: 10px;
  color: var(--cc-subtle);
  font-size: 13px;
}
.cf7cc-menu-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  margin-bottom: 6px;
  border: 1px solid var(--cc-border);
  border-radius: 7px;
  color: var(--cc-subtle);
}
.cf7cc-fb .cf7cc-menu-search input {
  flex: 1;
  border: 0;
  box-shadow: none;
  outline: 0;
  background: transparent;
  height: 34px;
  min-height: 0;
  padding: 0;
  font: inherit;
  font-size: 13px;
}

.cf7cc-fade-enter-active,
.cf7cc-fade-leave-active {
  transition: opacity 0.14s, transform 0.14s;
}
.cf7cc-fade-enter-from,
.cf7cc-fade-leave-to {
  opacity: 0;
  transform: translateY(-4px);
}

/* --------------------------------------------------------------------------
   Formula preview
   -------------------------------------------------------------------------- */

.cf7cc-code-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 6px 8px 6px 16px;
  border-radius: 8px;
  background: #f1f5fc;
  border: 1px solid #e6ecf6;
}
.cf7cc-code-row.has-error {
  background: var(--cc-danger-soft);
  border-color: #f7cfcb;
}
.cf7cc-code-row code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  color: #33415c;
  font-size: 13.5px;
  letter-spacing: 0.02em;
}
.cf7cc-code-row code.is-placeholder {
  color: var(--cc-subtle);
  font-family: inherit;
}

/* --------------------------------------------------------------------------
   Live preview
   -------------------------------------------------------------------------- */

.cf7cc-card.is-live {
  background: linear-gradient(180deg, #fbfdfb 0%, #f7fbf8 100%);
}
.cf7cc-card.is-live.is-ok {
  border-color: var(--cc-success-border);
}
.cf7cc-status-dot {
  display: grid;
  place-items: center;
}
.cf7cc-status-dot.is-ok {
  color: var(--cc-success);
}
.cf7cc-status-dot.is-wait {
  color: var(--cc-subtle);
}
.cf7cc-live {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 22px;
}
.cf7cc-live-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 22px 2px 16px;
  border-right: 1px solid var(--cc-border);
}
.cf7cc-live-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.65fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.cf7cc-fb .cf7cc-live-row label {
  font-size: 13.5px;
  color: #26334d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cf7cc-input {
  position: relative;
  display: flex;
  align-items: center;
}
.cf7cc-fb .cf7cc-input input,
.cf7cc-fb .cf7cc-select select {
  width: 100%;
  height: 34px;
  min-height: 0;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--cc-border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--cc-text);
  font: inherit;
  font-size: 13.5px;
  box-shadow: none;
  line-height: normal;
}
.cf7cc-fb .cf7cc-input.has-prefix input {
  padding-left: 24px;
}
.cf7cc-prefix {
  position: absolute;
  left: 10px;
  color: var(--cc-muted);
  font-size: 13.5px;
  pointer-events: none;
}
.cf7cc-fb .cf7cc-input input:focus,
.cf7cc-fb .cf7cc-select select:focus {
  outline: none;
  border-color: var(--cc-primary);
  box-shadow: var(--cc-ring);
}
.cf7cc-select {
  position: relative;
  display: flex;
  align-items: center;
}
.cf7cc-fb .cf7cc-select select {
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
  padding-right: 32px;
  cursor: pointer;
  max-width: none;
}
.cf7cc-select > .cf7cc-icon:last-child {
  position: absolute;
  right: 10px;
  color: var(--cc-muted);
  pointer-events: none;
}
.cf7cc-select.is-target {
  min-width: 240px;
}
.cf7cc-fb .cf7cc-select.is-target select {
  height: 36px;
  padding-left: 34px;
  font-weight: 500;
}
.cf7cc-select-lead {
  position: absolute;
  left: 11px;
  color: var(--cc-primary);
  pointer-events: none;
}

.cf7cc-live-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--cc-border);
}
.cf7cc-result-label {
  font-weight: 600;
  font-size: 13.5px;
}
.cf7cc-result {
  font-size: 38px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cc-success);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.cf7cc-result.is-empty {
  color: #c2cad8;
}
.cf7cc-result-target {
  color: var(--cc-subtle);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   Banner
   -------------------------------------------------------------------------- */

.cf7cc-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--cc-radius);
  border: 1px solid #dfe8fb;
  background: var(--cc-primary-softer);
}
.cf7cc-banner > div {
  flex: 1;
  min-width: 0;
}
.cf7cc-banner-icon {
  color: var(--cc-primary);
}
.cf7cc-fb .cf7cc-banner strong {
  display: block;
  font-size: 13.5px;
  color: var(--cc-primary-600);
}
.cf7cc-fb .cf7cc-banner p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--cc-muted);
}

/* --------------------------------------------------------------------------
   Right panel — fields & operators
   -------------------------------------------------------------------------- */

.cf7cc-fields {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 46px;
}
.cf7cc-fields-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cf7cc-fields-head .cf7cc-card-title {
  color: var(--cc-primary-600);
}
.cf7cc-fields > .cf7cc-card-title {
  margin-top: 2px;
}

.cf7cc-tip {
  position: relative;
  color: var(--cc-subtle);
  display: inline-grid;
  cursor: help;
  border-radius: 50%;
}
.cf7cc-tip:focus-visible {
  outline: none;
  box-shadow: var(--cc-ring);
}
.cf7cc-tip [role='tooltip'] {
  position: absolute;
  top: calc(100% + 8px);
  right: -60px;
  width: 220px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #13213d;
  color: #fff;
  font-size: 12.5px;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-3px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 50;
}
.cf7cc-tip:hover [role='tooltip'],
.cf7cc-tip:focus [role='tooltip'] {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.cf7cc-search {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--cc-subtle);
}
.cf7cc-search > .cf7cc-icon {
  position: absolute;
  left: 13px;
  pointer-events: none;
}
.cf7cc-fb .cf7cc-search input {
  width: 100%;
  height: 42px;
  min-height: 0;
  margin: 0;
  padding: 0 12px 0 40px;
  border: 1px solid var(--cc-border-strong);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--cc-text);
  box-shadow: none;
}
.cf7cc-fb .cf7cc-search input:focus {
  outline: none;
  border-color: var(--cc-primary);
  box-shadow: var(--cc-ring);
}

.cf7cc-field-list,
.cf7cc-op-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cf7cc-fb .cf7cc-field-item,
.cf7cc-fb .cf7cc-op-item {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--cc-border);
  border-radius: 8px;
  background: #fff;
  color: var(--cc-text);
  font: inherit;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.cf7cc-fb .cf7cc-field-item {
  padding: 7px 12px 7px 7px;
  cursor: grab;
}
.cf7cc-fb .cf7cc-field-item .cf7cc-ficon {
  width: 32px;
  height: 32px;
}
.cf7cc-field-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cf7cc-fb .cf7cc-field-add {
  color: var(--cc-primary);
  opacity: 0;
  transition: opacity 0.15s;
}
.cf7cc-fb .cf7cc-field-item:hover,
.cf7cc-fb .cf7cc-op-item:hover {
  border-color: #b9cdf8;
  background: var(--cc-primary-softer);
}
.cf7cc-fb .cf7cc-field-item:hover .cf7cc-field-add,
.cf7cc-fb .cf7cc-field-item:focus-visible .cf7cc-field-add {
  opacity: 1;
}
.cf7cc-fb .cf7cc-field-item:focus-visible,
.cf7cc-fb .cf7cc-op-item:focus-visible {
  outline: none;
  border-color: var(--cc-primary);
  box-shadow: var(--cc-ring);
}
.cf7cc-fb .cf7cc-field-item.is-result {
  cursor: pointer;
}
.cf7cc-fb .cf7cc-field-item.is-result.is-active {
  border-color: var(--cc-primary);
  background: var(--cc-primary-softer);
}
.cf7cc-fb .cf7cc-op-item {
  padding: 10px 14px;
  gap: 14px;
}
.cf7cc-fb .cf7cc-op-item .cf7cc-icon {
  color: var(--cc-primary);
}
.cf7cc-sep {
  border: 0;
  border-top: 1px solid var(--cc-border);
  margin: 10px 0 6px;
}
.cf7cc-empty-note {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--cc-surface-2);
  border: 1px dashed var(--cc-border-strong);
  color: var(--cc-muted);
  font-size: 13px;
  line-height: 1.55;
}
.cf7cc-empty-note .cf7cc-icon {
  margin-top: 2px;
  color: var(--cc-primary);
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */

.cf7cc-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 29, 58, 0.45);
}
.cf7cc-modal-box {
  position: relative;
  width: min(440px, 100%);
  padding: 28px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--cc-shadow-pop);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cf7cc-fb .cf7cc-modal-box h3 {
  font-size: 19px;
  font-weight: 700;
}
.cf7cc-fb .cf7cc-modal-box p {
  color: var(--cc-muted);
  line-height: 1.6;
}
.cf7cc-fb .cf7cc-modal-close {
  appearance: none;
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--cc-muted);
  cursor: pointer;
}
.cf7cc-fb .cf7cc-modal-close:hover {
  background: var(--cc-surface-2);
}
.cf7cc-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Responsive (container queries — the CF7 panel width varies)
   -------------------------------------------------------------------------- */

@container (max-width: 1260px) {
  .cf7cc-shell {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
  .cf7cc-side {
    grid-column: 1 / -1;
    position: static;
    padding: 8px;
    flex-direction: row;
    align-items: center;
  }
  .cf7cc-fb .cf7cc-nav {
    flex-direction: row;
    border-bottom: 0;
    padding: 0;
    flex: 1;
  }
  .cf7cc-fb .cf7cc-nav li {
    flex: none;
  }
  .cf7cc-fb .cf7cc-nav button {
    padding: 10px 14px;
    font-size: 14px;
    gap: 10px;
  }
  .cf7cc-side-pro,
  .cf7cc-upgrade p,
  .cf7cc-upgrade h4,
  .cf7cc-upgrade > .cf7cc-crown {
    display: none;
  }
  .cf7cc-upgrade {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
  }
  .cf7cc-templates {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@container (max-width: 900px) {
  .cf7cc-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .cf7cc-fields {
    position: static;
  }
  .cf7cc-side {
    flex-wrap: wrap;
  }
  .cf7cc-fb .cf7cc-nav {
    flex-wrap: wrap;
  }
  .cf7cc-live {
    grid-template-columns: minmax(0, 1fr);
  }
  .cf7cc-live-inputs {
    border-right: 0;
    padding: 0;
  }
}

@container (max-width: 640px) {
  .cf7cc-main {
    padding: 16px;
  }
  .cf7cc-header {
    flex-wrap: wrap;
  }
  .cf7cc-logo {
    width: 44px;
    height: 44px;
  }
  .cf7cc-fb .cf7cc-header h2 {
    font-size: 20px;
  }
  .cf7cc-templates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cf7cc-card-head {
    flex-wrap: wrap;
  }
  .cf7cc-fb .cf7cc-token-field {
    min-width: 0;
  }
  .cf7cc-save {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
  .cf7cc-banner {
    flex-wrap: wrap;
  }
  .cf7cc-select.is-target {
    min-width: 0;
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cf7cc-fb *,
  .cf7cc-fb *::before,
  .cf7cc-fb *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ==========================================================================
   Sidebar box (under "Status" in the CF7 editor)
   ========================================================================== */

#cf7cc-formula-sidebar {
  margin: 20px 0 0;
}

.cf7cc-fb.is-sidebar {
  padding: 14px;
  margin: 0;
  border-radius: 4px;
  background: var(--cc-surface);
  border: 1px solid #c3c4c7;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  font-size: 13px;
}

.cf7cc-sb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cf7cc-sb-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.cf7cc-sb-title .cf7cc-icon {
  color: var(--cc-primary);
}

.cf7cc-fb .cf7cc-sb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cf7cc-fb .cf7cc-sb-item {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--cc-border);
  border-radius: 8px;
  background: var(--cc-surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cf7cc-fb .cf7cc-sb-item.is-editing {
  background: #fff;
  border-color: var(--cc-primary);
  box-shadow: var(--cc-ring);
}

.cf7cc-sb-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cf7cc-sb-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.cf7cc-sb-name strong {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cf7cc-fb .cf7cc-sb-name code {
  color: var(--cc-subtle);
  font-size: 11.5px;
}

.cf7cc-sb-badge {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.cf7cc-sb-badge.is-ok {
  background: var(--cc-success-soft);
  color: var(--cc-success);
}
.cf7cc-sb-badge.is-error {
  background: var(--cc-danger-soft);
  color: var(--cc-danger);
}
.cf7cc-sb-badge.is-empty {
  background: #eef1f6;
  color: var(--cc-subtle);
}

.cf7cc-fb .cf7cc-sb-code {
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 1px dashed transparent;
  border-radius: 6px;
  background: #fff;
  color: #26334d;
  font-family: var(--cc-mono);
  font-size: 12.5px;
  line-height: 1.55;
  text-align: left;
  word-break: break-word;
  cursor: text;
  box-shadow: inset 0 0 0 1px var(--cc-border);
}
.cf7cc-fb .cf7cc-sb-code:hover,
.cf7cc-fb .cf7cc-sb-code:focus-visible {
  outline: none;
  border-color: var(--cc-primary);
  box-shadow: none;
}
.cf7cc-fb .cf7cc-sb-code.is-placeholder {
  color: var(--cc-subtle);
  font-family: inherit;
  font-style: italic;
}

.cf7cc-fb textarea.cf7cc-sb-textarea {
  width: 100%;
  min-height: 72px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--cc-border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--cc-text);
  font-family: var(--cc-mono);
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
  box-shadow: none;
}
.cf7cc-fb textarea.cf7cc-sb-textarea:focus {
  outline: none;
  border-color: var(--cc-primary);
  box-shadow: var(--cc-ring);
}

.cf7cc-sb-error {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--cc-danger);
  font-size: 12px;
}

.cf7cc-sb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.cf7cc-fb .cf7cc-sb-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #cfdcf8;
  border-radius: 999px;
  background: var(--cc-primary-softer);
  color: var(--cc-primary-600);
  font-family: var(--cc-mono);
  font-size: 11.5px;
  cursor: pointer;
}
.cf7cc-fb .cf7cc-sb-chip:hover,
.cf7cc-fb .cf7cc-sb-chip:focus-visible {
  outline: none;
  background: var(--cc-primary-soft);
  border-color: var(--cc-primary);
}

.cf7cc-sb-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.cf7cc-fb .cf7cc-btn.is-xs {
  height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
  gap: 6px;
  border-radius: 6px;
}
.cf7cc-fb .cf7cc-btn.is-ghost.is-xs {
  padding: 0 8px;
}
.cf7cc-sb-hint {
  margin-left: auto;
  color: var(--cc-subtle);
  font-size: 11px;
}
.cf7cc-sb-status {
  margin-left: auto;
  font-size: 12px;
  color: var(--cc-subtle);
}
.cf7cc-sb-status.is-saved {
  color: var(--cc-success);
}
.cf7cc-sb-status.is-error {
  color: var(--cc-danger);
}

.cf7cc-sb-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  color: var(--cc-muted);
}

/* ==========================================================================
   Builder popup
   ========================================================================== */

html.cf7cc-modal-open,
html.cf7cc-modal-open body {
  overflow: hidden;
}

.cf7cc-fb.is-modal {
  position: fixed;
  inset: 0;
  z-index: 100050; /* above the WP admin bar */
  margin: 0;
  padding: 24px;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 29, 58, 0.5);
  backdrop-filter: blur(2px);
}

.cf7cc-dialog {
  width: min(1280px, 100%);
  height: min(920px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  background: var(--cc-surface);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 29, 58, 0.28);
  overflow: hidden;
  outline: none;
}

.cf7cc-dialog-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px 14px;
}
.cf7cc-dialog-head .cf7cc-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
}
.cf7cc-fb .cf7cc-dialog-head h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.cf7cc-fb .cf7cc-dialog-head p {
  margin-top: 4px;
  color: var(--cc-muted);
  font-size: 13.5px;
}
.cf7cc-fb .cf7cc-dialog-close {
  appearance: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 1px solid var(--cc-border);
  border-radius: 10px;
  background: #fff;
  color: var(--cc-muted);
  cursor: pointer;
}
.cf7cc-fb .cf7cc-dialog-close:hover {
  background: var(--cc-surface-2);
  color: var(--cc-text);
}
.cf7cc-fb .cf7cc-dialog-close:focus-visible {
  outline: none;
  box-shadow: var(--cc-ring);
}

.cf7cc-dialog > .cf7cc-target {
  margin: 0 22px;
}
.cf7cc-target-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cf7cc-fb .cf7cc-target-field label {
  font-weight: 600;
  font-size: 13px;
}
.cf7cc-fb .cf7cc-target-field input {
  width: 200px;
  height: 34px;
  min-height: 0;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--cc-border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--cc-text);
  font: inherit;
  font-size: 13.5px;
  box-shadow: none;
}
.cf7cc-fb .cf7cc-target-field.is-name input {
  font-family: var(--cc-mono);
  font-size: 13px;
}
.cf7cc-fb .cf7cc-target-field input:focus {
  outline: none;
  border-color: var(--cc-primary);
  box-shadow: var(--cc-ring);
}
.cf7cc-target-hint {
  margin-left: auto !important;
  color: var(--cc-subtle);
  font-size: 12.5px;
}
.cf7cc-target-hint code {
  color: var(--cc-text);
}

.cf7cc-dialog-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: 16px;
  align-items: start;
  padding: 14px 22px 18px;
  overscroll-behavior: contain;
}
.cf7cc-dialog-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.cf7cc-dialog-body .cf7cc-fields {
  top: 0;
  border-radius: 12px;
  box-shadow: none;
  background: var(--cc-surface-2);
}

.cf7cc-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-top: 1px solid var(--cc-border);
  background: var(--cc-surface);
}
.cf7cc-foot-msg {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--cc-muted);
  font-size: 13px;
  min-width: 0;
}
.cf7cc-foot-msg.is-error {
  color: var(--cc-danger);
}
.cf7cc-foot-msg.is-warn {
  color: #b7791f;
}
.cf7cc-foot-actions {
  display: flex;
  gap: 10px;
  flex: none;
}

.cf7cc-modal-enter-active,
.cf7cc-modal-leave-active {
  transition: opacity 0.18s ease;
}
.cf7cc-modal-enter-active .cf7cc-dialog,
.cf7cc-modal-leave-active .cf7cc-dialog {
  transition: transform 0.2s ease;
}
.cf7cc-modal-enter-from,
.cf7cc-modal-leave-to {
  opacity: 0;
}
.cf7cc-modal-enter-from .cf7cc-dialog,
.cf7cc-modal-leave-to .cf7cc-dialog {
  transform: translateY(12px) scale(0.985);
}

/* The Pro dialog opens on top of the builder popup */
.cf7cc-fb.is-modal .cf7cc-modal {
  z-index: 2;
}

@container (max-width: 1100px) {
  .cf7cc-dialog-body {
    grid-template-columns: minmax(0, 1fr) 240px;
  }
  .cf7cc-target-hint {
    margin-left: 0 !important;
    width: 100%;
  }
}

@container (max-width: 860px) {
  .cf7cc-dialog-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .cf7cc-dialog-body .cf7cc-fields {
    position: static;
    order: -1;
  }
  .cf7cc-dialog-head .cf7cc-header-text p,
  .cf7cc-dialog-head .cf7cc-howto {
    display: none;
  }
}

@container (max-width: 600px) {
  .cf7cc-dialog {
    height: calc(100vh - 16px);
    border-radius: 12px;
  }
  .cf7cc-dialog-head,
  .cf7cc-dialog-body,
  .cf7cc-dialog-foot {
    padding-left: 14px;
    padding-right: 14px;
  }
  .cf7cc-dialog > .cf7cc-target {
    margin: 0 14px;
  }
  .cf7cc-target-field,
  .cf7cc-fb .cf7cc-target-field input {
    width: 100%;
  }
  .cf7cc-dialog-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .cf7cc-foot-actions .cf7cc-btn {
    flex: 1;
  }
}


/* --------------------------------------------------------------------------
   Display settings card
   -------------------------------------------------------------------------- */

.cf7cc-display-example {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--cc-success-soft);
  border: 1px solid var(--cc-success-border);
}
.cf7cc-display-example small {
  color: var(--cc-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cf7cc-display-example strong {
  color: var(--cc-success);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.cf7cc-display {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 18px;
}
.cf7cc-dfield {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.cf7cc-dfield.is-wide {
  grid-column: 1 / -1;
}
.cf7cc-fb .cf7cc-dfield > label,
.cf7cc-dlabel {
  font-weight: 600;
  font-size: 12.5px;
  color: #33415c;
}
.cf7cc-dfield .cf7cc-select,
.cf7cc-dfield .cf7cc-input {
  width: 100%;
}
.cf7cc-dfield.is-wide .cf7cc-select {
  max-width: 360px;
}

.cf7cc-segment {
  display: inline-flex;
  padding: 3px;
  border-radius: 8px;
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
  align-self: flex-start;
}
.cf7cc-fb .cf7cc-segment button {
  appearance: none;
  min-width: 64px;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--cc-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.cf7cc-fb .cf7cc-segment button:hover {
  color: var(--cc-text);
}
.cf7cc-fb .cf7cc-segment button.is-on {
  background: #fff;
  color: var(--cc-primary);
  box-shadow: 0 1px 2px rgba(16, 29, 58, 0.1), 0 0 0 1px var(--cc-border);
}
.cf7cc-fb .cf7cc-segment button:focus-visible {
  outline: none;
  box-shadow: var(--cc-ring);
}

.cf7cc-fb .cf7cc-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--cc-muted);
  font-size: 12.5px;
  font-weight: 400;
  cursor: pointer;
}
.cf7cc-fb .cf7cc-check input[type='checkbox'],
.cf7cc-fb .cf7cc-switch input[type='checkbox'] {
  margin: 0;
}

.cf7cc-fb .cf7cc-switch {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--cc-border);
  border-radius: 10px;
  background: var(--cc-surface-2);
  cursor: pointer;
}
.cf7cc-fb .cf7cc-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.cf7cc-switch-track {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  margin-top: 1px;
  border-radius: 999px;
  background: #cbd3e1;
  transition: background-color 0.15s;
}
.cf7cc-switch-track span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 29, 58, 0.25);
  transition: transform 0.15s;
}
.cf7cc-fb .cf7cc-switch input:checked + .cf7cc-switch-track {
  background: var(--cc-primary);
}
.cf7cc-fb .cf7cc-switch input:checked + .cf7cc-switch-track span {
  transform: translateX(16px);
}
.cf7cc-fb .cf7cc-switch input:focus-visible + .cf7cc-switch-track {
  box-shadow: var(--cc-ring);
}
.cf7cc-switch-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cf7cc-switch-text strong {
  font-size: 13.5px;
  font-weight: 600;
}
.cf7cc-switch-text small {
  color: var(--cc-subtle);
  font-size: 12.5px;
}

.cf7cc-result-target .cf7cc-icon {
  display: inline-block;
  vertical-align: -2px;
}

@container (max-width: 1100px) {
  .cf7cc-display {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container (max-width: 600px) {
  .cf7cc-display {
    grid-template-columns: minmax(0, 1fr);
  }
}
