/* Elaine's shared Messenger script editor */
.lm-script-backdrop[hidden]{display:none!important}
.lm-script-backdrop{position:fixed;inset:0;z-index:12500;background:rgba(15,31,45,.66);display:grid;place-items:center;padding:18px;backdrop-filter:blur(4px)}
.lm-script-modal{width:min(750px,100%);max-height:min(94dvh,940px);overflow:auto;background:#fff;border-radius:18px;box-shadow:0 25px 85px rgba(14,35,53,.35);color:#244354}
.lm-script-head{display:flex;align-items:flex-start;justify-content:space-between;padding:22px 26px 17px;border-bottom:1px solid #e7edf1;gap:16px}
.lm-script-head small{font-size:10px;letter-spacing:.13em;font-weight:900;color:#c62b71}
.lm-script-head h3{font:900 23px/1.15 Nunito,sans-serif;margin:6px 0;color:#264255}
.lm-script-head p{font-size:13px;margin:0;color:#657d8a}
.lm-script-close{border:0;border-radius:9px;background:#f8edf3;color:#ab3c70;cursor:pointer;font-size:25px;line-height:1;width:37px;height:37px}
.lm-script-body{padding:20px 26px 24px}
.lm-script-instructions{background:#fff5fa;border:1px solid #efcbdc;padding:14px 16px;border-radius:12px}
.lm-script-instructions strong{color:#a92864;font-size:13px}
.lm-script-instructions p{color:#775d6b;line-height:1.55;font-size:12px;margin:5px 0 0}
.lm-script-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin:15px 0 10px}
.lm-script-editor{min-height:260px;max-height:470px;overflow-y:auto;border:1.5px solid #cbd9e0;border-radius:11px;padding:16px 17px;line-height:1.72;white-space:pre-wrap;overflow-wrap:anywhere;font:500 14px/1.72 Nunito,system-ui,sans-serif;outline:none;color:#294253;background:#fff}
.lm-script-editor:focus{border-color:#df4191;box-shadow:0 0 0 3px #fce3ef}
.lm-script-link-chip{display:inline-block;border:1px solid #e995be;border-radius:8px;background:#fae7f0;padding:1px 9px;color:#a21f64;font-size:12px;font-weight:900;cursor:grab;white-space:nowrap;vertical-align:middle;user-select:none;touch-action:none}
.lm-script-link-chip:active{cursor:grabbing}
.lm-script-hint{font-size:12px;color:#547982;margin:9px 0 12px;font-weight:700}
.lm-script-hint.invalid{color:#cc3159}
.lm-script-preview-details{margin:13px 0;border:1px solid #e4ecf0;border-radius:12px;padding:12px 14px}
.lm-script-preview-details summary{font-size:12px;font-weight:900;cursor:pointer;color:#547081}
.lm-script-sample{white-space:pre-wrap;line-height:1.65;overflow-wrap:anywhere;font-size:12px;color:#506b79;margin-top:12px;background:#f6f9fb;border-radius:8px;padding:12px}
.lm-script-footer{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:9px;padding-top:15px;border-top:1px solid #edf1f4}
.lm-script-footer .btn:disabled{opacity:.48;cursor:not-allowed}
.lm-script-settings-intro{padding:18px 20px;border:1px solid #f0d7e1;background:#fff9fc;border-radius:13px;margin-bottom:18px}
.lm-script-settings-intro strong{font-size:18px;color:#a92965}
.lm-script-settings-intro p{font-size:13px;color:#57727f;line-height:1.5;margin:6px 0 0}
.lm-script-settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(235px,1fr));gap:13px}
.lm-script-template-card{display:flex;flex-direction:column;gap:12px;padding:17px;border:1px solid #e1e8eb;border-radius:13px;background:white}
.lm-script-template-top{display:flex;justify-content:space-between;align-items:center;gap:6px}
.lm-script-template-top strong{font-size:14px;color:#29495d}
.lm-script-template-top span{font-size:10px;font-weight:900;background:#fff0f6;border-radius:50px;padding:5px 9px;color:#af286c;white-space:nowrap}
.lm-script-template-card p{font-size:12px;color:#577582;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:6;-webkit-box-orient:vertical;overflow:hidden;min-height:110px;margin:0}
.lm-script-template-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:auto}
.lm-script-template-foot small{font-size:10px;color:#7e909a}
.lm-script-template-foot .btn{white-space:nowrap}
.lm-script-inline-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:10px 0}
.lm-script-edit-hint{color:#a62b6b;font-weight:800}
@media(max-width:650px){.lm-script-backdrop{padding:6px}.lm-script-modal{border-radius:11px;max-height:98dvh}.lm-script-head{padding:17px}.lm-script-body{padding:14px}.lm-script-editor{min-height:230px}.lm-script-template-foot{flex-direction:column;align-items:flex-start}}
/* Full-funnel Messenger message library */
.lm-script-settings-categories{display:grid;gap:22px}
.lm-script-search{display:grid;gap:7px;max-width:640px;margin:18px 0 20px}
.lm-script-search span,.lm-client-script-select-row label{font-size:12px;font-weight:900;color:#4e6979}
.lm-script-search input{min-height:44px}
.lm-script-group[hidden],.lm-script-template-card[hidden]{display:none!important}
.lm-script-group{padding:16px;background:#fafdff;border:1px solid #e5eaf0;border-radius:14px}
.lm-script-group-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;padding:0 2px 11px;border-bottom:1px solid #e5eaf0}
.lm-script-group-head strong{font-size:17px;color:#304a5b}
.lm-script-group-head p{font-size:12px;margin:4px 0 0;color:#738695}
.lm-script-group-head>span{font-size:11px;white-space:nowrap;font-weight:900;color:#bd3b7c;border:1px solid #f3d5e4;background:#fff5fa;padding:6px 10px;border-radius:30px}
.lm-script-template-usage{display:block;font-size:11px;color:#687e89;line-height:1.4;min-height:27px}
.lm-client-script-card{margin-bottom:16px;overflow:hidden}
.lm-client-script-card>summary{list-style:none;display:flex;justify-content:space-between;align-items:center;gap:14px;cursor:pointer}
.lm-client-script-card>summary::-webkit-details-marker{display:none}
.lm-client-script-card>summary span{display:grid;gap:4px}
.lm-client-script-card>summary small{font-size:10px;font-weight:900;color:#b83578;letter-spacing:.08em}
.lm-client-script-card>summary strong{font-size:17px;color:#2c4d60}
.lm-client-script-card>summary span span{font-size:12px;color:#69818f}
.lm-client-script-card>summary>b{font-size:11px;color:#af386f;white-space:nowrap}
.lm-client-script-content{display:grid;gap:11px;padding-top:18px;margin-top:17px;border-top:1px solid #ecf0f4}
.lm-client-script-select-row{display:grid;gap:8px}
.lm-client-script-select-row select{width:min(100%,510px);font-size:13px}
.lm-client-script-content textarea{width:100%;min-height:195px;line-height:1.6;box-sizing:border-box;white-space:pre-wrap}
.lm-script-note{font-size:11px;color:#728692;line-height:1.55}
.lm-handoff-script-choices{display:grid;gap:6px;margin:10px 0}
.lm-handoff-script-choices label{font-size:11px;font-weight:900;color:#556c7b}
.lm-handoff-script-choices select{width:100%;min-height:40px;box-sizing:border-box}
@media(max-width:620px){.lm-script-group{padding:10px}.lm-script-group-head{align-items:flex-start}.lm-client-script-card>summary strong{font-size:15px}.lm-client-script-card>summary>b{font-size:10px}}
/* v578: scripts are edited inside their own client profile, never in a separate settings page. */
.lm-script-inline-host[hidden],.lm-script-inline-editor[hidden]{display:none!important}
.lm-script-inline-host{display:block;min-width:0;max-width:100%;width:100%;margin:13px 0 4px}
.lm-script-inline-editor{position:relative;min-width:0;width:100%;background:#fff;border:1px solid #d9b9cd;border-top:4px solid #e45498;border-radius:12px;padding:0;box-shadow:0 7px 22px rgba(70,35,55,.045)}
.lm-script-inline-editor .lm-script-modal{width:100%;max-width:none;max-height:none;overflow:visible;background:transparent;color:#294253;border-radius:0;box-shadow:none}
.lm-script-inline-editor .lm-script-head{padding:13px 15px 11px;gap:10px}
.lm-script-inline-editor .lm-script-head h3{font-size:17px}
.lm-script-inline-editor .lm-script-head p{font-size:11px}
.lm-script-inline-editor .lm-script-body{padding:12px 15px 15px}
.lm-script-inline-editor .lm-script-instructions{padding:9px 12px;border-radius:8px}
.lm-script-inline-editor .lm-script-instructions strong{font-size:11px}
.lm-script-inline-editor .lm-script-instructions p{font-size:11px}
.lm-script-inline-editor .lm-script-editor{min-height:150px;max-height:none;overflow:visible;padding:11px 12px;font-size:13px;line-height:1.6}
.lm-script-inline-editor .lm-script-toolbar{margin:10px 0 8px}
.lm-script-inline-editor .lm-script-footer{padding-top:11px}
.lm-script-inline-editor .lm-script-close{width:30px;height:30px;font-size:21px;flex-shrink:0}
.lm-client-script-content>.lm-script-inline-host{margin-top:3px}
.admin-handoff-script>.lm-script-inline-host{margin:10px 0}
@media(max-width:620px){.lm-script-inline-editor .lm-script-head{padding:12px}.lm-script-inline-editor .lm-script-body{padding:10px}.lm-script-inline-editor .lm-script-footer{justify-content:start}}
/* Contextual shared-message editor, used wherever admin sends a client update. */
.lm-contextual-script{margin:12px 0;border:1px solid #efc6da;background:#fff9fc;padding:12px 14px;border-radius:11px;min-width:0}
.lm-contextual-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px}
.lm-contextual-head strong{font-size:12px;color:#a5336a}
.lm-contextual-script .lm-script-note{font-size:11px;line-height:1.5;color:#73818a;display:block;margin:6px 0 10px}
.lm-contextual-script .lm-contextual-message{display:block;box-sizing:border-box;width:100%;min-height:115px;white-space:pre-wrap;line-height:1.55;font-size:12px;resize:vertical}
.lm-contextual-script .actions{display:flex;gap:7px;margin-top:8px}
.lm-contextual-script .lm-script-inline-host{margin-top:10px}
@media(max-width:620px){.lm-contextual-head{align-items:start}.lm-contextual-script{padding:10px}}