/* Profile overlays occupy the content region, leaving both navigation rails intact. */
.crm-workspace>.crm-main{position:relative;isolation:isolate;min-width:0}
.crm-profile-bottom,.crm-card-overlay{position:absolute;inset:0;overflow:hidden;pointer-events:auto}
.crm-profile-shade,.crm-profile-bottom>.crm-contact-drawer-backdrop{position:absolute;inset:0;width:100%;height:100%;border:0;background:rgba(12,22,38,.28);cursor:default}
html[data-theme] .crm-workspace .crm-profile-bottom>.crm-contact-drawer-panel,
.crm-profile-bottom-panel{position:absolute;inset:8px 12px 0;display:flex;flex-direction:column;width:calc(100% - 24px);height:calc(100% - 8px);min-height:0;max-width:none;border:1px solid var(--color-border-strong);border-bottom:0;border-radius:13px 13px 0 0;background:var(--color-canvas);box-shadow:0 -8px 30px var(--color-shadow);overflow:hidden;transition:none}
.crm-workspace .crm-profile-bottom .crm-contact-drawer-head{padding:22px 28px;gap:20px;align-items:center;flex:0 0 auto;background:var(--color-surface);border-bottom:1px solid var(--color-border-subtle)}
.crm-profile-bottom .crm-contact-drawer-head h2{margin:0;font-size:26px;font-weight:700;line-height:1.35}
.crm-profile-identifiers{display:flex;flex-wrap:wrap;gap:6px 20px;margin-top:7px;color:var(--color-text-primary);font-size:15px;font-weight:550;line-height:1.5;overflow-wrap:anywhere}
.crm-profile-bottom .crm-drawer-actions{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:8px}
.crm-profile-bottom .crm-drawer-actions>a{text-decoration:none}
.crm-profile-bottom .crm-drawer-tabs{display:flex;flex:0 0 auto;min-width:0;gap:6px;padding:9px 28px;overflow-x:auto;white-space:nowrap;background:var(--color-surface);border-bottom:1px solid var(--color-border-subtle)}
.crm-profile-bottom .crm-contact-tab{flex:none;border-radius:8px;font-size:15px;font-weight:650;padding:10px 16px;border:0;color:var(--color-text-primary)}
.crm-profile-bottom .crm-contact-tab span{margin-inline-start:5px;font-size:12px;color:var(--color-text-secondary)}
.crm-profile-bottom .crm-drawer-body{flex:1 1 0;min-height:0;overflow:auto;padding:26px 28px;overscroll-behavior:contain;overflow-anchor:none}
.crm-workspace .crm-profile-bottom .crm-profile-overview{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(300px,1fr);align-items:start;gap:22px;max-width:none;margin:0}
.crm-profile-bottom .crm-profile-section{padding:24px;margin:0;border:1px solid var(--color-border-strong);border-radius:12px;background:var(--color-surface);min-width:0}
.crm-profile-bottom .crm-profile-section h3,.crm-card-panel h3{margin:0 0 14px;font-size:18px;font-weight:700;color:var(--color-text-primary)}
.crm-profile-bottom .crm-profile-contact-grid{gap:0;padding-top:4px;margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.crm-profile-bottom .crm-profile-contact-grid dt{font-size:13px;font-weight:600;color:var(--color-text-secondary);margin-bottom:8px}
.crm-profile-bottom .crm-profile-contact-grid dd{font-size:16px;font-weight:600;color:var(--color-text-primary);line-height:1.6;overflow-wrap:anywhere}
.crm-profile-bottom .crm-drawer-section{margin-top:28px;padding:22px 0 0;border:0;border-top:1px solid var(--color-border-subtle);background:transparent;box-shadow:none}
.crm-profile-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.crm-profile-section-head h3{margin:0!important}
.crm-profile-section-head p{margin:5px 0 0;color:var(--color-text-secondary);font-size:14px;line-height:1.5}
.crm-profile-card-summary{position:relative;display:block;width:100%;padding:16px 34px 16px 16px;text-align:start;background:var(--color-canvas);border:1px solid var(--color-border-strong);border-radius:10px;color:var(--color-text-primary);cursor:pointer;min-width:0}
.crm-profile-card-summary:hover{background:var(--color-selected);border-color:var(--color-accent-border)}
.crm-profile-card-summary:focus-visible,.crm-profile-related-person:focus-visible,.crm-card-subject:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}
.crm-profile-card-arrow{position:absolute;right:12px;top:17px;color:var(--color-text-secondary)}
.crm-profile-card-summary .crm-contact-card-preview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:13px;gap:12px}
.crm-profile-card-summary .crm-contact-card-preview>span{min-width:0;display:flex;flex-direction:column;gap:4px}
.crm-profile-card-summary .crm-contact-card-preview b{font-size:15px;font-weight:600;overflow-wrap:anywhere}
.crm-profile-card-summary .crm-contact-card-preview small{font-size:13px;color:var(--color-text-secondary)}
.crm-profile-card-summary .crm-contact-card-heading{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;align-items:center;font-size:16px}
.crm-profile-card-summary .crm-contact-card-empty{display:block;margin-top:10px;font-size:12px;color:var(--color-text-secondary)}
.crm-profile-bottom .crm-contact-card-list{display:grid;gap:10px}
.crm-profile-bottom .crm-organization-pill{cursor:pointer;border:0;background:transparent;color:var(--color-text-primary);text-align:start;padding:0}
.crm-organization-profile-overview{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(300px,1fr);gap:22px;max-width:none;margin:0}
.crm-organization-profile-overview .crm-drawer-detail-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;padding-top:12px}
.crm-profile-related-person{display:flex;flex-direction:column;gap:5px;width:100%;text-align:start;padding:12px 0;border:0;border-bottom:1px solid var(--color-border-subtle);color:var(--color-text-primary);background:transparent;cursor:pointer}
.crm-profile-related-person strong{font-size:14px;font-weight:600}
.crm-profile-related-person span{font-size:13px;color:var(--color-text-secondary)}
.crm-profile-related-person:last-of-type{margin-bottom:26px}
.crm-profile-table-wrap{max-width:100%;overflow:auto}
.crm-profile-table-wrap .crm-table{min-width:750px}
.crm-profile-table-wrap .crm-table td{font-size:14px}
.crm-profile-loading{display:grid;place-content:center;min-height:160px;gap:16px;padding:24px;font-size:14px;color:var(--color-text-secondary)}
.crm-organization-card-add{display:flex;align-items:end;gap:12px;margin:16px 0;padding:16px;background:var(--color-surface);border:1px solid var(--color-border-subtle);border-radius:8px}
.crm-organization-card-add label{display:flex;flex-direction:column;gap:7px;flex:1;max-width:400px;font-size:13px}
.crm-organization-card-add select,.crm-card-location select{height:40px;border:1px solid var(--color-border-strong);border-radius:7px;background:var(--color-surface);color:var(--color-text-primary);padding:0 10px;min-width:0;width:100%;font:inherit}
/* Exact-card editor is independent from the contact/organization profile. */
[data-crm-card-host]{position:absolute;inset:0;pointer-events:none}
.crm-card-overlay{pointer-events:auto}
.crm-card-panel{position:absolute;inset:0 0 0 auto;width:min(640px,100%);display:flex;flex-direction:column;background:var(--color-canvas);color:var(--color-text-primary);border:0;box-shadow:-10px 0 30px var(--color-shadow);min-height:0;outline:none}
.crm-card-panel-head{display:flex;align-items:center;justify-content:space-between;padding:16px 24px;flex:0 0 auto;border:0;background:var(--color-selected-strong);background-image:none;box-shadow:none;color:var(--color-text-primary)}
.crm-card-panel-head h2{font-family:var(--font-body);font-size:20px;font-weight:750;margin:0;color:inherit}
.crm-card-panel .crm-drawer-close,.crm-profile-bottom .crm-drawer-close{border:1px solid var(--color-border-strong);background:var(--color-surface);color:var(--color-text-primary);width:34px;height:34px;border-radius:7px;cursor:pointer;font-size:21px;line-height:1}
.crm-card-save-status{flex:none;margin:0;padding:9px 24px;font-size:14px;font-weight:550;line-height:1.5;min-height:39px;color:var(--color-text-primary);background:var(--color-selected-strong);border-bottom:1px solid var(--color-accent-border);overflow-wrap:anywhere}
.crm-card-save-status.is-error{color:var(--color-text-primary);font-weight:650;border-inline-start:4px solid var(--color-danger,#c43d47)}
.crm-card-panel-body{flex:1 1 0;overflow:auto;min-height:0;overscroll-behavior:contain;overflow-anchor:none;padding:20px 24px 24px}
.crm-card-subject{width:100%;text-align:start;display:flex;flex-direction:column;gap:9px;border:1px solid var(--color-accent-border);border-radius:10px;background:var(--color-selected-strong);padding:14px 16px;color:var(--color-text-primary);cursor:pointer}
.crm-card-subject:hover{background:var(--color-selected)}
.crm-card-subject-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;min-width:0}
.crm-card-subject-heading>strong{font-size:20px;font-weight:700;line-height:1.4;overflow-wrap:anywhere;min-width:0}
.crm-card-subject-identifiers{display:flex;flex-wrap:wrap;gap:5px 18px;font-size:16px;font-weight:550;line-height:1.5;overflow-wrap:anywhere}
.crm-card-subject-identifiers:empty{display:none}
.crm-card-subject-identifiers>span{min-width:0;max-width:100%}
.crm-card-subject-link{flex:none;font-size:14px;font-weight:700;color:var(--color-accent);white-space:nowrap}
.crm-card-location{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);align-items:center;gap:16px;margin:18px 0;padding:0;border:0}
.crm-card-location>div{min-width:0}
.crm-card-location strong{display:inline-block;font-size:17px;font-weight:700;line-height:1.5;overflow-wrap:anywhere;color:var(--color-text-primary)}
.crm-card-location select{height:44px;font-size:16px;font-weight:600;border-color:var(--color-accent-border);background:var(--color-surface);color:var(--color-text-primary)}
.crm-card-fields{padding:0;border:0;border-radius:0;background:transparent}
.crm-card-fields>h3{font-size:18px;margin:0 0 20px;color:var(--color-text-primary);font-family:var(--font-body)}
.crm-card-fields>p{font-size:15px;color:var(--color-text-primary);line-height:1.6;margin:0}
.crm-card-field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 18px}
.crm-card-field{min-width:0;display:flex;flex-direction:column;gap:7px}
.crm-card-field.is-wide{grid-column:1/-1}
.crm-card-field>label{font-size:14px;font-weight:650;line-height:1.6;color:var(--color-text-primary)}
.crm-card-field .pipeline-typed-input{width:100%;min-width:0;box-sizing:border-box;font-size:16px;line-height:1.5}
.crm-card-selected{padding-top:24px;margin-top:24px;border-top:1px solid var(--color-border-subtle)}
.crm-card-contact-links{display:grid;gap:7px}
.crm-card-contact-links>button{display:flex;flex-direction:column;gap:5px;text-align:start;cursor:pointer;border:1px solid var(--color-border-subtle);border-radius:7px;background:var(--color-surface);padding:12px;color:var(--color-text-primary)}
.crm-card-contact-links strong{font-size:14px;font-weight:600}.crm-card-contact-links small{font-size:13px}
.crm-card-selected>input{width:100%;height:38px;border:1px solid var(--color-border-strong);border-radius:6px;padding:0 10px;background:var(--color-surface);color:var(--color-text-primary);margin-bottom:12px}
.crm-card-contact-choices{display:grid;gap:8px}.crm-card-contact-choices>label{display:flex;align-items:center;gap:10px;cursor:pointer;padding:8px 0}.crm-card-contact-choices>label>span{display:flex;flex-direction:column;gap:4px;min-width:0}.crm-card-contact-choices strong{font-size:13px}.crm-card-contact-choices small{font-size:12px;overflow-wrap:anywhere}
.crm-card-footer{margin-top:28px;padding-top:20px;border-top:1px solid var(--color-border-subtle);display:flex;gap:10px;flex-wrap:wrap;align-items:center}.crm-card-footer>p{font-size:13px;line-height:1.5;width:100%}.crm-card-danger{color:var(--color-danger,#c43d47)}
.crm-pipeline-card[data-crm-card-open]{cursor:pointer;text-align:start}
.crm-pipeline-card-top[data-contact-open],.crm-pipeline-card-top[data-organization-open]{cursor:pointer}
.crm-pipeline-card-top[data-contact-open]:hover,.crm-pipeline-card-top[data-organization-open]:hover{background:var(--color-selected-strong)}
.crm-pipeline-card-top[role="button"]:focus-visible,.crm-pipeline-card[data-crm-card-open]:focus-visible{outline:2px solid var(--color-accent);outline-offset:-2px}
.crm-shared-profile-overlay>[data-crm-card-host]{position:absolute;inset:0}
@media(max-width:1000px){.crm-workspace .crm-profile-bottom .crm-profile-overview,.crm-organization-profile-overview{grid-template-columns:minmax(0,1fr)}.crm-profile-overview>[data-crm-key]{grid-column:auto;grid-row:auto}.crm-profile-bottom .crm-drawer-body{padding:22px}.crm-profile-bottom .crm-drawer-tabs{padding-inline:22px}}
@media(max-width:650px){.crm-workspace .crm-profile-bottom .crm-contact-drawer-head{padding:16px;gap:12px}.crm-profile-bottom .crm-contact-drawer-head h2{font-size:21px}.crm-profile-identifiers{font-size:14px;gap:6px 12px}.crm-profile-bottom .crm-drawer-body{padding:18px}.crm-profile-bottom .crm-drawer-tabs{gap:18px;padding-inline:18px}.crm-profile-bottom .crm-drawer-actions{gap:5px}.crm-card-field-grid{grid-template-columns:minmax(0,1fr)}.crm-profile-bottom .crm-drawer-actions .tickets-filter-button{padding:7px 9px}}

.crm-profile-conversations{display:grid;grid-template-columns:minmax(220px,30%) minmax(0,1fr);height:100%;min-height:0;gap:24px}
.crm-profile-conversation-picker{overflow:auto;min-height:0;padding-right:16px;border-right:1px solid var(--color-border-subtle)}
.crm-profile-conversation-history{overflow:auto;min-height:0;min-width:0}
.crm-profile-conversation-history .crm-chat-preview{padding:0;background:transparent}
@media(max-width:800px){.crm-profile-conversations{grid-template-columns:minmax(0,1fr);height:auto}.crm-profile-conversation-picker{max-height:230px;border-right:0;border-bottom:1px solid var(--color-border-subtle);padding:0 0 14px}.crm-profile-conversation-history{min-height:260px;overflow:visible}}

.crm-history-embedded{min-width:0;display:flex;flex-direction:column;gap:16px}.crm-history-embedded>header{display:flex;justify-content:space-between;gap:10px}.crm-history-embedded h2{font-size:18px;margin:0}.crm-history-embedded [data-summary] p{font-size:12px;color:var(--color-text-secondary);margin:0}.crm-history-embedded .crm-history-message{padding:14px 16px;margin-bottom:12px;border:1px solid var(--color-border-subtle);border-radius:8px;background:var(--color-surface)}.crm-history-embedded .crm-history-message header{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:13px}.crm-history-embedded .crm-history-message time{font-size:12px;color:var(--color-text-secondary)}.crm-history-embedded .crm-history-message p{font-size:14px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;margin:9px 0 0}.crm-history-embedded [data-close][hidden]{display:none}

/* Profile hierarchy: identity, navigation, then independently readable work areas. */
.crm-profile-identity{display:flex;align-items:center;gap:17px;min-width:0}
.crm-profile-identity>div{min-width:0}
.crm-profile-avatar{display:grid;place-items:center;flex:0 0 58px;width:58px;height:58px;border-radius:16px;background:var(--color-accent);color:var(--color-accent-contrast,#fff)}
.crm-profile-avatar svg{width:29px;height:29px;stroke-width:1.7}
.crm-profile-eyebrow{display:block;font-size:11px;letter-spacing:.09em;font-weight:750;line-height:1.6;text-transform:uppercase;color:var(--color-accent)}
.crm-profile-bottom .crm-profile-identifiers{font-size:16px;font-weight:600}
html[data-theme] .crm-workspace .crm-profile-bottom .crm-drawer-tabs .crm-contact-tab.is-active{background:var(--color-accent);color:var(--color-accent-contrast,#fff);border:0;box-shadow:none}
html[data-theme] .crm-workspace .crm-profile-bottom .crm-drawer-tabs .crm-contact-tab:not(.is-active):hover{background:var(--color-hover);color:var(--color-text-primary)}
.crm-profile-bottom .crm-contact-tab.is-active span{color:inherit}
html[data-theme] .crm-workspace .crm-profile-bottom .crm-profile-contact-grid>div{padding:18px 10px 18px 0;border-bottom:1px solid var(--color-border-subtle)}
.crm-profile-bottom .crm-profile-section-head{padding-bottom:17px;border-bottom:1px solid var(--color-border-subtle);margin-bottom:18px}
.crm-profile-bottom .crm-profile-section-head p{font-size:14px;line-height:1.5}
.crm-profile-count{display:inline-flex;align-items:center;justify-content:center;padding:3px 9px;border-radius:20px;font-size:12px;font-weight:650;background:var(--color-selected);color:var(--color-accent);vertical-align:middle}
.crm-profile-bottom .crm-profile-tags{display:flex;gap:7px;flex-wrap:wrap;margin-top:20px}
.crm-profile-bottom .crm-drawer-tag{font-size:13px;padding:5px 10px;border-radius:6px}
.crm-profile-bottom .crm-profile-icon-button{width:34px;height:34px;font-size:21px;border-radius:8px;color:var(--color-accent);background:var(--color-selected);border:1px solid var(--color-accent-border);cursor:pointer}
.crm-profile-bottom .crm-profile-icon-button:hover{background:var(--color-hover)}
.crm-profile-card-summary .crm-contact-card-stage{display:inline-flex;align-items:center;gap:6px;padding:5px 9px;background:var(--color-surface);border:1px solid var(--color-border-strong);border-radius:6px;font-size:13px;font-weight:650}
.crm-profile-bottom .crm-profile-empty{font-size:14px;color:var(--color-text-secondary);line-height:1.6;margin:10px 0}
.crm-profile-bottom .crm-drawer-detail-list dt{font-size:13px;font-weight:600}
.crm-profile-bottom .crm-drawer-detail-list dd{font-size:16px;line-height:1.6;color:var(--color-text-primary)}
.crm-profile-bottom .crm-organization-pill{display:inline-flex;align-items:center;padding:11px 14px;border:1px solid var(--color-border-strong);background:var(--color-canvas);border-radius:8px;font-size:15px;font-weight:600}
.crm-profile-bottom .crm-profile-related-person{padding:14px;border:1px solid var(--color-border-strong);border-radius:8px;background:var(--color-canvas);margin-bottom:9px}
.crm-profile-bottom .crm-profile-related-person strong{font-size:16px}
.crm-profile-bottom .crm-notes-panel{display:grid;grid-template-columns:minmax(260px,.7fr) minmax(0,1.3fr);gap:24px;align-items:start}
.crm-profile-bottom .crm-note-compose{padding:22px;border:1px solid var(--color-border-strong);border-radius:12px;background:var(--color-surface)}
.crm-profile-bottom .crm-note-compose textarea{font-size:16px;line-height:1.65;min-height:170px;color:var(--color-text-primary)}
html[data-theme] .crm-workspace .crm-profile-bottom .agents-note-item{padding:20px;border-radius:10px;border-color:var(--color-border-strong)}
.crm-profile-bottom .agents-note-item p{font-size:16px;line-height:1.7;color:var(--color-text-primary)}
.crm-profile-bottom .crm-contact-conversation-item{margin-bottom:10px;padding:16px;border-radius:10px}
.crm-profile-bottom .crm-contact-conversation-item strong{font-size:16px;color:var(--color-text-primary)}
.crm-profile-bottom .crm-contact-conversation-item p,.crm-profile-bottom .crm-contact-conversation-item span{font-size:13px;line-height:1.6}
html[data-theme] .crm-workspace .crm-profile-bottom .crm-contact-conversation-item.is-active{border-color:var(--color-accent);background:var(--color-selected)}
.crm-profile-activity{max-width:1100px;margin:0 auto;color:var(--color-text-primary)}
.crm-activity-intro{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:24px;padding:22px 24px;border:1px solid var(--color-border-strong);border-radius:12px;background:var(--color-surface)}
.crm-activity-intro h3{font-size:24px;line-height:1.3;margin:4px 0 8px}.crm-activity-intro p{font-size:14px;margin:0;color:var(--color-text-secondary)}
.crm-timeline-day{font-size:13px;font-weight:700;margin:28px 0 14px 52px;color:var(--color-text-secondary)}
.crm-timeline-event{position:relative;display:grid;grid-template-columns:36px minmax(0,1fr);gap:16px;padding-bottom:20px}
.crm-timeline-event:before{content:'';position:absolute;inset:35px auto -2px 17px;width:2px;background:var(--color-border-strong)}
.crm-timeline-dot{z-index:1;width:36px;height:36px;display:grid;place-items:center;border-radius:10px;background:var(--color-selected);color:var(--color-accent);font-size:21px;font-weight:650}
.crm-timeline-event.is-added .crm-timeline-dot{background:color-mix(in srgb,#15956a 15%,var(--color-surface));color:#15956a}
.crm-timeline-event.is-removed .crm-timeline-dot{background:color-mix(in srgb,#d34c5c 14%,var(--color-surface));color:#d34c5c}
.crm-timeline-content{min-width:0;padding:18px 20px;background:var(--color-surface);border:1px solid var(--color-border-strong);border-radius:10px}
.crm-timeline-content header{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap}
.crm-timeline-content header strong{font-size:16px;font-weight:700}.crm-timeline-content time{font-size:13px;color:var(--color-text-secondary);font-variant-numeric:tabular-nums}
.crm-timeline-context{font-size:15px;font-weight:550;margin:10px 0 0;line-height:1.6;overflow-wrap:anywhere}
.crm-timeline-content footer{margin-top:12px;font-size:13px;color:var(--color-text-secondary)}
.crm-timeline-changes{margin:14px 0 0;padding:0;border-top:1px solid var(--color-border-subtle)}
.crm-timeline-changes>div{display:grid;grid-template-columns:minmax(100px,.4fr) minmax(0,1fr);padding-top:12px;gap:12px}
.crm-timeline-changes dt{font-size:13px;font-weight:600;color:var(--color-text-secondary)}.crm-timeline-changes dd{margin:0;display:flex;gap:10px;flex-wrap:wrap;font-size:14px;line-height:1.5;overflow-wrap:anywhere}.crm-timeline-changes dd>*{min-width:0;max-width:100%}
.crm-change-before{color:var(--color-text-secondary);text-decoration:line-through;text-decoration-color:var(--color-border-strong)}
.crm-activity-legacy{margin:24px 0 0 52px;border-top:1px solid var(--color-border-strong);padding-top:18px}
.crm-activity-legacy summary{cursor:pointer;font-size:14px;font-weight:650}.crm-activity-legacy summary span{margin-inline-start:8px;color:var(--color-text-secondary)}
.crm-activity-legacy>p{font-size:14px;color:var(--color-text-secondary);margin-bottom:22px}
.crm-profile-empty-state{padding:32px;border:1px dashed var(--color-border-strong);border-radius:12px;font-size:16px}.crm-profile-empty-state p{font-size:14px;color:var(--color-text-secondary)}
@media(max-width:1000px){.crm-profile-bottom .crm-notes-panel{grid-template-columns:minmax(0,1fr)}}
@media(max-width:650px){.crm-profile-avatar{width:42px;height:42px;flex-basis:42px;border-radius:11px}.crm-profile-avatar svg{width:24px;height:24px}.crm-profile-identity{gap:12px}.crm-profile-bottom .crm-profile-section{padding:18px}.crm-profile-bottom .crm-drawer-tabs{gap:4px}.crm-profile-bottom .crm-contact-tab{padding:9px 12px;font-size:14px}.crm-profile-bottom .crm-contact-drawer-head{flex-wrap:wrap}.crm-profile-bottom .crm-drawer-actions{margin-inline-start:auto}.crm-timeline-event{gap:10px}.crm-timeline-content{padding:14px}.crm-activity-intro{padding:18px}.crm-timeline-changes>div{grid-template-columns:minmax(0,1fr);gap:5px}.crm-profile-bottom .crm-profile-contact-grid{grid-template-columns:minmax(0,1fr)}}

html[data-theme] .crm-workspace .crm-profile-bottom .crm-drawer-tabs{padding:9px 28px;gap:6px}
html[data-theme] .crm-workspace .crm-profile-bottom .crm-drawer-tabs .crm-contact-tab{flex:none;border:0;border-radius:8px;padding:10px 16px;font-size:15px;font-weight:650}
@media(max-width:650px){html[data-theme] .crm-workspace .crm-profile-bottom .crm-drawer-tabs{padding:8px 16px;gap:4px}html[data-theme] .crm-workspace .crm-profile-bottom .crm-drawer-tabs .crm-contact-tab{padding:9px 12px;font-size:14px}}

.crm-profile-bottom :is(h2,h3,h4){font-family:var(--font-body,system-ui);color:var(--color-text-primary)}

.crm-profile-bottom>.crm-contact-drawer-panel,.crm-profile-bottom-panel{container:crm-profile / inline-size}
@container crm-profile (max-width:850px){
 .crm-workspace .crm-profile-bottom .crm-profile-overview,.crm-organization-profile-overview{grid-template-columns:minmax(0,1fr)}
 .crm-profile-overview>[data-crm-key]{grid-column:auto;grid-row:auto}
 .crm-profile-bottom .crm-notes-panel{grid-template-columns:minmax(0,1fr)}
}
@container crm-profile (max-width:600px){
 .crm-workspace .crm-profile-bottom .crm-contact-drawer-head{flex-wrap:wrap;padding:18px;gap:12px}
 .crm-profile-bottom .crm-contact-drawer-head h2{font-size:22px;overflow-wrap:anywhere}
 .crm-profile-bottom .crm-drawer-actions{margin-inline-start:auto}
 .crm-profile-bottom .crm-profile-contact-grid{grid-template-columns:minmax(0,1fr)}
 .crm-profile-conversations{grid-template-columns:minmax(0,1fr);height:auto}
 .crm-profile-conversation-picker{max-height:230px;border-right:0;border-bottom:1px solid var(--color-border-subtle);padding:0 0 14px}
 .crm-profile-conversation-history{min-height:260px;overflow:visible}
}

.crm-profile-main-column,.crm-profile-related-column{display:grid;align-content:start;gap:20px;min-width:0}
.crm-contact-save-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;min-width:0}
.crm-contact-save-actions>[role="status"]{max-width:320px;font-size:13px;line-height:1.5;color:var(--color-text-secondary)}
.crm-contact-save-actions>.tickets-filter-button{flex:none;min-width:74px;cursor:pointer}
.crm-profile-bottom .crm-drawer-edit-grid{gap:18px 20px}
.crm-profile-bottom .crm-drawer-edit-grid input,.crm-profile-bottom .crm-drawer-edit-grid textarea{font-size:15px}
.crm-profile-bottom .crm-drawer-edit-grid .crm-detail-field>span{font-size:13px;color:var(--color-text-secondary)}
@container crm-profile (max-width:600px){.crm-contact-save-actions{gap:7px;flex-wrap:wrap}.crm-contact-save-actions>[role="status"]{max-width:180px}.crm-profile-bottom .crm-drawer-edit-grid{grid-template-columns:minmax(0,1fr)}.crm-profile-bottom .crm-drawer-edit-grid .crm-detail-field-span-2{grid-column:auto}}

/* Keep the contact dismissal target distinct from secondary header actions. */
.crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-drawer-actions>.crm-drawer-close{
 display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-width:44px;min-height:44px;
 margin-inline-start:8px;border:1px solid var(--color-accent-border,var(--color-accent));border-radius:10px;
 background:var(--color-selected-strong);color:var(--color-text-primary);font-size:28px;font-weight:650;line-height:1;
 cursor:pointer;touch-action:manipulation;
}
.crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-drawer-actions>.crm-drawer-close:hover{
 background:var(--color-accent);border-color:var(--color-accent);color:var(--color-text-inverse,#fff);
}
.crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-drawer-actions>.crm-drawer-close:focus-visible{
 outline:3px solid var(--color-accent);outline-offset:3px;
}

/* Readable card editor controls, scoped away from other CRM forms. */
.crm-card-panel{container:crm-card / inline-size}
.crm-card-panel .crm-drawer-close{display:grid;place-items:center;flex:none;width:44px;height:44px;font-size:28px;font-weight:650;color:var(--color-text-primary);border-color:var(--color-accent-border);background:var(--color-surface);cursor:pointer}
.crm-card-panel .crm-drawer-close:hover{background:var(--color-selected);border-color:var(--color-accent)}
.crm-card-panel .crm-drawer-close:focus-visible{outline:3px solid var(--color-accent);outline-offset:3px}
.crm-card-panel .pipeline-typed-input,.crm-card-panel .pipeline-field-choice summary{min-height:44px;border-color:var(--color-border-strong);background:var(--color-surface);color:var(--color-text-primary);font-size:16px}
.crm-card-panel .pipeline-field-unit{font-size:14px;font-weight:650;color:var(--color-text-primary)}
.crm-card-panel .pipeline-typed-input::placeholder,.crm-card-panel [data-card-contact-search]::placeholder{color:var(--color-text-primary);opacity:1}
.crm-card-panel .pipeline-field-options button{font-size:16px;color:var(--color-text-primary)}
.crm-card-panel .pipeline-calendar-popover{font-size:15px;color:var(--color-text-primary)}
.crm-card-panel .crm-card-contact-links strong,.crm-card-panel .crm-card-contact-choices strong{font-size:16px;color:var(--color-text-primary)}
.crm-card-panel .crm-card-contact-links small,.crm-card-panel .crm-card-contact-choices small,.crm-card-panel .crm-profile-empty,.crm-card-panel .crm-profile-loading{font-size:15px;line-height:1.6;color:var(--color-text-primary)}
.crm-card-panel .crm-card-selected>input{height:44px;font-size:16px;color:var(--color-text-primary)}
.crm-card-panel .crm-card-footer button,.crm-card-panel .crm-card-footer p{font-size:15px;line-height:1.5}
.crm-card-panel .crm-card-footer .crm-profile-remove{padding:9px 12px;border:1px solid var(--color-border-strong);border-radius:7px;background:var(--color-surface);color:var(--color-danger,#c43d47);cursor:pointer}
@container crm-card (max-width:500px){.crm-card-field-grid{grid-template-columns:minmax(0,1fr)}.crm-card-fields{padding:0}.crm-card-subject-heading{gap:10px}.crm-card-subject-heading>strong{font-size:18px}.crm-card-subject-link{font-size:14px}.crm-card-panel-body{padding:16px}}

.crm-card-panel .pipeline-field-choice summary span{font-size:16px;color:var(--color-text-primary)}
.crm-card-panel .pipeline-calendar-popover button,.crm-card-panel .pipeline-calendar-days>span{font-size:14px;color:var(--color-text-primary)}
.crm-card-subject:hover{border-color:var(--color-accent)}

/* Override inherited workspace heading and paragraph colors inside this editor. */
html[data-theme] .crm-workspace .crm-card-panel .crm-card-panel-head h2{color:var(--color-text-primary);font-family:var(--font-body);font-size:20px}
html[data-theme] .crm-workspace .crm-card-panel .crm-card-save-status{color:var(--color-text-primary);font-size:14px}
html[data-theme] .crm-workspace .crm-card-panel .crm-card-fields h3{color:var(--color-text-primary);font-family:var(--font-body);font-size:18px}
html[data-theme] .crm-workspace .crm-card-panel :is(p,small,label){color:var(--color-text-primary)}

.crm-card-save-status:empty{display:none}

/* Contact profiles use readable text for field labels and supporting information. */
html[data-theme] .crm-workspace .crm-profile-bottom[data-crm-overlay-kind="contact"] :is(.crm-detail-field>span,.crm-profile-contact-grid dt,.crm-drawer-detail-list dt){font-size:14px;font-weight:650;line-height:1.6;color:var(--color-text-primary)}
html[data-theme] .crm-workspace .crm-profile-bottom[data-crm-overlay-kind="contact"] :is(.crm-drawer-edit-grid input,.crm-drawer-edit-grid textarea,.phone-national-input,.tickets-custom-select-trigger>span){font-size:16px;line-height:1.5;color:var(--color-text-primary);text-transform:none;letter-spacing:normal}
html[data-theme] .crm-workspace .crm-profile-bottom[data-crm-overlay-kind="contact"] .phone-country-trigger{font-size:14px;color:var(--color-text-primary)}
html[data-theme] .crm-workspace .crm-profile-bottom[data-crm-overlay-kind="contact"] :is(input,textarea)::placeholder{color:var(--color-text-primary);opacity:1}
html[data-theme] .crm-workspace .crm-profile-bottom[data-crm-overlay-kind="contact"] :is(.crm-profile-section-head p,.crm-profile-empty,.crm-profile-hint,.crm-profile-loading,.crm-empty-box,.crm-duplicate-item>span,.crm-profile-related-person>span,.crm-contact-card-empty){font-size:15px;line-height:1.6;color:var(--color-text-primary)}
html[data-theme] .crm-workspace .crm-profile-bottom[data-crm-overlay-kind="contact"] :is(.crm-contact-card-preview small,.crm-contact-card-stage,.crm-profile-count,.crm-drawer-tag,.crm-contact-save-actions>[role="status"]){font-size:14px;line-height:1.5;color:var(--color-text-primary)}
html[data-theme] .crm-workspace .crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-contact-card-preview b{font-size:16px;color:var(--color-text-primary)}
html[data-theme] .crm-workspace .crm-profile-bottom[data-crm-overlay-kind="contact"] :is(.crm-contact-conversation-item p,.crm-contact-conversation-item>span,.agents-note-item time,.crm-timeline-content time,.crm-timeline-content footer,.crm-timeline-day,.crm-timeline-changes dt,.crm-activity-intro p,.crm-activity-legacy>p){font-size:14px;line-height:1.6;color:var(--color-text-primary)}
html[data-theme] .crm-workspace .crm-profile-bottom[data-crm-overlay-kind="contact"] .tickets-custom-select-option{font-size:16px;color:var(--color-text-primary)}

/* Give the editable contact record priority; related records use the narrow rail. */
.crm-workspace .crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-profile-overview{grid-template-columns:minmax(0,2fr) minmax(270px,.85fr)}
.crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-profile-main-column{container:crm-contact-fields / inline-size}
.crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-drawer-edit-grid{column-gap:52px;row-gap:18px}
.crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-drawer-edit-grid>.crm-detail-field{display:grid;grid-template-columns:76px minmax(0,1fr);align-items:center;column-gap:8px;row-gap:0;min-width:0}
.crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-drawer-edit-grid>.crm-detail-field>span{margin:0;letter-spacing:normal;text-transform:none;overflow-wrap:anywhere}
.crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-drawer-edit-grid>.crm-detail-field>:not(span){width:100%;min-width:0;max-width:100%}
.crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-drawer-edit-grid>.crm-detail-field:has(textarea)>span{align-self:start;padding-top:10px}
@container crm-profile (max-width:1000px){.crm-workspace .crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-profile-overview{grid-template-columns:minmax(0,1fr)}}
@container crm-contact-fields (max-width:680px){
 .crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-drawer-edit-grid{grid-template-columns:minmax(0,1fr)}
 .crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-drawer-edit-grid>.crm-detail-field-span-2{grid-column:auto}
}
@container crm-contact-fields (max-width:400px){.crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-drawer-edit-grid>.crm-detail-field{grid-template-columns:76px minmax(0,1fr);column-gap:8px}}

html[data-theme] .crm-workspace .crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-drawer-edit-grid :is(select[data-contact-detail-input],select[data-contact-custom-field-input]){min-height:44px;width:100%;min-width:0;padding:9px 11px;border:1px solid var(--color-border-strong);border-radius:6px;background:var(--color-input);color:var(--color-text-primary);font:inherit;font-size:16px;line-height:1.5;cursor:pointer}
html[data-theme] .crm-workspace .crm-profile-bottom[data-crm-overlay-kind="contact"] :is(select[data-contact-detail-input],select[data-contact-custom-field-input]):focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}

/* Match the portal's icon system without replacing the visible field labels. */
.crm-profile-bottom[data-crm-overlay-kind="contact"] [data-contact-profile-form]>.crm-detail-field{grid-template-columns:100px minmax(0,1fr)}
.crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-contact-field-label{display:flex;align-items:center;gap:7px;min-width:0}
.crm-profile-bottom[data-crm-overlay-kind="contact"] .crm-contact-field-label>:is(svg,i){flex:none;width:16px;height:16px;stroke-width:1.8;color:var(--color-text-primary)}
