#leadcrm-page {
        --leadcrm-primary: #3a3285;
        --leadcrm-primary-dark: #2b2668;
        --leadcrm-primary-ink: #232052;
        --leadcrm-primary-soft: #eeedf7;
        --leadcrm-secondary: #e60e81;
        --leadcrm-secondary-dark: #bd0a6a;
        --leadcrm-secondary-soft: #fde6f2;
        --leadcrm-bg: #f3f4f8;
        --leadcrm-card: #ffffff;
        --leadcrm-border: #e5e7eb;
        --leadcrm-text: #1f2333;
        --leadcrm-muted: #6b7280;
        --leadcrm-success: #15803d;
        --leadcrm-success-bg: #dcfce7;
        --leadcrm-warning: #b45309;
        --leadcrm-warning-bg: #fef3c7;
        --leadcrm-danger: #b91c1c;
        --leadcrm-danger-bg: #fee2e2;
        --leadcrm-radius: 16px;
        --leadcrm-shadow: 0 12px 32px rgba(58, 50, 133, .12);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        color: var(--leadcrm-text);
        padding-right: 20px;
      }
      #leadcrm-page .leadcrm-wrap { max-width: 1320px; margin: 16px auto 40px; padding: 0 24px; }
      /* Hero */
      #leadcrm-page .leadcrm-hero {
        background: linear-gradient(135deg, #3a3285 0%, #574fb0 48%, #e60e81 100%);
        border-radius: var(--leadcrm-radius);
        padding: 28px 28px 24px;
        color: #fff;
        box-shadow: var(--leadcrm-shadow);
        position: relative;
        overflow: hidden;
      }
      #leadcrm-page .leadcrm-hero::after {
        content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px;
        background: radial-gradient(circle at center, rgba(255,255,255,.22), transparent 70%);
        pointer-events: none;
      }
      #leadcrm-page .leadcrm-hero__main { display: flex; gap: 20px; align-items: flex-start; position: relative; z-index: 1; }
      #leadcrm-page .leadcrm-logo-badge {
        background: #fff; border-radius: 14px; padding: 10px 12px; min-width: 148px; max-width: 188px;
        display: flex; align-items: center; justify-content: center; flex-shrink: 0;
        box-shadow: 0 6px 18px rgba(0,0,0,.18);
      }
      #leadcrm-page .leadcrm-logo-badge img { max-width: 100%; max-height: 46px; width: auto; height: auto; border: 0; margin: 0; }
      #leadcrm-page .leadcrm-eyebrow {
        display: inline-flex; align-items: center; gap: 8px;
        font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
        background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
        padding: 5px 10px; border-radius: 999px; margin-bottom: 10px;
      }
      #leadcrm-page .leadcrm-eyebrow .dot { width: 7px; height: 7px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.22); }
      #leadcrm-page .leadcrm-hero h1 { color: #fff; font-size: 26px; line-height: 1.2; font-weight: 800; margin: 0 0 8px; }
      #leadcrm-page .leadcrm-hero p.leadcrm-hero__sub { color: rgba(255,255,255,.92); font-size: 14px; line-height: 1.6; margin: 0; max-width: 640px; }
      #leadcrm-page .leadcrm-hero__meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; position: relative; z-index: 1; }
      #leadcrm-page .leadcrm-status-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); color: #fff; }
      #leadcrm-page .leadcrm-status-pill .pulse { width: 8px; height: 8px; border-radius: 999px; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.3); }
      #leadcrm-page .leadcrm-status-pill.is-off .pulse { background: #fbbf24; box-shadow: 0 0 0 4px rgba(251,191,36,.28); }
      /* Card */
      #leadcrm-page .leadcrm-card {
        background: var(--leadcrm-card); border: 1px solid var(--leadcrm-border);
        border-radius: var(--leadcrm-radius); box-shadow: var(--leadcrm-shadow);
        margin-top: 18px; overflow: hidden;
      }
      #leadcrm-page .leadcrm-step { padding: 24px 26px; border-bottom: 1px solid #eef0f5; }
      #leadcrm-page .leadcrm-step:last-child { border-bottom: 0; }
      #leadcrm-page .leadcrm-step__head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
      #leadcrm-page .leadcrm-step__num {
        width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
        display: flex; align-items: center; justify-content: center;
        font-weight: 800; font-size: 13px; color: #fff;
        background: linear-gradient(135deg, var(--leadcrm-primary), var(--leadcrm-secondary));
        box-shadow: 0 6px 14px rgba(230,14,129,.28);
      }
      #leadcrm-page .leadcrm-step__title { font-size: 15px; font-weight: 800; margin: 2px 0 4px; color: var(--leadcrm-primary-ink); }
      #leadcrm-page .leadcrm-step__desc { font-size: 13px; line-height: 1.6; color: var(--leadcrm-muted); margin: 0; }
      #leadcrm-page .leadcrm-label { display: block; font-size: 13px; font-weight: 700; color: #374151; margin: 0 0 8px; }
      #leadcrm-page .leadcrm-field { position: relative; }
      #leadcrm-page .leadcrm-text-input {
        width: 100%; border: 1.5px solid var(--leadcrm-border) !important; border-radius: 12px !important;
        padding: 12px 14px 12px 42px !important; font-size: 14px !important; line-height: 1.4;
        background: #fbfbfe !important; color: var(--leadcrm-text) !important;
        box-shadow: none !important; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
      }
      #leadcrm-page .leadcrm-text-input:focus {
        outline: none !important; border-color: var(--leadcrm-secondary) !important; background: #fff !important;
        box-shadow: 0 0 0 4px rgba(230,14,129,.12) !important;
      }
      #leadcrm-page .leadcrm-text-input.is-error { border-color: #ef4444 !important; box-shadow: 0 0 0 4px rgba(239,68,68,.12) !important; }
      #leadcrm-page .leadcrm-field__icon {
        position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
        width: 20px; height: 20px; color: var(--leadcrm-primary); opacity: .75; pointer-events: none;
      }
      #leadcrm-page .leadcrm-hint { font-size: 12.5px; color: var(--leadcrm-muted); margin: 8px 2px 0; line-height: 1.5; }
      #leadcrm-page .leadcrm-error { font-size: 12.5px; color: var(--leadcrm-danger); margin-top: 8px; font-weight: 600; }
      /* Tags (pre-connect) */
      #leadcrm-page .leadcrm-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
      #leadcrm-page .leadcrm-tag {
        display: inline-flex; align-items: center; gap: 8px;
        background: var(--leadcrm-primary-soft); border: 1px solid #dcd9f0;
        color: var(--leadcrm-primary-ink); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
        padding: 7px 11px; border-radius: 999px;
      }
      #leadcrm-page .leadcrm-tag img { height: 16px; width: auto; max-width: 22px; }
      /* Form grid */
      #leadcrm-page .leadcrm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 12px; align-items: start; }
      @media (max-width: 960px) { #leadcrm-page .leadcrm-grid { grid-template-columns: 1fr; } }
      @media (max-width: 782px) { #leadcrm-page .leadcrm-grid { grid-template-columns: 1fr; } #leadcrm-page .leadcrm-hero__main { flex-direction: column; } }
      #leadcrm-page .leadcrm-form-card { display: flex; flex-direction: column;
        border: 1.5px solid var(--leadcrm-border); border-radius: 14px; padding: 14px 14px 12px;
        background: #fbfbfe; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
      }
      #leadcrm-page .leadcrm-form-card:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(58,50,133,.10); }
      #leadcrm-page .leadcrm-form-card.is-connected { border-color: #86efac; background: #f0fdf4; box-shadow: 0 8px 20px rgba(21,128,61,.10); }
      #leadcrm-page .leadcrm-form-card.is-pending { border-color: #f9a8d4; background: #fdf2f8; box-shadow: 0 8px 20px rgba(230,14,129,.10); }
      #leadcrm-page .leadcrm-form-card.is-off { border-color: var(--leadcrm-border); background: #f9fafb; }
      #leadcrm-page .leadcrm-form-card__top { display: flex; align-items: center; gap: 10px; }
      #leadcrm-page .leadcrm-form-card__logo { width: 34px; height: 34px; border-radius: 10px; background: #fff; border: 1px solid var(--leadcrm-border); display: flex; align-items: center; justify-content: center; padding: 5px; flex-shrink: 0; }
      #leadcrm-page .leadcrm-form-card__logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; }
      #leadcrm-page .leadcrm-form-card__name { font-size: 13.5px; font-weight: 800; color: var(--leadcrm-primary-ink); line-height: 1.3; flex: 1; }
      #leadcrm-page .leadcrm-form-card__bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
      #leadcrm-page .leadcrm-pill { font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 5px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; min-width: 92px; justify-content: center; }
      #leadcrm-page .leadcrm-pill--connected { background: var(--leadcrm-success-bg); color: var(--leadcrm-success); border: 1px solid #86efac; }
      #leadcrm-page .leadcrm-pill--pending { background: #fff; color: var(--leadcrm-secondary); border: 1px solid #f9a8d4; }
      #leadcrm-page .leadcrm-pill--off { background: #eef2f7; color: #6b7280; border: 1px solid #dbe1ea; }
      #leadcrm-page .leadcrm-pill .dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
      /* Toggle */
      #leadcrm-page .leadcrm-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
      #leadcrm-page .leadcrm-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
      #leadcrm-page .leadcrm-switch .track {
        position: absolute; inset: 0; border-radius: 999px; background: #d1d5db; transition: background .2s ease;
        box-shadow: inset 0 1px 3px rgba(0,0,0,.18);
      }
      #leadcrm-page .leadcrm-switch .thumb {
        position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 999px; background: #fff;
        box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .2s ease; z-index: 1;
      }
      #leadcrm-page .leadcrm-switch input:checked ~ .track { background: linear-gradient(135deg, var(--leadcrm-primary), var(--leadcrm-secondary)); }
      #leadcrm-page .leadcrm-switch input:checked ~ .thumb { transform: translateX(20px); }
      #leadcrm-page .leadcrm-switch input:focus-visible ~ .track { outline: 2px solid var(--leadcrm-secondary); outline-offset: 2px; }
      /* Save bar */
      #leadcrm-page .leadcrm-savebar {
        display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
        background: linear-gradient(180deg, #fafaff, #f4f2fb);
        padding: 18px 26px;
      }
      #leadcrm-page .leadcrm-savebar__text { flex: 1; min-width: 200px; font-size: 12.5px; color: var(--leadcrm-muted); line-height: 1.5; }
      #leadcrm-page .leadcrm-btn {
        border: 0; border-radius: 999px; padding: 13px 28px; font-size: 13px; font-weight: 800;
        letter-spacing: .08em; text-transform: uppercase; cursor: pointer; color: #fff;
        background: linear-gradient(135deg, var(--leadcrm-primary) 0%, var(--leadcrm-secondary) 100%);
        box-shadow: 0 10px 22px rgba(230,14,129,.32); transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
        min-width: 200px; max-width: 260px;
      }
      #leadcrm-page .leadcrm-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 14px 28px rgba(58,50,133,.32); }
      #leadcrm-page .leadcrm-btn:disabled { background: #d1d5db; color: #6b7280; box-shadow: none; cursor: not-allowed; }
      /* Help */
      #leadcrm-page .leadcrm-help { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
      @media (max-width: 782px) { #leadcrm-page .leadcrm-help { grid-template-columns: 1fr; } }
      #leadcrm-page .leadcrm-help__item {
        background: #fff; border: 1px solid var(--leadcrm-border); border-radius: 14px; padding: 14px 16px;
        font-size: 13px; color: var(--leadcrm-muted); line-height: 1.6;
      }
      #leadcrm-page .leadcrm-help__item strong { display: block; color: var(--leadcrm-primary-ink); font-size: 13px; margin-bottom: 4px; }
      #leadcrm-page .leadcrm-external-link { color: var(--leadcrm-secondary) !important; font-weight: 700; text-decoration: none; }
      #leadcrm-page .leadcrm-external-link:hover { color: var(--leadcrm-primary) !important; text-decoration: underline; }
      /* Toast */
      #leadcrm-page .leadcrm-toast-wrap { display: flex; justify-content: center; position: fixed; bottom: 28px; left: 0; right: 0; z-index: 100; pointer-events: none; padding: 0 16px; }
      #leadcrm-page .leadcrm-toast {
        pointer-events: auto; display: flex; align-items: center; gap: 12px;
        padding: 12px 14px 12px 16px; border-radius: 999px; box-shadow: 0 18px 40px rgba(0,0,0,.22);
        font-size: 13px; max-width: 560px; border: 1px solid transparent;
      }
      #leadcrm-page .leadcrm-toast--success { background: #111827; color: #fff; border-color: #22c55e; }
      #leadcrm-page .leadcrm-toast--error { background: #111827; color: #fff; border-color: #ef4444; }
      #leadcrm-page .leadcrm-toast__dot { width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0; }
      #leadcrm-page .leadcrm-toast--success .leadcrm-toast__dot { background: #22c55e; box-shadow: 0 0 0 5px rgba(34,197,94,.22); }
      #leadcrm-page .leadcrm-toast--error .leadcrm-toast__dot { background: #ef4444; box-shadow: 0 0 0 5px rgba(239,68,68,.22); }
      #leadcrm-page .leadcrm-toast__heading { font-weight: 800; }
      #leadcrm-page .leadcrm-toast__msg { opacity: .85; }
      #leadcrm-page .leadcrm-toast__close { margin-left: 6px; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 28px; height: 28px; border-radius: 999px; cursor: pointer; font-size: 14px; line-height: 1; }
      #leadcrm-page .leadcrm-toast__close:hover { background: rgba(255,255,255,.22); }
      /* Per-form CRM labels */
      #leadcrm-page .leadcrm-labels-toggle {
        margin-top: 10px; width: 100%; border: 1px dashed #c7cde0; background: #fff;
        border-radius: 10px; padding: 9px 12px; font-size: 12.5px; font-weight: 800;
        color: var(--leadcrm-primary); cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px;
      }
      #leadcrm-page .leadcrm-labels-toggle:hover { border-color: var(--leadcrm-secondary); color: var(--leadcrm-secondary); }
      #leadcrm-page .leadcrm-labels-toggle .chev { transition: transform .18s ease; font-size: 11px; }
      #leadcrm-page .leadcrm-labels-toggle.open .chev { transform: rotate(180deg); }
      #leadcrm-page .leadcrm-labels { margin-top: 10px; border-top: 1px solid #eef0f5; padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
      #leadcrm-page .leadcrm-label-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--leadcrm-border); border-radius: 10px; padding: 8px 10px; }
      #leadcrm-page .leadcrm-label-row__info { flex: 1; min-width: 0; }
      #leadcrm-page .leadcrm-label-row__title { font-size: 12.5px; font-weight: 800; color: var(--leadcrm-primary-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
      #leadcrm-page .leadcrm-label-row__id { font-size: 11px; color: var(--leadcrm-muted); }
      #leadcrm-page .leadcrm-label-row input {
        width: 190px; max-width: 45%; border: 1.5px solid var(--leadcrm-border) !important; border-radius: 9px !important;
        padding: 8px 10px !important; font-size: 12.5px !important; background: #fbfbfe !important; color: var(--leadcrm-text) !important;
      }
      #leadcrm-page .leadcrm-label-row input:focus { outline: none !important; border-color: var(--leadcrm-secondary) !important; background: #fff !important; box-shadow: 0 0 0 3px rgba(230,14,129,.12) !important; }
      #leadcrm-page .leadcrm-labels__note { font-size: 12px; color: var(--leadcrm-muted); line-height: 1.5; }
      #leadcrm-page .leadcrm-labels__loading { font-size: 12.5px; color: var(--leadcrm-muted); padding: 6px 2px; }
      #leadcrm-page .leadcrm-auto-note { margin-top: 10px; font-size: 12px; color: var(--leadcrm-muted); background: #f4f2fb; border: 1px solid #e2ddf3; border-radius: 10px; padding: 8px 10px; line-height: 1.5; }
      /* Legacy compat overrides */
      #leadcrm-page .toggle-checkbox, #leadcrm-page .toggle-label { display: none !important; }

}