/* ARKASCALE CRM — общие правила интерфейса; специальные рабочие экраны сохраняют свою компоновку. */
:root{--ui-space:16px;--ui-edge:18px;--ui-control:38px;--ui-radius:8px;--ui-card-radius:12px;--ui-border:#e1d8cc;--ui-secondary-border:#cbd6df;--ui-muted:#647482;--ui-primary:#173b5d;--ui-soft:#f7f3ed;--ui-danger:#a9382c;--ui-ring:#84b4d5}
.content .section-view{min-width:0}
.content .section-view>.panel,.content .section-view>.detail-grid>.panel{border-color:var(--ui-border);border-radius:var(--ui-card-radius);box-shadow:0 3px 14px rgba(25,47,65,.045)}
.content .section-view>.panel+.panel,#department-section>.panel+.panel{margin-top:var(--ui-space)}
.content .panel-title{padding:12px var(--ui-edge);gap:12px;min-height:58px;background:#f6f2ec;border-bottom-color:var(--ui-border);flex-wrap:wrap}
.content .panel-title>div:first-child{min-width:0;flex-wrap:wrap;gap:8px 10px}
.content .panel-title h2{font-size:13px;line-height:1.4;font-weight:800;letter-spacing:.035em;overflow-wrap:anywhere}
.content .panel-title h3{font-size:14px;line-height:1.45;margin:0;overflow-wrap:anywhere}
.content .panel-title .auth-hint{flex-basis:100%;margin:0 0 0 13px;font-size:12px;line-height:1.5;color:var(--ui-muted)}
.content .brown-line{height:22px;border-radius:2px;flex:0 0 3px}
.content :is(.entry-actions,.partner-actions,.tenant-user-actions,.panel-title-actions,.list-heading-actions){gap:8px;flex-wrap:wrap;min-width:0}
.content :is(.entry-actions,.partner-actions,.tenant-user-actions,.panel-title-actions) button,.content .panel-title>button,.content .view-switch button,.content .back-button,.content .settings-link{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:var(--ui-control);padding:8px 11px;border:1px solid var(--ui-secondary-border);border-radius:var(--ui-radius);background:#fff;color:var(--ui-primary);font:inherit;font-size:12px;font-weight:700;line-height:1.35;white-space:normal;max-width:100%;text-decoration:none;box-sizing:border-box}
.content :is(.entry-actions,.partner-actions,.tenant-user-actions,.panel-title-actions) button:hover:not(:disabled),.content .panel-title>button:hover,.content .view-switch button:hover{background:#edf3f7;border-color:#93adbf}
.content .view-switch button.active,.content .entry-actions button.primary,.content .partner-actions button.primary{background:var(--ui-primary);color:#fff;border-color:var(--ui-primary)}
.content .view-switch{gap:6px;padding:4px;flex-wrap:wrap;border-radius:9px}
.content .count-badge{font-size:11px;line-height:1.4;padding:4px 8px;white-space:nowrap}
.content .auth-hint{font-size:12px;line-height:1.55;color:var(--ui-muted)}
.content .empty{font-size:13px;line-height:1.5;color:var(--ui-muted)}
.content :is(.partner-entry,.department-thread){padding:14px;border-color:var(--ui-border);border-radius:9px;background:#fff;min-width:0}
.content .partner-entry+.partner-entry{margin-top:10px}
.content :is(.partner-entry,.department-thread)>b{font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.content :is(.partner-entry,.department-thread)>small{font-size:12px;line-height:1.5}
#department-section .partner-columns{gap:0;grid-template-columns:repeat(auto-fit,minmax(min(300px,100%),1fr))}
#department-section .partner-columns>section{padding:18px;min-width:0;border-color:var(--ui-border)}
#department-section .partner-columns h3{font-size:14px;line-height:1.5;margin:0 0 14px}
#department-section .partner-columns .entry-actions{margin-top:12px}
#department-section :is(.tenant-user-actions,.entry-actions) select{min-height:38px;padding:8px 10px;border:1px solid var(--ui-secondary-border);border-radius:8px;color:var(--ui-primary);background:#fff;font:inherit;font-size:12px;min-width:0}
#department-section .tenant-user{padding:16px 0;gap:12px 16px;min-width:0}
#department-section .tenant-user-identity b{font-size:13px;line-height:1.5;overflow-wrap:anywhere}
#department-section .tenant-user small{font-size:12px;line-height:1.5}
#department-section .tenant-user-actions{align-items:center}
#department-section :is(.settings-card,.admin-block-card){border-color:var(--ui-border);border-radius:10px;padding:18px}
#department-section .settings-card h3{font-size:16px;line-height:1.5}
#department-section .settings-card p{font-size:13px;line-height:1.6;margin-bottom:14px}
#list-section .table-wrap{overflow-x:auto;min-width:0}
#list-section table{font-size:12px}
#list-section th{font-size:10px;letter-spacing:.04em;color:#6b7882;padding:12px 14px;background:#f9f7f3;line-height:1.5}
#list-section td{padding:12px 14px;line-height:1.5;border-color:#ece6dd}
#list-section tbody tr:hover{background:#f1f6fa}
#list-section .deal-filter-panel{margin:12px;padding:14px;border:1px solid #e3d9ca;border-radius:9px;background:#f8f4ee}
#list-section .deal-filter-fields{gap:12px}
#list-section .deal-filter-fields label{font-size:12px;line-height:1.4;min-width:0}
#list-section .deal-filter-fields :is(input,select){min-height:38px;padding:8px 10px;border-radius:8px;border-color:#d3dce4;font:inherit;font-size:12px;background:#fff;min-width:0}
#calendar-section .calendar-item{border-radius:9px;border-color:var(--ui-border);margin:8px 14px;background:#fffdfa}
#calendar-section .calendar-item-open{padding:12px;line-height:1.5;min-width:0}
#calendar-section .calendar-event-actions{padding-right:12px;gap:8px}
#calendar-section .calendar-item-export{min-height:36px;display:inline-flex;align-items:center;padding:7px 10px;border-radius:8px;font-size:12px;border-color:var(--ui-secondary-border)}
#calendar-section .today-queue-filters{display:flex;gap:8px;flex-wrap:wrap}
#calendar-section .today-queue-filters button{min-height:38px;padding:8px 10px;border:1px solid var(--ui-secondary-border);border-radius:8px;background:#fff;color:var(--ui-primary);font-size:12px;font-weight:700}
#calendar-section .today-queue-filters button.active{background:var(--ui-primary);color:#fff}
.record-dialog{padding:24px;border-color:var(--ui-border);border-radius:14px;background:#fffdfa;box-shadow:0 24px 80px rgba(20,40,60,.24)}
.record-dialog :is(.dialog-heading,.dialog-header){display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px}
.record-dialog :is(.dialog-heading,.dialog-header) h2{font-family:Montserrat,sans-serif;font-size:23px;line-height:1.35;margin:0;color:var(--ui-primary);overflow-wrap:anywhere}
.record-dialog :is(.dialog-heading,.dialog-header)>button{flex:0 0 42px;display:grid;place-items:center;width:42px;height:42px;min-height:42px;padding:0;border:1px solid var(--ui-secondary-border);border-radius:8px;background:#fff;color:var(--ui-primary)}
.record-dialog :is(.dialog-heading,.dialog-header)>button .ui-icon{width:20px;height:20px}
.record-dialog .form-grid{gap:16px}
.record-dialog .form-grid label{font-size:13px;line-height:1.4;min-width:0}
.record-dialog .form-grid :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){min-height:42px;padding:10px 12px;border:1px solid #d6cbbc;border-radius:8px;background-color:#fff;color:var(--ui-primary);font:inherit;font-size:13px;font-weight:600;line-height:1.45;min-width:0}
.record-dialog .form-grid textarea{min-height:92px;resize:vertical}
.record-dialog .dialog-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px;margin-top:22px;padding-top:16px;border-top:1px solid var(--ui-border)}
.record-dialog .dialog-actions button{min-height:42px;padding:10px 16px;border:1px solid var(--ui-secondary-border);border-radius:8px;background:#fff;color:var(--ui-primary);font:inherit;font-size:13px;font-weight:700;line-height:1.4}
.record-dialog .dialog-actions button.primary{background:var(--ui-primary);border-color:var(--ui-primary);color:#fff}
.content button:disabled,.record-dialog button:disabled{opacity:.5;cursor:not-allowed}
.content :is(button,input,select,textarea,summary):focus-visible,.record-dialog :is(button,input,select,textarea):focus-visible{outline:3px solid var(--ui-ring);outline-offset:2px}
@media(max-width:700px){:root{--ui-edge:14px;--ui-space:12px;--ui-control:44px}.content .panel-title{padding:12px 14px;align-items:flex-start}.content .panel-title>div:first-child{flex:1 1 150px}.content .list-heading-actions{justify-content:flex-start;width:100%;margin:0}.content .partner-columns{grid-template-columns:minmax(0,1fr)}#department-section .partner-columns>section{padding:14px;border-right:0;border-bottom:1px solid var(--ui-border)}#department-section .tenant-user{grid-template-columns:minmax(0,1fr)}#department-section .tenant-user-actions{justify-content:flex-start}#calendar-section .calendar-item{margin:8px 10px}.record-dialog{padding:18px;max-width:calc(100vw - 24px)}.record-dialog :is(.dialog-heading,.dialog-header) h2{font-size:20px}.record-dialog .dialog-actions button{min-height:44px}.record-dialog .form-grid{gap:14px}}
#legal-workspace-panel .legal-dd-form textarea[name=summary]{min-height:140px}
#legal-workspace-panel .legal-dd-form :is(input,select,textarea){font-size:13px;border-radius:8px}
.content .panel-title>.entry-actions{margin-top:0}
@media(max-width:700px){#legal-workspace-panel .legal-dd-form textarea[name=summary]{min-height:120px}}
.content :is(.entry-actions,.tenant-user-actions,.panel-title-actions) button:is(.danger,.danger-text){color:var(--ui-danger);border-color:#e7c9c1;background:#fff7f4}
/* Reserve the custom arrow area even when the shared field padding wins specificity. */
.record-dialog .form-grid select:not([multiple]){padding-right:42px!important}
/* Динамический экран документов: самостоятельная панель с обязательными внутренними краями. */
#organization-documents-workspace{padding:20px;border:1px solid var(--ui-border);border-radius:12px;background:#fffdfa;box-shadow:0 3px 14px rgba(25,47,65,.045);min-width:0}
#organization-documents-workspace .documents-workspace-top{margin-bottom:18px;gap:14px;flex-wrap:wrap}
#organization-documents-workspace .documents-workspace-top h2{font-size:17px;line-height:1.5}
#organization-documents-workspace .documents-workspace-top p{font-size:12px;line-height:1.5;color:var(--ui-muted)}
#organization-documents-workspace .documents-view-switch{gap:6px;padding:4px;border-radius:9px;flex-wrap:wrap;max-width:100%}
#organization-documents-workspace .documents-view-switch button{min-height:38px;font-size:12px;padding:8px 12px;border-radius:7px}
#organization-documents-workspace .documents-edo-block{padding:16px;margin-bottom:16px;border-radius:10px;gap:16px}
#organization-documents-workspace .documents-edo-block>div{min-width:0}
#organization-documents-workspace .documents-edo-block h3{font-size:14px;line-height:1.5}
#organization-documents-workspace .documents-edo-block p{font-size:12px;line-height:1.5}
#organization-documents-workspace .documents-edo-block button{min-height:40px;padding:9px 14px;border-radius:8px;flex:none;font-size:12px}
#organization-documents-workspace .documents-category-grid{gap:14px;align-items:stretch}
#organization-documents-workspace .documents-category{padding:16px;border-color:var(--ui-border);border-radius:10px;background:#fff;min-width:0}
#organization-documents-workspace .documents-category header{align-items:flex-start;gap:12px}
#organization-documents-workspace .documents-category h3{font-size:13px;line-height:1.5;overflow-wrap:anywhere}
#organization-documents-workspace .documents-category header>span{flex:none;font-size:11px}
#organization-documents-workspace :is(.documents-category-description,.documents-empty,.documents-archive-note){font-size:12px;line-height:1.5;color:var(--ui-muted)}
#organization-documents-workspace .organization-document-entry{gap:10px;flex-wrap:wrap;min-height:48px;padding:12px 0}
#organization-documents-workspace .organization-document-entry>span:first-child{flex:1 1 160px;min-width:0}
#organization-documents-workspace .organization-document-entry em{max-width:100%;white-space:normal;overflow-wrap:anywhere;font-size:11px;line-height:1.4}
#organization-documents-workspace .organization-document-entry small{font-size:12px;line-height:1.5}
.content .section-view>.panel>.partner-actions{padding:14px var(--ui-edge);margin:0;border-bottom:1px solid var(--ui-border)}
.content .section-view>.panel>.auth-hint{margin:0;padding:14px var(--ui-edge)}
.content .section-view>.panel>.tenant-users-list{padding-inline:var(--ui-edge)}
@media(max-width:700px){#organization-documents-workspace{padding:14px}#organization-documents-workspace .documents-workspace-top{gap:12px;margin-bottom:14px}#organization-documents-workspace .documents-category-grid{gap:12px}#organization-documents-workspace .documents-category{padding:14px}#organization-documents-workspace .documents-edo-block{padding:14px}#organization-documents-workspace .documents-view-switch button,#organization-documents-workspace .documents-edo-block button{min-height:44px}}
#email-reader-empty{gap:9px}
#email-reader-empty b{font-size:16px;line-height:1.5}
#email-reader-empty small{font-size:13px;line-height:1.6;color:#667887}
.email-attachment-icon .ui-icon,.email-compose-attachment>.ui-icon,.email-compose-attachment>span .ui-icon{width:20px;height:20px;color:#658198}
.email-thread-message footer .ui-icon{width:16px;height:16px;vertical-align:middle;color:#658198}
/* Календарь ARKASCALE: даты — основной уровень, очередь — дополнительный. */
#calendar-section #calendar-list{padding:18px;margin:0;display:block}
.crm-calendar-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:14px}
.crm-calendar-date-nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.crm-calendar-date-nav h3{margin:0 0 0 10px;font-size:19px;line-height:1.4;text-transform:capitalize}
.crm-calendar-toolbar button{min-height:38px;padding:8px 12px;border:1px solid #cbd6df;border-radius:8px;background:#fff;color:#173b5d;font:inherit;font-size:12px;font-weight:700}
.crm-calendar-date-nav button:first-child,.crm-calendar-date-nav button:nth-child(3){width:38px;padding:0;font-size:23px}
.crm-calendar-view-switch{display:flex;gap:4px;padding:4px;background:#f2eee7;border:1px solid #e1d8cc;border-radius:9px}
.crm-calendar-view-switch button{border-color:transparent;background:transparent}
.crm-calendar-view-switch button.active{background:#173b5d;color:#fff}
.crm-calendar-filters{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:16px}
.crm-calendar-filters label{display:flex;align-items:center;gap:10px;font-size:12px;color:#647482}
.crm-calendar-filters select{min-height:38px;padding:8px 12px;border:1px solid #cbd6df;border-radius:8px;background:#fff;color:#173b5d;font:inherit;font-size:12px}
.crm-calendar-filters>small{margin-left:auto;color:#78848e;font-size:11px;line-height:1.5}
.crm-calendar-legend{display:flex;gap:12px;font-size:11px;color:#617380}
.crm-calendar-legend span::before{content:'';display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:6px;background:#5e97bf}
.crm-calendar-legend .meeting::before{background:#4f9581}.crm-calendar-legend .task::before{background:#ad8750}
.crm-calendar-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:16px;align-items:start}
.crm-calendar-grid-area{min-width:0;border:1px solid #e1d8cc;border-radius:10px;overflow:hidden}
.crm-calendar-weekdays,.crm-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}
.crm-calendar-weekdays{background:#f7f3ed;border-bottom:1px solid #e1d8cc}
.crm-calendar-weekdays span{padding:12px;text-align:right;font-size:11px;font-weight:700;color:#687b89}
.crm-calendar-weekdays span:nth-last-child(-n+2){color:#a17b53}
.crm-calendar-day{display:flex;flex-direction:column;gap:8px;min-height:110px;min-width:0;padding:9px;border:0;border-right:1px solid #e8e1d8;border-bottom:1px solid #e8e1d8;background:#fffdfa;color:#173b5d;text-align:left;font:inherit;cursor:pointer}
.crm-calendar-day:nth-child(7n){border-right:0}.crm-calendar-day:nth-last-child(-n+7){border-bottom:0}
.crm-calendar-day:hover{background:#f0f5f9}.crm-calendar-day.selected{background:#edf4f9;box-shadow:inset 0 0 0 2px #739dbc}
.crm-calendar-day.other-month{background:#faf8f4;color:#a2a8ad}
.crm-calendar-day-number{align-self:flex-end;display:grid;place-items:center;width:26px;height:26px;font-size:12px;font-weight:700;border-radius:50%}
.crm-calendar-day.today .crm-calendar-day-number{background:#173b5d;color:#fff}
.crm-calendar-day-events{display:grid;gap:4px;min-width:0;width:100%}
.crm-calendar-chip{display:flex;gap:5px;min-width:0;padding:4px 5px;border-left:2px solid #5e97bf;border-radius:4px;background:#eaf2f8;font-size:10px;line-height:1.4;color:#285c82}
.crm-calendar-chip span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-calendar-chip time{flex:none;font-weight:700}
.crm-calendar-chip.meeting{background:#eaf4ef;color:#326b58;border-left-color:#4f9581}.crm-calendar-chip.task,.crm-calendar-chip.reminder{background:#f7f0e5;color:#866332;border-left-color:#ad8750}
.crm-calendar-day-events>small{font-size:10px;color:#687b89}
.crm-calendar-grid.week .crm-calendar-day{min-height:280px}
.crm-calendar-selected-day{min-width:0;border:1px solid #e1d8cc;border-radius:10px;background:#fff;overflow:hidden}
.crm-calendar-selected-day>header{padding:16px;background:#f7f3ed;border-bottom:1px solid #e1d8cc}
.crm-calendar-selected-day>header small{font-size:10px;text-transform:uppercase;letter-spacing:.05em;color:#78848e}
.crm-calendar-selected-day h3{margin:7px 0;font-size:14px;line-height:1.5;text-transform:capitalize}
.crm-calendar-selected-day header>span{font-size:11px;color:#687b89}
#calendar-section .crm-calendar-selected-day .calendar-item{display:block;margin:10px;border-radius:8px;padding:0;overflow:hidden}
#calendar-section .crm-calendar-selected-day .calendar-item-open{display:grid;grid-template-columns:1fr;gap:5px;width:100%;text-align:left;padding:12px}
#calendar-section .crm-calendar-selected-day .calendar-item-open time{font-size:11px}.crm-calendar-selected-day .calendar-item-open b{font-size:12px;line-height:1.5}
#calendar-section .crm-calendar-selected-day .calendar-event-actions{display:flex;padding:0 12px 12px;flex-wrap:wrap;gap:8px}
#calendar-section .crm-calendar-selected-day .calendar-item-export{font-size:11px;min-height:34px}
.crm-calendar-selected-day .empty{padding:24px 16px;font-size:12px;line-height:1.6}
.crm-calendar-agenda-group h3{padding:12px 14px;background:#f7f3ed;border-radius:8px;font-size:13px;margin:0 0 10px;text-transform:capitalize}
.crm-calendar-agenda-group+.crm-calendar-agenda-group{margin-top:18px}
.calendar-work-queue{margin:0 18px 18px;border:1px solid #e1d8cc;border-radius:10px;background:#faf8f4;overflow:hidden}
.calendar-work-queue>summary{padding:15px;font-size:13px;font-weight:700;cursor:pointer;color:#526c80;min-height:44px}
.calendar-work-queue .calendar-meeting-summary{margin:12px;border-radius:8px}
@media(max-width:1200px){.crm-calendar-layout{grid-template-columns:minmax(0,1fr)}.crm-calendar-selected-day>div{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}.crm-calendar-day{min-height:98px;padding:6px}}
@media(max-width:700px){#calendar-section #calendar-list{padding:14px}.crm-calendar-toolbar{gap:12px}.crm-calendar-date-nav h3{font-size:16px;margin-left:4px}.crm-calendar-toolbar button,.crm-calendar-filters select{min-height:44px}.crm-calendar-filters{gap:12px}.crm-calendar-filters>small{margin:0;width:100%}.crm-calendar-weekdays span{padding:10px 2px}.crm-calendar-day{min-height:66px;padding:4px;gap:3px}.crm-calendar-day-number{width:23px;height:23px;font-size:11px}.crm-calendar-chip{padding:2px;border-left:0;display:block;height:5px;overflow:hidden;border-radius:2px;background:#739dbc}.crm-calendar-chip.meeting{background:#4f9581}.crm-calendar-chip.task,.crm-calendar-chip.reminder{background:#ad8750}.crm-calendar-chip>*{display:none}.crm-calendar-day-events>small{font-size:9px}.crm-calendar-grid.week .crm-calendar-day{min-height:100px}.crm-calendar-selected-day>div{display:block}.calendar-work-queue{margin:0 14px 14px}}
.crm-calendar-grid .crm-calendar-day{border-radius:0}

.task-deadline{padding:16px;border:1px solid #d7e2ea;border-radius:10px;background:#f4f8fb}.task-deadline header{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:14px}.task-deadline header b{font-size:14px;color:#173b5d}.task-deadline header small{font-size:11px;color:#6e8393}.task-deadline-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.7fr);gap:14px}.task-deadline-fields label{display:grid;gap:6px}.task-deadline-presets{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.task-deadline-presets button{min-height:38px;padding:8px 10px;border:1px solid #cad9e4;border-radius:8px;background:#fff;color:#173b5d;font:inherit;font-size:12px;font-weight:700}.task-deadline-presets button:hover{background:#e8f1f7}.task-deadline p{font-size:12px;line-height:1.5;color:#617989;margin:12px 0 0}@media(max-width:600px){.task-deadline{padding:14px}.task-deadline-presets button{min-height:44px}}
/* Заполненные карточки организаций, контактов и задач. */
#detail-content:not(.deal-detail-layout){grid-template-columns:minmax(0,1.5fr) minmax(280px,.8fr);gap:16px;align-items:start;min-width:0}
#detail-content:not(.deal-detail-layout) .field-grid{padding:4px 18px 18px;gap:0 20px}
#detail-content:not(.deal-detail-layout) .field{padding:14px 0;border-bottom-color:#e9e2d8}
#detail-content:not(.deal-detail-layout) .field span{font-size:12px;line-height:1.5;color:#687c8b}
#detail-content:not(.deal-detail-layout) .field strong{font-size:13px;line-height:1.6;font-weight:600;white-space:pre-line;overflow-wrap:anywhere}
#detail-content:not(.deal-detail-layout) .field a{overflow-wrap:anywhere;line-height:1.6;text-underline-offset:3px}
#detail-content:not(.deal-detail-layout) .detail-side-panel{background:#faf8f4}
#detail-content:not(.deal-detail-layout) .founder-link-item{padding:12px;border-color:#e0d7cb;gap:12px;flex-wrap:wrap}
#detail-content:not(.deal-detail-layout) .founder-link-copy{flex:1 1 180px}
#detail-content:not(.deal-detail-layout) .founder-link-action{min-height:38px;border-color:#cbd6df;font-size:12px;border-radius:8px}
#detail-content:not(.deal-detail-layout) .related-organizations-list{padding:16px 18px 18px;gap:12px}
#detail-content:not(.deal-detail-layout) .related-organization-card{padding:14px;gap:12px;flex-wrap:wrap;border-color:#e0d7cb;border-left-color:#b98955;background:#fffdfa}
#detail-content:not(.deal-detail-layout) .related-organization-main{flex:1 1 220px;gap:6px}
#detail-content:not(.deal-detail-layout) .related-organization-main button{font-size:13px;line-height:1.5;overflow-wrap:anywhere}
#detail-content:not(.deal-detail-layout) .related-organization-main small{font-size:12px;line-height:1.5;color:#687c8b}
#detail-content:not(.deal-detail-layout) .related-organization-reasons{justify-content:flex-start;gap:6px}
#detail-content:not(.deal-detail-layout) .related-organization-reasons span{white-space:normal;line-height:1.4;border-radius:6px;font-size:11px}
#detail-content:not(.deal-detail-layout) .contact-sensitive-card{margin:0 18px 18px;border-radius:9px;padding:14px;min-width:0}
#detail-content:not(.deal-detail-layout) .contact-sensitive-card h3{font-size:13px;line-height:1.5;margin:0 0 8px}
#detail-content:not(.deal-detail-layout) .contact-sensitive-card .field{padding:9px 0}
#detail-content:not(.deal-detail-layout) .contact-card-channel-actions{padding:0 18px 18px;gap:8px}
#detail-content:not(.deal-detail-layout) .contact-card-channel-actions a{min-height:38px;padding:8px 12px;font-size:12px;border-radius:8px}
#list-section .table-scroll{width:100%;max-width:100%;overflow:auto;scrollbar-width:thin}
#list-section .table-scroll table{width:100%;border-collapse:collapse}
#list-section .table-scroll th{position:sticky;top:0;z-index:1;white-space:nowrap;background:#f9f7f3;font-weight:700}
#list-section .table-scroll td{vertical-align:middle;max-width:360px;overflow-wrap:anywhere}
#list-section .table-scroll td a{color:#2f6392;text-underline-offset:3px}
#list-section .table-scroll td button{line-height:1.5;white-space:normal;overflow-wrap:anywhere;text-align:left}
#list-section .saved-view-bar{gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:12px}
#list-section .saved-view-bar select{min-height:38px;border-radius:8px;min-width:0}
#list-section .saved-view-bar button{min-height:38px;padding:8px 11px;border:1px solid #cbd6df;border-radius:8px;background:#fff;color:#173b5d;font-size:12px;font-weight:700}
@media(max-width:980px){#detail-content:not(.deal-detail-layout){grid-template-columns:minmax(0,1fr)}#detail-content:not(.deal-detail-layout) .detail-side-panel{grid-column:1}}
@media(max-width:600px){#detail-content:not(.deal-detail-layout) .field-grid{grid-template-columns:minmax(0,1fr);padding:4px 14px 14px}#detail-content:not(.deal-detail-layout) .field{padding:12px 0}#detail-content:not(.deal-detail-layout) .related-organizations-list{padding:14px}#detail-content:not(.deal-detail-layout) .contact-sensitive-card{margin:0 14px 14px}#detail-content:not(.deal-detail-layout) .founder-link-action{min-height:44px}#detail-content:not(.deal-detail-layout) .contact-card-channel-actions{padding:0 14px 14px}#detail-content:not(.deal-detail-layout) .contact-card-channel-actions a{min-height:44px}#list-section .saved-view-bar button{min-height:44px}}
/* Повторный круг: библиотека, обучение и партнёрские карточки. */
#library-workspace{grid-template-columns:260px minmax(0,1fr);min-height:480px}
#library-reader{grid-template-columns:minmax(0,1fr)}
#library-workspace .library-navigation{background:#f8f5ef;border-color:#e1d8cc}
#library-workspace .library-navigation-heading{min-height:58px;padding:16px;font-size:12px;line-height:1.5}
#library-workspace .library-navigation-tree{padding:14px;gap:12px}
#library-workspace .library-navigation-tree button{min-height:40px;padding:10px;border-radius:8px;gap:10px;font-size:12px;line-height:1.5}
#library-workspace .library-navigation-tree button>span{min-width:0;overflow-wrap:anywhere}
#library-workspace .library-tree-group>summary{padding:10px;font-size:12px;line-height:1.5;min-height:40px}
#library-workspace .library-reader-list-heading{padding:16px 18px;gap:12px;flex-wrap:wrap}
#library-workspace .library-reader-list-heading>span{font-size:14px;line-height:1.5}
#library-workspace .library-reader-list-heading small{font-size:12px}
#library-workspace .library-search{min-height:40px;padding:9px 12px;border:1px solid #cbd6df;border-radius:8px;background:#fff;min-width:0;font-size:12px;max-width:100%}
#library-workspace .library-material-link{padding:16px 18px;gap:14px;min-height:68px;border-bottom-color:#e6dfd5}
#library-workspace .library-material-link b{font-size:13px;line-height:1.5;overflow-wrap:anywhere}
#library-workspace .library-material-link small{font-size:12px;line-height:1.5}
#library-workspace .library-material-link em{flex:none;font-size:12px}
#library-workspace .crm-training-program{margin:16px 18px;padding:16px;border-color:#e1d8cc;border-radius:10px;background:#faf7f1}
#library-workspace .crm-training-program h3{font-size:15px;line-height:1.5}
#library-workspace .crm-training-program p{font-size:13px;line-height:1.6}
.library-reading-window-header{gap:12px;padding:14px 18px}
.library-reading-window-header b{font-size:16px;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
.library-reading-window-actions button{width:42px;height:42px;flex:none;display:grid;place-items:center;border-radius:8px}
.library-reading-toolbar{padding:10px 14px;gap:8px}
.library-reading-toolbar button,.library-reading-toolbar a{min-height:38px;padding:8px 11px;font-size:12px;line-height:1.4;border-radius:8px}
.library-reading-dialog .library-reading-body{padding:28px;line-height:1.75;font-size:15px}
#partner-workspace-panel .partner-columns,#client-rating-panel .partner-columns{grid-template-columns:repeat(auto-fit,minmax(min(300px,100%),1fr))}
#partner-workspace-panel .partner-columns>section,#client-rating-panel .partner-columns>section{padding:18px;min-width:0;border-color:#e1d8cc}
#partner-workspace-panel .partner-columns h3,#client-rating-panel .partner-columns h3{font-size:14px;line-height:1.5;margin:0 0 14px}
#partner-workspace-panel .partner-entry,#client-rating-panel .partner-entry{padding:14px;border-color:#e1d8cc;border-radius:9px;line-height:1.5}
#partner-workspace-panel .partner-entry small,#client-rating-panel .partner-entry small{font-size:12px;line-height:1.5}
#partner-workspace-panel .entry-actions,#client-rating-panel .entry-actions{gap:8px;margin-top:12px;flex-wrap:wrap}
#partner-workspace-panel .entry-actions button,#client-rating-panel .entry-actions button{min-height:38px;padding:8px 11px;border:1px solid #cbd6df;border-radius:8px;color:#173b5d;background:#fff;font-size:12px;font-weight:700}
#partner-workspace-panel .partner-rating-summary,#client-rating-panel .partner-rating-summary{padding:16px 18px;gap:12px}
#dashboard-section .quick-actions{padding:14px 18px;gap:10px}
#dashboard-section .quick-actions button{min-height:42px;border-radius:8px;font-size:12px;line-height:1.4}
#dashboard-section .dashboard-list-item{min-width:0;overflow-wrap:anywhere}
@media(max-width:800px){#library-workspace{grid-template-columns:minmax(0,1fr)}#library-workspace .library-navigation{border-right:0;border-bottom:1px solid #e1d8cc}#library-workspace .library-reader-list-heading{padding:14px}#library-workspace .library-material-link{padding:14px}#library-workspace .library-search{width:100%}#library-workspace .crm-training-program{margin:14px}#library-workspace .library-navigation-tree button{min-height:44px}.library-reading-window-actions button{width:44px;height:44px}.library-reading-toolbar button,.library-reading-toolbar a{min-height:44px}.library-reading-dialog .library-reading-body{padding:20px}#partner-workspace-panel .partner-columns,#client-rating-panel .partner-columns{grid-template-columns:minmax(0,1fr)}#partner-workspace-panel .partner-columns>section,#client-rating-panel .partner-columns>section{padding:14px;border-right:0;border-bottom:1px solid #e1d8cc}#partner-workspace-panel .entry-actions button,#client-rating-panel .entry-actions button{min-height:44px}}
#library-workspace.navigation-collapsed{grid-template-columns:minmax(0,1fr)}
#library-workspace.navigation-collapsed .library-navigation{display:none}
#library-reader{display:grid;grid-template-columns:minmax(0,1fr)}
#library-workspace .library-navigation-tree{display:flex;flex-direction:column}
#library-workspace .library-navigation-tree button{width:100%}
@media(max-width:600px){#library-workspace .library-material-link em{display:none}#library-workspace .library-material-link{align-items:flex-start}}

/* Исправление вложенной ширины центра дублей и доступных крестиков. */
#duplicate-center-dialog{width:min(820px,calc(100vw - 24px));max-width:calc(100vw - 24px);overflow-y:auto;overflow-x:hidden}
#duplicate-center-dialog .dialog-card{width:100%;max-width:100%;min-width:0;max-height:none;overflow:visible;padding:0}
#duplicate-center-dialog .dialog-heading>div{min-width:0;flex:1}
#duplicate-center-dialog p{font-size:13px;line-height:1.6;overflow-wrap:anywhere}
#duplicate-center-dialog .duplicate-center-group>header{flex-wrap:wrap;gap:8px}
#duplicate-center-dialog .duplicate-center-card b{font-size:13px;line-height:1.5;overflow-wrap:anywhere}
#duplicate-center-dialog .duplicate-center-card small{font-size:12px;line-height:1.5}
.record-dialog :is(.dialog-heading,.dialog-header)>button[aria-label="Закрыть"]{width:44px;height:44px;min-height:44px;flex-basis:44px}
/* Внутренний отступ принадлежит диалогу, а не одновременно диалогу и форме. */
.record-dialog>form{padding:0}
@media(max-width:600px){.email-compose-signature header{align-items:flex-start;flex-wrap:wrap}.email-compose-signature header button{min-height:44px}.record-dialog .dialog-help{font-size:12px;line-height:1.5}}
/* Длинные общие формы: заголовок и сохранение доступны при прокрутке. */
#record-dialog{scroll-padding-top:100px;scroll-padding-bottom:100px}
#record-dialog .dialog-heading{position:sticky;top:0;z-index:3;background:#fffdfa;padding:0 0 14px;margin-bottom:14px;border-bottom:1px solid #e1d8cc}
#record-dialog .dialog-actions{position:sticky;bottom:0;z-index:3;background:#fffdfa;padding:14px 0 0;box-shadow:0 -8px 16px #fffdfa;margin-top:20px}
#record-dialog :is(input,select,textarea){scroll-margin-top:100px;scroll-margin-bottom:100px}
#record-dialog .clipboard-summary-field textarea{min-height:110px}
#record-dialog .clipboard-summary-field small,#record-dialog [data-document-deal-status]{display:block;font-size:12px;line-height:1.6;color:#687c8b;font-weight:400;margin-top:8px}
#record-dialog [data-document-deal-search],#record-dialog .clipboard-summary-field button{min-height:40px;padding:9px 12px;border:1px solid #cbd6df;border-radius:8px;background:#fff;color:#173b5d;font-size:12px;font-weight:700;line-height:1.4}
@media(max-width:600px){#record-dialog .clipboard-summary-field textarea{min-height:96px}#record-dialog [data-document-deal-search],#record-dialog .clipboard-summary-field button{min-height:44px}}
#record-dialog .dialog-actions{bottom:-24px;padding-bottom:24px;margin-bottom:-24px}
@media(max-width:700px){#record-dialog .dialog-actions{bottom:-18px;padding-bottom:18px;margin-bottom:-18px}}

/* Long list values must wrap inside their own cell rather than overlap adjacent columns. */
#list-section td{white-space:normal;overflow-wrap:anywhere;word-break:normal;line-height:1.5;min-width:110px;}
#list-section td:first-child:not(.select-cell){min-width:200px;}
#list-section .select-cell{min-width:44px;white-space:nowrap;}
#list-section tbody tr:focus-visible{outline:2px solid #6da1cb;outline-offset:-2px;}

#list-section table{min-width:0;}
#list-section table:has(thead th:nth-child(5)){min-width:1100px;}

.list-refresh-error{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:14px 16px 0;padding:12px 14px;border:1px solid #e2c18f;border-radius:10px;background:#fff8ec;color:#795520;}
.list-refresh-error p{margin:0;font-size:13px;line-height:1.5;overflow-wrap:anywhere;}
.list-refresh-error button{flex-shrink:0;}
@media(max-width:600px){.list-refresh-error{align-items:stretch;flex-direction:column;gap:10px;}}
.list-refresh-error button{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:8px 11px;border:1px solid #cbd6df;border-radius:8px;background:#fff;color:#173b5d;font:inherit;font-size:12px;font-weight:700;line-height:1.35;cursor:pointer;}
.list-refresh-error button:hover:not(:disabled){background:#edf3f7;}
.list-refresh-error button:focus-visible{outline:3px solid #84b4d5;outline-offset:2px;}
@media(max-width:600px){.list-refresh-error button{min-height:44px;}}

/* Keep the brand marker beside a wrapping panel heading. */
.content .panel-title>div:first-child:has(>.brown-line):has(>h2){display:grid;grid-template-columns:3px minmax(0,1fr);align-items:center;gap:4px 10px;min-width:0;flex:1 1 180px;}
.content .panel-title>div:first-child>.brown-line{grid-column:1;grid-row:1;}
.content .panel-title>div:first-child>h2{min-width:0;margin:0;grid-column:2;grid-row:1;}
.content .panel-title>div:first-child:has(>.brown-line):has(>h2)>.auth-hint{grid-column:2;margin:0;}

#organization-documents-workspace .organization-document-entry{display:grid;grid-template-columns:minmax(0,1fr) 12px;gap:8px 10px;align-items:start;}
#organization-documents-workspace .organization-document-entry>span:first-child{grid-column:1;grid-row:1;min-width:0;}
#organization-documents-workspace .organization-document-entry>em{grid-column:1;grid-row:2;justify-self:start;max-width:100%;white-space:normal;overflow-wrap:anywhere;}
#organization-documents-workspace .organization-document-entry>span:last-child{grid-column:2;grid-row:1 / span 2;align-self:center;justify-self:end;}

#department-section .tenant-user-details small.tenant-user-department{display:block;max-width:100%;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.5;}

/* Department workspaces: work first, descriptive information on demand. */
#department-section>.panel{scroll-margin-top:84px;}
.department-workspace-nav{display:flex;gap:6px;overflow-x:auto;max-width:100%;padding:6px;margin-bottom:16px;border:1px solid #e1d8cc;border-radius:10px;background:#fffdfa;scrollbar-width:thin;}
.department-workspace-nav button{flex:0 0 auto;min-height:38px;max-width:300px;padding:8px 12px;border:1px solid transparent;border-radius:7px;background:transparent;color:#647482;font:inherit;font-size:12px;font-weight:700;line-height:1.4;white-space:normal;text-align:left;cursor:pointer;}
.department-workspace-nav button[aria-pressed=true]{background:#eaf1f6;border-color:#cbd6df;color:#173b5d;}
.department-workspace-nav button:hover{background:#f0f4f7;color:#173b5d;}
.department-workspace-nav button:focus-visible{outline:3px solid #84b4d5;outline-offset:-2px;}
.department-overview-details>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;cursor:pointer;color:#173b5d;list-style:none;}
.department-overview-details>summary::-webkit-details-marker{display:none;}
.department-overview-details>summary::after{content:'⌄';font-size:18px;}
.department-overview-details[open]>summary::after{transform:rotate(180deg);}
.department-overview-details>summary b{font-size:13px;}
.department-overview-details>summary span{margin-left:auto;color:#647482;font-size:12px;}
#department-tools{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(260px,100%),1fr));gap:12px;padding:16px 18px;}
#department-tools .department-tool{min-width:0;padding:14px;border:1px solid #e1d8cc;border-radius:9px;background:#fff;box-shadow:none;}
#department-tools .department-tool b{display:block;font-size:13px;line-height:1.5;overflow-wrap:anywhere;}
#department-tools .department-tool small{display:block;margin-top:5px;font-size:12px;line-height:1.55;overflow-wrap:anywhere;color:#647482;}
#department-tools .tool-status.ready{display:none;}
#department-section .legal-section-icon svg{width:20px;height:20px;}
@media(max-width:600px){.department-workspace-nav button{min-height:44px;max-width:240px;}.department-overview-details>summary{padding:14px;flex-wrap:wrap;}.department-overview-details>summary span{font-size:11px;}#department-tools{padding:14px;}}

#department-section .communication-options{display:flex;flex-wrap:wrap;gap:6px;padding:12px 18px;border-bottom:1px solid #e1d8cc;}
#department-section .communication-options button{flex:0 1 auto;min-width:0;min-height:38px;max-width:100%;padding:8px 12px;border:1px solid #cbd6df;border-radius:8px;background:#fff;color:#173b5d;text-align:left;box-shadow:none;}
#department-section .communication-options button b{font-size:12px;line-height:1.4;}
#department-section .communication-options button small{display:none;}
#department-section .communication-options button.active,#department-section .communication-options button[aria-pressed=true]{background:#173b5d;color:#fff;border-color:#173b5d;}
#department-section .empty{padding:22px 16px;min-height:0;}
@media(max-width:600px){#department-section .communication-options{padding:12px 14px;}#department-section .communication-options button{min-height:44px;}}
#department-section .partner-columns{gap:12px;padding:14px 16px;}
#department-section .partner-columns>section{padding:14px;border:1px solid #e1d8cc;border-radius:10px;background:#fff;min-width:0;}
#department-section .empty-state{display:grid;gap:6px;padding:14px;border:1px solid #e1d8cc;border-radius:9px;background:#f9f7f3;font-size:13px;line-height:1.5;}
#department-section .empty-state>span{color:#647482;}
@media(max-width:600px){#department-section .partner-columns{padding:12px 14px;}}

/* Guided CRM training shares the workspace control system. */
#crm-guide{width:min(380px,calc(100vw - 32px));padding:20px;border:1px solid #d8dfe5;border-radius:12px;background:#fffdfa;color:#173b5d;box-shadow:0 12px 36px rgba(23,59,93,.16);font-size:13px;line-height:1.55;}
#crm-guide header{gap:12px;align-items:center;}
#crm-guide-progress{display:inline-flex;align-items:center;min-height:26px;padding:3px 9px;border-radius:7px;background:#edf3f7;color:#647482;font-size:12px;font-weight:600;}
#crm-guide h3{margin:14px 0 8px;font-size:16px;font-weight:800;line-height:1.4;overflow-wrap:anywhere;}
#crm-guide p{margin:8px 0 14px;color:#647482;font-size:13px;line-height:1.6;}
#crm-guide button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:9px 14px;border:1px solid #cbd6df;border-radius:8px;background:#fff;color:#173b5d;font:inherit;font-size:12px;font-weight:700;line-height:1.35;box-sizing:border-box;}
#crm-guide button:hover:not(:disabled){background:#edf3f7;border-color:#93adbf;}
#crm-guide button:focus-visible{outline:3px solid #84b4d5;outline-offset:2px;}
#crm-guide button:disabled{opacity:1;color:#91a0ac;background:#f5f7f8;border-color:#e0e6ea;cursor:default;}
#crm-guide #crm-guide-next{background:#173b5d;border-color:#173b5d;color:#fff;}
#crm-guide #crm-guide-next:hover{background:#224b6d;border-color:#224b6d;}
#crm-guide #crm-guide-close{flex:0 0 44px;width:44px;min-width:44px;height:44px;padding:0;line-height:1;}
#crm-guide footer{margin-top:16px;padding-top:14px;border-top:1px solid #e1d8cc;gap:12px;}
#crm-guide-details{margin-top:12px;padding:12px 14px;border:1px solid #e1d8cc;border-radius:9px;background:#f7f3ed;}
#crm-guide-details p{margin:0;}
.crm-guide-highlight{outline:2px solid #b98955!important;outline-offset:3px;}
@media(max-width:600px){#crm-guide{padding:16px;max-height:calc(100dvh - 32px);}}

#tenant-users-panel .tenant-users-search{display:flex;flex-wrap:wrap;align-items:end;gap:8px 16px;padding:14px 16px;}
#tenant-users-panel .tenant-users-search label{display:grid;gap:6px;min-width:0;width:min(520px,100%);font-size:12px;font-weight:600;color:#647482;}
#tenant-users-search{box-sizing:border-box;width:100%;min-height:38px;padding:9px 12px;border:1px solid #cbd6df;border-radius:8px;background:#fff;color:#173b5d;font:inherit;font-size:13px;line-height:1.4;}
#tenant-users-search:focus-visible{outline:3px solid #84b4d5;outline-offset:2px;}
@media(max-width:600px){#tenant-users-search{min-height:44px;}}

@media(max-width:600px){
 #department-section .panel-title:has(>button)>div:first-child{flex-basis:100%;}
 #department-section .panel-title>button{margin-left:auto;}
 #internal-api-integrations .api-integration-card{grid-template-columns:minmax(0,1fr);gap:8px;}
 #internal-api-integrations .api-integration-card>.count-badge{justify-self:start;}
}

.board-meeting-badge .ui-icon{width:14px;height:14px;flex:0 0 14px;vertical-align:middle;}
[data-library-reader-fullscreen] svg{display:block;width:18px;height:18px;}

/* A zero total has no lost share; month charts retain a compact height. */
#dashboard-section .outcome-donut.is-empty{background:#e7edf1;}
#dashboard-section #dashboard-sales-chart{display:flex!important;align-items:flex-start;gap:12px;overflow-x:auto;max-width:100%;padding:16px;scrollbar-width:thin;}
#dashboard-section #dashboard-sales-chart>.sales-month{flex:0 0 72px;min-width:72px;width:72px;}
#dashboard-section #dashboard-sales-chart .sales-bars{height:150px;min-height:150px;gap:8px;}
#dashboard-section #dashboard-sales-chart .sales-bar{width:26px;}
#dashboard-section #dashboard-sales-chart:focus-visible{outline:3px solid #84b4d5;outline-offset:-3px;}

/* Узкая карточка: управление выше названия, без разрыва слов. */
@media(max-width:680px){
#dashboard-section .dashboard-kpi-strip>.dashboard-kpi{padding-top:50px!important;}
#dashboard-section .dashboard-kpi-strip .metric-heading{padding-right:0;gap:6px;font-size:11px;letter-spacing:0;text-transform:none;line-height:1.4;}
#dashboard-section .dashboard-kpi-strip .metric-heading span{overflow-wrap:normal;word-break:normal;hyphens:none;}
#dashboard-section .dashboard-kpi-strip .metric-icon{flex:0 0 22px;width:22px;height:22px;padding:4px;}
}

.department-team-panel{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:16px 20px;margin-bottom:12px;}
.department-team-lead{min-width:0;flex:1;}.department-team-lead>small{display:block;color:var(--muted);font-size:11px;margin-bottom:6px;}.department-person{display:block;overflow-wrap:anywhere;line-height:1.5;font-size:14px;}.department-team-members{flex:1;min-width:0;}.department-team-members summary{cursor:pointer;display:flex;gap:10px;align-items:center;font-size:12px;font-weight:700;color:var(--navy);min-height:36px;}.department-team-members>div{display:grid;gap:8px;padding-top:10px;}.department-team-members .department-person{font-size:12px;}
@media(max-width:680px){.department-team-panel{display:grid;gap:12px;padding:14px;}.department-team-members summary{min-height:44px;}}

/* Рабочий стол: короткое появление без изменения данных и геометрии. */
@keyframes ark-dashboard-enter{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:translateY(0);}}
@keyframes ark-dashboard-bar{from{transform:scaleY(0);}to{transform:scaleY(1);}}
@media(prefers-reduced-motion:no-preference){
#dashboard-section:not([hidden]) .dashboard-widget{animation:ark-dashboard-enter 280ms ease-out both;}
#dashboard-section .dashboard-kpi:nth-child(2){animation-delay:25ms;}
#dashboard-section .dashboard-kpi:nth-child(3){animation-delay:50ms;}
#dashboard-section .dashboard-kpi:nth-child(4){animation-delay:75ms;}
#dashboard-section .dashboard-kpi:nth-child(5){animation-delay:100ms;}
#dashboard-section .sales-bar{transform-origin:bottom;animation:ark-dashboard-bar 360ms cubic-bezier(.2,.7,.3,1) both;}
#dashboard-section .dashboard-widget-settings{transition:background-color 160ms ease,border-color 160ms ease;}
}
#dashboard-section .dashboard-kpi strong{font-variant-numeric:tabular-nums;}
@media(prefers-reduced-motion:reduce){#dashboard-section .dashboard-widget,#dashboard-section .sales-bar{animation:none!important;transition:none!important;}}

/* Мобильная навигация почты — общая вторичная кнопка. */
#email-workspace .email-mobile-back{align-items:center;justify-content:center;gap:6px;min-height:44px;padding:9px 12px;border:1px solid var(--ui-secondary-border,#cbd8e2);border-radius:8px;background:#fff;color:var(--navy);font:700 12px/1.4 Montserrat,sans-serif;cursor:pointer;white-space:nowrap;}
#email-workspace .email-mobile-back:hover{background:#edf3f7;border-color:#8babc2;}
#email-workspace .email-mobile-back:focus-visible{outline:3px solid #84b4d5;outline-offset:2px;}

#email-navigation-back{margin-bottom:10px;}
@media(min-width:981px){#email-navigation-back{display:none!important;}}

@media(max-width:600px){
#email-workspace .email-reader-toolbar [data-email-reader-action="previous"]:disabled,#email-workspace .email-reader-toolbar [data-email-reader-action="next"]:disabled{display:none;}
#email-workspace .email-reader-toolbar{gap:8px;padding:12px 16px;}
}

/* Доска сделок соблюдает общий край страницы и прокручивается внутри панели. */
.content:has(#deal-board:not([hidden])) .table-panel{min-width:0;max-width:100%;}
.content:has(#deal-board:not([hidden])) #deal-board{display:flex;max-width:100%;min-width:0;overflow-x:auto;overflow-y:hidden;}
@media(min-width:1601px){.content:has(#deal-board:not([hidden])){padding-inline:clamp(18px,3vw,46px);}.content:has(#deal-board:not([hidden])) #deal-board .board-column{flex:0 0 240px;min-width:240px;}}
/* Поисковый помощник — часть строки поиска, а не плавающее окно. */
.search-wrap{position:relative;min-width:0}
.search-wrap #global-search{padding-right:54px}
.crm-search-assistant{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:36px;height:36px;min-width:36px;min-height:36px;padding:2px;border:1px solid #d4dfe8;border-radius:10px;background:#f2f6f9;box-shadow:none;display:grid;place-items:center}
.crm-search-assistant[hidden]{display:none}
.crm-search-assistant img{width:30px;height:30px;object-fit:contain;border-radius:50%}
.crm-search-assistant:hover{background:#e5eef5;border-color:#b98955}
.crm-search-assistant:focus-visible{outline:2px solid #b98955;outline-offset:2px}
.search-help,.search-caption{padding:16px 18px;display:grid;gap:6px;color:#173b5d;font-size:13px;line-height:1.5}
.search-help span,.search-caption small{color:#647789;font-size:12px}
.search-caption{border-bottom:1px solid #e5ded5;background:#faf8f4}
@media(max-width:600px){.crm-search-assistant{width:40px;height:40px;min-width:40px;min-height:40px}.search-wrap #global-search{padding-right:54px;min-height:44px}}

.search-caption{display:flex;flex-direction:column}.global-search-results .search-caption small{grid-row:auto;text-transform:none;font-size:12px;font-weight:400;color:#647789}

/* Полная тема доступна, начальное чтение не отодвигается длинным заголовком. */
#email-reader-subject{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden;overflow-wrap:anywhere}
#email-reader-subject.is-expanded{display:block;-webkit-line-clamp:unset;overflow:visible}
.email-subject-toggle{margin:8px 0 12px;min-height:44px;padding:8px 12px;font-size:12px;font-weight:700;color:#173b5d;background:#fff;border:1px solid #cbd8e2;border-radius:8px;width:max-content;max-width:100%}
.email-subject-toggle[hidden]{display:none}
.email-subject-toggle:hover{background:#edf3f7}
.email-subject-toggle:focus-visible{outline:2px solid #b98955;outline-offset:2px}

#email-workspace-search-clear,[data-library-reader-close]{display:inline-flex;align-items:center;justify-content:center}
#email-workspace-search-clear[hidden]{display:none}
#email-workspace-search-clear .ui-icon,[data-library-reader-close] .ui-icon{width:18px;height:18px;flex:none;margin:0}
@media(max-width:600px){.email-column-search #email-workspace-search-clear{width:44px;height:44px}.email-column-search input{height:44px}.email-column-search input::-webkit-search-cancel-button{display:none}}

.department-team-members summary{min-height:44px;border-radius:6px}
.department-team-chevron{width:16px;height:16px;flex:none;transition:transform 160ms ease}
.department-team-members[open] .department-team-chevron{transform:rotate(180deg)}
.department-team-members summary:focus-visible{outline:2px solid #b98955;outline-offset:3px}
@media(prefers-reduced-motion:reduce){.department-team-chevron{transition:none}}

.partner-pipeline-dialog{width:min(640px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto}
.partner-pipeline-dialog .dialog-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.partner-pipeline-dialog .dialog-heading h2{margin:0;min-width:0;overflow-wrap:anywhere}
.partner-pipeline-dialog .dialog-close{width:44px;min-width:44px;height:44px;padding:0;display:grid;place-items:center}
.partner-pipeline-dialog .pipeline-enabled{display:flex;flex-direction:row;align-items:center;gap:10px;min-height:44px;align-self:end}
.partner-pipeline-dialog .pipeline-enabled input{width:18px;height:18px;min-height:18px;margin:0}
.partner-pipeline-dialog input[type=color]{height:44px;padding:6px;max-width:100%}
.partner-pipeline-dialog [data-error]:empty{display:none}
.partner-pipeline-dialog input[type=color]::-webkit-color-swatch-wrapper{padding:0}
.partner-pipeline-dialog input[type=color]::-webkit-color-swatch{border:0;border-radius:4px}

.composite-summary-dialog{width:min(640px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto}
.composite-summary-dialog .dialog-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.composite-summary-dialog .dialog-heading h2{margin:0;min-width:0;overflow-wrap:anywhere}
.composite-summary-dialog .dialog-close{width:44px;min-width:44px;height:44px;padding:0;display:grid;place-items:center}
.composite-summary-dialog select{min-width:0;max-width:100%}

.composite-summary-preview{margin:12px 0}
.composite-summary-preview summary{display:flex;align-items:center;gap:10px;min-height:44px}
.composite-summary-preview summary .ui-icon{width:16px;height:16px;flex:none}
.composite-summary-preview[open] summary .ui-icon{transform:rotate(180deg)}
.composite-summary-preview p{display:grid;gap:6px;overflow-wrap:anywhere;font-size:13px;line-height:1.5}
.composite-summary-dialog [data-selected-identities]{font-size:12px;line-height:1.5;overflow-wrap:anywhere;color:#647789}

.deal-bulk-dialog .dialog-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.deal-bulk-dialog .dialog-heading h2{margin:0;min-width:0;overflow-wrap:anywhere}
.deal-bulk-dialog .dialog-close{width:44px;min-width:44px;height:44px;padding:0;display:grid;place-items:center}
.deal-bulk-dialog .dialog-actions button{min-height:44px;font-weight:700}
.deal-bulk-dialog .bulk-result-errors{max-height:28vh;overflow:auto;padding:12px 12px 12px 30px;border:1px solid #e7c7c2;border-radius:8px;background:#fff7f5}
.deal-bulk-dialog .bulk-result-errors:focus-visible{outline:2px solid #b98955;outline-offset:2px}
.record-dialog.deal-bulk-dialog{width:min(640px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:24px}

.edo-preparation-dialog .dialog-heading,.edo-history-dialog .dialog-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.edo-preparation-dialog .dialog-heading h2,.edo-history-dialog .dialog-heading h2{margin:0;min-width:0;overflow-wrap:anywhere}
.edo-preparation-dialog .dialog-close,.edo-history-dialog .dialog-close{width:44px;min-width:44px;height:44px;padding:0;display:grid;place-items:center}
.edo-preparation-dialog .edo-file-choice{display:flex;align-items:flex-start;gap:12px;padding:12px;border:1px solid #e2d6c7;border-radius:8px;margin:10px 0}
.edo-preparation-dialog .edo-file-choice input{width:18px;height:18px;min-height:18px;flex:none;padding:0;margin:3px 0 0}
.edo-preparation-dialog .edo-file-choice span{min-width:0;overflow-wrap:anywhere;font-size:13px;line-height:1.5}
.edo-preparation-dialog .edo-file-choice small{display:block;color:#647789;margin-top:4px}
.edo-preparation-dialog [data-edo-files]{max-height:min(42dvh,340px);overflow:auto;padding:2px}

.saby-documents-dialog .dialog-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.saby-documents-dialog .dialog-heading h2{margin:0;min-width:0;overflow-wrap:anywhere}
.saby-documents-dialog .dialog-close{width:44px;min-width:44px;height:44px;padding:0;display:grid;place-items:center}
.saby-documents-dialog [data-saby-results]{max-height:min(42dvh,340px);overflow:auto;padding:2px;overflow-wrap:anywhere}
.saby-documents-dialog .saby-document-entry b{overflow-wrap:anywhere}

.saby-document-name summary{display:flex;align-items:center;gap:8px;min-height:44px;cursor:pointer;font-weight:700}
.saby-document-name summary span{min-width:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.saby-document-name summary .ui-icon{width:16px;height:16px;flex:none}
.saby-document-name[open] summary .ui-icon{transform:rotate(180deg)}
.saby-document-name p{font-size:13px;line-height:1.5;overflow-wrap:anywhere;font-weight:400}
.saby-document-name summary:focus-visible{outline:2px solid #b98955;outline-offset:2px;border-radius:4px}

.contact-notes-dialog>header>div{min-width:0}
.contact-notes-dialog h2{overflow-wrap:anywhere}
.contact-notes-dialog [data-note-close]{width:44px;min-width:44px;height:44px;padding:0;display:grid;place-items:center}
.contact-notes-dialog [data-note-close] .ui-icon{width:18px;height:18px}
.contact-notes-dialog .contact-notes-feed{max-height:min(28dvh,220px);overflow:auto;padding:2px}
.contact-notes-dialog .contact-note-save{min-height:44px;font-weight:700}
.contact-notes-dialog .contact-note-status:empty{display:none}

/* Record identity stays in the scrollable body, with a compact fixed heading. */
#record-form-fields .record-edit-context { min-width:0; max-width:100%; }
#record-form-fields .record-edit-context summary { font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
#record-form-fields .record-edit-context p { margin:10px 0 0; font-size:13px; line-height:1.6; white-space:pre-wrap; overflow-wrap:anywhere; }

.record-dialog .dialog-actions button.danger { color:var(--ui-danger); border-color:#e7c9c1; background:#fff7f4; }
.record-dialog .dialog-actions button.danger:hover:not(:disabled) { background:#fceee9; }
#calendar-event-delete { margin-right:auto; }

#organization-documents-workspace .organization-document-entry b { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
#organization-documents-workspace .document-name-disclosure { padding:0 0 12px; font-size:12px; line-height:1.5; }
#organization-documents-workspace .document-name-disclosure summary { cursor:pointer; color:var(--ui-muted); min-height:36px; display:list-item; align-content:center; }
#organization-documents-workspace .document-name-disclosure p { margin:8px 0 0; overflow-wrap:anywhere; white-space:pre-wrap; }
#organization-documents-workspace .documents-search-empty { padding:28px 16px; }
@media(max-width:700px){#organization-documents-workspace .document-name-disclosure summary{min-height:44px}}

/* Keep record names compact while the contact history control remains visible. */
#page-title:has([data-record-title]) { display:flex; align-items:center; gap:10px; min-width:0; }
#page-title [data-record-title] { line-height:1.2; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; overflow-wrap:anywhere; min-width:0; }
#page-title:has([data-record-title]) .contact-note-star { flex:none; margin:0; }
#page-record-name { display:none; max-width:100%; font-size:12px; line-height:1.5; color:var(--ui-muted); }
#page-title:has([data-record-title]) + #page-record-name { display:block; }
#page-record-name summary { cursor:pointer; min-height:38px; align-content:center; }
#page-record-name p { margin:4px 0 10px; white-space:pre-wrap; overflow-wrap:anywhere; font-size:13px; line-height:1.6; }
@media(max-width:700px){#page-record-name summary{min-height:44px}}

/* Connection lists size themselves to their panel, including a narrow department workspace. */
#department-section>:is(#email-mailboxes-panel,#telephony-endpoints-panel,#api-clients-panel){width:100%;max-width:none;min-width:0;container:admin-connections/inline-size}
#department-section :is(#email-mailboxes-list,#telephony-endpoints-list,#api-clients-list){min-width:0;padding-inline:var(--ui-edge)}
#department-section :is(#email-mailboxes-list,#telephony-endpoints-list,#api-clients-list) .tenant-user{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr) minmax(0,1.4fr);gap:12px 16px;min-width:0}
#department-section :is(#email-mailboxes-panel,#telephony-endpoints-panel,#api-clients-panel) .admin-block-columns{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr) minmax(0,1.4fr);gap:16px;margin-inline:var(--ui-edge);padding-inline:0;text-align:left}
#department-section :is(#email-mailboxes-panel,#telephony-endpoints-panel,#api-clients-panel) .admin-block-columns>span:last-child{text-align:right}
#department-section :is(#email-mailboxes-list,#telephony-endpoints-list,#api-clients-list) .tenant-user>span{min-width:0;max-width:100%}
#department-section :is(#email-mailboxes-list,#telephony-endpoints-list,#api-clients-list) .tenant-user :is(b,small,code){max-width:100%;white-space:normal;overflow-wrap:anywhere;word-break:normal;overflow:visible;text-overflow:clip}
#department-section :is(#email-mailboxes-list,#telephony-endpoints-list,#api-clients-list) .tenant-user-actions{flex-wrap:wrap;min-width:0;gap:8px}
#department-section :is(#email-mailboxes-list,#telephony-endpoints-list,#api-clients-list) .tenant-user-actions button{min-width:0;max-width:100%;white-space:normal}
@container admin-connections (max-width:899px){
 #department-section :is(#email-mailboxes-panel,#telephony-endpoints-panel,#api-clients-panel) .admin-block-columns{display:none}
 #department-section :is(#email-mailboxes-list,#telephony-endpoints-list,#api-clients-list) .tenant-user{grid-template-columns:minmax(0,1fr);gap:10px}
 #department-section :is(#email-mailboxes-list,#telephony-endpoints-list,#api-clients-list) .tenant-user-actions{justify-content:flex-start}
}
#email-mailboxes-removed{margin:0 var(--ui-edge) var(--ui-edge);border-top:1px solid var(--ui-border);padding-top:12px}
#email-mailboxes-removed>summary{cursor:pointer;min-height:38px;align-content:center;color:var(--ui-muted);font-size:12px;font-weight:700}
#email-mailboxes-removed-list{padding:0}
#email-mailboxes-removed-list .tenant-user{grid-template-columns:minmax(0,1fr) auto;gap:12px}
#email-mailboxes-removed-list .tenant-user>span{min-width:0;overflow-wrap:anywhere}
#email-mailbox-remove{margin-right:auto}
@media(max-width:700px){#email-mailboxes-removed>summary{min-height:44px}#email-mailbox-remove{margin-right:0;width:100%}#email-mailboxes-removed-list .tenant-user{grid-template-columns:minmax(0,1fr)}}

#internal-api-integrations .api-integration-card :is(div,b,small){min-width:0;max-width:100%;overflow-wrap:anywhere;white-space:normal;}

#tenant-users-list .tenant-user :is(b,small){max-width:100%;white-space:normal;overflow-wrap:anywhere;overflow:visible;text-overflow:clip;}
#tenant-users-list .tenant-user-identity>span:last-child{min-width:0;max-width:100%;}
#tenant-service-users article>span:first-child{min-width:0;max-width:100%;}
#tenant-service-users :is(b,small){white-space:normal;overflow-wrap:anywhere;max-width:100%;}
@media(min-width:1101px){
#tenant-users-panel .tenant-users-columns,#tenant-users-list .tenant-user{grid-template-columns:minmax(0,1fr) minmax(0,.9fr) minmax(0,.9fr) minmax(0,1.5fr);gap:12px;}
}
#tenant-users-list .tenant-user>span{min-width:0;max-width:100%;}
#tenant-users-list .tenant-user-actions{flex-wrap:wrap;}
#tenant-users-list .tenant-user-actions :is(button,select){max-width:100%;white-space:normal;}
#tenant-users-list .tenant-user-actions select{min-width:0;flex:1 1 170px;}
#tenant-users-list .access-tag{white-space:normal;overflow-wrap:anywhere;max-width:100%;}
#tenant-users-list .tenant-user-actions select{flex-basis:100%;}

#access-preview-content :is(.access-preview-card,b,small,.access-preview-tags>span){min-width:0;max-width:100%;overflow-wrap:anywhere;white-space:normal;}

#legal-dd-reviews-list :is(.partner-entry,b,small){min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;}
#legal-dd-queue-controls{padding:12px 16px;display:flex;gap:8px;flex-wrap:wrap;}
#legal-dd-queue-controls button[aria-pressed=true]{background:#173b5d;color:#fff;border-color:#173b5d;}
#department-section :is(#legal-dd-reviews-list,#legal-dd-queue-controls) button{display:inline-flex;align-items:center;justify-content:center;min-height:var(--ui-control);max-width:100%;padding:8px 11px;border:1px solid var(--ui-secondary-border);border-radius:var(--ui-radius);background:#fff;color:var(--ui-primary);font:inherit;font-size:12px;font-weight:700;line-height:1.35;white-space:normal;}
#department-section #legal-dd-queue-controls button[aria-pressed=true]{background:var(--ui-primary);color:#fff;border-color:var(--ui-primary);}
#department-section #legal-dd-reviews-list button[data-action=rejected]{color:var(--ui-danger);border-color:#e7c9c1;background:#fff7f4;}

#legal-dd-preview :is(.partner-entry,b,small){min-width:0;max-width:100%;overflow-wrap:anywhere;white-space:normal;}
#department-section #legal-dd-preview button{min-height:var(--ui-control);padding:8px 11px;border:1px solid var(--ui-secondary-border);border-radius:var(--ui-radius);background:#fff;color:var(--ui-primary);font:inherit;font-size:12px;font-weight:700;}

.crm-confirm-field textarea{box-sizing:border-box;width:100%;min-height:120px;max-width:100%;padding:11px 12px;border:1px solid var(--ui-secondary-border);border-radius:var(--ui-radius);background:#fff;color:var(--ui-primary);font:inherit;line-height:1.5;resize:vertical;}
.crm-confirm-field textarea:focus-visible{outline:3px solid #84b4d5;outline-offset:2px;}

#department-section #legal-due-diligence-form button{min-height:var(--ui-control);padding:8px 11px;border-radius:var(--ui-radius);font:inherit;font-size:12px;font-weight:700;}

.workspace-load-status{margin:12px 16px;padding:12px 14px;border:1px solid #e4d9cc;border-radius:8px;color:#647482;background:#fffdfa;overflow-wrap:anywhere;line-height:1.5}.workspace-load-status[role=alert]{color:#a13b30;border-color:#e7c9c1;background:#fff7f4}.workspace-load-status .entry-actions{margin-top:8px;}
#department-section .workspace-load-status button{display:inline-flex;align-items:center;justify-content:center;min-height:var(--ui-control);max-width:100%;padding:8px 11px;border:1px solid var(--ui-secondary-border);border-radius:var(--ui-radius);background:#fff;color:var(--ui-primary);font:inherit;font-size:12px;font-weight:700;line-height:1.35;white-space:normal;}
#department-section :is(#hr-workspace-panel,#it-workspace-panel)>.official-forms{width:auto;max-width:calc(100% - 32px);}

#department-section [data-money-retry]{min-height:var(--ui-control);padding:8px 11px;border:1px solid var(--ui-secondary-border);border-radius:var(--ui-radius);background:#fff;color:var(--ui-primary);font:inherit;font-size:12px;font-weight:700;}

#finance-workspace-panel{container-name:finance-workspace;container-type:inline-size;}
#finance-summary{grid-template-columns:minmax(0,1fr);}
@container finance-workspace (min-width:660px){#finance-summary{grid-template-columns:repeat(2,minmax(0,1fr));}}
@container finance-workspace (min-width:1320px){#finance-summary{grid-template-columns:repeat(4,minmax(0,1fr));}}

#department-section :is(.entry-actions,.panel-title) button{min-height:var(--ui-control);padding:8px 11px;border:1px solid var(--ui-secondary-border);border-radius:var(--ui-radius);background:#fff;color:var(--ui-primary);font:inherit;font-size:12px;font-weight:700;line-height:1.35;white-space:normal;max-width:100%;}
#department-section :is(.entry-actions,.panel-title) button.primary{background:var(--ui-primary);border-color:var(--ui-primary);color:#fff;}
:is(#finance-workspace-panel,#accounting-workspace-panel):focus-visible{outline:2px solid #84b4d5;outline-offset:2px;}

/* Upcoming deal work: same icons as main navigation. */
.board-schedule-badge{display:flex;align-items:flex-start;gap:6px;margin-top:7px;padding:6px 8px;border-radius:6px;font-size:11px;line-height:1.4;overflow-wrap:anywhere}
.board-schedule-badge .ui-icon{width:14px;height:14px;flex:none;margin-top:1px}
.board-schedule-badge.future{color:#637180;background:#edf0f3}
.board-schedule-badge.today{color:#176b45;background:#e9f5ed}
.board-schedule-badge.urgent{color:#a82626;background:#fbecec}

#management-decisions .tenant-user{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-start;}
#management-decisions .tenant-user>span:first-child{flex:1 1 240px;min-width:0;overflow-wrap:anywhere;}
#management-decisions .entry-actions{flex:0 1 auto;flex-wrap:wrap;max-width:100%;}
#management-decisions .entry-actions button{white-space:normal;min-height:38px;}
@media(max-width:700px){#management-decisions .entry-actions button{min-height:44px;}}
#management-workspace-panel{container-type:inline-size;container-name:management-workspace;}
#management-metrics{grid-template-columns:minmax(0,1fr);}
#management-metrics article{min-width:0;}
@container management-workspace (min-width:660px){#management-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}}
@container management-workspace (min-width:1320px){#management-metrics{grid-template-columns:repeat(3,minmax(0,1fr));}}
#management-workspace-panel .price-refresh-run{grid-template-columns:minmax(0,1fr);min-width:0;overflow-wrap:anywhere;}
#management-workspace-panel .price-refresh-run-heading{flex-wrap:wrap;}
#management-workspace-panel .price-refresh-run-heading>span{min-width:0;max-width:100%;}
#management-workspace-panel .price-refresh-run-heading>.entry-actions{display:flex;flex-wrap:wrap;}
#management-workspace-panel .price-refresh-items li>span:first-child{min-width:0;overflow-wrap:anywhere;}
#management-workspace-panel :is(.price-review-panel,.price-catalog-panel) .management-announcement-heading>div:first-child{display:grid;grid-template-columns:3px minmax(0,1fr);column-gap:10px;row-gap:8px;}
#management-workspace-panel :is(.price-review-panel,.price-catalog-panel) .management-announcement-heading .brown-line{grid-column:1;grid-row:1;margin:0;height:22px;}
#management-workspace-panel :is(.price-review-panel,.price-catalog-panel) .management-announcement-heading h3{grid-column:2;grid-row:1;margin:0;}
#management-workspace-panel :is(.price-review-panel,.price-catalog-panel) .management-announcement-heading .auth-hint{grid-column:1/-1;margin:0;}
#price-refresh-list:focus{outline:2px solid rgba(23,59,93,.35);outline-offset:3px;border-radius:8px;}

#scout-dialog>form>label :is(input,select,textarea){padding:10px 12px;font-family:Montserrat,sans-serif;font-size:13px;line-height:1.5;color:var(--navy,#173b5d);border:1px solid var(--line,#e5d5be);border-radius:8px;background:#fff;min-height:42px;}
#scout-dialog>form>label textarea{resize:vertical;}
#scout-import-preview{max-height:260px;overflow:auto;padding:12px;border:1px solid var(--line,#e5d5be);border-radius:8px;background:#f7f6f2;font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;}
#scout-import-preview:empty{display:none;}

#scout-dialog [data-scout-retry]{min-height:max(42px,var(--ui-control,38px));margin-top:8px;max-width:100%;padding:10px 16px;border:1px solid var(--ui-secondary-border);border-radius:8px;background:#fff;color:var(--ui-primary);font:inherit;font-size:13px;font-weight:700;line-height:1.4;white-space:normal;}

#scout-dialog>form>label{margin:0 0 14px;}

/* Tasks can be completed without leaving the deal. */
.deal-task-completion-panel{padding:14px;border-bottom:1px solid var(--border,#e3d6c5);display:grid;gap:10px}.deal-task-completion-panel[hidden]{display:none}.deal-task-completion-panel>h3{font:700 14px Montserrat,sans-serif;margin:0}.deal-inline-task{border:1px solid #ddd7cf;border-left:3px solid #9aa7b3;border-radius:10px;padding:12px;background:#fff;min-width:0}.deal-inline-task.is-today{border-left-color:#3d9569}.deal-inline-task.is-urgent{border-left-color:#c24b50;background:#fffafa}.deal-inline-task.is-completed{border-left-color:#3d9569;background:#f7faf8}.deal-inline-task-heading{display:flex;gap:9px;align-items:flex-start}.deal-inline-task-heading>div{min-width:0}.deal-inline-task-heading small{display:block;line-height:1.5;color:#657483;overflow-wrap:anywhere}.deal-inline-task-heading button{border:0;background:none;padding:3px 0;text-align:left;font-weight:700;overflow-wrap:anywhere;white-space:normal}.deal-inline-task.is-completed .deal-inline-task-heading button{text-decoration:line-through}.deal-inline-task>p{margin:7px 0 0 27px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}.deal-inline-task form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-top:10px}.deal-inline-task textarea{min-width:0;width:100%;box-sizing:border-box;resize:vertical;font:13px Montserrat,sans-serif}.deal-inline-task form>button{min-height:44px;align-self:start}.deal-inline-task-status{grid-column:1/-1;margin:0;font-size:12px;overflow-wrap:anywhere}.deal-inline-task-status:empty{display:none}@media(max-width:600px){.deal-inline-task form{grid-template-columns:minmax(0,1fr)}.deal-inline-task form>button{justify-self:end}}
.deal-inline-task .visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.deal-inline-task-heading button{font:600 13px/1.5 Montserrat,sans-serif;color:#1c3c59;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.deal-inline-task textarea{border:1px solid #dfd0bd;border-radius:8px;padding:10px;background:#fff;color:#1c3c59;min-height:62px}.deal-inline-task-heading>.ui-icon{color:#718390;flex:0 0 18px}.deal-inline-task.is-completed .ui-icon{color:#3d9569}
.deal-inline-task.is-today .deal-inline-task-heading>.ui-icon,.deal-inline-task.is-today .deal-inline-task-heading small{color:#347b58}.deal-inline-task.is-urgent .deal-inline-task-heading>.ui-icon,.deal-inline-task.is-urgent .deal-inline-task-heading small{color:#b04349}

#email-compose-form select[name="templateId"]{padding-right:40px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:100%}

#email-compose-form [data-email-template-status]{font-size:12px;font-weight:400;line-height:1.5;margin:8px 0 0;overflow-wrap:anywhere}#email-compose-form [data-email-template-status] button{margin-top:6px;min-height:38px}#email-compose-form [data-email-attachments-retry],#email-compose-form [data-email-check-delivery]{min-height:38px;margin-top:8px}@media(max-width:600px){#email-compose-form [data-email-template-status] button,#email-compose-form [data-email-attachments-retry],#email-compose-form [data-email-check-delivery]{min-height:44px}}
#email-compose-form [data-email-template-status] button{display:block;width:fit-content;max-width:100%}

/* Compact task entries belong to the deal conversation. */
#deal-timeline .deal-task-completion-panel{padding:0;border:0;gap:6px;margin:6px 0;min-width:0}
#deal-timeline .deal-inline-task{padding:7px 9px;border-radius:5px;border-left-width:2px;background:#fff}
#deal-timeline .deal-inline-task.is-urgent{background:#fffafa}
#deal-timeline .deal-inline-task-heading{gap:7px}
#deal-timeline .deal-inline-task-heading small{font-size:10px;line-height:1.35}
#deal-timeline .deal-inline-task-heading button{font-size:11px;line-height:1.4;padding:1px 0;-webkit-line-clamp:2}
#deal-timeline .deal-inline-task-heading>.ui-icon{width:16px;height:16px;flex-basis:16px}
#deal-timeline .deal-inline-task>p{margin:3px 0 0 23px;font-size:11px;line-height:1.4}
#deal-timeline .deal-inline-task form{margin:5px 0 0 23px;gap:6px;grid-template-columns:minmax(0,1fr) auto}
#deal-timeline .deal-inline-task textarea{min-height:30px;padding:6px 8px;border-radius:4px;font-size:11px;line-height:1.4}
#deal-timeline .deal-inline-task form>button{min-height:30px;padding:5px 12px;font-size:11px;border-radius:4px}
@media(max-width:600px){#deal-timeline .deal-inline-task form{grid-template-columns:minmax(0,1fr)}#deal-timeline .deal-inline-task form>button{min-height:40px}}

.dashboard-stage-open{width:100%;text-align:left;border:0;background:transparent;border-radius:6px;color:inherit;padding:10px 8px;white-space:normal}.dashboard-stage-open:hover{background:#edf3f7}.dashboard-stage-open:focus-visible{outline:2px solid #3976b9;outline-offset:2px}.dashboard-stage-dialog{width:min(680px,calc(100vw - 32px));max-height:85vh;padding:22px;border:1px solid #dfd0bd;border-radius:14px;background:#fffdf9;color:#1c3c59;box-sizing:border-box}.dashboard-stage-dialog::backdrop{background:rgba(20,39,55,.45)}.dashboard-stage-dialog .dialog-heading{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.dashboard-stage-dialog h2{font:700 20px/1.4 Montserrat,sans-serif;margin:4px 0;overflow-wrap:anywhere}.dashboard-stage-dialog small{font:400 11px/1.4 Montserrat,sans-serif;color:#7a6a58}.dashboard-stage-dialog [data-stage-close]{width:40px;min-height:40px;flex-shrink:0}.dashboard-stage-status{font:400 12px/1.5 Montserrat,sans-serif}.dashboard-stage-records{display:grid;gap:6px}.dashboard-stage-records>button{display:grid;text-align:left;gap:4px;white-space:normal;min-width:0;padding:10px 12px;min-height:44px;border:1px solid #e3d6c5;border-radius:6px;background:#fff;color:#1c3c59}.dashboard-stage-records b{font:600 12px/1.5 Montserrat,sans-serif;overflow-wrap:anywhere}

.outcome-legend>button{display:grid;grid-template-columns:10px minmax(0,1fr) auto;align-items:center;gap:8px;width:100%;border:0;background:transparent;color:inherit;text-align:left;white-space:normal;padding:7px 4px;border-radius:5px;font:inherit}.outcome-legend>button:hover{background:#edf3f7}.outcome-legend>button:focus-visible{outline:2px solid #3976b9;outline-offset:2px}.outcome-legend>button i{width:8px;height:8px;border-radius:50%;display:block}

.outcome-operational [data-dashboard-year-deals]{font:600 11px/1.4 Montserrat,sans-serif;border:1px solid #d4dfe7;border-radius:5px;background:#fff;color:#1c3c59;padding:6px 10px;margin-top:6px;min-height:32px}

.dashboard-stage-dialog [data-stage-close] .ui-icon{width:18px;height:18px;display:block;margin:auto;flex-shrink:0}

.dashboard-stage-records b{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}

#deal-timeline .deal-inline-task{position:relative;overflow:hidden}#deal-timeline .deal-inline-task-tools{display:flex;gap:4px;position:absolute;right:0;top:0;background:#f3f1ec;border:1px solid #ded8cf;border-radius:0 4px 0 5px;padding:4px;opacity:0;transform:translateX(100%);transition:transform .15s ease,opacity .15s ease;pointer-events:none;z-index:1}#deal-timeline .deal-inline-task:hover .deal-inline-task-tools,#deal-timeline .deal-inline-task:focus-within .deal-inline-task-tools{opacity:1;transform:translateX(0);pointer-events:auto}#deal-timeline .deal-inline-task-tools button{display:flex;align-items:center;gap:4px;padding:4px 6px;min-height:28px;font:500 10px Montserrat,sans-serif;border:0;background:transparent;color:#506373}#deal-timeline .deal-inline-task-tools [data-inline-task-trash]{color:#ac4146}#deal-timeline .deal-inline-task-tools .ui-icon{width:13px;height:13px}#deal-timeline .deal-task-result-actions{display:flex;gap:6px;align-items:flex-start}#deal-timeline .deal-task-result-actions button{min-height:30px;padding:5px 10px;font-size:11px}@media(hover:none){#deal-timeline .deal-inline-task-tools{position:static;justify-content:flex-end;opacity:1;transform:none;pointer-events:auto;margin-bottom:5px}#deal-timeline .deal-inline-task-tools button{min-height:40px}}@media(prefers-reduced-motion:reduce){#deal-timeline .deal-inline-task-tools{transition:none}}

@media(min-width:1101px){#detail-content.deal-detail-layout{grid-template-columns:minmax(300px,.48fr) minmax(0,1fr);gap:14px}#detail-content.deal-detail-layout .field-grid{grid-template-columns:minmax(0,1fr);padding:4px 14px 12px}#detail-content.deal-detail-layout .field-grid .field{padding:8px 0}#detail-content.deal-detail-layout .deal-contact-grid,#detail-content.deal-detail-layout .deal-company-grid{grid-template-columns:minmax(0,1fr);gap:10px}#detail-content.deal-detail-layout .panel-title{min-height:44px;padding:8px 14px}#detail-content.deal-detail-layout .deal-chat-panel{grid-column:2;grid-row:1 / span 2}}
#deal-timeline .deal-task-result-actions button:not(.primary){border:1px solid #cbd5dd;border-radius:5px;background:#fff;color:#1c3c59;font-family:Montserrat,sans-serif}#deal-timeline .deal-inline-task-tools [data-inline-task-trash] .ui-icon{color:inherit}@media(hover:none){#deal-timeline .deal-task-result-actions button{min-height:40px}}

/* The assistant keeps a generous hit target without a visible button plate. */
.crm-search-assistant,.crm-search-assistant:hover,.crm-search-assistant:active{background:transparent;border-color:transparent;box-shadow:none;padding:0;border-radius:50%}
.crm-search-assistant .ark-assistant-head{display:block;width:34px;height:34px;overflow:visible;pointer-events:none}
.ark-head-eye{transform-box:fill-box;transform-origin:center;animation:ark-assistant-blink 10s linear infinite}
.ark-head-smile{transform-box:fill-box;transform-origin:center;opacity:0;animation:ark-assistant-smile 10s ease-in-out infinite}
@keyframes ark-assistant-blink{0%,90%,94%,100%{transform:scaleY(1)}91%,92%{transform:scaleY(.07)}}
@keyframes ark-assistant-smile{0%,88%,97%,100%{opacity:0;transform:scale(1)}90%,95%{opacity:1;transform:scale(1.07)}}
@media(prefers-reduced-motion:reduce){.ark-head-eye,.ark-head-smile{animation:none}.ark-head-eye{transform:none}.ark-head-smile{opacity:0}}
/* A brief nod draws attention without an always-moving control. */
.crm-search-assistant .ark-assistant-head{transform-origin:50% 55%;animation:ark-assistant-attention 10s ease-in-out infinite}
@keyframes ark-assistant-attention{0%,84%,100%{transform:rotate(0) scale(1);filter:none}88%{transform:rotate(-7deg) scale(1.09);filter:drop-shadow(0 0 1px rgba(30,192,236,.35))}91%{transform:rotate(6deg) scale(1.09);filter:drop-shadow(0 0 1px rgba(30,192,236,.35))}94%{transform:rotate(-3deg) scale(1.06);filter:none}97%{transform:rotate(0) scale(1);filter:none}}
.crm-search-assistant:hover .ark-assistant-head,.crm-search-assistant:focus-visible .ark-assistant-head,.search-wrap:focus-within .ark-assistant-head{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){.crm-search-assistant .ark-assistant-head{animation:none;transform:none;filter:none}}

/* Mail folders precede mailbox accounts and stay recognisable. */
#email-workspace-folders{display:grid;grid-template-columns:minmax(0,1fr);gap:3px;margin-bottom:16px}#email-workspace-folders button{display:flex;align-items:center;gap:9px;min-height:38px;padding:8px 10px;border-radius:8px;text-align:left}#email-workspace-folders button>.ui-icon{width:18px;height:18px;flex:0 0 18px}#email-workspace-folders button>span{flex:1;min-width:0}#email-workspace-folders button>b{min-width:24px;text-align:right}#email-workspace-folders button.active{background:#e8f0f6;color:#173b5d;box-shadow:inset 3px 0 #173b5d}#email-workspace-folders button:nth-child(7){margin-top:9px;border-top:1px solid #e1d8cc}#email-workspace-mailboxes{max-height:280px;overflow-y:auto;overscroll-behavior:contain}#email-workspace-folders button:focus-visible{outline:2px solid #397dae;outline-offset:1px}@media(hover:none){#email-workspace-folders button{min-height:44px}}

/* Department navigation changes panels in place without scrolling. */
#department-section>[data-workspace-inactive="true"]{display:none!important}#department-section{overflow-anchor:none}#department-section>#department-workspace-nav{width:fit-content;max-width:100%;box-sizing:border-box}#department-section>.department-team-panel{max-width:920px}#department-section>.panel[data-workspace-inactive]{max-width:1200px;width:100%;box-sizing:border-box}

#deal-timeline .timeline-entry{position:relative;overflow:hidden}#deal-timeline .timeline-entry-tools{position:absolute;right:0;top:0;display:flex;flex-wrap:wrap;gap:4px;max-width:100%;padding:4px;border:1px solid #ded8cf;border-radius:0 4px 0 5px;background:#f3f1ec;opacity:0;transform:translateX(100%);transition:transform .15s ease,opacity .15s ease;pointer-events:none;z-index:2}#deal-timeline .timeline-entry:hover .timeline-entry-tools,#deal-timeline .timeline-entry:focus-within .timeline-entry-tools{opacity:1;transform:translateX(0);pointer-events:auto}#deal-timeline .timeline-entry-tools button,#deal-timeline .timeline-entry-tools a{position:static;display:inline-flex;align-items:center;min-height:28px;margin:0;padding:4px 6px;border:0;background:transparent;border-radius:4px;font:500 10px Montserrat,sans-serif;color:#506373;text-decoration:none}#deal-timeline .timeline-entry-tools .timeline-delete{color:#ac4146}@media(hover:none){#deal-timeline .timeline-entry-tools{position:static;justify-content:flex-end;opacity:1;transform:none;pointer-events:auto;margin-bottom:6px}#deal-timeline .timeline-entry-tools button,#deal-timeline .timeline-entry-tools a{min-height:40px}}@media(prefers-reduced-motion:reduce){#deal-timeline .timeline-entry-tools{transition:none}}

@media(hover:none){#deal-timeline .timeline-entry{display:flex;flex-direction:column}#deal-timeline .timeline-entry>*{order:2}#deal-timeline .timeline-entry>.timeline-entry-header{order:0}#deal-timeline .timeline-entry>.timeline-entry-tools{order:1;margin-top:6px;margin-bottom:8px}}

/* Compact mail navigation on pointer devices, preserve touch targets. */
@media(hover:hover){#email-workspace-folders{gap:1px;margin-bottom:10px}#email-workspace-folders button{min-height:30px;padding:5px 10px;line-height:1.3}#email-workspace-folders button:nth-child(7){margin-top:5px}.email-navigation .email-navigation-heading{margin-top:9px;margin-bottom:5px}.email-navigation .email-workspace-mailboxes button{padding-top:6px;padding-bottom:6px;line-height:1.3}.email-navigation .email-workspace-mailboxes button small{line-height:1.3}}

.email-thread-message>summary{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;cursor:pointer;padding:12px;list-style-position:inside}.email-thread-message>summary>span{min-width:0;overflow-wrap:anywhere}.email-thread-message>summary small{display:block;margin-top:4px}.email-thread-message>summary time{flex-shrink:0;font-size:11px;color:#667887}.email-thread-message>summary:focus-visible{outline:2px solid #397dae;outline-offset:-2px}.email-thread-message:not([open]){background:#f8f9fa}.email-thread-message[open]>summary{border-bottom:1px solid #e1e7ec}@media(max-width:600px){.email-thread-message>summary{flex-wrap:wrap}}

/* Partner cards share the deal workspace: information and compact cooperation left, chat right. */
.partner-left-workspace .partner-workspace-panel{grid-column:auto;width:100%;min-width:0}
#partner-left-workspace .partner-columns{display:block}
#partner-left-workspace .partner-compact-sections>details{padding:0;border:0;border-top:1px solid var(--crm-line,#e4d9c8)}
#partner-left-workspace .partner-compact-sections>details>summary{padding:11px 14px;font-size:12px;font-weight:700;cursor:pointer}
#partner-left-workspace .partner-compact-sections>details>div{padding:0 12px 12px}
#partner-left-workspace .partner-entry{padding:10px;line-height:1.4;border-radius:7px}
#partner-left-workspace .partner-entry small{line-height:1.4;font-size:11px}
#partner-left-workspace .partner-entry .entry-actions{gap:5px;margin-top:8px}
#partner-left-workspace .partner-actions{display:flex;flex-wrap:wrap;gap:6px;padding:10px 12px}
#partner-left-workspace .partner-actions button{min-height:34px;padding:6px 9px;font-size:11px}
#partner-left-workspace .partner-rating-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:12px}
#partner-left-workspace .partner-rating-summary article{padding:8px;min-width:0}
#partner-left-workspace .partner-rating-summary strong{font-size:20px;line-height:1.25}
#partner-left-workspace .partner-rating-summary small{font-size:10px;line-height:1.4}
#partner-left-workspace .empty{padding:10px;font-size:12px;line-height:1.4}
.partner-detail-page #detail-content.deal-detail-layout>.detail-main-panel{grid-column:1}
@media(min-width:1101px){.partner-detail-page #detail-content.deal-detail-layout{display:grid;grid-template-columns:minmax(300px,.48fr) minmax(0,1fr);gap:14px;align-items:start}.partner-detail-page #partner-left-workspace{grid-column:1;grid-row:2}.partner-detail-page #deal-chat-panel{grid-column:2;grid-row:1/span 2}}
@media(pointer:coarse){#partner-left-workspace .partner-actions button,#partner-left-workspace .partner-compact-sections>details>summary{min-height:44px}}
body[data-crm-appearance=night].partner-detail-page #deal-timeline>.empty,
body[data-crm-appearance=night].partner-detail-page #deal-message-form>label{color:var(--appearance-muted,#DCC4A8)!important}
body[data-crm-appearance=night].partner-detail-page #partner-contacts-list a{color:var(--appearance-ink,#F5F0E8)!important;text-decoration:underline}
.partner-detail-page #detail-main-fields .field{min-height:0;padding:6px 0;display:grid;grid-template-columns:minmax(0,.45fr) minmax(0,.55fr);column-gap:10px;align-items:baseline}
.partner-detail-page #detail-main-fields .field.wide{display:block}
.partner-detail-page #detail-main-fields .field.wide>span{display:none}
.partner-detail-page #detail-main-fields .field>strong{font-size:12px;line-height:1.45}
.partner-detail-page #detail-main-fields .field.wide>strong{font-size:15px}
.partner-detail-page #partner-left-workspace .field{min-height:0;padding:6px 0}
.partner-detail-page #partner-left-workspace .field>strong{font-size:12px;line-height:1.45}
.partner-detail-page #partner-left-workspace .field>span{font-size:11px;line-height:1.4}
#partner-left-workspace :is(.deal-company-title,.deal-contact-card)>button{border:0;background:transparent;padding:0;text-align:left;color:inherit;font:inherit;font-weight:700;text-decoration:underline;white-space:normal;overflow-wrap:anywhere;cursor:pointer}
.partner-contacts-total{font-size:11px;line-height:1.45;padding:0 14px 10px;color:var(--appearance-muted,#586979)}
#partner-left-workspace .partner-contacts-more{margin:0 14px 12px;font-size:12px;min-height:34px}
@media(pointer:coarse){#partner-left-workspace :is(.deal-company-title,.deal-contact-card)>button,#partner-left-workspace .partner-contacts-more{min-height:44px}}

#partner-dialog.smm-editor-dialog #partner-form-fields>.wide{grid-column:1/-1}
#partner-dialog.smm-editor-dialog #partner-form-fields{gap:12px 16px}
#partner-dialog.smm-editor-dialog .smm-editor-options{margin:0}
#partner-dialog.smm-editor-dialog .smm-editor-option-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;padding:12px}
#partner-dialog.smm-editor-dialog .smm-editor-option-fields>.wide{grid-column:1/-1}
#partner-dialog.smm-editor-dialog textarea[name=copyText]{min-height:90px}
@media(max-width:600px){#partner-dialog.smm-editor-dialog .smm-editor-option-fields{grid-template-columns:minmax(0,1fr)}}

/* SMM signal workflow: shared controls and compact expandable content. */
#smm-workspace-panel :is(.smm-trend-filters,.smm-comment-filters){display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px;margin:12px 0;}
#smm-workspace-panel :is(.smm-trend-filters,.smm-comment-filters) label{display:flex;flex-direction:column;gap:5px;min-width:0;flex:1 1 130px;font-size:12px;}
#smm-workspace-panel :is(.smm-trend-filters,.smm-comment-filters) :is(.smm-trend-search,.smm-comment-search){flex:2 1 190px;}
#smm-workspace-panel :is(.smm-trend-filters,.smm-comment-filters) :is(input,select){width:100%;min-width:0;box-sizing:border-box;min-height:var(--ui-control);padding:8px 10px;border:1px solid var(--ui-secondary-border);border-radius:var(--ui-radius);background:#fff;color:var(--ui-primary);font:inherit;font-size:12px;}
#smm-trend-notice{flex:1 1 180px;overflow-wrap:anywhere;}
#smm-trends-list .smm-trend-card{overflow-wrap:anywhere;}
#smm-trends-list .smm-trend-card details{margin-top:8px;}
#smm-trends-list .smm-trend-card details p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.5;margin:10px 12px;}

#smm-trends-list .smm-trend-card a{color:#286699;font-weight:600;text-underline-offset:.2em;}
#smm-trend-filters :is(input,select):focus-visible{outline:2px solid var(--ui-ring);outline-offset:2px;}
body[data-crm-appearance=night] #smm-trends-list .smm-trend-card a{color:#B8D9F1;}

#smm-comments-list .smm-sentiment-control{display:flex;flex-direction:column;gap:5px;min-width:0;font-size:12px;}
#smm-comments-list .entry-actions{align-items:flex-end;}
#smm-comment-filters :is(input,select):focus-visible{outline:2px solid var(--ui-ring);outline-offset:2px;}

/* Source evidence uses the same compact disclosure and readable theme palette. */
.smm-source-details{margin:8px 0;overflow-wrap:anywhere;}
.smm-source-details p{white-space:pre-wrap;margin:10px 12px;font-size:13px;line-height:1.5;}
.smm-source-details a{color:#286699;font-weight:600;text-underline-offset:.2em;}
.smm-source-details>button{margin:0 12px 12px;}
body[data-crm-appearance=night] #smm-content-list .smm-source-details a{color:#B8D9F1;}
.smm-origin-history section+section{margin-top:24px;}
.smm-origin-history .partner-entry p{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.5;}

#smm-comments-list .smm-captured-source{overflow-wrap:anywhere;}
#smm-comments-list .smm-captured-source a{color:#286699;font-weight:600;text-underline-offset:.2em;}
body[data-crm-appearance=night] #smm-comments-list .smm-captured-source a{color:#B8D9F1;}

.smm-audience-history section{margin-top:24px;}
.smm-audience-history [data-audience-summary]>small{display:block;margin-top:6px;}
.smm-audience-history .partner-entry p{line-height:1.5;overflow-wrap:anywhere;}
.smm-audience-history .smm-captured-source a{color:#286699;font-weight:600;text-underline-offset:.2em;}
.smm-audience-history .compact-disclosure{margin:8px 0;}

/* Financial retry notice spans the compact form grid. */
#partner-dialog [data-financial-retry]{grid-column:1/-1;margin:0}

#partner-workspace-panel .partner-financial-recovery{padding:14px var(--ui-edge);border-bottom:1px solid var(--ui-border);min-width:0}
#partner-workspace-panel .partner-financial-recovery h3{font-size:13px;line-height:1.5;margin:0 0 10px}
#partner-workspace-panel .partner-financial-recovery p{font-size:13px;line-height:1.5;margin:0 0 10px}

#partner-dialog .settlement-contract-options{grid-column:1/-1;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
#partner-dialog .settlement-contract-options p{flex:1 1 240px;margin:0}
/* Keep the contract and deal controls equal in height; search uses its own compact row. */
#partner-workspace-form[data-kind="settlement"] #partner-form-fields>label{align-self:start}
#partner-workspace-form[data-kind="settlement"] .record-lookup-field{display:contents}
#partner-workspace-form[data-kind="settlement"] .record-lookup-controls{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 10px;align-items:center}
#partner-workspace-form[data-kind="settlement"] .record-lookup-query{grid-column:1;min-width:0}
#partner-workspace-form[data-kind="settlement"] .record-lookup-controls>button{grid-column:2;grid-row:1}
#partner-workspace-form[data-kind="settlement"] .record-lookup-status{grid-column:1/-1;grid-row:2;margin:0}
@media(max-width:520px){#partner-workspace-form[data-kind="settlement"] .record-lookup-controls{grid-template-columns:minmax(0,1fr)}#partner-workspace-form[data-kind="settlement"] .record-lookup-controls>button{grid-column:1;grid-row:2;justify-self:start}#partner-workspace-form[data-kind="settlement"] .record-lookup-status{grid-row:3}}

/* Partner rating history follows the current widget theme. */
:is(#partner-workspace-panel,#client-rating-panel) .partner-history-status{color:var(--appearance-muted,#647482);font-size:12px;line-height:1.5;overflow-wrap:anywhere;}
#partner-workspace-panel .partner-rating-summary article,#client-rating-panel .partner-rating-summary article{background:var(--appearance-soft,#fffdfb);border-color:var(--appearance-line,var(--line));color:var(--appearance-ink,var(--navy));}
#partner-workspace-panel .partner-rating-summary :is(span,small),#client-rating-panel .partner-rating-summary :is(span,small){color:var(--appearance-muted,var(--muted))!important;}
#partner-workspace-panel .partner-rating-summary strong,#client-rating-panel .partner-rating-summary strong{color:var(--appearance-ink,var(--navy));}
#partner-workspace-panel .partner-rating-summary .zone-red strong,#client-rating-panel .partner-rating-summary .zone-red strong{color:#b82031;}
#partner-workspace-panel .partner-rating-summary .zone-green strong,#client-rating-panel .partner-rating-summary .zone-green strong{color:#008253;}
body[data-crm-appearance=night] :is(#partner-workspace-panel,#client-rating-panel) .partner-rating-summary .zone-red strong{color:#ffa2ac;}
body[data-crm-appearance=night] :is(#partner-workspace-panel,#client-rating-panel) .partner-rating-summary .zone-green strong{color:#29db8a;}

#partner-workspace-panel .partner-entry [data-metric-tone=bad]{color:#b82031!important;font-weight:600;}
#partner-workspace-panel .partner-entry [data-metric-tone=good]{color:#008253!important;font-weight:600;}
#partner-workspace-panel .partner-entry [data-metric-tone=steady]{color:#a94800!important;font-weight:600;}
body[data-crm-appearance=night] #partner-workspace-panel .partner-entry [data-metric-tone=bad]{color:#ffa2ac!important;}
body[data-crm-appearance=night] #partner-workspace-panel .partner-entry [data-metric-tone=good]{color:#29db8a!important;}
body[data-crm-appearance=night] #partner-workspace-panel .partner-entry [data-metric-tone=steady]{color:#ffb74d!important;}

#partner-workspace-form .client-rating-context{grid-column:1/-1;margin:0;line-height:1.5;overflow-wrap:anywhere;}
#partner-workspace-form[data-kind=client-rating] #partner-form-fields>label{align-self:start;}

/* KPI rows contain information and actions, not the three columns of the employee directory. */
#management-workspace-panel :is(#kpi-policies,#kpi-team-policy,#kpi-contexts,#kpi-readiness,#kpi-awards) .tenant-user{grid-template-columns:minmax(0,1fr) auto;gap:12px 16px;min-width:0;align-items:center}
#management-workspace-panel :is(#kpi-policies,#kpi-team-policy,#kpi-contexts,#kpi-readiness,#kpi-awards) .tenant-user>span{min-width:0;max-width:100%;overflow-wrap:anywhere}
#management-workspace-panel :is(#kpi-policies,#kpi-team-policy) .tenant-user>button{display:inline-flex;align-items:center;justify-content:center;width:auto;min-width:0;max-width:100%;min-height:38px;padding:8px 11px;justify-self:end;box-sizing:border-box;white-space:normal;line-height:1.35;font-size:12px;font-weight:700;color:var(--ui-primary,#1c3a57);background:#fff;border:1px solid var(--ui-secondary-border,#cbd9e4);border-radius:8px}
#management-workspace-panel :is(#kpi-contexts,#kpi-readiness,#kpi-awards) .tenant-user>.entry-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:flex-end;justify-self:end;max-width:220px;min-width:0}
#management-workspace-panel .partner-columns>section{container-type:inline-size;container-name:kpi-column}
@container kpi-column (max-width:420px){
 #management-workspace-panel :is(#kpi-policies,#kpi-contexts) .tenant-user{grid-template-columns:minmax(0,1fr)}
 #management-workspace-panel :is(#kpi-policies,#kpi-contexts) .tenant-user>button,#management-workspace-panel #kpi-contexts .tenant-user>.entry-actions{justify-self:start;justify-content:flex-start}
}
@media(max-width:700px){
 #management-workspace-panel :is(#kpi-policies,#kpi-team-policy,#kpi-contexts,#kpi-readiness,#kpi-awards) .tenant-user{grid-template-columns:minmax(0,1fr)}
 #management-workspace-panel :is(#kpi-policies,#kpi-team-policy) .tenant-user>button,#management-workspace-panel :is(#kpi-contexts,#kpi-readiness,#kpi-awards) .tenant-user>.entry-actions{justify-self:start;justify-content:flex-start}
}

#operations-workspace-panel .operations-workspace-intro{margin:16px 18px;line-height:1.6}
#operations-workspace-panel .operations-workspace-columns{grid-template-columns:repeat(3,minmax(0,1fr))}
#operations-workspace-panel .operations-workspace-columns>section{min-width:0;display:flex;flex-direction:column;gap:10px}
#operations-workspace-panel .operations-workspace-columns h3{margin:0;line-height:1.5;overflow-wrap:anywhere}
#operations-workspace-panel .operations-workspace-columns .auth-hint{margin:0;flex:1;line-height:1.6}
#operations-workspace-panel .operations-workspace-actions{padding:0 18px 18px;display:flex;flex-wrap:wrap;gap:8px}
body[data-crm-appearance=night] #operations-workspace-panel :is(h3,.auth-hint){color:var(--appearance-ink)!important}
body[data-crm-appearance=night] #operations-workspace-panel .auth-hint{color:var(--appearance-muted)!important}
@media(max-width:1100px){#operations-workspace-panel .operations-workspace-columns{grid-template-columns:minmax(0,1fr)}}
body[data-crm-appearance=night] #operations-workspace-panel .operations-workspace-columns>section{background:var(--appearance-soft)!important;color:var(--appearance-ink)!important;border-color:var(--appearance-line)!important}

/* Shared native card lookup: direct input, current selection and keyboard suggestions. */
.record-lookup-controls{min-width:0;position:relative}
.record-lookup-query{position:relative}
.record-lookup-suggestions{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:12;grid-column:1/-1;min-width:0;max-height:264px;overflow:auto;border:1px solid #c5d2de;border-radius:9px;background:#fffdfa;box-shadow:0 6px 18px #163b5814}
.record-lookup-suggestions[hidden]{display:none}
.record-lookup-suggestions .record-lookup-option{display:flex;flex-direction:column;align-items:flex-start;gap:4px;width:100%;min-height:48px;margin:0;padding:10px 12px;border:0;border-bottom:1px solid #e3e8ec;border-radius:0;white-space:normal;text-align:left;background:transparent;color:#173b5d}
.record-lookup-option strong,.record-lookup-option span{overflow-wrap:anywhere;text-align:left}
.record-lookup-option span{font-size:12px;color:#536677;font-weight:400}
.record-lookup-option:last-child{border-bottom:0}
.record-lookup-suggestions .record-lookup-option:hover,.record-lookup-suggestions .record-lookup-option[aria-selected="true"]{background:#e7f0f7;color:#173b5d}
.record-lookup-option:focus-visible{outline:2px solid #2b739e;outline-offset:-3px}
body[data-crm-appearance="night"] .record-lookup-suggestions{background:#17364f;border-color:#557188;box-shadow:0 6px 18px #05132240}
body[data-crm-appearance="night"] .record-lookup-suggestions .record-lookup-option{color:#f6f8fb;border-bottom-color:#425e75}
body[data-crm-appearance="night"] .record-lookup-option span{color:#c7d7e4}
body[data-crm-appearance="night"] .record-lookup-suggestions .record-lookup-option:hover,body[data-crm-appearance="night"] .record-lookup-suggestions .record-lookup-option[aria-selected="true"]{background:#2b526e;color:#fff}

/* Record cards have their own toolbar; retain the heading if a page action is visible. */
body.deal-detail-page .content:has(#detail-section:not([hidden]))>.page-heading:not(:has(.page-actions>button:not([hidden]))){display:none!important}

.form-grid>[data-task-schedule]{grid-column:1/-1}
#deal-action-fields:has([data-task-schedule]){grid-template-columns:minmax(0,2fr) minmax(0,1fr);align-items:start}
@media(max-width:680px){#deal-action-fields:has([data-task-schedule]){grid-template-columns:minmax(0,1fr)}}

/* Email deletion stays visible beside archive; trash remains recoverable. */
#email-workspace .email-reader-toolbar button.email-delete { color:#a9382c; border-color:#e7c9c1; background:#fff7f4; }
#email-workspace .email-reader-toolbar button.email-delete:hover:not(:disabled) { background:#fceee9; }
body[data-crm-appearance="night"] #email-workspace .email-reader-toolbar button.email-delete { color:#ffc0ba!important; border-color:#8f6869!important; background:#493c49!important; }
body[data-crm-appearance="night"] #email-workspace .email-reader-toolbar button.email-delete:hover:not(:disabled) { background:#5a4351!important; }

/* Mail uses one compact heading and a bounded workspace, not stacked duplicates. */
.content:has(#list-section:not([hidden]) #email-workspace:not([hidden])) { display:flex; flex-direction:column; height:calc(100dvh - 64px); min-height:0; box-sizing:border-box; padding-block:14px; }
.content:has(#list-section.documents-block-view:not([hidden]),#detail-section[data-resource="documents"]:not([hidden]),#list-section:not([hidden]) #email-workspace:not([hidden]),#department-section:not([hidden]),#scout-section:not([hidden]),#calendar-section:not([hidden]),#list-section[data-resource="calls"]:not([hidden])) > .page-heading { display:flex; flex:0 0 auto; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; margin-bottom:12px; min-height:0; }
.content:has(#list-section.documents-block-view:not([hidden]),#detail-section[data-resource="documents"]:not([hidden]),#list-section:not([hidden]) #email-workspace:not([hidden]),#department-section:not([hidden]),#scout-section:not([hidden]),#calendar-section:not([hidden]),#list-section[data-resource="calls"]:not([hidden])) > .page-heading > div:first-child { min-width:0; flex:1 1 120px; width:auto; }
.content:has(#list-section.documents-block-view:not([hidden]),#detail-section[data-resource="documents"]:not([hidden]),#list-section:not([hidden]) #email-workspace:not([hidden]),#department-section:not([hidden]),#scout-section:not([hidden]),#calendar-section:not([hidden]),#list-section[data-resource="calls"]:not([hidden])) #page-title { font-family:Montserrat,Arial,sans-serif; font-size:24px; line-height:1.25; margin:4px 0; }
.content:has(#list-section.documents-block-view:not([hidden]),#detail-section[data-resource="documents"]:not([hidden]),#list-section:not([hidden]) #email-workspace:not([hidden]),#department-section:not([hidden]),#scout-section:not([hidden]),#calendar-section:not([hidden]),#list-section[data-resource="calls"]:not([hidden])) #page-subtitle { font-size:12px; line-height:1.45; margin:4px 0 0; }
.content:has(#list-section.documents-block-view:not([hidden]),#detail-section[data-resource="documents"]:not([hidden]),#list-section:not([hidden]) #email-workspace:not([hidden]),#department-section:not([hidden]),#scout-section:not([hidden]),#calendar-section:not([hidden]),#list-section[data-resource="calls"]:not([hidden])) #primary-action { flex:none; min-height:44px; margin:0; }
#list-section:not([hidden]):has(#email-workspace:not([hidden])) { flex:1 1 auto; min-height:0; }
#list-section:has(#email-workspace:not([hidden])) > .table-panel { display:flex; flex-direction:column; height:100%; min-height:0; }
#list-section:has(#email-workspace:not([hidden])) > .table-panel > .panel-title { display:none; }
#list-section:has(#email-workspace:not([hidden])) > .table-panel > .list-more:has(>button[hidden]) { display:none; }
#list-section #email-workspace:not([hidden]) { flex:1 1 auto; height:auto; min-height:0; margin:0; }
#email-bulk-actions { flex:none; }
#email-bulk-actions[data-has-selection="false"] :is(.email-toolbar-quick,.email-toolbar-divider,.email-toolbar-more,.email-toolbar-clear,#email-selected-count) { display:none!important; }
#email-bulk-actions[data-has-selection="false"] { min-height:44px; padding:4px 16px; }
#email-bulk-actions .email-select-all-control { min-height:36px; }
@media(max-width:980px) {
 .content:has(#list-section.documents-block-view:not([hidden]),#detail-section[data-resource="documents"]:not([hidden]),#list-section:not([hidden]) #email-workspace:not([hidden]),#department-section:not([hidden]),#scout-section:not([hidden]),#calendar-section:not([hidden]),#list-section[data-resource="calls"]:not([hidden])) > .page-heading { padding:10px 14px; flex-wrap:wrap; gap:8px; }
 .content:has(#list-section.documents-block-view:not([hidden]),#detail-section[data-resource="documents"]:not([hidden]),#list-section:not([hidden]) #email-workspace:not([hidden]),#department-section:not([hidden]),#scout-section:not([hidden]),#calendar-section:not([hidden]),#list-section[data-resource="calls"]:not([hidden])) #page-title { font-size:20px; }
 .content:has(#list-section.documents-block-view:not([hidden]),#detail-section[data-resource="documents"]:not([hidden]),#list-section:not([hidden]) #email-workspace:not([hidden]),#department-section:not([hidden]),#scout-section:not([hidden]),#calendar-section:not([hidden]),#list-section[data-resource="calls"]:not([hidden])) #page-subtitle { display:none; }
 .content:has(#list-section.documents-block-view:not([hidden]),#detail-section[data-resource="documents"]:not([hidden]),#list-section:not([hidden]) #email-workspace:not([hidden]),#department-section:not([hidden]),#scout-section:not([hidden]),#calendar-section:not([hidden]),#list-section[data-resource="calls"]:not([hidden])) #primary-action { padding:8px 12px; }
 #list-section:has(.email-reader.mobile-open) #email-bulk-actions { display:none!important; }
 #email-bulk-actions[data-has-selection="true"] { gap:6px; padding:8px 12px; }
}
@media(max-height:600px) { .content:has(#list-section:not([hidden]) #email-workspace:not([hidden])) { min-height:440px; } }

.content:has(#list-section.documents-block-view:not([hidden]),#detail-section[data-resource="documents"]:not([hidden]),#list-section:not([hidden]) #email-workspace:not([hidden]),#department-section:not([hidden]),#scout-section:not([hidden]),#calendar-section:not([hidden]),#list-section[data-resource="calls"]:not([hidden])) > .page-heading > .page-actions { flex:0 0 auto; width:auto; margin:0; }

/* Compact reader actions and keyboard-safe mobile panels. */
#email-workspace .email-reader-toolbar button.email-reader-step { display:inline-flex; align-items:center; justify-content:center; width:44px; min-width:44px; height:44px; padding:0; }
#email-workspace .email-reader-step .ui-icon { width:18px; height:18px; }
#email-workspace [data-email-reader-action="next"] .ui-icon { transform:rotate(180deg); }
#email-workspace .email-reader-toolbar button[data-email-reader-action="reply"] { background:#173b5d!important; color:#fffdf9!important; border-color:#173b5d!important; }
#email-workspace .email-reader-toolbar button[data-email-reader-action="reply"]:hover:not(:disabled) { background:#214d75!important; }
#email-workspace .email-reader-menu-divider { width:100%; border:0; border-top:1px solid #d6e0e7; margin:4px 0; }
#email-workspace .email-reader-empty [data-email-reader-back] { min-height:44px; padding:8px 12px; border:1px solid var(--ui-secondary-border); border-radius:var(--ui-radius); font:inherit; font-size:12px; font-weight:700; color:var(--ui-primary); background:#fffdf9; }
@media(max-width:980px) {
 #email-workspace .email-navigation { visibility:hidden; }
 #email-workspace.mobile-navigation-open .email-navigation { visibility:visible; }
 #email-workspace .email-reader:not(.mobile-open) { visibility:hidden; }
 #email-workspace:has(.email-reader.mobile-open) .email-message-column { visibility:hidden; }
 #email-workspace.mobile-navigation-open :is(.email-message-column,.email-reader) { visibility:hidden; }
 #email-workspace .email-reader-toolbar { gap:6px; padding:10px 12px; }
 #email-workspace .email-reader-more { margin-left:0; }
}

/* Composer keeps its review controls visible without covering form fields. */
:is(#email-compose-dialog,#partner-dialog,#scout-dialog,#email-mailbox-dialog,#telephony-endpoint-dialog,#api-client-dialog) { padding:0; overflow:hidden; }
#partner-dialog,#scout-dialog,#email-mailbox-dialog,#telephony-endpoint-dialog,#api-client-dialog { max-height:calc(100dvh - 24px); }
:is(#email-compose-form,#partner-workspace-form,#scout-dialog > :where(form),#email-mailbox-form,#telephony-endpoint-form,#api-client-form) { display:flex; flex-direction:column; box-sizing:border-box; max-height:calc(100dvh - 28px); min-height:0; padding:20px 24px; }
:is(#email-compose-form,#partner-workspace-form,#scout-dialog > :where(form),#email-mailbox-form,#telephony-endpoint-form,#api-client-form) > .dialog-heading { flex:none; margin:0 0 14px; }
:is(#email-compose-form,#partner-workspace-form,#scout-dialog > :where(form),#email-mailbox-form,#telephony-endpoint-form,#api-client-form) > :is(.form-grid,.scout-dialog-body) { flex:1 1 auto; min-height:0; overflow:auto; padding:2px 4px 8px 2px; overscroll-behavior:contain; scrollbar-width:thin; }
:is(#email-compose-form,#partner-workspace-form,#scout-dialog > :where(form),#email-mailbox-form,#telephony-endpoint-form,#api-client-form) > .dialog-actions { flex:none; margin-top:12px; padding:14px 0 0; }
:is(#email-compose-form,#partner-workspace-form,#scout-dialog > :where(form),#email-mailbox-form,#telephony-endpoint-form,#api-client-form) > :is(.dialog-help,.auth-error) { flex:none; }
:is(#email-compose-error,#partner-form-error,#email-mailbox-form-error) { max-height:25dvh; overflow:auto; }
#email-compose-dialog #email-compose-draft-status:empty { display:none; }
@media(max-width:600px) { :is(#email-compose-form,#partner-workspace-form,#scout-dialog > :where(form),#email-mailbox-form,#telephony-endpoint-form,#api-client-form) { padding:18px; } }
@media(max-height:600px) { #email-workspace .email-reader-menu { max-height:calc(100dvh - 300px); } }

:is(#email-compose-form,#partner-workspace-form,#scout-dialog > :where(form),#email-mailbox-form,#telephony-endpoint-form,#api-client-form) > :is(.form-grid,.scout-dialog-body) { scroll-padding-block:14px; }
#email-compose-dialog .form-grid :is(input,select,textarea,button) { scroll-margin-block:14px; }

/* Documents use the shared compact heading and one truthful empty state. */
#list-section.documents-block-view .list-more:has(>button[hidden]) { display:none; }
#organization-documents-workspace { padding:16px; }
#organization-documents-workspace .documents-workspace-top { margin-bottom:12px; align-items:center; }
#organization-documents-workspace .documents-view-summary { margin:0; font-size:12px; color:var(--ui-muted); }
#organization-documents-workspace .documents-view-switch button { display:inline-flex; align-items:center; gap:8px; min-height:44px; }
#organization-documents-workspace .documents-view-switch button span { min-width:18px; font-size:11px; }
#organization-documents-workspace .documents-edo-block { padding:12px; gap:12px; margin-bottom:12px; }
#organization-documents-workspace :is(.documents-edo-block,.documents-category) h2 { font-size:14px; line-height:1.5; margin:0; }
#organization-documents-workspace .documents-edo-block button { min-height:44px; }
#organization-documents-workspace .documents-empty-state { display:flex; align-items:flex-start; gap:14px; padding:20px; border:1px dashed var(--ui-secondary-border); border-radius:10px; }
#organization-documents-workspace .documents-empty-state>.ui-icon { flex:none; width:28px; height:28px; margin-top:2px; color:var(--ui-muted); }
#organization-documents-workspace .documents-empty-state h2 { font-size:16px; line-height:1.4; margin:0 0 8px; }
#organization-documents-workspace .documents-empty-state p { margin:0; font-size:12px; line-height:1.6; }
#organization-documents-workspace .documents-empty-state .documents-context-note { margin-top:10px; color:var(--ui-muted); }
#organization-documents-workspace .document-status { flex:none; padding:4px 7px; border-radius:6px; font-size:11px; line-height:1.4; font-style:normal; }
#organization-documents-workspace .document-status-ok { color:#226e49!important; background:#ecf6ef!important; }
#organization-documents-workspace .document-status-work { color:#8a4f16!important; background:#fff3e5!important; }
#organization-documents-workspace .document-status-danger { color:#a9382c!important; background:#fff0ed!important; }
#organization-documents-workspace .document-status-muted { color:#536879!important; background:#edf2f6!important; }
body[data-crm-appearance="night"] #organization-documents-workspace .document-status-ok { color:#b2efd0!important; background:#214e3e!important; }
body[data-crm-appearance="night"] #organization-documents-workspace .document-status-work { color:#ffdaae!important; background:#554531!important; }
body[data-crm-appearance="night"] #organization-documents-workspace .document-status-danger { color:#ffc4bd!important; background:#593c44!important; }
body[data-crm-appearance="night"] #organization-documents-workspace .document-status-muted { color:#e0e8f0!important; background:#334a62!important; }
.edo-preparation-dialog [data-edo-preview-retry] { min-height:44px; padding:8px 12px; border:1px solid var(--ui-secondary-border); border-radius:var(--ui-radius); color:var(--ui-primary); background:#fffdf9; font:inherit; font-size:12px; font-weight:700; }
@media(max-width:600px) {
 #organization-documents-workspace { padding:14px; }
 #organization-documents-workspace .documents-workspace-top { flex-direction:row; }
 #organization-documents-workspace .documents-view-summary { flex-basis:100%; }
 #organization-documents-workspace .documents-edo-block { flex-direction:row; align-items:center; }
 #organization-documents-workspace .documents-edo-block p { display:none; }
 #organization-documents-workspace .documents-empty-state { padding:16px; }
}


/* ЭДО: ограниченная рабочая область; навигация не исчезает при длинном списке. */
.saby-documents-dialog { padding:0; width:min(760px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:hidden; }
.saby-documents-dialog[open] { display:flex; flex-direction:column; }
.saby-documents-head { flex:none; padding:20px 24px 16px; border-bottom:1px solid var(--ui-border); }
.saby-documents-dialog .dialog-heading { margin-bottom:10px; }
.saby-documents-dialog .dialog-heading h2 { margin:0; font-size:22px; line-height:1.25; }
.saby-documents-dialog .eyebrow { margin:0 0 6px; font-size:10px; letter-spacing:.08em; }
.saby-documents-dialog .saby-documents-intro { margin:0; font-size:12px; line-height:1.5; }
.saby-documents-filter { display:flex; align-items:flex-end; gap:10px; margin-top:16px; }
.saby-documents-filter label { flex:1; min-width:0; display:grid; gap:6px; font-size:12px; font-weight:700; }
.saby-documents-dialog .saby-documents-filter select { width:100%; min-height:44px; height:44px; }
.saby-documents-filter button { flex:none; min-height:44px; }
.saby-documents-body { flex:1 1 auto; min-height:100px; max-height:55dvh; overflow:auto; overscroll-behavior:contain; padding:16px 24px; }
.saby-documents-dialog [data-saby-results] { max-height:none; overflow:visible; padding:0; display:grid; gap:12px; }
.saby-documents-dialog [data-saby-status] { margin:0 0 12px; font-size:12px; line-height:1.5; }
.saby-documents-dialog [data-saby-status]:empty { display:none; }
.saby-documents-dialog [data-saby-status][role=alert] { padding:12px; border:1px solid #efc4bd; border-radius:var(--ui-radius); color:#a9382c; background:#fff0ed; }
.saby-documents-dialog [data-saby-retry] { min-height:44px; margin-bottom:14px; }
.saby-documents-dialog .saby-document-entry { display:grid; gap:12px; padding:14px 16px; border:1px solid var(--ui-border); border-radius:var(--ui-radius); background:#fffdf9; }
.saby-document-meta { display:grid; grid-template-columns:1fr 1fr 1.4fr; gap:12px; margin:0; }
.saby-document-meta div { min-width:0; }
.saby-document-meta dt { font-size:11px; color:#667480; margin-bottom:4px; }
.saby-document-meta dd { font-size:12px; font-weight:600; line-height:1.5; margin:0; overflow-wrap:anywhere; }
.saby-documents-dialog .saby-document-open { justify-self:start; min-height:44px; gap:8px; background:#fff; border:1px solid var(--ui-secondary-border); color:var(--ui-primary); }
.saby-document-no-link { margin:0; font-size:12px; color:#667480; }
.saby-documents-empty { display:flex; align-items:flex-start; gap:12px; padding:16px; border:1px dashed var(--ui-secondary-border); border-radius:var(--ui-radius); }
.saby-documents-empty .ui-icon { width:24px; height:24px; flex:none; }
.saby-documents-empty h3 { margin:0 0 6px; font-size:15px; }
.saby-documents-empty p { margin:0; color:#667480; font-size:12px; line-height:1.5; }
.saby-documents-dialog .saby-documents-actions { flex:none; margin:0; padding:14px 24px; border-top:1px solid var(--ui-border); display:flex; flex-wrap:wrap; justify-content:space-between; gap:12px; }
.saby-documents-paging { display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-width:0; }
.saby-documents-paging span { font-size:11px; white-space:nowrap; }
.saby-documents-dialog .saby-documents-actions button { min-height:44px; }
body[data-crm-appearance=night] .saby-documents-dialog [data-saby-status][role=alert] { color:#f6b8ae; background:#4b302d; border-color:#805149; }
@media(max-width:680px) {
 .saby-documents-head { padding:18px 18px 14px; }
 .saby-documents-dialog .dialog-heading h2 { font-size:20px; }
 .saby-documents-filter { gap:8px; }
 .saby-documents-body { padding:14px 18px; }
 .saby-document-meta { grid-template-columns:1fr 1fr; gap:10px; }
 .saby-document-meta div:last-child { grid-column:1/-1; }
 .saby-documents-dialog .saby-document-entry { padding:12px; }
 .saby-documents-dialog .saby-documents-actions { padding:12px 18px; gap:10px; }
 .saby-documents-paging { gap:6px; }
 .saby-documents-paging button { padding-inline:10px; }
}

.saby-documents-dialog .visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* Department and administration navigation reuse the same 44px controls. */
#department-workspace-nav button { min-height:44px; }

/* Scrollable workspace forms retain their review actions and inline lookup options. */
#partner-workspace-form > .dialog-heading > div:first-child { max-height:25dvh; overflow:auto; scrollbar-width:thin; }
#partner-workspace-form > .dialog-heading > div:first-child:focus-visible { outline:3px solid var(--ui-ring); outline-offset:2px; }
:is(#partner-dialog,#record-dialog) .record-lookup-suggestions { position:static; margin-top:4px; max-height:min(264px,30dvh); }
:is(#partner-form-error,#email-compose-error):focus-visible { outline:3px solid var(--ui-ring); outline-offset:2px; }

@media(max-width:600px) { :is(#email-compose-form,#partner-workspace-form,#scout-dialog > :where(form),#email-mailbox-form,#telephony-endpoint-form,#api-client-form) > .form-grid :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select) { min-height:44px; } #partner-form-fields .checkbox-field { min-height:44px; } }

/* PR uses the same review shell as workspace forms and mail. */
#scout-dialog form > #scout-error{flex:none;max-height:25dvh;overflow:auto;overflow-wrap:anywhere;margin:10px 0 0}
#scout-dialog form > #scout-error:empty{display:none}
#scout-dialog .scout-dialog-body{scroll-padding-block:14px}
#scout-dialog .scout-dialog-body :is(input,select,textarea,button){scroll-margin-block:14px}
#scout-dialog #scout-error:focus-visible{outline:3px solid var(--ui-ring);outline-offset:2px}
@media(max-width:600px){#scout-dialog .scout-dialog-body :is(input,select,button){min-height:44px}}

/* Dashboard detail keeps review context and close action outside the scrolling records. */
.dashboard-stage-dialog{padding:0;overflow:hidden;display:none}
.dashboard-stage-dialog[open]{display:flex;flex-direction:column}
.dashboard-stage-dialog>.dialog-heading{flex:none;padding:18px 22px 8px}
.dashboard-stage-dialog>.dashboard-stage-status{flex:none;margin:0;padding:0 22px 12px}
.dashboard-stage-dialog>.dashboard-stage-records{min-height:0;overflow:auto;padding:0 22px 22px;scrollbar-width:thin;grid-auto-rows:max-content;align-content:start}
.dashboard-stage-records>h3{margin:12px 0 4px;font-size:14px;line-height:1.4;color:inherit}
.dashboard-stage-records>.auth-hint{margin:0 0 6px}

/* Contact history has one content scroller; native form submit remains associated with its footer action. */
.contact-notes-dialog{overflow:hidden;display:none}
.contact-notes-dialog[open]{display:flex;flex-direction:column}
.contact-notes-dialog>header{flex:0 0 auto}
.contact-notes-dialog h2{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.contact-notes-dialog>.contact-notes-scroll{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:2px}
.contact-notes-dialog .contact-notes-feed{max-height:none;overflow:visible;grid-auto-rows:max-content;align-content:start}
.contact-notes-dialog>.contact-notes-actions{flex:0 0 auto;min-height:0;max-height:45dvh;overflow:hidden;display:flex;flex-direction:column;align-items:stretch;gap:10px;margin-top:12px;padding-top:12px;border-top:1px solid #e8e0d6}
.contact-notes-dialog>.contact-notes-actions:not(:has(.contact-note-status:not(:empty),.contact-note-recovery:not([hidden]),.contact-note-save:not([hidden]))){display:none}
.contact-notes-dialog>.contact-notes-actions .contact-note-save{align-self:flex-end;flex:0 0 auto}
.contact-notes-dialog .contact-note-feedback{min-height:0;overflow:auto;flex:0 1 auto;scrollbar-width:thin}
.contact-notes-dialog .contact-note-feedback:not(:has(.contact-note-status:not(:empty),.contact-note-recovery:not([hidden]))){display:none}
.contact-notes-dialog .contact-note-recovery{margin-top:0}
body[data-crm-appearance=night] .contact-notes-dialog>.contact-notes-actions{border-color:var(--appearance-line,#48617A)}
@media(max-width:680px){.contact-notes-dialog>.contact-notes-actions .contact-note-save{width:100%}}
@media(max-height:420px){.contact-notes-dialog h2{-webkit-line-clamp:1}.contact-notes-dialog>header{padding-bottom:10px}.contact-notes-dialog>.contact-notes-actions{margin-top:8px;padding-top:8px}}

@media(max-width:700px){#email-mailbox-form>.dialog-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}#email-mailbox-remove{grid-column:1/-1}#email-mailbox-form>.dialog-actions>button{width:100%}}

/* The user header and rows share one grid, at the width of their own panel. */
#department-section #tenant-users-panel{container-type:inline-size;max-width:none;min-width:0}
#tenant-users-panel .tenant-users-columns,#department-section #tenant-users-list .tenant-user{grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr) minmax(0,1fr) minmax(0,1.45fr);column-gap:16px;padding-inline:0}
#tenant-users-panel .tenant-users-columns{margin-inline:16px;text-align:left}
#tenant-users-panel #tenant-users-list{padding-inline:16px;min-width:0}
#tenant-users-list .tenant-user>span,#tenant-users-list .tenant-user-identity>span:last-child{min-width:0;max-width:100%}
#tenant-users-list .tenant-user :is(b,small){overflow-wrap:anywhere;white-space:normal;overflow:visible;text-overflow:clip}
#tenant-users-list .access-tags{justify-content:flex-start}
#tenant-users-list .access-tag{white-space:normal;max-width:100%;box-sizing:border-box}
#department-section #tenant-users-list .tenant-user-actions{flex-wrap:wrap;justify-content:flex-start;gap:8px;min-width:0}
#department-section #tenant-users-list .tenant-user-actions :is(button,select){font-size:12px;min-height:38px;white-space:normal;min-width:0;max-width:100%}
#department-section #tenant-users-list .tenant-user-actions select{flex:1 1 100%;width:100%;height:auto}
@container(max-width:899px){
 #tenant-users-panel .tenant-users-columns{display:none}
 #department-section #tenant-users-list .tenant-user{grid-template-columns:minmax(0,1fr);gap:10px}
 #department-section #tenant-users-list .tenant-user-actions :is(button,select){min-height:44px}
}

/* Call statistics must retain long employee names inside their widget. */
#dashboard-calls-panel :is(.dashboard-call-person,.dashboard-call-statuses){min-width:0;max-width:100%;}
#dashboard-calls-panel :is(.dashboard-call-person b,.dashboard-call-status b){min-width:0;overflow-wrap:anywhere;}
#dashboard-calls-panel .dashboard-call-status{max-width:100%;}
#dashboard-calls-panel .dashboard-call-picker{min-width:0;flex-wrap:wrap;}
#dashboard-calls-panel .dashboard-call-picker select{width:0;max-width:100%;flex:1 1 180px;}

/* The stacked calendar heading must size to its content, not its desktop flex basis. */
@media(max-width:760px){.content .calendar-heading>div:first-child:has(>.brown-line):has(>h2){flex:0 1 auto;}}

/* Queue states keep the shared calendar surfaces and semantic overdue contrast. */
#today-call-queue{padding:0;background:var(--ui-soft);border-color:var(--ui-border)}
#today-call-queue>.panel-title{border-radius:8px 8px 0 0}
#call-queue-coverage{margin:12px 14px;overflow-wrap:anywhere}
#call-queue-data-status{margin:12px 14px}
#today-call-queue-list{padding:0 14px 12px}
#today-call-queue .today-queue-main :is(button,b,small){overflow-wrap:anywhere}
#today-call-queue .today-queue-item.overdue .today-queue-time small{color:var(--ui-danger);font-weight:600}
body[data-crm-appearance=night] #today-call-queue{background:var(--appearance-surface);border-color:var(--appearance-line);color:var(--appearance-ink)}
body[data-crm-appearance=night] #today-call-queue :is(.today-queue-time time,.today-queue-main button,.today-queue-main b){color:var(--appearance-ink)}
body[data-crm-appearance=night] #today-call-queue :is(.today-queue-time small,.today-queue-main small,#call-queue-coverage,.empty){color:var(--appearance-muted)}
body[data-crm-appearance=night] #today-call-queue .today-queue-item.overdue{background:var(--appearance-soft);border-left-color:var(--summary-bad,#ffa2ac)}
body[data-crm-appearance=night] #today-call-queue .today-queue-item.overdue .today-queue-time small{color:var(--summary-bad,#ffa2ac)}
@media(max-width:700px){#calendar-section #today-call-queue :is(button,a){min-height:44px}#today-call-queue-list{padding:0 10px 10px}#call-queue-coverage,#call-queue-data-status{margin:10px}}

/* The adjacent meeting summaries use the same night surface and compact empty state. */
#calendar-section .calendar-work-queue .calendar-meeting-summary .empty{min-height:0;padding:20px 14px}
body[data-crm-appearance=night] #calendar-section .calendar-work-queue .calendar-meeting-summary{background:var(--appearance-surface);border-color:var(--appearance-line);color:var(--appearance-ink)}
body[data-crm-appearance=night] #calendar-section .calendar-work-queue .calendar-meeting-summary>h3{color:var(--appearance-ink)}
body[data-crm-appearance=night] #calendar-section .calendar-work-queue .calendar-meeting-summary .empty{color:var(--appearance-muted)}

/* Scoped recovery notice: align with the current page in both themes. */
#workspace-load-status{margin:16px 0;}
#workspace-load-status button:disabled{opacity:.7;cursor:progress;}
body[data-crm-appearance=night] #workspace-load-status{background:var(--appearance-surface);border-color:#B48C64;color:var(--appearance-ink);}
body[data-crm-appearance=night] #workspace-load-status button{background:var(--appearance-soft);color:var(--appearance-ink);border-color:var(--appearance-line);}
body[data-crm-appearance=night] #workspace-load-status button:hover:not(:disabled){background:var(--appearance-surface);}

/* Global search: plain search follows the same server policy; compact feedback in both themes. */
.search-wrap[hidden]{display:none}
.search-wrap[data-search-mode="plain"] #global-search{padding-right:0}
.global-search-results{max-height:min(520px,calc(100dvh - 100px));background:var(--surface,#fff);color:var(--ink);border-color:var(--line)}
.global-search-results button[data-open-record]{grid-template-columns:82px minmax(0,1fr);min-height:44px;background:transparent;color:var(--ink)}
.global-search-results button[data-open-record] small{color:var(--muted,#785537)}
.global-search-results button[data-open-record]:hover{background:var(--surface-soft,#f2f6f9)}
.global-search-results button:focus-visible{outline:2px solid var(--gold,#b98955);outline-offset:-2px}
.global-search-results :is(.search-caption,.search-help){background:transparent;color:var(--ink);border-color:var(--line)}
.global-search-results .search-caption{padding:8px 12px;overflow-wrap:anywhere}
.global-search-results :is(.search-help span,.search-caption small,button[data-open-record] span){color:var(--muted,#5c6b78)}
body[data-crm-appearance="night"] .global-search-results button[data-open-record] small{color:var(--appearance-muted)}
.global-search-results .search-result-count{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.global-search-results .search-feedback{display:grid;gap:8px;padding:16px 12px;line-height:1.5}
.global-search-results .search-feedback span{white-space:normal;overflow-wrap:anywhere;font-size:13px;color:var(--muted,#5c6b78)}
.global-search-results .search-feedback b{white-space:normal}
.global-search-results .search-feedback button{display:block;width:auto;justify-self:start;min-height:44px;padding:8px 14px;border:1px solid var(--line);border-radius:8px;background:transparent;color:var(--ink);font:inherit;font-weight:700}
body[data-crm-appearance="night"] .global-search-results{background:var(--appearance-surface,#19374f);color:var(--appearance-ink);--ink:var(--appearance-ink);--muted:var(--appearance-muted);--line:var(--appearance-line);--surface-soft:var(--appearance-soft)}
@media(max-width:600px){.global-search-results{position:fixed;left:12px;right:12px;top:var(--global-search-top,68px);max-height:min(520px,calc(100dvh - var(--global-search-top,68px) - 12px))}.global-search-results button[data-open-record]{grid-template-columns:1fr;gap:4px}.global-search-results button[data-open-record] small{grid-row:auto}.global-search-results .search-feedback{padding:12px 8px}.global-search-results button[data-open-record] :is(b,span){white-space:normal;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}}

/* Role availability is independent of a widget's own empty/loading visibility. */
.content .detail-retry{margin:0 0 16px;min-height:44px}
#dashboard-section [data-dashboard-access-hidden="true"],#dashboard-section .dashboard-widget[data-dashboard-access-hidden="true"],#dashboard-section .dashboard-kpi-strip[hidden],#dashboard-section .dashboard-widget-grid[hidden]{display:none!important}

/* Conditional second-line inputs must not stretch their neighboring controls. */
#record-form-fields>label{align-content:start}

/* Composite field buttons need the same sticky-header clearance as inputs. */
#record-dialog #record-form-fields :is(button,[tabindex]){scroll-margin-top:100px;scroll-margin-bottom:100px}

/* Task assignment guidance stays readable beneath compact form labels. */
#record-form [data-task-assignee-note]{font-size:12px;line-height:1.5;font-weight:500}

/* Shared document reference:flat controls inside the existing paper form. */
.document-reference-control{display:grid;gap:12px;min-width:0}
.document-reference-control [data-document-crm]{display:grid;gap:10px;min-width:0}
.document-reference-search{display:flex;align-items:center;gap:8px;min-width:0}
.document-reference-search input{flex:1;min-width:0}
.document-reference-search button{flex:none}
.document-reference-paging{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;line-height:1.5}
.document-reference-status,.document-reference-unavailable,.document-reference-action{overflow-wrap:anywhere;min-width:0}
.document-reference-action{margin-top:6px;display:grid;gap:6px}
.document-reference-action a{display:inline-flex;gap:6px;align-items:center;min-height:38px;padding:8px 11px;border:1px solid var(--ui-secondary-border);border-radius:8px;text-decoration:none;color:var(--ui-primary);background:#fff;font-size:12px;font-weight:700}
.document-reference-control .auth-hint{font-size:12px;line-height:1.5;font-weight:400}
.document-reference-control [hidden]{display:none!important}

.document-reference-control :is(p,.auth-hint){margin:0}
.document-reference-control [data-document-crm]{gap:8px}
.document-reference-control [data-document-full-name]{font-size:12px;font-weight:400;line-height:1.5}
.document-reference-control [data-document-full-name] summary{cursor:pointer;color:var(--ui-primary)}
.document-reference-control [data-document-full-title]{padding-top:6px;overflow-wrap:anywhere}

/* Internal document routing uses the existing paper dialog and semantic statuses. */
.internal-doc-dialog{width:min(1120px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 28px);padding:0;overflow:hidden;color:var(--ink,#193b59);background:var(--paper,#fffcf7)}
.internal-doc-dialog[open]{display:flex;flex-direction:column}
.internal-doc-dialog>.dialog-heading{padding:22px 24px 14px;margin:0;flex:none;border-bottom:1px solid var(--line,#ded4c5)}
.internal-doc-body{overflow:auto;overscroll-behavior:contain;padding:18px 24px;min-height:140px;min-width:0;scroll-padding:16px}
.internal-doc-controls{padding:14px 24px;border-top:1px solid var(--line,#ded4c5);display:flex;gap:8px;flex-wrap:wrap;flex:none;max-height:35dvh;overflow:auto}
.internal-doc-dialog button,.internal-doc-dialog input:not([type=checkbox]),.internal-doc-dialog select{min-height:44px}
.internal-doc-form{display:grid;gap:14px;min-width:0}.internal-doc-form label,.internal-doc-filters label{display:grid;gap:6px;font-weight:650;min-width:0}.internal-doc-form input,.internal-doc-form select,.internal-doc-form textarea,.internal-doc-filters select{width:100%;max-width:100%;box-sizing:border-box}
.internal-doc-grid,.internal-doc-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.internal-doc-form h3,.internal-doc-summary h3{margin:0}.internal-doc-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55}.internal-doc-summary p{margin:8px 0}
.internal-doc-list{display:grid;gap:8px}.internal-doc-row{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr);gap:16px;width:100%;text-align:left;padding:14px;background:transparent;border:1px solid var(--line,#ded4c5);border-radius:10px}
.internal-doc-row>span,.internal-doc-selected{display:grid;align-content:start;gap:7px;min-width:0;overflow-wrap:anywhere}.internal-doc-row small{font-weight:400;line-height:1.4;color:#596a79}
.internal-doc-status{display:inline-block;width:fit-content;font-size:13px;font-weight:650;border-radius:7px;padding:5px 8px;color:#77440f;background:#fff1d9}
.internal-doc-status.completed{color:#186244;background:#e6f5eb}.internal-doc-status.returned,.internal-doc-overdue{color:#9c2f29}.internal-doc-status.returned{background:#fcebe7}.internal-doc-status.cancelled{color:#52616f;background:#edf0f3}
.internal-doc-files{display:grid;gap:10px;margin:12px 0}.internal-doc-files a{display:flex;justify-content:space-between;gap:12px;overflow-wrap:anywhere;padding:10px;border:1px solid var(--line,#ded4c5);border-radius:8px;min-height:44px;align-items:center;box-sizing:border-box}
.internal-doc-files small{flex:none}.internal-doc-history article{border-left:2px solid #c69a64;padding:0 0 14px 14px;margin-top:14px}.internal-doc-history small{display:block;margin-top:5px;color:#596a79}
.internal-doc-paging{display:flex;gap:10px;align-items:center;margin-top:16px}.internal-doc-recovery{padding:14px;background:#fff1d9;border:1px solid #d9b477;border-radius:8px;margin-bottom:16px}.internal-doc-recovery p{margin:8px 0;line-height:1.5}
.internal-doc-form .checkbox-field{display:flex;align-items:flex-start;gap:8px;font-weight:400}.internal-doc-form .checkbox-field input{margin-top:3px;flex:none}.internal-doc-dialog .auth-error{color:#9c2f29}.internal-doc-dialog [hidden]{display:none!important}
@media(max-width:700px){.internal-doc-dialog{width:calc(100vw - 24px)}.internal-doc-dialog>.dialog-heading{padding:16px}.internal-doc-body{padding:14px 16px}.internal-doc-controls{padding:12px 16px}.internal-doc-row,.internal-doc-grid,.internal-doc-filters{grid-template-columns:minmax(0,1fr);gap:10px}.internal-doc-controls button{flex:1 1 130px}.internal-doc-files a{align-items:flex-start;flex-direction:column}.internal-doc-dialog .dialog-actions{flex-wrap:wrap}}

.internal-doc-dialog:is([data-view="send"],[data-view="new-document"],[data-view="action"]){width:min(780px,calc(100vw - 32px))}
.internal-doc-form.form-grid{grid-template-columns:minmax(0,1fr);padding:0;margin:0}
.internal-doc-dialog .internal-doc-filters select{padding:10px 12px;border:1px solid #d6cbbc;border-radius:8px;background:#fff;color:#193b59;font:500 13px/1.4 Montserrat,sans-serif}
.internal-doc-form .checkbox-field input[type=checkbox]{width:18px!important;min-width:18px;max-width:18px;height:18px;min-height:18px;padding:0;margin:2px 0 0;flex:0 0 18px}
.internal-doc-form .checkbox-field span{min-width:0;overflow-wrap:anywhere}
.internal-doc-files a,.internal-doc-files a:visited{color:#173b5d}.internal-doc-files a:hover{background:#eef3f7}
.internal-doc-controls:empty{display:none}
@media(max-width:700px){.internal-doc-dialog:is([data-view="send"],[data-view="new-document"],[data-view="action"]){width:calc(100vw - 24px)}}

.internal-doc-notices:empty{display:none}.internal-doc-notices{display:grid;gap:8px;margin-bottom:16px}.internal-doc-notices h3{margin:0}.internal-doc-notices button{display:grid;gap:5px;text-align:left;padding:12px;background:#fff1d9;border-color:#d9b477;color:#77440f;overflow-wrap:anywhere}.internal-doc-notices span{font-weight:400}
.record-dialog .document-reference-control select{padding-inline-end:44px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}

@media(prefers-reduced-motion:reduce){.internal-doc-dialog,.internal-doc-dialog *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.internal-doc-file-choice{display:flex;gap:12px;justify-content:space-between;align-items:flex-start;min-width:0}.internal-doc-file-choice .checkbox-field{flex:1;min-width:0;min-height:44px}.internal-doc-file-choice a{flex:none;min-height:44px;display:flex;align-items:center;color:#173b5d}

/* Shared existing-record editor keeps fields, recovery and actions reachable. */
.workspace-record-dialog{width:min(820px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 28px);padding:0;overflow:hidden;background:var(--paper,#fffcf7);color:var(--ink,#193b59)}
.workspace-record-dialog[open]{display:flex;flex-direction:column}.workspace-record-dialog>.dialog-heading{padding:20px 24px 16px;margin:0;flex:none;border-bottom:1px solid var(--line,#ded4c5)}
.workspace-record-scroll{overflow:auto;min-height:100px;min-width:0;overscroll-behavior:contain;padding:18px 24px;scroll-padding:16px}
.workspace-record-form.form-grid{margin:0;padding:0}.workspace-record-form>label{align-content:start}.workspace-record-form :is(input,select,textarea){min-width:0;width:100%;box-sizing:border-box}.workspace-record-form input[type=checkbox]{width:18px;height:18px;min-height:18px;flex:none}.workspace-record-form .checkbox-field{align-items:flex-start}
.workspace-record-footer{display:flex;flex-wrap:wrap;gap:8px;padding:14px 24px;flex:none;max-height:35dvh;overflow:auto;border-top:1px solid var(--line,#ded4c5)}
.record-dialog.workspace-record-dialog button,.workspace-record-dialog .workspace-record-form.form-grid :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select){min-height:44px}.workspace-record-dialog [hidden]{display:none!important}.workspace-record-recovery{padding:14px;border:1px solid #d9b477;background:#fff1d9;border-radius:8px}.workspace-record-dialog .auth-error{color:#9c2f29}
.workspace-record-dialog :is(h2,p){overflow-wrap:anywhere}.workspace-record-dialog [data-edit-body]>button{display:block;margin:10px 0;max-width:100%;white-space:normal}
@media(max-width:700px){.workspace-record-dialog{width:calc(100vw - 24px)}.workspace-record-dialog>.dialog-heading{padding:16px}.workspace-record-scroll{padding:14px 16px}.workspace-record-form.form-grid{grid-template-columns:minmax(0,1fr)}.workspace-record-footer{padding:12px 16px}.workspace-record-footer button{flex:1 1 140px}}
@media(prefers-reduced-motion:reduce){.workspace-record-dialog,.workspace-record-dialog *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Shared document/recovery actions must fit the compact heading, including narrow department pages. */
.content > .page-heading > .page-actions { min-width:0; max-width:100%; flex-wrap:wrap; }
.content > .page-heading > .page-actions > button:not([id]) { display:inline-flex; align-items:center; justify-content:center; min-height:44px; max-width:100%; box-sizing:border-box; padding:8px 11px; border:1px solid var(--ui-secondary-border); border-radius:var(--ui-radius); background:#fffdf9; color:var(--ui-primary); font:700 12px/1.4 Montserrat,Arial,sans-serif; white-space:normal; overflow-wrap:anywhere; cursor:pointer; }
.content > .page-heading > .page-actions > button:not([id]):hover:not(:disabled) { background:#edf3f7; border-color:#93adbf; }
.content > .page-heading > .page-actions > button:not([id]):focus-visible { outline:3px solid var(--ui-ring); outline-offset:2px; }
body[data-crm-appearance=night] .content > .page-heading > .page-actions > button:not([id]) { background:#244762; color:#fffdf9; border-color:#879bab; }
body[data-crm-appearance=night] .content > .page-heading > .page-actions > button:not([id]):hover:not(:disabled) { background:#315b7b; }
@media(max-width:980px) {
 .content > .page-heading > .page-actions:has(> [data-internal-documents]:not([hidden])) { flex:1 1 100%!important; width:100%!important; }
}

/* Mail form feedback occupies its own row below the scrolling fields. */
#email-compose-form > .dialog-help { margin:10px 0 0; }

/* The shared read-status component also fits the narrow mail list column. */
.email-collection-status { flex-direction:column; align-items:stretch; margin:12px; gap:10px; }
.email-collection-status button { min-height:44px; }

/* Keep focus scrolling inside the fields, never on the modal shell. */
#email-compose-dialog { overflow:clip; }

/* Attachment actions remain comfortable touch targets in the compact reader. */
@media(max-width:700px){
 .email-attachment-bulk a,.email-attachment-actions a,.email-thread-message footer a { display:inline-flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; padding:10px 12px; box-sizing:border-box; font-size:12px; line-height:1.35; }
}

/* Mail is edited on one sheet; drafts are saved by the existing controller. */
#email-compose-dialog.email-compose-sheet{width:min(1180px,calc(100vw - 48px));max-width:none;height:calc(100dvh - 48px);max-height:none;padding:0;overflow:clip;background:var(--paper);color:var(--ink)}
#email-compose-form{height:100%;max-height:100%;padding:0;min-height:0}
#email-compose-form>.dialog-heading{margin:0;padding:14px 24px;border-bottom:1px solid var(--line);align-items:center;gap:12px}
#email-compose-title{font-size:18px;line-height:1.4;margin:0}
#email-compose-form>.email-compose-page{display:flex;flex-direction:column;gap:0;padding:0 24px 20px;overflow:auto;min-height:0;scroll-padding-block:16px}
#email-compose-form .email-compose-row{display:grid;grid-template-columns:78px minmax(0,1fr);align-items:center;gap:12px;border-bottom:1px solid var(--line);padding:8px 0;margin:0;color:var(--muted);font-size:13px;font-weight:600}
#email-compose-form .email-compose-row :is(input,select){margin:0;min-height:44px;border:0;box-shadow:none;background:transparent;color:var(--ink);padding:10px 12px;font-size:14px;min-width:0;width:100%;border-radius:6px}
#email-compose-form .email-compose-row :is(input,select):focus-visible{outline:2px solid var(--ink);outline-offset:-2px}
#email-compose-form .email-compose-subject{border-bottom:2px solid var(--line);margin-bottom:16px}
#email-compose-form .email-compose-subject input{font-size:18px;font-weight:600;line-height:1.5}
#email-compose-form .email-compose-options{padding:4px 0;border-bottom:1px solid var(--line);flex:none}
#email-compose-form .email-compose-options summary{min-height:44px;display:flex;align-items:center;cursor:pointer;width:fit-content;gap:8px;font-size:13px;font-weight:600;color:var(--ink)}
#email-compose-form .email-compose-options summary::before{content:'›';font-size:20px;line-height:1;transform:rotate(90deg)}
#email-compose-form .email-compose-options[open] summary::before{transform:rotate(-90deg)}
#email-compose-form .email-compose-options-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 20px;padding:8px 0 20px}
#email-compose-form .email-compose-options-fields>.wide{grid-column:1/-1}
#email-compose-form .email-letter-field{display:flex;flex-direction:column;flex:1 0 auto;gap:10px;min-height:0}
#email-compose-form .email-letter-field>label{font-size:13px;font-weight:600;color:var(--muted);margin:0}
#email-compose-form .email-letter-editor{margin:0;border:0;border-radius:0;background:transparent;overflow:visible}
#email-compose-form .email-letter-editor:focus-within{outline:none}
#email-compose-form .email-letter-editor textarea{box-sizing:border-box;min-width:0;padding:14px 12px;font-size:16px;font-weight:400;line-height:1.65;resize:vertical;color:var(--ink)}
#email-compose-form #email-compose-body{min-height:220px;height:28dvh}
#email-compose-form #email-compose-signature{font-size:13px;min-height:200px;height:220px;border-top:1px solid var(--line);color:var(--muted)}
@supports(field-sizing:content){#email-compose-form #email-compose-signature{field-sizing:content;height:auto;min-height:90px;max-height:300px}}
#email-compose-form .email-letter-editor textarea:focus-visible{outline:2px solid var(--ink);outline-offset:-2px}
#email-compose-form #email-signature-help{margin:0 0 16px;font-size:12px;color:var(--muted)}
#email-compose-form .email-compose-file{padding:14px 0 0;border-top:1px solid var(--line);font-size:13px}
#email-compose-form .email-compose-file input{min-height:44px;max-width:100%;font-size:13px}
#email-compose-form .email-compose-file input::file-selector-button{min-height:40px;margin-right:10px}
#email-compose-form #email-compose-attachment-hint{margin:14px 0 0;line-height:1.6;color:var(--muted);font-weight:400}
#email-compose-form>.dialog-help,#email-compose-form>.auth-error{margin:10px 24px 0;flex:none;max-height:22dvh;overflow:auto}
#email-compose-form>.dialog-actions{margin:0;padding:14px 24px;border-top:1px solid var(--line);gap:12px;justify-content:flex-start;flex:none}
#email-compose-cancel{margin-left:auto}
#email-compose-form .dialog-actions button{min-height:44px;min-width:100px}
.email-compose-notice{position:fixed;right:24px;bottom:max(24px,env(safe-area-inset-bottom));z-index:10000;display:flex;gap:16px;align-items:center;max-width:min(540px,calc(100vw - 32px));padding:12px 16px;border:1px solid var(--line);border-left:3px solid #ad6a24;border-radius:10px;background:var(--paper);color:var(--ink);box-shadow:0 8px 32px #0002}
.email-compose-notice[hidden]{display:none}.email-compose-notice p{font-size:13px;line-height:1.6;margin:0;overflow-wrap:anywhere}.email-compose-notice button{flex:0 0 44px;width:44px;height:44px;padding:10px}
body[data-crm-appearance=night] :is(#email-compose-dialog.email-compose-sheet,.email-compose-notice){--paper:var(--appearance-surface);--ink:var(--appearance-ink);--muted:var(--appearance-muted);--line:var(--appearance-line);background:var(--paper)!important;color:var(--ink)}
body[data-crm-appearance=night] #email-compose-title{color:var(--ink)}
body[data-crm-appearance=night] #email-compose-draft-status{color:var(--muted)!important}
body[data-crm-appearance=night] #email-compose-send{background:var(--brown-soft)!important;color:var(--navy)!important;border-color:var(--brown-soft)!important}
body[data-crm-appearance=night] #email-compose-form :is(input,select,textarea){color:var(--ink);background:var(--paper);border-color:var(--line)}
body[data-crm-appearance=night] #email-compose-form :is(input,textarea)::placeholder{color:var(--muted)!important;opacity:1}
@media(max-width:600px){#email-compose-dialog.email-compose-sheet{width:100vw;height:100dvh;max-height:100dvh;max-width:100vw;margin:0;border:0;border-radius:0}#email-compose-form{padding:0;max-height:100dvh}#email-compose-form>.dialog-heading{padding:10px 16px}#email-compose-form>.email-compose-page{padding:0 16px 16px}#email-compose-form .email-compose-row{grid-template-columns:52px minmax(0,1fr);gap:4px}#email-compose-form .email-compose-row :is(input,select){font-size:16px;padding-inline:8px}#email-compose-form .email-compose-options-fields{grid-template-columns:minmax(0,1fr)}#email-compose-form .email-compose-subject input{font-size:17px}#email-compose-form>.dialog-actions{padding:12px 16px calc(12px + env(safe-area-inset-bottom))}#email-compose-form>.dialog-help,#email-compose-form>.auth-error{margin-inline:16px}#email-compose-form #email-compose-body{height:240px;min-height:200px}.email-compose-notice{right:16px;bottom:max(16px,env(safe-area-inset-bottom))}}
@media(prefers-reduced-motion:reduce){#email-compose-dialog *,.email-compose-notice *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

#email-compose-form [data-email-forward-retry]{min-height:44px;margin-top:8px}

#email-compose-form .email-compose-attachment{background:var(--paper);color:var(--ink)}
#email-compose-form .email-compose-attachment b{font-size:13px;font-weight:600;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
#email-compose-form .email-compose-attachment small{font-size:12px;color:var(--muted);font-weight:400}
#email-compose-form .email-compose-attachment button{min-height:44px}

#email-compose-sender-status{margin:0;padding:8px 0;color:var(--muted);font-size:13px;line-height:1.5}#email-compose-sender-status button{min-height:44px;margin:4px 0 0 8px}

.email-compose-close-recovery{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.email-compose-close-recovery button{min-height:44px}

/* Bounded money lists expose complete counts and preserve loaded rows on read failure. */
.money-page-footer{display:grid;gap:8px;padding:12px 0 4px;border-top:1px solid var(--line,#ded4c5)}
.money-page-overview{margin:0 0 8px;color:var(--muted,#617084);font-size:12px;line-height:1.5}
.money-page-count,.money-page-error{margin:0;font-size:12px;line-height:1.5;overflow-wrap:anywhere}.money-page-count{color:var(--muted,#617084)}
.money-page-footer .entry-actions{display:flex;flex-wrap:wrap;gap:8px;margin:0}
#finance-workspace-panel .money-page-footer button,#accounting-workspace-panel .money-page-footer button{min-height:44px;max-width:100%;white-space:normal}
.money-page-items>.partner-entry:focus{outline:2px solid var(--ui-focus,#3976b9);outline-offset:2px}
body[data-crm-appearance=night] .money-page-items>.partner-entry:focus{outline-color:var(--appearance-ink,#f5f0e8)}
@media(max-width:600px){.money-page-footer .entry-actions>button{flex:1 1 140px}}

/* FNS reference controls reuse the CRM control size and theme colours. */
#accounting-official-forms .entry-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
#accounting-official-forms .entry-actions a{display:inline-flex;align-items:center;min-height:var(--ui-control,38px);max-width:100%;padding:4px 0;box-sizing:border-box;color:var(--ui-primary,#173b5d);font-size:12px;font-weight:700;line-height:1.4;text-underline-offset:3px;overflow-wrap:anywhere}
body[data-crm-appearance=night] #accounting-official-forms .entry-actions a{color:var(--appearance-link,#b8d8f0)}

/* Calendar connection actions keep pending and failed states inside the shared dialog. */
#calendar-connect-dialog button{min-height:44px}
#calendar-connect-dialog .calendar-feed-field{min-width:0}
#calendar-connect-dialog #calendar-feed-url{box-sizing:border-box;width:100%;min-width:0;font-size:13px}
#calendar-connect-dialog .calendar-connection-error{color:#9c3025;background:#fff1ed;border-color:#d5a294}
#calendar-connect-dialog .calendar-connection-pending{color:#794306;background:#fff6e8;border-color:#c8ae88}
#calendar-connect-dialog .calendar-connection-success{color:#205f49;background:#edf7f1;border-color:#94b7a5}
#calendar-connect-dialog #calendar-connection-retry{min-height:44px;max-width:100%;white-space:normal}

/* Task completion: a client notice is confirmed in its own record. */
#task-bulk-actions .task-bulk-client-notice{margin:12px 0;padding:14px;border:1px solid #c49a64;border-inline-start:3px solid #b48241;border-radius:8px;background:#fff7ec;color:#654422;min-width:0;overflow-wrap:anywhere;font-size:13px;line-height:1.5}
#task-bulk-actions .task-bulk-client-notice[hidden]{display:none}
#task-bulk-actions .task-bulk-client-notice p{margin:0 0 8px;color:inherit;font-size:inherit;line-height:inherit}
#task-bulk-actions .task-bulk-client-notice ul{max-height:230px;margin:0;padding:0;list-style:none;overflow-y:auto;overscroll-behavior:contain}
#task-bulk-actions .task-bulk-client-notice li+li{margin-top:6px}
#task-bulk-actions .task-bulk-client-notice button{display:block;width:100%;max-width:100%;min-height:44px;height:auto;padding:9px 11px!important;border:1px solid #c49a64!important;border-radius:7px;background:#fff!important;color:#173b5d!important;text-align:left;white-space:normal;overflow-wrap:anywhere;font:inherit;font-weight:700;line-height:1.5}
body[data-crm-appearance=night] #task-bulk-actions .task-bulk-client-notice{background:#382d22;border-color:#b68a52;color:#f5dfc2}
body[data-crm-appearance=night] #task-bulk-actions .task-bulk-client-notice button{background:#243b4f!important;border-color:#b68a52!important;color:#f5f0e8!important}

#task-bulk-actions .task-bulk-review b{white-space:normal;overflow-wrap:anywhere}

#task-bulk-actions>.form-error{font-size:13px;line-height:1.55;white-space:normal;overflow-wrap:anywhere}
#task-bulk-actions>button{min-height:44px;padding:8px 11px!important}
#task-bulk-actions>button+button{margin-inline-start:8px}

/* Fixed task status labels stay whole when column widths shrink or reorder. */
#list-section .table-scroll tr[data-open-record="tasks"]>td.task-status-cell{white-space:nowrap;overflow-wrap:normal;word-break:normal}

/* Reader metadata feedback shares the task notice palette. */
#task-read-feedback{margin:0;padding:12px 16px;border-block:1px solid #d7b989;background:#fff7ec;color:#654422;font-size:13px;line-height:1.55;white-space:normal;overflow-wrap:anywhere}
#task-read-feedback[hidden]{display:none}
#task-read-feedback[data-kind="error"]{border-color:#ddb0aa;background:#fff2f0;color:#982c25}
body[data-crm-appearance="night"] #task-read-feedback{border-color:#96764f;background:#382d22;color:#f5dfc2}
body[data-crm-appearance="night"] #task-read-feedback[data-kind="error"]{border-color:#b77d79;background:#452d2d;color:#ffd2cc}
#task-read-feedback:focus-visible{outline:2px solid currentColor;outline-offset:-3px}

#task-read-new{min-width:44px;min-height:44px}

/* Inline task delivery recovery uses the shared form colours in both themes. */
.inline-task-recovery{border:1px solid var(--line);border-radius:var(--ui-radius-md,10px);padding:12px 14px;background:var(--paper,#fffdf9);color:var(--ink,#173b5d);min-width:0;overflow-wrap:anywhere}
.inline-task-recovery p{margin:6px 0 10px;line-height:1.5}
.inline-task-recovery-actions{display:flex;gap:8px;flex-wrap:wrap}
.inline-task-recovery-actions button{min-height:44px;white-space:normal;text-align:center;padding:8px 12px;border:1px solid var(--ui-secondary-border,#cbd6df);border-radius:var(--ui-radius,8px);background:var(--paper,#fff);color:var(--ink,#173b5d);font:600 12px/1.4 Montserrat,sans-serif;cursor:pointer}.inline-task-recovery-actions button:hover:not(:disabled){background:var(--ui-soft,#f7f3ed)}.inline-task-recovery-actions button:focus-visible{outline:2px solid var(--ui-ring,#84b4d5);outline-offset:2px}.inline-task-recovery-actions button:disabled{cursor:default;opacity:.65}
@media(max-width:600px){.inline-task-recovery{padding:10px}.inline-task-recovery-actions{display:grid;grid-template-columns:1fr}.inline-task-recovery-actions button{width:100%}}

body[data-crm-appearance=night] .inline-task-recovery{background:var(--appearance-surface);color:var(--appearance-ink);border-color:var(--appearance-line)}
body[data-crm-appearance=night] .inline-task-recovery-actions button{background:var(--appearance-soft);color:var(--appearance-ink);border-color:var(--appearance-line)}body[data-crm-appearance=night] .inline-task-recovery-actions button:hover:not(:disabled){background:var(--appearance-surface)}
body[data-crm-appearance=night] #deal-timeline .deal-inline-task{background:var(--appearance-surface);color:var(--appearance-ink);border-color:var(--appearance-line)}
body[data-crm-appearance=night] #deal-timeline .deal-inline-task-heading small{color:var(--appearance-muted)}
body[data-crm-appearance=night] #deal-timeline .deal-inline-task-heading button{color:var(--appearance-ink)}
body[data-crm-appearance=night] #deal-timeline .deal-inline-task textarea{background:var(--appearance-soft);color:var(--appearance-ink);border-color:var(--appearance-line)}

/* An empty file selection does not reserve a form row. Paper dialogs share both palettes. */
.internal-doc-form>[data-document-files]:empty{display:none}

/* AI search uses the existing result panel, with a compact reset action. */
#global-search-results .search-caption{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:8px 12px}
#global-search-results .search-caption>span{flex:1 1 180px;min-width:0;color:inherit;overflow-wrap:anywhere}
#global-search-results .search-caption>small{flex:0 0 100%;text-transform:none;letter-spacing:normal}
#global-search-results button[data-search-new]{display:inline-flex;align-items:center;justify-content:center;width:auto;min-height:44px;padding:8px 12px;border:1px solid currentColor;border-radius:8px;background:transparent;color:inherit;white-space:nowrap}
#global-search-results button[data-search-new]:hover{background:color-mix(in srgb,currentColor 8%,transparent)}
#global-search-results button[data-search-new]:focus-visible{outline:2px solid currentColor;outline-offset:2px}

/* Deleted tasks share the standard CRM dialog and original task data. */
.task-trash-dialog{width:min(800px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto;padding:20px;background:var(--paper,#fffdf9);color:var(--ink,#18354f);border-color:var(--line,#d8c8b5)}
.task-trash-dialog[open]{display:flex;flex-direction:column;overflow:hidden}.task-trash-content{min-height:0;overflow:auto;overscroll-behavior:contain;padding-right:4px}.task-trash-dialog .dialog-heading{flex-shrink:0;align-items:flex-start;gap:16px}.task-trash-dialog h2{overflow-wrap:anywhere}.task-trash-dialog .auth-hint{line-height:1.5}
.task-trash-list,.task-trash-pending{display:grid;gap:12px}.task-trash-row,.task-trash-recovery{display:grid;gap:8px;min-width:0;padding:14px;border:1px solid var(--line,#e4d9c8);border-radius:8px;background:var(--sand,#f5f0e8);overflow-wrap:anywhere}
.task-trash-row p,.task-trash-recovery p{margin:0;line-height:1.5}.task-trash-row small,.task-trash-warning{color:var(--muted,#715c46);line-height:1.5}.task-trash-row>button{justify-self:start;min-height:44px}.task-trash-status{line-height:1.5}.task-trash-dialog .entry-actions{display:flex;flex-wrap:wrap;gap:8px}.task-trash-dialog>.dialog-actions{flex-shrink:0;margin-top:16px;padding:12px 0;background:var(--paper,#fffdf9)}
@media(max-width:480px){.task-trash-dialog{padding:14px}.task-trash-dialog>.dialog-actions{margin-top:12px}.task-trash-dialog .dialog-actions button{flex:1 1 auto;min-height:44px}}

/* Keep task controls compact while the common status retains the full count. */
@media(max-width:700px){
 #list-section[data-resource=tasks] .list-heading-actions{flex-direction:row;align-items:center;justify-content:flex-start;gap:8px}
 #list-section[data-resource=tasks] #task-read-new{width:44px;min-width:44px;padding:0;justify-content:center}
 #list-section[data-resource=tasks] #task-read-new span,#list-section[data-resource=tasks] #list-count{display:none}
 #list-section[data-resource=tasks] #list-column-settings{width:44px;min-width:44px}
 #list-section[data-resource=tasks] #tasks-filter-panel{width:calc(100% - 24px);max-width:calc(100% - 24px);min-width:0}
}
/* In a column, the desktop 220px flex basis must not become select height. */
@media(max-width:700px){
 .content .saved-view-bar>select{flex:0 1 auto;min-height:44px;height:44px;width:100%;max-width:100%}
 #list-section[data-resource=tasks] #tasks-filter-panel select{min-height:44px}
}

/* Constructor uncertain-save recovery, inherited ARKASCALE theme. */
.proposal-constructor-dialog.proposal-recovering{width:min(780px,calc(100vw - 24px));height:fit-content;max-height:calc(100dvh - 24px);grid-template-rows:auto minmax(0,1fr);}
.proposal-constructor-dialog .proposal-recovery{padding:24px;overflow:auto;align-self:start;min-width:0;max-width:100%;box-sizing:border-box;}
.proposal-constructor-dialog .proposal-recovery h3{margin:0 0 12px;}
.proposal-constructor-dialog .proposal-recovery p{max-width:70ch;overflow-wrap:anywhere;line-height:1.55;margin:0 0 20px;}
.proposal-constructor-dialog .proposal-recovery-actions{display:flex;flex-wrap:wrap;gap:10px;}
.proposal-constructor-dialog .proposal-recovery-actions button{min-height:44px;max-width:100%;white-space:normal;text-align:left;}
.proposal-constructor-dialog .proposal-recovery[hidden],.proposal-constructor-dialog iframe[hidden]{display:none!important;}
body[data-crm-appearance=night] .proposal-constructor-dialog.proposal-recovering{--paper:var(--appearance-surface);--ink:var(--appearance-ink);--line:var(--appearance-line);--muted:var(--appearance-muted);background:var(--appearance-surface)!important;color:var(--appearance-ink);border-color:var(--appearance-line);}
body[data-crm-appearance=night] .proposal-recovering :is(h2,h3){color:var(--appearance-ink);}
body[data-crm-appearance=night] .proposal-recovering .proposal-recovery-actions button{background:var(--appearance-soft);color:var(--appearance-ink);border-color:var(--appearance-line);}
@media(max-width:600px){.proposal-constructor-dialog .proposal-recovery{padding:16px;}.proposal-constructor-dialog .proposal-recovery-actions{flex-direction:column;align-items:stretch;}}

/* Confirmed cancellation is status feedback, not a validation failure. */
.auth-error[data-workspace-feedback="notice"]{color:var(--muted,#586979)!important;background:var(--sand,#f5f0e8)!important;border-color:var(--line,#d8c8b5)!important;}

/* Shared department forms use the same night surface/text pairs as their workspace. */
body[data-crm-appearance=night] .workspace-record-dialog{--paper:var(--appearance-surface);--ink:var(--appearance-ink);--muted:var(--appearance-muted);--line:var(--appearance-line);background:var(--appearance-surface)!important;color:var(--appearance-ink)!important;border-color:var(--appearance-line)!important;color-scheme:dark}
body[data-crm-appearance=night] .workspace-record-dialog :is(.dialog-heading,.workspace-record-footer){background:var(--appearance-surface);border-color:var(--appearance-line)}
body[data-crm-appearance=night] .workspace-record-dialog :is(h2,label){color:var(--appearance-ink)}
body[data-crm-appearance=night] .workspace-record-dialog :is(.eyebrow,.dialog-help,small){color:var(--appearance-muted)!important}
body[data-crm-appearance=night] .workspace-record-dialog .workspace-record-form :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){background-color:var(--appearance-soft);color:var(--appearance-ink);border-color:var(--appearance-line)}
body[data-crm-appearance=night] .workspace-record-dialog :is(input,textarea)::placeholder{color:var(--appearance-muted);opacity:1}
body[data-crm-appearance=night] .workspace-record-dialog :is(.dialog-heading>button,.workspace-record-footer button){background:var(--appearance-soft)!important;color:var(--appearance-ink)!important;border-color:var(--appearance-line)!important}
body[data-crm-appearance=night] .workspace-record-dialog .workspace-record-footer button.primary{background:#DCC4A8!important;color:#1C3A57!important;border-color:#DCC4A8!important}
body[data-crm-appearance=night] .workspace-record-dialog :is(input,textarea,select,button):focus-visible{outline-color:#B8D8F0}
body[data-crm-appearance=night] .workspace-record-dialog .auth-error{color:#FFD2CC}
body[data-crm-appearance=night] .workspace-record-dialog .workspace-record-recovery{background:#382D22;color:#F5DFC2;border-color:#B68A52}

body[data-crm-appearance=night] .workspace-record-dialog select:not([multiple]){background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='10' viewBox='0 0 18 10' fill='none'%3E%3Cpath d='m2 2 7 6 7-6' stroke='%23F5F0E8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}

/* Legal/SB headings remain content-sized when the mobile layout becomes a column. */
#legal-workspace-panel .legal-workspace-heading>div:first-child{display:grid;grid-template-columns:3px minmax(0,1fr);align-items:center;gap:10px;flex:0 1 auto}
#legal-workspace-panel .legal-workspace-heading>div:first-child>.brown-line{align-self:center}
#legal-workspace-panel .legal-dd-heading h3{font-family:Montserrat,sans-serif;font-weight:700;line-height:1.4;font-size:18px}

#legal-dd-error,#legal-dd-save-recovery{grid-column:1/-1;min-width:0;overflow-wrap:anywhere}
#legal-dd-save-recovery{color:#543B24;background:#FFF1D9;border-color:#D9B477}
#legal-dd-save-recovery p{color:inherit!important;margin:0 0 10px;font-size:13px;line-height:1.5}
#legal-dd-error:not([hidden]){padding:10px 12px;border:1px solid #B77D79;border-radius:8px;background:#FFF1EF;color:#8D2922}
#legal-dd-error[data-workspace-feedback=notice]:not([hidden]){background:#EAF1F6;color:#1C3A57;border-color:#A8BDCD}
body[data-crm-appearance=night] #legal-dd-save-recovery{background:#382D22;color:#F5DFC2;border-color:#B68A52}
body[data-crm-appearance=night] #legal-dd-save-recovery button{background:#244561!important;color:#F5F0E8!important;border-color:#48617A!important}
body[data-crm-appearance=night] #legal-dd-error:not([hidden]){background:#452D2D;color:#FFD2CC;border-color:#B77D79}
body[data-crm-appearance=night] #legal-dd-error[data-workspace-feedback=notice]:not([hidden]){background:#244561;color:#F5F0E8;border-color:#48617A}

@media(max-width:700px){
 #list-section[data-resource=requests] .table-panel>.panel-title{align-items:center;gap:10px}
 #list-section[data-resource=requests] .table-panel>.panel-title>div:first-child{flex:0 1 auto}
 #list-section[data-resource=requests] .table-panel>.panel-title>.list-heading-actions{flex:1 1 180px;flex-direction:row!important;align-items:center!important;justify-content:flex-end!important;width:auto!important;flex-wrap:wrap;gap:8px}
}

/* Shared contact actions use one consistent touch target in every card. */
.deal-contact-actions .contact-external-action{box-sizing:border-box;min-width:44px;min-height:44px}

/* The mobile label hides its caption; keep the page control readable. */
.library-reading-toolbar .library-bookmark input{box-sizing:border-box;min-height:44px;font:600 12px/1.4 Montserrat,Arial,sans-serif}

/* Keep calendar day targets usable on the narrowest supported viewport. */
.crm-calendar-grid-wrapper{min-width:0}
.calendar-grid-scroll-hint{display:none}
.crm-calendar-grid-area:focus-visible{outline:2px solid var(--navy);outline-offset:2px}
@media(max-width:380px){.crm-calendar-grid-area{overflow-x:auto}.crm-calendar-grid-area>.crm-calendar-weekdays,.crm-calendar-grid-area>.crm-calendar-grid{min-width:308px}.calendar-grid-scroll-hint{display:block;margin:0;padding:8px;font-size:11px;line-height:1.4;color:var(--muted)}}

#list-section[data-resource="calls"] .table-scroll:focus-visible{outline:2px solid var(--appearance-ink,var(--navy));outline-offset:2px}

/* Keep the shared split date/time control at the standard interaction height. */
.record-dialog .form-grid .email-date-time-fields :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden])){min-height:44px}

/* Keep internal document fields at the shared touch size after form-grid rules. */
@media(max-width:700px){.internal-doc-dialog .internal-doc-form :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select),.internal-doc-dialog .internal-doc-filters select{min-height:44px}}

@media(max-width:700px){#record-dialog #record-form-fields :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select){min-height:44px}}

@media(max-width:700px){#calendar-event-dialog #calendar-event-form :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select){min-height:44px}}

/* Shared list-filter geometry includes the surrounding 12px gutters. */
@media(max-width:760px){
 #list-section .deal-filter-panel{width:calc(100% - 24px);max-width:calc(100% - 24px);min-width:0}
 #list-section .deal-filter-panel .saved-view-bar select{flex:0 1 auto}
 #list-section .deal-filter-panel :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select){min-height:44px}
}
