.aiforya-sm-builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
        @media (max-width: 1100px) { .aiforya-sm-builder-layout { grid-template-columns: 1fr; } }

        .aiforya-sm-builder-form-col { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
        .aiforya-sm-builder-preview-col { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
        .aiforya-sm-builder-sticky { position: sticky; top: 24px; }

        .aiforya-sm-builder-type-select {
            width: 100%; max-width: 100%;
            background: #0f172a; color: #f1f5f9;
            border: 1px solid rgba(99,102,241,0.30); border-radius: 8px;
            padding: 10px 12px; font-size: 14px; font-weight: 600; line-height: 1.4;
        }
        .aiforya-sm-builder-type-desc { margin-top: 10px; }

        .aiforya-sm-builder-fields-host { display: flex; flex-direction: column; gap: 14px; }

        .aiforya-sm-builder-section .aiforya-card-header h3 { display: flex; align-items: center; gap: 10px; }
        .aiforya-sm-builder-section-count {
            background: rgba(99,102,241,0.18); color: #c7d2fe;
            font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; line-height: 1;
        }
        .aiforya-sm-builder-section--required .aiforya-card-header { border-left: 3px solid #fbbf24; }
        .aiforya-sm-builder-section--recommended .aiforya-card-header { border-left: 3px solid #60a5fa; }
        .aiforya-sm-builder-section--advanced .aiforya-card-header { border-left: 3px solid rgba(255,255,255,0.18); }
        .aiforya-sm-builder-section--custom .aiforya-card-header { border-left: 3px solid #a5b4fc; }

        .aiforya-sm-builder-field { padding: 10px 0; border-bottom: 1px dashed rgba(255,255,255,0.06); }
        .aiforya-sm-builder-field:last-child { border-bottom: 0; }
        .aiforya-sm-builder-field-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
        .aiforya-sm-builder-field-label { font-size: 13px; font-weight: 600; color: #f1f5f9; flex: 1 1 auto; }
        .aiforya-sm-builder-field-req { color: #fbbf24; font-size: 13px; cursor: help; }
        .aiforya-sm-builder-field-key { font-size: 11px; padding: 2px 8px; background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.25); border-radius: 4px; color: #c7d2fe; font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace; }
        .aiforya-sm-builder-field-desc { font-size: 11.5px; color: #94a3b8; margin: 4px 0 0 0; line-height: 1.45; }

        .aiforya-sm-builder-input {
            width: 100%; box-sizing: border-box;
            background: #0b1220 !important; color: #f1f5f9 !important;
            border: 1px solid rgba(99,102,241,0.18) !important; border-radius: 8px !important;
            padding: 9px 12px !important; font-size: 13.5px !important; line-height: 1.5 !important;
            transition: border-color .15s, box-shadow .15s;
        }
        .aiforya-sm-builder-input:focus { border-color: rgba(99,102,241,0.55) !important; box-shadow: 0 0 0 3px rgba(99,102,241,0.15) !important; outline: none !important; }
        textarea.aiforya-sm-builder-input { font-family: inherit; resize: vertical; }
        textarea.aiforya-sm-builder-input--array { font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace; font-size: 12.5px !important; }

        .aiforya-sm-builder-nested-wrap {
            margin-top: 8px;
            background: rgba(99,102,241,0.04);
            border: 1px solid rgba(99,102,241,0.18); border-radius: 8px;
        }
        .aiforya-sm-builder-nested-summary {
            padding: 8px 12px; cursor: pointer; user-select: none;
            display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
            list-style: none;
        }
        .aiforya-sm-builder-nested-summary::-webkit-details-marker { display: none; }
        .aiforya-sm-builder-nested-summary::before {
            content: "▶"; font-size: 9px; color: #94a3b8; transition: transform .15s; display: inline-block;
        }
        details[open] > .aiforya-sm-builder-nested-summary::before { transform: rotate(90deg); }
        .aiforya-sm-builder-nested-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #c7d2fe; padding: 2px 8px; background: rgba(99,102,241,0.20); border-radius: 4px; }
        .aiforya-sm-builder-nested-hint { font-size: 11.5px; color: #94a3b8; flex: 1 1 auto; }
        .aiforya-sm-builder-nested-body { padding: 8px 12px 12px 12px; border-top: 1px solid rgba(99,102,241,0.10); }

        .aiforya-sm-builder-array-wrap {
            margin-top: 8px;
            background: rgba(99,102,241,0.04);
            border: 1px solid rgba(99,102,241,0.18); border-radius: 8px;
            padding: 10px;
        }
        .aiforya-sm-builder-array-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
        .aiforya-sm-builder-array-item { background: rgba(2,6,23,0.40); border: 1px solid rgba(255,255,255,0.06); border-radius: 8px; transition: opacity .15s, box-shadow .15s, border-color .15s; }
        .aiforya-sm-builder-array-item.is-dragging { opacity: 0.35; border-color: rgba(99,102,241,0.55); }
        .aiforya-sm-builder-array-item.is-drop-before { box-shadow: 0 -3px 0 0 #a5b4fc inset; }
        .aiforya-sm-builder-array-item.is-drop-after  { box-shadow: 0 3px 0 0 #a5b4fc inset; }
        .aiforya-sm-builder-array-item-drag {
            display: inline-flex; align-items: center; justify-content: center;
            cursor: grab; padding: 0 4px; color: #94a3b8; user-select: none;
            border-radius: 4px; transition: color .15s, background .15s;
            -webkit-user-drag: element;
        }
        .aiforya-sm-builder-array-item-drag:hover { color: #c7d2fe; background: rgba(99,102,241,0.10); }
        .aiforya-sm-builder-array-item-drag:active { cursor: grabbing; }
        .aiforya-sm-builder-array-item.is-dragging .aiforya-sm-builder-array-item-drag { cursor: grabbing; color: #c7d2fe; }
        .aiforya-sm-builder-array-item-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: rgba(15,23,42,0.60); border-bottom: 1px solid rgba(255,255,255,0.06); border-radius: 8px 8px 0 0; }
        .aiforya-sm-builder-array-item-label { flex: 1 1 auto; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #c7d2fe; }
        .aiforya-sm-builder-array-item-body { padding: 8px 12px 4px 12px; }
        .aiforya-sm-builder-array-add { width: 100%; }
        .aiforya-sm-builder-array-up .dashicons,
        .aiforya-sm-builder-array-down .dashicons,
        .aiforya-sm-builder-array-remove .dashicons,
        .aiforya-sm-builder-template-delete .dashicons,
        .aiforya-sm-builder-custom-remove .dashicons {
            font-size: 14px; width: 14px; height: 14px; line-height: 14px;
        }

        .aiforya-sm-builder-custom-row { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; }
        .aiforya-sm-builder-custom-name, .aiforya-sm-builder-custom-value {
            flex: 1 1 50%;
            background: #0b1220; color: #f1f5f9;
            border: 1px solid rgba(99,102,241,0.18); border-radius: 8px;
            padding: 8px 10px; font-size: 13px;
        }
        .aiforya-sm-builder-custom-name { font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace; }
        .aiforya-sm-button-danger { background: rgba(239,68,68,0.10) !important; border-color: rgba(239,68,68,0.4) !important; color: #fecaca !important; }
        .aiforya-sm-button-danger:hover { background: rgba(239,68,68,0.18) !important; }

        /* Preview / Score */
        .aiforya-sm-builder-preview-col .aiforya-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
        .aiforya-sm-builder-score { display: inline-flex; align-items: center; gap: 8px; }
        .aiforya-sm-builder-score-circle {
            width: 56px; height: 56px; border-radius: 50%;
            display: inline-flex; align-items: center; justify-content: center;
            background: conic-gradient(#a5b4fc calc(var(--p, 0) * 1%), rgba(255,255,255,0.06) 0);
            position: relative;
            transition: background .35s;
        }
        .aiforya-sm-builder-score-circle::before {
            content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #0f172a;
        }
        .aiforya-sm-builder-score-num { position: relative; font-size: 18px; font-weight: 700; color: #f1f5f9; font-feature-settings: "tnum"; }
        .aiforya-sm-builder-score[data-status="excellent"] .aiforya-sm-builder-score-circle { background: conic-gradient(#4ade80 var(--p, 0%), rgba(255,255,255,0.06) 0); }
        .aiforya-sm-builder-score[data-status="good"]      .aiforya-sm-builder-score-circle { background: conic-gradient(#a5b4fc var(--p, 0%), rgba(255,255,255,0.06) 0); }
        .aiforya-sm-builder-score[data-status="partial"]   .aiforya-sm-builder-score-circle { background: conic-gradient(#fbbf24 var(--p, 0%), rgba(255,255,255,0.06) 0); }
        .aiforya-sm-builder-score[data-status="weak"]      .aiforya-sm-builder-score-circle { background: conic-gradient(#f87171 var(--p, 0%), rgba(255,255,255,0.06) 0); }
        .aiforya-sm-builder-score-label { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

        .aiforya-sm-builder-jsonld {
            background: #020617 !important; color: #cbd5e1 !important;
            border: 1px solid rgba(99,102,241,0.18); border-radius: 10px;
            padding: 14px 16px;
            margin: 0 0 12px 0;
            max-height: 480px; overflow: auto;
            font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace; font-size: 12.5px; line-height: 1.55;
            white-space: pre; tab-size: 2;
        }
        .aiforya-sm-builder-jsonld code { background: transparent; padding: 0; color: inherit; }

        .aiforya-sm-builder-validation { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
        .aiforya-sm-builder-validation-msg { font-size: 12.5px; padding: 6px 10px; border-radius: 6px; }
        .aiforya-sm-builder-validation-msg--ok { background: rgba(74,222,128,0.10); border-left: 3px solid #4ade80; color: #bbf7d0; }
        .aiforya-sm-builder-validation-msg--warn { background: rgba(251,191,36,0.10); border-left: 3px solid #fbbf24; color: #fde68a; }
        .aiforya-sm-builder-validation-msg--info { background: rgba(96,165,250,0.10); border-left: 3px solid #60a5fa; color: #bfdbfe; }

        .aiforya-sm-builder-actions { display: flex; flex-wrap: wrap; gap: 8px; }
        .aiforya-sm-builder-actions .button .dashicons { font-size: 14px; width: 14px; height: 14px; line-height: 14px; }

        /* Templates list */
        .aiforya-sm-builder-templates-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
        .aiforya-sm-builder-template-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; }
        .aiforya-sm-builder-template-meta { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
        .aiforya-sm-builder-template-type { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; background: rgba(99,102,241,0.18); color: #c7d2fe; border-radius: 4px; font-weight: 700; flex: 0 0 auto; }
        .aiforya-sm-builder-template-name { font-size: 13px; color: #f1f5f9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .aiforya-sm-builder-template-actions { display: flex; gap: 4px; flex: 0 0 auto; }

        /* Import textarea */
        .aiforya-sm-builder-import-ta {
            width: 100%; box-sizing: border-box;
            background: #0b1220 !important; color: #cbd5e1 !important;
            border: 1px solid rgba(99,102,241,0.18) !important; border-radius: 8px !important;
            padding: 10px 12px !important; font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace; font-size: 12.5px !important;
            margin-bottom: 8px;
        }
        .aiforya-sm-builder-import-actions { display: flex; gap: 8px; }

        /* Modals — pattern AIFORYA appendTo body. */
        .aiforya-sm-builder-modal { position: fixed !important; inset: 0 !important; z-index: 99999 !important; display: none; isolation: isolate; }
        .aiforya-sm-builder-modal.is-open { display: block !important; }
        .aiforya-sm-builder-modal-backdrop { position: fixed !important; inset: 0 !important; z-index: 1; background: rgba(2,6,23,0.85); backdrop-filter: blur(4px); }
        .aiforya-sm-builder-modal-panel {
            position: fixed !important; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2;
            background: #0f172a !important; color: #f1f5f9;
            border: 1px solid rgba(99,102,241,0.30); border-radius: 12px;
            box-shadow: 0 24px 60px rgba(0,0,0,0.6);
            width: min(92vw, 640px); max-height: 86vh; display: flex; flex-direction: column; overflow: hidden;
        }
        .aiforya-sm-builder-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.08); background: #0f172a !important; }
        .aiforya-sm-builder-modal-title { margin: 0; font-size: 15px; color: #f1f5f9; }
        .aiforya-sm-builder-modal-body { padding: 16px 18px; overflow: auto; flex: 1 1 auto; background: #0f172a !important; }
        .aiforya-sm-builder-modal-foot { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid rgba(255,255,255,0.08); background: #0f172a !important; }
        .aiforya-sm-builder-modal-body label { display: block; font-size: 12px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin: 12px 0 6px 0; }
        .aiforya-sm-builder-tpl-input {
            width: 100%; box-sizing: border-box;
            background: #0b1220 !important; color: #f1f5f9 !important;
            border: 1px solid rgba(99,102,241,0.30) !important; border-radius: 8px !important;
            padding: 10px 12px !important; font-size: 13.5px !important;
        }

        /* Apply modal results */
        .aiforya-sm-builder-apply-results { margin-top: 10px; max-height: 240px; overflow: auto; }
        .aiforya-sm-builder-apply-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
        .aiforya-sm-builder-apply-row { display: flex; gap: 10px; padding: 8px 10px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; cursor: pointer; transition: background .15s, border-color .15s; }
        .aiforya-sm-builder-apply-row:hover { background: rgba(99,102,241,0.10); border-color: rgba(99,102,241,0.30); }
        .aiforya-sm-builder-apply-row.is-selected { background: rgba(99,102,241,0.20); border-color: rgba(99,102,241,0.55); }
        .aiforya-sm-builder-apply-row-title { flex: 1 1 auto; font-size: 13px; color: #f1f5f9; }
        .aiforya-sm-builder-apply-row-pt { font-size: 10.5px; padding: 2px 8px; background: rgba(255,255,255,0.06); color: #94a3b8; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
        .aiforya-sm-builder-apply-row-id { font-size: 11.5px; color: #64748b; font-family: ui-monospace, monospace; }
        .aiforya-sm-builder-apply-selected { margin-top: 12px; padding: 10px 12px; background: rgba(74,222,128,0.10); border: 1px solid rgba(74,222,128,0.30); border-radius: 8px; font-size: 12.5px; color: #bbf7d0; }
        .aiforya-sm-builder-apply-selected-title { color: #f1f5f9; font-weight: 600; }

        /* Toasts */
        .aiforya-sm-toast-host { position: fixed; right: 24px; bottom: 24px; z-index: 100001; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
        .aiforya-sm-toast { pointer-events: auto; min-width: 240px; max-width: 380px; padding: 12px 16px; border-radius: 10px; font-size: 13px; line-height: 1.45; color: #f1f5f9; background: #0f172a; border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 12px 32px rgba(0,0,0,0.45); transform: translateX(120%); opacity: 0; transition: transform .28s ease, opacity .28s ease; }
        .aiforya-sm-toast.is-visible { transform: translateX(0); opacity: 1; }
        .aiforya-sm-toast--success { border-left: 3px solid #4ade80; }
        .aiforya-sm-toast--error   { border-left: 3px solid #f87171; }
        .aiforya-sm-toast--warning { border-left: 3px solid #fbbf24; }
        .aiforya-sm-toast--info    { border-left: 3px solid #60a5fa; }
