/* V4 sales workspace. Live controls and server permissions are retained. */
.content:has(>.inbox){display:flex;flex-direction:column;min-height:0;height:calc(100dvh - var(--top,46px));padding:14px 16px 16px;overflow:hidden;box-sizing:border-box}
.inbox-page-toolbar{display:flex;align-items:center;gap:12px;margin:0 0 8px;flex:none;min-height:28px}
.inbox-page-toolbar h1{font-size:18px;line-height:24px;margin:0}.inbox-page-toolbar .chat-sync-status{font-size:10px;color:var(--fg-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inbox-page-toolbar>button{margin-left:auto}
.content .inbox{position:relative;flex:1;display:flex;height:auto;min-height:0;border:1px solid var(--line);border-radius:var(--r,8px);background:var(--surface);overflow:hidden}
.inbox .inbox-list{width:300px;min-height:0;max-height:none;background:var(--surface);border-right:1px solid var(--line);flex-shrink:0}
.inbox .inbox-filters{padding:8px;gap:6px;background:var(--surface);border-color:var(--line)}
.inbox .inbox-filters :is(input,select),.inbox #chat-inbox-state{height:30px;min-height:30px;background:var(--surface);color:var(--fg);border:1px solid var(--line-strong);border-radius:var(--r-sm,6px);font-size:12px;padding:4px 8px;min-width:0}
.inbox #chat-inbox-state{margin:0 8px;width:calc(100% - 16px)}
.chat-quick-filters{display:flex;gap:2px;margin:0 8px 6px;padding:2px;border-radius:var(--r-sm,6px);background:var(--surface-3)}
.chat-quick-filters button{flex:1;min-height:26px;height:26px;padding:2px 7px;font-size:11px;border:0;border-radius:4px;background:transparent;color:var(--fg-2)}
.chat-quick-filters button[aria-pressed=true]{background:var(--rail);color:var(--rail-fg-strong)}
.inbox .chat-filter-summary{padding:5px 8px;display:flex;gap:6px;align-items:center;justify-content:space-between;color:var(--fg-3);border-bottom:1px solid var(--line);font-size:10px}
.inbox .chat-filter-summary button{font-size:10px;min-height:22px;padding:0;color:var(--fg-2)}
.inbox #chat-list{min-height:0;overflow:auto;overscroll-behavior:contain}
.inbox .chat-contact{display:flex;align-items:center;gap:8px;padding:8px 10px;min-height:55px;background:var(--surface);color:var(--fg);border:0;border-bottom:1px solid var(--line);border-radius:0;box-shadow:none}
.inbox .chat-contact:hover{background:var(--surface-2)}.inbox .chat-contact.selected{background:var(--accent-soft);box-shadow:inset 2px 0 var(--accent)}
.inbox .chat-avatar{width:28px;height:28px;background:var(--surface-3);color:var(--fg-2);font-size:10px}
.inbox .chat-avatar .channel-badge{width:13px;height:13px;border-width:1px;font-size:7px;right:-2px;bottom:-1px}.inbox .channel-badge svg{width:9px;height:9px}
.inbox .chat-contact-body{overflow:hidden;min-width:0}.inbox .chat-contact-meta{display:flex;justify-content:space-between;gap:6px}.inbox .chat-contact-meta strong{font-size:13px;line-height:18px;color:var(--fg);font-weight:600;min-width:0}
.inbox .chat-contact-meta time{font-size:10px;color:var(--fg-3);flex:none;font-variant-numeric:tabular-nums}.inbox .chat-preview{font-size:12px;line-height:17px;margin:2px 0 0;color:var(--fg-2)}
.inbox .chat-channel-label{display:inline-flex;font-size:9px;line-height:14px;padding:0 4px;margin-right:5px;background:var(--surface-3);color:var(--fg-2);border-radius:4px;vertical-align:1px}
.inbox .chat-unread{position:absolute;right:8px;bottom:5px;background:var(--accent-strong);font-size:9px;padding:0 4px;line-height:15px;min-width:15px;text-align:center;color:var(--rail-fg-strong)}
.inbox .chat-contact.unread .chat-preview{padding-right:18px}.chat-state-badge{color:var(--fg-3);font-size:10px}
.inbox #chat-dialog{min-height:0;min-width:0;position:relative}.inbox .inbox-dialog-head{display:flex;flex-wrap:wrap;align-items:center;padding:8px 12px;gap:6px;border-bottom:1px solid var(--line);background:var(--surface)}
.inbox .chat-head-client{flex:1 1 200px;min-width:120px;gap:8px;display:flex;align-items:center}.inbox .chat-head-client>div{min-width:0}.inbox .chat-head-client strong{font-size:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block;color:var(--fg)}
.inbox .chat-head-route{display:flex;flex-wrap:wrap;gap:3px 6px;line-height:15px;color:var(--fg-2);font-size:10px}.inbox .chat-head-route>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:210px}
.inbox .inbox-dialog-head>.secondary{height:28px;min-height:28px;padding:3px 8px;font-size:11px;margin:0;border-radius:var(--r-sm,6px)}
.inbox .chat-head-agent{order:5;flex-basis:100%;padding:0;justify-self:auto}.inbox .chat-head-agent .chat-agent-bar{justify-content:flex-start;padding:0;gap:8px;border:0;background:none;box-shadow:none;margin:0}
.inbox .inbox-conversation{min-height:0;flex:1}.inbox .inbox-message-column{min-height:0}.inbox .chat-messages{height:auto;min-height:0;max-height:none;flex:1;background:var(--bg);padding:12px 14px;gap:6px;overscroll-behavior:contain}
.inbox .chat-bubble,.crm-deal-record .crm-timeline .chat-bubble{max-width:min(620px,84%);border:1px solid var(--line);background:var(--surface);color:var(--fg);padding:7px 10px 5px;border-radius:10px;border-top-left-radius:3px;line-height:18px;font-size:13px;white-space:pre-wrap}
.inbox .chat-out,.crm-deal-record .crm-timeline .chat-out{background:var(--accent-soft);border-color:var(--accent-line);border-top-left-radius:10px;border-top-right-radius:3px}
.inbox .chat-bubble.chat-ai-message,.crm-deal-record .crm-timeline .chat-bubble.chat-ai-message{background:var(--ai-soft);border-color:var(--ai-line);color:var(--fg);border-left-width:1px}
.inbox .chat-bubble.chat-note,.crm-deal-record .crm-timeline .chat-bubble.chat-note{background:var(--warn-soft);border:1px solid var(--warn-line);align-self:stretch;max-width:720px;color:var(--fg)}
.inbox .chat-bubble.chat-ai-note,.crm-deal-record .crm-timeline .chat-bubble.chat-ai-note{background:var(--ai-soft);border-color:var(--ai-line)}
.chat-note>strong{display:block;font-size:11px;color:var(--warn);margin-bottom:3px}.chat-ai-note>strong{color:var(--ai)}
.chat-bubble .chat-message-author{color:var(--fg-2);font-size:10px;font-weight:600;margin-bottom:3px;gap:3px 8px}.chat-bubble.chat-ai-message .chat-message-author{color:var(--ai)}
.inbox .chat-bubble small,.crm-deal-record .chat-bubble small{font-size:10px;color:var(--fg-2);margin-top:3px;line-height:15px}.chat-bubble.chat-delivery-failed{border-color:var(--bad-line)}.chat-delivery-failed>small{color:var(--bad)!important}
.chat-attachment :is(img,video){max-width:100%;max-height:260px;object-fit:contain;border-radius:var(--r-sm,6px)}.chat-attachment audio{max-width:100%;height:36px}
.inbox .inbox-contact{width:300px;min-width:0;flex-shrink:0;border-left:1px solid var(--line);background:var(--surface);padding:10px 12px;font-size:12px;min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain;box-sizing:border-box}
.inbox .inbox-contact .chat-contact-card{position:static;top:auto;margin:0 0 8px;padding:0 0 8px;background:var(--surface);box-shadow:none;border-color:var(--line)}
.inbox-contact h3{font-size:11px!important;font-weight:600;letter-spacing:.02em;color:var(--fg-2);margin:12px 0 6px!important}.inbox-contact :is(p,small){color:var(--fg-2)}
.chat-contact-card .contact-card-top{display:flex;align-items:center;justify-content:space-between;gap:6px}.chat-contact-card .contact-card-top small{font-size:10px;color:var(--fg-3);letter-spacing:.04em}.chat-contact-card .contact-card-top .back-link{color:var(--fg-2);font-size:11px;min-height:24px}
.contact-identity{display:flex;align-items:center;gap:8px;margin:4px 0 10px}.contact-identity .contact-initials{width:36px;height:36px;flex-shrink:0;border-radius:50%;background:var(--accent-soft);color:var(--accent-ink);font-size:13px;font-weight:600;display:grid;place-items:center}
.chat-contact-card .contact-identity h2,.inbox-contact .chat-contact-card h2{font-size:15px;line-height:20px;margin:0;overflow-wrap:anywhere;color:var(--fg)}
.contact-field{display:grid;grid-template-columns:90px minmax(0,1fr);gap:8px;align-items:start;margin:5px 0;font-size:12px;line-height:18px}.contact-field>span{color:var(--fg-2)}.contact-field>div{color:var(--fg);overflow-wrap:anywhere}.contact-mono{font-family:var(--mono);font-size:11px}
.contact-field .contact-copy{display:inline-flex;vertical-align:middle;align-items:center;justify-content:center;width:22px;height:22px;min-height:22px;padding:0;margin-left:4px;border:0;border-radius:4px;background:transparent;color:var(--fg-2);font-size:15px;cursor:pointer}.contact-copy:hover{background:var(--surface-3)}
.chat-contact-card .contact-channel-actions{display:flex;flex-wrap:wrap;gap:4px;margin:8px 0}.chat-contact-card .contact-action{display:inline-flex;flex-direction:row;gap:4px;width:auto;min-height:26px;height:26px;padding:3px 6px;border:1px solid var(--line);border-radius:var(--r-sm);background:var(--surface);font-size:10px;color:var(--fg-2)}.chat-contact-card .contact-action svg{width:13px;height:13px}
.contact-vehicle{border-top:1px solid var(--line);padding-top:8px;margin-top:8px}.contact-vehicle>small{font-size:10px;color:var(--fg-2);letter-spacing:.04em}.chat-task{border-color:var(--line)}
.inbox .compact-compose #chat-compose.chat-composer,.crm-deal-record .compact-compose #chat-compose.chat-composer{display:flex;flex-direction:column;gap:4px;margin:0;padding:8px 12px;border-top:1px solid var(--line);background:var(--surface);max-height:42dvh;overflow:auto;border-radius:0}
.crm-deal-record .compact-compose{background:var(--surface);padding:0;border:0}
.compact-compose .compose-routing{display:flex;align-items:center;gap:6px;flex-wrap:wrap;position:relative;min-height:28px}
.inbox .compact-compose .compose-routing select,.crm-deal-record .compact-compose .compose-routing select{width:auto;min-width:0;flex:1 1 140px;max-width:280px;height:28px;font-size:11px;border:1px solid var(--line-strong);border-radius:var(--r-sm);background:var(--surface);color:var(--fg);padding:3px 6px}
.compact-compose .compose-routing [data-compose-mode]{background:var(--surface-3)!important;border-color:var(--surface-3)!important}
.compact-compose .compose-status{position:relative;margin-left:auto;font-size:10px;color:var(--fg-2)}.compact-compose .compose-status>summary{cursor:pointer;display:flex;gap:4px;align-items:center;padding:3px}.compact-compose .compose-state-dot{width:5px;height:5px;border-radius:50%;background:var(--ok)}
.compact-compose .chat-dialog-actions{position:absolute;bottom:100%;right:0;z-index:12;display:flex;flex-direction:column;align-items:stretch;gap:4px;min-width:165px;background:var(--surface);padding:8px!important;border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow-pop)}
.compact-compose .compose-status:not([open])>.chat-dialog-actions{display:none!important}.compact-compose .compose-status .chat-dialog-actions button{white-space:nowrap;font-size:11px;min-height:28px!important;text-align:left;border:0;background:var(--surface-2);color:var(--fg)}
.compact-compose .compose-info{position:relative;color:var(--fg-3);font-size:11px}.compact-compose .compose-info>summary{cursor:pointer;width:20px;list-style:none;text-align:center}.compact-compose .compose-info>div{position:absolute;right:0;bottom:25px;width:250px;max-width:80vw;background:var(--surface);color:var(--fg-2);border:1px solid var(--line);border-radius:var(--r);padding:10px;box-shadow:var(--shadow-pop);z-index:15}.compose-author{font-size:10px;line-height:16px;color:var(--fg-2)}.compose-author strong{color:var(--fg);font-weight:600}
.compact-compose .compose-hint{margin:0!important;font-size:10px!important;color:var(--fg-3)!important;line-height:14px}.compact-compose .compose-hint:empty{display:none}
.inbox .compact-compose #chat-compose textarea,.crm-deal-record .compact-compose #chat-compose textarea{flex:none;width:100%;height:38px;min-height:38px;max-height:120px;resize:none;padding:7px 9px;font:inherit;font-size:12px;line-height:18px;background:var(--surface);color:var(--fg);border:1px solid var(--line-strong);border-radius:var(--r);box-sizing:border-box}
.compact-compose #chat-compose.is-note textarea{background:var(--warn-soft);border-color:var(--warn-line)}
.inbox .compact-compose #chat-compose .compose-tools,.crm-deal-record .compact-compose #chat-compose .compose-tools{display:flex;align-items:center;gap:3px;flex-wrap:wrap}
.inbox .compact-compose #chat-compose .compose-tools button,.crm-deal-record .compact-compose #chat-compose .compose-tools button{height:28px!important;min-height:28px!important;padding:3px 6px!important;border-radius:var(--r-sm)!important;font-size:11px!important}
.compact-compose .compose-tools :is([data-attach],[data-mic],[data-templates],[data-emoji]){background:transparent;color:var(--fg-2);border:0}.compact-compose .compose-tools svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.6}
.compact-compose .compose-tools [data-compose-suggest]{background:transparent;border:0;color:var(--ai)}.compact-compose .compose-tools [data-send]{margin-left:auto}.compact-compose [data-compose-attachment]:empty,.compact-compose .error:empty{display:none}
.compact-compose [data-compose-popup]{border-color:var(--line);background:var(--surface);color:var(--fg)}.compose-file{background:var(--surface-2);border-color:var(--line)}
.chat-agent-bar{background:var(--surface-2);color:var(--fg-2);border-color:var(--line)}.ai-toolbar-status b{color:var(--ai);font-size:11px}.ai-toolbar-status small{font-size:10px;color:var(--fg-2)}.ai-toolbar-actions{display:flex;flex-wrap:wrap;gap:4px}.chat-agent-bar button{font-size:11px!important;min-height:26px!important;height:26px!important;padding:3px 7px!important}
.chat-agent-bar .ai-suggest{color:var(--ai);border-color:var(--ai-line);background:var(--ai-soft)}.chat-agent-bar .ai-takeover{color:var(--fg-2)}
.chat-ai-draft{border:1px dashed var(--ai-line);background:var(--ai-soft);color:var(--fg);margin:4px 8px;border-radius:var(--r);max-height:180px;overflow:auto}.chat-ai-draft>summary{padding:6px 9px;font-size:11px;color:var(--ai)}.chat-ai-draft .chat-ai-text{padding:0 9px;font-size:12px;white-space:pre-wrap}.chat-ai-draft .field-help{color:var(--fg-2)}
/* Board and list retain the same search, pagination and workflow actions. */
.content:has(>.deal-search-shell){padding:14px 16px 16px}
.crm-board-toolbar.deal-search-toolbar{gap:8px;background:transparent;border:0;padding:0;margin:0 0 12px;border-radius:0;align-items:center}
.deal-search-toolbar h1{font-size:20px;line-height:28px;margin:0 4px 0 0}.deal-search-toolbar [data-pipeline]{font-size:13px!important;max-width:200px!important;background:var(--surface)!important;border:1px solid var(--line-strong)!important;border-radius:var(--r-sm);color:var(--fg)}
.deal-search-toolbar .deal-view-switch{gap:0;border:1px solid var(--line-strong);border-radius:var(--r-sm);background:var(--surface);overflow:hidden}.deal-view-switch button{font-size:12px!important;border-radius:0!important;color:var(--fg-2)}.deal-view-switch button[aria-pressed=true]{background:var(--rail);color:var(--rail-fg-strong)}
.deal-search-toolbar .deal-filters{flex:1 1 100%;order:2;min-width:0;display:flex;gap:8px}.deal-search-toolbar .deal-filters input[name=q]{min-width:80px;max-width:650px;flex:1;background:var(--surface);color:var(--fg);border:1px solid var(--line-strong);height:32px}
.deal-search-toolbar .deal-search-chip{background:var(--surface);color:var(--fg);border-color:var(--line-strong);max-width:220px;text-overflow:ellipsis;overflow:hidden}.deal-search-toolbar>.primary{margin-left:auto}
.deal-search-total{color:var(--fg-2);font-size:11px}.deal-search-panel:not([hidden]){background:var(--surface);border-color:var(--line);box-shadow:var(--shadow-pop);width:min(800px,100%);max-height:75dvh}
.deal-search-panel nav{border-color:var(--line)}.deal-search-panel nav button{background:var(--surface);color:var(--fg-2);border-color:var(--line);padding:12px 8px}.deal-search-panel nav button:hover{background:var(--accent-soft);color:var(--accent-ink)}
.deal-search-panel :is(input,select){background:var(--surface);color:var(--fg);border-color:var(--line-strong)}.deal-search-panel h3,.deal-search-fields label{color:var(--fg-2)}.deal-active-filters button{background:var(--accent-soft);color:var(--accent-ink);border-color:var(--accent-line)}
.content .crm-kanban{gap:8px;min-height:calc(100dvh - 190px);align-items:stretch;padding-bottom:8px}.crm-kanban .crm-lane{flex:0 0 236px;border-radius:var(--r);padding:0;background:var(--surface-3);overflow:hidden;border:0}
.crm-kanban .crm-lane>header{border-top:3px solid var(--lane-color,var(--line-strong));border-bottom:0;padding:9px 10px 8px;gap:5px;background:var(--surface-3);font-size:12px;min-height:38px}.crm-lane>header strong{color:var(--fg)}.crm-kanban .crm-lane>header span{background:var(--surface);color:var(--fg-2);border-radius:10px;padding:0 5px;font-size:10px}
.crm-kanban .crm-lane-cards{padding:0 6px 5px}.crm-kanban .crm-deal-card{padding:7px 8px;margin:0 0 6px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-sm);min-height:80px;box-shadow:none;color:var(--fg)}
.crm-kanban .crm-deal-card.needs-reply{background:var(--surface);border-color:var(--line);box-shadow:none}.crm-kanban .crm-deal-card:hover{border-color:var(--accent-line);background:var(--surface-2)}
.crm-kanban .crm-card-top{display:flex;gap:6px;align-items:center;min-width:0}.crm-kanban .crm-card-client{font-size:13px;font-weight:600;line-height:18px}.crm-kanban .crm-card-amount{font-size:10px;color:var(--fg-2);white-space:nowrap}.crm-kanban .crm-card-request{font-size:12px;line-height:18px;margin:2px 0;color:var(--fg-2)}
.crm-kanban .crm-card-number{font-size:11px;font-weight:600;color:var(--fg-2)}.crm-kanban .crm-card-created{font-size:9px;color:var(--fg-3)}
.crm-kanban .crm-deal-card footer{border:0;padding:2px 0 0;display:flex;align-items:center;gap:4px;justify-content:space-between;font-size:10px;min-width:0}.crm-kanban .crm-card-context{color:var(--fg-2)!important;font-size:10px;line-height:16px;min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-kanban .crm-card-next{color:var(--fg-3)!important;font-size:10px}
.crm-kanban .crm-deal-card .reply-indicator,.deal-waiting-badge{display:inline-flex;align-items:center;gap:4px;background:var(--bad-soft);color:var(--bad);border:0;border-radius:10px;font-size:10px;font-weight:600;line-height:16px;padding:0 5px;white-space:nowrap;margin:0}.reply-indicator:before{width:4px;height:4px;background:var(--bad)}.crm-lane-empty{color:var(--fg-3);font-size:11px}
.deal-list-view{border:1px solid var(--line);background:var(--surface);border-radius:var(--r);overflow:auto}.deal-list-view td,.deal-list-view th{padding:7px 10px;font-size:12px;border-color:var(--line);background:var(--surface);color:var(--fg)}.deal-list-view th{background:var(--surface-2);color:var(--fg-2);font-size:10px}.deal-list-view [data-table-deal]{border:0;background:transparent;color:var(--info);padding:0;font-size:12px;line-height:18px;min-height:24px}
.deal-loss-cell{min-width:220px;max-width:420px}.deal-pagination{color:var(--fg-3);font-size:11px}.crm-board-nav{background:var(--surface);border-color:var(--line)}
/* Deal is a single full-height record, with a light compact card on the left. */
.workspace-main>.content:has(.crm-deal-record){padding:14px 16px 16px!important;background:var(--bg)}
.content .crm-deal-record{grid-template-columns:340px minmax(0,1fr);border:1px solid var(--line);border-radius:var(--r);overflow:hidden;background:var(--surface)}
.crm-deal-record>.crm-record-card{border-right:1px solid var(--line);background:var(--surface)}
.content .crm-record-header.section-head{padding:10px 12px 12px;background:var(--surface);color:var(--fg);gap:9px;border-bottom:1px solid var(--line)}.content .crm-record-header h1{font-size:18px;line-height:24px;color:var(--fg)}
.crm-record-header [data-back]{color:var(--fg-2);font-size:11px}.crm-record-header .crm-detail-title{font-size:12px;color:var(--fg);font-weight:600;margin:5px 0}.crm-record-created{display:block;color:var(--fg-3);font-size:10px;line-height:16px;margin-top:3px}.crm-record-header .deal-waiting-badge{margin:3px 0 0 4px}
.crm-record-menu>summary{color:var(--fg-2)}.crm-record-menu>div{background:var(--surface);border-color:var(--line);box-shadow:var(--shadow-pop)}.crm-record-menu .crm-deal-permalink{color:var(--info)}
.crm-record-header .deal-stage-picker summary,.crm-record-header .deal-stage-picker summary strong{background:transparent;color:var(--fg)}.crm-record-header .deal-stage-picker summary small{color:var(--fg-2)}.crm-record-header .deal-stage-picker summary{padding-bottom:5px}.crm-record-header .deal-stage-picker summary strong{font-size:12px}
.crm-record-header .crm-stage-stripe{height:7px;gap:3px}.crm-record-header .crm-stage-stripe span{height:7px;background:var(--line)!important;opacity:1;outline:none;border-radius:2px}.crm-record-header .crm-stage-stripe span.done{background:var(--accent-line)!important}.crm-record-header .crm-stage-stripe span.current{background:var(--accent)!important;outline:none}
.crm-record-header .deal-stage-options{background:var(--surface);border-color:var(--line);box-shadow:var(--shadow-pop)}.crm-record-header .deal-stage-options button{background:var(--surface);color:var(--fg)}.crm-record-header .deal-stage-options button[aria-pressed=true]{background:var(--accent-soft);color:var(--accent-ink)}.crm-record-header .deal-stage-picker .error{color:var(--bad)}
.crm-record-header .crm-detail-amount{display:grid;grid-template-columns:100px minmax(0,1fr);gap:6px 8px;align-items:center}.crm-record-header .crm-detail-amount>small{display:block;color:var(--fg-2);font-size:12px}.crm-record-header .crm-detail-amount>strong{color:var(--fg);font-size:14px;line-height:20px}
.crm-record-header .deal-header-owner{grid-column:1/-1;color:var(--fg-2);font-size:12px}.crm-record-header .deal-header-owner select{color:var(--fg);background:var(--surface);border-color:var(--line-strong)}.crm-record-header .deal-header-owner option{background:var(--surface);color:var(--fg)}
.crm-deal-record .crm-detail-tabs{padding:0 8px;background:var(--surface);border-bottom:1px solid var(--line)}.crm-deal-record .crm-detail-tabs button{font-size:11px;color:var(--fg-2);min-height:32px;padding:6px}.crm-deal-record .crm-detail-tabs button[aria-selected=true]{color:var(--accent-ink);background:var(--accent-soft);border-bottom-color:var(--accent)}
.crm-deal-record .crm-detail-main{padding:10px 12px;background:var(--surface)}.crm-deal-record .deal-form label{color:var(--fg-2)}.crm-deal-record .deal-form :is(input,select,textarea){background:var(--surface);color:var(--fg);border-color:var(--line-strong)}.crm-deal-record .deal-form :is(small,.field-help){color:var(--fg-3)}
.crm-deal-record .crm-order-section,.crm-other-deals{background:var(--surface);padding:12px!important;border-color:var(--line)}.chat-deal-link{background:var(--surface);color:var(--fg);border-color:var(--line)}.chat-deal-link small{color:var(--fg-2)}
.crm-deal-record>.crm-deal-conversation{background:var(--surface)}.crm-deal-record .crm-timeline-head{min-height:46px;background:var(--surface);border-color:var(--line);color:var(--fg)}.crm-deal-record .crm-timeline-head small{color:var(--fg-3)}.crm-deal-record .crm-timeline-head select{background:var(--surface);color:var(--fg);border-color:var(--line-strong)}
.crm-deal-record .crm-timeline{background:var(--bg);padding:12px 14px;gap:6px}.crm-deal-record .crm-call-event{background:var(--surface);color:var(--fg);border-color:var(--line);border-left-color:var(--info);font-size:12px;padding:6px 9px}.crm-call-event small{color:var(--fg-3)}
.crm-deal-record .crm-system-event.deal-system-event{color:var(--fg-2);font-size:11px;padding:3px 6px}.deal-system-event header,.deal-system-event header strong{color:var(--fg-2)}.deal-event-field{color:var(--fg-2)}.deal-event-before{color:var(--fg-3)}.deal-event-after{color:var(--fg)}.deal-event-after.deal-event-stage{background:var(--ok-soft);color:var(--ok)}
.crm-deal-record .crm-timeline .crm-system-event.deal-system-event.deal-ai-comment{background:var(--ai-soft);border:1px solid var(--ai-line);border-left:3px solid var(--ai);color:var(--fg);padding:7px 10px;margin:3px 0;box-shadow:none;max-width:720px}.crm-deal-record .deal-ai-comment header strong{color:var(--ai)}.deal-ai-note-label{font-size:10px;font-weight:600;color:var(--ai);margin:3px 0}
.crm-deal-record [data-history-info]{color:var(--fg-3);background:var(--surface)}.crm-deal-record .crm-record-mobile{background:var(--surface);color:var(--fg);border-color:var(--line)}
.customer-card .customer-summary,.customer-card .customer-columns section,.customer-car,.customer-order,.customer-task{background:var(--surface);border-color:var(--line);color:var(--fg)}.customer-card .customer-summary{border-radius:var(--r)}.customer-card h2{font-size:14px}.customer-card :is(small,.muted,.field-help){color:var(--fg-2)}.customer-card .customer-columns{gap:12px}.customer-order{padding:7px 8px;min-height:38px}.customer-card .customer-columns section{padding:12px}.customer-card .contact-field{grid-template-columns:90px minmax(0,1fr)}
.chat-back-list{display:none!important}
@media(max-width:1240px){.inbox .inbox-list{width:260px}.inbox .inbox-contact{position:absolute;right:0;top:0;bottom:0;width:300px;max-width:100%;z-index:20;background:var(--surface);box-shadow:var(--shadow-pop)}.inbox .inbox-contact[hidden]{display:none!important}.inbox .inbox-contact:not([hidden]){display:block}.content .crm-deal-record{grid-template-columns:300px minmax(0,1fr)}}
@media(max-width:860px){.content:has(>.inbox){padding:8px;height:calc(100dvh - var(--top,46px))}.inbox-page-toolbar .chat-sync-status{max-width:50vw}.content .inbox{flex-direction:row}.inbox .inbox-list{width:100%;max-height:none;display:flex}.inbox #chat-dialog{display:none;min-height:0}.inbox.thread-open .inbox-list{display:none}.inbox.thread-open #chat-dialog{display:flex}.chat-back-list{display:inline-flex!important}.inbox .inbox-dialog-head{padding:7px 8px}.inbox .chat-messages{padding:10px;max-height:none}.inbox .chat-head-client{flex-basis:140px}.content .crm-deal-record{grid-template-columns:minmax(0,1fr);grid-template-rows:36px minmax(0,1fr)}.crm-deal-record>.crm-record-card{display:none;grid-row:2}.crm-deal-record>.crm-deal-conversation{grid-row:2}.crm-deal-record.record-card-open>.crm-record-card{display:block}.crm-deal-record.record-card-open>.crm-deal-conversation{display:none}.crm-deal-record .crm-record-mobile{display:flex}.workspace-main>.content:has(.crm-deal-record){padding:8px!important}.deal-search-toolbar h1{font-size:18px}.deal-search-toolbar .deal-search-total{display:none}.deal-search-toolbar .deal-filters{gap:5px}.deal-search-toolbar .deal-filters input[name=q]{width:100px}.crm-kanban .crm-lane{flex-basis:230px}}
@media(max-width:720px){.content:has(>.inbox){height:calc(100dvh - var(--top,46px) - 60px)}.inbox-page-toolbar{margin-bottom:5px}.inbox-page-toolbar h1{font-size:16px}.inbox .chat-head-route>span:last-child{max-width:150px}.inbox .chat-head-agent .chat-agent-bar{flex-wrap:wrap}.inbox .chat-head-agent .ai-toolbar-status{display:none}.inbox .compact-compose #chat-compose.chat-composer,.crm-deal-record .compact-compose #chat-compose.chat-composer{padding:6px 8px;max-height:46dvh}.compact-compose .compose-routing select{max-width:47%!important;flex-basis:100px!important}.compose-author{font-size:9px}.compact-compose .compose-tools [data-compose-suggest]{font-size:10px!important}.inbox .chat-bubble,.crm-deal-record .crm-timeline .chat-bubble{max-width:92%}.deal-search-toolbar .deal-filters{flex-wrap:wrap}.deal-search-toolbar .deal-filters input[name=q]{order:3;flex-basis:100%;max-width:none}.deal-search-toolbar [data-loss-view]{padding:4px 7px}.deal-search-panel:not([hidden]){max-height:65dvh}.contact-field{grid-template-columns:85px minmax(0,1fr)}.workspace:has(#chat-compose:focus-within) .sidebar{display:none!important}.workspace:has(#chat-compose:focus-within) .topbar{display:none!important}.workspace:has(#chat-compose:focus-within)>.workspace-main{margin:0!important}.content:has(>.inbox:focus-within){min-height:0}}

.inbox-contact .contact-close{display:none}
@media(max-width:1240px){.inbox-contact .contact-close{display:block;margin:0 0 10px auto;height:28px;min-height:28px;font-size:11px}}
/* Override the prior full-width/stacked inbox rules and their fixed blue palette. */
.workspace-main>.content:has(>.inbox){height:calc(100dvh - var(--top,46px));padding:14px 16px 16px!important;overflow:hidden}
.content:has(>.inbox)>.schedule-toolbar{height:28px;min-height:28px;margin:0 0 8px;padding:0;background:transparent;border:0}
.content>.inbox{flex-direction:row;overflow:hidden;min-height:0;border:1px solid var(--line);border-radius:var(--r)}
.inbox .inbox-list{height:auto;max-height:none;min-width:0}.inbox .inbox-conversation{flex-direction:row}.inbox .inbox-message-column{min-width:0;min-height:0}.inbox .inbox-contact{order:0;border-right:0;border-top:0;border-left:1px solid var(--line);max-height:none}
.inbox .chat-head-agent{max-width:none;width:100%;order:5}.inbox .chat-agent-bar b{color:var(--ai)}.inbox .chat-agent-bar small{color:var(--fg-2)}
.inbox .chat-contact-card,.crm-deal-record .chat-contact-card{background:var(--surface);border-color:var(--line)}.inbox .inbox-contact .contact-copy{padding:0;min-height:22px;height:22px;font-size:15px;border:0}.inbox .inbox-contact .back-link{color:var(--fg-2)}
.inbox .chat-bubble.chat-out{background:var(--accent-soft);color:var(--fg);border-color:var(--accent-line)}.inbox .chat-bubble.chat-ai-message{background:var(--ai-soft);border-color:var(--ai-line);color:var(--fg)}.inbox .chat-bubble.chat-note,.crm-deal-record .chat-bubble.chat-note{background:var(--warn-soft)!important;color:var(--fg)}.inbox .chat-bubble.chat-ai-note,.crm-deal-record .chat-bubble.chat-ai-note{background:var(--ai-soft)!important}
.inbox .compact-compose #chat-compose.chat-composer{padding:8px 12px;gap:4px;box-shadow:none;max-height:42dvh;border-top:1px solid var(--line);background:var(--surface)}
.inbox .compact-compose #chat-compose.chat-composer textarea{height:38px;min-height:38px;max-height:120px;padding:7px 9px;border:1px solid var(--line-strong);background:var(--surface);color:var(--fg);font-size:12px;border-radius:var(--r)}
.inbox .compact-compose #chat-compose.chat-composer.is-note,.crm-deal-record .compact-compose #chat-compose.chat-composer.is-note{background:var(--surface)!important}.inbox .compact-compose #chat-compose.is-note textarea{background:var(--warn-soft)}
.inbox .compact-compose #chat-compose .compose-tools [data-send]{background:var(--accent-strong);color:var(--rail-fg-strong);margin-left:auto;padding:3px 10px!important}.inbox .compact-compose #chat-compose .compose-tools [data-send]:hover{background:var(--accent-hover)}
.inbox .compact-compose #chat-compose .compose-tools [data-compose-suggest],.crm-deal-record .compact-compose #chat-compose .compose-tools button[data-compose-suggest]{width:auto;max-width:none;white-space:nowrap;color:var(--ai);background:transparent;flex:none;padding:3px 6px!important}
.inbox .compact-compose .compose-routing{flex-direction:row;justify-content:flex-start}.inbox .compact-compose .compose-tools :is([data-attach],[data-mic],[data-templates],[data-emoji]){color:var(--fg-2)}
.inbox .chat-agent-panel,.crm-deal-record .crm-deal-conversation [data-chat-agent],.crm-deal-record .crm-deal-conversation [data-agent-toolbar]{background:var(--surface);border-color:var(--line)}
.crm-deal-record .chat-agent-bar.ai-toolbar{background:var(--surface-2);border-color:var(--line)}.crm-deal-record .chat-agent-bar .ai-toolbar-status b{color:var(--ai)}.crm-deal-record .chat-agent-bar .ai-toolbar-status small{color:var(--fg-2)}
.crm-deal-record .crm-deal-conversation .chat-ai-draft{background:var(--ai-soft);border-color:var(--ai-line)}.crm-deal-record .crm-deal-conversation .chat-ai-draft summary{background:var(--ai-soft);color:var(--ai)}
@media(max-width:860px){.workspace-main>.content:has(>.inbox){height:calc(100dvh - var(--top,46px));padding:8px!important}.content>.inbox{flex-direction:row;flex:1;min-height:0;overflow:hidden}.inbox .inbox-list{width:100%;height:auto;max-height:none;min-width:0}.inbox .inbox-conversation{flex-direction:row}.inbox .inbox-contact{width:300px;max-height:none;order:0}.inbox .inbox-message-column{min-height:0}.inbox .chat-messages{min-height:0;max-height:none}.inbox .compact-compose #chat-compose.chat-composer{max-height:42dvh}.inbox .compact-compose .compose-routing select{width:auto}}
/* Keep all secondary tools readable when the shared theme changes. */
.inbox .chat-head-agent .ai-toolbar .ai-mode-switch,.crm-deal-record .crm-deal-conversation .ai-toolbar .ai-mode-switch{background:var(--surface);color:var(--fg-2);border-color:var(--line-strong)}
.inbox .chat-head-agent .ai-toolbar .ai-suggest,.crm-deal-record .crm-deal-conversation .ai-toolbar .ai-suggest{background:var(--ai-soft);color:var(--ai);border-color:var(--ai-line)}
.inbox .chat-head-agent .ai-toolbar .ai-takeover,.crm-deal-record .crm-deal-conversation .ai-toolbar .ai-takeover{background:transparent;color:var(--fg-2);border-color:transparent}
.compact-compose .chat-composer [data-compose-popup]{background:var(--surface);color:var(--fg);border-color:var(--line)}.compact-compose .compose-template{border-color:var(--line)}.compact-compose .compose-template button{color:var(--fg)}.compact-compose .compose-template small{color:var(--fg-2)}
.inbox .compact-compose #chat-compose textarea:focus,.crm-deal-record .compact-compose #chat-compose textarea:focus{background:var(--surface);color:var(--fg);outline:2px solid var(--accent);outline-offset:1px;border-color:var(--accent)}
.inbox .compact-compose #chat-compose.is-note textarea:focus,.crm-deal-record .compact-compose #chat-compose.is-note textarea:focus{background:var(--warn-soft)}

/* Transcription is a private reading aid, never an outgoing message. */
.chat-voice-transcript{margin-top:8px;padding:9px 11px;border:1px solid var(--border,#dce2e7);border-radius:8px;background:var(--surface-2,#f4f6f8);font-size:12px;max-width:100%;}
.chat-voice-transcript summary{font-weight:600;cursor:pointer;font-size:11px;color:var(--text-secondary,#69798a);}
.chat-voice-transcript p{margin:7px 0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.5;}
.chat-voice-transcript small{display:block;margin-top:5px;white-space:normal;}
.chat-voice-transcript button{font-size:12px;white-space:normal;text-align:left;}
.chat-voice-error:empty{display:none;}
[data-theme="dark"] .chat-voice-transcript{background:#202b38;border-color:#394655;color:#e4e9f0;}
[data-theme="dark"] .chat-voice-transcript summary{color:#b5c0cf;}
/* Independent left response and right task indicators. */
.crm-deal-card.needs-reply{border-left:4px solid var(--bad,#d94358)!important}
.crm-deal-card.task-future{border-right:4px solid var(--ai,#8057cf)!important}
.crm-deal-card.task-today{border-right:4px solid var(--ok,#259b61)!important}
.crm-deal-card.task-overdue{border-right:4px solid var(--bad,#d94358)!important}
.task-indicator{display:block;font-size:10px;text-align:right;margin-top:4px;color:var(--ai)}
.task-today .task-indicator{color:var(--ok)}.task-overdue .task-indicator{color:var(--bad)}
.task-filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}.task-filters input{flex:1;min-width:180px}
.task-planner{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px;align-items:start}
.task-column{min-width:0;background:var(--surface-2);border-radius:8px;padding:10px;border-top:3px solid var(--ai)}.task-column.task-today{border-color:var(--ok)}.task-column.task-overdue{border-color:var(--bad)}
.crm-task{display:grid;gap:5px;padding:10px;margin:8px 0;border:1px solid var(--line);border-left:3px solid var(--ai);border-radius:6px;background:var(--surface);font-size:12px}.crm-task.task-today{border-left-color:var(--ok)}.crm-task.task-overdue{border-left-color:var(--bad)}.crm-task small{color:var(--fg-3)}.crm-task>div{display:flex;flex-wrap:wrap;gap:6px}.crm-task button{min-height:26px;font-size:11px;padding:3px 6px}
.deal-task-panel{flex:none;max-height:220px;overflow:auto;background:var(--surface);border-bottom:1px solid var(--line);padding:8px 12px}.deal-task-panel>header{display:flex;align-items:center;gap:8px}.deal-task-panel>header strong{margin-right:auto}.deal-task-panel>small{color:var(--fg-3)}

.contact-inline-form{display:grid;gap:10px;min-width:0}.contact-inline-form label{display:grid;gap:4px;font-size:12px;color:var(--text-muted,#737987)}.contact-inline-form input{width:100%;min-width:0;box-sizing:border-box}.contact-inline-actions{display:flex;gap:8px;flex-wrap:wrap}.contact-inline-form .error:empty{display:none}
/* Composer menus use the browser top layer, outside scroll clipping. */
.compact-compose .compose-floating-panel[popover]{position:fixed!important;inset:auto!important;margin:0!important;max-height:calc(100dvh - 32px);overflow:auto;box-sizing:border-box;z-index:1000}
.compact-compose .compose-floating-panel[popover]:not(:popover-open){display:none!important}
.compact-compose .compose-floating-panel[popover]:popover-open{left:var(--menu-left,8px)!important;top:var(--menu-top,8px)!important}
/* Keep both task actions aligned despite shared back-link margins. */
.deal-task-panel>header{min-height:32px;align-items:center;gap:8px}
.deal-task-panel>header>strong{margin-block:0;line-height:32px}
.deal-task-panel>header>button{display:inline-flex;align-items:center;justify-content:center;align-self:center;height:32px;min-height:32px;margin:0!important;padding:5px 10px!important;line-height:20px;font-size:12px;box-sizing:border-box;white-space:nowrap}
.deal-task-panel>header>[data-planner]{border:1px solid var(--line-strong);border-radius:6px;background:var(--surface);color:var(--fg-2)}
.deal-task-panel>header>[data-planner]:hover{background:var(--surface-3);color:var(--fg)}
.deal-task-panel>small{display:block;margin-top:6px;line-height:18px}
.vehicle-full-data{margin:16px 0}.vehicle-full-data>div{display:grid;grid-template-columns:minmax(130px,1fr) 2fr;gap:12px;padding:8px 0;border-bottom:1px solid var(--line)}.vehicle-full-data dt{color:var(--fg-2)}.vehicle-full-data dd{margin:0;overflow-wrap:anywhere;color:var(--fg)}

/* Focused deal card: one request, one vehicle, tools above the conversation. */
.content .deal-focused .crm-record-header{gap:10px;padding:10px 12px}
.deal-focused .crm-record-header>div:first-child{padding-right:24px}
.content .deal-focused .crm-record-header h1{font-size:12px;line-height:20px;font-weight:500;color:var(--fg-2);letter-spacing:0}
.deal-focused .crm-record-header [data-back]{margin-bottom:4px!important}
.deal-focused .crm-record-menu{top:18px}
.deal-focused .crm-record-menu .crm-record-created{margin:0;padding:4px 5px;white-space:normal;color:var(--fg-3)}
.deal-focused .deal-request-label{display:block;margin:4px 0 0}
.deal-focused .deal-request-label input{display:block;width:100%;box-sizing:border-box;height:30px!important;min-height:30px!important;max-height:30px!important;margin:0;padding:3px 0!important;border:0!important;border-bottom:1px solid transparent!important;border-radius:0!important;background:transparent!important;color:var(--fg);font:600 16px/22px var(--font)!important;white-space:nowrap;text-overflow:ellipsis;box-shadow:none!important;cursor:text}
.deal-focused .deal-request-label input:hover:not(:disabled){border-bottom-color:var(--line-strong)!important}
.deal-focused .deal-request-label input:focus{border-bottom-color:var(--accent)!important;outline:none!important;text-overflow:clip}
.deal-focused .deal-request-label input:disabled{opacity:1;cursor:default}
.deal-focused .crm-detail-amount.deal-no-estimate>small,.deal-focused .crm-detail-amount.deal-no-estimate>strong{display:none}
.deal-focused .crm-record-header .crm-stage-stripe,.deal-focused .crm-record-header .crm-stage-stripe span{height:4px}
.deal-focused .crm-record-header .deal-stage-picker summary small{font-size:10px}
.deal-focused .crm-record-header .deal-header-owner{grid-template-columns:90px minmax(0,1fr);font-size:11px}
.deal-focused .crm-record-header .crm-deal-actions{gap:5px;flex-wrap:wrap}
.deal-focused .crm-record-header .crm-deal-actions button{padding:5px 7px!important}
.deal-focused .crm-detail-main{padding:12px}
.deal-focused .deal-contact-card{border:0;border-radius:0;padding:0 0 12px;margin:0 0 12px;border-bottom:1px solid var(--line);box-shadow:none}
.deal-focused .deal-contact-card .contact-card-top{margin-bottom:4px}
.deal-focused .deal-contact-card .contact-card-top>small{font-size:11px;font-weight:600;letter-spacing:0;color:var(--fg-2)}
.deal-focused .deal-contact-card .contact-identity{margin:3px 0 6px;gap:9px}
.deal-focused .deal-contact-card .contact-initials{width:32px;height:32px;font-size:12px}
.deal-focused .deal-contact-card .contact-name-terms{gap:4px 6px}
.deal-focused .deal-contact-card .contact-field{grid-template-columns:70px minmax(0,1fr);margin:4px 0;font-size:12px}
.deal-focused .deal-contact-card .contact-channel-actions{margin:7px 0 0}
.deal-focused .deal-contact-card .contact-terms-badge{font-size:10px;line-height:18px;padding:2px 7px}
.deal-focused .deal-form{gap:12px}
.deal-focused .deal-vehicle-editor{display:grid;gap:6px;min-width:0}
.deal-focused .deal-vehicle-editor>label{font-size:11px;font-weight:600}
.deal-focused .deal-vehicle-controls{display:flex;align-items:center;gap:5px;min-width:0}
.deal-focused .deal-vehicle-controls select{flex:1;min-width:0;width:0}
.deal-focused .deal-vehicle-controls .deal-add-vehicle{display:grid;place-items:center;flex:0 0 30px;width:30px;height:30px;min-height:30px;padding:0;margin:0!important;font-size:20px;font-weight:400}
.deal-focused .deal-form .vin-vehicle-info{font-family:var(--mono);font-size:10px;line-height:16px;overflow-wrap:anywhere;color:var(--fg-3)}
.deal-focused .deal-form .deal-vehicle-details{justify-self:start;min-height:26px;padding:3px 7px;font-size:11px;color:var(--fg-2);background:var(--surface-2);border-color:var(--line)}
.deal-focused .deal-notes{border-top:1px solid var(--line);padding-top:10px}
.deal-focused .deal-notes>summary{cursor:pointer;color:var(--fg-2);font-size:12px;line-height:20px;font-weight:500;overflow-wrap:anywhere}
.deal-focused .deal-notes>summary::marker{color:var(--fg-3)}
.deal-focused .deal-note-preview{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:3px 0 0;font-size:11px;line-height:16px;font-weight:400;color:var(--fg-3);white-space:pre-wrap}
.deal-focused .deal-note-preview:empty,.deal-focused .deal-notes[open] .deal-note-preview{display:none}
.deal-focused .deal-notes[open]>label{margin-top:7px}
.deal-focused .deal-notes textarea{width:100%;min-height:74px;resize:vertical;box-sizing:border-box}
.deal-focused .deal-form>button.primary{justify-self:start;min-height:30px;font-size:11px}

.deal-focused .crm-timeline-head{display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:8px 12px 6px;min-height:0;flex:none}
.deal-focused .crm-conversation-tools{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 12px;min-width:0}
.deal-focused .crm-conversation-tools [data-agent-toolbar]{min-width:0;padding:0;border:0}
.deal-focused .crm-conversation-tools .chat-agent-bar.ai-toolbar{min-height:28px;margin:0;padding:0;border:0;border-radius:0;background:transparent;gap:8px;flex-wrap:wrap;justify-content:flex-start}
.deal-focused .crm-conversation-tools .ai-toolbar-status{display:flex;flex-direction:column;align-items:flex-start;gap:0;min-width:0}
.deal-focused .crm-conversation-tools .ai-toolbar-status b{font-size:11px;white-space:nowrap}
.deal-focused .crm-conversation-tools .ai-toolbar-status small{font-size:9px;line-height:12px;margin:0;max-width:160px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.deal-focused .crm-conversation-tools .ai-toolbar-actions{gap:4px;flex-wrap:wrap}
.deal-focused .crm-conversation-tools button{height:28px!important;min-height:28px!important;padding:4px 7px!important;font-size:11px!important;border-radius:6px!important;white-space:nowrap}
.deal-focused [data-deal-task-tools]{margin-left:auto}
.deal-focused .deal-task-tools{display:flex;align-items:center;flex-wrap:wrap;gap:5px}
.deal-focused .deal-task-toggle[aria-expanded=true]{border-color:var(--accent-line);background:var(--accent-soft);color:var(--accent-ink)}
.deal-focused .deal-task-overdue{display:inline-block;padding:1px 5px;margin-left:3px;border-radius:4px;background:var(--bad-soft);color:var(--bad);font-size:10px}
.deal-focused .crm-conversation-caption{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.deal-focused .crm-conversation-caption>strong{font-size:11px;font-weight:500;color:var(--fg-2)}
.deal-focused .crm-conversation-caption>select{max-width:200px;height:24px;min-height:24px;margin:0;padding:2px 5px;font-size:10px;border-color:transparent;background:transparent}
.deal-focused .deal-task-panel{max-height:min(190px,25dvh);padding:6px 12px;background:var(--surface-2)}
.deal-focused .deal-task-panel[hidden]{display:none}
.deal-focused .deal-task-panel>header{min-height:24px;justify-content:flex-end}
.deal-focused .deal-task-panel>header>[data-planner]{height:24px;min-height:24px;padding:2px 7px!important;font-size:11px}
.deal-focused .deal-task-panel .crm-task{padding:7px 9px;gap:3px;margin:5px 0}
.deal-focused .deal-task-panel .crm-task [data-task-open]{display:none}
.deal-focused [data-vin-status]:empty{display:none}
.deal-focused [data-vin-status]{margin:0;padding:3px 12px;font-size:10px;line-height:16px}
.deal-focused [data-chat-agent]:empty{display:none}
.deal-focused .crm-deal-conversation .chat-ai-draft{margin:4px 0;padding:0;border-style:solid}
.deal-focused .crm-deal-conversation .chat-ai-draft>summary{padding:4px 8px;font-size:10px}
@media(max-width:1100px){.deal-focused .crm-conversation-tools{gap:6px}.deal-focused .crm-conversation-tools .ai-toolbar-status small{max-width:110px}.deal-focused .crm-conversation-tools .ai-toolbar-actions{gap:2px}}
@media(max-width:860px){.deal-focused .crm-timeline-head{padding:7px 8px}.deal-focused .crm-conversation-tools button{min-height:30px!important}.deal-focused .crm-conversation-tools .chat-agent-bar.ai-toolbar{gap:5px}.deal-focused .crm-conversation-caption>select{max-width:165px}}

/* Paired controls must share the same border-box height despite global button rules. */
.deal-focused .deal-vehicle-controls :is(select,button){height:32px!important;min-height:32px!important;max-height:32px!important;box-sizing:border-box!important;margin:0!important;border-radius:6px!important;line-height:20px!important}
.deal-focused .deal-vehicle-controls .deal-add-vehicle{width:32px!important;flex-basis:32px!important;padding:0!important}
.deal-focused .crm-record-header .crm-deal-actions button{height:32px!important;min-height:32px!important;max-height:32px!important;box-sizing:border-box!important;line-height:20px!important;margin:0!important}

/* Keep call conclusions and close action available while reading long calls. */
.cash-dialog.transcript-dialog>.dialog-top{position:sticky;top:0;z-index:5;pointer-events:none}
.cash-dialog.transcript-dialog>.dialog-top .close{pointer-events:auto;box-shadow:0 0 0 5px var(--surface,#fff)}
.transcript-dialog .transcript-analysis{position:sticky;top:40px;max-height:calc(92dvh - 100px);overflow-y:auto;overscroll-behavior:contain;box-sizing:border-box;scrollbar-width:thin}
@media(max-width:760px){.transcript-dialog .transcript-analysis{position:static;max-height:none;overflow:visible}}

/* Persistent controls within the transcript dialog scroll container. */
body dialog.cash-dialog.transcript-dialog{overflow-y:auto;scroll-padding-top:110px}
body dialog.cash-dialog.transcript-dialog>.dialog-top{position:sticky;top:0;z-index:20;pointer-events:none}
body dialog.cash-dialog.transcript-dialog>.dialog-top .close{pointer-events:auto;background:var(--surface-3,#f0f1f4);box-shadow:0 0 0 6px var(--surface,#fff)}
.transcript-dialog .transcript-layout{align-items:start;overflow:visible}
.transcript-dialog .transcript-conversation{overflow:visible}
.transcript-dialog .transcript-translation-toolbar{position:sticky;top:40px;z-index:10;background:#f5f6f9;padding:10px 0;margin-top:-10px;box-shadow:0 -12px 0 #f5f6f9,0 8px 0 #f5f6f9;flex-shrink:0}
.transcript-dialog .transcript-analysis{position:sticky;top:40px;align-self:start;max-height:calc(92dvh - 110px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;background:var(--surface,#fff)}
@media(max-width:760px){.transcript-dialog .transcript-analysis{position:static;max-height:55dvh;overflow-y:auto}.transcript-dialog .transcript-translation-toolbar{top:36px}}

/* Duplicate comparison: compact controls, explicit field selection. */
.deal-duplicate-badge{display:inline-flex;align-items:center;width:max-content;max-width:100%;border:1px solid #f4c2d8;background:#fff0f6;color:#a52d61;border-radius:6px;padding:3px 7px;font-size:11px;line-height:1.3;font-weight:600;margin-top:5px}
.dup-board-menu{position:relative}.dup-board-menu summary{list-style:none;cursor:pointer;padding:7px 12px;border:1px solid var(--border,#dce0e6);border-radius:8px;background:var(--surface,#fff);font-size:20px}.dup-board-menu>div{position:absolute;right:0;top:100%;z-index:40;width:260px;padding:14px;background:var(--surface,#fff);border:1px solid #dce0e6;border-radius:10px;box-shadow:0 10px 30px #0002}.dup-board-menu label{display:grid;gap:6px;margin-top:12px;font-size:12px}.dup-board-menu select{width:100%;min-width:0}
dialog.dup-dialog{width:min(1080px,94vw);max-width:94vw}.dup-dialog .dup-search{display:flex;gap:12px;align-items:end;margin:12px 0}.dup-search label{display:grid;gap:6px;font-size:12px}.dup-search input{width:180px}.dup-dialog button{min-height:34px}.dup-pair{display:grid;grid-template-columns:1fr auto;gap:16px;align-items:center;padding:14px 0;border-bottom:1px solid #e5e7eb}.dup-pair small,.dup-note{color:#737b87;font-size:12px}.dup-pair-cards{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:8px}.dup-card{display:grid;gap:5px;text-align:left;padding:10px 12px;background:#f8f9fb;border:1px solid #e0e4ea;border-radius:9px;min-width:0}.dup-card span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dup-primary{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0}.dup-comparison{border:1px solid #e0e4ea;border-radius:10px;overflow:hidden}.dup-grid-head,.dup-field{display:grid;grid-template-columns:125px 1fr 1fr 1fr;gap:10px;padding:10px 12px;align-items:start}.dup-grid-head{background:#f6f7f9;font-size:12px}.dup-field{border-top:1px solid #e7e9ed;font-size:13px}.dup-field>span:first-child{color:#737b87}.dup-value{display:flex!important;gap:7px!important;padding:8px;border:1px solid transparent;border-radius:7px;cursor:pointer;min-width:0}.dup-value input{width:14px!important;min-height:14px!important;height:14px;margin:2px 0 0;flex-shrink:0;accent-color:#c94c00}.dup-value.selected{border-color:#f4bd97;background:#fff4ec}.dup-value span,.dup-result{white-space:pre-wrap;overflow-wrap:anywhere;max-height:160px;overflow:auto}.dup-result{padding:8px;color:#343b43}.dup-note{line-height:1.5;margin:12px 0}.dup-confirm{display:flex!important;align-items:center;gap:8px!important;font-size:13px}.dup-confirm input{width:16px!important;min-height:16px!important}.dup-footer{display:flex;justify-content:flex-end;gap:8px;position:sticky;bottom:0;padding:14px 0 0;background:var(--surface,#fff)}.dup-footer[hidden]{display:none}.dup-footer [data-ignore]{margin-right:auto}.dup-empty{padding:30px;text-align:center;color:#737b87}
@media(max-width:700px){.dup-grid-head,.dup-field{grid-template-columns:80px 1fr 1fr;gap:5px;padding:8px}.dup-grid-head>:last-child,.dup-result{display:none}.dup-pair{grid-template-columns:1fr}.dup-pair-cards{grid-template-columns:1fr}.dup-primary{align-items:start;flex-direction:column}}
dialog.dup-dialog .dup-form label{margin:0;line-height:1.4}dialog.dup-dialog .dup-form button{width:auto;min-height:34px;height:auto;margin:0}dialog.dup-dialog .dup-search input{width:180px;min-height:34px;height:34px}dialog.dup-dialog .dup-search label{display:grid}dialog.dup-dialog .dup-primary{padding:8px 0;min-height:42px}dialog.dup-dialog .dup-field{padding:6px 10px}dialog.dup-dialog .dup-value{padding:6px}dialog.dup-dialog .dup-search[hidden]{display:none}dialog.dup-dialog .dup-form{margin-top:8px}dialog.dup-dialog .dup-footer{padding:10px 0 0}.dup-readonly{padding:6px;overflow-wrap:anywhere}
.dup-blocked{display:block;margin-top:5px;font-size:11px;color:#946242}.dup-value:has(input:disabled){cursor:default;background:#f8f8f8}
/* Deal cards remain native links without browser link decoration. */
.crm-kanban a.crm-deal-card,.crm-kanban a.crm-deal-card:visited,.crm-kanban a.crm-deal-card:hover,.crm-kanban a.crm-deal-card:active,.crm-kanban a.crm-deal-card *{text-decoration:none!important}
.deal-list-view a[data-table-deal]{display:inline-block;text-decoration:none;color:inherit;font:inherit}
.deal-search-fields .deal-source-field{grid-column:1/-1}
/* Этап-передача в другую воронку */
.pipeline-stage-row .pipeline-stage-move{flex:0 0 190px;width:190px;min-height:32px;padding:4px 8px;font-size:12px;margin:0}
.pipeline-stage-row:has(.pipeline-stage-move){flex-wrap:wrap}
.deal-moved-notice{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);z-index:1000;padding:12px 18px;border-radius:12px;background:#1F2430;color:#fff;font-size:14px;box-shadow:0 12px 32px rgba(17,24,39,.25)}
