#modelConnectionsModal{z-index:130}
[data-model-device]{color:#9a6a12!important;min-height:44px}
.model-connections-card{width:min(680px,100%);max-height:calc(100dvh - 48px);padding:32px!important;border-radius:24px;overflow:auto;overscroll-behavior:contain}
.model-connections-card .modal-close{width:44px;height:44px;right:12px;top:12px}
.model-connection-heading{padding-right:34px}.model-connection-heading h2{font-size:30px!important;letter-spacing:-.03em;margin:10px 0}.model-connection-heading p,.model-intro{font-size:16px;line-height:1.65;color:#6e685e}
.model-provider-tabs{display:flex;gap:12px;margin:24px 0 18px}.model-provider-tabs button{flex:1;min-height:66px;border:1px solid #e9e1d3;background:var(--cortex-surface,#fffdf8);border-radius:14px;font:600 18px var(--sans);text-align:left;padding:12px 18px;color:#1d1a14}.model-provider-tabs button[aria-pressed=true]{border-color:#c9a35a;background:#fbf3e2}.model-provider-tabs small{display:block;font-size:13px;font-weight:400;color:#736d60;margin-top:4px}
.model-account-list{display:grid;gap:10px;margin:20px 0}.model-account{display:flex;gap:16px;align-items:center;justify-content:space-between;padding:16px;border:1px solid #e9e1d3;border-radius:14px}.model-account>div{min-width:0}.model-account strong{font-size:17px;overflow-wrap:anywhere}.model-account small{display:block;color:#736f65;font-size:13px;margin-top:5px}.model-account .button{flex-shrink:0;min-width:90px}.model-empty{padding:24px 16px;background:#f6f1e7;border-radius:14px;color:#7e7a73;text-align:center;font-size:15px}
.model-connections-card .button{min-height:48px;font-size:16px;padding:12px 18px}.model-connections-card input:not([type="radio"]):not([type="checkbox"]){font-size:16px;min-height:50px;font-weight:400}.model-add-form{display:grid;gap:16px;margin-top:16px}.model-add-form label{font-size:15px;display:grid;gap:8px;font-weight:600}.model-status:not(:empty),.model-note{font-size:15px;line-height:1.6;background:#fbf3e2;border-radius:12px;padding:14px 16px;margin:14px 0;color:#6d5530}
.model-code-panel{padding:20px;background:#fbf3e2;border-radius:16px;margin:16px 0}.model-code-panel p{margin:0;font-size:15px}.model-code{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0}.model-code code{font-size:28px;letter-spacing:.12em;font-weight:600;user-select:all;overflow-wrap:anywhere}.model-code-panel>a{display:flex;text-decoration:none;text-align:center;justify-content:center}.model-code-panel small{display:block;margin-top:12px;font-size:13px;color:#756e62;line-height:1.6}.model-footnote{font-size:13px;color:#7e7a73;line-height:1.7;padding-top:20px;margin-top:22px;border-top:1px solid #ece4d6}.model-connections-card button:disabled{opacity:.5;cursor:not-allowed}
@media(max-width:600px){#modelConnectionsModal{padding:12px}.model-connections-card{max-height:calc(100dvh - 24px);padding:24px 18px!important;border-radius:20px}.model-connection-heading h2{font-size:27px!important}.model-code code{font-size:24px;letter-spacing:.08em}.model-provider-tabs{gap:8px}.model-account{padding:14px;gap:8px}}
.model-usage{display:inline-block;margin-top:8px;padding:3px 10px;border-radius:999px;font-size:13px;line-height:1.5;color:#736f65;background:#f4efe6}.model-usage.is-active{color:#5b4210;background:#f3e2bd;font-weight:600}.model-usage.is-partial{color:#7a5a17;background:#fbf3e2}
.model-others{margin-top:28px;padding-top:20px;border-top:1px solid #e9e1d3}.model-others h3{display:flex;align-items:center;gap:10px;font-size:17px;margin:0 0 12px}.model-others h3 small{font:500 12px var(--sans);color:#736f65;border:1px solid #e9e1d3;border-radius:999px;padding:2px 8px}.model-others ul{list-style:none;margin:0;padding:0;display:grid;gap:8px}.model-others li{display:flex;gap:12px;align-items:baseline;justify-content:space-between;padding:10px 14px;border:1px solid #efe8dc;border-radius:12px;background:var(--cortex-surface,#fffdf8)}.model-others li strong{font-size:15px;flex-shrink:0}.model-others li>div{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end;min-width:0}.model-chip{font-size:13px;color:#736f65;background:#f4efe6;border-radius:999px;padding:2px 10px;overflow-wrap:anywhere}.model-chip.is-active{color:#5b4210;background:#f3e2bd}.model-others p{font-size:13px;color:#736f65;margin:10px 0 0}
@media(max-width:600px){.model-others li{flex-direction:column;align-items:flex-start}.model-others li>div{justify-content:flex-start}}
/* Reading status under the tabs (2026-10-24, Pin): visible on open, no scrolling. */
.model-sync-bar{display:flex;align-items:center;flex-wrap:wrap;gap:2px 14px;margin:-10px 0 14px;font-size:13px;color:#8a8478}
.model-sync-bar .model-read-at{display:inline-flex;align-items:center;gap:8px}
.model-sync-bar.is-loading .model-read-at{color:#8a5a00;font-weight:600}
.model-sync-bar.is-loading .model-read-at::before{content:"";width:8px;height:8px;border-radius:50%;background:#f0a020;animation:model-sync-pulse .9s ease-in-out infinite alternate}
.model-sync-bar button{min-height:32px;border:0;background:none;color:#9a6a12;text-decoration:underline;font-size:13px;padding:4px 0;cursor:pointer}
.model-sync-bar button:disabled{color:#b9b2a5;text-decoration:none;cursor:default}
@keyframes model-sync-pulse{to{opacity:.3}}
@media(prefers-reduced-motion:reduce){.model-sync-bar.is-loading .model-read-at::before{animation:none}}
/* 模型与工具: one tab bar across the models/accounts modal and the tools modal, same card width so switching does not jump. */
#modelConnectionsModal .model-connections-card{width:min(780px,100%)}
.settings-tabs{display:flex;gap:4px;margin:18px 0 22px;padding:4px;background:#f4efe6;border-radius:14px}.settings-tabs button{flex:1;min-height:44px;border:0;border-radius:10px;background:none;font:600 15px var(--sans);color:#6e685e;cursor:pointer}.settings-tabs button[aria-selected=true]{background:var(--cortex-surface,#fffdf8);color:#1d1a14;box-shadow:0 1px 3px rgba(60,40,10,.12)}
.model-device-select{font:600 16px var(--sans);min-height:40px;border:1px solid #e9e1d3;border-radius:10px;padding:4px 10px;background:var(--cortex-surface,#fffdf8);max-width:100%}
.model-section{margin:8px 0 24px}.model-section-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:8px 16px;margin-bottom:12px}.model-section-head h3{font-size:19px;margin:0}.model-section-head p{flex:1 1 100%;margin:0;color:#6e685e;font-size:14px;line-height:1.6}
.model-search{width:100%;min-height:44px;font-size:15px;border:1px solid #e9e1d3;border-radius:12px;padding:8px 14px;margin-bottom:12px;background:var(--cortex-surface,#fffdf8)}
.model-editor{display:grid;gap:14px;padding:16px;border:1px solid #e9e1d3;border-radius:14px;background:var(--cortex-surface,#fffdf8)}.model-field{display:grid;gap:8px;font-size:14px;font-weight:600;color:#3b362e}.model-field select{min-height:46px;font-size:15px;font-weight:400;border:1px solid #e3d9c7;border-radius:10px;padding:8px 10px;background:#fffdf8;max-width:100%}
.model-fallback-list{list-style:none;margin:0;padding:0;display:grid;gap:6px}.model-fallback-list li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;border-radius:10px;background:#f7f2e9;font-weight:500}.model-fallback-list li.model-fallback-empty{color:#8a8478;background:none;padding-left:0}.model-fallback-actions{display:flex;gap:4px;flex-shrink:0}.model-fallback-actions button{min-width:34px;min-height:32px;border:1px solid #e3d9c7;border-radius:8px;background:#fffdf8;font-size:13px;cursor:pointer}.model-fallback-actions button:disabled{opacity:.4;cursor:default}
.model-editor-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:12px}
.model-agent-list{display:grid;gap:8px}.model-agent{border:1px solid #e9e1d3;border-radius:14px;padding:12px 16px}.model-agent.is-editing{border-color:#c9a35a;background:#fffaf0}.model-agent-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.model-agent-row>div{min-width:0}.model-agent-row strong{font-size:16px}.model-agent-row small{display:block;color:#736f65;font-size:13px;margin-top:4px;overflow-wrap:anywhere}.model-agent-row .button{flex-shrink:0;min-height:40px!important;font-size:14px!important;padding:8px 14px!important}
.model-agent-editor{display:grid;gap:10px;margin-top:12px}.model-agent-editor>label{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:15px;font-weight:600}.model-agent-editor>label small{flex-basis:100%;margin-left:26px;font-weight:400;color:#736f65;font-size:13px}
@media(max-width:600px){.settings-tabs button{font-size:14px;min-height:42px}.model-agent-row{align-items:flex-start}.model-fallback-list li{flex-wrap:wrap}.model-editor{padding:12px}}
/* Simplified 模型与工具: models first, sources as one line each, advanced collapsed. */
.model-heading-row{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}.model-heading-row h2{margin:10px 0!important}.model-heading-row .model-device-select{width:auto;min-width:160px}.model-device-name{font-weight:600;color:#6e685e}
.model-warning-strip{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding:10px 14px;border-radius:12px;background:#fbf0d8;color:#6b4a0c;font-size:14px;line-height:1.5}.model-strip-actions{display:flex;gap:8px;flex-shrink:0}.model-strip-actions button{border:0;background:none;color:#7a5410;font:600 14px var(--sans);text-decoration:underline;cursor:pointer;padding:4px 2px}
.model-source-list{display:grid;border:1px solid #e9e1d3;border-radius:14px;overflow:hidden}.model-source+.model-source{border-top:1px solid #efe8dc}.model-source-row{display:flex;width:100%;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border:0;background:var(--cortex-surface,#fffdf8);text-align:left;cursor:pointer;font:inherit;color:inherit}.model-source-row strong{display:block;font-size:16px}.model-source-row small{display:block;color:#736f65;font-size:13px;margin-top:3px;overflow-wrap:anywhere}.model-source-action{color:#9a6a12;font-size:14px;font-weight:600;flex-shrink:0}.model-source.is-open .model-source-row{background:#fbf6ec}
.model-source-panel{padding:4px 16px 16px;background:#fbf6ec;display:grid;gap:10px}.model-origin{display:grid;gap:8px}.model-origin-title{margin:8px 0 0;font-size:14px;font-weight:600;color:#3b362e}.model-origin-title small{display:block;font-weight:400;color:#8a8478;font-size:12px;margin-top:2px}
.model-source-panel .model-account{background:var(--cortex-surface,#fffdf8)}.model-source .model-others{margin:0;padding:4px 16px 16px;border-top:0;background:#fbf6ec}.model-source .model-others h3{display:none}
.model-key-order{border-top:1px solid #efe4cf;padding-top:8px}.model-key-order summary{cursor:pointer;font-size:14px;font-weight:600;color:#6e685e;padding:6px 0}
.model-add-open{justify-self:start;margin-top:12px;border:1px dashed #d8c7a3;border-radius:12px;background:none;padding:10px 16px;font:600 15px var(--sans);color:#7a5410;cursor:pointer}.model-source-panel .model-add-open{margin-top:4px}
.model-connect{margin-top:12px;padding:14px 16px;border:1px solid #e9e1d3;border-radius:14px}.model-connect-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:8px}.model-connect-choices button{text-align:left;padding:12px;border:1px solid #e9e1d3;border-radius:12px;background:var(--cortex-surface,#fffdf8);cursor:pointer;font:inherit}.model-connect-choices button[aria-pressed=true]{border-color:#c9a35a;background:#fbf3e2}.model-connect-choices strong{display:block;font-size:15px}.model-connect-choices small{display:block;color:#736f65;font-size:12px;margin-top:3px}
.model-advanced{margin-top:4px}.model-advanced-toggle{display:flex;width:100%;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border:0;border-top:1px solid #e9e1d3;background:none;cursor:pointer;font:600 15px var(--sans);color:#3b362e;text-align:left}.model-advanced-toggle small{display:block;font-weight:400;color:#8a8478;font-size:13px;margin-top:2px}.model-advanced-toggle>span:last-child{color:#9a6a12;font-size:14px}
@media(max-width:600px){.model-connect-choices{grid-template-columns:1fr}.model-warning-strip{flex-direction:column;align-items:flex-start}.model-heading-row .model-device-select{width:100%}}
.model-account-tag{flex-shrink:0;font-size:13px;color:#8a8478;border:1px solid #e9e1d3;border-radius:999px;padding:4px 10px}
@media(max-width:600px){.model-source-panel{padding:4px 10px 12px}.model-source-panel .model-account{flex-direction:column;align-items:stretch}.model-source-panel .model-account .button,.model-source-panel .model-account-tag{align-self:flex-start}}

/* Compact per-Agent mode control; native radios must not inherit text-input sizing. */
.model-agent-mode{display:flex;gap:8px;min-width:0;margin:0;padding:4px;border:1px solid #e9e1d3;border-radius:12px;background:#f4efe6}
.model-agent-mode legend{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.model-agent-mode label{display:flex;flex:1;align-items:center;justify-content:center;gap:8px;margin:0;padding:10px 12px;border:1px solid transparent;border-radius:9px;font-size:14px;font-weight:600;cursor:pointer}
.model-agent-mode label:has(input:checked){background:#fffdf8;border-color:#d8c7a3;color:#7a5410}
.model-connections-card .model-agent-mode input[type="radio"]{appearance:auto;display:inline-block;flex:0 0 16px;width:16px;height:16px;min-width:16px;min-height:16px;margin:0;padding:0;accent-color:#9a6a12}
.model-agent-mode label:has(input:focus-visible){outline:2px solid #9a6a12;outline-offset:2px}
.model-agent-mode:disabled{opacity:.6}.model-inherited-chain{margin:0;padding:6px 4px;color:#736f65;font-size:13px;line-height:1.6;overflow-wrap:anywhere}
