.nedai-assistant,
.nedai-settings-preview {
    --nedai-header-bg: #2d8f1f;
    --nedai-header-fg: #fff;
    --nedai-launcher-bg: #2d8f1f;
    --nedai-launcher-fg: #fff;
    --nedai-shadow: rgba(36, 65, 31, .28);
}

.nedai-theme-lightgreen {--nedai-header-bg:#a8dfa0;--nedai-header-fg:#14211a;--nedai-launcher-bg:#a8dfa0;--nedai-launcher-fg:#14211a;--nedai-shadow:rgba(62,109,55,.22)}
.nedai-theme-lightblue {--nedai-header-bg:#a9ddf4;--nedai-header-fg:#13202b;--nedai-launcher-bg:#a9ddf4;--nedai-launcher-fg:#13202b;--nedai-shadow:rgba(46,94,120,.22)}
.nedai-theme-lightgrey {--nedai-header-bg:#d4d4d4;--nedai-header-fg:#171717;--nedai-launcher-bg:#d4d4d4;--nedai-launcher-fg:#171717;--nedai-shadow:rgba(75,75,75,.2)}
.nedai-theme-lightred {--nedai-header-bg:#ffb2b6;--nedai-header-fg:#2a1618;--nedai-launcher-bg:#ffb2b6;--nedai-launcher-fg:#2a1618;--nedai-shadow:rgba(132,61,67,.2)}
.nedai-theme-lightorange {--nedai-header-bg:#ffb58f;--nedai-header-fg:#2b190f;--nedai-launcher-bg:#ffb58f;--nedai-launcher-fg:#2b190f;--nedai-shadow:rgba(139,73,38,.22)}
.nedai-theme-darkgreen {--nedai-header-bg:#2d8f1f;--nedai-header-fg:#fff;--nedai-launcher-bg:#2d8f1f;--nedai-launcher-fg:#fff;--nedai-shadow:rgba(36,65,31,.28)}
.nedai-theme-darkblue {--nedai-header-bg:#176fbd;--nedai-header-fg:#fff;--nedai-launcher-bg:#176fbd;--nedai-launcher-fg:#fff;--nedai-shadow:rgba(18,67,108,.28)}
.nedai-theme-darkgrey {--nedai-header-bg:#666a6d;--nedai-header-fg:#fff;--nedai-launcher-bg:#666a6d;--nedai-launcher-fg:#fff;--nedai-shadow:rgba(48,51,53,.28)}
.nedai-theme-darkred {--nedai-header-bg:#b90f4d;--nedai-header-fg:#fff;--nedai-launcher-bg:#b90f4d;--nedai-launcher-fg:#fff;--nedai-shadow:rgba(105,14,47,.28)}
.nedai-theme-darkorange {--nedai-header-bg:#c75216;--nedai-header-fg:#fff;--nedai-launcher-bg:#c75216;--nedai-launcher-fg:#fff;--nedai-shadow:rgba(108,49,20,.28)}

/* Legacy class aliases retained so existing cached pages/configurations remain readable during upgrade. */
.nedai-theme-green {--nedai-header-bg:#2d8f1f;--nedai-header-fg:#fff;--nedai-launcher-bg:#2d8f1f;--nedai-launcher-fg:#fff;--nedai-shadow:rgba(36,65,31,.28)}
.nedai-theme-blue {--nedai-header-bg:#176fbd;--nedai-header-fg:#fff;--nedai-launcher-bg:#176fbd;--nedai-launcher-fg:#fff;--nedai-shadow:rgba(18,67,108,.28)}
.nedai-theme-red {--nedai-header-bg:#b90f4d;--nedai-header-fg:#fff;--nedai-launcher-bg:#b90f4d;--nedai-launcher-fg:#fff;--nedai-shadow:rgba(105,14,47,.28)}
.nedai-theme-orange {--nedai-header-bg:#c75216;--nedai-header-fg:#fff;--nedai-launcher-bg:#c75216;--nedai-launcher-fg:#fff;--nedai-shadow:rgba(108,49,20,.28)}
.nedai-theme-neutral {--nedai-header-bg:#666a6d;--nedai-header-fg:#fff;--nedai-launcher-bg:#666a6d;--nedai-launcher-fg:#fff;--nedai-shadow:rgba(48,51,53,.28)}
.nedai-theme-purple {--nedai-header-bg:#6f42c1;--nedai-header-fg:#fff;--nedai-launcher-bg:#6f42c1;--nedai-launcher-fg:#fff;--nedai-shadow:rgba(86,48,144,.24)}

.nedai-assistant{position:fixed;right:20px;bottom:20px;z-index:1055;font-family:inherit}
.nedai-launcher{min-width:52px;width:52px;height:52px;border:0;border-radius:50%;background:var(--nedai-launcher-bg);color:var(--nedai-launcher-fg);box-shadow:0 8px 24px var(--nedai-shadow);cursor:pointer;font-weight:800;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 14px}
.nedai-launcher--with-name{width:auto;max-width:220px;border-radius:999px}
.nedai-launcher-name{max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nedai-panel{position:absolute;right:0;bottom:66px;width:min(390px,calc(100vw - 32px));height:min(600px,calc(100vh - 110px));background:#fff;border:1px solid #dce1e4;border-radius:18px;box-shadow:0 24px 70px rgba(31,41,47,.22);overflow:hidden;display:flex;flex-direction:column;color:#24313a}
.nedai-panel[hidden]{display:none}
.nedai-assistant .nedai-header{display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:12px 16px 11px;background:var(--nedai-header-bg);color:var(--nedai-header-fg);border-bottom:1px solid rgba(0,0,0,.08)}
.nedai-assistant .nedai-header-top,.nedai-assistant .nedai-header-bottom{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:10px;width:100%;min-width:0;box-sizing:border-box}
.nedai-title-row{display:flex;align-items:center;justify-self:start;gap:8px;min-width:0}
.nedai-title{font-size:1.05rem;font-weight:800}
.nedai-status-badge{display:inline-block;border:1px solid currentColor;border-radius:2px;padding:1px 4px;font-size:.68rem;font-weight:600;line-height:1.1;white-space:nowrap}
.nedai-profile-row{width:100%;max-width:220px;min-width:0;justify-self:start}
.nedai-profile-name{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nedai-profile-switcher{display:block;width:100%;max-width:100%;min-width:0;border:0;border-bottom:1px solid rgba(255,255,255,.55);background:transparent;color:inherit;font:inherit;padding:0 16px 1px 1px;cursor:pointer;text-overflow:ellipsis}
.nedai-profile-switcher:focus{outline:2px solid currentColor;outline-offset:2px}
.nedai-profile-switcher option{background:#fff;color:#24313a}
.nedai-header-close,.nedai-newchat{background:transparent;color:inherit;flex-shrink:0}
.nedai-header-close{display:inline-flex;align-items:center;justify-content:center;justify-self:end;width:22px;height:22px;border:1px solid currentColor;border-radius:0;padding:0;font-size:1.1rem;line-height:1;box-sizing:border-box}
.nedai-newchat{justify-self:end;border:0;padding:3px 4px;font-size:.78rem}
.nedai-credits{padding:9px 14px;background:#f1f4f3;border-bottom:1px solid #dce1e4;color:#34464e;font-size:.8rem;font-weight:700}
.nedai-context{padding:8px 14px;border-bottom:1px solid #edf0f2;color:#65747c;font-size:.75rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nedai-messages{flex:1;overflow-y:auto;padding:14px}
.nedai-message{display:flex;margin:0 0 10px}
.nedai-message-user{justify-content:flex-end}
.nedai-bubble{max-width:86%;padding:9px 11px;border-radius:13px;background:#f0f2f3;white-space:pre-wrap;overflow-wrap:anywhere}
.nedai-message-user .nedai-bubble{background:#e9eef1;color:#24313a}
.nedai-message-error .nedai-bubble{background:#fff1f1;color:#9c2d2d}
.nedai-starters{padding:0 14px 10px;display:flex;flex-wrap:wrap;gap:7px}
.nedai-starters[hidden]{display:none}
.nedai-starters button{border:1px solid #cbd3d7;border-radius:999px;background:#fff;color:#34464e;padding:6px 10px;font-size:.78rem}
.nedai-composer{display:flex;gap:8px;padding:10px 12px 6px;border-top:1px solid #e3e7e9}
.nedai-composer textarea{flex:1;resize:none;border:1px solid #bdc7cc;border-radius:11px;padding:9px 10px}
.nedai-composer textarea:focus{outline:2px solid #5f6f77;outline-offset:1px}
.nedai-composer button{border:0;border-radius:10px;background:#44545c;color:#fff;padding:10px 13px;font-weight:700}
.nedai-disclaimer{text-align:center;padding:0 10px 8px;color:#748188;font-size:.68rem}
.nedai-quickrail{display:flex;gap:8px;padding:7px 14px 10px;border-top:1px solid #e3e7e9}
.nedai-quickrail-item{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:5px;background:#0f6cbf;color:#fff;text-decoration:none;font-weight:800}
.nedai-quickrail-item--hub{background:#2d8f1f}
.nedai-quickrail-item--query{background:#0f6cbf}

/* Admin settings live preview. */
.nedai-settings-preview{max-width:390px;margin-top:12px}
.nedai-settings-preview-panel{border:1px solid #dce1e4;border-radius:14px;background:#fff;overflow:hidden;box-shadow:0 8px 28px rgba(31,41,47,.12)}
.nedai-settings-preview-header{padding:13px 14px;background:var(--nedai-header-bg);color:var(--nedai-header-fg);border-bottom:1px solid rgba(0,0,0,.08)}
.nedai-settings-preview-title{font-weight:800}
.nedai-settings-preview-status{font-size:.75rem;color:inherit;opacity:.92}
.nedai-settings-preview-bubble{margin:18px 14px 32px;display:inline-block;padding:9px 11px;border-radius:13px;background:#f0f2f3;color:#24313a}
.nedai-settings-preview-launcher{margin:12px 0 0 auto;min-width:48px;width:48px;height:48px;border-radius:50%;background:var(--nedai-launcher-bg);color:var(--nedai-launcher-fg);display:flex;align-items:center;justify-content:center;gap:7px;font-weight:800;padding:0 13px}
.nedai-settings-preview-launcher.is-with-name{width:max-content;max-width:220px;border-radius:999px}
.nedai-settings-preview-name{display:none;max-width:140px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nedai-settings-preview-launcher.is-with-name .nedai-settings-preview-name{display:inline}

@media(max-width:600px){.nedai-assistant{right:12px;bottom:12px}.nedai-panel{position:fixed;inset:12px;width:auto;height:auto}}
