/* Connector and server controls reuse the workspace font and mint palette. */
#integrationPanel{--cn-border:var(--line,#dfe8e3);--cn-muted:#7b8c84;font-family:inherit}
#integrationPanel .panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
#integrationPanel .panel-head>div{min-width:0}
#integrationPanel .panel-head button{flex-shrink:0;font-family:inherit}
#integrationServices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 20px;margin:12px 0}
#integrationServices p{margin:0;overflow-wrap:anywhere}
#integrationPanel details{font-size:12px;line-height:1.7;color:#7b8c84}
#integrationPanel details p{overflow-wrap:anywhere}
#integrationPanel summary{cursor:pointer;color:var(--ink,#263b32)}
.friend-event-item [data-friend-accept]{width:auto;min-height:28px;padding:5px 10px;margin-top:5px;font:inherit;font-size:11px;line-height:1.4}
@media(max-width:600px){#integrationPanel .panel-head{flex-wrap:wrap}#integrationServices{grid-template-columns:1fr}}
#page-connector {
  --cn-border: var(--line, #dfe8e3);
  --cn-muted: #7b8c84;
  --cn-accent: var(--primary, #00876a);
  font-family: inherit;
  font-size: 12px;
  color: var(--ink, #263b32);
}
#page-connector [hidden], .server-selector [hidden] { display: none !important; }
#page-connector button, #page-connector input, #page-connector select,
#page-connector textarea, .server-selector button, .server-selector input { font-family: inherit; }
#page-connector .quiet-button, #page-connector .primary,
.server-selector .server-profile-button, .server-profile-popover button {
  font-size: 11px; font-weight: 620; line-height: 1.35;
}
#page-connector .quiet-button { line-height: 1; }
#page-connector .cn-hero { align-items: center; margin-bottom: 22px; }
#page-connector .cn-hero p { max-width: 760px; line-height: 1.6; }
#page-connector .cn-hero > button { flex-shrink: 0; white-space: nowrap; }
.cn-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.cn-stat { padding: 18px; background: #fff; border: 1px solid var(--cn-border); border-radius: 12px; }
.cn-stat small { display: block; color: var(--cn-muted); font-size: 11px; }
.cn-stat strong { display: block; margin: 9px 0; font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.cn-stat p { margin: 0; color: var(--cn-muted); font-size: 11px; line-height: 1.6; }
.cn-panel { padding: 20px; margin-bottom: 18px; border: 1px solid var(--cn-border); border-radius: 12px; background: #fff; }
.cn-panel h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; color: #1b2925; }
.cn-panel p { font-size: 12px; line-height: 1.6; color: var(--cn-muted); }
.cn-connect { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.cn-connect label { flex: 1; min-width: 190px; }
.cn-picker { display: grid; grid-template-columns: minmax(0,560px); gap: 10px; margin: 16px 0; }
.cn-picker label { display: grid; gap: 7px; color: #47554f; font-size: 11px; font-weight: 600; }
.cn-picker select { min-height: 42px; }
.cn-picker .smart-select { min-width: 0; width: 100%; }
.cn-picker .smart-select-trigger { min-height: 42px; font-size: 11px; font-weight: 500; }
.cn-picker .cn-client-tech { margin: 0; }
.cn-client { min-width: 0; border: 1px solid var(--cn-border); border-radius: 10px; background: #fff; overflow: hidden; }
.cn-client.is-selected { border-color: #65aa98; background: #f3faf6; box-shadow: 0 0 0 1px #65aa98; }
#page-connector .cn-client-choice { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px; border: 0; border-radius: 0; background: transparent; color: inherit; text-align: left; font: inherit; }
.cn-client-choice:focus-visible { outline: 2px solid var(--cn-accent); outline-offset: -3px; }
.cn-client-mark { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 9px; background: #e6f3ed; color: #23876a; font-size: 19px; }
.cn-client-info { flex: 1; min-width: 0; }
.cn-client-info strong { display: block; font-size: 12px; font-weight: 650; line-height: 1.6; overflow-wrap: anywhere; }
.cn-client-info small { display: block; margin-top: 4px; font-size: 11px; line-height: 1.6; font-weight: 400; color: var(--cn-muted); overflow-wrap: anywhere; }
.cn-client-tech { border-top: 1px solid var(--cn-border); padding: 8px 14px; color: var(--cn-muted); font-size: 11px; line-height: 1.6; }
.cn-client-tech summary { cursor: pointer; }
.cn-client-tech small { display: block; padding-top: 6px; overflow-wrap: anywhere; }
.cn-client-actions { margin-top: 16px; }
.wecom-account-state.is-waiting .status-dot { background: #d1a23c; }
.cn-stat strong::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: #9ba6a0; vertical-align: middle; }
.cn-stat strong:not([class^="cn-status-"])::before { display: none; }
.cn-stat strong.cn-status-online::before { background: #22966b; }
.cn-stat strong.cn-status-pending::before { background: #d1a23c; }
.cn-note { padding: 11px 14px; border-left: 3px solid #d6a657; background: #fff9ed; font-size: 11px; color: #79603a; line-height: 1.7; margin: 14px 0; }
#page-connector .cn-note { color: #79603a; font-size: 11px; }
.cn-toolbar { display: grid; grid-template-columns: minmax(180px,1fr) minmax(150px,200px) minmax(150px,200px); gap: 10px; align-items: center; margin-bottom: 16px; }
.cn-toolbar > * { min-width: 0; width: 100%; }
.cn-toolbar .smart-select { width: 100%; min-width: 0; }
.cn-workspace { display: grid; grid-template-columns: minmax(230px,.85fr) minmax(0,1.7fr); gap: 20px; align-items: start; }
.cn-workspace > div { min-width: 0; }
.cn-catalog { max-height: 660px; overflow: auto; padding-right: 5px; }
.cn-operation { display: block; width: 100%; text-align: left; border: 1px solid var(--cn-border); background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 8px; color: #334b40; }
.cn-operation:hover, .cn-operation.active { border-color: #90bfae; background: #f0f9f5; }
.cn-operation strong { font-size: 12px; font-weight: 650; }
.cn-operation small { display: block; color: var(--cn-muted); margin-top: 5px; font-size: 11px; overflow-wrap: anywhere; }
.cn-chip { display: inline-flex; padding: 3px 7px; border-radius: 6px; background: #edf5f1; color: #557365; font-size: 10px; margin-right: 8px; }
.cn-chip.write { background: #fff1dd; color: #926329; }
.cn-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.cn-fields label { min-width: 0; }
.cn-fields label.wide { grid-column: 1 / -1; }
.cn-fields small { display: block; font-size: 11px; font-weight: 400; color: var(--cn-muted); line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
#page-connector input, #page-connector select:not(.smart-select-native), #page-connector textarea {
  font-size: 11px; border: 1px solid #d5dfdb; border-radius: 10px; padding: 9px 12px;
  min-height: 42px; background: #fff; color: #33423d; width: 100%; max-width: 100%;
}
#page-connector input:focus, #page-connector textarea:focus { outline: none; border-color: #65aa98; box-shadow: 0 0 0 3px rgba(0,135,106,.09); }
#page-connector label { display: flex; flex-direction: column; gap: 7px; font-size: 11px; font-weight: 600; color: #47554f; }
#page-connector button { cursor: pointer; }
#page-connector button:disabled { opacity: .5; cursor: not-allowed; }
#cnResult { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 440px; overflow: auto; background: #f6f9f7; border: 1px solid var(--cn-border); border-radius: 10px; padding: 16px; font: 12px/1.8 Consolas,monospace; margin-top: 14px; }
.cn-result-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cn-result-head h3 { margin-top: 20px; }
.cn-table { width: 100%; border-collapse: collapse; }
.cn-table th, .cn-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--cn-border); white-space: normal; overflow-wrap: anywhere; }
.cn-table th { color: var(--cn-muted); font-size: 11px; font-weight: 500; }
.cn-table td { font-size: 12px; }
.cn-scroll { overflow: auto; }
.cn-empty { padding: 24px; text-align: center; color: var(--cn-muted); }
.cn-footer { font-size: 11px; color: var(--cn-muted, #7b8c84); line-height: 1.7; margin-top: 12px; }
#page-connector .cn-footer { font-size: 11px; }
.cn-error { color: #b42318 !important; }
.cn-ok { color: #237051 !important; }
.cn-history { margin-top: 14px; border-top: 1px solid var(--cn-border); padding-top: 12px; }
.cn-history summary { cursor: pointer; color: #6b8075; font-size: 11px; }
.cn-history .cn-connect { margin-top: 10px; }

/* Match the selector and name editor to the existing topbar controls. */
.server-selector { position: relative; display: flex; align-items: center; gap: 7px; white-space: nowrap; color: #53645d; }
.server-selector-caption { font-size: 11px; font-weight: 620; }
.server-selector select:not(.smart-select-native) { width: 158px; min-width: 110px; max-width: 19vw; height: 34px; padding: 0 26px 0 10px; border: 1px solid var(--line,#e5ebe8); border-radius: 9px; color: #475467; background: #fff; font-family: inherit; font-size: 11px; font-weight: 620; line-height: 1; }
.server-selector .smart-select { width: 158px; min-width: 110px; max-width: 19vw; }
.server-selector .smart-select-trigger { min-height: 34px; height: 34px; padding: 8px 10px; border-color: var(--line,#e5ebe8); border-radius: 9px; color: #475467; background: #fff; box-shadow: none; font-family: inherit; font-size: 11px; font-weight: 620; line-height: 11px; }
.server-selector .smart-select-trigger:hover { border-color: #bcd8ce; color: var(--primary,#00876a); background: #f5fbf8; }
.server-profile-button { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line,#e5ebe8); border-radius: 9px; color: #596b64; background: #fff; }
.server-profile-button:hover { border-color: #bcd8ce; color: var(--primary,#00876a); background: #f5fbf8; }
.server-profile-button[hidden] { display: none !important; }
.server-profile-popover { position: absolute; top: calc(100% + 9px); right: 0; z-index: 60; display: grid; gap: 12px; width: min(340px,calc(100vw - 24px)); padding: 16px; border: 1px solid #dce7e2; border-radius: 12px; background: #fff; box-shadow: 0 16px 42px rgba(19,52,41,.16); white-space: normal; }
.server-profile-popover[hidden] { display: none !important; }
.server-profile-popover-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 11px; border-bottom: 1px solid #e8eeeb; }
.server-profile-popover-head > div { display: grid; gap: 3px; }
.server-profile-popover-head b { color: #283d35; font-size: 13px; font-weight: 700; }
.server-profile-popover-head small { color: #7d8b85; font-size: 11px; line-height: 1.5; }
.server-profile-popover-head > button { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; padding: 0; border: 1px solid #e1e9e5; border-radius: 8px; color: #60716a; background: #fff; }
.server-profile-popover label { display: grid; gap: 6px; color: #42574e; font-size: 11px; font-weight: 620; }
.server-profile-popover input { width: 100%; min-height: 36px; padding: 8px 10px; border: 1px solid #d7e2dd; border-radius: 8px; color: #263b33; background: #fff; font-family: inherit; font-size: 11px; line-height: 1.4; }
.server-profile-popover input:focus { outline: 0; border-color: #65aa98; box-shadow: 0 0 0 3px rgba(0,135,106,.09); }
.server-profile-popover #serverProfileSave { width: 100%; min-height: 36px; font-family: inherit; font-size: 11px; font-weight: 620; line-height: 1.35; }
.server-profile-hint { min-height: 18px; margin: 0; color: #08765f; font-size: 11px; line-height: 1.5; }
.server-profile-hint.is-error { color: #b42318; }

@media(max-width:1100px) {
  .cn-grid { grid-template-columns: 1fr 1fr; }
  .cn-workspace { grid-template-columns: 1fr; }
  .cn-catalog { max-height: 280px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .cn-operation { margin: 0; }
}
@media(max-width:600px) {
  .cn-fields, .cn-grid, .cn-catalog, .cn-toolbar { grid-template-columns: 1fr; }
  #page-connector .cn-hero { align-items: start; flex-direction: column; }
  .cn-panel { padding: 15px; }
  .cn-connect { align-items: stretch; flex-direction: column; }
  .cn-connect label { min-width: 0; }
  .cn-connect button { width: 100%; }
  .server-selector-caption { display: none; }
  .server-selector select:not(.smart-select-native), .server-selector .smart-select { width: 142px; max-width: 34vw; }
}

.workspace-selector{position:relative;display:flex;align-items:center;font:inherit;color:#53645d}
.server-selector{gap:0;min-width:0}.server-selector>.server-selector-caption,.server-selector>#serverSelect,.server-selector>.smart-select,.server-selector>#serverProfileButton{display:none!important}
.ws-current small{font-size:11px;color:#819189}.ws-company button:disabled{opacity:.6;cursor:not-allowed}
.workspace-trigger{height:34px;display:flex;align-items:center;gap:7px;padding:0 10px;border:1px solid var(--line,#e5ebe8);border-radius:9px;background:#fff;color:#475467;font:inherit;font-size:11px;font-weight:620;white-space:nowrap;cursor:pointer}
.workspace-trigger:hover{border-color:#bcd8ce;background:#f5fbf8;color:var(--primary,#00876a)}.workspace-trigger b{max-width:145px;overflow:hidden;text-overflow:ellipsis;font-weight:620}.workspace-trigger>.ti:last-child{font-size:14px;color:#82938b}
.workspace-popover{position:absolute;right:0;top:calc(100% + 9px);z-index:70;width:min(430px,calc(100vw - 24px));padding:15px;border:1px solid #dce7e2;border-radius:12px;background:#fff;box-shadow:0 16px 42px rgba(19,52,41,.16);font:inherit}
.workspace-popover[hidden]{display:none}.workspace-popover header,.workspace-popover footer,.ws-account-head,.ws-company{display:flex;align-items:center;justify-content:space-between;gap:10px}.workspace-popover header{padding-bottom:11px;border-bottom:1px solid #e8eeeb}.workspace-popover header>div{display:grid;gap:3px}.workspace-popover header b{font-size:13px;color:#283d35}.workspace-popover header small,.ws-account-head small{font-size:11px;color:#7d8b85;line-height:1.5}.workspace-close{width:29px;height:29px;border:1px solid #e1e9e5;border-radius:8px;background:#fff;color:#60716a;cursor:pointer}.workspace-server{padding:12px 0;border-bottom:1px solid #edf1ef}.workspace-server label{display:grid;gap:6px;font-size:11px;font-weight:620;color:#42574e}.workspace-server select{height:34px;border:1px solid #d7e2dd;border-radius:8px;background:#fff;padding:0 9px;font:inherit;font-size:11px;color:#263b33}.workspace-tree{max-height:min(52vh,420px);overflow:auto;padding:8px 0}.ws-account{padding:8px 0;border-bottom:1px solid #edf1ef}.ws-account:last-child{border-bottom:0}.ws-account-head{padding:2px 2px 6px;color:#31493f;font-size:12px}.ws-company{gap:6px;margin:4px 0}.ws-company>button:first-child{display:flex;align-items:center;gap:8px;min-width:0;flex:1;padding:8px;border:1px solid transparent;border-radius:8px;background:#fbfdfc;color:#385147;text-align:left;font:inherit;cursor:pointer}.ws-company>button:first-child:hover,.ws-company.is-selected>button:first-child{border-color:#c8e2d8;background:#f2faf6}.ws-company>button:first-child>span{display:grid;min-width:0}.ws-company>button:first-child b,.ws-company>button:first-child small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ws-company>button:first-child b{font-size:11px;font-weight:620}.ws-company>button:first-child small{font-size:10px;color:#85948d;margin-top:2px}.ws-switch{padding:6px 8px;border:1px solid #cbe1d8;border-radius:7px;background:#fff;color:#14775f;font:inherit;font-size:10px;cursor:pointer}.ws-chip{display:inline-flex;align-items:center;flex:0 0 auto;padding:2px 6px;border-radius:999px;font-size:10px;font-weight:620;line-height:1.4}.ws-online{color:#14775f;background:#e5f6ee}.ws-switchable{color:#216f8f;background:#e6f4f8}.ws-offline{color:#75817d;background:#eef1f0}.ws-unknown,.ws-unconfirmed{color:#8b6b20;background:#fff5dc}.workspace-hint,.ws-empty{margin:10px 0 0;padding:8px 10px;border-radius:8px;background:#f7faf8;color:#71817a;font-size:10px;line-height:1.6}.workspace-popover footer{padding-top:10px;border-top:1px solid #edf1ef}.workspace-popover footer button{font:inherit;font-size:11px}
.workspace-trigger .ws-account-status{font:inherit;font-size:10px;font-weight:400;color:#75877e;border-left:1px solid #e3ebe7;padding-left:7px}
@media(max-width:600px){.workspace-trigger>span:not(.ws-chip){display:none}.workspace-trigger b{max-width:90px}.workspace-trigger .ws-account-status{font-size:9px;padding-left:5px}.workspace-popover{right:-8px}.workspace-trigger{padding:0 8px}}

/* Account/company rows share one alignment system with the dashboard card. */
.workspace-popover{width:min(480px,calc(100vw - 32px));box-sizing:border-box;white-space:normal}
@media(min-width:901px){.workspace-popover{left:0;right:auto}}
.workspace-popover header>div{min-width:0}
.workspace-close{flex:0 0 29px;display:grid;place-items:center;padding:0}
.workspace-tree{overscroll-behavior:contain;scrollbar-gutter:stable;padding:10px 0}
.ws-account{padding:10px 0}
.ws-account-head,.ws-current-head{display:grid;grid-template-columns:30px minmax(0,1fr) auto;align-items:center;gap:9px}
.ws-account-head{padding:0 4px 9px}
.ws-account-head.has-actions{grid-template-columns:30px minmax(0,1fr) auto 28px}
.ws-remove{width:28px;height:28px;padding:0;display:grid;place-items:center;border:1px solid transparent;border-radius:7px;background:transparent;color:#87938d;font:inherit;font-size:15px;cursor:pointer}
.ws-remove:not(:disabled):hover{color:#b44848;background:#fff1f1;border-color:#edd3d3}
.ws-remove:disabled{opacity:.4;cursor:not-allowed}
.ws-account-head>div,.ws-current-head>div{display:grid;gap:2px;min-width:0}
.ws-account-head b,.ws-current-head b{overflow-wrap:anywhere;font-size:12px;font-weight:650;color:#283d35;line-height:1.5}
.ws-account-mark,.ws-company-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:8px;background:#edf6f2;color:#33806b;font-size:16px;flex-shrink:0}
.ws-company{display:grid;grid-template-columns:28px minmax(0,1fr) 65px 80px;gap:8px;margin:5px 0;padding:10px;border:1px solid #e8eeeb;border-radius:9px;background:#fbfdfc}
.ws-company.is-selected{border-color:#beddd0;background:#f1f9f5}
.ws-company-icon{width:28px;height:28px;border-radius:7px;background:#fff;color:#7a9186;font-size:15px}
.ws-company-info{display:grid;gap:3px;min-width:0}
.ws-company-info b{font-size:12px;line-height:1.5;font-weight:620;color:#31493f;overflow-wrap:anywhere}
.ws-company-info small{font-size:10px;line-height:1.55;color:#7b8e84;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.ws-switch{width:80px;min-height:30px;padding:6px 5px;font-size:11px;line-height:1.4;white-space:nowrap}
.ws-switch:not(:disabled):hover{background:#eaf6ef;border-color:#91c6b2}
.ws-company .ws-chip{justify-self:start}
.ws-chip{gap:5px;white-space:nowrap;font-family:inherit}
.ws-dot{width:6px;height:6px;flex:0 0 6px;border-radius:50%;display:inline-block;background:currentColor}
.ws-online{color:#16815f;background:#e8f6ef}
.ws-switchable{color:#337bc0;background:#edf4fc}
.ws-offline{color:#89938e;background:#f0f2f1}
.ws-unknown,.ws-unconfirmed{color:#a07b27;background:#fff6df}
.workspace-hint{font-size:11px;min-height:34px;margin:0 0 10px;overflow-wrap:anywhere}
.workspace-hint.is-checking{color:#246a99;background:#eef6fc}
.workspace-refresh:disabled{opacity:.55;cursor:wait}
.workspace-popover footer button{display:inline-flex;align-items:center;gap:5px;min-height:30px}
.workspace-selector button:focus-visible{outline:2px solid #55a28b;outline-offset:2px}
.ws-current{margin:0 18px 18px;padding:14px;border:1px solid #e4eee8;border-radius:10px;background:#fbfdfc;min-width:0}
.ws-current-head{padding-bottom:12px;border-bottom:1px solid #e7eeea}
.ws-current-details{display:grid;gap:10px;margin:12px 0;font-size:11px;line-height:1.6}
.ws-current-details>div{display:grid;grid-template-columns:66px minmax(0,1fr);align-items:start;gap:10px}
.ws-current-details dt{color:#7b8d83}
.ws-current-details dd{display:flex;align-items:center;gap:7px;flex-wrap:wrap;min-width:0;margin:0;color:#395146;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.ws-current-details dd b{font-size:12px;font-weight:620;overflow-wrap:anywhere;max-width:100%}
.ws-current .ws-current-note{margin:0;padding-top:10px;border-top:1px solid #e7eeea;color:#75877e;font-size:11px;line-height:1.7;overflow-wrap:anywhere}
#heroWecom .ws-chip{border:0;padding:0;background:transparent;border-radius:0;font-size:inherit}
#heroWecom .ws-online{color:#16815f}#heroWecom .ws-offline{color:#89938e}#heroWecom .ws-switchable{color:#337bc0}#heroWecom .ws-unknown,#heroWecom .ws-unconfirmed{color:#a07b27}
@media(max-width:600px){
  .workspace-popover{position:fixed;top:70px;left:12px;right:12px;width:auto;padding:13px;max-height:calc(100dvh - 90px);overflow:auto}
  .workspace-tree{max-height:min(48vh,370px)}
  .workspace-trigger .ws-account-status{display:none}
  .ws-current{margin:0 14px 14px;padding:12px}
}
@media(max-width:400px){
  .ws-company{grid-template-columns:26px minmax(0,1fr) 76px;padding:9px;column-gap:7px;row-gap:6px}
  .ws-company-icon{grid-column:1;grid-row:1;width:26px;height:26px}
  .ws-company-info{grid-column:2;grid-row:1 / 3}
  .ws-company .ws-chip{grid-column:3;grid-row:1;justify-self:center}
  .ws-company .ws-switch{grid-column:3;grid-row:2;width:76px}
  .ws-current-details>div{grid-template-columns:60px minmax(0,1fr);gap:8px}
}
