.bot-layout{display:grid;grid-template-columns:290px minmax(0,1fr);gap:20px;align-items:start}.bot-list,.bot-editor,.bot-history{background:var(--panel,#fff);border:1px solid var(--border,#e5e7eb);border-radius:14px}.bot-list{padding:16px}.bot-list-head,.bot-editor-head,.bot-save-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.bot-list-head h2,.bot-list-head h3{margin:0}.bot-card{display:block;width:100%;text-align:left;border:1px solid var(--border,#e5e7eb);border-radius:10px;background:transparent;padding:14px;margin-top:12px;cursor:pointer;color:inherit}.bot-card.selected{border-color:var(--accent,#2763e7);background:#f2f6ff}.bot-card>div{display:flex;justify-content:space-between;gap:8px}.bot-card p{margin:10px 0 6px;font-size:13px;overflow-wrap:anywhere}.bot-card small,.bot-empty,.bot-welcome p,.bot-editor-head p{color:var(--muted,#68758c)}.bot-chip{display:inline-flex;align-items:center;padding:3px 8px;border-radius:20px;background:#eef2f7;font-size:11px;white-space:nowrap}.bot-editor{padding:24px;min-height:360px}.bot-editor h2{margin:0}.bot-editor-head{align-items:start;margin-bottom:24px}.bot-editor-head p{font-size:13px;margin:8px 0}.bot-fields{display:grid;grid-template-columns:1fr 1fr;gap:18px}.bot-fields label{display:flex;flex-direction:column;gap:8px;font-size:13px}.bot-fields .bot-check{flex-direction:row;align-items:center}.bot-editor fieldset{border:0;padding:0;min-width:0}.bot-target{border-top:1px solid var(--border,#e5e7eb);margin-top:24px;padding-top:20px}.bot-target h3{margin:0}.bot-target p{font-size:12px;line-height:1.7}.bot-current{font-size:13px;margin:14px 0}.bot-session{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid var(--border,#e5e7eb);border-radius:8px;margin-top:8px;cursor:pointer}.bot-session>span:nth-child(2){flex:1;min-width:0;overflow-wrap:anywhere}.bot-session small{display:block;margin-top:5px;color:var(--muted,#68758c)}#botSessionList{max-height:300px;overflow:auto;margin:12px 0}.bot-save-row{justify-content:flex-start;margin-top:24px}.bot-error{background:#fff2f1;color:#b42318;border:1px solid #f4c5c0;border-radius:10px;padding:14px;margin-bottom:16px}.bot-empty{padding:24px 8px;font-size:13px;text-align:center;line-height:1.8}.bot-welcome{text-align:center;max-width:440px;margin:36px auto}.bot-welcome-icon{font-size:42px;color:#3475db}.bot-welcome p{line-height:1.8;font-size:13px}.bot-history{padding:20px;margin-top:24px}.bot-history h2{font-size:16px}.bot-table-wrap{overflow:auto}.bot-table{width:100%;border-collapse:collapse;font-size:12px;margin-top:16px}.bot-table th,.bot-table td{padding:12px;text-align:left;border-bottom:1px solid var(--border,#e5e7eb)}.bot-record-error{display:block;color:#b42318;margin-top:6px;max-width:260px}.node-notification{border:1px solid var(--border,#e5e7eb);border-radius:8px;padding:12px;margin:14px 0}.bot-trigger-options{display:grid;gap:8px;margin:10px 0}.bot-trigger-options label{display:flex;gap:8px;align-items:center}.node-notification textarea{width:100%;resize:vertical}@media(max-width:950px){.bot-layout{grid-template-columns:1fr}.bot-fields{grid-template-columns:1fr}.bot-save-row{flex-wrap:wrap}}

/* Fixed workspace geometry keeps loading, selection and session refresh stable. */
#botsContent{display:flex;flex-direction:column;gap:0;min-width:0}.bot-message-bar{height:40px;min-height:40px;margin:0 0 12px;padding:10px 14px;font-size:12px;color:var(--muted);overflow:auto;border-radius:8px}.bot-message-bar.bot-error{color:#b42318}.bot-layout{grid-template-columns:220px minmax(0,1fr);height:clamp(520px,64vh,680px);min-height:520px;gap:16px}.bot-list{height:100%;overflow-y:auto;min-height:0;box-sizing:border-box}.bot-list-head{flex-shrink:0}.bot-card>div{align-items:center}.bot-card p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bot-editor{height:100%;min-height:0;padding:20px;box-sizing:border-box;overflow:hidden}.bot-editor form{display:flex;flex-direction:column;height:100%;min-height:0}.bot-editor-head{flex-shrink:0;margin-bottom:16px}.bot-editor fieldset{flex:1;min-height:0;overflow-y:auto;padding-right:8px}.bot-save-row{position:sticky;bottom:0;background:var(--panel,#fff);padding:14px 0;margin-top:10px;border-top:1px solid var(--border,#e5e7eb)}.bot-fields{grid-template-columns:1fr;gap:14px}.bot-welcome{height:100%;max-width:420px;margin:0 auto;display:flex;flex-direction:column;align-items:center;justify-content:center}.bot-welcome h2{font-size:20px}.bot-welcome p{margin:12px 0}.bot-welcome .button{flex-shrink:0}.bot-current{min-height:28px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#botSessionList{height:156px;min-height:156px;max-height:156px;overflow-y:auto;box-sizing:border-box}.bot-empty{display:flex;align-items:center;justify-content:center;min-height:70px}.bot-history{height:226px;min-height:226px;box-sizing:border-box;overflow:auto;margin-top:16px}.bot-history h2{font-size:16px;margin:0}.bot-history .bot-list-head{position:sticky;top:0;background:var(--panel,#fff);padding-bottom:8px;z-index:1}.bot-source-label{display:block;color:var(--muted);font-size:11px;margin-top:4px}.bot-skeleton{height:104px;background:var(--bg,#f0f3f8);border-radius:10px;margin-top:14px;opacity:.65}.notification-config-head{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:12px;color:var(--muted);margin:10px 0}.notification-config-head>span{flex:1;min-width:180px}.notification-config-card{padding:14px;margin:14px 0;border:1px solid var(--border,#e5e7eb);border-radius:10px;min-width:0}.notification-config-card label{display:block;margin-top:12px;font-size:12px}.notification-config-card label .select,.notification-config-card label .input{display:block;width:100%;margin-top:7px;box-sizing:border-box}.notification-config-card textarea{resize:vertical}.notification-config-title{display:flex;justify-content:space-between;align-items:center}.notification-config-card .bot-trigger-options label{display:flex;gap:7px;align-items:center;margin-top:0}.notification-presets{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:12px 0;color:var(--muted);font-size:11px}.notification-variable-buttons{display:flex;flex-wrap:wrap;gap:5px;margin:9px 0}.notification-variable-buttons button{border:1px solid var(--border,#e5e7eb);border-radius:5px;background:var(--bg,#f6f8fb);color:var(--muted);padding:4px 6px;font-size:10px;cursor:pointer}.notification-preview{margin-top:14px;padding:10px;background:var(--bg,#f6f8fb);border:1px solid var(--border,#e5e7eb);border-radius:7px}.notification-preview>div{display:flex;justify-content:space-between;gap:8px;font-size:11px}.notification-preview small{color:var(--muted);font-size:10px}.notification-preview pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;line-height:1.7;margin:9px 0 0;max-height:180px;min-height:82px;overflow:auto;font-family:inherit}.schedule-notifications{margin-top:18px;padding-top:14px;border-top:1px solid var(--border)}.schedule-notifications h3{margin:0}.assistant-notification-editor{max-height:520px;overflow-y:auto}.notification-config-error{color:#b42318}
@media(min-width:1150px){.bot-layout{grid-template-columns:270px minmax(0,1fr)}.bot-fields{grid-template-columns:1fr 1fr}}
@media(max-width:680px){.bot-layout{grid-template-columns:1fr;grid-template-rows:150px minmax(0,1fr);height:760px;min-height:760px}.bot-list{padding:12px}.bot-list .bot-card{margin-top:8px;padding:10px}.bot-editor{padding:16px}.bot-card small{display:none}}

#botsView .page-header{display:flex;justify-content:space-between;align-items:center;gap:20px;margin:0 0 12px}#botsView .page-header h1{font-size:28px;line-height:1.2;margin:5px 0 7px}#botsView .page-header .eyebrow{margin:0;font-size:11px}#botsView .page-header p.muted{margin:0;font-size:12px}.bot-layout{height:clamp(420px,58vh,620px);min-height:420px}.bot-message-bar{height:34px;min-height:34px;padding:8px 12px}.bot-history{height:210px;min-height:210px}.bot-editor-head h2{font-size:20px}.bot-editor-head p{margin:6px 0}.bot-editor-head{margin-bottom:12px}.bot-fields label{font-size:12px}.bot-target{margin-top:18px;padding-top:16px}
@media(max-width:680px){.bot-layout{height:720px;min-height:720px}}

/* Keep the SOP report editor inside the viewport as its content grows. */
.flow-settings-panel{max-height:calc(100dvh - 180px)}
.flow-settings-body{min-height:0;overflow:auto}

.flow-settings-notifications{grid-column:1/-1;border-top:1px solid var(--v3-line);padding-top:18px}

[data-sop-notification-custom]{border-top:1px solid var(--v3-line);padding-top:12px}
[data-sop-notification-custom] summary{cursor:pointer;font-weight:600;margin-bottom:12px}
[data-sop-notification-custom] label{display:block;margin:12px 0}

.sop-message-fields{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.sop-more-fields summary{font-size:12px;color:var(--muted);font-weight:400}
.sop-notification-example{border:1px solid var(--v3-line);border-radius:10px;background:var(--bg,#f6f8fb);padding:14px;margin:14px 0}
.sop-notification-example>div:first-child{display:flex;justify-content:space-between;gap:12px}
.sop-notification-example small{color:var(--muted);font-size:11px}
[data-sop-notification-preview]{max-height:280px;min-height:110px;overflow:auto;overflow-wrap:anywhere;margin-top:14px;font-size:13px}
[data-sop-notification-preview] h3{font-size:16px;margin:12px 0 8px}
[data-sop-notification-preview] p{margin:6px 0}

.sop-message-compose{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px;align-items:start}
.sop-message-edit{min-width:0}
.sop-message-compose .sop-notification-example{margin:0}
.sop-message-compose .sop-notification-example>div:first-child{flex-wrap:wrap}
@media(max-width:850px){.sop-message-compose{grid-template-columns:1fr}}

.bot-model-field .ai-model-menu{position:fixed;right:auto;bottom:auto;min-width:0;max-width:calc(100vw - 24px);z-index:100}

.bot-interaction-hint{font-size:12px;line-height:1.7}.bot-interaction-records{border-top:1px solid var(--border);padding-top:14px;margin-top:14px}.bot-interaction-records details{margin-top:12px;font-size:12px}.bot-interaction-entry{border-bottom:1px solid var(--border);padding:10px 0;overflow-wrap:anywhere}.bot-interaction-entry small{color:var(--muted)}
