/* TASK-048 proposal: contextual controls belong to the chat header; the CRM
   panel has its own scroll container and becomes an overlay on narrow screens. */
.crm-linkbar{display:flex;align-items:center;gap:6px;min-width:0;margin-top:4px;max-width:100%;overflow:hidden}.crm-linkbar button,.crm-toggle,.crm-icon,.crm-text-button{border:0;background:transparent;color:#65788a;min-width:0;min-height:28px;padding:3px 5px;border-radius:7px;display:inline-flex;gap:6px;align-items:center;font-size:12px;cursor:pointer}.crm-linkbar button:hover,.crm-toggle:hover,.crm-icon:hover,.crm-text-button:hover{background:#eaf5fc;color:#247dad}.crm-linkbar button{overflow:hidden;max-width:210px}.crm-linkbar button span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.crm-linkbar svg,.crm-toggle svg,.crm-icon svg,.crm-text-button svg,.crm-avatar svg{width:16px;height:16px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.crm-divider{color:#ced7df}.crm-muted{color:#84929e;font-size:12px;line-height:1.65}.crm-toggle{position:fixed;z-index:61;right:0;top:60px;width:44px;height:44px;min-width:44px;min-height:44px;justify-content:center;padding:0;background:#fff;font-size:12px;box-shadow:0 2px 12px #263c501f}.crm-toggle span{display:none}.crm-toggle[aria-expanded=true]{background:#edf7fd;color:#2486bb}.conversation-head>div:first-child{min-width:0}.crm-linkbar .crm-icon{flex-shrink:0}.workspace-layout.crm-open{grid-template-columns:260px minmax(0,1fr) 320px}.workspace-layout.crm-open.rail-collapsed{grid-template-columns:72px minmax(0,1fr) 320px}.workspace-layout>.crm-panel{padding:0;border-left:1px solid #e5ecf1;background:#fbfcfd;min-height:0;display:flex;flex-direction:column;overflow:hidden}.crm-panel[hidden],.crm-backdrop[hidden]{display:none!important}.crm-panel-head{height:76px;flex-shrink:0;padding:16px 20px 10px;display:flex;align-items:center}.crm-kicker{font-size:9px;font-weight:650;letter-spacing:1.5px;color:#90a0ad;display:block;margin-bottom:7px}.crm-panel-head h2{font-size:15px;font-weight:600;letter-spacing:-.3px}.crm-icon{width:30px;height:30px;justify-content:center}.crm-tabs{display:flex;gap:3px;padding:0 20px 12px;border-bottom:1px solid #e8eef3}.crm-tabs button{border:0;background:transparent;min-width:0;min-height:30px;flex:1;font-size:12px;border-radius:7px;color:#86949e;display:inline-flex;align-items:center;justify-content:center;gap:5px}.crm-tabs button[aria-pressed=true]{background:#edf5fb;color:#247daf;font-weight:600}.crm-tab-icon{display:inline-flex}.crm-tab-icon svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.crm-content{padding:20px;display:flex;flex-direction:column;gap:20px;overflow-y:auto;min-height:0;scrollbar-width:thin;scrollbar-color:#d1dce5 transparent}.crm-content h3{font-size:14px;line-height:1.4;font-weight:600;letter-spacing:-.2px}.crm-content p{font-size:12px;line-height:1.65}.crm-record{border:1px solid #e6edf2;border-radius:12px;background:white;padding:16px;display:flex;flex-direction:column;gap:10px;box-shadow:0 2px 7px #20384b03}.crm-record-title{display:flex;align-items:center;gap:10px}.crm-record-title>div:last-child{min-width:0}.crm-record-title h3{overflow-wrap:anywhere}.crm-avatar{width:36px;height:36px;border-radius:10px;background:#eaf4fb;color:#5697bd;display:grid;place-items:center;flex-shrink:0}.crm-avatar svg{width:20px;height:20px}.crm-avatar.soft{background:#f2f5f8;color:#879eae}.crm-text-button{padding:0;align-self:flex-start;min-height:26px;color:#438aae}.crm-text-button.muted{color:#92a0aa}.crm-history{display:grid;gap:9px}.crm-history>div{display:flex;align-items:center;justify-content:space-between;gap:8px}.crm-badge{font-size:9px;padding:4px 7px;border-radius:5px;color:#6d98b3;background:#edf5fa;white-space:nowrap;align-self:flex-start}.crm-primary,.crm-secondary{min-height:34px;min-width:0;border:0;border-radius:8px;font-size:12px;padding:7px 12px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}.crm-primary{background:#53a8da;color:white}.crm-primary:hover{background:#419bce}.crm-secondary{background:#eff5f9;color:#5385a4}.crm-buttons{display:flex;gap:12px;align-items:center}.crm-form{display:grid;gap:8px}.crm-form label{font-size:11px;color:#6e818f;margin-top:6px}.crm-form label small{color:#9aa6af}.crm-form input,.crm-form select,.crm-form textarea{min-height:34px;min-width:0;width:100%;font:inherit;font-size:12px;border:1px solid #e3eaf0;border-radius:7px;background:#fcfdfe;padding:8px;color:#405768}.crm-form textarea{resize:vertical;min-height:78px}.crm-form button{margin-top:8px}.crm-consent{padding:10px;background:#f4f8fb;border-radius:8px;color:#70899a}.crm-warning{color:#997137}.crm-activity{display:grid;gap:10px}.crm-notification{display:flex;align-items:flex-start;gap:10px;padding:10px 0;border-bottom:1px solid #edf1f4}.crm-notification small{font-size:10px;color:#91a0ac}.crm-dot{width:5px;height:5px;border-radius:50%;background:#62a9d3;flex-shrink:0;margin-top:6px}.crm-switch{display:flex;align-items:center;gap:9px;font-size:11px;color:#587a8e;line-height:1.5}.crm-switch input{width:14px;height:14px;min-width:14px;min-height:14px;margin:0;accent-color:#53a8da}.crm-ai-placeholder{border:1px dashed #d8e5ee;border-radius:12px;padding:16px;display:grid;gap:10px}.crm-ai-mark{color:#61a6ce;font-size:25px}.crm-backdrop{display:none}.crm-panel :focus-visible,.crm-toggle:focus-visible,.crm-linkbar :focus-visible{outline:2px solid #439bcc;outline-offset:2px}
.crm-content{flex:1 1 auto;padding:16px;gap:14px}.crm-record{padding:14px;gap:8px}.crm-record .crm-kicker{margin-bottom:2px}
.crm-record-details{display:grid;gap:5px;margin:0}.crm-record-details>div{display:grid;grid-template-columns:44px minmax(0,1fr);gap:7px;font-size:11px;line-height:1.45}.crm-record-details dt{color:#8795a0}.crm-record-details dd{margin:0;color:#4d6373;overflow-wrap:anywhere}.crm-record a{text-decoration:none}
@media(max-width:1099px){.workspace-layout.crm-open{grid-template-columns:260px minmax(0,1fr)}.workspace-layout.crm-open.rail-collapsed{grid-template-columns:72px minmax(0,1fr)}.workspace-layout>.crm-panel{position:fixed;right:0;top:52px;bottom:0;width:min(320px,calc(100vw - 28px));z-index:60;box-shadow:-12px 0 48px #263c5019}.crm-panel-head{padding-right:60px}.crm-backdrop:not([hidden]){display:block;position:fixed;inset:52px 0 0;z-index:59;background:#233c4b21;border:0;padding:0}.crm-linkbar button{max-width:140px}}
@media(max-width:760px){.workspace-layout.crm-open,.workspace-layout.crm-open.rail-collapsed{grid-template-columns:minmax(0,1fr)}.crm-linkbar{gap:3px}.crm-linkbar button{max-width:110px;font-size:10px}.crm-toggle{padding:4px}.crm-toggle span{display:none}.crm-linkbar .crm-muted{font-size:10px}}
#next-actions-toggle svg { width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6; }
.next-actions-dialog { width:min(540px,calc(100vw - 28px));max-height:calc(100dvh - 40px);padding:20px;border:1px solid #dae5ee;border-radius:20px;background:#f8fbff;color:#233b50;box-sizing:border-box;box-shadow:0 16px 60px #193b5426; }
.next-actions-dialog::backdrop { background:#18304445;backdrop-filter:blur(3px); }
.next-actions-dialog>header,.next-actions-toolbar,.next-action-item>div { display:flex;align-items:center;justify-content:space-between;gap:12px; }
.next-actions-dialog h2 { margin:3px 0 0;font-size:20px; }
.next-actions-toolbar { margin:18px 0 10px; }
.next-actions-toolbar label { display:flex;align-items:center;gap:8px;font-size:13px; }
.next-actions-toolbar select { width:auto;min-height:32px;padding:4px 10px;border:1px solid #dce6ed;border-radius:10px;background:white;font:inherit; }
.next-actions-list h3 { margin:18px 0 8px;font-size:12px;color:#637d92; }
.next-action-item { margin:6px 0;padding:12px;background:white;border:1px solid #e2eaf0;border-radius:12px;overflow-wrap:anywhere; }
.next-action-item p { margin:0 0 7px;font-size:14px; }
.next-action-item>div,.next-action-item small { font-size:11px;color:#61798c; }
.next-action-item a { flex-shrink:0; }
.next-actions-dialog #next-actions-status { font-size:12px; }
/* Preserve the small glyphs while reserving distinct, usable hit regions.
   Keep this after the component size overrides. */
.crm-panel button,.crm-panel select,.crm-panel input:not([type=checkbox]):not([type=radio]),
.crm-panel a[href],.crm-linkbar button,.crm-toggle,
.next-actions-dialog button,.next-actions-dialog select,.next-actions-dialog a[href]{min-height:44px;min-width:44px}
.crm-overview-section,.crm-overview-detail{display:grid;gap:8px;padding:0 0 14px;border-bottom:1px solid #e7edf2}.crm-overview-row{width:100%;min-width:0;border:0;background:transparent;padding:4px 0;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;text-align:left;color:#263f52;cursor:pointer}.crm-overview-row:hover{color:#247dad}.crm-overview-row>span:nth-child(2){min-width:0;display:grid;gap:2px}.crm-overview-row strong,.crm-overview-row small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-overview-row small{font-size:11px;color:#84929e;font-weight:400}.crm-overview-row>b{font-size:18px;color:#9aa8b3;font-weight:400}.crm-overview-notes{border-top:1px solid #eef2f5;padding-top:6px}.crm-overview-notes summary{font-size:11px;color:#718493;cursor:pointer;list-style-position:inside}.crm-overview-notes form{display:grid;gap:7px;padding-top:8px}.crm-overview-notes textarea{width:100%;min-height:74px;resize:vertical;border:1px solid #dfe8ee;border-radius:8px;padding:8px;font:inherit;font-size:12px;color:#405768;background:#fcfdfe;box-sizing:border-box}.crm-note-actions{display:flex;align-items:center;gap:8px;justify-content:space-between}.crm-note-actions [role=status]{display:flex;align-items:center;gap:6px}.crm-overview-next{display:grid;gap:5px}.crm-overview-next small{color:#84929e;font-size:11px}.crm-contact-avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#edf5fb;color:#317da8;font-size:11px;font-weight:650}.crm-context-footer{margin-top:auto;padding-top:4px}.crm-overview-detail .crm-record-details{margin-top:6px}
.crm-overview-detail.crm-contact-detail{margin:0 -16px;padding:0 18px;border-bottom:0;gap:0}.crm-overview-detail-head{display:flex;align-items:center;gap:11px;padding-bottom:15px;border-bottom:1px solid #e7edf2}.crm-overview-detail-head>div{min-width:0}.crm-overview-detail-head h3{font-size:15px;overflow-wrap:anywhere}.crm-overview-detail-icon{width:30px;height:30px;border-radius:9px;background:#edf6fc;color:#6fa5c3;display:grid;place-items:center;flex-shrink:0}.crm-overview-detail-icon svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.crm-overview-detail-label{display:block;margin:0 0 3px;color:#91a2ae;font-size:9px;line-height:1;text-transform:uppercase;letter-spacing:1.1px}.crm-contact-detail .crm-record-details{padding:15px 0;margin:0;gap:8px}.crm-contact-detail .crm-record-details>div{grid-template-columns:51px minmax(0,1fr);gap:6px;font-size:11px;line-height:1.55}.crm-contact-detail .crm-overview-notes{padding:2px 0;border-top:1px solid #e7edf2;border-bottom:1px solid #e7edf2}.crm-contact-detail .crm-overview-notes summary{padding:12px 0;font-size:12px;line-height:normal;list-style-position:inside}.crm-contact-detail .crm-overview-notes form{padding:0 0 10px}.crm-contact-detail .crm-overview-notes textarea{min-height:110px;padding:9px 10px;line-height:18px}.crm-full-card{justify-content:normal;gap:5px;min-height:44px;margin:7px -5px -7px;padding:5px;font-size:11px;text-decoration:none}.crm-full-card svg{width:13px;height:13px}
.crm-contact-row:has(.crm-participant-company-row){grid-template-columns:auto minmax(0,1fr) auto}.crm-participant-company-row{grid-column:2/4;min-width:0;display:flex}.crm-participant-company-row .crm-text-button{padding:3px 5px;font-size:11px}.crm-participant-company{max-width:100%;white-space:normal;text-align:left}.crm-participant-company-unavailable{min-width:0;padding:3px 5px;color:#84929e;font-size:11px}.crm-participant-card-actions{display:flex;gap:8px;padding:8px 0;border-top:1px solid #e7edf2}.crm-participant-card-actions .crm-text-button{align-self:center}
.crm-contact-identity{min-width:0;width:100%;padding:3px 0;border:0;background:transparent;color:inherit;text-align:left;display:grid;gap:2px;cursor:pointer}.crm-contact-identity:hover strong{color:#247dad}.crm-contact-identity:disabled{cursor:default}.crm-contact-edit{width:44px;height:44px;min-width:44px;min-height:44px;justify-content:center;align-self:center;padding:0}.crm-contact-edit svg{width:17px;height:17px}
.crm-contact-shared{display:grid;gap:7px;padding:14px 0;border-top:1px solid #e7edf2}.crm-contact-shared [role=status]{font-size:12px;color:#5c7282;line-height:1.5}.crm-contact-shared ul{list-style:none;display:grid;gap:6px;margin:0;padding:0}.crm-contact-shared li{padding:7px 9px;border-radius:7px;background:#f4f8fb;overflow-wrap:anywhere}.crm-contact-shared small{display:block;color:#84929e;font-size:10px}:root[data-r2tg-theme="tg-dark"] .crm-contact-shared{border-color:#303030}:root[data-r2tg-theme="tg-dark"] .crm-contact-shared li{background:#2b2b2b;color:#ddd}
:root[data-r2tg-theme="tg-dark"] .workspace-layout>.crm-panel{background:#212121;color:#fff}:root[data-r2tg-theme="tg-dark"] .crm-overview-row,:root[data-r2tg-theme="tg-dark"] .crm-overview-row strong{color:#fff}:root[data-r2tg-theme="tg-dark"] .crm-overview-row small{color:#aaa}:root[data-r2tg-theme="tg-dark"] .crm-overview-section,:root[data-r2tg-theme="tg-dark"] .crm-tabs,:root[data-r2tg-theme="tg-dark"] .crm-overview-notes,:root[data-r2tg-theme="tg-dark"] .crm-participant-card-actions{border-color:#303030}
.crm-binding-maintenance{border-top:1px solid #e7edf2;padding-top:10px;color:#718493}.crm-binding-maintenance summary{font-size:11px;cursor:pointer;list-style-position:inside}.crm-binding-maintenance>div{display:grid;gap:7px;padding-top:10px}.crm-binding-maintenance .crm-text-button{margin-top:0}
.crm-action-group{display:grid;gap:0;padding:0 0 14px;border-bottom:1px solid #e7edf2}.crm-action-group:last-child{border-bottom:0}.crm-action-group>.crm-kicker{margin-bottom:5px}.crm-action-row{width:100%;border:0;border-top:1px solid #eef2f5;background:transparent;padding:10px 0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;text-align:left;color:#263f52;cursor:pointer}.crm-action-group>.crm-action-row:nth-child(2){border-top:0}.crm-action-row:hover{color:#247dad}.crm-action-row:disabled{color:#7f929f;cursor:default}.crm-action-row:disabled:hover{color:#7f929f}.crm-action-row>span{min-width:0;display:grid;gap:2px}.crm-action-row strong{font-size:13px;font-weight:600}.crm-action-row small{font-size:11px;color:#84929e;line-height:1.45}.crm-action-row>b{font-size:18px;color:#9aa8b3;font-weight:400}.crm-action-badge{justify-self:start;margin-top:4px;padding:3px 6px;border-radius:10px;background:#eef4f8;color:#7893a4;font-size:8px;font-style:normal;letter-spacing:.45px}
#crm-contact-results{display:grid;max-height:210px;overflow-y:auto;border:1px solid #e3eaf0;border-radius:8px;background:#fff}#crm-contact-results:empty{display:none}#crm-contact-results button{min-height:34px;margin:0;padding:7px 9px;border:0;border-bottom:1px solid #edf1f4;background:#fff;color:#405768;text-align:left;cursor:pointer}#crm-contact-results button:last-child{border-bottom:0;color:#438aae}#crm-contact-results button:hover,#crm-contact-results button[aria-selected=true]{background:#edf7fd}

/* Accepted Q1 tab scale. */
.crm-tabs button{font-size:14px}
.crm-contact-avatar{position:relative;overflow:hidden}.crm-contact-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0}.crm-contact-avatar img.loaded{opacity:1}
.crm-combo-field{display:grid;gap:5px}.crm-field-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:28px}.crm-field-heading label{margin:0}.crm-field-heading .crm-text-button{white-space:nowrap}.crm-combobox{position:relative}.crm-combobox input{padding-right:30px}.crm-combo-results{position:absolute;z-index:4;top:calc(100% + 4px);left:0;right:0;max-height:248px;overflow-y:auto;padding:4px;border:1px solid #dce7ee;border-radius:9px;background:#fff;box-shadow:0 10px 28px #29485c1f}.crm-combo-results[hidden]{display:none}.crm-combo-results button{display:flex;width:100%;min-height:44px!important;margin:0!important;padding:7px 9px!important;border:0;border-radius:6px;background:#fff;color:#405768;text-align:left;cursor:pointer}.crm-combo-results button:hover,.crm-combo-results button:focus,.crm-combo-results button[aria-selected=true]{background:#edf7fd}.crm-combo-results button span,.crm-combo-results strong,.crm-combo-results small{display:block;min-width:0}.crm-combo-results strong,.crm-combo-results small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-combo-results small{margin-top:2px;color:#8ba0ad;font-size:10px}.crm-combo-results p{padding:10px;margin:0;color:#8ba0ad}.crm-product-choices{position:relative;min-width:0;margin:5px 0 0;padding:0;border:0}.crm-product-choices summary{min-height:44px;padding:8px 30px 8px 9px;border:1px solid #e3eaf0;border-radius:7px;background:#fcfdfe;color:#405768;font-size:12px;line-height:18px;cursor:pointer;list-style-position:inside;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-product-choices>[role=listbox]{position:absolute;z-index:4;left:0;right:0;display:grid;gap:2px;max-height:180px;overflow-y:auto;margin-top:4px;padding:4px;border:1px solid #dce7ee;border-radius:9px;background:#fff;box-shadow:0 10px 28px #29485c1f}.crm-product-choices:not([open])>[role=listbox]{display:none}.crm-product-choices [data-crm-product]{display:flex;align-items:center;width:100%;min-height:44px!important;margin:0!important;padding:7px 9px!important;border:0;border-radius:7px;background:#fff;color:#405768;text-align:left;cursor:pointer}.crm-product-choices [data-crm-product]:hover,.crm-product-choices [data-crm-product]:focus,.crm-product-choices [data-crm-product][aria-selected=true]{background:#edf7fd}.crm-product-choices [data-crm-product]:focus-visible{outline:2px solid #247dad;outline-offset:2px}.crm-product-choices #crm-products-error:empty{display:none}
.crm-combo-results .crm-combo-warning{color:#855119;font-weight:500}.crm-combo-results button:disabled{opacity:1;background:#f3f5f7;color:#5b6973;cursor:not-allowed}:root[data-r2tg-theme="tg-dark"] .crm-combo-results .crm-combo-warning{color:#f1b56b}:root[data-r2tg-theme="tg-dark"] .crm-combo-results button:disabled{background:#2b2b2b;color:#b8b8b8}

/* Approved Q1 action shortcuts. */
.crm-action-row{padding:14px 24px;grid-template-columns:21px minmax(0,1fr) auto}
.crm-all-actions{grid-template-columns:minmax(0,1fr) auto;padding:10px 0}
.crm-action-row .crm-action-icon{display:flex;align-self:start;margin-top:2px;color:#53a8da}
.crm-action-icon svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round}
.crm-action-row strong{font-size:14px}
.crm-action-row small{font-size:12px;line-height:1.5}
#crm-action-link-required{color:#855119}
:root[data-r2tg-theme="tg-dark"] #crm-action-link-required{color:#f1b56b}

.crm-overview-deal-picker{width:100%;min-height:44px;padding:9px 10px;border:1px solid #e3eaf0;border-radius:7px;background:#fcfdfe;color:#84929e;font:inherit;font-size:12px;text-align:left;cursor:pointer}.crm-overview-deal-picker:hover{border-color:#86bce0;color:#247dad}.crm-overview-deal-picker:focus-visible{outline:2px solid #439bcc;outline-offset:2px}.crm-overview-section .crm-field-heading .crm-kicker{margin-bottom:0}

.crm-link-comparison{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:stretch;gap:8px}.crm-link-comparison>section{min-width:0;padding:10px;border:1px solid #e3eaf0;border-radius:9px;background:#f9fbfd}.crm-link-comparison h3,.crm-link-comparison p{overflow-wrap:anywhere}.crm-link-comparison .crm-muted{margin-top:4px}.crm-link-arrow{align-self:center;color:#6e9db9;font-size:18px}@media(max-width:420px){.crm-link-comparison{grid-template-columns:1fr}.crm-link-arrow{transform:rotate(90deg);justify-self:center}}

.crm-link-confirm-status{font-size:12px;font-weight:500;line-height:1.65;color:#49697e;overflow-wrap:anywhere}.crm-link-confirm-status[data-state="ambiguous"]{color:#855119}:root[data-r2tg-theme="tg-dark"] .crm-link-confirm-status{color:#9dcced}:root[data-r2tg-theme="tg-dark"] .crm-link-confirm-status[data-state="ambiguous"]{color:#f1b56b}

/* CRM navigation is a tab set, not a toggle/checkbox control. */
.crm-tabs button[aria-selected=true]{background:#edf5fb;color:#247daf;font-weight:600}

.crm-overview-section .crm-link-submit{width:100%;min-height:44px;margin-top:2px}

/* Preview values must identify the CRM record type, including duplicate names. */
.crm-review-fields{display:grid;gap:8px;margin:0}.crm-review-fields>div{display:grid;grid-template-columns:56px minmax(0,1fr);align-items:start;gap:8px}.crm-review-fields dt{color:#84929e;font-size:11px;line-height:1.45}.crm-review-fields dd{min-width:0;margin:0;font-size:12px;line-height:1.45;overflow-wrap:anywhere}.crm-review-fields>div:first-child dd{font-size:14px;font-weight:600}
.crm-link-overview{gap:10px}
.crm-link-overview>.crm-context-footer{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.crm-link-overview>.crm-context-footer .crm-text-button{min-height:44px;padding:6px 4px}
.crm-link-overview>.crm-overview-section{gap:5px;padding-bottom:9px}
.crm-link-overview .crm-combo-field{gap:2px}
.crm-link-overview .crm-field-heading{min-height:0}
.crm-link-overview .crm-field-heading label{margin-top:0}
.crm-link-overview .crm-product-choices{margin-top:0}
.crm-link-overview .crm-link-submit{margin-top:7px}
.crm-create-review-details>div{grid-template-columns:68px minmax(0,1fr)}

/* Keep the saved Deal, Company and Product visible above the link action. */
.crm-linkbar{display:grid;justify-items:start;gap:2px;overflow:visible}
.crm-linkbar-records{display:flex;align-items:center;flex-wrap:wrap;gap:3px;max-width:100%;min-width:0}
.crm-linkbar [data-edit-link]{max-width:100%;min-height:26px;padding:2px 5px}

/* Linked CRM context stays close to the chat title without tall link cards. */
.conversation-head .chat-heading{align-self:flex-start}
.conversation-head .crm-linkbar{margin-top:0;gap:0;max-width:100%;overflow:hidden}
.conversation-head .crm-linkbar-records{box-sizing:border-box;flex-wrap:nowrap;gap:2px;overflow-x:auto;padding:4px;scrollbar-width:none}
.conversation-head .crm-linkbar-records::-webkit-scrollbar{display:none}
.conversation-head .crm-linkbar-records button{flex:0 0 auto;height:24px;min-height:24px;max-width:210px;padding:1px 3px;gap:3px;border-radius:5px;font-size:11px}
.conversation-head .crm-linkbar-records svg{width:14px;height:14px}
.conversation-head .crm-divider{flex-shrink:0;margin:0 1px}
@media(max-width:760px){.conversation-head .crm-linkbar-records button{max-width:110px;font-size:10px}}
.crm-toggle{transform:translateY(48px)}
.workspace-layout.crm-open #refresh-live{display:none}
.crm-participants-section{grid-template-columns:minmax(0,1fr) 44px}.crm-participants-section>.crm-kicker{grid-column:1;grid-row:1;margin-bottom:0;align-self:center}.crm-participants-section>:not(.crm-kicker):not(.crm-participants-refresh){grid-column:1/-1}
.crm-participants-refresh{grid-column:2;grid-row:1;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;align-self:center;justify-content:center}

#crm-create-review #crm-create-error{color:#946a30}
[data-r2tg-theme="tg-dark"] #crm-create-review #crm-create-error{color:#b4874c}

/* R2TG AI Chat stays local to this page and wraps untrusted long content. */
.r2tg-ai-panel{display:grid;gap:12px;min-width:0}.r2tg-ai-panel header{display:grid;gap:4px}.r2tg-ai-panel header h3,.r2tg-ai-panel header p{margin:0;overflow-wrap:anywhere}.r2tg-ai-panel header p,.r2tg-ai-empty,.r2tg-ai-status{color:#718493;font-size:12px;line-height:1.5}.r2tg-ai-turns{display:grid;gap:9px;max-height:min(52vh,520px);overflow:auto}.r2tg-ai-turn{min-width:0;padding:9px 10px;border-radius:10px;background:#f4f8fb;overflow-wrap:anywhere;word-break:break-word}.r2tg-ai-turn-user{margin-left:18px;background:#eaf5fb}.r2tg-ai-turn-assistant{margin-right:18px}.r2tg-ai-turn>span,.r2tg-ai-turn>small{display:block;color:#84929e;font-size:10px}.r2tg-ai-turn>div{margin-top:5px;font-size:13px;line-height:1.55}.r2tg-ai-turn p,.r2tg-ai-turn ul{margin:0 0 6px}.r2tg-ai-turn p:last-child,.r2tg-ai-turn ul:last-child{margin-bottom:0}.r2tg-ai-turn a{color:#247dad}.r2tg-ai-composer{display:grid;gap:7px}.r2tg-ai-composer label{font-size:11px;color:#718493}.r2tg-ai-composer textarea{box-sizing:border-box;width:100%;min-height:84px;resize:vertical;padding:9px 10px;border:1px solid #dfe8ee;border-radius:8px;background:#fcfdfe;color:#405768;font:inherit;font-size:13px;line-height:1.5}.r2tg-ai-error{margin:0;color:#946a30;font-size:12px;line-height:1.5;overflow-wrap:anywhere}:root[data-r2tg-theme="tg-dark"] .r2tg-ai-turn{background:#2b2b2b;color:#ddd}:root[data-r2tg-theme="tg-dark"] .r2tg-ai-turn-user{background:#263c49}:root[data-r2tg-theme="tg-dark"] .r2tg-ai-composer textarea{border-color:#414141;background:#262626;color:#eee}:root[data-r2tg-theme="tg-dark"] .r2tg-ai-error{color:#d3a066}@media(max-width:520px){.r2tg-ai-turn-user{margin-left:8px}.r2tg-ai-turn-assistant{margin-right:8px}}

.crm-tabs{padding-top:12px;flex:0 0 auto}
.crm-tabs [hidden],.crm-tabs[hidden],.crm-content[hidden],.crm-linkbar[hidden]{display:none!important}
.crm-panel[data-active-tab="ai"] .crm-content{flex:1 1 auto;height:0;padding:0;gap:0;overflow:hidden}
.r2tg-ai-panel{display:flex;flex:1 1 auto;flex-direction:column;min-width:0;min-height:0;overflow:hidden}
.r2tg-ai-panel [data-ai-chat-latest]{flex:0 0 auto;align-self:center;min-height:28px;margin:0 16px}
.r2tg-ai-panel [data-ai-chat-latest][hidden]{display:none!important}
.r2tg-ai-turns{display:grid;align-content:start;gap:9px;flex:1 1 auto;min-height:0;max-height:none;overflow-y:auto;padding:16px;scrollbar-width:thin;scrollbar-color:#d1dce5 transparent}
.r2tg-ai-status,.r2tg-ai-error{flex:0 0 auto;margin:0;padding:8px 16px 0}
.r2tg-ai-composer{position:relative;display:flex;align-items:center;flex:0 0 auto;gap:8px;padding:12px 16px 16px;border-top:1px solid #e8eef3;background:#fbfcfd}
.r2tg-ai-composer textarea{flex:1;min-width:0;min-height:48px;max-height:120px;resize:none;padding-right:12px;border-radius:22px}
.r2tg-ai-composer .r2tg-ai-send{position:static;flex:0 0 40px;align-self:center;width:40px;height:40px;min-width:40px;min-height:40px;padding:0;border:0;border-radius:50%;background:#53a8da;color:#fff;font-size:20px;line-height:1;cursor:pointer}
.r2tg-ai-send:disabled{cursor:default;opacity:.55}
:root[data-r2tg-theme="tg-dark"] .r2tg-ai-composer{border-color:#303030;background:#212121}
.crm-chat-identity{display:flex;align-items:center;gap:12px;min-width:0;padding:14px 20px;border-bottom:1px solid #e7edf2}.crm-chat-identity .chat-avatar-wrap,.crm-chat-identity .chat-avatar{width:40px;height:40px;flex:none}.crm-chat-identity-copy{display:grid;gap:3px;min-width:0}.crm-chat-identity-copy strong{font-size:14px;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-chat-identity-copy small{font-size:11px;color:#84929e}
.crm-chat-identity[hidden]{display:none}
:root[data-r2tg-theme="tg-dark"] .crm-chat-identity{border-color:#303030}:root[data-r2tg-theme="tg-dark"] .crm-chat-identity-copy small{color:#aaa}
