.channel-workspace{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:20px;align-items:start}.channel-directory,.channel-editor{min-width:0;border:1px solid var(--line);border-radius:16px;background:var(--surface);box-shadow:0 3px 18px var(--shadow-color)}.channel-directory-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:22px}.channel-directory-head h2,.channel-editor h2{font-size:17px;margin:0 0 7px}.channel-directory-head h2 span{font-size:11px;color:var(--muted);font-weight:500;margin-left:6px}.channel-directory-head p,.channel-editor p{font-size:12px;color:var(--muted);line-height:1.6;margin:0}.channel-filters{display:flex;gap:8px;padding:14px 20px;background:var(--accent-faint);border-block:1px solid var(--line)}.channel-filters input{min-width:150px;flex:1}.channel-filters select{width:auto;max-width:140px}.channel-filters input,.channel-filters select{font-size:12px;padding:9px 10px;min-height:36px}.channel-filters .btn{padding:8px 12px;font-size:12px}.channel-table-scroll{overflow:auto;min-height:240px}.channel-table{width:100%;min-width:820px;border-collapse:collapse;table-layout:auto}.channel-table th{padding:12px 16px;text-align:left;color:var(--muted);font-size:11px;font-weight:500;white-space:nowrap}.channel-table td{padding:16px;border-top:1px solid var(--line);vertical-align:top;font-size:12px}.channel-table td:first-child{min-width:190px;max-width:280px}.channel-table tr.is-selected td{background:var(--accent-faint)}.channel-table .channel-name{display:flex;gap:9px;align-items:center}.channel-name>div{min-width:0}.channel-name strong{font-size:12px;font-weight:650;overflow-wrap:anywhere}.channel-name small{display:block;font-size:10px;color:var(--muted);max-width:230px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:5px}.channel-bindings-preview{margin:10px 0 0 39px}.channel-bindings-preview summary{font-size:11px;color:var(--muted);cursor:pointer}.channel-bindings-preview .channel-tags{margin-top:12px;max-width:270px;max-height:240px;overflow:auto;padding:4px 8px 4px 0}.channel-tags{display:flex;flex-wrap:wrap;gap:10px;min-height:36px;max-height:230px;overflow:auto;padding:6px 8px 6px 0}.channel-tag{display:inline-block;position:relative;max-width:100%;font-size:11px;line-height:1.5;padding:6px 19px 6px 9px;background:var(--accent-soft);border:1px solid var(--line);border-radius:7px;color:var(--ink);overflow-wrap:anywhere}.channel-tag button{position:absolute;right:-5px;top:-5px;display:grid;place-items:center;border:1px solid var(--line-strong);background:var(--surface);color:var(--muted);border-radius:50%;width:18px;height:18px;font-size:14px;line-height:1;padding:0;cursor:pointer}.channel-tag button:hover{background:var(--danger-soft);color:var(--danger);border-color:var(--danger)}.channel-route-inputs{display:flex;gap:6px;min-width:150px}.channel-route-inputs label{white-space:nowrap;display:flex;align-items:center;background:var(--accent-soft);border:1px solid var(--line);border-radius:7px;color:var(--muted);font-size:10px;padding-left:7px;gap:5px;overflow:hidden}.channel-route-inputs input{width:56px;border:0;border-left:1px solid var(--line);border-radius:0;min-height:32px;padding:7px 4px;text-align:center;font-size:12px;font-weight:650;background:var(--surface);color:var(--ink);appearance:textfield}.channel-route-inputs input::-webkit-inner-spin-button{appearance:none}.channel-health{display:inline-flex;align-items:center;border-radius:20px;font-size:10px;padding:6px 9px;background:var(--accent-soft);white-space:nowrap}.channel-health.is-good{background:var(--success-soft);color:var(--success)}.channel-health.is-bad{background:var(--danger-soft);color:var(--danger)}.channel-test-time{display:block;color:var(--muted);font-size:9px;margin-top:7px;max-width:145px;line-height:1.5}.channel-table .btn{font-size:11px;padding:7px 9px;min-height:30px;white-space:nowrap;border-radius:7px}.channel-row-actions{display:flex;gap:4px;flex-wrap:wrap;max-width:170px;min-width:118px}.channel-pagination{display:flex;align-items:center;justify-content:flex-end;gap:14px;padding:16px 20px;border-top:1px solid var(--line);font-size:11px;color:var(--muted)}.channel-pagination .btn{font-size:11px;padding:7px 10px}.channel-empty{text-align:center;padding:40px 18px!important;color:var(--muted);font-size:12px;line-height:1.7}
.channel-editor{position:sticky;top:80px;max-height:calc(100dvh - 210px);overflow:auto}.channel-editor>header{display:flex;justify-content:space-between;align-items:start;gap:8px;padding:20px;border-bottom:1px solid var(--line)}.channel-editor>header>span{font-size:10px;white-space:nowrap;color:var(--muted);background:var(--accent-soft);padding:4px 6px;border-radius:5px}.channel-editor form{padding:0 18px}.channel-editor .field{margin:0 0 14px;gap:6px}.channel-editor .field>span{font-size:12px}.channel-editor input,.channel-editor select{font-size:12px;padding:10px;min-height:36px}.channel-editor .btn{font-size:12px;padding:9px 11px}.channel-form-section{padding:20px 0;border-bottom:1px solid var(--line)}.channel-editor h3{font-size:13px;margin:0 0 14px}.channel-editor small{font-size:10px;color:var(--muted);line-height:1.6}.channel-section-title{display:flex;justify-content:space-between;align-items:center}.channel-section-title h3{margin:0}.channel-section-title h3 span{font-size:11px;font-weight:500;color:var(--muted);margin-left:4px}.channel-two{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:10px 0}.channel-two>*{min-width:0}.channel-editor #binding-search{margin-top:4px}.channel-picker-bar{display:flex;align-items:center;gap:5px;padding:14px 0 5px;font-size:10px;color:var(--muted)}.channel-picker-bar>span{margin-right:auto}.channel-picker-bar .btn{padding:4px;font-size:10px}.channel-picker{display:flex;flex-direction:column;gap:4px;padding:4px;max-height:190px;overflow:auto;border:1px solid var(--line);border-radius:8px;margin:3px 0 10px}.channel-picker>button{flex:none;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;width:100%;text-align:left;background:none;border:0;border-radius:7px;font-size:11px;color:var(--ink);cursor:pointer}.channel-picker>button:last-child{border-bottom:0}.channel-picker>button:hover,.channel-picker>button.is-selected{background:var(--accent-soft)}.channel-picker>button span{overflow-wrap:anywhere;min-width:0}.channel-picker small{display:block;font-size:9px;margin-top:2px}.channel-picker b{font-size:14px}.channel-picker>p{padding:12px;font-size:11px}.channel-redirects{max-height:230px;overflow:auto;margin-top:10px}.channel-redirects label{display:grid;grid-template-columns:minmax(0,1fr) 10px minmax(0,1fr);gap:8px;align-items:center;margin:9px 0}.channel-redirects label span{font-size:10px;overflow-wrap:anywhere;color:var(--muted)}.channel-redirects i{font-style:normal;color:var(--muted)}.channel-redirects input{padding:8px;font-size:10px;min-width:0}.channel-editor .switch-field{margin:18px 0}.channel-editor .switch-field strong{font-size:12px}.channel-advanced{border-top:1px solid var(--line);padding:15px 0}.channel-advanced summary{font-size:12px;font-weight:600;margin:0 0 15px;cursor:pointer}.channel-advanced summary small{margin-left:8px;font-weight:400}.channel-advanced>small{display:block;margin-bottom:16px}.channel-save-bar{position:sticky;bottom:0;background:var(--surface);padding:12px 0 16px;border-top:1px solid var(--line);z-index:2}.channel-workspace .registry-error{font-size:12px;color:var(--danger);margin:12px 0}.channel-tools-dialog{width:min(760px,94vw);max-width:760px}.channel-test-dialog>p{font-size:12px;line-height:1.7}.channel-test-models{display:flex;flex-wrap:wrap;gap:10px;max-height:190px;overflow:auto;padding:12px 0}.channel-test-models label{display:flex;gap:7px;align-items:center;font-size:12px;padding:8px;border:1px solid var(--line);border-radius:7px}.channel-test-models small{font-size:10px;color:var(--muted)}.channel-test-select-actions,.channel-test-actions{display:flex;gap:8px;flex-wrap:wrap}.channel-test-actions{padding-top:14px;border-top:1px solid var(--line)}.channel-tools-dialog .btn{font-size:12px}.channel-test-results{max-height:310px;overflow:auto}.channel-test-results article{display:flex;justify-content:space-between;gap:16px;padding:12px 4px;border-top:1px solid var(--line);font-size:12px}.channel-test-results article>div{min-width:0}.channel-test-results article>span{flex-shrink:0;text-align:right}.channel-test-results article small{display:block;white-space:pre-wrap;overflow-wrap:anywhere;max-height:100px;overflow:auto;font-size:11px;line-height:1.6;color:var(--muted);margin-top:4px}.channel-test-results .is-bad>span{color:var(--danger)}.channel-test-results .is-good>span{color:var(--success)}#test-progress{font-size:12px;color:var(--muted)}.channel-chat-tool>.muted{font-size:12px;line-height:1.7}.channel-chat-messages{height:340px;overflow:auto;padding:16px;background:var(--accent-faint);border:1px solid var(--line);border-radius:12px;margin:16px 0}.channel-chat-bubble{max-width:92%;font-size:13px;line-height:1.7;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface);margin-bottom:14px;overflow-wrap:anywhere}.channel-chat-bubble>strong{font-size:10px;color:var(--muted)}.channel-chat-bubble>div{white-space:pre-wrap;margin-top:5px}.channel-chat-bubble.user{margin-left:auto;background:var(--accent-soft)}.channel-chat-bubble pre{white-space:pre-wrap;overflow-wrap:anywhere;font-family:inherit;font-size:11px}.channel-chat-bubble summary{font-size:11px;color:var(--muted);cursor:pointer}.channel-chat-tool textarea{width:100%;resize:vertical}.channel-chat-actions{display:flex;align-items:center;gap:8px;margin-top:12px;flex-wrap:wrap}.channel-chat-actions>span{margin-left:auto;color:var(--muted);font-size:11px}.channel-chat-tool .registry-error{font-size:12px;color:var(--danger)}
@media(min-width:1800px){.channel-workspace{grid-template-columns:minmax(0,1fr) 370px}.channel-row-actions{max-width:none;flex-wrap:nowrap}.channel-route-inputs input{width:65px}}
@media(max-width:1180px){.channel-workspace{grid-template-columns:minmax(0,1fr)}.channel-editor{position:static;max-height:none}.channel-editor form{display:grid;grid-template-columns:1fr 1fr;gap:0 28px}.channel-editor .channel-save-bar,.channel-editor .registry-error{grid-column:1/-1}.channel-editor .channel-save-bar{position:static}.channel-editor .channel-advanced{grid-column:1/-1}.channel-editor .channel-advanced[open]{display:block}}
@media(max-width:640px){.channel-workspace{gap:16px}.channel-directory-head{padding:16px;gap:8px}.channel-directory-head h2{font-size:15px}.channel-directory-head p{font-size:10px}.channel-filters{padding:12px;flex-wrap:wrap}.channel-filters input{flex-basis:100%;width:100%}.channel-filters select{flex:1;max-width:none}.channel-editor form{display:block;padding:0 16px}.channel-editor>header{padding:16px}.channel-table td{padding:12px}.channel-pagination{padding:12px}.channel-tools-dialog{padding:18px}.channel-chat-messages{height:280px}.channel-test-models{max-height:160px}.channel-chat-actions>span{width:100%;order:4;margin-left:0}.channel-chat-actions [type=submit]{margin-left:auto}}
/* Channel test workspace: explicit sizes avoid generic admin form overrides. */
body.admin-mode dialog.channel-probe-dialog{width:min(1000px,calc(100vw - 32px));max-width:1000px;max-height:calc(100dvh - 32px);padding:0;overflow:hidden;border-radius:26px;background:var(--surface);display:flex;flex-direction:column;color:var(--ink)}
body.admin-mode dialog.channel-probe-dialog:not([open]){display:none}
body.admin-mode dialog.channel-probe-dialog>.dialog-head{position:absolute;right:28px;top:28px;margin:0;border:0;z-index:2}
body.admin-mode dialog.channel-probe-dialog>.dialog-head h2{display:none}
body.admin-mode dialog.channel-probe-dialog>.dialog-head .icon-btn{width:44px;height:44px;background:var(--accent-faint);border:1px solid var(--line);border-radius:10px;color:var(--muted)}
.channel-probe-heading{padding:30px 34px 24px;border-bottom:1px solid var(--line);flex-shrink:0}
.channel-probe-heading>span{display:none}
.channel-probe-heading h2{font-size:26px;line-height:1.3;margin:12px 55px 12px 0;font-weight:750}
.channel-probe-heading p{margin:0;font-size:14px;color:var(--muted);line-height:1.7;padding-right:30px}
.channel-probe-scroll{overflow:auto;min-height:0;padding:26px 34px 20px;overscroll-behavior:contain;scrollbar-gutter:stable}
.channel-probe-settings{display:grid;grid-template-columns:230px minmax(0,1fr);gap:16px;margin-bottom:26px}
.channel-probe-settings label{display:flex;flex-direction:column;gap:10px;font-size:14px;font-weight:650}
body.admin-mode .channel-probe-settings input,body.admin-mode .channel-probe-settings select{width:100%;min-height:52px;padding:12px 16px;border:1px solid var(--line-strong);border-radius:12px;background:var(--surface);color:var(--ink);font-size:15px;font-weight:600}
.channel-probe-selection{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.channel-probe-selection h3{font-size:16px;margin:0}.channel-probe-selection>div{display:flex;gap:8px;align-items:center}
body.admin-mode dialog.channel-probe-dialog .btn{font-size:14px;min-height:40px;padding:9px 15px;border-radius:11px;box-shadow:none;white-space:nowrap}
.channel-probe-selection #test-selected{border-radius:30px;background:var(--accent-faint);padding:8px 12px;color:var(--muted);font-size:13px;font-weight:650;white-space:nowrap}
.channel-probe-models{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:16px}
body.admin-mode .channel-probe-models label{display:flex;align-items:center;gap:13px;min-width:0;min-height:78px;padding:14px;border:1px solid var(--line);background:var(--accent-faint);border-radius:9px;cursor:pointer;transition:border-color .15s,background .15s}
body.admin-mode .channel-probe-models label:has(input:checked){border-color:var(--line-strong);background:var(--hover)}
body.admin-mode .channel-probe-models input[type=checkbox]{appearance:auto;width:21px;height:21px;min-height:0;flex:0 0 21px;padding:0;margin:0;accent-color:var(--accent);box-shadow:none}
.channel-probe-models label>span{min-width:0;flex:1}.channel-probe-models strong{display:block;font-size:15px;font-weight:700;overflow-wrap:anywhere;line-height:1.4}.channel-probe-models small{display:block;font-size:12px;color:var(--muted);margin-top:5px}
.channel-probe-models i{font-style:normal;font-size:11px;white-space:nowrap;color:var(--muted);background:var(--accent-soft);border-radius:20px;padding:5px 9px}
.channel-probe-note{background:var(--warning-soft);color:var(--warning);font-size:12px;line-height:1.8;border-radius:9px;padding:14px 16px;margin:16px 0 20px}
.channel-probe-summary{border-top:1px solid var(--line);padding:18px 0 10px;display:flex;gap:12px;align-items:center;justify-content:space-between}.channel-probe-summary>div{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.channel-probe-summary #test-progress{font-size:15px;color:var(--ink);margin:0}.channel-probe-summary #test-counts{font-size:12px;color:var(--muted)}
body.admin-mode .channel-probe-summary .danger{background:var(--surface);color:var(--ink);border:1px solid color-mix(in srgb,var(--danger) 35%,var(--line))}
.channel-probe-results{display:grid;gap:10px}.channel-probe-results article{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px;border:1px solid var(--line);border-left-width:4px;border-radius:10px;background:var(--accent-faint);min-height:78px}.channel-probe-results article>div{min-width:0}.channel-probe-results article strong{font-size:15px;overflow-wrap:anywhere}.channel-probe-results article small{display:block;margin-top:6px;font-size:12px;line-height:1.6;color:var(--muted);overflow-wrap:anywhere;max-height:80px;overflow:auto}.channel-probe-results article>span{font-size:15px;font-weight:700;flex-shrink:0}.channel-probe-results article.is-good{background:var(--success-soft);border-color:color-mix(in srgb,var(--success) 35%,var(--line));color:var(--success)}.channel-probe-results article.is-bad{background:var(--danger-soft);border-color:color-mix(in srgb,var(--danger) 45%,var(--line));color:var(--danger)}.channel-probe-results article.is-running{box-shadow:0 0 0 3px var(--accent-faint)}.channel-probe-results .is-cancelled{opacity:.65}
.channel-probe-footer{display:flex;gap:14px;padding:20px 34px 24px;border-top:1px solid var(--line);background:var(--surface);flex-shrink:0}.channel-probe-footer>.btn{flex:1;min-height:52px!important}.channel-probe-footer [hidden]{display:none!important}
.channel-name-button{border:0;background:none;color:var(--ink);padding:0;font:inherit;font-weight:700;text-align:left;cursor:pointer}.channel-name-button:hover{color:var(--accent)}
.channel-workspace .channel-table tr.is-selected td:first-child{box-shadow:inset 2px 0 0 var(--ink)}.channel-workspace .channel-editor{max-height:calc(100dvh - 110px)}.channel-editor>header{position:static;background:var(--surface)}.channel-workspace .channel-tag{font-size:12px}.channel-workspace .channel-tags{align-content:start}.channel-workspace .channel-table td{padding-block:18px}.channel-workspace .channel-name strong,.channel-workspace .channel-name-button{font-size:13px}.channel-workspace .channel-row-actions{gap:6px}.theme-trigger [hidden]{display:none!important}
@media(max-width:700px){body.admin-mode dialog.channel-probe-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:18px}.channel-probe-heading{padding:22px 20px 18px}.channel-probe-heading h2{font-size:22px}.channel-probe-heading p{font-size:12px;padding-right:0}body.admin-mode dialog.channel-probe-dialog>.dialog-head{right:16px;top:18px}.channel-probe-scroll{padding:20px 16px}.channel-probe-settings{grid-template-columns:1fr;gap:12px}.channel-probe-models{grid-template-columns:1fr}.channel-probe-selection{align-items:start;flex-direction:column}.channel-probe-results article{align-items:start;flex-direction:column;gap:8px}.channel-probe-summary{align-items:start;flex-direction:column}.channel-probe-footer{padding:14px;gap:8px;flex-wrap:wrap}.channel-probe-footer>.btn{padding:9px!important;font-size:12px!important}.channel-workspace .channel-editor{max-height:none}}



body.admin-mode dialog.channel-probe-dialog .channel-probe-models strong{font-size:16px}
body.admin-mode dialog.channel-probe-dialog .channel-probe-summary .btn.danger{background:var(--surface);color:var(--ink);border-color:color-mix(in srgb,var(--danger) 30%,var(--line))}
.channel-pool-disclosure{margin:15px 0 10px;border:1px solid var(--line);border-radius:9px;padding:10px}
.channel-pool-disclosure>summary{font-size:12px;font-weight:600;cursor:pointer;color:var(--ink)}
.channel-pool-disclosure>summary>span{font-size:10px;font-weight:400;color:var(--muted);margin-left:5px}
.channel-pool-disclosure .channel-picker-bar{padding-top:8px}
.channel-pool-disclosure .channel-picker{margin-bottom:0;max-height:210px;overscroll-behavior-y:contain}
.channel-workspace .channel-redirects label{grid-template-columns:minmax(0,1fr) 10px minmax(0,1fr) 22px}
.channel-redirect-remove{border:0;background:transparent;color:var(--muted);font-size:18px;cursor:pointer;padding:0}
.channel-redirect-remove:hover{color:var(--danger)}
.channel-redirect-add{display:flex;gap:8px;margin-top:12px}.channel-redirect-add select{min-width:0;flex:1}.channel-redirect-add button{flex-shrink:0}
/* Keep all bindings accessible in a compact, independent scroll area. */
.adm #binding-tags{gap:6px;align-content:flex-start;max-height:180px;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;scrollbar-width:thin;padding:6px 4px 6px 0;margin:4px 0 12px}
.adm #binding-tags .channel-tag{display:inline-flex;align-items:center;gap:4px;max-width:100%;padding:3px 5px 3px 7px;font-size:11px;line-height:18px;border:0;border-radius:6px}
.adm #binding-tags .channel-tag-name{min-width:0;overflow-wrap:anywhere}
.adm #binding-tags .channel-tag [data-remove-binding]{position:static;flex:none;display:grid;place-items:center;width:18px;height:18px;min-width:18px;min-height:18px;padding:0;border:0;border-radius:4px;background:transparent;color:var(--muted)}
.adm #binding-tags .channel-tag [data-remove-binding]:hover{background:var(--danger-soft);color:var(--danger)}
@media(pointer:coarse){.adm #binding-tags .channel-tag [data-remove-binding]{width:24px;height:24px}}
.channel-workspace .channel-tags{overscroll-behavior-y:contain}.channel-workspace .channel-redirects{overscroll-behavior-y:contain}

/* Testing needs a solid reading surface, without blurring the admin page. */
body.admin-mode dialog.channel-probe-dialog{
 --surface:#1b1b1b;--paper:var(--surface);
 background:var(--surface);backdrop-filter:none;-webkit-backdrop-filter:none;
 box-shadow:0 18px 60px rgba(0,0,0,.24);
}
body.admin-mode dialog.channel-probe-dialog::backdrop{
 background:rgba(0,0,0,.4);backdrop-filter:none;-webkit-backdrop-filter:none;
}
html[data-theme=light] body.admin-mode dialog.channel-probe-dialog{--surface:#fff;box-shadow:0 18px 60px rgba(0,0,0,.14)}
html[data-theme=light] body.admin-mode dialog.channel-probe-dialog::backdrop{background:rgba(0,0,0,.18)}

/* Compact test dialog: scroll the contents while keeping actions visible. */
body.admin-mode dialog.channel-probe-dialog{width:min(800px,calc(100vw - 32px));max-width:800px;max-height:min(780px,calc(100dvh - 48px));border-radius:20px}
body.admin-mode dialog.channel-probe-dialog>.dialog-head{top:18px;right:20px}
body.admin-mode dialog.channel-probe-dialog>.dialog-head .icon-btn{width:34px;height:34px}
.channel-probe-heading{padding:20px 24px 16px}
.channel-probe-heading>span{font-size:11px}
.channel-probe-heading h2{font-size:21px;margin:8px 44px 8px 0}
.channel-probe-heading p{font-size:12px}
.channel-probe-scroll{padding:18px 24px}
.channel-probe-settings{grid-template-columns:180px minmax(0,1fr);gap:12px;margin-bottom:18px}
.channel-probe-settings label{gap:7px;font-size:12px}
body.admin-mode .channel-probe-settings :is(input,select){min-height:40px;padding:9px 11px;font-size:13px}
.channel-probe-selection h3{font-size:14px}
body.admin-mode dialog.channel-probe-dialog .btn{font-size:12px;min-height:34px;padding:7px 12px}
body.admin-mode .channel-probe-models label{min-height:60px;padding:10px;gap:10px}
body.admin-mode dialog.channel-probe-dialog .channel-probe-models strong{font-size:13px}
.channel-probe-models small{font-size:11px;margin-top:3px}
.channel-probe-note{padding:10px 12px;margin:12px 0}
.channel-probe-results article{min-height:60px;padding:12px;gap:12px}
.channel-probe-results article strong,.channel-probe-results article>span,.channel-probe-summary #test-progress{font-size:13px}
.channel-probe-footer{padding:14px 24px;gap:10px}
.channel-probe-footer>.btn{min-height:40px!important}
@media(max-width:600px){.channel-probe-settings{grid-template-columns:1fr}.channel-probe-heading{padding:18px}.channel-probe-scroll{padding:16px}.channel-probe-footer{padding:12px}}

.channel-chat-bubble.assistant {max-width:100%;background:var(--paper)}
.channel-chat-bubble .markdown {white-space:normal;min-width:0}
.channel-chat-bubble .rich-code-source,.channel-chat-bubble .rich-code-source code {white-space:pre;overflow-wrap:normal;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px}
.channel-chat-bubble .rich-code-source {overflow:auto}
.channel-chat-bubble .rich-code-toolbar {white-space:normal;flex-wrap:wrap}
.channel-chat-bubble .reasoning-panel {white-space:normal}
.channel-reply-status {font-size:12px;color:var(--muted);margin:10px 0 0}

/* Redirects use aligned source/target columns, including the pending row. */
.channel-workspace .channel-redirect-section{--redirect-columns:minmax(0,1fr) 16px minmax(0,1fr) 26px;--redirect-gap:8px;min-width:0;margin:16px 0;padding:14px 12px;border:1px solid var(--line);border-radius:14px;background:var(--paper);box-shadow:none}
.channel-workspace .channel-redirect-heading{gap:8px;margin-bottom:8px}
.channel-workspace .channel-redirect-heading h3{font-size:13px;white-space:nowrap}
.channel-workspace .channel-redirect-section>p{font-size:11px;line-height:1.6}
.channel-workspace :is(.channel-redirect-columns,.channel-redirect-row){display:grid;grid-template-columns:var(--redirect-columns);column-gap:var(--redirect-gap);align-items:center;min-width:0}
.channel-workspace .channel-redirect-columns{margin:14px 0 8px;font-size:11px;line-height:18px;color:var(--muted)}
.channel-workspace .channel-redirect-columns>span:nth-child(2){grid-column:3}
.channel-workspace .channel-redirects{display:grid;gap:8px;max-height:320px;margin:0;overflow:auto;scrollbar-width:thin;scrollbar-gutter:auto}
.channel-workspace .channel-redirects:empty{display:none}
.channel-workspace .channel-redirect-row{position:relative;padding:0;border-radius:0;background:transparent}
.channel-workspace .channel-redirect-row .channel-redirect-field{display:block;min-width:0;margin:0}
#channel-editor .channel-redirect-field input{width:100%;min-width:0;height:36px;min-height:36px;box-sizing:border-box;padding:7px 8px;border:1px solid var(--line);border-radius:8px;background:var(--ui-field);box-shadow:none;font-size:11px;line-height:20px}
.channel-workspace .channel-redirect-arrow{display:grid;place-items:center;color:var(--muted)}
.channel-workspace .channel-redirect-remove{position:static;display:grid;place-items:center;width:26px;height:30px;min-height:30px;margin:0;padding:0;border:0;border-radius:7px;color:var(--muted);background:transparent}
.channel-workspace .channel-redirect-remove:hover{color:var(--danger);background:var(--danger-soft)}
.channel-workspace .channel-redirect-heading .channel-redirect-new{display:inline-flex;align-items:center;justify-content:center;flex:none;width:auto;min-height:32px;margin:0;padding:6px 10px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink);font-size:11px;white-space:nowrap}
.channel-workspace .channel-redirect-heading .channel-redirect-new:hover{background:var(--ui-field-hover)}
.channel-workspace :is(.channel-redirect-new,.channel-redirect-remove):focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.channel-workspace .channel-redirect-add{display:block;margin:0 0 8px;padding:0;background:transparent;border-radius:0}
.channel-workspace .channel-redirect-add[hidden]{display:none!important}
.channel-workspace .channel-redirect-actions{display:flex;justify-content:flex-end;padding-right:34px;margin-top:6px}
.channel-workspace .channel-redirect-actions .btn{width:auto;min-height:28px;padding:4px 12px;font-size:11px}
@media(min-width:1341px){body.admin-mode .adm .channel-workspace{grid-template-columns:minmax(0,1fr) 380px}}
@media(min-width:641px) and (max-width:1340px){.channel-workspace .channel-redirect-section{grid-column:1/-1}}
.adm #binding-tags button.channel-tag-name{position:static;display:block;flex:1;min-width:0;width:auto;height:auto;min-height:18px;padding:0;border:0;border-radius:3px;background:transparent;color:inherit;font:inherit;text-align:left;overflow-wrap:anywhere;cursor:copy}
.adm #binding-tags button.channel-tag-name:hover{background:transparent;color:var(--accent)}
.adm #binding-tags button.channel-tag-name:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(pointer:coarse){.channel-workspace .channel-redirect-section{--redirect-columns:minmax(0,1fr) 16px minmax(0,1fr) 30px}.channel-workspace .channel-redirect-remove{width:30px;height:36px}.adm #binding-tags button.channel-tag-name{min-height:24px}}

/* Category navigation shares the directory header and remains horizontally scrollable. */
body.admin-mode .channel-directory-head{display:grid;grid-template-columns:auto minmax(120px,1fr) auto;gap:22px;align-items:center}
.channel-category-bar{display:flex;align-items:center;gap:8px;min-width:0}
.channel-category-tabs{display:flex;align-items:center;gap:4px;overflow-x:auto;min-width:0;scrollbar-width:thin;padding:4px 2px}
body.admin-mode .channel-category-tab{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex-shrink:0;min-height:38px;border:0;border-radius:9px;background:transparent;color:var(--muted);padding:8px 11px;font-size:12px;line-height:1.3;font-weight:550;white-space:nowrap;box-shadow:none;cursor:pointer;touch-action:pan-y}
body.admin-mode .channel-category-tab:hover{background:var(--hover);color:var(--ink)}
body.admin-mode .channel-category-tab.is-selected{background:var(--accent);color:var(--on-accent)}
body.admin-mode .channel-category-tab.is-selected:hover{background:var(--accent-hover)}
body.admin-mode .channel-category-tab.is-selected>.identity-image{background:transparent;color:inherit}
body.admin-mode .channel-category-tab.is-selected>small{opacity:1}
.channel-category-tab>.identity-image{width:20px;height:20px;flex:0 0 20px;border-radius:5px;background:var(--hover);overflow:hidden;font-size:11px}
.channel-category-tab>.identity-image img{width:100%;height:100%;object-fit:contain}
.channel-category-tab>small{font-size:10px;font-variant-numeric:tabular-nums;opacity:.7}
body.admin-mode .channel-category-tab.is-drop-target{box-shadow:inset 2px 0 var(--accent);background:var(--accent-soft);color:var(--ink)}
.channel-category-tab.is-dragging{opacity:.4}
.channel-category-tools{display:flex;gap:2px;flex-shrink:0}
.channel-category-tools .icon-btn{width:32px;height:32px;border-radius:8px;flex-shrink:0}
.channel-category-form{display:grid;gap:16px}
.channel-category-form .field,.channel-category-form .image-field{margin:0}
.channel-category-form .registry-error{color:var(--danger);font-size:12px;margin:0}
.channel-category-manager>p{font-size:12px;line-height:1.7;margin:0 0 18px}
.channel-category-manage-row{display:flex;align-items:center;gap:8px;padding:12px 0;border-bottom:1px solid var(--line)}
.channel-category-manage-row>.identity-image{width:30px;height:30px;flex-shrink:0;border-radius:8px;background:var(--hover);overflow:hidden}
.channel-category-manage-row>strong{min-width:0;flex:1;font-size:13px;overflow-wrap:anywhere}
.channel-category-manage-row>small{font-size:11px;white-space:nowrap;color:var(--muted)}
.channel-category-manage-row>.icon-btn{width:30px;height:30px;flex-shrink:0}
.channel-category-empty{padding:24px 0;text-align:center}

/* Inline category changes: the same icon and name in the chip and picker. */
/* Names and addresses share one line; status remains on the second line. */
.channel-name-category{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:14px;row-gap:4px}
body.admin-mode .channel-name-category>.channel-name{display:grid;grid-template-columns:minmax(164px,1fr) minmax(96px,1fr);align-items:center;gap:12px;min-width:0;grid-column:1;grid-row:1}
.channel-name-category>.channel-category-trigger{grid-column:2;grid-row:1 / span 2;align-self:center}
body.admin-mode .channel-name-category .channel-name-button{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:20px}
body.admin-mode .channel-name-category .channel-address{min-width:0;max-width:none;margin:0;font-size:12px;line-height:20px}
body.admin-mode .channel-name-category>.channel-bindings-summary{grid-column:1;grid-row:2;margin-top:0;font-size:11px;line-height:18px}
body.admin-mode .channel-table td:first-child{min-width:440px;max-width:none}
.adm .channel-workspace .channel-table tr[data-channel-row]>td{padding-block:10px}

.channel-category-trigger,.channel-category-popover{--category-accent:#b9a7ff;--category-fill:#282234;--category-selected:#342b49;--category-edge:#615080}
html[data-theme=light] :is(.channel-category-trigger,.channel-category-popover){--category-accent:#7352ff;--category-fill:#f8f6ff;--category-selected:#f1edff;--category-edge:#d6ccff}
body.admin-mode .channel-category-trigger{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:0 0 auto;max-width:180px;min-height:34px;padding:6px 9px;border:1px solid var(--category-edge);border-radius:10px;background:var(--category-fill);color:var(--category-accent);font:inherit;font-size:12px;line-height:1.4;font-weight:600;cursor:pointer}
.channel-category-trigger>span:not(.identity-image){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.channel-category-trigger>.identity-image{width:19px;height:19px;flex:0 0 19px;border-radius:5px;overflow:hidden;background:var(--category-selected);font-size:10px}
.channel-category-trigger>svg{flex:none}
.channel-category-trigger>svg:last-child{transition:transform .15s}
.channel-category-trigger[aria-expanded=true]>svg:last-child{transform:rotate(180deg)}
body.admin-mode .channel-category-trigger:hover,body.admin-mode .channel-category-trigger[aria-expanded=true]{background:var(--category-selected);border-color:var(--category-accent)}
body.admin-mode .channel-category-trigger:focus-visible{outline:2px solid var(--category-accent);outline-offset:2px}
body.admin-mode .channel-category-popover{position:fixed;inset:auto;margin:0;z-index:1000;box-sizing:border-box;display:flex;flex-direction:column;width:360px;padding:16px 10px 10px;border:1px solid var(--line);border-radius:16px;background:#1b1b1b;color:var(--ink);box-shadow:0 12px 40px #0003;overflow:hidden;backdrop-filter:none;font-family:inherit}
html[data-theme=light] body.admin-mode .channel-category-popover{background:#fff;box-shadow:0 12px 36px #18223b1a}
.channel-category-popover::backdrop{background:transparent;pointer-events:none}
.channel-category-popover>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 6px 14px}
.channel-category-popover>header strong{font-size:16px;font-weight:700}
.channel-category-popover>header span{font-size:12px;color:var(--muted)}
body.admin-mode .channel-category-popover .channel-category-search{flex:none;width:calc(100% - 4px);min-width:0;margin:0 2px 12px;padding:10px 12px;height:44px;border:1px solid var(--line-strong);border-radius:11px;background:transparent;color:var(--ink);font:inherit;font-size:14px;box-shadow:none}
body.admin-mode .channel-category-popover .channel-category-search:focus{border-color:var(--category-accent);outline:2px solid var(--category-accent);outline-offset:2px;box-shadow:none}
.channel-category-options{display:flex;flex-direction:column;gap:4px;overflow:auto;overscroll-behavior:contain;min-height:0;max-height:320px;scrollbar-width:thin;scrollbar-color:var(--line-strong) transparent}
body.admin-mode .channel-category-option{flex:none;display:flex;align-items:center;gap:12px;width:100%;min-height:48px;padding:8px 12px;border:0;border-radius:10px;background:transparent;color:var(--ink);text-align:left;font:inherit;font-size:15px;line-height:1.5;cursor:pointer}
.channel-category-option>span:not(.identity-image){flex:1;min-width:0;overflow-wrap:anywhere}
.channel-category-option>.identity-image{width:28px;height:28px;flex:0 0 28px;border-radius:7px;overflow:hidden;background:var(--hover);font-size:13px}
.channel-category-option>svg{width:28px;flex:0 0 28px}
.channel-category-option>svg:last-child:not(:first-child){width:20px;flex-basis:20px}
body.admin-mode .channel-category-option:hover{background:var(--hover)}
body.admin-mode .channel-category-option[aria-selected=true]{background:var(--category-selected);color:var(--category-accent);font-weight:650}
body.admin-mode .channel-category-option:focus-visible{outline:2px solid var(--category-accent);outline-offset:-2px}
.channel-category-popover>footer{flex:none;margin:8px 4px 0;padding-top:7px;border-top:1px solid var(--line)}
body.admin-mode .channel-category-popover [data-category-manage]{display:flex;align-items:center;gap:8px;width:100%;min-height:42px;padding:8px 8px;border:0;border-radius:8px;background:transparent;color:var(--category-accent);font:inherit;font-size:14px;font-weight:600;text-align:left;cursor:pointer}
body.admin-mode .channel-category-popover [data-category-manage]:hover{background:var(--category-fill)}
.channel-category-no-results{padding:24px 12px;text-align:center;font-size:13px;color:var(--muted)}
.channel-category-error{margin:8px 6px 0;color:var(--danger);font-size:12px;line-height:1.5}
.channel-category-popover [hidden]{display:none!important}
.channel-category-popover [disabled]{opacity:.6;cursor:wait}
@media(prefers-reduced-motion:reduce){.channel-category-trigger>svg:last-child{transition:none}}

/* The column heading names these inputs; keep the pair centered in each row. */
body.admin-mode .channel-workspace .channel-route-inputs{gap:12px;align-items:center;justify-content:center}
body.admin-mode .channel-workspace .channel-route-inputs label{display:block;flex:none;margin:0;padding:0;background:transparent;border:0;border-radius:0;overflow:visible;font-size:10px;color:var(--muted)}
body.admin-mode .channel-workspace .channel-table :is(th,td):nth-child(2){text-align:center;vertical-align:middle}
body.admin-mode .adm .channel-table .channel-route-inputs input[type=number][data-route-key]{height:36px;min-height:36px;padding:7px 10px;border:1px solid transparent;border-radius:9px;box-shadow:none;background:var(--hover);color:var(--ink);font-size:13px;font-weight:600;line-height:20px;font-variant-numeric:tabular-nums}
body.admin-mode .adm .channel-table .channel-route-inputs input[type=number][data-route-key]:hover{background:var(--accent-faint);border-color:var(--line)}
body.admin-mode .adm .channel-table .channel-route-inputs input[type=number][data-route-key]:focus{background:var(--surface);border-color:var(--accent);outline:2px solid var(--accent-soft);outline-offset:2px;box-shadow:none}
@media(max-width:1560px){body.admin-mode .channel-directory-head{grid-template-columns:minmax(0,1fr) auto;gap:16px}.channel-category-bar{grid-row:2;grid-column:1/-1}body.admin-mode .channel-directory-head>#add-channel{grid-column:2;grid-row:1}}
@media(max-width:640px){.channel-category-manager{min-width:0}.channel-category-manage-row{gap:5px;flex-wrap:wrap}.channel-category-manage-row>strong{flex-basis:calc(100% - 45px)}.channel-category-manage-row>small{margin-right:auto}.channel-category-tabs{flex:1}body.admin-mode .channel-category-tab{min-height:40px;padding-inline:10px}}

/* Keep destructive actions apart from routine channel controls. */
body.admin-mode .channel-workspace .channel-row-actions{width:100%;min-width:272px;max-width:none;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:32px}
.channel-primary-actions{display:flex;align-items:center;gap:6px;flex-wrap:nowrap}
body.admin-mode .channel-workspace .channel-row-actions .channel-delete-action{flex:none;margin-inline-start:auto;color:var(--danger);background:transparent;border-color:transparent}
body.admin-mode .channel-workspace .channel-row-actions .channel-delete-action:hover:not(:disabled){color:var(--danger);background:var(--danger-soft)}
body.admin-mode .channel-workspace .channel-row-actions .channel-delete-action:focus-visible{outline:2px solid var(--danger);outline-offset:3px}

.channel-probe-summary{flex-wrap:wrap}.channel-probe-summary>div{flex:1 1 240px}

/* Test results use semantic colors independently of the site's accent. */
.channel-probe-results{--success:#8ee0ae;--success-soft:#173124;--danger:#ffacb6;--danger-soft:#371f26}
html[data-theme=light] .channel-probe-results{--success:#17683b;--success-soft:#eaf8ef;--danger:#ad2238;--danger-soft:#fff0f2}
.channel-probe-results article:is(.is-good,.is-bad) :is(strong,small,span){color:inherit}

/* All channels: complete category sections, with the same order as the tabs. */
.channel-pagination[hidden]{display:none}
.channel-table-scroll{container-type:inline-size}
/* Group headers and idle rows share a surface; selection remains visible. */
body.admin-mode .channel-workspace .channel-table tbody>tr,
body.admin-mode .channel-workspace .channel-table tbody>tr:is(:hover,.is-selected,.is-disabled),
body.admin-mode .channel-workspace .channel-table tbody>tr>td,
body.admin-mode .channel-workspace .channel-table tbody>tr:is(:hover,.is-selected,.is-disabled)>td{background:transparent}
body.admin-mode .channel-workspace .channel-table tbody>tr.is-selected>td{background:var(--accent-soft)}
body.admin-mode .channel-workspace .channel-table :is(.channel-group-row,.channel-group-empty){background:transparent}
body.admin-mode .channel-workspace .channel-table .channel-group-row>td{padding:8px 16px 0;min-width:0;max-width:none;border:0;background:transparent;box-shadow:none}
body.admin-mode .channel-workspace .channel-table .channel-group-row+tr[data-channel-row]>td{border-top:0}
.channel-group-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:38px;position:sticky;left:16px}
@supports(width:1cqw){.channel-group-heading{width:calc(100cqw - 32px)}}
.channel-group-label{display:flex;align-items:center;gap:9px;flex:0 1 auto;min-width:0;padding:6px 9px;border:1px solid var(--line);border-radius:10px;background:transparent}
.channel-group-label>.identity-image{width:24px;height:24px;flex:0 0 24px;border-radius:6px;overflow:hidden;background:var(--hover);font-size:12px}
.channel-group-label>.identity-image img{width:100%;height:100%;object-fit:contain}
.channel-group-label>svg{width:22px;height:22px;flex:none;color:var(--muted)}
.channel-group-label h3{margin:0;min-width:0;font-size:14px;line-height:22px;font-weight:700;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.channel-group-count{flex:none;padding:2px 6px;border-radius:4px;background:var(--hover);color:var(--muted);font-size:11px;line-height:18px;font-weight:500;white-space:nowrap;font-variant-numeric:tabular-nums}
body.admin-mode .channel-workspace .channel-group-add{flex:none;min-height:32px;padding:6px 10px;border:1px solid var(--line);border-radius:9px;background:transparent;color:var(--ink);font-size:12px;line-height:18px;white-space:nowrap;box-shadow:none}
body.admin-mode .channel-workspace .channel-group-add:hover{background:var(--hover);border-color:var(--line-strong)}
body.admin-mode .channel-workspace .channel-group-add:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
body.admin-mode .channel-workspace .channel-table .channel-group-empty>td{padding:12px 26px 22px;color:var(--muted);font-size:12px;background:transparent;border:0}
@media(max-width:640px){.channel-group-heading{gap:10px}.channel-group-label{gap:7px;padding:6px 8px}.channel-group-label h3{font-size:13px}}

/* The directory uses spacing for structure, with filled search controls. */
.adm .channel-workspace .channel-directory{border:0;box-shadow:none}
.adm .channel-workspace .channel-filters{border:0;gap:10px;padding-block:8px 14px}
.adm #channel-search,.adm #channel-status{border:0;border-radius:10px;background:var(--ui-field);box-shadow:none}
.adm .channel-workspace .channel-table :is(th,td){border:0}
.adm .channel-workspace .channel-table thead th{background:transparent}
.adm .channel-workspace .channel-group-label{border:0;border-radius:0;padding:6px 0}
.adm .channel-workspace .channel-table .channel-group-row:not(:first-child)>td{padding-top:20px}
.adm .channel-workspace .channel-group-add{border:0;background:var(--ui-field)}
.adm .channel-workspace .channel-group-add:hover{background:var(--ui-field-hover)}
.adm .channel-workspace .channel-pagination{border:0}

/* Image probes explain their fixed prompt only on hover or keyboard focus. */
.channel-probe-models .channel-probe-kind{position:relative;cursor:help;outline-offset:3px}
.channel-probe-models .channel-probe-kind:focus-visible{outline:2px solid var(--accent)}
.channel-probe-kind-tip{position:absolute;right:0;bottom:calc(100% + 10px);z-index:5;width:max-content;max-width:calc(100vw - 80px);padding:9px 12px;border-radius:8px;background:var(--ink);color:var(--surface);box-shadow:0 4px 14px #0002;font-size:12px;font-weight:400;line-height:1.5;white-space:normal;visibility:hidden;opacity:0;pointer-events:none}
.channel-probe-kind:is(:hover,:focus-visible)>.channel-probe-kind-tip{visibility:visible;opacity:1}

/* Empty redirect drafts can be added independently before saving. */
.relay-channels #channel-form #redirect-create.channel-redirect-add{display:grid;gap:8px;margin:0 0 8px}
.relay-channels .channel-redirect-add[hidden]{display:none!important}
