:root{--bg:#f4f4ef;--panel:#fff;--ink:#17201d;--muted:#77807b;--line:#e4e5df;--surface:#fff;--soft:#f2f4f1;--text:#17201d;--input:#fff;--green:#175b45;--lime:#d9f26a;--orange:#e89052;--purple:#8d79c4;--blue:#6e9fc2;--shadow:0 14px 40px rgba(24,38,31,.08)}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Manrope,Arial,sans-serif;font-size:14px}.app-shell{min-height:100vh;display:grid;grid-template-columns:230px 1fr}.sidebar{position:fixed;inset:0 auto 0 0;width:230px;padding:30px 20px 22px;border-right:1px solid var(--line);display:flex;flex-direction:column;background:#f8f8f4;z-index:10}.brand{display:flex;align-items:center;gap:11px;color:var(--ink);font:700 23px Onest;text-decoration:none;padding:0 8px 36px}.brand-mark{width:26px;height:26px;display:flex;gap:2px;align-items:end}.brand-mark i{display:block;width:7px;background:var(--green);border-radius:8px}.brand-mark i:nth-child(1){height:13px}.brand-mark i:nth-child(2){height:22px}.brand-mark i:nth-child(3){height:17px;background:var(--lime)}.nav{display:grid;gap:5px}.nav-item{border:0;background:none;color:#65706b;width:100%;padding:11px 12px;border-radius:10px;display:flex;align-items:center;gap:11px;font:500 13px Manrope;text-align:left;cursor:pointer}.nav-item:hover{background:#eeeeE8;color:var(--ink)}.nav-item.active{background:#e8ede7;color:var(--green);font-weight:700}.nav-icon{width:20px;font-size:19px;text-align:center}.nav-item b{margin-left:auto;background:var(--lime);color:#33401f;padding:2px 7px;border-radius:10px;font-size:10px}.sidebar-bottom{margin-top:auto}.api-status{display:flex;gap:9px;padding:14px 10px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin-bottom:7px}.api-status>span{width:8px;height:8px;border-radius:50%;background:#44ad74;margin-top:5px;box-shadow:0 0 0 4px #dceee3}.api-status strong,.api-status small,.profile strong,.profile small{display:block}.api-status strong{font-size:10px}.api-status small,.profile small{font-size:9px;color:var(--muted);margin-top:3px}.profile{display:flex;align-items:center;gap:10px;padding:16px 8px 0}.profile .avatar{width:34px;height:34px;border-radius:50%;background:#d7dbcf;display:grid;place-items:center;font-weight:700;font-size:11px}.profile strong{font-size:11px}.profile button{margin-left:auto;border:0;background:none;color:var(--muted)}.main{grid-column:2;padding:34px 38px 70px;min-width:0}.topbar{display:flex;align-items:end;justify-content:space-between;margin-bottom:31px}.eyebrow{color:var(--green);font-size:10px;letter-spacing:.12em;text-transform:uppercase;font-weight:700}.topbar h1{margin:5px 0 0;font:600 30px Onest}.top-actions{display:flex;gap:9px}.icon-button,.secondary-button,.primary-button,.filter-button,.chip{font:600 12px Manrope;border-radius:9px;cursor:pointer}.icon-button{width:38px;height:38px;background:var(--panel);border:1px solid var(--line);font-size:21px}.primary-button{background:var(--green);color:#fff;border:0;padding:11px 18px}.primary-button:hover{background:#0e4c38}.primary-button span{color:var(--lime)}.mobile-menu{display:none}.page{display:none}.page.active{display:block}.summary-row{display:grid;grid-template-columns:1fr 1fr 1.55fr;gap:12px;margin-bottom:27px}.metric{background:var(--panel);border:1px solid var(--line);border-radius:13px;padding:17px 19px}.metric>span,.metric div>span{display:block;color:var(--muted);font-size:10px}.metric strong{display:block;font:600 21px Onest;margin:7px 0 3px}.metric small{font-size:9px;color:var(--muted)}.metric .positive{color:#4c9169}.metric.accent{background:var(--green);color:#fff;display:flex;align-items:center;justify-content:space-between}.metric.accent span,.metric.accent small{color:#a9c5ba}.metric.accent button{width:34px;height:34px;border-radius:50%;border:1px solid rgba(255,255,255,.25);color:var(--lime);background:transparent;font-size:18px;cursor:pointer}.board-toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.view-switch{background:#e8e9e3;padding:3px;border-radius:8px}.view-switch button{border:0;background:none;padding:7px 12px;border-radius:6px;font:600 10px Manrope;color:var(--muted);cursor:pointer}.view-switch button.active{background:#fff;color:var(--ink);box-shadow:0 2px 4px rgba(0,0,0,.05)}.filter-group{display:flex;gap:7px}.chip,.filter-button{padding:7px 11px;background:transparent;border:1px solid var(--line);color:var(--muted)}.chip.active{background:#fff;color:var(--ink)}.filter-button span{background:var(--green);color:white;border-radius:50%;padding:1px 5px;font-size:8px}.board{display:grid;grid-template-columns:repeat(4,minmax(220px,1fr));gap:11px;overflow-x:auto;padding-bottom:20px}.column{min-width:220px;background:#ebebe5;border-radius:12px;padding:12px;min-height:430px}.column-head{display:flex;align-items:center;gap:8px;padding:3px 3px 12px}.column-head i{width:7px;height:7px;border-radius:50%;background:var(--orange)}.column:nth-child(2) .column-head i{background:var(--blue)}.column:nth-child(3) .column-head i{background:var(--purple)}.column:nth-child(4) .column-head i{background:var(--green)}.column-head strong{font-size:11px}.column-head span{margin-left:auto;color:var(--muted);font-size:9px}.lead-card{background:#fff;border:1px solid #e1e2db;border-radius:10px;padding:14px;margin-bottom:9px;cursor:grab;box-shadow:0 2px 3px rgba(20,30,25,.025);transition:.18s}.lead-card:hover{transform:translateY(-2px);box-shadow:0 7px 18px rgba(20,30,25,.08)}.lead-card.dragging{opacity:.45}.lead-top{display:flex;justify-content:space-between;align-items:start}.lead-top>span{font:600 15px Onest}.lead-top button{border:0;background:none;color:#aaa;cursor:pointer}.lead-card p{font-size:10px;color:var(--muted);margin:4px 0 14px}.lead-value{display:flex;align-items:center;justify-content:space-between;padding-top:11px;border-top:1px solid #eee;font-size:11px;font-weight:700}.source{font-size:8px;font-weight:600;color:var(--muted);background:#f1f2ee;border-radius:10px;padding:4px 7px}.lead-meta{display:flex;justify-content:space-between;margin-top:10px;color:var(--muted);font-size:9px}.section-head{display:flex;justify-content:space-between;align-items:end;margin-bottom:24px}.section-head p{margin:0;color:var(--green);text-transform:uppercase;letter-spacing:.12em;font-size:9px;font-weight:700}.section-head h2{font:600 25px Onest;margin:5px 0 0}.secondary-button{border:1px solid var(--line);background:#fff;color:var(--ink);padding:10px 14px}.calendar-layout{background:#fff;border:1px solid var(--line);border-radius:15px;padding:24px}.date-strip{display:grid;grid-template-columns:repeat(7,1fr);border-bottom:1px solid var(--line);padding-bottom:20px}.date{text-align:center;font-size:9px;color:var(--muted)}.date span{display:grid;place-items:center;width:33px;height:33px;margin:7px auto 0;font:600 13px Onest;border-radius:50%}.date.active span{background:var(--green);color:#fff}.date.muted{opacity:.5}.schedule{padding:10px 0}.meeting-row{display:grid;grid-template-columns:80px 4px 1fr auto;gap:18px;align-items:center;padding:16px 8px;border-bottom:1px solid #eee}.meeting-row time{font:600 14px Onest}.meeting-row>i{height:45px;border-radius:4px;background:var(--orange)}.meeting-row:nth-child(2n)>i{background:var(--purple)}.meeting-row strong,.meeting-row small{display:block}.meeting-row small{font-size:9px;color:var(--muted);margin-top:5px}.reminders{font-size:9px;color:var(--green);background:#eaf2ee;padding:6px 9px;border-radius:8px}.empty{text-align:center;padding:50px;color:var(--muted)}.automation-grid,.settings-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.automation-card,.integration-card{background:#fff;border:1px solid var(--line);border-radius:13px;padding:20px}.automation-top,.integration-top{display:flex;align-items:start;justify-content:space-between}.automation-icon,.integration-icon{width:37px;height:37px;border-radius:10px;background:#edf0e9;display:grid;place-items:center;font-size:17px;color:var(--green)}.automation-card h3,.integration-card h3{font:600 14px Onest;margin:17px 0 6px}.automation-card p,.integration-card p{font-size:10px;color:var(--muted);line-height:1.6;margin:0}.automation-flow{display:flex;align-items:center;gap:7px;margin-top:18px;font-size:9px}.automation-flow span{background:#f0f1ed;padding:6px 8px;border-radius:6px}.automation-flow b{color:#aaa}.toggle{position:relative;width:37px;height:21px;border:0;border-radius:12px;background:#ccd0ca;cursor:pointer}.toggle::after{content:"";position:absolute;width:15px;height:15px;background:white;border-radius:50%;left:3px;top:3px;transition:.2s}.toggle.on{background:var(--green)}.toggle.on::after{transform:translateX(16px)}.activity-card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:8px 23px}.activity-item{display:grid;grid-template-columns:35px 1fr auto;gap:13px;align-items:center;padding:16px 0;border-bottom:1px solid #eee}.activity-item:last-child{border:0}.activity-symbol{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#eff2ed;color:var(--green)}.activity-item strong,.activity-item small{display:block}.activity-item strong{font-size:11px}.activity-item small{font-size:9px;color:var(--muted);margin-top:4px}.activity-item time{font-size:9px;color:var(--muted)}.integration-card{display:flex;gap:14px}.integration-card .integration-main{flex:1}.integration-top{align-items:center}.status-pill{font-size:8px;font-weight:700;color:#3f8861;background:#e6f2eb;padding:5px 8px;border-radius:12px}.status-pill.off{color:#8a7161;background:#f2ece7}.integration-card button{margin-top:14px;border:0;background:none;color:var(--green);font:700 10px Manrope;padding:0;cursor:pointer}.webhook-box{margin-top:12px;background:#17251f;color:white;border-radius:13px;padding:18px 20px}.webhook-box>div{display:flex;align-items:center;gap:10px}.webhook-box .tag{font-size:8px;background:var(--lime);color:#314018;padding:5px 7px;border-radius:5px;font-weight:700}.webhook-box code{font-size:11px;color:#dce5e0}.webhook-box button{margin-left:auto;background:none;border:1px solid #52635b;color:#fff;padding:7px 10px;border-radius:7px;cursor:pointer}.webhook-box p{font-size:9px;color:#91a49b;margin:12px 0 0}.modal-backdrop{position:fixed;inset:0;background:rgba(18,27,24,.52);display:grid;place-items:center;z-index:50;padding:20px}.modal-backdrop[hidden]{display:none}.modal{position:relative;background:#fff;width:min(500px,100%);padding:30px;border-radius:17px;box-shadow:var(--shadow)}.modal h2{font:600 25px Onest;margin:5px 0 23px}.modal-close{position:absolute;right:20px;top:18px;background:#f0f1ec;border:0;width:29px;height:29px;border-radius:50%;font-size:18px;cursor:pointer}.modal label{display:block;font-size:10px;font-weight:700;margin-bottom:14px}.modal input,.modal select,.modal textarea{display:block;width:100%;margin-top:7px;border:1px solid var(--line);border-radius:8px;padding:11px 12px;font:500 12px Manrope;color:var(--ink);outline:none}.modal input:focus,.modal select:focus,.modal textarea:focus{border-color:var(--green)}.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.full{width:100%;margin-top:5px;padding:13px}.notice{background:#edf3ef;color:#527164;padding:11px;border-radius:8px;font-size:9px;margin-bottom:14px;line-height:1.5}.toast{position:fixed;right:25px;bottom:25px;background:#17251f;color:#fff;padding:13px 18px;border-radius:11px;display:flex;align-items:center;gap:11px;box-shadow:var(--shadow);transform:translateY(100px);opacity:0;transition:.3s;z-index:3000}.toast.show{transform:none;opacity:1}.toast>span{color:var(--lime)}.toast strong,.toast small{display:block}.toast strong{font-size:11px}.toast small{font-size:9px;color:#aebdb6;margin-top:2px}
@media(max-width:1000px){.summary-row{grid-template-columns:1fr 1fr}.metric.accent{grid-column:span 2}.main{padding:28px 24px}.filter-group .chip{display:none}}@media(max-width:720px){.app-shell{display:block}.sidebar{transform:translateX(-100%);transition:.25s;box-shadow:var(--shadow)}.sidebar.open{transform:none}.main{padding:22px 16px}.mobile-menu{display:inline-block;border:0;background:none;font-size:20px;margin-right:8px}.topbar{align-items:center}.topbar h1{font-size:23px}.topbar .eyebrow{margin-left:34px}.icon-button{display:none}.primary-button{padding:10px 12px}.summary-row{grid-template-columns:1fr}.metric.accent{grid-column:auto}.board-toolbar{align-items:start}.board{margin-right:-16px}.filter-button{white-space:nowrap}.automation-grid,.settings-grid{grid-template-columns:1fr}.calendar-layout{padding:14px}.meeting-row{grid-template-columns:54px 3px 1fr}.reminders{display:none}.form-row{grid-template-columns:1fr}.webhook-box code{font-size:8px}.webhook-box button{display:none}}

/* Bitrix-matched CRM structure */
.crm-toolbar{display:flex;align-items:center;gap:9px;margin-bottom:18px}.quick-create{height:40px;border:0;border-radius:9px;background:var(--green);color:#fff;padding:0 17px;font:700 12px Manrope;cursor:pointer}.quick-create>span{margin-left:5px}.pipeline-select{height:40px;border:1px solid var(--line);border-radius:9px;background:#fff;padding:0 15px;font:600 12px Manrope;color:var(--ink);cursor:pointer}.pipeline-select span{margin-left:14px;color:var(--muted)}.pipeline-filter{height:40px;display:flex;align-items:center;min-width:320px;flex:1;max-width:560px;border:1px solid var(--line);border-radius:9px;background:#fff;overflow:hidden}.pipeline-filter>span{margin-left:13px;background:#edf1ed;border-radius:6px;padding:6px 9px;font-size:10px;color:#51605a}.pipeline-filter>b{font-size:11px;color:#98a19c;margin-left:5px}.pipeline-filter input{border:0;outline:0;min-width:80px;flex:1;padding:0 10px;font:500 11px Manrope;background:transparent}.robots-link{margin-left:auto}.board{grid-template-columns:repeat(22,250px);align-items:stretch;scrollbar-width:thin;scrollbar-color:#c7cbc5 transparent}.column{min-width:250px;min-height:510px;background:#e9eae5;padding:10px;border-radius:10px}.stage-cap{position:relative;display:flex;align-items:center;min-height:34px;background:var(--stage);color:#fff;padding:7px 13px;border-radius:7px 2px 2px 7px}.stage-cap::after{content:"";position:absolute;right:-9px;top:0;border-top:17px solid transparent;border-bottom:17px solid transparent;border-left:9px solid var(--stage);z-index:2}.stage-cap strong{font:700 10px Manrope;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stage-cap span{margin-left:auto;font-size:9px;opacity:.8;padding-left:7px}.column-total{text-align:center;background:rgba(255,255,255,.45);border-radius:7px;margin:11px 0 5px;padding:7px;font:600 11px Onest;color:#68716c}.column-add{width:100%;border:0;background:transparent;padding:6px;color:#808983;font-size:15px;cursor:pointer}.column .lead-card{margin-top:5px}.card-field{margin-top:10px;padding-top:9px;border-top:1px solid #eee}.card-field small,.card-field b{display:block}.card-field small{font-size:8px;color:var(--muted)}.card-field b{font-size:9px;margin-top:3px}.lead-card p{min-height:26px}.robot-legend{display:flex;align-items:center;gap:16px;margin:-10px 0 14px;color:var(--muted);font-size:9px}.robot-legend span{display:flex;align-items:center;gap:6px}.robot-legend i{width:8px;height:8px;border-radius:50%;background:#b7bcb8}.robot-legend i.on{background:#41a36c}.robot-legend small{margin-left:auto}.automation-grid{display:grid;grid-template-columns:repeat(22,190px);gap:7px;overflow-x:auto;align-items:start;padding:0 0 18px}.robot-column{background:#e9eae5;border-radius:10px;padding:8px;min-height:440px}.robot-column .stage-cap{margin-bottom:9px}.robot-trigger{height:34px;display:grid;place-items:center;background:#dedfd9;color:#777f7a;border-radius:6px;margin:0 0 13px}.robot-stack{display:grid;gap:7px}.robot-card{position:relative;background:#fff;border:1px solid #dfe2dc;border-left:3px solid #4ba77a;border-radius:8px;padding:10px;cursor:pointer;box-shadow:0 2px 5px rgba(25,35,30,.03)}.robot-card:hover{box-shadow:0 6px 14px rgba(25,35,30,.08)}.robot-card.disabled{opacity:.48;border-left-color:#aaa}.robot-card.disabled::after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(-45deg,transparent,transparent 5px,rgba(235,237,232,.45) 5px,rgba(235,237,232,.45) 10px);pointer-events:none}.robot-when{font-size:8px;color:#4f8a70;text-decoration:underline;margin-bottom:7px;line-height:1.35}.robot-title{display:flex;gap:7px;align-items:start}.robot-title>span{color:var(--green)}.robot-title strong{font:600 10px Onest;line-height:1.35}.robot-card>small,.robot-card>b{display:block;margin-left:21px}.robot-card>small{font-size:7px;color:#a0a6a2;margin-top:9px}.robot-card>b{font-size:8px;color:#547366;margin-top:2px}.robot-card em{display:block;font-style:normal;font-size:7px;color:#976e59;background:#f3ebe6;margin:8px 0 0 21px;width:max-content;padding:3px 5px;border-radius:4px}.empty-robots{display:grid;place-items:center;color:#a7ada9;padding:30px 5px;text-align:center}.empty-robots span{font-size:18px}.empty-robots p{font-size:8px}.drawer-backdrop{position:fixed;inset:0;background:rgba(17,25,22,.4);z-index:40}.drawer-backdrop[hidden]{display:none}.deal-drawer{position:absolute;right:0;top:0;bottom:0;width:min(610px,100%);background:#f5f5f1;box-shadow:-18px 0 55px rgba(19,31,26,.15);overflow:auto;animation:drawerIn .22s ease-out}@keyframes drawerIn{from{transform:translateX(30px);opacity:.5}}.drawer-head{position:sticky;top:0;z-index:4;display:flex;justify-content:space-between;align-items:start;background:#fff;padding:24px 27px 18px;border-bottom:1px solid var(--line)}.drawer-head h2{font:600 21px Onest;margin:5px 0 0}.drawer-head button{border:0;background:#eef0eb;border-radius:50%;width:32px;height:32px;font-size:19px;cursor:pointer}.drawer-stage{display:flex;align-items:center;gap:10px;background:#fff;padding:14px 27px;border-bottom:1px solid var(--line)}.drawer-stage>span{width:9px;height:38px;background:var(--stage);border-radius:5px}.drawer-stage small,.drawer-stage strong{display:block}.drawer-stage small{font-size:8px;color:var(--muted)}.drawer-stage strong{font-size:11px;margin-top:4px}.drawer-stage button{margin-left:auto;border:1px solid var(--line);background:#fff;color:var(--green);border-radius:7px;padding:8px 10px;font:700 9px Manrope;cursor:pointer}.drawer-tabs{position:sticky;top:75px;z-index:3;display:flex;gap:22px;background:#fff;padding:0 27px;border-bottom:1px solid var(--line)}.drawer-tabs button{border:0;background:none;padding:14px 0 12px;color:var(--muted);font:600 10px Manrope;cursor:pointer;border-bottom:2px solid transparent}.drawer-tabs button.active{color:var(--green);border-color:var(--green)}.drawer-body{padding:15px}.deal-section{background:#fff;border:1px solid var(--line);border-radius:11px;padding:18px;margin-bottom:11px}.deal-section-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:13px}.deal-section-title h3{font:600 13px Onest;margin:0}.deal-section-title button{border:0;background:none;color:var(--green);font:700 9px Manrope;cursor:pointer}.field-list{display:grid;grid-template-columns:1fr 1fr;gap:0 24px}.field-list>div{padding:10px 0;border-bottom:1px solid #eee}.field-list small,.field-list strong{display:block}.field-list small{font-size:8px;color:var(--muted)}.field-list strong{font-size:10px;margin-top:5px;font-weight:600}.product-row{display:flex;gap:11px;align-items:center}.product-row>span{width:36px;height:36px;display:grid;place-items:center;border-radius:8px;background:#edf2ed;color:var(--green)}.product-row strong,.product-row small{display:block}.product-row strong{font-size:10px}.product-row small{font-size:8px;color:var(--muted);margin-top:4px}.mini-timeline>div{display:grid;grid-template-columns:28px 1fr auto;gap:9px;padding:12px 0;border-bottom:1px solid #eee}.mini-timeline>div:last-child{border:0}.mini-timeline>div>span{width:27px;height:27px;border-radius:50%;display:grid;place-items:center;background:#edf2ed;color:var(--green);font-size:10px}.mini-timeline strong{font-size:9px}.mini-timeline p{font-size:8px;color:var(--muted);margin:3px 0 0}.mini-timeline time{font-size:7px;color:var(--muted)}.drawer-robots{display:grid;gap:8px}.drawer-robots .robot-card{padding:14px}.drawer-robots .robot-title strong{font-size:11px}
@media(max-width:720px){.crm-toolbar{flex-wrap:wrap}.pipeline-filter{order:3;min-width:100%;max-width:none}.robots-link{margin-left:0}.board{grid-template-columns:repeat(22,230px)}.column{min-width:230px}.deal-drawer{width:100%}.field-list{grid-template-columns:1fr}.drawer-tabs{top:75px}.robot-legend small{display:none}}

/* Users and responsible owners */
.profile{cursor:pointer;border-radius:9px}.profile:hover{background:#eceee8}.responsible-filter{height:31px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);padding:0 10px;font:600 10px Manrope;max-width:170px}.card-owner{display:flex;align-items:center;gap:7px;margin-top:10px;padding-top:10px;border-top:1px solid #eee}.mini-avatar,.employee-avatar{background:var(--avatar);color:#fff;display:grid;place-items:center;border-radius:50%;font-weight:700}.mini-avatar{width:25px;height:25px;font-size:8px;flex:0 0 auto}.card-owner small,.card-owner strong{display:block}.card-owner small{font-size:7px;color:var(--muted)}.card-owner strong{font-size:8px;margin-top:2px}.responsible-control{display:flex;align-items:center;gap:10px;background:#f0f3ef;border-radius:9px;padding:10px 12px;margin-bottom:9px}.responsible-control .mini-avatar{width:34px;height:34px;font-size:10px}.responsible-control label{flex:1}.responsible-control small{display:block;font-size:8px;color:var(--muted)}.responsible-control select{width:100%;border:0;background:transparent;color:var(--ink);font:700 10px Manrope;outline:0;margin-top:3px}.team-summary{display:flex;align-items:center;gap:20px;background:var(--green);color:#fff;padding:18px 22px;border-radius:13px;margin-bottom:13px}.team-summary>div{display:flex;align-items:baseline;gap:7px}.team-summary strong{font:600 28px Onest;color:var(--lime)}.team-summary span{font-size:10px}.team-summary p{margin:0 0 0 auto;color:#b9d0c7;font-size:9px}.employee-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:11px}.employee-card{display:flex;align-items:center;gap:13px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:17px}.employee-avatar{position:relative;width:45px;height:45px;font-size:11px;flex:0 0 auto}.employee-avatar i{position:absolute;right:1px;bottom:1px;width:9px;height:9px;border-radius:50%;background:#52b77a;border:2px solid #fff}.employee-info{min-width:0}.employee-info h3{font:600 12px Onest;margin:0}.employee-info h3 span{font:700 7px Manrope;color:#497760;background:#e5f0e9;border-radius:10px;padding:3px 6px;margin-left:6px}.employee-info p{font-size:8px;color:var(--muted);margin:5px 0}.employee-info small{font-size:8px;color:#4d6c5e}.employee-card>button{margin-left:auto;border:1px solid var(--line);background:#f7f8f5;color:var(--green);border-radius:7px;padding:7px 9px;font:700 8px Manrope;cursor:pointer}.text-button{border:0;background:transparent;color:var(--green);font:700 10px Manrope;padding:11px;cursor:pointer}@media(max-width:720px){.employee-grid{grid-template-columns:1fr}.team-summary p{display:none}.filter-group .responsible-filter{display:block;max-width:145px}}

/* Bitrix-matched deal card: wide stage strip, fields and activity feed */
.automation-grid{grid-template-columns:repeat(25,190px)}
.robot-card-actions{position:relative;z-index:3;display:flex;justify-content:flex-end;gap:4px;margin:-3px -3px 7px}.robot-card-config,.robot-card-toggle{border:0;background:#eef3ef;color:var(--green);border-radius:5px;font:700 7px Manrope;padding:4px 6px;cursor:pointer}.robot-card-toggle{color:#7c8580;background:#edf0ed}.robot-card-toggle.on{color:#28724f;background:#dff0e5}.robot-card-config:hover,.robot-card-toggle:hover{background:#dcebe1}.robot-editor-backdrop{position:fixed;inset:0;z-index:70;background:rgba(17,25,22,.48);display:grid;place-items:center;padding:20px}.robot-editor-backdrop[hidden]{display:none}.robot-editor-dialog{width:min(760px,100%);max-height:calc(100vh - 40px);overflow:auto;background:#fff;border-radius:15px;box-shadow:var(--shadow);padding:25px}.robot-editor-dialog>header{display:flex;align-items:start;justify-content:space-between;border-bottom:1px solid var(--line);padding-bottom:17px;margin-bottom:18px}.robot-editor-dialog h2{font:600 23px Onest;margin:5px 0}.robot-editor-dialog header small{display:block;color:var(--muted);font-size:10px}.robot-editor-dialog header button{border:0;background:#eef0eb;border-radius:50%;width:30px;height:30px;font-size:18px;cursor:pointer}.robot-editor-dialog label{display:block;margin:0 0 14px;color:#48544e;font:700 10px Manrope}.robot-editor-dialog input:not([type="checkbox"]),.robot-editor-dialog select,.robot-editor-dialog textarea{display:block;width:100%;margin-top:7px;border:1px solid var(--line);border-radius:8px;padding:10px 11px;background:#fff;color:var(--ink);font:500 12px Manrope;outline:none}.robot-editor-dialog textarea{resize:vertical;min-height:85px}.robot-editor-dialog input:focus,.robot-editor-dialog select:focus,.robot-editor-dialog textarea:focus{border-color:var(--green)}.robot-editor-dialog .robot-editor-switch{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border:1px solid var(--line);border-radius:9px}.robot-editor-switch strong,.robot-editor-switch small{display:block}.robot-editor-switch small{font:500 9px Manrope;color:var(--muted);margin-top:3px}.robot-editor-switch input{width:38px;height:21px;accent-color:var(--green)}.robot-editor-grid{display:grid;grid-template-columns:1.25fr .6fr .75fr 1.4fr;gap:9px}.robot-editor-check{display:flex!important;align-items:center;gap:8px}.robot-editor-check input{width:16px;height:16px;accent-color:var(--green)}.robot-field-action{grid-template-columns:1fr 1fr}.robot-condition-editor{border:1px solid var(--line);border-radius:10px;padding:13px;margin:0 0 14px}.robot-condition-editor>header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.robot-condition-editor>header strong,.robot-condition-editor>header small{display:block}.robot-condition-editor>header small{color:var(--muted);font-size:8px;margin-top:3px}.robot-condition-editor>header button{border:0;border-radius:7px;background:#edf3ef;color:var(--green);padding:8px 10px;font:700 9px Manrope;cursor:pointer}.robot-condition-row{display:grid;grid-template-columns:64px 1.2fr 1fr 1fr 32px;gap:6px;align-items:center;margin-top:7px}.robot-condition-row select,.robot-condition-row input{margin:0!important;padding:8px!important;min-width:0}.robot-condition-row button{width:32px;height:32px;border:0;border-radius:7px;background:#f6eaea;color:#a75353;font-size:16px;cursor:pointer}.robot-condition-empty{margin:3px 0;color:var(--muted);font-size:9px}.robot-variable-list{display:flex;flex-wrap:wrap;gap:6px;margin:-7px 0 14px}.robot-variable-list button{border:1px solid #d8e4dc;background:#f6faf7;color:var(--green);border-radius:14px;padding:5px 8px;font:700 8px Manrope;cursor:pointer}.robot-editor-hint{margin:5px 0 17px;padding:10px 12px;border-radius:8px;background:#edf3ef;color:#587064;font-size:9px;line-height:1.55}.robot-editor-dialog footer{display:flex;justify-content:flex-end;gap:9px}@media(max-width:720px){.robot-editor-dialog{padding:19px;border-radius:13px}.robot-editor-dialog h2{font-size:19px}.robot-editor-grid,.robot-field-action{grid-template-columns:1fr 1fr}.robot-condition-row{grid-template-columns:58px 1fr 1fr 32px}.robot-condition-row [data-condition-value]{grid-column:2/4}.robot-editor-dialog footer{position:sticky;bottom:-19px;background:#fff;padding:12px 0 0}.robot-editor-dialog footer button{flex:1}.robot-card-config,.robot-card-toggle{font-size:7px}}
.automation-scroll-shell{position:relative;min-width:0}.automation-scroll-arrow{position:absolute;z-index:6;top:148px;transform:none;width:42px;height:72px;border:0;border-radius:10px;background:rgba(255,255,255,.96);box-shadow:0 7px 24px rgba(27,40,33,.18);color:#5a6760;font:600 35px Onest;cursor:pointer;opacity:.86;transition:opacity .18s,transform .18s}.automation-scroll-shell:hover .automation-scroll-arrow,.automation-scroll-arrow:focus-visible{opacity:1}.automation-scroll-arrow:hover{background:#fff;color:var(--green);transform:scale(1.04)}.automation-scroll-arrow.left{left:8px}.automation-scroll-arrow.right{right:8px}.automation-grid{scroll-behavior:auto}@media(max-width:720px){.automation-scroll-arrow{top:112px;display:block;width:34px;height:58px;font-size:28px;opacity:.94}.automation-scroll-arrow.left{left:0}.automation-scroll-arrow.right{right:0}}
@media(max-width:720px){body{overflow-x:hidden}.topbar{gap:12px;margin-bottom:21px}.topbar .top-actions{gap:6px;flex:0 0 auto}.topbar .primary-button{white-space:nowrap}.crm-toolbar{gap:7px}.quick-create,.pipeline-select{flex:1;min-width:0}.pipeline-select{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.board-toolbar{flex-wrap:wrap;gap:10px}.board-toolbar>.filter-group{width:100%;overflow-x:auto;padding-bottom:2px}.board-toolbar>.filter-group>*{flex:0 0 auto}.contacts-toolbar{display:flex;gap:8px;align-items:center}.contacts-toolbar input{min-width:0;flex:1}.contact-preview{padding:16px}.contact-preview>header{align-items:flex-start;flex-wrap:wrap}.contact-preview header button{margin-left:auto}.calendar-layout{padding:14px 10px}.calendar-owner-bar{overflow-x:auto;flex-wrap:nowrap;padding-bottom:12px}.calendar-owner-bar button{flex:0 0 auto}.date-strip{min-width:0}.date span{width:29px;height:29px}.meeting-row{gap:10px;padding:13px 2px}.meeting-row strong{font-size:11px}.stage-manager-backdrop{padding:0}.stage-manager{height:100%;max-height:100%;border-radius:0}.stage-manager>header{padding:18px 16px 14px}.stage-manager h2{font-size:20px}.stage-manager-list{padding:10px}.stage-add-form{grid-template-columns:1fr 46px}.stage-add-form button{grid-column:1/-1;height:38px}.stage-manager>footer{padding:12px;gap:8px}.stage-manager>footer button{flex:1}.toast{left:12px;right:12px;bottom:12px}.robot-legend{gap:10px;flex-wrap:wrap}}
.deal-drawer{width:min(1320px,calc(100% - 250px));max-width:none;background:#eef1f3;display:flex;flex-direction:column;overflow:hidden}
.drawer-head{position:relative;top:auto;flex:0 0 auto;padding:22px 28px 18px;background:#f7f9fa}
.drawer-head h2{font-size:25px;max-width:820px}
.drawer-title-meta{display:flex;align-items:center;gap:9px;margin-top:7px;color:#67737e;font-size:10px}
.drawer-title-meta span:first-child{color:#315f8a;border-bottom:1px dashed #a8b5c0}
.drawer-title-meta span+span::before{content:"·";margin-right:9px;color:#a4adb5}
.drawer-stage{display:block;flex:0 0 auto;background:#eef1f3;padding:14px 26px 11px;border-bottom:0;overflow:hidden}
.drawer-stage-scroll{overflow:hidden;padding:0;width:100%}
.drawer-stage-strip{display:grid;grid-template-columns:repeat(22,minmax(58px,1fr));gap:5px;min-width:1280px}
.drawer-stage-step{position:relative;min-width:0;height:48px;border:0;background:#d5dbe0;color:#4e5962;padding:0 15px 0 10px;clip-path:polygon(0 0,82% 0,100% 50%,82% 100%,0 100%,10% 50%);cursor:pointer;overflow:hidden}
.drawer-stage-step:first-child{clip-path:polygon(0 0,82% 0,100% 50%,82% 100%,0 100%)}
.drawer-stage-step::after{content:"";position:absolute;left:6px;right:12px;bottom:0;height:3px;border-radius:3px;background:var(--stage)}
.drawer-stage-step span{display:block;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 9px Manrope;text-align:left}
.drawer-stage-step.active{background:var(--stage);color:#fff}
.drawer-stage-step.active::after{background:rgba(255,255,255,.78)}
.drawer-tabs{position:relative;top:auto;flex:0 0 auto;gap:26px;padding:0 28px;background:#f7f9fa}
.drawer-tabs button{font-size:11px;padding:13px 0 11px}
.drawer-body{flex:1;overflow-y:auto;overflow-x:hidden;padding:18px 24px 32px;background:#eef1f3}
.bitrix-card-grid{display:grid;grid-template-columns:minmax(360px,.88fr) minmax(480px,1.25fr);gap:22px;align-items:start}
.bitrix-card-left,.bitrix-card-right{min-width:0}
.bitrix-card-grid .deal-section{border:0;border-radius:14px;box-shadow:0 10px 28px rgba(36,50,62,.055);padding:21px}
.bitrix-deal-panel>.deal-section-title{padding-bottom:13px;border-bottom:1px solid #e7eaec}
.bitrix-deal-panel>.deal-section-title h3,.deal-subhead{color:#56616b;font:700 11px Manrope;letter-spacing:.02em}
.bitrix-stage-field{display:flex;align-items:end;justify-content:space-between;gap:14px;padding:13px 0 7px}
.bitrix-stage-field small,.bitrix-amount small,.bitrix-contact-card small,.bitrix-field-stack small{display:block;color:#9aa3aa;font-size:9px;font-weight:500}
.bitrix-stage-field strong{display:flex;align-items:center;gap:7px;margin-top:5px;font:600 14px Onest}
.bitrix-stage-field strong i{width:8px;height:23px;border-radius:5px;background:var(--stage)}
.bitrix-stage-field button{border:1px solid #cfd8df;background:#fff;color:#2879db;border-radius:8px;padding:8px 10px;font:700 9px Manrope;cursor:pointer}
.bitrix-amount{display:flex;justify-content:space-between;align-items:end;padding:10px 0 14px}
.bitrix-amount strong{display:block;margin-top:3px;font:500 34px Onest;color:#3f4850}
.bitrix-amount>span{font-size:8px;color:#a3abb1}.bitrix-amount>button{border:0;background:transparent;color:#287fea;padding:4px;font:700 8px Manrope;cursor:pointer}
.bitrix-deal-panel .responsible-control{margin:0 0 17px;background:#f2f5f6}
.deal-subhead{margin:17px 0 9px;text-transform:none}
.bitrix-contact-card{padding:15px 17px;border:1px solid #e5e8ea;border-radius:12px;background:#fff}
.bitrix-contact-card>strong{display:block;margin:5px 0 11px;font:600 15px Onest}
.bitrix-contact-card>div{display:flex;gap:14px;flex-wrap:wrap;color:#65717a;font-size:9px}
.bitrix-contact-card>div span{display:flex;align-items:center;gap:4px}
.bitrix-field-stack{margin-top:9px}
.bitrix-field-stack>div,.bitrix-field-stack>button{padding:10px 0;border:0;border-bottom:1px solid #edf0f1}
.bitrix-field-stack>div:last-child,.bitrix-field-stack>button:last-child{border-bottom:0}
.editable-deal-field{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;background:transparent;text-align:left;cursor:default}.editable-deal-field>span{min-width:0}
.editable-deal-field em{display:none}
.editable-deal-field .inline-edit-trigger{border:0;background:transparent;padding:0;color:#287fea;font:700 8px Manrope;font-style:normal;opacity:0;transition:opacity .15s;cursor:pointer}
.editable-deal-field:hover{background:#f8fbfd}
.editable-deal-field:hover .inline-edit-trigger,
.editable-deal-field:focus-within .inline-edit-trigger{opacity:1}
.bitrix-field-stack strong{display:block;margin-top:5px;color:#444e56;font-size:11px;font-weight:600;line-height:1.45}
.field-empty{color:#a7afb5;font-weight:500}
.deal-composer{padding:0!important;overflow:hidden}
.deal-composer nav{display:flex;align-items:center;gap:8px;padding:13px 16px;border-bottom:1px solid #edf0f1}
.deal-composer nav button{border:0;background:none;color:#7a858d;border-radius:8px;padding:8px 11px;font:600 11px Manrope;cursor:pointer}
.deal-composer nav button.active{background:#edf6ff;color:#287fea;box-shadow:inset 0 0 0 1px #b9dcff}
.deal-composer textarea{display:block;width:calc(100% - 32px);margin:16px;border:1px solid #d7dce0;border-radius:11px;padding:15px;resize:vertical;min-height:88px;outline:none;font:500 12px Manrope;color:var(--ink);background:#fff}
.task-composer-controls{display:flex;align-items:end;gap:9px;padding:14px 16px 0}.task-composer-controls label{flex:1;min-width:0}.task-composer-controls label span{display:block;margin-bottom:5px;color:#9aa3aa;font-size:8px;font-weight:700}.task-composer-controls input,.task-composer-controls select{width:100%;border:1px solid #83cfff;border-radius:8px;background:#fff;padding:9px 10px;color:#53606a;font:600 10px Manrope;outline:0}.task-actions-button{border:1px solid #83cfff!important;background:#fff!important;color:#62707a!important;border-radius:8px!important;padding:10px 12px!important;font:700 9px Manrope!important;white-space:nowrap}.task-actions-menu{position:absolute;right:16px;z-index:6;width:245px;border:1px solid #e0e5e8;border-radius:12px;background:#fff;padding:8px;box-shadow:0 14px 32px rgba(33,45,55,.18)}.task-actions-menu[hidden]{display:none}.task-actions-menu button{display:block!important;width:100%;border:0!important;background:#fff!important;padding:11px 10px!important;color:#4d5962!important;text-align:left!important;font:600 10px Manrope!important}.task-actions-menu button:hover{background:#f1f7fb!important;color:#287fea!important}.deal-due{display:block;margin-top:9px;border-radius:7px;background:#eef7ff;color:#287fea;padding:7px 9px;font-size:8px}.deal-feed-item.task .deal-feed-icon{background:#e5f4eb;color:#278857}.deal-feed-item.comment .deal-feed-icon{background:#f1edff;color:#7b66bd}
.deal-composer textarea:focus{border-color:#6aaef5;box-shadow:0 0 0 3px rgba(106,174,245,.12)}
.composer-actions{display:flex;align-items:center;gap:12px;padding:0 16px 16px}
.composer-actions small{color:#9aa3aa;font-size:8px;line-height:1.4}
.composer-actions button{margin-left:auto;border:0;border-radius:8px;background:#2f80ed;color:#fff;padding:10px 14px;font:700 10px Manrope;cursor:pointer}
.discussion-invite{margin:14px 0;background:#fff;border-radius:28px;padding:12px 18px;color:#a0a8ae;box-shadow:0 9px 23px rgba(36,50,62,.05);font-size:10px}
.discussion-invite span{display:inline-grid;place-items:center;width:28px;height:28px;margin-right:7px;border-radius:50%;background:#e9f4ff;color:#2f80ed}
.feed-divider{display:flex;align-items:center;gap:12px;margin:16px 0;color:#fff;font:700 9px Manrope}
.feed-divider::before,.feed-divider::after{content:"";height:1px;background:#d8dde0;flex:1}
.feed-divider span{background:#57c982;border-radius:15px;padding:6px 14px}
.deal-feed{display:grid;gap:11px}
.deal-feed-item{position:relative;display:grid;grid-template-columns:38px 1fr;gap:12px;background:#fff;border-radius:13px;padding:16px 18px;box-shadow:0 8px 24px rgba(36,50,62,.045)}
.deal-feed-icon{width:36px;height:36px;display:grid;place-items:center;border-radius:50%;background:#e8f4ff;color:#2f80ed;font-size:14px}
.deal-feed-item header{display:flex;align-items:center;gap:12px}
.deal-feed-item header strong{font:600 12px Onest}
.deal-feed-item time{margin-left:auto;color:#a0a8ae;font-size:8px}
.deal-feed-item small{display:block;color:#8d989f;font-size:8px;margin-top:3px}
.deal-feed-item p{margin:8px 0 0;color:#58636c;font-size:10px;line-height:1.55;white-space:pre-wrap}
.drawer-tab-single{max-width:980px;margin:0 auto;background:#fff;border-radius:14px;padding:21px;box-shadow:0 10px 28px rgba(36,50,62,.055)}
.drawer-tab-heading{display:flex;justify-content:space-between;align-items:end;padding-bottom:15px;margin-bottom:14px;border-bottom:1px solid #e7eaec}
.drawer-tab-heading small{display:block;color:#98a2a9;font-size:8px}
.drawer-tab-heading h3{font:600 18px Onest;margin:4px 0 0}
.drawer-tab-heading button{border:1px solid #cfd8df;background:#fff;color:#2879db;border-radius:8px;padding:9px 11px;font:700 9px Manrope;cursor:pointer}
@media(max-width:1050px){.deal-drawer{width:calc(100% - 24px)}.bitrix-card-grid{grid-template-columns:1fr}.bitrix-card-right{order:-1}}
@media(max-width:720px){.deal-drawer{width:100%}.drawer-head{padding:18px 16px 14px}.drawer-head h2{font-size:19px}.drawer-stage{padding:10px 12px 7px}.drawer-tabs{padding:0 16px;gap:20px}.drawer-body{padding:12px 10px 24px}.drawer-stage-strip{min-width:1220px}.bitrix-card-grid{display:block}.bitrix-card-right{margin-bottom:12px}.bitrix-card-grid .deal-section{padding:16px}.deal-composer{padding:0!important}.composer-actions{align-items:flex-start;flex-direction:column}.composer-actions button{margin-left:0;width:100%}.drawer-tab-heading{align-items:flex-start;gap:12px;flex-direction:column}}

/* Deal drawer must reflow without native horizontal scrollbars. */
html,body,.deal-drawer{max-width:100%;overflow-x:hidden}.drawer-stage-step span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bitrix-card-grid,.bitrix-card-left,.bitrix-card-right,.deal-section{min-width:0;max-width:100%}.bitrix-card-grid input,.bitrix-card-grid select,.bitrix-card-grid textarea{max-width:100%;min-width:0}.inline-messenger-field{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:end;padding:10px 0;border-bottom:1px solid #eee}.inline-messenger-field small{grid-column:1/-1;color:var(--muted);font-size:8px}.inline-messenger-field select{height:38px;border:1px solid var(--line);border-radius:8px;background:#fff;padding:0 10px}.inline-messenger-field button{height:38px;border:0;border-radius:8px;background:var(--green);color:#fff;padding:0 16px;font-weight:700;cursor:pointer}.board{scrollbar-width:none}.board::-webkit-scrollbar{display:none}.kanban-scroll-control{opacity:.78!important;transition:opacity .18s ease,transform .18s ease!important}.kanban-scroll-control:hover{opacity:1!important;transform:translateY(-50%) scale(1.03)}
@media(max-width:720px){.drawer-stage-strip{min-width:0!important}.drawer-stage-step span{font-size:10px}.field-list{grid-template-columns:1fr}.inline-messenger-field{grid-template-columns:1fr}}

/* Working CRM controls: separated stages, list view, contacts and editable deal */
.board:not(.list-mode){grid-template-columns:repeat(var(--stage-count,22),250px)}
.kanban-scroll-shell{position:relative}.kanban-scroll-arrow{position:absolute;top:42%;z-index:5;width:42px;height:72px;border:0;border-radius:10px;background:rgba(255,255,255,.94);box-shadow:0 7px 24px rgba(27,40,33,.18);color:#5a6760;font-size:35px;line-height:1;cursor:pointer;opacity:0;transform:translateY(-50%);transition:opacity .18s,transform .18s}.kanban-scroll-shell:hover .kanban-scroll-arrow{opacity:1}.kanban-scroll-arrow:hover{background:#fff;color:#175b45;transform:translateY(-50%) scale(1.04)}.kanban-scroll-arrow.left{left:8px}.kanban-scroll-arrow.right{right:8px}.kanban-scroll-shell.list-active .kanban-scroll-arrow{display:none}
.board.list-mode{display:block;overflow-x:auto;padding-bottom:14px}
.deal-list-wrap{min-width:930px;background:#fff;border:1px solid var(--line);border-radius:13px;overflow:hidden}
.deal-list{width:100%;border-collapse:collapse;text-align:left}
.deal-list th{padding:12px 14px;background:#f1f3ef;color:#7a847f;font-size:8px;text-transform:uppercase;letter-spacing:.06em}
.deal-list td{padding:13px 14px;border-top:1px solid #edf0eb;font-size:10px;vertical-align:middle}
.deal-list-row{cursor:pointer}.deal-list-row:hover{background:#f8faf7}
.deal-list td strong,.deal-list td small{display:block}.deal-list td strong{font:600 11px Onest}.deal-list td small{color:var(--muted);margin-top:4px;font-size:8px}
.deal-list select{max-width:240px;border:1px solid #dce1dc;border-left:4px solid var(--stage);border-radius:7px;background:#fff;padding:8px;font:600 9px Manrope;color:var(--ink)}
.stage-progress{width:100%;height:5px;margin-top:7px;border-radius:5px;background:#e5e9e6;overflow:hidden}.stage-progress i{display:block;height:100%;min-width:5px;border-radius:5px;background:var(--stage)}.stage-progress-caption{display:block!important;margin-top:3px;color:#8b9690;font-size:7px!important}
.table-owner{display:flex;align-items:center;gap:7px}.table-owner i{width:25px;height:25px;display:grid;place-items:center;border-radius:50%;background:var(--avatar);color:#fff;font-style:normal;font-size:7px}
.channel-badge{display:inline-block;border-radius:12px;background:#edf2ef;color:#4f6f60;padding:5px 8px;font-size:8px;font-weight:700}

/* Полоса стадий: все стадии умещаются в ширину карточки, ничего не прокручиваем.
   Сегменты разделены светлым зазором, текст в одну строку с сокращением,
   текущая стадия шире соседних и читается целиком. */
.drawer-stage-scroll{overflow:hidden;padding:2px 0 4px;width:100%}
.drawer-stage-strip{display:flex;grid-template-columns:none;gap:2px;min-width:0;width:100%;padding:0}
.drawer-stage-step,.drawer-stage-step:first-child{
  position:relative;flex:1 1 0;width:auto;min-width:0;height:30px;
  display:block;overflow:hidden;
  padding:0 5px 0 13px!important;margin-right:0;
  background:#dde2e6;color:#5b666e;border:0;
  clip-path:polygon(0 0,calc(100% - 8px) 0,100% 50%,calc(100% - 8px) 100%,0 100%,8px 50%);
  filter:none;isolation:auto;
}
.drawer-stage-step:first-child{
  padding-left:8px!important;
  clip-path:polygon(0 0,calc(100% - 8px) 0,100% 50%,calc(100% - 8px) 100%,0 100%);
}
.drawer-stage-step span{
  display:block;width:100%;max-width:100%;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  font:600 10px Manrope;line-height:30px;text-align:left;-webkit-line-clamp:none;
}
.drawer-stage-step::after{display:none}
.drawer-stage-step.passed,.drawer-stage-step.active{background:var(--stage);color:#fff}
.drawer-stage-step.passed span,.drawer-stage-step.active span{font-weight:700}
.drawer-stage-step.active{flex:3.4 1 0;z-index:3;box-shadow:inset 0 0 0 2px rgba(255,255,255,.34)}
.drawer-stage-step:hover{filter:brightness(1.08)}

.bitrix-contact-card{position:relative;padding-right:132px}
.bitrix-contact-card>button{position:absolute;right:14px;top:50%;transform:translateY(-50%);border:0;background:#edf6ff;color:#287fea;border-radius:8px;padding:8px 10px;font:700 8px Manrope;cursor:pointer}
.client-chat-card{background:#fff;border-radius:14px;padding:17px 19px;margin:14px 0;box-shadow:0 9px 23px rgba(36,50,62,.05)}
.client-chat-card header{display:flex;align-items:start;gap:10px}.client-chat-card header>div{flex:1}.client-chat-card small{display:block;color:#9aa3aa;font-size:8px}.client-chat-card h3{font:600 14px Onest;margin:4px 0 0}.client-chat-card p{margin:12px 0;color:#6f7a82;font-size:9px;line-height:1.6}.client-chat-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.client-chat-card button,.client-chat-card a{border:0;border-radius:8px;background:#2f80ed;color:#fff;padding:10px 13px;font:700 9px Manrope;cursor:pointer;text-decoration:none}.client-chat-card a{background:#edf6ff;color:#287fea}.client-chat-card button:disabled{background:#d5dbe0;color:#8f999f;cursor:not-allowed}.chat-status{border-radius:12px;background:#f2ece7;color:#8a7161;padding:5px 8px;font-size:8px;font-weight:700}.chat-status.ready{background:#e6f2eb;color:#3f8861}

.deal-edit-form{max-width:1120px;margin:0 auto;background:#fff;border-radius:15px;padding:23px;box-shadow:0 10px 28px rgba(36,50,62,.055)}
.deal-edit-header{display:flex;align-items:center;justify-content:space-between;gap:18px;padding-bottom:17px;border-bottom:1px solid #e7eaec}.deal-edit-header small{display:block;color:#98a2a9;font-size:8px}.deal-edit-header h3{font:600 20px Onest;margin:4px 0 0}.deal-edit-header>div:last-child{display:flex;gap:8px}
.deal-edit-grid{display:grid;grid-template-columns:1fr 1fr;gap:17px;margin-top:18px}.deal-edit-grid section{border:1px solid #e6e9e5;border-radius:12px;padding:17px}.deal-edit-grid h4{margin:0 0 15px;font:600 13px Onest;color:#46534d}.deal-edit-grid label{display:block;margin-bottom:12px;color:#6c7771;font-size:8px;font-weight:700}.deal-edit-grid input,.deal-edit-grid select,.deal-edit-grid textarea{display:block;width:100%;margin-top:6px;border:1px solid #dfe3df;border-radius:8px;background:#fff;padding:10px 11px;color:var(--ink);font:500 10px Manrope;outline:0}.deal-edit-grid input:focus,.deal-edit-grid select:focus,.deal-edit-grid textarea:focus{border-color:#6aaef5;box-shadow:0 0 0 3px rgba(106,174,245,.11)}.deal-edit-grid input[type="datetime-local"]{color-scheme:light;cursor:pointer}.form-hint{margin:3px 0 0;color:#929b96;font-size:8px;line-height:1.5}

.contacts-toolbar{margin-bottom:12px}.contacts-toolbar input{width:min(520px,100%);border:1px solid var(--line);border-radius:9px;background:#fff;padding:12px 14px;font:500 11px Manrope;outline:0}.contacts-layout{display:grid;grid-template-columns:minmax(300px,.8fr) minmax(420px,1.2fr);gap:13px;align-items:start}.contacts-list,.contact-preview{background:#fff;border:1px solid var(--line);border-radius:13px;overflow:hidden}.contacts-list{max-height:650px;overflow-y:auto;padding:7px}.contact-list-card{width:100%;display:grid;grid-template-columns:38px 1fr auto;gap:10px;align-items:center;border:0;border-radius:9px;background:transparent;padding:10px;text-align:left;cursor:pointer}.contact-list-card:hover,.contact-list-card.active{background:#edf2ee}.contact-list-card>span,.contact-avatar-large{display:grid;place-items:center;border-radius:50%;background:var(--green);color:#fff;font-weight:700}.contact-list-card>span{width:36px;height:36px;font-size:11px}.contact-list-card strong,.contact-list-card small{display:block}.contact-list-card strong{font:600 11px Onest}.contact-list-card small{color:var(--muted);font-size:8px;margin-top:4px}.contact-list-card>b{background:var(--lime);border-radius:11px;padding:3px 7px;font-size:8px}.contact-preview{padding:22px}.contact-preview>header{display:flex;align-items:center;gap:13px;padding-bottom:17px;border-bottom:1px solid #edf0eb}.contact-avatar-large{width:52px;height:52px;font-size:13px}.contact-preview header>div:nth-child(2){flex:1}.contact-preview header small{color:var(--muted);font-size:8px}.contact-preview h3{font:600 18px Onest;margin:3px 0}.contact-preview header p{margin:0;color:var(--muted);font-size:8px}.contact-preview header button{border:1px solid var(--line);background:#fff;color:var(--green);border-radius:8px;padding:8px 10px;font:700 8px Manrope;cursor:pointer}.contact-preview dl{display:grid;grid-template-columns:1fr 1fr;gap:0 20px;margin:13px 0}.contact-preview dl>div{padding:10px 0;border-bottom:1px solid #edf0eb}.contact-preview dt{color:var(--muted);font-size:8px}.contact-preview dd{margin:5px 0 0;font-size:10px;font-weight:600}.contact-preview section h4{font:600 12px Onest;margin:18px 0 9px}.contact-preview section h4 span{color:var(--green)}.contact-deal-link{width:100%;display:flex;align-items:center;gap:10px;border:1px solid #e8ebe7;background:#fafbf9;border-radius:9px;padding:10px;margin-top:7px;text-align:left;cursor:pointer}.contact-deal-link:hover{border-color:#b9c9c0}.contact-deal-link>i{width:7px;height:34px;border-radius:5px;background:var(--stage)}.contact-deal-link>span{flex:1}.contact-deal-link strong,.contact-deal-link small{display:block}.contact-deal-link strong{font-size:10px}.contact-deal-link small{color:var(--muted);font-size:8px;margin-top:4px}.empty-contact-deals{color:var(--muted);font-size:9px}

.stage-manager-backdrop{position:fixed;inset:0;z-index:120;background:rgba(18,27,24,.58);display:grid;place-items:center;padding:20px}.stage-manager-backdrop[hidden]{display:none}.stage-manager{width:min(850px,100%);max-height:92vh;display:flex;flex-direction:column;background:#f7f8f5;border-radius:17px;box-shadow:var(--shadow);overflow:hidden}.stage-manager>header{display:flex;align-items:start;justify-content:space-between;padding:23px 25px 17px;background:#fff;border-bottom:1px solid var(--line)}.stage-manager h2{font:600 23px Onest;margin:5px 0 3px}.stage-manager header small{color:var(--muted);font-size:8px}.stage-manager>header>button{border:0;background:#eef0eb;border-radius:50%;width:32px;height:32px;font-size:18px;cursor:pointer}.stage-manager-list{overflow:auto;padding:12px 16px}.stage-manager-row{display:grid;grid-template-columns:26px 26px 1fr 48px 34px 34px 70px;gap:7px;align-items:center;background:#fff;border:1px solid #e3e6e1;border-radius:9px;padding:8px;margin-bottom:7px}.stage-manager-row.dragging{opacity:.45}.stage-drag{color:#9da49f;cursor:grab;font-size:16px;text-align:center}.stage-order{color:#8d9691;font-size:8px;text-align:center}.stage-manager-row input{min-width:0;height:34px;border:1px solid #dfe3df;border-radius:7px;padding:0 9px;font:600 10px Manrope}.stage-manager-row input[type="color"]{padding:3px}.stage-manager-row button{height:32px;border:1px solid #e0e4df;background:#f6f7f4;border-radius:7px;color:#52605a;cursor:pointer}.stage-manager-row .stage-delete{color:#a05252;font:700 8px Manrope}.stage-add-form{display:grid;grid-template-columns:1fr 56px auto;gap:8px;padding:13px 16px;border-top:1px solid var(--line);background:#fff}.stage-add-form input{height:38px;border:1px solid #dfe3df;border-radius:8px;padding:0 11px;font:500 10px Manrope}.stage-add-form input[type="color"]{padding:3px}.stage-add-form button{border:0;border-radius:8px;background:var(--green);color:#fff;padding:0 14px;font:700 9px Manrope;cursor:pointer}.stage-manager>footer{display:flex;justify-content:space-between;padding:14px 16px;background:#fff;border-top:1px solid var(--line)}

@media(max-width:900px){.deal-edit-grid,.contacts-layout{grid-template-columns:1fr}.contacts-list{max-height:360px}.stage-manager-row{grid-template-columns:24px 24px 1fr 44px 32px 32px}.stage-manager-row .stage-delete{grid-column:3/7;width:100%}}
@media(max-width:720px){.drawer-stage-step,.drawer-stage-step:first-child{width:118px;min-width:118px}.bitrix-contact-card{padding-right:15px}.bitrix-contact-card>button{position:static;transform:none;margin-top:12px}.deal-edit-form{padding:14px}.deal-edit-header{align-items:flex-start;flex-direction:column}.deal-edit-header>div:last-child{width:100%}.deal-edit-header button{flex:1}.contact-preview dl{grid-template-columns:1fr}}

/* Настраиваемые обязательные поля — по модели Bitrix: поле + набор стадий */
.field-rules-backdrop{position:fixed;inset:0;z-index:130;background:rgba(18,27,24,.58);display:grid;place-items:center;padding:20px}.field-rules-backdrop[hidden]{display:none}.field-rules-dialog{width:min(980px,100%);max-height:92vh;display:flex;flex-direction:column;overflow:hidden;border-radius:17px;background:#f7f8f5;box-shadow:var(--shadow)}.field-rules-dialog>header{display:flex;align-items:start;justify-content:space-between;padding:23px 25px 17px;background:#fff;border-bottom:1px solid var(--line)}.field-rules-dialog h2{font:600 23px Onest;margin:5px 0 3px}.field-rules-dialog header small{color:var(--muted);font-size:8px}.field-rules-dialog>header>button{border:0;background:#eef0eb;border-radius:50%;width:32px;height:32px;font-size:18px;cursor:pointer}.field-rules-layout{display:grid;grid-template-columns:270px 1fr;min-height:400px;overflow:hidden}.field-rules-layout aside{padding:17px 12px;border-right:1px solid var(--line);overflow:auto;background:#f2f4f0}.field-rules-layout aside>strong{display:block;padding:0 10px 10px;color:#6b756f;font-size:8px;text-transform:uppercase;letter-spacing:.06em}.field-rules-field-list{display:grid;gap:4px}.field-rules-field-list button{display:flex;align-items:center;justify-content:space-between;gap:8px;border:0;border-radius:8px;background:transparent;padding:10px;text-align:left;color:#55615b;font:600 10px Manrope;cursor:pointer}.field-rules-field-list button:hover,.field-rules-field-list button.active{background:#fff;color:#175b45;box-shadow:0 2px 9px rgba(36,50,62,.06)}.field-rules-field-list b{display:grid;place-items:center;min-width:21px;height:21px;border-radius:10px;background:#dfe8e2;color:#42705a;font-size:8px}.field-rules-field-list button.active b{background:#d7f0df;color:#176b41}.field-rules-content{padding:22px 25px;overflow:auto;background:#fff}.field-rules-content-head{display:flex;align-items:start;justify-content:space-between;gap:16px}.field-rules-content-head small{display:block;color:#929b96;font-size:8px}.field-rules-content h3{margin:4px 0 0;font:600 18px Onest;color:#46534d}.field-rules-content-head button{border:1px solid #d9e1dc;border-radius:7px;background:#fff;color:#2879db;padding:7px 9px;font:700 8px Manrope;cursor:pointer}.field-rules-content>p{margin:13px 0 15px;color:#8a948e;font-size:9px;line-height:1.5}.field-rules-stage-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.field-rules-stage-list label{display:flex;align-items:center;gap:8px;border:1px solid #e4e8e3;border-radius:8px;padding:10px;cursor:pointer;color:#4d5952;font:600 9px Manrope}.field-rules-stage-list label:hover{border-color:#bfcfc3;background:#f7faf7}.field-rules-stage-list input{width:15px;height:15px;accent-color:#278857}.field-rules-stage-list i{width:7px;height:25px;border-radius:5px;background:var(--stage);flex:0 0 auto}.field-rules-dialog>footer{display:flex;justify-content:flex-end;gap:9px;padding:14px 16px;background:#fff;border-top:1px solid var(--line)}.field-rule-button{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;margin-left:5px;border:1px solid #d5dfd8;border-radius:8px;background:#fff;color:#5b7c69;padding:2px 5px;font:700 7px Manrope;cursor:pointer}.field-rule-button:hover{border-color:#6ca37d;background:#eef7f0}.rule-required{margin-left:3px;color:#db594b;font-style:normal;font-size:12px}.deal-validation{margin-top:15px;border:1px solid #f1c7c0;border-radius:9px;background:#fff5f3;color:#a34c41;padding:11px 13px;font-size:9px;font-weight:700;line-height:1.45}.deal-validation[hidden]{display:none}.deal-edit-grid .is-invalid{border-color:#e17166!important;background:#fffafa}.deal-edit-grid .is-invalid:focus{box-shadow:0 0 0 3px rgba(225,113,102,.12)!important}
@media(max-width:720px){.field-rules-backdrop{padding:0}.field-rules-dialog{height:100%;max-height:100%;border-radius:0}.field-rules-layout{grid-template-columns:1fr;overflow:auto}.field-rules-layout aside{border-right:0;border-bottom:1px solid var(--line)}.field-rules-field-list{grid-template-columns:repeat(2,minmax(0,1fr))}.field-rules-stage-list{grid-template-columns:1fr}.field-rules-content{overflow:visible}}

.calendar-owner-bar{display:flex;gap:7px;flex-wrap:wrap;padding:0 0 17px;border-bottom:1px solid var(--line)}.calendar-owner-bar button{display:flex;align-items:center;gap:7px;border:1px solid #dfe5df;border-radius:18px;background:#fff;padding:7px 10px;color:#66716b;font:600 9px Manrope;cursor:pointer}.calendar-owner-bar button.active{border-color:#80b795;background:#edf8f0;color:#175b45}.calendar-owner-bar i{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:var(--avatar);color:#fff;font-style:normal;font-size:7px}
.calendar-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:16px 0 11px}.calendar-navigation,.calendar-view-switch{display:flex;align-items:center;gap:4px}.calendar-navigation button,.calendar-view-switch button{height:31px;border:1px solid #dfe5df;background:#fff;color:#60706a;padding:0 10px;font:600 9px Manrope;cursor:pointer}.calendar-navigation button:first-child{border-radius:8px 0 0 8px}.calendar-navigation button:last-child{border-radius:0 8px 8px 0}.calendar-navigation .today-button{border-radius:8px;margin:0 3px;color:#175b45}.calendar-view-switch{background:#f0f2ed;border-radius:9px;padding:3px}.calendar-view-switch button{border:0;border-radius:6px;height:27px}.calendar-view-switch button.active{background:#fff;color:#175b45;box-shadow:0 1px 4px rgba(23,40,31,.12)}.calendar-range-title{font:600 17px Onest;padding:0 0 14px}.calendar-grid-shell{min-width:0}.calendar-time-view{--time-gutter:72px;min-width:820px;border:1px solid #e5e8e2;border-radius:10px;overflow:hidden;background:#fff}.calendar-time-head{display:grid;grid-template-columns:var(--time-gutter) repeat(var(--calendar-days,7),minmax(112px,1fr));border-bottom:1px solid #e4e8e1;background:#fafbf9}.calendar-time-head>span{border-right:1px solid #e6e9e4}.calendar-time-head>button{border:0;border-left:1px solid #e6e9e4;background:transparent;padding:9px 5px;cursor:pointer;color:#65716a}.calendar-time-head small,.calendar-time-head strong{display:block}.calendar-time-head small{text-transform:uppercase;font-size:8px;color:#9ba39f}.calendar-time-head strong{font:600 14px Onest;margin-top:3px}.calendar-time-head button.today strong{width:25px;height:25px;display:grid;place-items:center;border-radius:50%;margin:3px auto 0;background:#175b45;color:#fff}.calendar-time-body{display:grid;grid-template-columns:var(--time-gutter) minmax(0,1fr);max-height:680px;overflow:auto;scrollbar-gutter:stable}.calendar-time-labels{display:grid;grid-template-rows:repeat(var(--calendar-row-count,19),58px);background:#fafbf9;border-right:1px solid #e6e9e4}.calendar-time-labels span{padding:0 10px 0 0;text-align:right;transform:translateY(-7px);color:#9aa39e;font-size:8px;line-height:1}.calendar-time-columns{display:grid;grid-template-columns:repeat(var(--calendar-days,7),minmax(112px,1fr));min-width:100%}.calendar-time-column{position:relative;min-height:812px;border-right:1px solid #e7eae6;cursor:crosshair}.calendar-time-column:last-child{border-right:0}.calendar-time-column>i{display:block;height:58px;border-bottom:1px solid #eef0ec}.calendar-event-position{position:absolute;left:5px;right:5px;z-index:2;min-height:42px}.calendar-event{display:block;width:100%;min-height:42px;overflow:hidden;border:0;border-left:3px solid #547cca;border-radius:5px;background:#e8f0ff;color:#2d5487;padding:6px 7px;text-align:left;font:600 8px Manrope;cursor:pointer}.calendar-event:hover{filter:brightness(.96)}.calendar-event b,.calendar-event span,.calendar-event small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.calendar-event b{font-size:8px}.calendar-event span{margin-top:2px}.calendar-event small{font-weight:500;margin-top:3px;opacity:.78}.calendar-now-line{position:absolute;z-index:4;left:0;right:0;height:2px;background:#e24942;pointer-events:none}.calendar-now-line i{position:absolute;left:-5px;top:-4px;width:10px;height:10px;border-radius:50%;background:#e24942}.calendar-quick-create{position:absolute;z-index:8;top:var(--quick-top,5px);left:6px;right:6px;min-width:170px;border:1px solid #6d9bee;border-radius:8px;background:#fff;box-shadow:0 10px 26px rgba(36,68,112,.22);padding:8px;cursor:default}.calendar-quick-create>input{display:block;width:100%;border:0;border-bottom:1px solid #e3e9f2;padding:4px 2px 8px;outline:0;font:600 10px Manrope;color:#273a58}.calendar-quick-create>div{display:flex;align-items:center;gap:5px;margin-top:7px}.calendar-quick-create input[type="time"]{width:68px;height:25px;border:1px solid #d8e1ef;border-radius:5px;padding:0 4px;font:600 8px Manrope}.calendar-quick-create button{height:25px;border:0;border-radius:5px;background:#edf1f6;color:#607080;padding:0 7px;font:700 8px Manrope;cursor:pointer}.calendar-quick-create button[type="submit"]{margin-left:auto;background:#286fe5;color:#fff}.calendar-month-view{border:1px solid #e5e8e2;border-radius:10px;overflow:hidden}.calendar-month-weekdays,.calendar-month-grid{display:grid;grid-template-columns:repeat(7,minmax(105px,1fr))}.calendar-month-weekdays{background:#fafbf9;border-bottom:1px solid #e6e9e4}.calendar-month-weekdays span{padding:10px;text-align:center;color:#89938d;text-transform:uppercase;font-size:8px}.calendar-month-grid{min-height:620px}.calendar-month-day{position:relative;min-height:103px;padding:6px;border-right:1px solid #e7eae6;border-bottom:1px solid #e7eae6;background:#fff;cursor:pointer}.calendar-month-day:nth-child(7n){border-right:0}.calendar-month-day.outside{background:#fafbf9;color:#b8bfba}.calendar-month-day>button{display:grid;place-items:center;width:23px;height:23px;border:0;border-radius:50%;background:transparent;color:inherit;font:600 10px Onest;cursor:pointer}.calendar-month-day.today>button{background:#175b45;color:#fff}.calendar-month-day .calendar-event{min-height:20px;margin-top:3px;padding:3px 5px;border-left-width:2px;font-size:7px}.calendar-month-day .calendar-event b{display:inline}.calendar-month-day .calendar-event span{display:inline;margin-left:2px}.calendar-month-day>small{display:block;color:#748078;font-size:7px;margin:4px 0 0 5px}.schedule .meeting-row{width:100%;border-left:0;border-right:0;border-top:0;background:#fff;text-align:left;cursor:pointer}.schedule .meeting-row:hover{background:#fafcf9}
@media(max-width:720px){.calendar-toolbar{align-items:flex-start;flex-direction:column}.calendar-view-switch{width:100%;overflow-x:auto}.calendar-view-switch button{flex:0 0 auto}.calendar-grid-shell{overflow-x:auto;padding-bottom:5px}.calendar-time-view{--calendar-days:7}.calendar-month-view{min-width:735px}.calendar-range-title{font-size:15px}.calendar-month-day{min-height:92px}}
.deal-composer{position:relative}
.deal-composer>.composer-actions{margin-top:0}.bitrix-task-editor{margin:16px;border:1px solid #d2d8dc;border-radius:12px;background:#fff;overflow:visible}.bitrix-task-title{display:block;width:100%;border:0!important;margin:0!important;padding:16px 18px 8px!important;color:#404a52!important;font:500 15px Onest!important;outline:0}.bitrix-task-title::placeholder{color:#404a52;opacity:1}.bitrix-task-body textarea{width:100%!important;min-height:72px!important;margin:0!important;border:0!important;border-radius:0!important;padding:9px 18px 14px!important;box-shadow:none!important}.bitrix-task-body textarea::placeholder{color:#b3b9bd}.bitrix-task-editor footer{display:flex;align-items:center;gap:10px;padding:12px 18px;border-top:1px solid #edf0f1}.bitrix-task-date{display:flex;align-items:center;gap:8px;border:1px solid #77cdf9;border-radius:8px;padding:8px 10px;color:#596572;background:#fff}.bitrix-task-date span{color:#7d8992}.bitrix-task-date input{width:174px;border:0;background:transparent;color:#596572;font:500 10px Manrope;outline:0}.bitrix-task-bell{border:0;background:transparent;color:#9aa4ac;font-size:17px;cursor:pointer}.bitrix-task-bell.active{color:#e5a42e}.bitrix-task-assignee{display:none}.bitrix-task-actions{margin-left:auto;border:1px solid #77cdf9;background:#fff;color:#68757e;border-radius:8px;padding:10px 13px;font:600 10px Manrope;cursor:pointer}.bitrix-task-actions-menu{position:absolute;right:16px;z-index:8;width:270px;margin-top:7px;border-radius:13px;background:#fff;padding:12px;box-shadow:0 13px 34px rgba(35,49,60,.2)}.bitrix-task-actions-menu[hidden]{display:none}.bitrix-task-actions-menu button,.task-file-action{display:block;width:100%;border:0;background:#fff;padding:12px 10px;color:#4c5760;text-align:left;font:500 11px Manrope;cursor:pointer}.bitrix-task-actions-menu button:hover,.task-file-action:hover{background:#f2f8fc;color:#287fea}.task-file-action{box-sizing:border-box}.task-composer-controls,.task-actions-menu{display:none!important}
.task-context-panel{margin:0 18px 14px;padding:12px;border-radius:10px;background:#f4f8fb;color:#4c5760;font:500 10px Manrope}.task-context-panel[hidden]{display:none}.task-context-panel>strong{display:block;margin-bottom:8px}.task-context-panel label{display:block;margin:6px 0}.task-context-panel select{width:100%;margin-top:6px;border:1px solid #d6dde2;border-radius:8px;background:#fff;padding:9px;font:500 10px Manrope}
.deal-task-meta{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.deal-task-meta span,.deal-task-meta a{border-radius:6px;background:#eef5fb;color:#3973a8;padding:5px 7px;font:600 8px Manrope;text-decoration:none}.deal-task-meta a:hover{text-decoration:underline}
.quick-date-field{position:relative;cursor:pointer}.quick-date-field:hover{background:#f8fbfd}.quick-date-field::after{content:'Изменить';position:absolute;right:0;top:12px;color:#287fea;font-size:8px;opacity:0}.quick-date-field:hover::after{opacity:1}.quick-date-popover{position:absolute;left:0;top:calc(100% - 3px);z-index:9;width:285px;border:1px solid #d7e4ec;border-radius:10px;background:#fff;padding:12px;box-shadow:0 12px 30px rgba(35,49,60,.18);cursor:default}.quick-date-popover strong{display:block;margin-bottom:8px;color:#56616b;font-size:9px}.quick-date-popover input{width:100%;border:1px solid #77cdf9;border-radius:7px;padding:9px;font:500 10px Manrope;outline:0}.quick-date-popover>div{display:flex;justify-content:flex-end;gap:7px;margin-top:10px}.quick-date-popover button{border:0;border-radius:7px;background:#60bee9;color:#fff;padding:8px 10px;font:700 8px Manrope;cursor:pointer}.quick-date-popover [data-quick-cancel]{background:#eff2f3;color:#69747c}
.bitrix-date-picker{position:absolute;left:0;top:calc(100% - 2px);z-index:12;width:292px;border:1px solid #d8e0e5;border-radius:3px;background:#fff;padding:14px;box-shadow:0 9px 24px rgba(37,52,64,.22);cursor:default}.bitrix-date-picker header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.bitrix-date-picker header strong{font:600 11px Onest;color:#4b565e;text-transform:capitalize}.bitrix-date-picker header button{border:0;background:transparent;color:#7d8992;font-size:20px;line-height:1;cursor:pointer}.picker-weekdays,.picker-days{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;text-align:center}.picker-weekdays{margin-bottom:4px;color:#a3abb1;font-size:7px}.picker-days i,.picker-days button{height:29px;border:0;border-radius:2px;background:#fff;color:#4c5760;font:500 9px Manrope}.picker-days button{cursor:pointer}.picker-days button:hover{background:#eaf5ff;color:#287fea}.picker-days button.selected{background:#2f80ed;color:#fff;font-weight:700}.picker-days button:disabled,.picker-days button:disabled:hover{background:#fff;color:#c9cfd3;cursor:not-allowed;text-decoration:line-through}.picker-days button.selected:disabled{background:#e4e8eb;color:#a8b0b6}.picker-time{margin-top:10px;border-top:1px solid #edf0f2;padding-top:10px;color:#7d8790;font-size:8px}.picker-time select{border:1px solid #d6dde2;border-radius:4px;background:#fff;padding:5px;color:#56616b;font:500 9px Manrope}.bitrix-date-picker footer{display:flex;justify-content:flex-end;gap:7px;margin-top:12px}.bitrix-date-picker footer button{border:0;border-radius:3px;background:#edf0f2;color:#65717a;padding:7px 10px;font:700 8px Manrope;cursor:pointer}.bitrix-date-picker footer [data-picker-save]{background:#2f80ed;color:#fff}
.calendar-draft-preview{position:absolute;z-index:6;left:5px;right:5px;min-height:42px;box-sizing:border-box;overflow:hidden;border-radius:7px;background:#4b9ee2;color:#fff;box-shadow:0 4px 12px rgba(39,111,183,.24);padding:7px 8px;pointer-events:none}.calendar-draft-preview strong,.calendar-draft-preview span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.calendar-draft-preview strong{font:700 10px Manrope}.calendar-draft-preview span{margin-top:2px;font:600 9px Manrope;opacity:.94}.calendar-time-column.is-calendar-dragging{user-select:none}.calendar-time-column.is-calendar-dragging>i{cursor:ns-resize}
.personal-login-backdrop{position:fixed;inset:0;z-index:150;display:grid;place-items:center;padding:24px;background:rgba(13,25,21,.58);backdrop-filter:blur(5px)}.personal-login-backdrop[hidden]{display:none}.personal-login-dialog{width:min(940px,100%);max-height:calc(100vh - 48px);overflow:auto;border:1px solid rgba(255,255,255,.35);border-radius:20px;background:#f8faf8;box-shadow:0 28px 80px rgba(5,18,13,.34)}.personal-login-dialog>header{display:flex;align-items:center;justify-content:space-between;padding:22px 24px 17px}.personal-login-dialog>header small{color:var(--green);font:700 9px Manrope;letter-spacing:.13em}.personal-login-dialog>header h2{margin:5px 0 0;font:600 23px Onest}.personal-login-close{width:37px;height:37px;border:1px solid var(--line);border-radius:50%;background:#fff;color:#5e6964;font-size:22px;cursor:pointer}.personal-browser-toolbar{display:flex;align-items:center;justify-content:space-between;margin:0 24px;border:1px solid #dce2de;border-bottom:0;border-radius:12px 12px 0 0;background:#eef2ef;padding:9px 12px}.personal-browser-toolbar span{display:flex;align-items:center;gap:8px;min-width:0}.personal-browser-toolbar i{width:8px;height:8px;border-radius:50%;background:#56b579;box-shadow:0 0 0 4px rgba(86,181,121,.13)}.personal-browser-toolbar b{overflow:hidden;color:#64706a;font:600 10px Manrope;text-overflow:ellipsis;white-space:nowrap}.personal-browser-toolbar button{border:1px solid #d6ddd8;border-radius:8px;background:#fff;color:#476558;padding:8px 11px;font:700 9px Manrope;cursor:pointer}.personal-browser-frame{position:relative;display:grid;place-items:center;min-height:480px;margin:0 24px;overflow:hidden;border:1px solid #dce2de;border-radius:0 0 12px 12px;background:#dfe9e4}.personal-browser-frame img{display:block;width:100%;height:auto;max-height:620px;object-fit:contain}.personal-browser-frame img[hidden]{display:none}.personal-browser-loading{color:#6d7873;font:600 12px Manrope}.personal-login-status{margin:14px 24px 0;border-radius:10px;background:#fff3d9;color:#876322;padding:12px 14px;font:600 10px Manrope}.personal-login-status.ready{background:#e1f2e8;color:#237148}.personal-login-dialog>footer{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:14px 24px 22px}.personal-login-dialog>footer p{margin:0;color:var(--muted);font-size:9px}
@media(max-width:720px){.personal-login-backdrop{padding:0}.personal-login-dialog{width:100%;max-height:100vh;min-height:100vh;border:0;border-radius:0}.personal-login-dialog>header{padding:18px}.personal-browser-toolbar,.personal-browser-frame{margin-left:12px;margin-right:12px}.personal-browser-frame{min-height:330px}.personal-login-status{margin-left:12px;margin-right:12px}.personal-login-dialog>footer{align-items:flex-start;flex-direction:column;padding:13px 12px 20px}.personal-login-dialog>footer button{width:100%}}

/* Рабочая серверная авторизация */
.auth-pending{overflow:hidden}.auth-pending .app-shell{visibility:hidden}.auth-gate{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;overflow:auto;padding:28px;background:radial-gradient(circle at 18% 18%,rgba(217,242,106,.26),transparent 31%),linear-gradient(145deg,#eef1e9 0%,#f7f7f3 54%,#e5eee8 100%)}.auth-gate[hidden]{display:none}.auth-card{width:min(470px,100%);border:1px solid rgba(23,91,69,.12);border-radius:24px;background:rgba(255,255,255,.96);padding:34px 38px;box-shadow:0 30px 90px rgba(24,49,37,.15)}.auth-brand{display:flex;align-items:center;gap:10px;color:var(--green)}.auth-brand strong{font:700 23px Onest}.auth-copy{margin:34px 0 25px}.auth-copy>span{color:var(--green);font-size:9px;font-weight:700;letter-spacing:.14em;text-transform:uppercase}.auth-copy h1{margin:7px 0 9px;font:600 29px/1.12 Onest}.auth-copy p{margin:0;color:var(--muted);font-size:10px;line-height:1.6}.auth-tabs{display:grid;grid-template-columns:1fr 1fr;margin-bottom:20px;border-radius:10px;background:#edf0eb;padding:4px}.auth-tabs button{border:0;border-radius:7px;background:transparent;padding:9px;color:#7b847f;font:700 10px Manrope;cursor:pointer}.auth-tabs button.active{background:#fff;color:var(--green);box-shadow:0 2px 8px rgba(31,57,44,.08)}.auth-form{display:grid;gap:14px}.auth-form[hidden]{display:none}.auth-form label{color:#59645e;font-size:9px;font-weight:700}.auth-form input{display:block;width:100%;height:45px;margin-top:7px;border:1px solid #dce2dd;border-radius:10px;background:#fff;padding:0 13px;color:var(--ink);font:500 12px Manrope;outline:0}.auth-form input:focus{border-color:#5f9b81;box-shadow:0 0 0 3px rgba(58,128,96,.1)}.auth-name-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.auth-submit{height:45px;margin-top:4px;border:0;border-radius:10px;background:var(--green);color:#fff;font:700 11px Manrope;cursor:pointer}.auth-submit:hover{background:#104b3a}.auth-submit:disabled{cursor:wait;opacity:.65}.auth-message{margin-top:15px;border-radius:9px;background:#fff1e2;color:#8a5c35;padding:11px 12px;font:600 9px/1.5 Manrope}.auth-message.success{background:#e6f4eb;color:#286b49}.auth-message[hidden]{display:none}.auth-footnote{display:block;margin-top:17px;color:#9aa19d;font-size:8px;line-height:1.5}.employee-card .employee-actions{margin-left:auto;display:flex;gap:7px}.employee-card .pending-label{color:#9a6e37;background:#fff1dc;border-radius:12px;padding:5px 8px;font-size:8px}.employee-card button.approve-user{background:#e3f2e8;color:#226b47}
.auth-password-field{position:relative;display:block}.auth-password-field input{padding-right:48px}.auth-password-toggle{position:absolute;right:5px;bottom:5px;width:36px;height:36px;display:grid;place-items:center;border:0;border-radius:8px;background:transparent;color:#7f8984;cursor:pointer}.auth-password-toggle:hover{background:#edf2ee;color:var(--green)}.auth-password-toggle:focus-visible{outline:2px solid #5f9b81;outline-offset:1px}.auth-password-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8}.auth-password-toggle.is-visible svg path{stroke-dasharray:4 2}
@media(max-width:560px){.auth-gate{padding:0}.auth-card{min-height:100vh;border:0;border-radius:0;padding:28px 22px}.auth-copy{margin-top:45px}.auth-copy h1{font-size:26px}.auth-name-row{grid-template-columns:1fr}}

.crm-chat-backdrop{position:fixed;inset:0;z-index:190;display:grid;place-items:center;padding:24px;background:rgba(13,23,20,.62);backdrop-filter:blur(4px)}.crm-chat-backdrop[hidden]{display:none}.crm-chat-dialog{width:min(760px,100%);height:min(820px,calc(100vh - 48px));display:grid;grid-template-rows:auto auto 1fr auto;overflow:hidden;border:1px solid rgba(255,255,255,.45);border-radius:20px;background:#eef3f0;box-shadow:0 28px 85px rgba(3,17,12,.38)}.crm-chat-header{display:flex;align-items:center;gap:13px;padding:18px 20px;background:#fff;border-bottom:1px solid var(--line)}.crm-chat-avatar{display:grid;flex:0 0 auto;place-items:center;width:46px;height:46px;border-radius:50%;background:var(--green);color:#fff;font:700 15px Onest}.crm-chat-heading{flex:1;min-width:0}.crm-chat-heading small{display:block;color:#38826a;font:700 8px Manrope;letter-spacing:.08em;text-transform:uppercase}.crm-chat-heading h2{overflow:hidden;margin:3px 0 2px;color:#1f2824;font:600 18px Onest;text-overflow:ellipsis;white-space:nowrap}.crm-chat-heading span{display:block;color:#8a9690;font-size:8px}.crm-chat-header>a{flex:0 0 auto;border-radius:9px;background:#eef6ff;color:#287fea;padding:9px 11px;font:700 8px Manrope;text-decoration:none}.crm-chat-close{display:grid;flex:0 0 auto;place-items:center;width:36px;height:36px;border:1px solid #e0e5e1;border-radius:50%;background:#f8faf8;color:#66716b;font-size:22px;line-height:1;cursor:pointer}.crm-chat-context{padding:10px 20px;border-bottom:1px solid #efe4b8;background:#fff9e8;color:#756a43;font:600 9px Manrope}.crm-chat-context[hidden]{display:none}.crm-chat-messages{min-height:0;overflow:auto;padding:22px;display:flex;flex-direction:column;gap:8px;background:linear-gradient(rgba(239,245,241,.92),rgba(239,245,241,.92)),radial-gradient(circle at 20% 20%,#dce9e1 1px,transparent 1px);background-size:auto,20px 20px}.crm-chat-message{display:flex}.crm-chat-message.incoming{justify-content:flex-start}.crm-chat-message.outgoing{justify-content:flex-end}.crm-chat-message>div{max-width:min(74%,560px);border-radius:13px;padding:10px 12px;box-shadow:0 2px 8px rgba(27,54,42,.08)}.crm-chat-message.incoming>div{border-bottom-left-radius:5px;background:#fff}.crm-chat-message.outgoing>div{border-bottom-right-radius:5px;background:#dff2e7}.crm-chat-message p{margin:0;color:#29332f;font:500 10px/1.55 Manrope;white-space:pre-wrap;word-break:break-word}.crm-chat-message time{display:block;margin-top:4px;color:#87928d;font:500 7px Manrope;text-align:right}.crm-chat-composer{display:grid;grid-template-columns:1fr auto;gap:10px;padding:14px;background:#fff;border-top:1px solid var(--line)}.crm-chat-composer textarea{min-height:44px;max-height:130px;resize:none;border:1px solid #dce3de;border-radius:12px;background:#fbfcfb;padding:12px 14px;color:#27302c;font:500 10px/1.45 Manrope;outline:0}.crm-chat-composer textarea:focus{border-color:#65a98c;box-shadow:0 0 0 3px rgba(64,145,108,.1)}.crm-chat-composer button{align-self:end;height:44px;border:0;border-radius:11px;background:var(--green);color:#fff;padding:0 18px;font:700 9px Manrope;cursor:pointer}.crm-chat-composer button:disabled{cursor:wait;opacity:.55}.crm-chat-loading,.crm-chat-empty{margin:auto;color:#7c8983;font:600 10px Manrope;text-align:center}
@media(max-width:720px){.crm-chat-backdrop{padding:0}.crm-chat-dialog{width:100%;height:100vh;border:0;border-radius:0}.crm-chat-header{padding:13px 14px}.crm-chat-avatar{width:40px;height:40px}.crm-chat-heading h2{font-size:16px}.crm-chat-header>a{display:none}.crm-chat-messages{padding:14px}.crm-chat-message>div{max-width:86%}.crm-chat-composer{padding:10px}.crm-chat-composer button{padding:0 12px}}

/* Keep every robot inside its own fixed-width stage column. */
.automation-grid>.robot-column{min-width:0;width:190px;max-width:190px;overflow:hidden}
.robot-column>.robot-stack,.robot-stack>.robot-card{min-width:0;width:100%;max-width:100%;overflow:hidden}
.robot-card .robot-title strong,.robot-card>em{min-width:0;max-width:100%;overflow-wrap:anywhere;word-break:break-word}
.robot-card>em{width:fit-content;max-width:calc(100% - 21px)}

.google-calendar-backdrop{position:fixed;inset:0;z-index:210;display:grid;place-items:center;padding:24px;background:rgba(13,23,20,.58);backdrop-filter:blur(4px)}.google-calendar-backdrop[hidden]{display:none}.google-calendar-dialog{width:min(720px,100%);max-height:calc(100vh - 48px);overflow:auto;border-radius:18px;background:#fff;padding:26px;box-shadow:0 28px 85px rgba(3,17,12,.35)}.google-calendar-dialog>header{display:flex;align-items:start;justify-content:space-between;gap:20px;padding-bottom:17px;border-bottom:1px solid var(--line)}.google-calendar-dialog>header h2{margin:5px 0;font:600 24px Onest}.google-calendar-dialog>header small{display:block;color:var(--muted);font-size:9px;line-height:1.55}.google-calendar-dialog>header button{flex:0 0 auto;width:34px;height:34px;border:0;border-radius:50%;background:#eef1ed;color:#56625c;font-size:21px;cursor:pointer}.google-calendar-steps{display:grid;gap:9px;margin:18px 0}.google-calendar-steps>div{display:grid;grid-template-columns:28px 1fr;gap:10px;align-items:start}.google-calendar-steps b{display:grid;place-items:center;width:27px;height:27px;border-radius:50%;background:#e5f1e9;color:var(--green);font:700 10px Manrope}.google-calendar-steps p{margin:4px 0;color:#53605a;font:500 9px/1.55 Manrope}.google-calendar-steps a{color:#287fea;font-weight:700}.google-calendar-dialog label{display:block;margin:0 0 13px;color:#4f5a55;font:700 9px Manrope}.google-calendar-dialog input{display:block;width:100%;height:43px;margin-top:7px;border:1px solid #dbe2dd;border-radius:9px;background:#fff;padding:0 12px;color:#25302b;font:500 11px Manrope;outline:0}.google-calendar-dialog input:focus{border-color:#65a98c;box-shadow:0 0 0 3px rgba(64,145,108,.1)}.google-calendar-dialog label>small{display:block;margin-top:5px;color:var(--muted);font:500 8px/1.45 Manrope}.google-copy-row,.google-secret-row{position:relative;display:grid;grid-template-columns:1fr auto;gap:7px}.google-copy-row input,.google-secret-row input{margin-top:7px}.google-copy-row button{align-self:end;height:43px;border:0;border-radius:9px;background:#eaf3ee;color:var(--green);padding:0 13px;font:700 9px Manrope;cursor:pointer}.google-secret-row{display:block}.google-secret-row input{padding-right:48px}.google-secret-row button{position:absolute;right:5px;bottom:5px;width:34px;height:33px;border:0;border-radius:7px;background:#eef2ef;color:#68746e;cursor:pointer}.google-calendar-message{margin:12px 0;border-radius:9px;background:#fff0e1;color:#8a5c35;padding:10px 12px;font:600 9px/1.5 Manrope}.google-calendar-message.success{background:#e6f4eb;color:#286b49}.google-calendar-message[hidden]{display:none}.google-calendar-dialog footer{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}.google-calendar-note{margin:17px 0 0;border-radius:9px;background:#f1f4f2;color:#758079;padding:10px 12px;font:500 8px/1.5 Manrope}@media(max-width:640px){.google-calendar-backdrop{padding:0}.google-calendar-dialog{width:100%;max-height:100vh;min-height:100vh;border-radius:0;padding:20px}.google-calendar-dialog>header h2{font-size:21px}.google-copy-row{grid-template-columns:1fr}.google-copy-row button{width:100%}.google-calendar-dialog footer{position:sticky;bottom:-20px;display:grid;grid-template-columns:1fr 1fr;background:#fff;padding:12px 0 0}.google-calendar-dialog footer .primary-button{grid-column:1/3}}

.max-phone-login{display:grid;grid-template-columns:minmax(210px,.8fr) minmax(360px,1.2fr);gap:18px;margin:0 24px 18px;padding:18px;border:1px solid #dce4de;border-radius:14px;background:#fff}.max-phone-login[hidden],.max-phone-login form[hidden],.personal-login-divider[hidden]{display:none}.max-phone-login small{color:var(--green);font:700 8px Manrope;letter-spacing:.1em;text-transform:uppercase}.max-phone-login h3{margin:5px 0 6px;font:600 17px Onest;color:#15221d}.max-phone-login>div>p{margin:0;color:var(--muted);font-size:9px;line-height:1.55}.max-phone-login form{align-self:center}.max-phone-login label{display:block;margin-bottom:6px;color:#52615a;font:700 9px Manrope}.max-phone-login form>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.max-phone-login input{min-width:0;height:43px;border:1px solid #ccd7d0;border-radius:9px;background:#fbfcfb;padding:0 12px;color:#17231e;font:600 11px Manrope;outline:0}.max-phone-login input:focus{border-color:#2d674f;box-shadow:0 0 0 3px rgba(45,103,79,.1)}.max-phone-login button{height:43px;border:0;border-radius:9px;background:var(--green);color:#fff;padding:0 16px;font:700 10px Manrope;cursor:pointer}.max-phone-login button:disabled{cursor:wait;opacity:.62}.max-login-help{grid-column:2;margin:0;color:#5c6a63;font:600 9px Manrope}.max-login-help.error{color:#a44232}.personal-login-divider{display:flex;align-items:center;gap:12px;margin:0 24px 12px;color:#87928d;font:600 8px Manrope;text-transform:uppercase;letter-spacing:.08em}.personal-login-divider:before,.personal-login-divider:after{content:"";height:1px;flex:1;background:#dfe5e1}@media(max-width:720px){.max-phone-login{grid-template-columns:1fr;margin:0 12px 15px;padding:15px}.max-login-help{grid-column:1}.max-phone-login form>div{grid-template-columns:1fr}.max-phone-login button{width:100%}.personal-login-divider{margin-left:12px;margin-right:12px}}
.integration-card-clickable{cursor:pointer;transition:border-color .18s,box-shadow .18s,transform .18s}.integration-card-clickable:hover,.integration-card-clickable:focus-visible{border-color:#a9c4b6;box-shadow:0 9px 24px rgba(23,91,69,.1);outline:0;transform:translateY(-1px)}.personal-login-footer-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}.personal-login-footer-actions [hidden]{display:none}@media(max-width:720px){.personal-login-footer-actions{display:grid;width:100%;grid-template-columns:1fr}.personal-login-dialog>footer .personal-login-footer-actions button{width:100%}}
.personal-browser-frame[role="application"]{cursor:default;outline:0;touch-action:none}.personal-browser-frame[role="application"] img{pointer-events:none;user-select:none;-webkit-user-drag:none}.personal-browser-frame[role="application"]:focus{box-shadow:inset 0 0 0 3px rgba(45,103,79,.62)}.personal-browser-frame[role="application"] .personal-browser-loading{pointer-events:none}

/* Серверные роботы: тестовый план и журнал (CLAUDE_OVERNIGHT_TASK.md §5).
   Используются существующие токены Orbito, новый визуальный стиль не вводится. */
.robot-console-head{margin-top:28px}
.robot-console{background:var(--panel,#fff);border:1px solid var(--line,#e4e5df);border-radius:18px;padding:18px;box-shadow:var(--shadow,0 14px 40px rgba(24,38,31,.08))}
.robot-console-bar{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.robot-console-bar label{font-size:12px;color:var(--muted,#77807b)}
.robot-console-bar select{min-width:170px;padding:8px 10px;border:1px solid var(--line,#e4e5df);border-radius:10px;background:#fff;font:inherit;color:inherit}
.robot-console-note{margin:12px 0 0;font-size:13px;color:var(--muted,#77807b)}
.robot-console-subtitle{margin:22px 0 10px;font-size:14px}
.robot-console-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:22px 0 10px}
.robot-console-toolbar .robot-console-subtitle{margin:0}
.robot-console-toolbar-actions{display:flex;gap:8px;align-items:center}
.robot-console-plan,.robot-console-jobs{display:grid;gap:8px;margin-top:12px}
.robot-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:start;padding:11px 13px;border:1px solid var(--line,#e4e5df);border-radius:12px;background:#fbfbf8}
.robot-row strong{font-size:13px;font-weight:600}
.robot-row small{display:block;font-size:12px;color:var(--muted,#77807b);margin-top:3px;word-break:break-word}
.robot-row pre{margin:8px 0 0;white-space:pre-wrap;font:inherit;font-size:12px;color:#3d4744;background:#f4f4ef;border-radius:8px;padding:8px 10px;max-height:150px;overflow:auto}
.robot-row-state{justify-self:end;white-space:nowrap;font-size:11px;letter-spacing:.02em;text-transform:uppercase;padding:4px 9px;border-radius:999px;background:#eef0ea;color:#5b655f}
.robot-row-state.ok{background:#e4f3ea;color:#175b45}
.robot-row-state.wait{background:#fbf2dd;color:#8a6a1f}
.robot-row-state.stop{background:#f7e6e4;color:#8c4b45}
.robot-row-state.mute{background:#eef0ea;color:#77807b}
.robot-summary-list{margin:8px 0 0 0;padding:0 0 0 17px;list-style:disc;display:grid;gap:5px;word-break:break-word}
.robot-summary-list li{font-size:12px;color:var(--muted,#77807b);line-height:1.35}
@media(max-width:720px){.robot-console-bar{display:grid;grid-template-columns:1fr}.robot-console-bar select,.robot-console-bar button{width:100%}.robot-row{grid-template-columns:1fr}.robot-row-state{justify-self:start}}

/* Выбор календаря Google — в существующем стиле полей мастера. */
.google-calendar-picker{display:flex;gap:8px;align-items:center}
.google-calendar-picker select{flex:1;min-width:0;padding:9px 10px;border:1px solid var(--line,#e4e5df);border-radius:10px;background:#fff;font:inherit;color:inherit}
.google-calendar-picker button[hidden]{display:none}
.google-calendar-message.success{color:#175b45}
@media(max-width:720px){.google-calendar-picker{display:grid;grid-template-columns:1fr}}


/* Стрелки воронки остаются по краям доски, но закреплены в области экрана:
   до них не нужно прокручивать страницу вниз. position:fixed держит их в
   видимой части окна на любой высоте доски. */
.kanban-scroll-arrow{position:fixed!important;top:50vh!important;transform:translateY(-50%)!important;opacity:1!important;display:grid!important;place-items:center;z-index:30;width:40px;height:76px;border:1px solid var(--line,#e4e5df);border-radius:11px;background:rgba(255,255,255,.96);box-shadow:0 8px 26px rgba(27,40,33,.16);color:#5a6760;font-size:30px;line-height:1;cursor:pointer;transition:background .16s ease,color .16s ease,box-shadow .16s ease}
.kanban-scroll-arrow.left{left:246px!important;right:auto!important}
.kanban-scroll-arrow.right{right:16px!important;left:auto!important}
.kanban-scroll-arrow:hover,.kanban-scroll-arrow:focus-visible{background:#fff;color:var(--green,#175b45);box-shadow:0 10px 30px rgba(27,40,33,.22);outline:0;transform:translateY(-50%)!important}
.kanban-scroll-arrow:active{background:#eef2ee}
/* В режиме списка прокручивать нечего. */
.kanban-scroll-shell.list-active .kanban-scroll-arrow{display:none!important}
@media(max-width:1000px){.kanban-scroll-arrow.left{left:238px!important}}
@media(max-width:720px){.kanban-scroll-arrow{width:34px;height:62px;font-size:25px}.kanban-scroll-arrow.left{left:8px!important}.kanban-scroll-arrow.right{right:8px!important}}

/* Цветовые метки карточек: что горит — видно без чтения. */
.lead-card{position:relative}
.lead-flag{display:block;margin:-2px 0 8px;padding:3px 7px;border-radius:5px;font:700 9px Manrope;letter-spacing:.01em}
.lead-card.state-today{border-left:3px solid #d98b2b}
.lead-card.state-today .lead-flag{background:#fbf1de;color:#8a5a12}
.lead-card.state-overdue{border-left:3px solid #c2564d}
.lead-card.state-overdue .lead-flag{background:#f8e7e5;color:#8c3a33}
.lead-card.state-unread{border-left:3px solid #2f7d57}
.lead-card.state-unread .lead-flag{background:#e3f2e9;color:#175b45}
.lead-card.state-stale{border-left:3px solid #97a09a}
.lead-card.state-stale .lead-flag{background:#eef0ec;color:#5f6864}

/* Читаемые размеры: прежние 7–9 px были на грани различимости. */
.lead-card .lead-top span{font-size:13px}
.lead-card p{font-size:11px;line-height:1.45}
.card-field small{font-size:10px}
.card-field b{font-size:12px}
.lead-meta span{font-size:10px}
.card-owner small{font-size:10px}
.card-owner strong{font-size:11px}
.stage-cap strong{font-size:11px}
.stage-cap span{font-size:10px}
.robot-when{font-size:10px}
.robot-title strong{font-size:12px}
.robot-card>small{font-size:10px}
.robot-card>b{font-size:11px}
.robot-card em{font-size:10px}
.field-list small{font-size:10px}
.field-list strong{font-size:12px}
.mini-timeline strong{font-size:11px}
.mini-timeline p{font-size:10px}
.mini-timeline time{font-size:9px}

/* Пустая колонка объясняет, что делать, вместо серого прямоугольника. */
.column-empty{display:grid;place-items:center;gap:4px;padding:22px 8px;color:#8d958f;text-align:center}
.column-empty b{font-size:11px;font-weight:600;color:#75807a}
.column-empty span{font-size:10px}

/* === Современная полировка интерфейса ===
   Только оформление: тени, скругления, отклик на наведение и нажатие,
   плавные переходы. Расположение элементов не меняется. */

:root{
  --ease:cubic-bezier(.2,.8,.28,1);
  --hover-tint:#f4f7f4;
  --hover-tint-strong:#eef3ef;
  --ring:0 0 0 3px rgba(23,91,69,.16);
  --lift-1:0 1px 2px rgba(22,34,28,.05),0 2px 6px rgba(22,34,28,.045);
  --lift-2:0 2px 5px rgba(22,34,28,.06),0 12px 26px rgba(22,34,28,.09);
  --lift-3:0 4px 10px rgba(22,34,28,.07),0 22px 48px rgba(22,34,28,.12);
}

/* Фон получает еле заметную глубину вместо плоской заливки. */
body{
  background:
    radial-gradient(1100px 620px at 78% -12%, rgba(217,242,106,.20), transparent 62%),
    radial-gradient(900px 560px at -8% 8%, rgba(23,91,69,.06), transparent 60%),
    var(--bg);
  background-attachment:fixed;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
.sidebar{background:linear-gradient(180deg,#fafaf7,#f5f6f1);backdrop-filter:saturate(1.15)}
::selection{background:rgba(23,91,69,.16)}

/* Общий отклик: всё интерактивное реагирует на наведение и нажатие. */
button,a,input,select,textarea,summary,
.lead-card,.metric,.column,.automation-card,.integration-card,.employee-card,
.deal-section,.contact-list-card,.deal-list-row,.meeting-row,.activity-item,
.robot-card,.stage-cap,.profile,.nav-item,.chip,.filter-button,.view-switch button{
  transition:background-color .18s var(--ease),color .18s var(--ease),
             border-color .18s var(--ease),box-shadow .22s var(--ease),
             transform .18s var(--ease),opacity .18s var(--ease);
}
button:not(:disabled){cursor:pointer}
button:not(:disabled):active,.lead-card:active{transform:translateY(1px) scale(.996)}

/* Видимая рамка фокуса — для клавиатуры, мышью не мешает. */
:focus-visible{outline:none;box-shadow:var(--ring);border-radius:9px}

/* --- Карточка сделки: то самое «оживает под курсором» --- */
.lead-card{
  border-radius:13px;
  box-shadow:var(--lift-1);
  will-change:transform;
}
.lead-card:hover{
  background:var(--hover-tint);
  border-color:#d3dbd5;
  transform:translateY(-3px);
  box-shadow:var(--lift-2);
}
.lead-card:hover .lead-top>span{color:var(--green)}
.lead-card:active{box-shadow:var(--lift-1)}
.lead-card.dragging{transform:rotate(1.1deg) scale(1.02);box-shadow:var(--lift-3);opacity:.9}
.lead-card .source{transition:background-color .18s var(--ease)}
.lead-card:hover .source{background:#e8efe9}

/* Появление карточек при отрисовке — короткое, не мешает работе. */
@keyframes orbitoCardIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.column .lead-card{animation:orbitoCardIn .26s var(--ease) both}

/* --- Колонки канбана --- */
.column{
  background:linear-gradient(180deg,#ecedE7,#e8e9e3);
  border:1px solid rgba(255,255,255,.6);
  border-radius:14px;
}
.column:hover{box-shadow:inset 0 0 0 1px rgba(23,91,69,.06)}
.stage-cap{box-shadow:0 1px 2px rgba(20,30,25,.14)}
.column:hover .stage-cap{filter:saturate(1.08) brightness(1.03)}
.column-total{backdrop-filter:blur(2px)}
.column-add{border-radius:8px}
.column-add:hover{background:rgba(255,255,255,.65);color:var(--green)}

/* --- Кнопки --- */
.primary-button,.quick-create{
  box-shadow:0 2px 5px rgba(23,91,69,.22),0 8px 20px rgba(23,91,69,.16);
  background-image:linear-gradient(180deg,rgba(255,255,255,.10),rgba(255,255,255,0));
}
.primary-button:hover,.quick-create:hover{
  transform:translateY(-1px);
  box-shadow:0 4px 10px rgba(23,91,69,.24),0 14px 30px rgba(23,91,69,.20);
}
.primary-button:active,.quick-create:active{transform:translateY(1px);box-shadow:0 1px 3px rgba(23,91,69,.25)}
.secondary-button:hover,.icon-button:hover,.pipeline-select:hover,.responsible-filter:hover{
  background:#fff;border-color:#cfd7d1;box-shadow:var(--lift-1);transform:translateY(-1px);
}
.icon-button:hover{color:var(--green)}
.text-button{border-radius:8px}
.text-button:hover{background:var(--hover-tint-strong)}
.chip:hover,.filter-button:hover{background:#fff;color:var(--ink);border-color:#cfd7d1}
.chip.active,.filter-button.active{
  background:#fff;color:var(--ink);border-color:#c2cec6;
  box-shadow:0 1px 2px rgba(22,34,28,.06);
}
.view-switch{box-shadow:inset 0 1px 2px rgba(22,34,28,.06)}
.view-switch button:hover{color:var(--ink)}
.view-switch button.active{box-shadow:0 1px 3px rgba(22,34,28,.12)}

/* --- Поля ввода --- */
input,select,textarea{transition:border-color .16s var(--ease),box-shadow .16s var(--ease),background-color .16s var(--ease)}
input:hover:not(:focus),select:hover:not(:focus),textarea:hover:not(:focus){border-color:#cfd7d1}
.modal input:focus,.modal select:focus,.modal textarea:focus,
.robot-editor-dialog input:focus,.robot-editor-dialog select:focus,.robot-editor-dialog textarea:focus{
  box-shadow:var(--ring);
}
.pipeline-filter{transition:border-color .18s var(--ease),box-shadow .18s var(--ease)}
.pipeline-filter:hover{border-color:#cfd7d1}
.pipeline-filter:focus-within{border-color:var(--green);box-shadow:var(--ring)}

/* --- Боковое меню --- */
.nav-item{position:relative}
.nav-item::before{
  content:"";position:absolute;left:-20px;top:50%;transform:translateY(-50%);
  width:3px;height:0;border-radius:0 3px 3px 0;background:var(--green);
  transition:height .22s var(--ease);
}
.nav-item:hover{background:#eef1ec;transform:translateX(1px)}
.nav-item.active::before{height:20px}
.nav-item.active{box-shadow:inset 0 0 0 1px rgba(23,91,69,.08)}
.profile:hover{box-shadow:var(--lift-1);transform:translateY(-1px)}
.api-status>span{animation:orbitoPulse 2.6s var(--ease) infinite}
@keyframes orbitoPulse{0%,100%{box-shadow:0 0 0 4px #dceee3}50%{box-shadow:0 0 0 7px rgba(220,238,227,.45)}}

/* --- Панели и карточки разделов --- */
.metric,.automation-card,.integration-card,.employee-card,.calendar-layout,
.activity-card,.deal-section,.contact-preview{
  border-radius:15px;
  box-shadow:var(--lift-1);
}
.metric:hover,.automation-card:hover,.integration-card:hover,.employee-card:hover{
  transform:translateY(-2px);
  border-color:#d9ded7;
  box-shadow:var(--lift-2);
}
.metric.accent{background-image:linear-gradient(135deg,#1a6650,#134b39)}
.automation-icon,.integration-icon,.product-row>span,.activity-symbol,.mini-timeline>div>span{
  background-image:linear-gradient(145deg,#f1f5ef,#e6ece5);
}
.automation-card:hover .automation-icon,.integration-card:hover .integration-icon{
  background-image:linear-gradient(145deg,#e6f0e8,#dbe9de);
}

/* --- Строки списков: тот же лёгкий отклик, что и у карточек --- */
.meeting-row,.activity-item,.mini-timeline>div,.field-list>div,
.bitrix-field-stack>div,.deal-list-row,.stage-manager-row{border-radius:9px}
.meeting-row:hover,.activity-item:hover,.mini-timeline>div:hover,
.field-list>div:hover,.stage-manager-row:hover{
  background:var(--hover-tint);box-shadow:inset 0 0 0 1px rgba(23,91,69,.05);
}
.deal-list-row:hover{background:var(--hover-tint);box-shadow:inset 0 0 0 1px rgba(23,91,69,.06)}
.contact-list-card:hover{transform:translateX(2px)}
.employee-card:hover .employee-avatar{transform:scale(1.05)}
.employee-avatar{transition:transform .2s var(--ease)}

/* --- Роботы --- */
.robot-card{border-radius:11px;box-shadow:var(--lift-1)}
.robot-card:hover{transform:translateY(-2px);background:#fcfdfc;box-shadow:var(--lift-2)}
.robot-card-config:hover,.robot-card-toggle:hover{transform:translateY(-1px)}
.toggle{transition:background-color .22s var(--ease),box-shadow .22s var(--ease)}
.toggle:hover{box-shadow:0 0 0 4px rgba(23,91,69,.10)}
.toggle::after{transition:transform .24s var(--ease)}

/* --- Стрелки прокрутки --- */
.kanban-scroll-arrow,.automation-scroll-arrow{
  border-radius:14px!important;
  box-shadow:var(--lift-2)!important;
  backdrop-filter:blur(8px);
}
.kanban-scroll-arrow:hover,.automation-scroll-arrow:hover{
  transform:translateY(-50%) scale(1.06)!important;
  color:var(--green)!important;
}
.automation-scroll-arrow:hover{transform:scale(1.06)!important}

/* --- Окна, шторка сделки, уведомления --- */
.modal-backdrop,.drawer-backdrop,.robot-editor-backdrop{backdrop-filter:blur(3px)}
.modal,.robot-editor-dialog{border-radius:19px;box-shadow:var(--lift-3);animation:orbitoModalIn .22s var(--ease) both}
@keyframes orbitoModalIn{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
.modal-close:hover,.drawer-head button:hover,.robot-editor-dialog header button:hover{
  background:#e3e7e0;transform:rotate(90deg);
}
.modal-close,.drawer-head button,.robot-editor-dialog header button{transition:background-color .18s var(--ease),transform .25s var(--ease)}
.deal-drawer{box-shadow:-24px 0 70px rgba(19,31,26,.20)}
.drawer-tabs button{position:relative}
.drawer-tabs button:hover{color:var(--ink)}
.drawer-stage-step{transition:filter .16s var(--ease),transform .16s var(--ease),background-color .18s var(--ease)}
.toast{border-radius:14px;box-shadow:var(--lift-3);backdrop-filter:blur(6px)}

/* --- Экран входа --- */
.auth-card{border-radius:22px;box-shadow:var(--lift-3);animation:orbitoModalIn .3s var(--ease) both}
.auth-submit{transition:transform .18s var(--ease),box-shadow .22s var(--ease),background-color .18s var(--ease)}
.auth-submit:hover{transform:translateY(-1px);box-shadow:0 12px 28px rgba(23,91,69,.24)}
.auth-submit:active{transform:translateY(1px)}

/* --- Полосы прокрутки --- */
*{scrollbar-width:thin;scrollbar-color:#c9cfc9 transparent}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:#cdd3cd;border:3px solid transparent;background-clip:content-box;border-radius:9px}
::-webkit-scrollbar-thumb:hover{background:#adb5ae;background-clip:content-box}

/* Уважаем системную настройку «меньше движения». */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
  .lead-card:hover,.metric:hover,.robot-card:hover,.primary-button:hover{transform:none}
}


/* Ширина канбана и доски роботов подстраивается под реальное число стадий,
   а не под жёстко зашитые 22 и 25 колонок — иначе справа оставалась пустота. */
.board{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:250px}
.automation-grid{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:190px}
@media(max-width:720px){.board{grid-auto-columns:230px}}

/* === Управление стадиями и столбцами прямо на доске === */

/* Шапка стадии кликабельна: крестик-меню появляется при наведении, как в Битрикс. */
.column{position:relative}
.stage-cap{cursor:pointer;padding-right:26px}
.stage-cap .stage-cap-menu{
  position:absolute;right:12px;top:50%;transform:translateY(-50%);
  width:16px;height:16px;display:grid;place-items:center;
  border-radius:5px;background:rgba(255,255,255,.24);color:#fff;
  font:700 10px Manrope;font-style:normal;opacity:0;transition:opacity .16s var(--ease),background-color .16s var(--ease);
  z-index:3;
}
.stage-cap:hover .stage-cap-menu,.stage-cap.menu-open .stage-cap-menu{opacity:1}
.stage-cap .stage-cap-menu:hover{background:rgba(255,255,255,.42)}
.stage-cap.menu-open{filter:brightness(1.06)}
.stage-rename-input{
  flex:1;min-width:0;height:22px;border:0;border-radius:5px;
  background:rgba(255,255,255,.94);color:#1c2a24;
  padding:0 7px;font:700 11px Manrope;outline:none;
}
.stage-menu{
  position:absolute;left:6px;top:44px;z-index:24;width:min(212px,calc(100% - 12px));
  display:grid;gap:2px;padding:7px;
  background:#fff;border:1px solid #e2e6e1;border-radius:13px;
  box-shadow:var(--lift-3);
  animation:orbitoMenuIn .16s var(--ease) both;
}
@keyframes orbitoMenuIn{from{opacity:0;transform:translateY(-5px) scale(.985)}to{opacity:1;transform:none}}
.stage-menu button,.stage-menu label{
  display:flex;align-items:center;gap:10px;
  border:0;background:none;border-radius:9px;
  padding:9px 10px;color:#3b4640;font:600 12px Manrope;text-align:left;cursor:pointer;
}
.stage-menu button>span,.stage-menu label>span{width:16px;color:#8d968f;font-size:13px;text-align:center}
.stage-menu button:hover:not(:disabled),.stage-menu label:hover{background:var(--hover-tint-strong);color:var(--ink)}
.stage-menu button:disabled{opacity:.38;cursor:default}
.stage-menu button.danger{color:#a8443c}
.stage-menu button.danger:hover{background:#fbeeec}
.stage-menu .stage-menu-color input{margin-left:auto;width:34px;height:24px;border:1px solid var(--line);border-radius:7px;background:none;padding:2px;cursor:pointer}

/* Панель выбора столбцов списка. */
.board-toolbar{position:relative}
.list-columns-panel{
  position:absolute;right:0;top:46px;z-index:22;width:288px;
  background:#fff;border:1px solid #e2e6e1;border-radius:15px;
  box-shadow:var(--lift-3);padding:8px;
  animation:orbitoMenuIn .16s var(--ease) both;
}
.list-columns-panel[hidden]{display:none}
.list-columns-panel>header{display:flex;align-items:center;justify-content:space-between;padding:6px 8px 9px}
.list-columns-panel>header strong{font:700 12px Manrope}
.list-columns-panel>header button{border:0;background:#f1f3ef;border-radius:50%;width:24px;height:24px;font-size:15px;color:#6d766f;cursor:pointer}
.list-columns-panel>header button:hover{background:#e5e8e2;color:var(--ink)}
.list-columns-rows{display:grid;gap:1px;max-height:340px;overflow:auto}
.list-columns-row{display:grid;grid-template-columns:1fr 28px 28px;gap:4px;align-items:center;border-radius:9px;padding:3px 6px}
.list-columns-row:hover{background:var(--hover-tint)}
.list-columns-row.off label span{color:#a2aaa4}
.list-columns-row label{display:flex;align-items:center;gap:9px;padding:6px 2px;font:600 12px Manrope;cursor:pointer;min-width:0}
.list-columns-row label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.list-columns-row input[type=checkbox]{width:16px;height:16px;accent-color:var(--green);cursor:pointer}
.list-columns-row button{border:0;background:#f2f4f1;border-radius:7px;height:26px;color:#5d675f;font-size:13px;cursor:pointer}
.list-columns-row button:hover:not(:disabled){background:#e4eae5;color:var(--green)}
.list-columns-row button:disabled{opacity:.32;cursor:default}
.list-columns-panel>footer{padding:8px 6px 3px}
.list-columns-panel>footer button{border:0;background:none;color:var(--green);font:700 11px Manrope;padding:5px;border-radius:7px;cursor:pointer}
.list-columns-panel>footer button:hover{background:var(--hover-tint-strong)}

/* ID сделки и ссылка на неё. */
.deal-list .cell-id{width:1%;white-space:nowrap}
.deal-id-link{
  display:inline-block;color:#7c857f;font:600 11px Manrope;text-decoration:none;
  border-radius:6px;padding:3px 6px;background:#f2f4f1;
}
.deal-id-link:hover{background:#e4eae5;color:var(--green)}
.deal-name-link{color:inherit;text-decoration:none}
.deal-name-link:hover strong{color:var(--green)}

/* === Правка полей прямо в карточке сделки === */

.editable-deal-field{border-radius:9px;padding:9px 8px;transition:background-color .16s var(--ease),box-shadow .16s var(--ease)}
.editable-deal-field:hover{background:var(--hover-tint);box-shadow:inset 0 0 0 1px rgba(23,91,69,.07)}
.editable-deal-field .rule-required{opacity:1!important;visibility:visible!important}
.editable-deal-field.editing{
  display:grid;gap:5px;background:#fff;cursor:default;
  box-shadow:inset 0 0 0 2px rgba(23,91,69,.22);
}
.editable-deal-field.editing>small{color:var(--muted);font-size:10px}
.inline-field-input{
  width:100%;min-width:0;border:1px solid var(--line);border-radius:8px;
  padding:9px 10px;background:#fff;color:var(--ink);
  font:600 13px Manrope;outline:none;
}
.inline-field-input:focus{border-color:var(--green);box-shadow:var(--ring)}
textarea.inline-field-input{min-height:76px;resize:vertical;font-weight:500;line-height:1.5}
.product-row .editable-deal-field.product-edit{display:grid;gap:3px;width:100%;text-align:left;background:transparent;border:0;cursor:pointer}
.product-row .editable-deal-field.product-edit small{color:var(--muted);font-size:10px}
.product-row .editable-deal-field.product-edit em{font-style:normal;color:#287fea;font:700 9px Manrope;opacity:0;transition:opacity .15s}
.product-row .editable-deal-field.product-edit:hover em{opacity:1}

/* Панель «Сохранить» внизу карточки: видно, что осталось несохранённым. */
.deal-save-bar{
  position:sticky;bottom:0;z-index:8;flex:0 0 auto;
  display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:11px;
  padding:13px 24px;background:#fff;
  border-top:1px solid var(--line);
  box-shadow:0 -10px 28px rgba(24,38,31,.10);
  animation:orbitoSaveBarIn .2s var(--ease) both;
}
.deal-save-bar[hidden]{display:none}
@keyframes orbitoSaveBarIn{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
.deal-save-bar>span{
  grid-column:1;min-width:0;color:#7a5a1e;background:#fbf3e2;
  border-radius:9px;padding:8px 11px;
  font:600 11px Manrope;line-height:1.4;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.deal-save-actions{grid-column:2;display:flex;align-items:center;justify-content:center;gap:10px}.deal-save-bar .secondary-button,.deal-save-bar .primary-button{flex:0 0 auto;white-space:nowrap}
@media(max-width:720px){
  .deal-save-bar{grid-template-columns:1fr;padding:11px 12px;gap:7px}
  .deal-save-bar>span,.deal-save-actions{grid-column:1;white-space:normal}
  .deal-save-actions{width:min(100%,360px);justify-self:center}.deal-save-bar button{flex:1}
}

/* Полоса стадий сделки: цвет выбранной стадии окрашивает весь пройденный путь. */
.drawer-stage-step::after{display:block;content:"";position:absolute;left:7px;right:11px;bottom:0;height:3px;border-radius:3px;background:var(--stage)}
.drawer-stage-step.passed,.drawer-stage-step.active{background:var(--current-stage);color:#fff}
.drawer-stage-step.passed::after,.drawer-stage-step.active::after{background:rgba(255,255,255,.76)}
.drawer-stage-step.active{flex:1 1 0;z-index:1;box-shadow:inset 0 0 0 1px rgba(255,255,255,.5)}
.drawer-stage-strip.previewing .drawer-stage-step:not(.preview-passed){background:#dde2e6;color:#5b666e;box-shadow:none}
.drawer-stage-strip.previewing .drawer-stage-step:not(.preview-passed)::after{background:var(--stage)}
.drawer-stage-strip.previewing .drawer-stage-step.preview-passed{background:var(--preview-stage);color:#fff}
.drawer-stage-strip.previewing .drawer-stage-step.preview-passed::after{background:rgba(255,255,255,.76)}
.drawer-stage-strip.previewing .drawer-stage-step.preview-target{flex:5 1 0;z-index:4;filter:none;box-shadow:inset 0 0 0 2px rgba(255,255,255,.48)}
.drawer-stage-strip.previewing .drawer-stage-step.preview-target span{font-weight:800;text-overflow:clip}
body.theme-dark .drawer-stage-step:not(.passed):not(.active){background:#34413b;color:#c4cec9}
body.theme-dark .drawer-stage-strip.previewing .drawer-stage-step:not(.preview-passed){background:#34413b;color:#c4cec9}
body.theme-dark .drawer-stage-step::after{height:4px;filter:saturate(1.3) brightness(1.18)}

/* === Выпадающие списки ===
   Системные списки Windows выглядят как из Excel: грубая синяя полоса выделения,
   чужой шрифт, резкое появление. Ниже — свой вид: аккуратное поле со стрелкой и,
   там где браузер это умеет, полностью своя всплывающая панель. */

select{
  appearance:none;-webkit-appearance:none;
  background-color:#fff;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1.4 1.6 6 6.2l4.6-4.6' fill='none' stroke='%2379837c' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat:no-repeat;
  background-position:right 11px center;
  padding-right:30px!important;
  border:1px solid var(--line);border-radius:9px;
  color:var(--ink);font:600 12px Manrope;
  cursor:pointer;
}
select:hover{border-color:#c7d0ca;background-color:#fcfdfc}
select:focus-visible{border-color:var(--green);box-shadow:var(--ring);outline:none}
select:disabled{opacity:.55;cursor:default}

/* Chrome умеет отдавать всплывающую панель под управление CSS — пользуемся. */
@supports (appearance:base-select){
  select,::picker(select){appearance:base-select}
  select::picker-icon{
    color:#79837c;transition:transform .18s var(--ease),color .18s var(--ease);
  }
  select:hover::picker-icon{color:var(--green)}
  select:open::picker-icon{transform:rotate(180deg);color:var(--green)}
  select{background-image:none;padding-right:12px!important;display:flex;align-items:center;gap:8px}
  ::picker(select){
    border:1px solid #e2e6e1;border-radius:14px;
    background:#fff;box-shadow:var(--lift-3);
    padding:6px;margin-top:6px;
    opacity:0;transform:translateY(-6px) scale(.985);
    transition:opacity .16s var(--ease),transform .16s var(--ease),overlay .16s allow-discrete,display .16s allow-discrete;
  }
  select:open::picker(select){opacity:1;transform:none}
  @starting-style{select:open::picker(select){opacity:0;transform:translateY(-6px) scale(.985)}}
  option{
    display:flex;align-items:center;gap:9px;
    border-radius:9px;padding:9px 11px;
    font:600 12px Manrope;color:#3b4640;
    transition:background-color .14s var(--ease),color .14s var(--ease);
  }
  /* Мягкая подсветка вместо резкой синей полосы. */
  option:hover,option:focus{background:var(--hover-tint-strong);color:var(--ink);outline:none}
  option:checked{background:#e7f0ea;color:var(--green);font-weight:700}
  option::checkmark{color:var(--green);order:1;margin-left:auto;content:"✓"}
  optgroup{font:700 10px Manrope;color:#939c96;padding:8px 11px 4px;letter-spacing:.04em;text-transform:uppercase}
}

/* Список стадий в строке таблицы: цветная метка стадии слева от названия. */
.deal-list select[data-list-stage]{border-left:3px solid var(--stage)}

/* === Окна подтверждения, отмена действий и мелкие правки интерфейса === */

/* Своё окно подтверждения вместо браузерного «Подтвердите действие на ...». */
.confirm-backdrop{position:fixed;inset:0;z-index:120;display:grid;place-items:center;padding:20px;background:rgba(18,27,24,.5);backdrop-filter:blur(3px)}
.confirm-backdrop[hidden]{display:none}
.confirm-dialog{
  width:min(420px,100%);background:#fff;border-radius:19px;padding:26px 26px 20px;
  box-shadow:var(--lift-3);animation:orbitoModalIn .2s var(--ease) both;
}
.confirm-dialog h2{margin:0 0 9px;font:600 19px Onest}
.confirm-dialog p{margin:0 0 22px;color:#5c665f;font-size:12px;line-height:1.55}
.confirm-dialog footer{display:flex;justify-content:flex-end;gap:9px}
.confirm-dialog footer button{min-width:112px}
.confirm-dialog .primary-button.danger{background:#b04a41;box-shadow:0 2px 5px rgba(176,74,65,.24),0 8px 20px rgba(176,74,65,.18)}
.confirm-dialog .primary-button.danger:hover{background:#9c3f37}

/* Кнопка «Отменить» в уведомлении: 12 секунд, чтобы вернуть всё назад. */
.toast-undo{
  margin-left:6px;border:1px solid rgba(217,242,106,.45);border-radius:9px;
  background:transparent;color:var(--lime);padding:8px 13px;
  font:700 11px Manrope;cursor:pointer;white-space:nowrap;
}
.toast-undo[hidden]{display:none}
.toast-undo:hover{background:rgba(217,242,106,.14)}

/* Крестик у стадии — только после клика по стадии, и не наезжает на счётчик. */
.stage-cap{padding-right:13px}
.stage-cap span{padding-right:0}
.stage-cap .stage-cap-menu{opacity:0;pointer-events:none;position:static;transform:none;margin-left:8px;flex:0 0 auto}
.stage-cap:hover .stage-cap-menu{opacity:0}
.stage-cap.menu-open{padding-right:13px}
.stage-cap.menu-open .stage-cap-menu{opacity:1;pointer-events:auto}

/* Меню карточки сделки. */
.lead-card{position:relative}
.lead-card-menu{border-radius:7px;padding:0 4px}
.lead-card-menu:hover{background:#eef1ec;color:var(--green)}
.card-menu{
  position:absolute;right:auto;left:6px;max-width:calc(100% - 12px);top:38px;z-index:26;width:198px;
  display:grid;gap:2px;padding:7px;
  background:#fff;border:1px solid #e2e6e1;border-radius:13px;
  box-shadow:var(--lift-3);animation:orbitoMenuIn .16s var(--ease) both;
  cursor:default;
}
.card-menu button{
  display:flex;align-items:center;gap:10px;border:0;background:none;border-radius:9px;
  padding:9px 10px;color:#3b4640;font:600 12px Manrope;text-align:left;cursor:pointer;
}
.card-menu button>span{width:16px;color:#8d968f;text-align:center}
.card-menu button:hover{background:var(--hover-tint-strong);color:var(--ink)}
.card-menu button.danger{color:#a8443c}
.card-menu button.danger:hover{background:#fbeeec}

/* Крестик закрытия сделки — слева, как в Битрикс. */
.drawer-head{align-items:flex-start;gap:14px}
.drawer-close-left{
  flex:0 0 auto;order:-1;margin-top:2px;
  width:34px;height:34px;border:0;border-radius:50%;
  background:#eef0eb;color:#57625b;font-size:20px;line-height:1;cursor:pointer;
  transition:background-color .18s var(--ease),transform .25s var(--ease),color .18s var(--ease);
}
.drawer-close-left:hover{background:#e2e6df;color:var(--ink);transform:rotate(90deg)}

/* Пока сервер не сказал, кто вошёл, не мигаем экраном входа. */
.auth-checking .auth-gate{display:none!important}
.auth-checking .app-shell{visibility:hidden}

/* === Фон-сеть за интерфейсом ===
   Как в темах Битрикс: картинка живёт на фоне, а рабочие панели лежат поверх
   полупрозрачным слоем. Сеть рисуется на canvas и не перехватывает клики. */
.neuro-bg{
  position:fixed;inset:0;z-index:0;
  width:100vw;height:100vh;
  pointer-events:none;
  opacity:.85;
}
.app-shell{position:relative;z-index:1}
.sidebar{background:linear-gradient(180deg,rgba(250,250,247,.93),rgba(245,246,241,.90));backdrop-filter:blur(10px) saturate(1.1)}
/* Колонки канбана — «стеклянные», сквозь них видно сеть, но карточки читаются. */
.column{
  background:linear-gradient(180deg,rgba(236,237,231,.80),rgba(232,233,227,.74));
  backdrop-filter:blur(7px) saturate(1.05);
  border:1px solid rgba(255,255,255,.55);
}
.lead-card{background:rgba(255,255,255,.97)}
.metric,.automation-card,.integration-card,.employee-card,.calendar-layout,
.activity-card,.deal-section,.contact-preview,.deal-list-wrap{
  background:rgba(255,255,255,.95);backdrop-filter:blur(6px);
}
.robot-column{background:linear-gradient(180deg,rgba(233,234,229,.80),rgba(229,230,225,.74));backdrop-filter:blur(7px)}
.pipeline-filter,.pipeline-select,.icon-button,.view-switch{backdrop-filter:blur(6px)}
.modal-backdrop,.drawer-backdrop,.confirm-backdrop,.robot-editor-backdrop,.auth-gate{z-index:60}
.drawer-backdrop{z-index:40}
.modal-backdrop{z-index:50}
.confirm-backdrop{z-index:120}
.auth-gate{z-index:1000}
@media (prefers-reduced-motion:reduce){.neuro-bg{opacity:.45}}

/* === Корзина === */
.trash-modal{width:min(560px,100%)}
.trash-hint{margin:-14px 0 18px;color:var(--muted);font-size:11px;line-height:1.5}
.trash-list{display:grid;gap:8px;max-height:min(58vh,460px);overflow:auto}
.trash-row{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:12px;padding:13px 15px;background:#fff}
.trash-row:hover{background:var(--hover-tint);border-color:#d6ded8}
.trash-row>div{flex:1;min-width:0}
.trash-row strong{display:block;font:600 13px Onest}
.trash-row small{display:block;margin-top:4px;color:var(--muted);font-size:10px}
.trash-row button{flex:0 0 auto}
.trash-empty{margin:0;padding:26px 8px;text-align:center;color:var(--muted);font-size:12px}

/* === Поля сделки: правка на месте без наложений ===
   Раньше поле в режиме правки вырастало и наезжало на соседние строки. */
.bitrix-field-stack>.editable-deal-field,
.bitrix-field-stack>.editable-deal-field.editing{
  display:block;width:100%;padding:10px 10px!important;margin:2px 0;
  border-bottom:1px solid #edf0f1;border-radius:10px;
}
.bitrix-field-stack>.editable-deal-field:last-child{border-bottom:0}
.editable-deal-field.editing{
  position:relative;z-index:2;background:#fff;cursor:default;
  box-shadow:0 0 0 2px rgba(23,91,69,.20);
}
.editable-deal-field.editing>small{display:block;margin-bottom:6px;color:var(--muted);font-size:10px}
.editable-deal-field.editing .inline-field-input{display:block;width:100%;box-sizing:border-box}
.bitrix-field-stack{display:block}

/* Фон-сеть: плотнее и заметнее, с футуристичным свечением. */
.neuro-bg{opacity:1;filter:saturate(1.12)}
body{
  background:
    radial-gradient(1200px 680px at 82% -14%, rgba(38,166,154,.16), transparent 60%),
    radial-gradient(940px 620px at -10% 6%, rgba(23,91,69,.10), transparent 58%),
    linear-gradient(180deg,#f6f7f2 0%,#eef2ee 58%,#e9efeb 100%);
  background-attachment:fixed;
}

/* === Вход: запомнить компьютер и код с почты === */
.auth-remember{display:flex;align-items:center;gap:9px;margin:2px 0 2px;color:#59645e;font:600 11px Manrope;cursor:pointer}
.auth-remember input{width:16px;height:16px;accent-color:var(--green);cursor:pointer}
.auth-code-hint{margin:0 0 4px;color:var(--muted);font-size:11px;line-height:1.5}
#authCodeForm input[name=code]{letter-spacing:.32em;font:700 18px Manrope;text-align:center}
.auth-code-back{border:0;background:none;color:var(--green);font:700 11px Manrope;padding:8px;border-radius:8px;cursor:pointer}
.auth-code-back:hover{background:#eef3ef}
.auth-tabs[hidden]{display:none}

/* === Тема оформления: светлая и тёмная ===
   Тёмная делает фон глубоким, а плашки — тёмно-серыми, не чёрными: текст
   остаётся читаемым весь день. Сеть на фоне при этом светится светлым. */

.theme-switch{display:grid;grid-template-columns:1fr 1fr;gap:3px;margin:0 0 10px;padding:3px;border-radius:10px;background:#e9ebe5}
.theme-switch button{
  display:flex;align-items:center;justify-content:center;gap:6px;
  border:0;background:none;border-radius:8px;padding:8px 6px;
  color:#79837c;font:600 10px Manrope;cursor:pointer;
  transition:background-color .18s var(--ease),color .18s var(--ease),box-shadow .18s var(--ease);
}
.theme-switch button span{font-size:12px}
.theme-switch button:hover{color:var(--ink)}
.theme-switch button.active{background:#fff;color:var(--green);box-shadow:0 1px 3px rgba(22,34,28,.12)}

/* Плавное переключение: цвета переезжают, а не мигают. */
.theme-animating,.theme-animating *{
  transition:background-color .34s var(--ease),color .34s var(--ease),
             border-color .34s var(--ease),box-shadow .34s var(--ease),
             fill .34s var(--ease)!important;
}

body.theme-dark{
  --bg:#080d0b;--panel:#232f29;--ink:#e8efea;--muted:#93a09a;--line:#33423b;
  /* Эти четыре использовались в коде, но нигде не объявлялись: из-за этого
     панель сохранения, меню полей и закреплённая строка списка стадий
     оставались с прозрачным фоном, и сквозь них просвечивало содержимое. */
  --surface:#232f29;--soft:#1d2823;--text:#e8efea;--input:#1b2520;
  --green:#3ecf9a;--lime:#d9f26a;
  --hover-tint:#2b3a33;--hover-tint-strong:#31423a;
  --ring:0 0 0 3px rgba(62,207,154,.24);
  --lift-1:0 1px 2px rgba(0,0,0,.32),0 2px 8px rgba(0,0,0,.26);
  --lift-2:0 3px 8px rgba(0,0,0,.36),0 14px 30px rgba(0,0,0,.34);
  --lift-3:0 6px 14px rgba(0,0,0,.42),0 26px 56px rgba(0,0,0,.46);
  color:var(--ink);
  background:
    radial-gradient(1200px 680px at 82% -14%, rgba(62,207,154,.14), transparent 60%),
    radial-gradient(940px 620px at -10% 6%, rgba(78,150,255,.10), transparent 58%),
    linear-gradient(180deg,#070c0a 0%,#0b120f 58%,#080e0c 100%);
  background-attachment:fixed;
}
body.theme-dark .sidebar{background:linear-gradient(180deg,rgba(30,41,35,.96),rgba(25,34,29,.94));border-right-color:#33423b}
body.theme-dark .nav-item{color:#9aa8a1}
body.theme-dark .nav-item:hover{background:#1e2924;color:var(--ink)}
body.theme-dark .nav-item.active{background:#1d2f27;color:#5fe0ad}
body.theme-dark .nav-item b{background:#2e4a3c;color:#bff3dc}
body.theme-dark .brand,body.theme-dark .topbar h1,body.theme-dark .section-head h2{color:var(--ink)}
body.theme-dark .brand-mark i{background:#3ecf9a}
body.theme-dark .brand-mark i:nth-child(3){background:#d9f26a}

body.theme-dark .column{
  background:linear-gradient(180deg,rgba(34,45,39,.90),rgba(29,39,34,.88));
  border-color:rgba(255,255,255,.09);
}
body.theme-dark .lead-card{background:#2b3a33;border-color:#3b4c44;color:var(--ink)}
body.theme-dark .lead-card:hover{background:#334339;border-color:#4a5d53}
body.theme-dark .lead-card p,body.theme-dark .lead-meta,body.theme-dark .card-field small,
body.theme-dark .card-owner small{color:#8f9d96}
body.theme-dark .lead-value,body.theme-dark .card-field{border-top-color:#3b4c44}
body.theme-dark .source{background:#3a4a42;color:#c0cec6}
body.theme-dark .column-total{background:rgba(255,255,255,.10);color:#b3c1ba}
body.theme-dark .column-add{color:#7f8d86}
body.theme-dark .column-empty{color:#7c8a83}
body.theme-dark .column-empty b{color:#93a09a}

body.theme-dark .metric,body.theme-dark .automation-card,body.theme-dark .integration-card,
body.theme-dark .employee-card,body.theme-dark .calendar-layout,body.theme-dark .activity-card,
body.theme-dark .deal-section,body.theme-dark .contact-preview,body.theme-dark .deal-list-wrap,
body.theme-dark .robot-card,body.theme-dark .trash-row{
  background:#232f29;border-color:#36453e;color:var(--ink);
}
body.theme-dark .robot-column{background:linear-gradient(180deg,rgba(34,45,39,.90),rgba(29,39,34,.88))}
body.theme-dark .robot-trigger{background:#33423b;color:#a8b6ae}
body.theme-dark .automation-icon,body.theme-dark .integration-icon,body.theme-dark .product-row>span,
body.theme-dark .activity-symbol,body.theme-dark .mini-timeline>div>span{
  background-image:linear-gradient(145deg,#34453c,#2a382f);color:#6fe9b8;
}

body.theme-dark .deal-list-row:hover,body.theme-dark .meeting-row:hover,
body.theme-dark .activity-item:hover,body.theme-dark .field-list>div:hover,
body.theme-dark .contact-list-card:hover,body.theme-dark .stage-manager-row:hover{background:#31423a}
body.theme-dark .activity-item,body.theme-dark .meeting-row,body.theme-dark .mini-timeline>div,
body.theme-dark .field-list>div,body.theme-dark .bitrix-field-stack>div,
body.theme-dark .bitrix-field-stack>.editable-deal-field{border-bottom-color:#28332e}
body.theme-dark .deal-list thead th{background:#28352e;color:#a8b6ae;border-bottom-color:#3b4c44}

body.theme-dark .primary-button,body.theme-dark .quick-create{background:#1f9c74;color:#eafff6}
body.theme-dark .primary-button:hover,body.theme-dark .quick-create:hover{background:#23ac7f}
body.theme-dark .primary-button span{color:#d9f26a}
body.theme-dark .secondary-button,body.theme-dark .icon-button,body.theme-dark .pipeline-select,
body.theme-dark .responsible-filter,body.theme-dark .chip,body.theme-dark .filter-button{
  background:#2b3a33;border-color:#3d4f46;color:#d3e0d9;
}
body.theme-dark .secondary-button:hover,body.theme-dark .icon-button:hover,
body.theme-dark .pipeline-select:hover,body.theme-dark .chip:hover,body.theme-dark .filter-button:hover{
  background:#334339;border-color:#4b5e54;color:var(--ink);
}
body.theme-dark .chip.active,body.theme-dark .filter-button.active{background:#35473d;color:#6fe9b8;border-color:#4d6f5c}
body.theme-dark .view-switch{background:#28352e}
body.theme-dark .view-switch button{color:#8e9c95}
body.theme-dark .view-switch button.active{background:#3a4a42;color:var(--ink)}
body.theme-dark .pipeline-filter{background:#2b3a33;border-color:#3d4f46}
body.theme-dark .pipeline-filter>span{background:#37473f;color:#b3c1ba}
body.theme-dark .pipeline-filter input{color:var(--ink)}

body.theme-dark input,body.theme-dark select,body.theme-dark textarea{
  background-color:#2b3a33;border-color:#3d4f46;color:var(--ink);
}
body.theme-dark input::placeholder,body.theme-dark textarea::placeholder{color:#77857e}
@supports (appearance:base-select){
  body.theme-dark ::picker(select){background:#1c2621;border-color:#2c3832}
  body.theme-dark option{color:#c3d0c9}
  body.theme-dark option:hover,body.theme-dark option:focus{background:#243029;color:var(--ink)}
  body.theme-dark option:checked{background:#1d3a2e;color:#5fe0ad}
}

body.theme-dark .modal,body.theme-dark .robot-editor-dialog,body.theme-dark .confirm-dialog,
body.theme-dark .stage-menu,body.theme-dark .card-menu,body.theme-dark .list-columns-panel,
body.theme-dark .auth-card,body.theme-dark .stage-manager{
  background:#26332c;border-color:#3a4a42;color:var(--ink);
}
body.theme-dark .stage-menu button,body.theme-dark .card-menu button{color:#c3d0c9}
body.theme-dark .stage-menu button:hover:not(:disabled),body.theme-dark .card-menu button:hover{background:#37473f;color:var(--ink)}
body.theme-dark .stage-menu button.danger,body.theme-dark .card-menu button.danger{color:#ef8478}
body.theme-dark .stage-menu button.danger:hover,body.theme-dark .card-menu button.danger:hover{background:#33211f}
body.theme-dark .modal-close,body.theme-dark .drawer-close-left,body.theme-dark .drawer-head button{background:#37473f;color:#d3e0d9}
body.theme-dark .modal-close:hover,body.theme-dark .drawer-close-left:hover{background:#2e3b34;color:var(--ink)}

body.theme-dark .deal-drawer{background:#141d19}
body.theme-dark .drawer-head,body.theme-dark .drawer-tabs{background:#212c26;border-bottom-color:#36453e}
body.theme-dark .drawer-stage,body.theme-dark .drawer-body{background:#141d19}
body.theme-dark .drawer-tabs button{color:#8e9c95}
body.theme-dark .drawer-tabs button.active{color:#5fe0ad;border-color:#5fe0ad}
body.theme-dark .drawer-stage-step:not(.passed):not(.active){background:#3a4a42;color:#b3c1ba}
body.theme-dark .drawer-stage-strip.previewing .drawer-stage-step.preview-passed{background:var(--preview-stage);color:#fff}
body:not(.can-manage-fields) .deal-field-drag,
body:not(.can-manage-fields) .deal-field-gear,
body:not(.can-manage-fields) .deal-field-settings,
body:not(.can-manage-fields) .deal-field-mobile-order,
body:not(.can-manage-fields) .deal-fields-footer,
body:not(.can-manage-fields) .deal-field-tools,
body:not(.can-manage-fields) .custom-field-creator,
body:not(.can-manage-fields) .archived-fields-panel,
body:not(.can-manage-fields) .deal-config-mode .field-gear{display:none!important}
body:not(.can-manage-fields) .deal-layout-row{grid-template-columns:minmax(0,1fr)!important}
body.theme-dark .deal-save-bar{background:#26332c;border-top-color:#3a4a42}
body.theme-dark .deal-save-bar>span{background:#33291a;color:#e6c98a}
body.theme-dark .editable-deal-field:hover{background:#212c26}
body.theme-dark .editable-deal-field.editing{background:#2b3a33}
body.theme-dark .bitrix-contact-card{background:#2b3a33;border-color:#3a4a42}
body.theme-dark .bitrix-card-grid .deal-section{box-shadow:var(--lift-1)}
body.theme-dark .responsible-control{background:#2b3a33}

body.theme-dark .auth-gate{background:radial-gradient(circle at 18% 18%,rgba(62,207,154,.16),transparent 34%),linear-gradient(145deg,#0d1411 0%,#111a16 54%,#0c1310 100%)}
body.theme-dark .auth-card{background:#232f29;border-color:rgba(255,255,255,.10)}
body.theme-dark .auth-tabs{background:#2b3a33}
body.theme-dark .auth-tabs button{color:#8e9c95}
body.theme-dark .auth-tabs button.active{background:#37473f;color:#6fe9b8}
body.theme-dark .auth-form input{background:#2b3a33;border-color:#3d4f46}
body.theme-dark .auth-submit{background:#1f9c74;color:#eafff6}
body.theme-dark .auth-remember{color:#a6b3ac}

body.theme-dark .theme-switch{background:#28352e}
body.theme-dark .theme-switch button{color:#8e9c95}
body.theme-dark .theme-switch button.active{background:#3a4a42;color:#6fe9b8;box-shadow:0 1px 3px rgba(0,0,0,.4)}
body.theme-dark .api-status,body.theme-dark .profile{border-color:#33423b}
body.theme-dark .profile:hover{background:#2f3e37}
body.theme-dark .profile .avatar{background:#3c4d44;color:#e2ede7}
body.theme-dark .webhook-box{background:#0c1310;border:1px solid #253029}
body.theme-dark .toast{background:#1d2721;border:1px solid #3a4a42}
body.theme-dark .neuro-bg{opacity:1;filter:saturate(1.2) brightness(1.15)}
body.theme-dark ::-webkit-scrollbar-thumb{background:#2e3b34;background-clip:content-box}
body.theme-dark ::-webkit-scrollbar-thumb:hover{background:#3b4a42;background-clip:content-box}
body.theme-dark *{scrollbar-color:#2e3b34 transparent}

/* === Мобильная версия и журнал === */

.journal-head{margin:26px 0 14px}
.journal-card{max-height:none}
.journal-card .activity-item time{white-space:nowrap}

@media(max-width:720px){
  /* Всё, что добавилось за последние правки, должно быть удобным и с телефона. */
  .theme-switch button{font-size:11px;padding:10px 6px}
  .list-columns-panel{position:fixed;left:12px;right:12px;top:auto;bottom:12px;width:auto;max-height:62vh;overflow:auto}
  .stage-menu{position:fixed;left:12px;right:12px;top:auto;bottom:12px;width:auto;z-index:70}
  .card-menu{position:fixed;left:12px;right:12px;top:auto;bottom:12px;width:auto;z-index:70}
  .confirm-dialog{width:100%;padding:20px 18px 16px}
  .confirm-dialog footer{flex-direction:column-reverse}
  .confirm-dialog footer button{width:100%}
  .trash-modal{width:100%}
  .trash-row{flex-wrap:wrap}
  .trash-row button{width:100%}
  .toast{flex-wrap:wrap}
  .toast-undo{width:100%;margin-left:0}
  .drawer-head{gap:10px;padding:16px 14px 14px}
  .drawer-head h2{font-size:19px}
  .drawer-close-left{width:30px;height:30px;font-size:18px}
  .drawer-stage-step span{font-size:9px}
  .deal-list-wrap{overflow-x:auto}
  .deal-list{min-width:640px}
  .board-toolbar>.filter-group{gap:6px}
  .filter-button,.chip{padding:8px 10px;font-size:11px}
  .activity-item{grid-template-columns:28px 1fr;row-gap:4px}
  .activity-item time{grid-column:2;justify-self:start}
  .journal-head{flex-direction:column;align-items:flex-start;gap:10px}
  .journal-head button{width:100%}
  .kanban-scroll-arrow{width:34px!important;height:56px!important;font-size:26px!important}
  .kanban-scroll-arrow.left{left:6px!important}
  .kanban-scroll-arrow.right{right:6px!important}
  .neuro-bg{opacity:.7}
}
@media(max-width:420px){
  .main{padding:18px 12px 64px}
  .topbar h1{font-size:20px}
  .board{grid-auto-columns:86vw}
  .column{min-width:86vw}
}

/* === Тёмная тема: карточка сделки в едином стиле ===
   Раньше внутри сделки часть блоков оставалась светлой, часть зелёной — теперь
   все панели, кнопки и подписи живут по одним правилам. */

body.theme-dark .deal-composer nav{border-bottom-color:#36453e}
body.theme-dark .deal-composer nav button{color:#a8b6ae}
body.theme-dark .deal-composer nav button.active{background:#33473f;color:#6fe9b8;box-shadow:inset 0 0 0 1px #4b6f5f}
body.theme-dark .deal-composer textarea{background:#1d2721;border-color:#3d4f46;color:var(--ink)}
body.theme-dark .deal-composer textarea:focus{border-color:#3ecf9a;box-shadow:var(--ring)}
body.theme-dark .task-composer-controls label span{color:#93a09a}
body.theme-dark .task-composer-controls input,
body.theme-dark .task-composer-controls select{background:#1d2721;border-color:#3d4f46;color:#d3e0d9}
body.theme-dark .task-actions-button{background:#2b3a33;border-color:#3d4f46;color:#d3e0d9}
body.theme-dark .task-actions-menu{background:#26332c;border-color:#3a4a42;box-shadow:var(--lift-3)}
body.theme-dark .task-actions-menu button{background:#26332c!important;color:#c3d0c9!important}
body.theme-dark .task-actions-menu button:hover{background:#33433b!important;color:#6fe9b8!important}
body.theme-dark .composer-actions small{color:#93a09a}
body.theme-dark .composer-actions button{background:#1f9c74;color:#eafff6}
body.theme-dark .composer-actions button:hover{background:#23ac7f}

body.theme-dark .client-chat-card{background:#232f29;box-shadow:var(--lift-1)}
body.theme-dark .client-chat-card small{color:#93a09a}
body.theme-dark .client-chat-card p{color:#b3c1ba}
body.theme-dark .client-chat-card strong{color:var(--ink)}
body.theme-dark .client-chat-card a{background:#1f9c74;color:#eafff6}
body.theme-dark .client-chat-card a:nth-child(2),
body.theme-dark .client-chat-actions a+a{background:#33433b;color:#d3e0d9}
body.theme-dark .status-pill{background:#2c4a3b;color:#8fe3bd}
body.theme-dark .status-pill.off{background:#3a352c;color:#dcc79a}

body.theme-dark .discussion-invite{background:#232f29;color:#93a09a;box-shadow:var(--lift-1)}
body.theme-dark .feed-divider{color:#0d1512}
body.theme-dark .feed-divider::before,body.theme-dark .feed-divider::after{background:#36453e}
body.theme-dark .feed-divider span{background:#3ecf9a;color:#0b1310}
body.theme-dark .deal-feed-item{background:#232f29;box-shadow:var(--lift-1)}
body.theme-dark .deal-feed-icon{background:#33433b;color:#6fe9b8}
body.theme-dark .empty,body.theme-dark .deal-feed-item p,body.theme-dark .deal-feed-item small{color:#93a09a}

body.theme-dark .bitrix-stage-field button,body.theme-dark .bitrix-amount>button,
body.theme-dark .editable-deal-field em,body.theme-dark .deal-section-title button,
body.theme-dark .drawer-stage button,body.theme-dark .bitrix-contact-card>button{
  background:#2b3a33;border-color:#3d4f46;color:#6fe9b8;
}
body.theme-dark .bitrix-stage-field button:hover,body.theme-dark .bitrix-contact-card>button:hover{background:#33433b}
body.theme-dark .bitrix-amount strong{color:#dbe7e1}
body.theme-dark .bitrix-stage-field small,body.theme-dark .bitrix-amount small,
body.theme-dark .bitrix-contact-card small,body.theme-dark .bitrix-field-stack small,
body.theme-dark .bitrix-amount>span,body.theme-dark .drawer-title-meta{color:#93a09a}
body.theme-dark .bitrix-field-stack strong{color:#d3e0d9}
body.theme-dark .field-empty{color:#7d8a83}
body.theme-dark .bitrix-deal-panel>.deal-section-title{border-bottom-color:#36453e}
body.theme-dark .bitrix-deal-panel>.deal-section-title h3,body.theme-dark .deal-subhead{color:#a8b6ae}
body.theme-dark .drawer-title-meta span:first-child{color:#6fe9b8;border-bottom-color:#4b6f5f}
body.theme-dark .editable-deal-field:hover{background:#31423a}

/* === Перетаскивание стадий === */
.stage-cap{cursor:default}
.stage-cap.stage-editable{cursor:grab}
.stage-cap:active{cursor:grabbing}
.stage-cap.stage-dragging{opacity:.5;transform:scale(.98)}
.stage-cap.stage-drop-target{box-shadow:inset 0 0 0 2px rgba(255,255,255,.85),0 6px 16px rgba(0,0,0,.22)}
.stage-menu-hint{margin:6px 8px 2px;color:#8d968f;font-size:10px;line-height:1.45}
body.theme-dark .stage-menu-hint{color:#93a09a}

/* === Apple Liquid Glass: единая поверхность и живой свет под курсором === */
:root{--glass-line:rgba(255,255,255,.62);--glass-shadow:0 14px 38px rgba(30,55,44,.10),inset 0 1px 0 rgba(255,255,255,.82);--glass-fill:rgba(255,255,255,.66)}
.lead-card,.column,.metric,.automation-card,.integration-card,.employee-card,.calendar-layout,
.activity-card,.deal-section,.contact-preview,.deal-list-wrap,.robot-card,.settings-card,.team-summary,
.personal-login-dialog,.crm-chat-dialog,.google-calendar-dialog,.permissions-dialog{
 position:relative;isolation:isolate;overflow:hidden;border-color:var(--glass-line);
 background:linear-gradient(145deg,rgba(255,255,255,.78),rgba(245,249,246,.54));
 -webkit-backdrop-filter:blur(24px) saturate(155%);backdrop-filter:blur(24px) saturate(155%);
 box-shadow:var(--glass-shadow);transition:transform .24s var(--ease),box-shadow .24s var(--ease),border-color .24s var(--ease)
}
.lead-card::before,.metric::before,.automation-card::before,.integration-card::before,.employee-card::before,.robot-card::before{
 content:"";position:absolute;z-index:-1;inset:0;pointer-events:none;opacity:0;
 background:radial-gradient(220px circle at var(--glass-x,50%) var(--glass-y,50%),rgba(255,255,255,.86),rgba(197,240,224,.22) 42%,transparent 72%);
 transition:opacity .2s var(--ease)
}
.lead-card:hover::before,.metric:hover::before,.automation-card:hover::before,.integration-card:hover::before,.employee-card:hover::before,.robot-card:hover::before{opacity:1}
.lead-card:hover,.metric:hover,.automation-card:hover,.integration-card:hover,.employee-card:hover,.robot-card:hover{border-color:rgba(255,255,255,.94);box-shadow:0 18px 45px rgba(28,64,48,.16),inset 0 1px 0 #fff;transform:translateY(-2px)}
.permissions-backdrop{position:fixed;inset:0;z-index:240;display:grid;place-items:center;padding:22px;background:rgba(18,27,24,.34);backdrop-filter:blur(14px)}
.permissions-dialog{width:min(620px,100%);max-height:calc(100vh - 44px);overflow:auto;border:1px solid var(--glass-line);border-radius:24px;padding:24px}
.permissions-dialog header{display:flex;justify-content:space-between;gap:18px}.permissions-dialog h2{margin:5px 0;font:600 24px Onest}.permissions-dialog header small{color:var(--green);font-weight:800;letter-spacing:.13em}.permissions-dialog header p{margin:5px 0 0;color:var(--muted);font-size:10px}.permissions-dialog header>button{width:36px;height:36px;border:0;border-radius:50%;background:rgba(255,255,255,.7);font-size:22px;cursor:pointer}
.permissions-list{display:grid;gap:8px;margin:20px 0}.permissions-list label{display:flex;align-items:center;justify-content:space-between;gap:16px;border:1px solid rgba(125,145,135,.16);border-radius:14px;background:rgba(255,255,255,.48);padding:13px 15px;cursor:pointer}.permissions-list b,.permissions-list small{display:block}.permissions-list b{font-size:11px}.permissions-list small{min-height:10px;margin-top:4px;color:var(--muted);font-size:8px}.permissions-list input{width:19px;height:19px;accent-color:var(--green)}.permissions-dialog footer{display:flex;justify-content:flex-end;gap:8px}
body.theme-dark{--glass-line:rgba(255,255,255,.12);--glass-shadow:0 16px 42px rgba(0,0,0,.3),inset 0 1px 0 rgba(255,255,255,.1)}
body.theme-dark .lead-card,body.theme-dark .column,body.theme-dark .metric,body.theme-dark .automation-card,body.theme-dark .integration-card,body.theme-dark .employee-card,body.theme-dark .calendar-layout,body.theme-dark .activity-card,body.theme-dark .deal-section,body.theme-dark .contact-preview,body.theme-dark .deal-list-wrap,body.theme-dark .robot-card,body.theme-dark .permissions-dialog{background:linear-gradient(145deg,rgba(47,63,55,.74),rgba(25,36,30,.62));border-color:var(--glass-line)}
body.theme-dark .permissions-list label,body.theme-dark .permissions-dialog header>button{background:rgba(255,255,255,.06);color:var(--ink)}
@media(max-width:640px){.permissions-backdrop{padding:0}.permissions-dialog{width:100%;max-height:100vh;min-height:100vh;border-radius:0;padding:20px}.permissions-dialog footer{position:sticky;bottom:-20px;background:rgba(255,255,255,.82);backdrop-filter:blur(18px);padding:12px 0 0}}

/* ========================================================================== */
/* Compact workspace + collapsible sidebar                                    */
/* ========================================================================== */
:root{--sidebar-wide:216px;--sidebar-narrow:68px;--compact-column:194px}
.app-shell{grid-template-columns:var(--sidebar-wide) minmax(0,1fr);transition:grid-template-columns .24s cubic-bezier(.2,.7,.2,1)}
.sidebar{width:var(--sidebar-wide);padding:16px 11px 13px;transition:width .24s cubic-bezier(.2,.7,.2,1),padding .24s cubic-bezier(.2,.7,.2,1)}
.sidebar-head{display:flex;align-items:center;gap:4px;min-width:0}.sidebar-head .brand{flex:1;min-width:0;margin:0;padding:0 7px 16px;font-size:20px}
.sidebar-toggle{width:34px;height:34px;display:grid;place-content:center;gap:4px;flex:0 0 auto;border:1px solid rgba(39,82,68,.13);border-radius:11px;background:rgba(255,255,255,.56);color:var(--green);cursor:pointer;box-shadow:0 6px 18px rgba(35,64,54,.07);transition:.2s ease}.sidebar-toggle:hover{background:rgba(255,255,255,.88);transform:translateY(-1px)}.sidebar-toggle i{display:block;width:15px;height:1.5px;border-radius:2px;background:currentColor;transition:.2s ease}
.nav{gap:4px}.nav-item{min-height:42px;padding:9px 11px;border-radius:11px;font-size:13px}.nav-icon{font-size:17px}.sidebar-bottom{gap:7px}.theme-switch{padding:3px}.theme-switch button{padding:7px 4px;font-size:10px}.api-status{padding:10px 7px}.profile{padding:8px 6px}.profile .avatar{width:34px;height:34px}
.main{min-width:0;padding:20px 20px 38px}.topbar{margin-bottom:14px}.topbar h1{font-size:28px;line-height:1.05}.top-actions{gap:8px}.primary-button,.secondary-button,.icon-button{min-height:36px}.crm-toolbar{gap:8px;margin-bottom:10px}.crm-toolbar>*{min-height:34px}.pipeline-filter{max-width:580px}.board-toolbar{margin-bottom:9px;gap:7px}.view-switch button,.responsible-filter,.filter-chip{min-height:32px}
.board{grid-template-columns:repeat(22,var(--compact-column));gap:7px;padding:0 0 12px}.column{width:var(--compact-column);min-width:var(--compact-column);padding:5px;border-radius:10px}.stage-cap{min-height:29px;padding:6px 8px;border-radius:7px}.stage-cap strong{font-size:9px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.column-total{height:26px;margin:5px 0;font-size:10px}.column-add{height:25px;margin-bottom:5px}.lead-card{margin-bottom:6px;padding:8px;border-radius:10px}.lead-top{gap:5px}.lead-top>span{font-size:11px;line-height:1.25}.lead-top button{font-size:14px}.board .lead-card>p{font-size:9px;line-height:1.35;margin:4px 0 6px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.lead-value{padding:6px 0;font-size:10px}.source{max-width:104px;padding:3px 5px;font-size:7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.card-field{margin-top:5px}.board .card-field span{font-size:8px}.board .card-field b{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.lead-meta{padding:6px 0;font-size:8px}.card-owner{gap:6px;padding-top:6px}.card-owner .avatar{width:26px;height:26px;font-size:8px}.card-owner span,.card-owner b{font-size:8px}.lead-flag{padding:3px 5px;font-size:7px}.column-empty{padding:26px 5px}.column-empty strong{font-size:10px}.column-empty span{font-size:8px}
.app-shell.sidebar-collapsed{grid-template-columns:var(--sidebar-narrow) minmax(0,1fr)}.sidebar-collapsed .sidebar{width:var(--sidebar-narrow);padding-inline:8px}.sidebar-collapsed .sidebar-head{flex-direction:column;gap:8px}.sidebar-collapsed .sidebar-head .brand{flex:0 0 auto;padding:0}.sidebar-collapsed .brand>span:last-child,.sidebar-collapsed .nav-item>span:not(.nav-icon),.sidebar-collapsed .nav-item>b,.sidebar-collapsed .theme-switch,.sidebar-collapsed .api-status>div,.sidebar-collapsed .profile>div:not(.avatar),.sidebar-collapsed .profile>button{display:none}.sidebar-collapsed .sidebar-toggle{transform:rotate(180deg)}.sidebar-collapsed .nav-item{width:44px;min-height:42px;justify-content:center;padding:8px;margin-inline:auto}.sidebar-collapsed .nav-icon{margin:0}.sidebar-collapsed .api-status{justify-content:center;padding:10px 0}.sidebar-collapsed .profile{justify-content:center;padding-inline:0}.sidebar-collapsed .sidebar-bottom{align-items:center}.sidebar-collapsed .board-arrow.left{left:80px}
.google-simple-connect{display:grid;grid-template-columns:minmax(220px,.8fr) minmax(320px,1.2fr);gap:18px;align-items:end;margin:18px 0;padding:20px;border:1px solid rgba(56,112,91,.16);border-radius:18px;background:linear-gradient(135deg,rgba(235,249,240,.84),rgba(255,255,255,.64));box-shadow:inset 0 1px rgba(255,255,255,.8),0 16px 40px rgba(35,80,62,.08)}.google-simple-connect h3{margin:4px 0 6px;font-size:20px}.google-simple-connect p{margin:0;color:var(--muted);font-size:12px}.google-simple-connect form{display:flex;gap:8px;align-items:end}.google-simple-connect label{flex:1}.google-simple-connect input{width:100%}.google-advanced-connect{border-top:1px solid var(--line);padding-top:14px}.google-advanced-connect summary{cursor:pointer;font-weight:700;color:var(--green);padding:10px 0}
body.theme-dark .sidebar-toggle{background:rgba(35,48,44,.72);border-color:rgba(255,255,255,.1)}body.theme-dark .google-simple-connect{background:linear-gradient(135deg,rgba(37,68,57,.7),rgba(23,34,30,.64));border-color:rgba(160,210,189,.14)}
@media(max-width:720px){.app-shell,.app-shell.sidebar-collapsed{display:block}.sidebar-toggle{display:none}.sidebar-head .brand{padding-bottom:20px}.main{padding:16px 12px 28px}.google-simple-connect{grid-template-columns:1fr;padding:15px}.google-simple-connect form{align-items:stretch;flex-direction:column}}

/* ========================================================================== */
/* Bitrix-density Kanban: transparent lanes, compact cards, local scrolling   */
/* ========================================================================== */
:root{--compact-column:178px;--kanban-gap:2px;--kanban-card-height:176px}
.sidebar-head{display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;gap:2px;margin-bottom:16px}
.sidebar-head .sidebar-toggle{grid-column:1;grid-row:1;justify-self:center;border:0;border-radius:8px;background:transparent;box-shadow:none}
.sidebar-head .sidebar-toggle:hover{background:rgba(23,91,69,.07);box-shadow:none;transform:none}
.sidebar-head .brand{grid-column:2;grid-row:1;padding:0 4px}
.sidebar-collapsed .sidebar-head{display:flex;flex-direction:column;align-items:center;gap:7px}
.sidebar-collapsed .sidebar-head .sidebar-toggle{order:-1}

.kanban-scroll-shell{min-height:0}
.board:not(.list-mode){
  grid-template-columns:repeat(var(--stage-count,22),var(--compact-column));
  grid-auto-columns:var(--compact-column);
  gap:var(--kanban-gap);
  align-items:start;
  padding:0 0 8px;
}
.board:not(.list-mode) .column{
  width:var(--compact-column);min-width:var(--compact-column);max-width:var(--compact-column);
  height:calc(100dvh - 205px);min-height:430px;
  display:flex;flex-direction:column;
  padding:0 3px 0;
  overflow:hidden;
  border:0;border-right:1px dashed rgba(68,91,80,.16);border-radius:0;
  background:transparent;
  -webkit-backdrop-filter:none;backdrop-filter:none;
  box-shadow:none;isolation:auto;
}
.board:not(.list-mode) .column:hover{box-shadow:none}
.board:not(.list-mode) .stage-cap{flex:0 0 29px;height:29px;min-height:29px;max-height:29px;margin:0 0 4px;box-shadow:none}
.board:not(.list-mode) .column-total{flex:0 0 24px;margin:0 0 3px;background:rgba(255,255,255,.42);border-radius:5px;padding:5px}
.board:not(.list-mode) .column-add{flex:0 0 24px;height:24px;margin:0 0 3px;border-radius:5px}
.column-cards{
  flex:1;min-height:0;
  overflow-y:auto;overflow-x:hidden;
  padding:2px 3px 18px 1px;
  overscroll-behavior-x:auto;overscroll-behavior-y:contain;
  scrollbar-width:thin;scrollbar-color:rgba(89,108,99,.42) transparent;
}
.column-cards::-webkit-scrollbar{width:7px}
.column-cards::-webkit-scrollbar-thumb{border:2px solid transparent;background:rgba(89,108,99,.42);background-clip:content-box}
.column-load-more{display:block;width:calc(100% - 4px);margin:8px 2px 2px;border:1px solid rgba(23,91,69,.15);border-radius:8px;background:rgba(255,255,255,.72);color:var(--green);padding:9px 6px;font:700 9px Manrope;cursor:pointer}.column-load-more:hover{background:#fff;border-color:rgba(23,91,69,.3)}.column-load-more small{display:block;margin-top:2px;color:var(--muted);font-size:7px;font-weight:600}
.crm-hydrating .app-shell{pointer-events:none;cursor:wait}

.board:not(.list-mode) .lead-card{
  width:100%;height:var(--kanban-card-height);min-height:var(--kanban-card-height);max-height:var(--kanban-card-height);
  display:flex;flex-direction:column;
  margin:0 0 4px;padding:8px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.46);border-radius:9px;
  background:rgba(255,255,255,.68);
  -webkit-backdrop-filter:blur(11px) saturate(118%);backdrop-filter:blur(11px) saturate(118%);
  box-shadow:0 2px 8px rgba(28,52,42,.08),inset 0 1px 0 rgba(255,255,255,.55);
  transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease,background-color .15s ease;
}
.board:not(.list-mode) .lead-card::before{display:none!important}
.board:not(.list-mode) .lead-card:hover{
  transform:translateY(-1px);
  border-color:rgba(255,255,255,.7);
  background:rgba(255,255,255,.76);
  box-shadow:0 4px 12px rgba(28,52,42,.11),inset 0 1px 0 rgba(255,255,255,.7);
}
.board:not(.list-mode) .lead-card>p{min-height:0;max-height:25px;margin:3px 0 5px}
.board:not(.list-mode) .lead-value{padding:5px 0}
.board:not(.list-mode) .card-field{margin-top:3px;padding-top:4px}
.board:not(.list-mode) .lead-meta{margin-top:auto;padding:4px 0}
.board:not(.list-mode) .card-owner{padding-top:4px}
.board:not(.list-mode) .lead-flag{flex:0 0 auto;margin-bottom:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.board:not(.list-mode) .column-empty{min-height:120px;padding:24px 7px;background:transparent}

body.theme-dark .board:not(.list-mode) .column{background:transparent;border-color:rgba(255,255,255,.08);box-shadow:none}
body.theme-dark .board:not(.list-mode) .column-total{background:rgba(18,28,23,.35)}
body.theme-dark .board:not(.list-mode) .lead-card{
  color:var(--ink);border-color:rgba(255,255,255,.09);
  background:rgba(29,42,35,.68);
  box-shadow:0 2px 8px rgba(0,0,0,.20),inset 0 1px 0 rgba(255,255,255,.07)
}
body.theme-dark .board:not(.list-mode) .lead-card:hover{
  border-color:rgba(113,217,174,.18);background:rgba(36,51,43,.76);
  box-shadow:0 4px 12px rgba(0,0,0,.25),inset 0 1px 0 rgba(255,255,255,.09)
}
@media(max-width:720px){
  :root{--compact-column:178px;--kanban-card-height:176px}
  .board:not(.list-mode){grid-template-columns:repeat(var(--stage-count,22),var(--compact-column));grid-auto-columns:var(--compact-column)}
  .board:not(.list-mode) .column{height:calc(100dvh - 238px);width:var(--compact-column);min-width:var(--compact-column);max-width:var(--compact-column)}
}

/* ========================================================================== */
/* Liquid Glass v21: optical edge, translucent depth, no milky cursor blob    */
/* ========================================================================== */
:root{
  --liquid-fill:linear-gradient(145deg,rgba(255,255,255,.52),rgba(255,255,255,.26) 47%,rgba(225,244,235,.34));
  --liquid-fill-strong:linear-gradient(145deg,rgba(255,255,255,.72),rgba(255,255,255,.40) 52%,rgba(230,247,239,.48));
  --liquid-line:rgba(255,255,255,.70);
  --liquid-line-soft:rgba(255,255,255,.48);
  --liquid-shadow:0 10px 26px rgba(31,60,48,.085),0 2px 7px rgba(31,60,48,.045),inset 0 1px 0 rgba(255,255,255,.82),inset 0 -1px 0 rgba(94,137,119,.08);
  --liquid-shadow-hover:0 13px 30px rgba(31,60,48,.12),0 3px 8px rgba(31,60,48,.055),inset 0 1px 0 rgba(255,255,255,.92),inset 0 -1px 0 rgba(94,137,119,.10);
}

/* Regular glass belongs to navigation and grouping surfaces. */
.sidebar,.metric,.automation-card,.integration-card,.employee-card,.calendar-layout,
.activity-card,.deal-section,.contact-preview,.deal-list-wrap,.robot-card,.settings-card,.team-summary,
.personal-login-dialog,.crm-chat-dialog,.google-calendar-dialog,.permissions-dialog,.modal,.robot-editor-dialog,
.stage-menu,.card-menu,.list-columns-panel,.pipeline-select,.pipeline-filter,.icon-button,.secondary-button,
.view-switch,.responsible-filter,.filter-chip,.chip,.filter-button{
  border:1px solid var(--liquid-line-soft);
  background:var(--liquid-fill);
  -webkit-backdrop-filter:blur(22px) saturate(142%) contrast(102%);
  backdrop-filter:blur(22px) saturate(142%) contrast(102%);
  box-shadow:var(--liquid-shadow);
}

/* The highlight is clipped to a one-pixel optical rim, never a white patch. */
.metric::before,.automation-card::before,.integration-card::before,.employee-card::before,.robot-card::before{
  content:"";display:block;position:absolute;z-index:3;inset:-1px;padding:1px;border-radius:inherit;
  pointer-events:none;opacity:.58;
  background:radial-gradient(82px circle at var(--glass-x,22%) var(--glass-y,0%),rgba(255,255,255,.95),rgba(255,255,255,.18) 48%,transparent 76%);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;mask-composite:exclude;
  transition:opacity .18s ease;
}
.metric:hover::before,.automation-card:hover::before,.integration-card:hover::before,.employee-card:hover::before,.robot-card:hover::before{opacity:.78}
.metric:hover,.automation-card:hover,.integration-card:hover,.employee-card:hover,.robot-card:hover{
  transform:translateY(-1px);border-color:var(--liquid-line);box-shadow:var(--liquid-shadow-hover)
}

/* Primary actions use a selective green tint, as recommended for hierarchy. */
.primary-button,.quick-create{
  background:linear-gradient(145deg,rgba(25,103,76,.94),rgba(18,79,59,.88));
  border:1px solid rgba(255,255,255,.20);
  -webkit-backdrop-filter:blur(16px) saturate(135%);backdrop-filter:blur(16px) saturate(135%);
  box-shadow:0 9px 22px rgba(20,76,56,.20),inset 0 1px 0 rgba(255,255,255,.22)
}

/* Deal cards: square scan-friendly layout with one-line identity fields. */
.board:not(.list-mode) .lead-card{
  width:100%;height:var(--kanban-card-height);min-height:var(--kanban-card-height);max-height:var(--kanban-card-height);aspect-ratio:auto;
  padding:8px;border:1px solid var(--liquid-line-soft);
  background:var(--liquid-fill-strong);
  -webkit-backdrop-filter:blur(18px) saturate(138%) contrast(102%);
  backdrop-filter:blur(18px) saturate(138%) contrast(102%);
  box-shadow:0 6px 17px rgba(31,60,48,.075),inset 0 1px 0 rgba(255,255,255,.85),inset 0 -1px 0 rgba(94,137,119,.07)
}
.board:not(.list-mode) .lead-card::before{display:none!important}
.board:not(.list-mode) .lead-card::after{
  content:"";position:absolute;z-index:3;inset:-1px;padding:1px;border-radius:inherit;pointer-events:none;
  background:linear-gradient(132deg,rgba(255,255,255,.92),rgba(255,255,255,.12) 25%,transparent 58%,rgba(123,176,153,.15));
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;mask-composite:exclude
}
.board:not(.list-mode) .lead-card:hover{
  transform:translateY(-1px);border-color:var(--liquid-line);
  background:linear-gradient(145deg,rgba(255,255,255,.66),rgba(255,255,255,.34) 50%,rgba(229,246,238,.43));
  box-shadow:0 9px 21px rgba(31,60,48,.10),inset 0 1px 0 rgba(255,255,255,.92),inset 0 -1px 0 rgba(94,137,119,.08)
}
.board:not(.list-mode) .lead-top{min-width:0;align-items:center}
.board:not(.list-mode) .lead-top>span{
  min-width:0;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-size:10px;line-height:1.2;letter-spacing:-.01em
}
.board:not(.list-mode) .lead-top button{flex:0 0 auto}
.board:not(.list-mode) .lead-card>p{
  min-height:12px;max-height:12px;margin:3px 0 4px;display:block;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:8px;line-height:1.45
}
.board:not(.list-mode) .lead-value{min-height:22px;padding:4px 0;font-size:9px}
.board:not(.list-mode) .card-field{
  min-height:20px;margin:0;padding:4px 0;display:flex;align-items:baseline;justify-content:space-between;gap:6px
}
.board:not(.list-mode) .card-field small{flex:0 0 auto;font-size:7px}
.board:not(.list-mode) .card-field b{min-width:0;margin:0;font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right}
.board:not(.list-mode) .lead-meta{min-height:18px;margin-top:auto;padding:3px 0;gap:5px;white-space:nowrap}
.board:not(.list-mode) .lead-meta span{min-width:0;overflow:hidden;text-overflow:ellipsis}
.board:not(.list-mode) .card-owner{min-height:25px;padding-top:3px;min-width:0}
.board:not(.list-mode) .card-owner>div{min-width:0;display:flex;align-items:baseline;gap:4px}
.board:not(.list-mode) .card-owner small{display:none}
.board:not(.list-mode) .card-owner strong{min-width:0;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:8px}

body.theme-dark{
  --liquid-fill:linear-gradient(145deg,rgba(54,72,63,.54),rgba(27,39,33,.42) 50%,rgba(35,55,46,.48));
  --liquid-fill-strong:linear-gradient(145deg,rgba(61,80,70,.62),rgba(28,41,34,.52) 52%,rgba(37,57,48,.56));
  --liquid-line:rgba(202,239,224,.22);--liquid-line-soft:rgba(213,241,229,.13);
  --liquid-shadow:0 12px 28px rgba(0,0,0,.25),0 2px 7px rgba(0,0,0,.16),inset 0 1px 0 rgba(255,255,255,.10),inset 0 -1px 0 rgba(0,0,0,.13);
  --liquid-shadow-hover:0 15px 34px rgba(0,0,0,.31),0 3px 9px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.14)
}
body.theme-dark .sidebar,body.theme-dark .metric,body.theme-dark .automation-card,body.theme-dark .integration-card,
body.theme-dark .employee-card,body.theme-dark .calendar-layout,body.theme-dark .activity-card,body.theme-dark .deal-section,
body.theme-dark .contact-preview,body.theme-dark .deal-list-wrap,body.theme-dark .robot-card,body.theme-dark .settings-card,
body.theme-dark .personal-login-dialog,body.theme-dark .crm-chat-dialog,body.theme-dark .google-calendar-dialog,
body.theme-dark .permissions-dialog,body.theme-dark .modal,body.theme-dark .robot-editor-dialog,
body.theme-dark .stage-menu,body.theme-dark .card-menu,body.theme-dark .list-columns-panel,
body.theme-dark .pipeline-select,body.theme-dark .pipeline-filter,body.theme-dark .icon-button,body.theme-dark .secondary-button,
body.theme-dark .view-switch,body.theme-dark .responsible-filter,body.theme-dark .filter-chip,body.theme-dark .chip,body.theme-dark .filter-button{
  background:var(--liquid-fill);border-color:var(--liquid-line-soft);box-shadow:var(--liquid-shadow)
}
body.theme-dark .board:not(.list-mode) .lead-card{
  background:var(--liquid-fill-strong);border-color:var(--liquid-line-soft);box-shadow:0 7px 18px rgba(0,0,0,.22),inset 0 1px 0 rgba(255,255,255,.10)
}
body.theme-dark .board:not(.list-mode) .lead-card:hover{
  background:linear-gradient(145deg,rgba(68,89,77,.68),rgba(31,46,38,.57) 53%,rgba(42,64,53,.61));
  border-color:var(--liquid-line);box-shadow:0 10px 24px rgba(0,0,0,.29),inset 0 1px 0 rgba(255,255,255,.14)
}

@media(prefers-reduced-transparency:reduce){
  .sidebar,.lead-card,.metric,.automation-card,.integration-card,.employee-card,.calendar-layout,.activity-card,
  .deal-section,.contact-preview,.deal-list-wrap,.robot-card,.settings-card,.pipeline-select,.pipeline-filter,.icon-button,
  .secondary-button,.view-switch,.responsible-filter,.filter-chip,.chip,.filter-button{-webkit-backdrop-filter:none;backdrop-filter:none}
}

/* ========================================================================== */
/* Kanban polish v22: clean chevrons, transparent navigation, one type system */
/* ========================================================================== */
:root{--kanban-gap:0px}
.board:not(.list-mode) .column{padding-inline:0}
.board:not(.list-mode) .column-cards{padding-inline:2px 4px}

/* One clipped shape replaces the old cap + separate CSS triangle pair. */
.board:not(.list-mode) .stage-cap{
  width:100%;min-height:29px;margin:0 0 4px;padding:6px 15px 6px 9px;
  border:0;border-radius:7px 0 0 7px;overflow:hidden;
  clip-path:polygon(0 0,calc(100% - 7px) 0,100% 50%,calc(100% - 7px) 100%,0 100%);
  box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none
}
.board:not(.list-mode) .stage-cap::before,
.board:not(.list-mode) .stage-cap::after{display:none!important}

/* Navigation is an unobtrusive overlay: no white panel obscures deal cards. */
.kanban-scroll-arrow{
  width:28px!important;height:64px!important;border:0!important;border-radius:0!important;
  background:transparent!important;box-shadow:none!important;color:rgba(55,76,67,.48)!important;
  opacity:.42!important;text-shadow:0 1px 2px rgba(255,255,255,.9);
  transition:opacity .16s ease,color .16s ease!important
}
.kanban-scroll-shell:hover .kanban-scroll-arrow{opacity:.58!important}
.kanban-scroll-arrow:hover,.kanban-scroll-arrow:focus-visible{
  background:transparent!important;box-shadow:none!important;color:var(--green)!important;opacity:.92!important
}
.kanban-scroll-arrow:active{background:transparent!important;opacity:1!important}
body.theme-dark .kanban-scroll-arrow{color:rgba(221,239,231,.54)!important;text-shadow:0 1px 3px rgba(0,0,0,.65)}

/* Bitrix-like scan density: every text fragment in a kanban card uses Manrope. */
.board:not(.list-mode) .lead-card,
.board:not(.list-mode) .lead-card *{font-family:Manrope,Arial,sans-serif}
.board:not(.list-mode) .lead-top>span{font-size:10px;font-weight:700;letter-spacing:0}
.board:not(.list-mode) .lead-card>p{font-size:8px;font-weight:500}
.board:not(.list-mode) .lead-value strong{font-size:9px;font-weight:700}
.board:not(.list-mode) .card-owner{min-height:18px;gap:0}
.board:not(.list-mode) .card-owner .mini-avatar{display:none!important}
.board:not(.list-mode) .card-owner>div{width:100%}
.board:not(.list-mode) .card-owner strong{font-size:8px;font-weight:600}

@media(max-width:720px){.kanban-scroll-arrow{width:24px!important;height:54px!important}}

/* ========================================================================== */
/* Kanban fixed geometry v23: resizing the browser never stretches the lanes */
/* ========================================================================== */
:root{
  --compact-column:178px;
  --kanban-column-height:640px;
  --kanban-card-height:176px;
  --kanban-stage-height:29px;
}
.board:not(.list-mode){
  grid-template-columns:repeat(var(--stage-count,22),var(--compact-column))!important;
  grid-auto-columns:var(--compact-column)!important;
  align-items:start!important;
}
.board:not(.list-mode) .column{
  flex:0 0 var(--compact-column)!important;
  inline-size:var(--compact-column)!important;
  width:var(--compact-column)!important;
  min-width:var(--compact-column)!important;
  max-width:var(--compact-column)!important;
  block-size:var(--kanban-column-height)!important;
  height:var(--kanban-column-height)!important;
  min-height:var(--kanban-column-height)!important;
  max-height:var(--kanban-column-height)!important;
}
.board:not(.list-mode) .stage-cap{
  flex:0 0 var(--kanban-stage-height)!important;
  block-size:var(--kanban-stage-height)!important;
  height:var(--kanban-stage-height)!important;
  min-height:var(--kanban-stage-height)!important;
  max-height:var(--kanban-stage-height)!important;
}
.board:not(.list-mode) .lead-card{
  flex:0 0 var(--kanban-card-height)!important;
  block-size:var(--kanban-card-height)!important;
  height:var(--kanban-card-height)!important;
  min-height:var(--kanban-card-height)!important;
  max-height:var(--kanban-card-height)!important;
  aspect-ratio:auto!important;
}
@media(max-width:720px){
  :root{
    --compact-column:178px;
    --kanban-column-height:640px;
    --kanban-card-height:176px;
    --kanban-stage-height:29px;
  }
}

/* Contact center: editable Avito welcome message. */
.avito-settings-backdrop{position:fixed;inset:0;z-index:215;display:grid;place-items:center;padding:24px;background:rgba(13,23,20,.58);backdrop-filter:blur(4px)}
.avito-settings-backdrop[hidden]{display:none}
.avito-settings-dialog{width:min(620px,100%);max-height:calc(100vh - 48px);overflow:auto;border-radius:18px;background:#fff;padding:26px;box-shadow:0 28px 85px rgba(3,17,12,.35)}
.avito-settings-dialog>header{display:flex;align-items:start;justify-content:space-between;gap:20px;padding-bottom:17px;border-bottom:1px solid var(--line)}
.avito-settings-dialog>header h2{margin:5px 0;font:600 24px Onest}
.avito-settings-dialog>header small{display:block;color:var(--muted);font-size:9px;line-height:1.55}
.avito-settings-dialog>header button{flex:0 0 auto;width:34px;height:34px;border:0;border-radius:50%;background:#eef1ed;color:#56625c;font-size:21px;cursor:pointer}
.avito-settings-dialog form{display:grid;gap:16px;margin-top:20px}
.avito-auto-reply-switch{display:flex;align-items:center;justify-content:space-between;gap:18px;border:1px solid var(--line);border-radius:13px;padding:16px;background:#f8faf8}
.avito-auto-reply-switch strong,.avito-auto-reply-switch small{display:block}
.avito-auto-reply-switch strong{font:600 13px Onest}
.avito-auto-reply-switch small{margin-top:5px;color:var(--muted);font:500 9px/1.45 Manrope}
.avito-auto-reply-switch input{appearance:none;flex:0 0 auto;width:44px;height:24px;border:0;border-radius:14px;background:#cbd0cc;position:relative;cursor:pointer;transition:.2s}
.avito-auto-reply-switch input:after{content:"";position:absolute;width:18px;height:18px;left:3px;top:3px;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.18);transition:.2s}
.avito-auto-reply-switch input:checked{background:var(--green)}
.avito-auto-reply-switch input:checked:after{transform:translateX(20px)}
.avito-new-chat-guard{margin:0;border:1px solid #d6e8dc;border-radius:11px;background:#edf7f0;color:#2d6a48;padding:12px 14px;font:600 9px/1.55 Manrope}
.avito-auto-reply-text{display:block;color:#4f5a55;font:700 9px Manrope}
.avito-auto-reply-text textarea{display:block;width:100%;resize:vertical;min-height:150px;margin-top:7px;border:1px solid #dbe2dd;border-radius:11px;background:#fff;padding:13px;color:#25302b;font:500 11px/1.6 Manrope;outline:0}
.avito-auto-reply-text textarea:focus{border-color:#65a98c;box-shadow:0 0 0 3px rgba(64,145,108,.1)}
.avito-auto-reply-text>small{display:block;margin-top:6px;text-align:right;color:var(--muted);font:500 8px Manrope}
.avito-settings-message{margin:0;border-radius:9px;background:#fff0e1;color:#8a5c35;padding:10px 12px;font:600 9px/1.5 Manrope}
.avito-settings-message.success{background:#e6f4eb;color:#286b49}
.avito-settings-message[hidden]{display:none}
.avito-settings-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--muted);font:500 9px Manrope}
.avito-settings-dialog footer{display:flex;justify-content:flex-end;gap:8px;padding-top:2px}
body.theme-dark .avito-settings-dialog{background:#25332d;color:#dce8e1}
body.theme-dark .avito-settings-dialog>header button,body.theme-dark .avito-auto-reply-switch{background:#2f4038}
body.theme-dark .avito-new-chat-guard{background:#293d33;border-color:#3f5a4b;color:#a9d6ba}
body.theme-dark .avito-auto-reply-text,body.theme-dark .avito-auto-reply-text textarea{color:#dce8e1}
body.theme-dark .avito-auto-reply-text textarea{background:#2b3a33;border-color:#43534b}
@media(max-width:640px){.avito-settings-backdrop{padding:0}.avito-settings-dialog{width:100%;max-height:100vh;min-height:100vh;border-radius:0;padding:20px}.avito-settings-meta{align-items:stretch;flex-direction:column}.avito-settings-dialog footer{position:sticky;bottom:-20px;display:grid;grid-template-columns:1fr 1fr;background:inherit;padding:12px 0 0}}

/* Явный вход в настройки контакт-центра из боковой панели. */
.api-status{width:100%;align-items:flex-start;background:transparent;color:inherit;text-align:left;font:inherit;border-left:0;border-right:0;border-radius:9px}
.api-status:hover{background:#eef1ec;transform:translateY(-1px)}
.api-status>span{flex:0 0 auto}.api-status>div{min-width:0}.api-status>b{margin-left:auto;color:var(--green);font-size:20px;line-height:1}
.api-status small{line-height:1.35}.sidebar-collapsed .api-status>b{display:none}
body.theme-dark .api-status:hover{background:#1e2924}

/* Телефон: закрываемое боковое меню с затемнением и крупными touch-target. */
.mobile-menu-scrim{display:none}
.mobile-sidebar-close{display:none}
@media(max-width:720px){
  body.mobile-nav-open{overflow:hidden}
  .mobile-menu{width:44px;height:44px;margin-right:4px;border-radius:10px;color:var(--ink);cursor:pointer}
  .mobile-menu-scrim{position:fixed;inset:0;z-index:9;border:0;background:rgba(13,23,20,.42);backdrop-filter:blur(2px)}
  body.mobile-nav-open .mobile-menu-scrim{display:block}
  .sidebar{z-index:10;width:min(300px,86vw)}
  .sidebar-head{grid-template-columns:minmax(0,1fr) 44px}
  .sidebar-head .brand{grid-column:1;grid-row:1;padding:0 4px}
  .mobile-sidebar-close{display:grid;grid-column:2;grid-row:1;place-items:center;width:44px;height:44px;border:0;border-radius:12px;background:#e8eee9;color:#52625b;font:400 27px/1 Arial;cursor:pointer}
  body.theme-dark .mobile-sidebar-close{background:#26332e;color:#dce6e0}
  .nav-item,.api-status,.theme-switch button{min-height:44px}
  .top-actions .primary-button{min-height:44px}
}
.mobile-menu-scrim[hidden]{display:none!important}

/* Фоновая синхронизация не должна заново анимировать все карточки. */
.column .lead-card{animation:none}

/* Мобильная стадия сделки: текущая + соседняя и полный список в нижней шторке. */
.drawer-stage-mobile{display:none}
.mobile-stage-sheet-backdrop{position:fixed;inset:0;z-index:240;display:flex;align-items:flex-end;justify-content:center;background:rgba(6,12,10,.68);backdrop-filter:blur(3px)}
.mobile-stage-sheet-backdrop[hidden]{display:none}
.mobile-stage-sheet{display:flex;flex-direction:column;width:min(620px,100%);max-height:88dvh;overflow:hidden;border-radius:24px 24px 0 0;background:#f8faf8;box-shadow:0 -22px 70px rgba(0,0,0,.32);animation:mobileStageSheetIn .2s ease-out}
@keyframes mobileStageSheetIn{from{transform:translateY(24px);opacity:.55}}
.mobile-stage-sheet-handle{flex:0 0 auto;width:44px;height:5px;margin:8px auto 5px;border-radius:8px;background:#a8afab}
.mobile-stage-sheet>header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:10px 18px 16px;border-bottom:1px solid var(--line)}
.mobile-stage-sheet>header small{display:block;color:var(--green);font:700 9px Manrope;text-transform:uppercase;letter-spacing:.09em}
.mobile-stage-sheet>header h2{margin:5px 0 0;font:600 20px Onest}
.mobile-stage-sheet>header button{display:grid;place-items:center;flex:0 0 auto;width:40px;height:40px;border:0;border-radius:50%;background:#e9eeea;color:#5f6a64;font-size:23px;cursor:pointer}
.mobile-stage-sheet-list{min-height:0;overflow:auto;overscroll-behavior:contain;padding:10px 16px calc(18px + env(safe-area-inset-bottom))}
.mobile-stage-option{display:grid;grid-template-columns:30px minmax(0,1fr);align-items:center;gap:10px;width:100%;min-height:58px;border:0;background:transparent;padding:5px 0;color:var(--ink);text-align:left;cursor:pointer}
.mobile-stage-option>b{color:#8a928e;font:500 13px Onest;text-align:center}
.mobile-stage-option>span{position:relative;display:flex;align-items:center;min-height:48px;overflow:hidden;background:var(--stage);color:#fff;padding:0 42px 0 18px;clip-path:polygon(0 0,95% 0,100% 50%,95% 100%,0 100%);font:700 14px Manrope;text-overflow:ellipsis;white-space:nowrap}
.mobile-stage-option.selected>span{box-shadow:inset 0 0 0 3px #ecf8ff,0 0 0 2px #2879db;filter:saturate(1.08)}
.mobile-stage-option.selected>span::after{content:'✓';position:absolute;right:20px;font-size:15px}
body.mobile-stage-sheet-open{overflow:hidden}
body.theme-dark .mobile-stage-sheet{background:#111815;color:#e7eeea}
body.theme-dark .mobile-stage-sheet>header{border-color:#2e3b35}
body.theme-dark .mobile-stage-sheet>header button{background:#293630;color:#d6e0da}

@media(max-width:720px){
  .drawer-stage-scroll{display:none}
  .drawer-stage-mobile{display:flex;width:100%;min-width:0;gap:8px}
  .drawer-stage-mobile button{position:relative;min-width:0;height:52px;overflow:hidden;border:0;color:#fff;text-align:left;cursor:pointer}
  .drawer-stage-mobile small,.drawer-stage-mobile span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .drawer-stage-mobile small{font:600 7px Manrope;text-transform:uppercase;letter-spacing:.06em;opacity:.8}
  .drawer-stage-mobile span{margin-top:3px;font:700 12px Manrope}
  .mobile-current-stage{flex:1.45;background:var(--stage);padding:8px 38px 8px 14px;clip-path:polygon(0 0,94% 0,100% 50%,94% 100%,0 100%)}
  .mobile-current-stage::after{content:'⌄';position:absolute;right:20px;top:17px;font-size:15px}
  .mobile-neighbor-stage{flex:1;background:color-mix(in srgb,var(--stage) 72%,#eef1ed);padding:8px 28px 8px 14px;clip-path:polygon(0 0,92% 0,100% 50%,92% 100%,0 100%);opacity:.78}
}

/* Открытая сделка полностью владеет экраном; канбан под ней не двигается и не кликается. */
body.drawer-open{overflow:hidden;overscroll-behavior:none}
.drawer-backdrop{overscroll-behavior:contain}
.deal-drawer{overscroll-behavior:contain;touch-action:pan-y}
.drawer-head{justify-content:flex-start;text-align:left}
.drawer-head>div{width:100%;text-align:left}
.drawer-external-close{position:fixed;right:626px;top:14px;z-index:12;display:grid;place-items:center;width:42px;height:42px;border:1px solid rgba(255,255,255,.5);border-radius:50%;background:rgba(21,31,27,.82);color:#fff;font-size:25px;line-height:1;cursor:pointer;box-shadow:0 8px 24px rgba(0,0,0,.2)}
.drawer-external-close:hover{background:#17251f}
body.theme-dark .drawer-external-close{background:#e4eee8;color:#18221d;border-color:#fff}

@media(max-width:720px){
  .kanban-scroll-arrow{display:none!important}
  .drawer-backdrop{padding-top:54px;background:rgba(12,19,16,.74)}
  .deal-drawer{top:54px;height:calc(100dvh - 54px);bottom:auto}
  .drawer-external-close{top:7px;right:10px;width:40px;height:40px}
  .drawer-head{padding-left:16px;padding-right:16px;text-align:left}
}

/* Keep the desktop navigation control attached to the visible board edge. */
.app-shell.sidebar-collapsed .kanban-scroll-arrow.left{left:80px!important}

/* Bitrix-подобная настройка полей: карточка не сменяется отдельным окном. */
.deal-config-mode{padding:0!important;overflow:hidden}
.bitrix-inline-edit{padding:21px}
.bitrix-inline-edit .deal-section-title{padding-bottom:13px;border-bottom:1px solid #e7eaec}
.bitrix-inline-edit .deal-section-title>div{display:flex;gap:8px}
.bitrix-inline-edit .deal-section-title button{height:34px;padding:0 13px;border-radius:8px}
.bitrix-inline-edit .deal-section-title .secondary-button{border:1px solid var(--line);background:#fff;color:#77817c}
.bitrix-inline-edit .deal-section-title .primary-button{background:var(--green);color:#fff}
.edit-pencil{margin-left:5px;color:#a6afaa;font-weight:400}
.inline-system-field{display:grid;gap:6px;margin:12px 0;color:#8e9792;font-size:10px}
.inline-system-field input,.inline-system-field select,.bitrix-stage-field.edit select,.bitrix-amount.edit input,.responsible-control.edit select{width:100%;height:42px;border:1px solid #cfd6d2;border-radius:8px;background:#fff;color:var(--ink);padding:0 11px;font:500 11px Manrope}
.bitrix-stage-field.edit{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px}
.bitrix-stage-field.edit label{min-width:0}.bitrix-stage-field.edit small{margin-bottom:6px}.field-gear{padding:10px 0;color:#aab2ae;font-size:15px}
.bitrix-amount.edit{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px}.bitrix-amount.edit label{min-width:0}.bitrix-amount.edit small{margin-bottom:6px}.bitrix-amount.edit span{padding-bottom:12px}
.responsible-control.edit{margin-bottom:13px!important}.responsible-control.edit label{min-width:0;flex:1}
.deal-layout-editor{display:grid;margin-top:10px}
.deal-layout-row{position:relative;display:grid;grid-template-columns:24px minmax(0,1fr) 32px;align-items:start;gap:7px;padding:10px 0;border-bottom:1px solid #edf0f1;transition:background .15s,opacity .15s}
.deal-layout-row.dragging{opacity:.42;background:#edf6f0}.deal-layout-row.field-hidden{background:repeating-linear-gradient(-45deg,transparent,transparent 7px,rgba(146,157,151,.055) 7px,rgba(146,157,151,.055) 14px)}
.deal-field-drag,.deal-field-gear{border:0;background:transparent;color:#9ea8a2;cursor:pointer}
.deal-field-drag{margin-top:24px;padding:3px 0;font-size:18px;opacity:0;cursor:grab}.deal-layout-row:hover .deal-field-drag,.deal-layout-row:focus-within .deal-field-drag{opacity:1}.deal-field-drag:active{cursor:grabbing}
.deal-field-gear{margin-top:23px;width:32px;height:32px;border-radius:7px;font-size:16px}.deal-field-gear:hover{background:#eef3ef;color:#547666}
.deal-field-control{display:grid;gap:6px;min-width:0;color:#909a94;font-size:10px}.deal-field-control>span{display:flex;align-items:center;gap:3px}.deal-field-control>input,.deal-field-control>select,.deal-field-control>textarea{width:100%;box-sizing:border-box;border:1px solid #cfd6d2;border-radius:8px;background:#fff;color:var(--ink);padding:0 11px;font:500 11px Manrope}.deal-field-control>input,.deal-field-control>select{height:42px}.deal-field-control>textarea{min-height:74px;padding-top:10px;resize:vertical}.deal-field-control .is-invalid{border-color:#e17166;background:#fffafa}
.field-help{display:inline-grid;place-items:center;width:15px;height:15px;border-radius:50%;background:#c6ceca;color:#fff;font:700 9px Manrope;font-style:normal;cursor:help}
.deal-field-settings{grid-column:2/4;margin-top:8px;padding:14px;border:1px solid #dfe5e1;border-radius:10px;background:#f6f8f7;box-shadow:0 8px 20px rgba(34,50,42,.06)}.deal-field-settings[hidden]{display:none}.deal-field-settings>label{display:grid;gap:6px;margin-bottom:10px;color:#77827c;font-size:9px}.deal-field-settings input[type="text"],.deal-field-settings textarea,.deal-field-settings select{width:100%;box-sizing:border-box;border:1px solid #cfd7d2;border-radius:8px;background:#fff;color:var(--ink);padding:9px;font:500 10px Manrope}.deal-field-settings select[multiple]{min-height:116px}.deal-field-settings .field-setting-check{display:flex;align-items:center;gap:8px}.field-setting-check input{width:16px;height:16px;accent-color:#2b7dea}.field-setting-stages.disabled{opacity:.45;pointer-events:none}.field-hint-text[hidden],.field-options-text[hidden]{display:none}.field-hide-button,.field-archive-button{border:0;background:transparent;text-decoration:underline;padding:5px 0;text-align:left;font:700 9px Manrope;cursor:pointer}.field-hide-button{color:#866b43}.field-archive-button{display:block;margin-top:5px;color:#b35d55}
.deal-field-mobile-order{display:none}.deal-fields-footer{display:flex;justify-content:space-between;gap:10px;padding-top:14px;color:#718078;font-size:10px}.deal-fields-footer small{color:#9ca6a0;font-size:8px}.deal-field-tools{display:flex;gap:8px;margin-top:10px}.deal-field-tools button,.archived-fields-panel button{border:1px solid #cfd8d3;border-radius:8px;background:#fff;color:#315f4c;padding:8px 11px;font:700 9px Manrope;cursor:pointer}.custom-field-creator,.archived-fields-panel{margin-top:10px;padding:13px;border:1px solid #dce4df;border-radius:10px;background:#f7faf8}.custom-field-creator[hidden],.archived-fields-panel[hidden]{display:none}.custom-field-creator>label{display:grid;gap:6px;margin-bottom:10px;color:#718078;font-size:9px}.custom-field-creator input,.custom-field-creator select,.custom-field-creator textarea{width:100%;box-sizing:border-box;border:1px solid #cfd7d2;border-radius:8px;background:#fff;color:var(--ink);padding:9px;font:500 10px Manrope}.custom-field-creator>div{display:flex;justify-content:flex-end;gap:8px}.archived-fields-panel h4{margin:0 0 9px}.archived-fields-panel>div{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;border-top:1px solid #e4e9e6}.archived-fields-panel>div span{display:grid;gap:2px}.archived-fields-panel small{color:var(--muted);font-size:8px}.archived-fields-panel p{margin:0;color:var(--muted);font-size:9px}.rule-required{color:#e14f3f!important}.required-preview::after{content:'*';color:#e14f3f;margin-left:2px}.bitrix-field-stack small .rule-required{display:inline;margin-left:3px}.bitrix-field-stack .editable-deal-field[title] small::after{content:' ?';color:#99a49e}
body.theme-dark .bitrix-inline-edit .deal-section-title{border-color:#36453e}.theme-dark .inline-system-field input,.theme-dark .inline-system-field select,.theme-dark .bitrix-stage-field.edit select,.theme-dark .bitrix-amount.edit input,.theme-dark .responsible-control.edit select,.theme-dark .deal-field-control>input,.theme-dark .deal-field-control>select,.theme-dark .deal-field-control>textarea,.theme-dark .deal-field-settings input[type="text"],.theme-dark .deal-field-settings textarea,.theme-dark .deal-field-settings select,.theme-dark .custom-field-creator input,.theme-dark .custom-field-creator select,.theme-dark .custom-field-creator textarea{background:#1f2a25;border-color:#3b4b44;color:#e1e9e4}.theme-dark .deal-field-settings,.theme-dark .custom-field-creator,.theme-dark .archived-fields-panel{background:#1b2521;border-color:#34443c}.theme-dark .deal-field-tools button,.theme-dark .archived-fields-panel button{background:#24322c;border-color:#3b4b44;color:#b9d7ca}

@media(max-width:720px){
 .bitrix-inline-edit{padding:16px}.bitrix-inline-edit .deal-section-title{align-items:flex-start}.bitrix-inline-edit .deal-section-title>div{width:auto;flex-wrap:wrap;justify-content:flex-end}.bitrix-inline-edit .deal-section-title button{padding:0 9px}
 .deal-layout-row{grid-template-columns:24px minmax(0,1fr) 34px}.deal-field-drag{opacity:1}.deal-field-mobile-order{grid-column:2/4;display:flex;gap:6px;justify-content:flex-end}.deal-field-mobile-order button{width:36px;height:30px;border:1px solid var(--line);border-radius:7px;background:#fff;color:#627068}.deal-field-settings{grid-column:1/4}.deal-fields-footer{display:block}.deal-fields-footer small{display:block;margin-top:4px}
}

/* Меню аккаунта и единая карточка сотрудника — одна сущность для ответственных. */
.sidebar-bottom{position:relative}
.profile{position:relative;outline:0}
.account-popover[hidden],.user-profile-backdrop[hidden]{display:none}
.account-popover{position:fixed;left:16px;bottom:76px;z-index:80;width:min(328px,calc(100vw - 32px));overflow:hidden;border:1px solid rgba(60,86,73,.18);border-radius:16px;background:rgba(255,255,255,.98);box-shadow:0 18px 55px rgba(19,44,32,.24);backdrop-filter:blur(18px)}
.account-popover-person{display:grid;grid-template-columns:46px minmax(0,1fr) 18px;align-items:center;gap:11px;width:100%;border:0;border-bottom:1px solid var(--line);background:linear-gradient(135deg,rgba(23,91,69,.08),rgba(217,242,106,.1));padding:15px;text-align:left;color:var(--ink);cursor:pointer}
.account-popover-avatar{display:grid;width:46px;height:46px;place-items:center;border-radius:50%;background:var(--green);color:#fff;font:700 14px Onest}
.account-popover-person>span:nth-child(2){display:grid;min-width:0;gap:4px}.account-popover-person strong,.account-popover-person small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account-popover-person strong{font:700 13px Onest}.account-popover-person small{color:var(--muted);font-size:9px}.account-popover-person>b{color:#819087;font:400 26px Onest}
.account-popover-actions{display:grid;padding:8px}.account-popover-actions button,.account-popover-logout{width:100%;border:0;border-radius:9px;background:transparent;padding:11px 12px;color:var(--ink);font:600 10px Manrope;text-align:left;cursor:pointer}.account-popover-actions button{display:grid;grid-template-columns:22px minmax(0,1fr);align-items:center;gap:9px}.account-popover-actions button>span:last-child{display:grid;gap:3px}.account-popover-actions button strong,.account-popover-actions button small{display:block}.account-popover-actions button small{color:var(--muted);font-size:8px;font-weight:500}.account-popover-actions button:disabled{cursor:default;opacity:.58}.account-popover-actions button:not(:disabled):hover{background:#edf4ef}.account-popover-logout{border-top:1px solid var(--line);border-radius:0;color:#a5413b;padding:13px 20px}.account-popover-logout:hover{background:#fff2f1}
.user-profile-backdrop{position:fixed;inset:0;z-index:85;overflow:auto;overscroll-behavior:contain;background:rgba(9,20,15,.72);backdrop-filter:blur(4px)}
.user-profile-drawer{position:absolute;top:20px;right:20px;bottom:20px;width:min(1040px,calc(100% - 96px));overflow:auto;overscroll-behavior:contain;border:1px solid rgba(217,242,106,.18);border-radius:24px;background:radial-gradient(circle at 86% 3%,rgba(217,242,106,.13),transparent 32%),linear-gradient(150deg,#163f31,#175b45 55%,#0e241c);box-shadow:0 26px 80px rgba(4,17,12,.42);color:#fff}
.user-profile-external-close{position:fixed;top:24px;right:calc(min(1040px,calc(100vw - 96px)) + 34px);z-index:87;display:grid;width:44px;height:44px;place-items:center;border:1px solid rgba(217,242,106,.42);border-radius:50%;background:#183d30;color:#fff;font:300 27px Onest;cursor:pointer;box-shadow:0 10px 28px rgba(0,0,0,.22)}
.user-profile-titlebar{position:sticky;top:0;z-index:2;display:flex;align-items:center;min-height:82px;padding:0 28px;border-bottom:1px solid rgba(217,242,106,.16);background:rgba(14,50,37,.78);backdrop-filter:blur(15px)}.user-profile-titlebar>div{display:grid;gap:5px}.user-profile-titlebar span{color:#b8cec4;font:600 10px Manrope;letter-spacing:.08em;text-transform:uppercase}.user-profile-titlebar h2{margin:0;font:700 25px Onest;color:#fff}
.user-profile-layout{display:grid;grid-template-columns:290px minmax(0,1fr);align-items:start;gap:20px;padding:22px 28px 30px}
.user-profile-identity-card{position:sticky;top:104px;display:grid;justify-items:center;gap:10px;border:1px solid rgba(217,242,106,.18);border-radius:17px;background:#f8faf6;padding:28px 20px;color:#26352f;box-shadow:0 16px 40px rgba(3,20,13,.22)}
.user-profile-identity-card .account-profile-avatar{width:152px;height:152px;font-size:38px;box-shadow:0 0 0 7px #eef2ef}.user-profile-identity-card h3{margin:4px 0 0;text-align:center;font:700 20px Onest}.user-profile-identity-card p{display:flex;flex-wrap:wrap;justify-content:center;gap:7px;margin:0;color:#88928d;font-size:9px}.user-profile-identity-card p span{font-weight:700}.user-profile-identity-card p i{border-radius:10px;background:#e5f3e8;color:#28724a;padding:3px 8px;font-style:normal;font-weight:700}
.user-profile-drawer .account-profile-card{width:100%;border:1px solid rgba(217,242,106,.14);border-radius:17px;background:#f8faf6;color:#39444f;box-shadow:0 16px 40px rgba(3,20,13,.22)}
.user-profile-drawer .account-profile-header{justify-content:space-between;padding:21px 26px;background:#f8faf6}.user-profile-drawer .account-profile-header>div{display:grid;gap:7px;min-width:0}.user-profile-drawer .account-profile-header>div>span{color:#263d34;font:600 19px Onest}.user-profile-drawer .account-profile-header>div>small{display:block;max-width:560px;color:#7a8781;font:500 10px Manrope;line-height:1.45}.user-profile-drawer .account-profile-header h3{font:500 19px Onest}.user-profile-drawer .account-profile-header>button{margin-left:auto}
.user-profile-drawer .account-profile-view{padding:5px 26px 26px}.user-profile-drawer .account-profile-view dl{grid-template-columns:1fr}.user-profile-drawer .account-profile-view dl>div,.user-profile-drawer .account-profile-view dl>div:nth-child(2n){padding:15px 0;border-bottom:1px solid #e8ecea}.user-profile-drawer .account-profile-view dt{margin-bottom:5px;color:#a1a9a5;font-size:9px}.user-profile-drawer .account-profile-view dd{color:#46505b;font:500 13px Onest}
.user-profile-link,.table-owner,.card-owner,.responsible-profile-link,.responsible-open-profile,.employee-profile-main{font:inherit}.user-profile-link{cursor:pointer}.card-owner{display:flex;align-items:center;gap:8px;width:100%;border:0;border-top:1px solid var(--line);background:transparent;padding:10px 0 0;color:var(--ink);text-align:left}.card-owner>span:last-child{display:grid;gap:1px}.card-owner small{color:var(--muted);font-size:7px}.card-owner strong{font-size:9px}.table-owner{display:inline-flex;align-items:center;gap:7px;border:0;background:transparent;color:inherit;padding:0}.table-owner i{display:grid;width:24px;height:24px;place-items:center;border-radius:50%;background:var(--avatar);color:#fff;font-size:7px;font-style:normal}.responsible-profile-link,.responsible-open-profile{border:0;background:transparent;color:var(--green)}.responsible-profile-link{padding:0}.responsible-open-profile{font-size:8px;font-weight:700}.employee-profile-main{display:flex;align-items:center;gap:13px;min-width:0;flex:1;border:0;background:transparent;color:inherit;padding:0;text-align:left}.employee-profile-main .employee-info{display:grid;min-width:0;gap:4px}.employee-profile-main .employee-info small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.theme-dark .account-popover{border-color:#3a4b43;background:rgba(25,35,30,.98)}body.theme-dark .account-popover-person{border-color:#3a4b43;background:linear-gradient(135deg,rgba(87,161,128,.13),rgba(217,242,106,.05))}body.theme-dark .account-popover-actions button:not(:disabled):hover{background:#293931}body.theme-dark .account-popover-logout{border-color:#3a4b43}body.theme-dark .account-popover-logout:hover{background:#462925}

@media(max-width:720px){
 .account-popover{left:12px;right:12px;bottom:76px;width:auto}.user-profile-backdrop{background:rgba(7,15,12,.78)}.user-profile-drawer{top:54px;right:0;bottom:0;width:100%;border-radius:20px 20px 0 0}.user-profile-external-close{top:7px;right:10px;width:40px;height:40px}.user-profile-titlebar{min-height:68px;padding:0 16px}.user-profile-titlebar h2{max-width:calc(100% - 44px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:20px}.user-profile-layout{grid-template-columns:1fr;gap:12px;padding:12px}.user-profile-identity-card{position:static;grid-template-columns:72px minmax(0,1fr);justify-items:start;align-items:center;padding:17px;text-align:left}.user-profile-identity-card .account-profile-avatar{grid-row:1/3;width:72px;height:72px;font-size:20px}.user-profile-identity-card h3{align-self:end;margin:0;text-align:left;font-size:17px}.user-profile-identity-card p{align-self:start;justify-content:flex-start}.user-profile-drawer .account-profile-card{border-radius:14px}.user-profile-drawer .account-profile-header{padding:18px 16px}.user-profile-drawer .account-profile-view{padding:4px 16px 18px}.employee-profile-main .employee-info small{white-space:normal}
}

/* Google Calendar: настоящее модальное окно, единый уровень полей и явный ход синхронизации. */
.google-calendar-backdrop{align-items:center;overflow:hidden;overscroll-behavior:contain}
.google-calendar-dialog{width:min(820px,100%);max-height:calc(100dvh - 48px);overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;scrollbar-gutter:stable;padding:26px}
.google-calendar-dialog:focus{outline:0}
.google-simple-connect{grid-template-columns:minmax(230px,.8fr) minmax(390px,1.2fr);align-items:start}
.google-calendar-ical-form{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:end!important;gap:10px!important;min-width:0;margin:0;padding:0;border:0;background:transparent;box-shadow:none}
.google-calendar-ical-form label{min-width:0;margin:0}.google-calendar-ical-form label>span{display:block;margin:0 0 7px;color:#66736c;font:700 9px Manrope}
.google-calendar-ical-form input{height:46px;margin:0;border:1px solid #cfd9d3;border-radius:10px;background:#fff;padding:0 13px}.google-calendar-ical-form button{height:46px;white-space:nowrap;padding-inline:18px}.google-calendar-ical-form button:disabled{cursor:wait;opacity:.7}
.google-calendar-sync-state{grid-column:1/-1;display:flex;align-items:center;gap:11px;margin-top:2px;border-left:3px solid #64a78a;border-radius:8px;background:rgba(231,244,236,.72);padding:11px 13px;color:#285c47}.google-calendar-sync-state[hidden]{display:none}
.google-calendar-sync-state>i{position:relative;flex:0 0 auto;width:18px;height:18px;border:2px solid rgba(40,92,71,.22);border-top-color:#2e7658;border-radius:50%;animation:googleCalendarSpin .75s linear infinite}.google-calendar-sync-state>span{display:grid;min-width:0;gap:3px}.google-calendar-sync-state strong{font:700 10px Manrope}.google-calendar-sync-state small{color:#66776f;font:500 9px/1.45 Manrope}
.google-calendar-sync-state.success{border-left-color:#7ebc55;background:rgba(236,247,226,.8);color:#35651e}.google-calendar-sync-state.success>i{border:0;background:#68a744;animation:none}.google-calendar-sync-state.success>i::after{content:'✓';position:absolute;inset:0;display:grid;place-items:center;color:#fff;font:700 11px Manrope}
.google-calendar-sync-state.error{border-left-color:#c76459;background:rgba(250,234,231,.88);color:#8b3f37}.google-calendar-sync-state.error>i{border:0;background:#bd584d;animation:none}.google-calendar-sync-state.error>i::after{content:'!';position:absolute;inset:0;display:grid;place-items:center;color:#fff;font:700 11px Manrope}.google-calendar-sync-state.slow{border-left-color:#c39b45;background:rgba(250,243,222,.88);color:#796020}
.google-calendar-message{grid-column:1/-1;margin:2px 0 0}@keyframes googleCalendarSpin{to{transform:rotate(360deg)}}
body.theme-dark .google-calendar-ical-form label>span{color:#b4c0ba}body.theme-dark .google-calendar-ical-form input{border-color:#42564c;background:#1b2922;color:#edf5f0}body.theme-dark .google-calendar-sync-state{background:rgba(42,80,62,.56);color:#c9eadb}body.theme-dark .google-calendar-sync-state small{color:#a9bbb2}body.theme-dark .google-calendar-sync-state.success{background:rgba(55,86,39,.48);color:#d5edc3}body.theme-dark .google-calendar-sync-state.error{background:rgba(104,48,42,.48);color:#f3c8c2}body.theme-dark .google-calendar-sync-state.slow{background:rgba(93,75,32,.5);color:#f0dda2}
@media(max-width:720px){.google-calendar-backdrop{align-items:stretch;padding:0}.google-calendar-dialog{width:100%;height:100dvh;max-height:100dvh;border-radius:0;padding:20px 16px 28px;scrollbar-gutter:auto}.google-simple-connect{grid-template-columns:1fr;gap:15px}.google-calendar-ical-form{grid-template-columns:1fr}.google-calendar-ical-form button{width:100%}}

/* UX stability pass: fixed kanban geometry, deterministic overlays and clean edit states. */
.kanban-scroll-shell{min-width:0;isolation:isolate;contain:layout style}
.board:not(.list-mode){overflow-anchor:none;overscroll-behavior-inline:contain;scrollbar-gutter:stable;scroll-snap-type:none;contain:layout style}
.board:not(.list-mode) .column,.board:not(.list-mode) .lead-card{contain:layout style}
.board:not(.list-mode) .column-cards{overflow-anchor:none;scrollbar-gutter:stable}
.kanban-scroll-arrow{transition:opacity .16s ease,color .16s ease}
.kanban-scroll-arrow:disabled{opacity:0;pointer-events:none}
.kanban-scroll-shell:not(.has-horizontal-overflow) .kanban-scroll-arrow{opacity:0;pointer-events:none}

body.drawer-open .neuro-bg{pointer-events:none}
.drawer-backdrop,.user-profile-backdrop{touch-action:none}
.deal-drawer,.user-profile-drawer{touch-action:pan-y}
.drawer-backdrop:not([hidden]),.user-profile-backdrop:not([hidden]){pointer-events:auto}
.deal-drawer:focus{outline:none}
.editable-deal-field .rule-required,.deal-field-control .rule-required,.deal-subhead .rule-required{display:inline!important;opacity:1!important;visibility:visible!important;color:#d63f35!important;font-weight:800!important}
.deal-save-bar[hidden]{display:none!important}
.deal-save-bar:not([hidden]){isolation:isolate}
.inline-messenger-field>button{display:none!important}

.account-popover{width:min(300px,calc(100vw - 32px))}
.account-popover-person{border-bottom:0}
.account-popover-logout{border-top:1px solid var(--line)}
.user-profile-drawer{width:min(860px,calc(100% - 96px));background:radial-gradient(circle at 88% 0,rgba(217,242,106,.16),transparent 34%),linear-gradient(145deg,#f7faf7,#edf4ef);color:var(--ink);border-color:rgba(23,91,69,.16);box-shadow:0 26px 80px rgba(4,17,12,.28)}
.user-profile-external-close{right:calc(min(860px,calc(100vw - 96px)) + 34px)}
.user-profile-layout{grid-template-columns:220px minmax(0,1fr);gap:18px;padding:24px}
.user-profile-titlebar{min-height:76px;padding:0 24px;color:var(--ink);border-color:rgba(23,91,69,.12)}
.user-profile-titlebar span{color:var(--muted)}
.user-profile-identity-card,.user-profile-drawer .account-profile-card{border-color:rgba(23,91,69,.12);background:rgba(255,255,255,.82);box-shadow:0 12px 32px rgba(24,62,44,.09)}
.user-profile-identity-card{top:100px;padding:24px 16px}
.user-profile-identity-card .account-profile-avatar{width:116px;height:116px;font-size:30px}
body.theme-dark .user-profile-drawer{background:radial-gradient(circle at 88% 0,rgba(119,164,79,.12),transparent 34%),linear-gradient(145deg,#18241e,#111a16);color:#e6eee9;border-color:#34443c}
body.theme-dark .user-profile-titlebar{color:#e6eee9;border-color:#34443c}
body.theme-dark .user-profile-titlebar span{color:#9aaba2}
body.theme-dark .user-profile-identity-card,body.theme-dark .user-profile-drawer .account-profile-card{border-color:#34443c;background:#202d27;color:#e2ebe6;box-shadow:0 14px 36px rgba(0,0,0,.22)}
body.theme-dark .user-profile-drawer .account-profile-header{background:#202d27}
body.theme-dark .user-profile-drawer .account-profile-header>div>span,body.theme-dark .user-profile-drawer .account-profile-view dd{color:#e2ebe6}
body.theme-dark .user-profile-drawer .account-profile-view dl>div{border-color:#34443c}

@media(max-width:720px){
 .sidebar{will-change:transform;transition:transform .2s ease,box-shadow .2s ease}
 .sidebar[aria-hidden="true"]{visibility:hidden;pointer-events:none}
 body.mobile-nav-open .sidebar{visibility:visible}
 .board:not(.list-mode){scrollbar-gutter:auto}
 .user-profile-drawer{top:54px;right:0;bottom:0;width:100%;border-radius:20px 20px 0 0}
 .user-profile-external-close{top:7px;right:10px}
 .user-profile-layout{grid-template-columns:1fr;gap:12px;padding:12px}
 .user-profile-identity-card{padding:15px}
 .user-profile-identity-card .account-profile-avatar{width:64px;height:64px;font-size:18px}
}
@media(prefers-reduced-motion:reduce){.sidebar,.kanban-scroll-arrow{transition:none!important}}

/* Личная карточка держателя аккаунта: просмотр и inline-редактирование. */
.account-profile-heading small{display:block;margin-top:7px;color:var(--muted);font-size:10px}.account-profile-card{width:min(820px,100%);overflow:hidden;border:1px solid var(--line);border-radius:18px;background:var(--panel);box-shadow:0 16px 42px rgba(27,55,42,.08)}.account-profile-header{display:flex;align-items:center;gap:16px;padding:24px 26px;border-bottom:1px solid var(--line);background:linear-gradient(135deg,rgba(23,91,69,.075),rgba(217,242,106,.09))}.account-profile-avatar{display:grid;flex:0 0 auto;width:60px;height:60px;place-items:center;border-radius:50%;background:var(--green);color:#fff;font:700 18px Onest;box-shadow:0 0 0 5px rgba(255,255,255,.72)}.account-profile-header>div:nth-child(2){min-width:0}.account-profile-header h3{margin:0;font:600 21px Onest}.account-profile-header p{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin:6px 0 0;color:var(--muted);font-size:10px}.account-profile-header p span{font-weight:700}.account-profile-header p i{border-radius:10px;background:#e4f2e8;color:#277048;padding:3px 7px;font-style:normal;font-weight:700}.account-profile-header>button{margin-left:auto}.account-profile-view{padding:10px 26px 26px}.account-profile-view[hidden],.account-profile-form[hidden]{display:none}.account-profile-view dl{display:grid;grid-template-columns:1fr 1fr;margin:0}.account-profile-view dl>div{min-width:0;padding:18px 10px 15px 0;border-bottom:1px solid var(--line)}.account-profile-view dl>div:nth-child(2n){padding-left:18px}.account-profile-view dt{margin-bottom:7px;color:var(--muted);font-size:9px}.account-profile-view dd{overflow-wrap:anywhere;margin:0;font:600 13px Onest}.account-profile-identity dt span{font-size:8px}.account-profile-form{display:grid;gap:15px;padding:24px 26px 26px}.account-profile-form label{display:block;color:#53605a;font-size:9px;font-weight:700}.account-profile-form label em{color:#ef493f;font-style:normal}.account-profile-form input{display:block;width:100%;height:44px;margin-top:7px;border:1px solid #d8dfda;border-radius:9px;background:#fff;padding:0 12px;color:var(--ink);font:500 12px Manrope;outline:0}.account-profile-form input:focus{border-color:#4d9273;box-shadow:0 0 0 3px rgba(46,126,91,.1)}.account-profile-readonly{position:relative}.account-profile-readonly>span{float:right;color:#929b96;font-size:8px;font-weight:600}.account-profile-readonly input{cursor:not-allowed;background:#f0f2ef;color:#7a837f}.account-profile-note{margin:0;border-radius:9px;background:#eef3ef;padding:11px 12px;color:#617168;font-size:9px;line-height:1.55}.account-profile-form footer{display:flex;justify-content:flex-end;gap:9px;padding-top:3px}body.theme-dark .account-profile-card{border-color:#3b4b43;background:linear-gradient(145deg,rgba(47,63,55,.82),rgba(25,36,30,.76))}body.theme-dark .account-profile-header{border-color:#3b4b43;background:linear-gradient(135deg,rgba(115,203,161,.1),rgba(217,242,106,.05))}body.theme-dark .account-profile-avatar{box-shadow:0 0 0 5px rgba(18,29,24,.58)}body.theme-dark .account-profile-view dl>div{border-color:#3b4b43}body.theme-dark .account-profile-form input{border-color:#46584f;background:#1e2b25;color:#eef5f1}body.theme-dark .account-profile-readonly input{background:#27352e;color:#a8b4ae}body.theme-dark .account-profile-note{background:#26382f;color:#adbbb4}@media(max-width:720px){.account-profile-card{border-radius:14px}.account-profile-header{align-items:flex-start;padding:18px 16px}.account-profile-avatar{width:50px;height:50px;font-size:15px}.account-profile-header h3{font-size:18px}.account-profile-header>button{padding:8px 10px}.account-profile-view{padding:4px 16px 18px}.account-profile-view dl{grid-template-columns:1fr}.account-profile-view dl>div,.account-profile-view dl>div:nth-child(2n){padding:15px 0}.account-profile-form{padding:18px 16px}.account-profile-form .form-row{grid-template-columns:1fr}.account-profile-form footer{position:sticky;bottom:-18px;display:grid;grid-template-columns:1fr 1fr;margin:0 -2px;background:var(--panel);padding:12px 2px 0}.account-profile-form footer button{width:100%}body.theme-dark .account-profile-form footer{background:#1d2a24}}

.deal-drawer [data-edit-field][hidden] {
  display: none !important;
}

/* v91: calm kanban target and a permanent Bitrix-like close rail. */
.kanban-drop-placeholder {
  background: rgba(104, 207, 165, 0.13) !important;
  border-color: rgba(104, 207, 165, 0.58) !important;
  box-shadow: inset 0 0 0 1px rgba(104, 207, 165, 0.1) !important;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

@media (max-width: 1180px) {
  .drawer-backdrop .deal-drawer {
    left: 64px !important;
    right: auto !important;
    transform: none !important;
  }

  .drawer-backdrop .drawer-external-close {
    left: 20px !important;
    right: auto !important;
    width: 44px !important;
  }
}

.deal-drawer .editable-deal-field[hidden],
.deal-drawer .deal-field-control[hidden] {
  display: none !important;
}

.deal-stage-history {
  display: grid;
  gap: 12px;
}

.deal-stage-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(127, 127, 127, 0.22);
  border-radius: 16px;
  background: rgba(127, 127, 127, 0.08);
  color: inherit;
}

.deal-stage-event header,
.deal-stage-path {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.deal-stage-event header {
  justify-content: space-between;
  margin-bottom: 11px;
}

.deal-stage-event time {
  color: inherit;
  opacity: 0.62;
  font-size: 0.82rem;
}

.deal-responsible-event {
  border-color: rgba(105, 210, 164, 0.42);
  background: rgba(105, 210, 164, 0.1);
}

.deal-responsible-path span:last-child {
  font-weight: 750;
}

.deal-history-actor {
  display: block;
  margin-top: 10px;
  color: inherit;
  opacity: 0.72;
}

.deal-stage-path span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.14);
}

.deal-stage-path b {
  color: #69d2a4;
  font-size: 1.1rem;
}

.deal-stage-author {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #79dcb1;
  color: #0e2d22;
  font-weight: 800;
  cursor: help;
}

.deal-other-history {
  border-top: 1px solid rgba(127, 127, 127, 0.2);
  padding-top: 10px;
}

.deal-other-history > summary {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  color: inherit;
  opacity: 0.78;
}

.deal-other-history > summary span {
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  text-align: center;
  background: rgba(127, 127, 127, 0.14);
}

.contact-record-backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 12px;
  background: rgba(7, 15, 12, 0.62);
  backdrop-filter: blur(4px);
}

.contact-record-backdrop[hidden] {
  display: none !important;
}

.contact-record-drawer {
  width: min(1180px, calc(100vw - 24px));
  height: min(900px, calc(100dvh - 24px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(127, 127, 127, 0.24);
  border-radius: 22px;
  background: #f4f6f4;
  color: #24332d;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  animation: contact-record-rise 180ms ease-out both;
}

@keyframes contact-record-rise {
  from { transform: translateY(34px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.contact-record-drawer > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 17px;
  border-bottom: 1px solid rgba(127, 127, 127, 0.2);
  background: rgba(255, 255, 255, 0.82);
}

.contact-record-drawer header small,
.contact-record-drawer header p {
  color: #748079;
}

.contact-record-drawer header h2 {
  margin: 4px 0;
  font: 650 24px Onest;
}

.contact-record-drawer header p {
  margin: 0;
  font-size: 0.82rem;
}

.contact-record-drawer > header > button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(127, 127, 127, 0.12);
  color: inherit;
  font-size: 24px;
  cursor: pointer;
}

.contact-record-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

.contact-record-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 18px;
}

.contact-record-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(127, 127, 127, 0.18);
  border-radius: 18px;
  background: #fff;
}

.contact-record-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 17px;
  border-bottom: 1px solid rgba(127, 127, 127, 0.17);
}

.contact-record-head small,
.contact-record-comment small {
  display: block;
  color: #7d8982;
  font-size: 0.75rem;
}

.contact-record-head strong {
  display: block;
  margin-top: 4px;
}

.contact-record-head button,
.contact-record-links a {
  border: 0;
  border-radius: 10px;
  background: #e7f5ed;
  color: #176344;
  padding: 9px 12px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.contact-record-panel dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
  margin: 12px 0;
}

.contact-record-panel dl > div {
  padding: 11px 0;
  border-bottom: 1px solid rgba(127, 127, 127, 0.14);
}

.contact-record-panel dt {
  color: #7d8982;
  font-size: 0.75rem;
}

.contact-record-panel dd {
  margin: 5px 0 0;
  font-weight: 650;
}

.contact-record-panel h3 {
  margin: 20px 0 10px;
  font: 650 15px Onest;
}

.contact-record-panel h3 span {
  color: #278857;
}

.contact-record-comment {
  padding: 12px;
  border-radius: 12px;
  background: rgba(127, 127, 127, 0.08);
}

.contact-record-comment p {
  margin: 6px 0 0;
}

.contact-record-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.contact-record-deals,
.contact-record-notifications {
  display: grid;
  gap: 8px;
}

.contact-record-deals button,
.contact-record-notifications article {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 11px;
  align-items: center;
  width: 100%;
  border: 1px solid rgba(127, 127, 127, 0.17);
  border-radius: 12px;
  background: rgba(127, 127, 127, 0.05);
  color: inherit;
  padding: 12px;
  text-align: left;
}

.contact-record-deals button { cursor: pointer; }
.contact-record-deals i { width: 7px; height: 36px; border-radius: 6px; background: var(--stage); }
.contact-record-deals strong,
.contact-record-deals small { display: block; }
.contact-record-deals small,
.contact-record-notifications small { margin-top: 4px; color: #7d8982; }
.contact-record-notifications article > span { font-size: 20px; }
.contact-record-notifications p { margin: 5px 0; }
.contact-record-empty { color: #7d8982; }

.theme-dark .contact-record-drawer {
  background: #101b17;
  color: #edf7f2;
}

.theme-dark .contact-record-drawer > header,
.theme-dark .contact-record-panel {
  background: #182620;
}

.theme-dark .contact-record-head button,
.theme-dark .contact-record-links a {
  background: #294c3c;
  color: #9ae7c1;
}

body.contact-record-open {
  overflow: hidden !important;
}

@media (max-width: 720px) {
  .contact-record-backdrop { padding: 0; }
  .contact-record-drawer { width: 100vw; height: 100dvh; border-radius: 0; }
  .contact-record-body { padding: 12px; }
  .contact-record-grid { grid-template-columns: 1fr; }
  .contact-record-panel { padding: 15px; }
  .contact-record-panel dl { grid-template-columns: 1fr; }
}
.editable-deal-field .rule-required,
.deal-drawer .rule-required {
  display: inline !important;
  min-width: 0 !important;
  width: auto !important;
  height: auto !important;
  margin-left: 3px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #f07167 !important;
  font: inherit !important;
  line-height: 1 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body.theme-dark #avitoReconcileDetails {
  color: #e8f3ed;
}

body.theme-dark #avitoReconcileDetails > * {
  border-color: rgba(164, 202, 183, .2) !important;
  background: #182820 !important;
  color: #e8f3ed !important;
  box-shadow: none !important;
}

body.theme-dark #avitoReconcileDetails > * > * {
  color: inherit;
}
.deal-money-control {
  display: grid !important;
  grid-template-columns: minmax(120px, 1fr) minmax(170px, .85fr);
  gap: 8px;
}

.deal-money-control > small {
  grid-column: 1 / -1;
}

.deal-money-control > input,
.deal-money-control > select {
  width: 100%;
  min-width: 0;
}

@media(max-width:720px) {
  .deal-money-control { grid-template-columns: 1fr; }
  .deal-money-control > small { grid-column: auto; }
}

/* v48: employee profile uses the same record-drawer language as deal and contact. */
#userProfileBackdrop[hidden]{display:none!important}
#userProfileBackdrop{
  display:flex;
  align-items:stretch;
  justify-content:flex-end;
  padding:12px 22px 12px 78px;
  background:rgba(9,20,15,.72);
  backdrop-filter:blur(10px);
  overscroll-behavior:contain
}
.user-profile-drawer{
  --profile-shell:#f4f8f5;
  --profile-panel:#fff;
  --profile-line:rgba(40,89,66,.18);
  --profile-title:#173d2c;
  --profile-text:#183126;
  --profile-muted:#657b70;
  position:relative;
  inset:auto;
  display:flex;
  flex-direction:column;
  width:min(1180px,calc(100vw - 100px));
  max-width:none;
  height:calc(100dvh - 24px);
  max-height:none;
  margin:0;
  overflow:hidden;
  color:var(--profile-text);
  border:1px solid var(--profile-line);
  border-radius:22px;
  background:
    radial-gradient(circle at 92% 0,rgba(87,181,132,.12),transparent 34%),
    linear-gradient(145deg,var(--profile-shell),#eaf2ed);
  box-shadow:0 24px 72px rgba(3,15,9,.34)
}
.theme-dark .user-profile-drawer{
  --profile-shell:#18241e;
  --profile-panel:#202d27;
  --profile-line:rgba(132,190,158,.2);
  --profile-title:#e6eee9;
  --profile-text:#e2ebe6;
  --profile-muted:#adbbb4;
  background:
    radial-gradient(circle at 92% 0,rgba(95,181,132,.12),transparent 34%),
    linear-gradient(145deg,#18241e,#111a16)
}
.user-profile-titlebar{
  flex:0 0 auto;
  min-height:96px;
  padding:20px 94px 18px 28px;
  color:var(--profile-title);
  border-bottom:1px solid var(--profile-line);
  background:rgba(230,242,235,.86);
  backdrop-filter:blur(16px)
}
.theme-dark .user-profile-titlebar{background:rgba(14,50,37,.78)}
.user-profile-titlebar h2{margin:2px 0 0;font-size:clamp(25px,2vw,34px);line-height:1.08}
.user-profile-titlebar p{margin:0;color:var(--profile-muted);font-size:12px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}
.user-profile-external-close{
  position:absolute;
  z-index:3;
  top:26px;
  right:40px;
  left:auto;
  width:46px;
  height:46px;
  margin:0;
  color:var(--profile-title);
  border:1px solid var(--profile-line);
  border-radius:14px;
  background:var(--profile-panel);
  box-shadow:none
}
.user-profile-external-close:hover{transform:none;background:rgba(92,180,132,.13)}
.user-profile-layout{
  display:block;
  flex:1 1 auto;
  min-height:0;
  overflow-x:hidden;
  overflow-y:auto;
  padding:22px 28px 38px;
  scrollbar-gutter:stable
}
.user-profile-identity-card{
  display:grid;
  grid-template-columns:80px minmax(0,1fr);
  grid-template-rows:auto auto;
  align-items:center;
  gap:2px 16px;
  min-height:0;
  padding:18px 20px;
  color:var(--profile-text);
  border:1px solid var(--profile-line);
  border-radius:18px;
  background:var(--profile-panel);
  box-shadow:none;
  text-align:left
}
.user-profile-identity-card::after{display:none}
.user-profile-identity-card .account-profile-avatar{
  grid-row:1/3;
  width:72px;
  height:72px;
  margin:0;
  font-size:30px;
  border:1px solid var(--profile-line);
  background:#3f9c73
}
.user-profile-identity-card h3{align-self:end;margin:0;font-size:25px;line-height:1.15}
.user-profile-identity-card p{align-self:start;margin:3px 0 0;color:var(--profile-muted)}
.user-profile-identity-card #accountProfileStatus{display:inline-flex;margin-left:8px}
.account-profile-card{
  min-height:0;
  margin-top:16px;
  overflow:hidden;
  color:var(--profile-text);
  border:1px solid var(--profile-line);
  border-radius:18px;
  background:var(--profile-panel);
  box-shadow:none
}
.account-profile-header{
  min-height:70px;
  padding:16px 18px;
  color:var(--profile-text);
  border-bottom:1px solid var(--profile-line);
  background:transparent
}
.account-profile-header h3{margin:0;font-size:18px}
.account-profile-view{padding:0 18px 18px}
.account-profile-view dl{
  display:grid;
  grid-template-columns:minmax(150px,.7fr) minmax(0,1.3fr);
  margin:0
}
.account-profile-view dt,
.account-profile-view dd{
  min-width:0;
  margin:0;
  padding:15px 12px;
  border-top:1px solid var(--profile-line)
}
.account-profile-view dt{color:var(--profile-muted);font-size:13px}
.account-profile-view dd{color:var(--profile-text);font-weight:700;overflow-wrap:anywhere}
.account-profile-form{padding:18px}
.account-profile-form input{
  color:var(--profile-text);
  border-color:var(--profile-line);
  background:color-mix(in srgb,var(--profile-panel) 90%,#000 10%)
}
.account-profile-note{
  margin:0;
  padding:14px 16px;
  color:var(--profile-muted);
  border:1px solid var(--profile-line);
  border-radius:14px;
  background:transparent
}
.user-profile-drawer .secondary-button{
  color:var(--profile-text);
  border-color:var(--profile-line);
  background:transparent
}
@media(max-width:720px){
  #userProfileBackdrop{padding:0}
  .user-profile-drawer{
    width:100vw;
    height:100dvh;
    border:0;
    border-radius:0
  }
  .user-profile-titlebar{min-height:80px;padding:16px 72px 14px 18px}
  .user-profile-external-close{top:16px;right:14px;width:44px;height:44px}
  .user-profile-layout{padding:14px 14px 28px}
  .user-profile-identity-card{grid-template-columns:62px minmax(0,1fr);padding:14px}
  .user-profile-identity-card .account-profile-avatar{width:56px;height:56px;font-size:24px}
  .user-profile-identity-card h3{font-size:21px}
  .account-profile-view dl{grid-template-columns:1fr}
  .account-profile-view dt{padding-bottom:3px}
  .account-profile-view dd{padding-top:3px}
}

/* v49: Bitrix-style role tree and owner-only access navigation. */
.nav-item[hidden],#contactCenterNav[hidden]{display:none!important}
.permissions-list.access-tree{display:grid;gap:12px;padding:2px;background:transparent}
.permission-tree-group{
  overflow:hidden;
  border:1px solid rgba(85,145,112,.2);
  border-radius:16px;
  background:rgba(255,255,255,.66)
}
.theme-dark .permission-tree-group{background:rgba(31,46,39,.86);border-color:rgba(132,190,158,.18)}
.permission-tree-heading{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid rgba(85,145,112,.16)
}
.permission-tree-heading>span{
  width:12px;
  height:12px;
  border:3px solid #48a776;
  border-radius:3px;
  background:rgba(72,167,118,.12)
}
.permission-tree-heading div{display:grid;gap:2px}
.permission-tree-heading b{font-size:15px;color:var(--text,#20352b)}
.permission-tree-heading small{font-size:12px;color:var(--muted,#718178)}
.theme-dark .permission-tree-heading b{color:#e4eee8}
.theme-dark .permission-tree-heading small{color:#a9b9b0}
.permission-tree-items{position:relative;display:grid;padding:6px 12px 10px 36px}
.permission-tree-items::before{
  content:'';
  position:absolute;
  top:0;
  bottom:16px;
  left:21px;
  width:1px;
  background:rgba(72,167,118,.32)
}
.permissions-list.access-tree .permission-tree-items label{
  position:relative;
  min-height:48px;
  margin:0;
  padding:10px 8px 10px 14px;
  border:0;
  border-radius:10px;
  background:transparent
}
.permissions-list.access-tree .permission-tree-items label::before{
  content:'';
  position:absolute;
  top:24px;
  left:-15px;
  width:14px;
  height:1px;
  background:rgba(72,167,118,.32)
}
.permissions-list.access-tree .permission-tree-items label:hover{background:rgba(72,167,118,.08)}
.permissions-list.access-tree .permission-tree-items label b{font-size:14px}
.permissions-list.access-tree .permission-tree-items label small{color:var(--muted,#718178)}
@media(max-width:720px){
 .permission-tree-items{padding-left:30px}
 .permission-tree-items::before{left:17px}
 .permissions-list.access-tree .permission-tree-items label{align-items:flex-start}
}

/* v51: one explicit, visible entry into deal edit mode */
#editDealBtn {
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid rgba(79, 157, 120, 0.52);
  border-radius: 10px;
  background: rgba(79, 157, 120, 0.14);
  color: inherit;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

#editDealBtn:hover {
  border-color: rgba(99, 191, 148, 0.78);
  background: rgba(79, 157, 120, 0.24);
}

#editDealBtn:focus-visible {
  outline: 3px solid rgba(99, 191, 148, 0.34);
  outline-offset: 3px;
}

#editDealBtn:active {
  transform: translateY(1px);
}

@media (max-width: 700px) {
  #editDealBtn {
    min-height: 44px;
    padding-inline: 16px;
  }
}

/* v52: visible release identity for owner-only drift detection */
.ui-release-badge {
  display: grid;
  gap: 3px;
  margin: 0 8px 12px;
  padding: 10px 12px;
  border: 1px solid rgba(79, 157, 120, 0.32);
  border-radius: 11px;
  background: rgba(79, 157, 120, 0.1);
  color: inherit;
}

.ui-release-badge[hidden] {
  display: none !important;
}

.ui-release-badge strong {
  font-size: 11px;
  line-height: 1.25;
}

.ui-release-badge small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

body.theme-dark .ui-release-badge {
  border-color: rgba(118, 193, 156, 0.34);
  background: rgba(65, 130, 98, 0.16);
}

@media (max-width: 700px) {
  .ui-release-badge {
    margin-inline: 0;
  }
}

/* ORBITO_UI_FINISH_V54 */
.deal-drawer [data-edit-field][hidden],
.deal-drawer button[hidden] {
  display: none !important;
}

.deal-drawer [data-orbito-view-locked="true"] {
  pointer-events: none !important;
  cursor: default !important;
  opacity: 1 !important;
}

.deal-drawer .orbito-field-settings-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent);
}

.deal-drawer .orbito-field-settings-save {
  min-height: 42px;
}

.deal-drawer .orbito-required-mark,
.deal-drawer sup,
.deal-drawer abbr,
.deal-drawer .required-mark,
.deal-drawer .field-required {
  display: inline !important;
  width: auto !important;
  height: auto !important;
  margin-left: 3px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #ff675f !important;
  text-decoration: none !important;
  opacity: 1 !important;
}

.orbito-kanban-card {
  contain: layout paint;
  overflow-anchor: none;
  transform: translateZ(0);
}

.theme-dark .orbito-bright-stage,
.theme-dark .orbito-bright-stage * {
  color: #10231c !important;
  text-shadow: none !important;
}

.theme-dark .orbito-dark-surface-fix {
  background: rgba(23, 43, 35, 0.96) !important;
  color: #eef7f2 !important;
  border-color: rgba(139, 221, 187, 0.24) !important;
}

.theme-dark .orbito-dark-surface-fix :is(strong, small, span, p) {
  color: inherit !important;
}

.orbito-unified-profile {
  background: linear-gradient(145deg, #10251d, #17362b) !important;
  border-color: rgba(119, 218, 177, 0.3) !important;
}

.orbito-unified-profile [class*="avatar"] {
  background: #1f8b68 !important;
  color: #f4fff9 !important;
  border-color: rgba(196, 255, 228, 0.42) !important;
}

.orbito-contact-backdrop {
  position: fixed;
  inset: 0;
  z-index: 118;
  border: 0;
  background: rgba(3, 13, 10, 0.72);
  backdrop-filter: blur(8px);
}

.orbito-contact-drawer {
  position: fixed !important;
  inset: 0 0 0 auto !important;
  z-index: 119 !important;
  display: block !important;
  width: min(1180px, 84vw) !important;
  max-width: none !important;
  height: 100dvh !important;
  max-height: none !important;
  overflow: auto !important;
  padding: clamp(24px, 4vw, 58px) !important;
  border: 0 !important;
  border-left: 1px solid rgba(120, 218, 178, 0.28) !important;
  border-radius: 28px 0 0 28px !important;
  background: linear-gradient(155deg, #10251d, #172e26 68%, #10251d) !important;
  color: #edf8f2 !important;
  box-shadow: -26px 0 70px rgba(0, 0, 0, 0.42) !important;
}

.orbito-contact-close {
  position: sticky;
  top: 0;
  z-index: 2;
  float: right;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: -8px -8px 18px 18px;
  border: 1px solid rgba(212, 255, 237, 0.24);
  border-radius: 50%;
  background: rgba(13, 31, 24, 0.88);
  color: #f6fff9;
  font-size: 30px;
  cursor: pointer;
}

body.orbito-contact-open,
body.orbito-messenger-open {
  overflow: hidden !important;
}

.orbito-messenger-workspace {
  position: fixed;
  inset: 0 0 0 clamp(214px, 17vw, 304px);
  z-index: 92;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  background:
    radial-gradient(circle at 85% 8%, rgba(95, 215, 166, 0.12), transparent 28%),
    linear-gradient(145deg, #0a1712, #10251d 58%, #0b1c16);
  color: #edf8f2;
}

.orbito-messenger-workspace[hidden] {
  display: none !important;
}

.orbito-messenger-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px clamp(22px, 4vw, 54px) 12px;
}

.orbito-messenger-header span {
  color: #79d9b1;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.orbito-messenger-header h1 {
  margin: 4px 0 0;
  font-size: clamp(30px, 4vw, 54px);
}

.orbito-messenger-close {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(190, 244, 220, 0.22);
  border-radius: 50%;
  background: rgba(20, 48, 38, 0.82);
  color: #fff;
  font-size: 28px;
}

.orbito-channel-tabs {
  display: flex;
  gap: 10px;
  padding: 0 clamp(22px, 4vw, 54px) 18px;
}

.orbito-channel-tabs button {
  min-width: 112px;
  padding: 11px 18px;
  border: 1px solid rgba(184, 238, 216, 0.2);
  border-radius: 999px;
  background: rgba(23, 52, 42, 0.72);
  color: #a8bdb5;
}

.orbito-channel-tabs button.active {
  background: #42b98b;
  color: #092117;
  font-weight: 800;
}

.orbito-messenger-layout {
  display: grid;
  grid-template-columns: minmax(260px, 34%) minmax(0, 1fr);
  min-height: 0;
  margin: 0 clamp(14px, 2vw, 32px) clamp(14px, 2vw, 32px);
  overflow: hidden;
  border: 1px solid rgba(182, 236, 214, 0.18);
  border-radius: 24px;
  background: rgba(10, 27, 20, 0.72);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.orbito-chat-list {
  min-width: 0;
  overflow: auto;
  border-right: 1px solid rgba(182, 236, 214, 0.16);
  background: rgba(17, 39, 31, 0.82);
}

.orbito-chat-list > label {
  position: sticky;
  top: 0;
  z-index: 2;
  display: block;
  padding: 18px;
  background: #11271f;
}

.orbito-chat-list > label span {
  display: block;
  margin-bottom: 7px;
  color: #93aaa0;
  font-size: 12px;
}

.orbito-chat-list input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid rgba(177, 230, 209, 0.2);
  border-radius: 14px;
  background: #0c1d17;
  color: #fff;
}

.orbito-chat-list-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid rgba(183, 231, 212, 0.1);
  background: transparent;
  color: #eaf6f0;
  text-align: left;
}

.orbito-chat-list-item:hover,
.orbito-chat-list-item.active {
  background: rgba(78, 186, 142, 0.16);
}

.orbito-chat-list-item strong,
.orbito-chat-list-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orbito-chat-list-item small {
  margin-top: 5px;
  color: #92aaa0;
}

.orbito-chat-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2d7c60;
  color: #fff;
  font-weight: 800;
}

.orbito-chat-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
}

.orbito-chat-pane > header,
.orbito-chat-pane > footer {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(183, 231, 212, 0.12);
  background: rgba(15, 35, 28, 0.9);
}

.orbito-chat-pane > header strong,
.orbito-chat-pane > header small {
  display: block;
}

.orbito-chat-pane > header small {
  margin-top: 5px;
  color: #91aaa0;
}

.orbito-chat-body {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: auto;
  padding: 28px;
  background:
    radial-gradient(circle at 20% 20%, rgba(99, 206, 161, 0.09), transparent 28%),
    rgba(7, 21, 16, 0.72);
}

.orbito-chat-empty-state {
  max-width: 500px;
  padding: 30px;
  text-align: center;
}

.orbito-chat-empty-state strong,
.orbito-chat-empty-state small {
  display: block;
}

.orbito-chat-empty-state p,
.orbito-chat-empty-state small {
  color: #9db4aa;
  line-height: 1.6;
}

.orbito-chat-empty-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 20px;
  background: rgba(74, 187, 142, 0.18);
  color: #74d7ae;
  font-size: 30px;
}

.orbito-chat-pane > footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border-top: 1px solid rgba(183, 231, 212, 0.12);
  border-bottom: 0;
}

.orbito-chat-pane textarea {
  min-height: 54px;
  resize: none;
  border: 1px solid rgba(177, 230, 209, 0.18);
  border-radius: 14px;
  background: #0b1c16;
  color: #93a89f;
}

.orbito-chat-pane footer button {
  border: 0;
  border-radius: 14px;
  padding: 0 22px;
  background: #3aa879;
  color: #092016;
  font-weight: 800;
}

.orbito-chat-list-empty {
  padding: 22px;
  color: #9db2a9;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .orbito-contact-drawer {
    inset: 0 !important;
    width: 100vw !important;
    border-radius: 0 !important;
    padding: 24px 18px !important;
  }

  .orbito-messenger-workspace {
    inset: 0;
    z-index: 140;
  }

  .orbito-messenger-header {
    padding: 18px;
  }

  .orbito-channel-tabs {
    padding: 0 18px 14px;
    overflow-x: auto;
  }

  .orbito-messenger-layout {
    grid-template-columns: minmax(118px, 38%) minmax(0, 1fr);
    margin: 0;
    border-radius: 0;
  }

  .orbito-chat-list > label {
    padding: 10px;
  }

  .orbito-chat-list-item {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 12px 9px;
  }

  .orbito-chat-avatar {
    width: 36px;
    height: 36px;
  }

  .orbito-chat-pane > header,
  .orbito-chat-pane > footer {
    padding: 12px;
  }

  .orbito-chat-body {
    padding: 12px;
  }
}
/* v54 owner defects: interactive stages, clean dark drawer, readable field settings. */
.ui-release-badge{display:none!important}
.kanban-scroll-shell{contain:none!important}
.deal-drawer .drawer-stage-step,.deal-drawer .mobile-current-stage,.deal-drawer .mobile-neighbor-stage{pointer-events:auto!important}
.deal-field-settings select[multiple]{display:block!important;min-height:210px!important;overflow-x:hidden!important;overflow-y:auto!important;padding:6px!important;white-space:normal!important}
.deal-field-settings select[multiple] option{display:block!important;width:100%!important;min-height:34px!important;margin:0 0 4px!important;padding:8px 10px!important;border-radius:8px!important;white-space:normal!important}
body.theme-dark .drawer-tab-single,body.theme-dark .drawer-tab-heading,body.theme-dark .drawer-tab-single .empty,body.theme-dark .drawer-tab-single .empty-robots{border-color:#34473e!important;background:#18261f!important;color:#eaf5ef!important}
body.theme-dark .drawer-tab-heading small,body.theme-dark .drawer-tab-single .empty,body.theme-dark .drawer-tab-single .empty-robots,body.theme-dark .deal-stage-event time,body.theme-dark .deal-other-history>summary{color:#adbbb4!important;opacity:1!important}
body.theme-dark .drawer-tab-heading button{border-color:#466258!important;background:#22352c!important;color:#8fe3bd!important}
body.theme-dark .drawer-robots .robot-card,body.theme-dark .drawer-robots .robot-card:hover{border:1px solid #466057!important;background:#22322b!important;color:#edf7f2!important;opacity:1!important;box-shadow:0 12px 28px rgba(0,0,0,.24)!important}
body.theme-dark .drawer-robots .robot-card :is(strong,b,small,em,.robot-when){color:#dcebe4!important;opacity:1!important}
body.theme-dark .drawer-robots .robot-title span{color:#60d4a4!important}
body.theme-dark .deal-stage-event{border-color:#3e554a!important;background:#22322b!important;color:#edf7f2!important}
body.theme-dark .deal-stage-path span{background:#30463b!important;color:#e3f2eb!important}
body.theme-dark .bitrix-task-editor,body.theme-dark .bitrix-task-editor footer,body.theme-dark .bitrix-task-title,body.theme-dark .bitrix-task-body textarea,body.theme-dark .bitrix-task-date,body.theme-dark .bitrix-task-actions,body.theme-dark .bitrix-task-actions-menu,body.theme-dark .bitrix-task-actions-menu button{border-color:#42574d!important;background:#1b2922!important;color:#e8f3ed!important}
body.theme-dark .bitrix-task-title::placeholder,body.theme-dark .bitrix-task-body textarea::placeholder{color:#9dafa5!important}
.orbito-chat-thread{display:grid;gap:10px;padding:6px 2px}
.orbito-chat-message{width:fit-content;max-width:min(78%,760px);padding:11px 13px;border-radius:15px;background:#20352b;color:#edf8f2}
.orbito-chat-message.outgoing{justify-self:end;background:#245d48}.orbito-chat-message.incoming{justify-self:start}
.orbito-chat-message p{margin:0;white-space:pre-wrap;line-height:1.5}.orbito-chat-message small{display:block;margin-top:6px;color:#a9bcb3;text-align:right}
.orbito-chat-unread{align-self:center;min-width:24px;padding:4px 7px;border-radius:999px;background:#5fd4a4;color:#0a251a;text-align:center}
@media(max-width:720px){.deal-field-settings select[multiple]{min-height:250px!important}.orbito-chat-message{max-width:88%}}
/* v57: one bottom save bar, visible only for a real deal edit. */
.deal-drawer .deal-edit-savebar{
  position:sticky;bottom:0;z-index:14;display:flex;align-items:center;justify-content:space-between;gap:14px;
  margin:20px -21px -21px;padding:13px 21px;background:var(--surface);border-top:1px solid var(--line);
  box-shadow:0 -12px 28px rgba(12,28,20,.12)
}
.deal-drawer .deal-edit-savebar[hidden]{display:none!important}
.deal-drawer .deal-edit-savebar>span{color:var(--muted);font:650 12px Manrope}
.deal-drawer .deal-edit-savebar .primary-button{min-width:190px;min-height:42px}
body.theme-dark .deal-drawer .deal-edit-savebar{background:#243129;border-top-color:#405048;box-shadow:0 -14px 30px rgba(0,0,0,.28)}
body.theme-dark .deal-drawer .deal-edit-savebar>span{color:#c8d3cd}
@media(max-width:720px){.deal-drawer .deal-edit-savebar{margin:16px -12px -12px;padding:11px 12px;flex-direction:column;align-items:stretch}.deal-drawer .deal-edit-savebar .primary-button{width:100%;min-width:0}}

/* v58: values are edited in place; "Изменить" only reveals hidden fields and settings. */
.deal-drawer [data-orbito-view-locked="true"]{pointer-events:auto!important;cursor:pointer!important}
.deal-drawer #editDealBtn{width:auto;min-width:0;height:28px!important;border:1px solid var(--line);border-radius:999px;background:var(--surface);padding:0 10px!important;color:var(--muted);font:650 9px Manrope;letter-spacing:0;text-transform:none}
.deal-drawer #editDealBtn:hover{border-color:#76a18d;color:var(--green);background:color-mix(in srgb,var(--green) 7%,var(--surface))}
.deal-drawer .bitrix-amount>[data-edit-field]{width:auto;min-width:0;height:26px;border:0;border-radius:999px;background:color-mix(in srgb,var(--green) 9%,var(--surface));padding:0 9px;color:var(--green);font:700 8px Manrope;cursor:pointer}
.deal-drawer .bitrix-deal-panel :is(small,button,label,select,input,textarea){font-family:Manrope,sans-serif}
.deal-drawer .bitrix-deal-panel small{font-size:10px;line-height:1.35}
.deal-drawer .bitrix-deal-panel strong{font-weight:650}
.deal-view-layout{display:grid}
.deal-view-layout-row{position:relative;display:grid!important;grid-template-columns:26px minmax(0,1fr) 32px;align-items:center;gap:7px;min-height:70px;border-bottom:1px solid var(--line);transition:transform .18s ease,box-shadow .18s ease,background .18s ease,opacity .18s ease}
.deal-view-layout-row.no-layout-tools{grid-template-columns:minmax(0,1fr)}
.deal-view-layout-row.dragging{z-index:8;opacity:.92;transform:rotate(-1.25deg) scale(1.012);border-radius:10px;background:var(--surface);box-shadow:0 16px 34px rgba(16,39,29,.2)}
.deal-view-layout-row.drop-target{background:color-mix(in srgb,var(--green) 8%,transparent);box-shadow:inset 0 2px 0 var(--green)}
.deal-view-field-drag,.deal-view-field-gear{display:grid;place-items:center;border:0;background:transparent;color:#9aa69f;opacity:0;cursor:pointer;transition:opacity .14s ease,color .14s ease,background .14s ease}
.deal-view-field-drag{height:38px;padding:0;font-size:20px;cursor:grab}.deal-view-field-drag:active{cursor:grabbing}
.deal-view-field-gear{width:32px;height:32px;border-radius:8px;font-size:16px}
.deal-view-layout-row:hover :is(.deal-view-field-drag,.deal-view-field-gear),.deal-view-layout-row:focus-within :is(.deal-view-field-drag,.deal-view-field-gear){opacity:1}
.deal-view-field-gear:hover{background:color-mix(in srgb,var(--green) 10%,transparent);color:var(--green)}
.deal-view-field-main{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-width:0;min-height:69px;border:0;background:transparent;padding:10px 0;color:var(--ink);text-align:left;cursor:text}
.deal-view-field-main>span{display:grid;min-width:0;gap:5px}.deal-view-field-main small{color:var(--muted)}.deal-view-field-main strong{overflow-wrap:anywhere;font-size:13px}.deal-view-field-main>em{opacity:0;color:var(--green);font:700 8px Manrope;font-style:normal;transition:opacity .14s ease}.deal-view-field-main:hover>em,.deal-view-field-main:focus-visible>em{opacity:1}
.deal-view-field-menu{position:absolute;z-index:30;right:0;top:54px;display:grid;width:190px;overflow:hidden;border:1px solid var(--line);border-radius:14px;background:var(--surface);padding:8px;box-shadow:0 16px 38px rgba(15,38,28,.22)}
.deal-view-field-menu[hidden]{display:none!important}.deal-view-field-menu>button,.deal-view-field-menu>label{display:flex;align-items:center;gap:8px;min-height:38px;border:0;border-radius:8px;background:transparent;padding:0 10px;color:var(--ink);font:600 10px Manrope;text-align:left;cursor:pointer}.deal-view-field-menu>button:hover,.deal-view-field-menu>label:hover{background:color-mix(in srgb,var(--green) 9%,transparent)}.deal-view-field-menu input{width:16px;height:16px;accent-color:var(--green)}
.deal-drawer .rule-required{display:inline!important;width:auto!important;height:auto!important;margin-left:3px!important;border:0!important;background:transparent!important;box-shadow:none!important;color:#ff6259!important;font-style:normal!important;font-weight:850!important;opacity:1!important;visibility:visible!important}
body.theme-dark .deal-view-layout-row{border-color:#35463e}body.theme-dark .deal-view-layout-row.dragging,body.theme-dark .deal-view-field-menu{border-color:#465a50;background:#223129;color:#edf6f1}body.theme-dark .deal-view-field-main{color:#edf6f1}body.theme-dark .deal-view-field-main small{color:#aebcb5}body.theme-dark .deal-drawer #editDealBtn,body.theme-dark .deal-drawer .bitrix-amount>[data-edit-field]{border-color:#42564d;background:#26372f;color:#8fe3bd}

/* v61: one active inline editor, full-width controls and field gear without text hints. */
.deal-view-field-main>em,.product-edit>em{display:none!important}
.deal-view-layout-row>.editable-deal-field.editing{grid-column:2;width:100%;min-width:0;margin:0!important}
.deal-view-layout-row>.editable-deal-field.editing{grid-template-columns:minmax(0,1fr)!important;align-items:stretch}
.deal-view-layout-row>.editable-deal-field.editing .inline-field-input{display:block!important;grid-column:1/-1;width:100%!important;min-width:100%!important;max-width:none!important;box-sizing:border-box}
.deal-view-layout-row:has(.bitrix-date-picker){z-index:5;background:color-mix(in srgb,var(--green) 7%,transparent)}
.deal-view-layout-row .bitrix-date-picker{grid-column:2;width:min(430px,100%);max-width:100%;margin-top:8px}
@media(max-width:720px){.deal-view-layout-row>.editable-deal-field.editing .inline-field-input{min-width:100%}.deal-view-layout-row .bitrix-date-picker{width:100%}}

/* v63: one compact Bitrix-like date picker and stage requirement selector. */
.deal-view-layout-row .bitrix-date-picker,.quick-date-field .bitrix-date-picker,.required-shared-date .bitrix-date-picker,.bitrix-date-picker[data-deal-filter-calendar]{width:286px!important;max-width:min(286px,calc(100vw - 36px))!important;border:1px solid color-mix(in srgb,var(--line) 82%,#b7c2bb)!important;border-radius:14px!important;background:var(--panel,#fff)!important;opacity:1!important;padding:12px!important;box-shadow:0 18px 42px rgba(12,31,22,.24)!important}
.bitrix-date-picker header{margin-bottom:8px}.bitrix-date-picker header strong{padding:6px 10px;border-radius:8px;color:var(--ink)!important;font:650 13px Onest;text-transform:none;transition:background .15s,box-shadow .15s}.bitrix-date-picker header strong:hover{background:color-mix(in srgb,var(--green) 8%,transparent);box-shadow:0 5px 13px rgba(18,45,32,.09)}
.bitrix-date-picker header button{display:grid;width:30px;height:30px;place-items:center;border-radius:8px!important;color:var(--muted)!important;font-size:22px!important;transition:background .15s,color .15s,transform .15s}.bitrix-date-picker header button:hover{background:color-mix(in srgb,var(--green) 11%,transparent)!important;color:var(--green)!important;transform:translateY(-1px)}
.picker-weekdays{font-size:9px!important}.picker-days{gap:3px!important}.picker-days i,.picker-days button{height:30px!important;border-radius:7px!important;background:transparent!important;color:var(--ink)!important;font:600 10px Manrope!important}.picker-days button:hover{background:color-mix(in srgb,var(--green) 12%,transparent)!important;color:var(--green)!important;box-shadow:0 4px 10px rgba(18,45,32,.08)}.picker-days button.selected{background:var(--green)!important;color:#fff!important}.picker-days button:disabled{opacity:.28!important;text-decoration:none!important}
.picker-time{margin-top:9px!important;padding-top:9px!important}.picker-time label{display:flex;align-items:center;justify-content:flex-start;gap:10px}.picker-time label span{color:var(--muted);font:600 10px Manrope}.picker-time input{width:76px!important;height:34px!important;border:1px solid var(--line)!important;border-radius:8px!important;background:color-mix(in srgb,var(--surface) 94%,var(--green) 6%)!important;padding:0 10px!important;color:var(--ink)!important;font:700 11px Manrope!important;text-align:center}
.inline-field-messenger{position:relative}.inline-field-messenger .inline-field-input{appearance:none;padding-right:38px!important}.inline-field-messenger::after{content:'';position:absolute;right:15px;bottom:16px;width:7px;height:7px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(45deg);pointer-events:none}
.bitrix-date-picker footer{margin-top:10px!important}.bitrix-date-picker footer button{border-radius:8px!important;padding:8px 12px!important;font-size:9px!important}.bitrix-date-picker footer [data-picker-save]{background:var(--green)!important}
body.theme-dark .bitrix-date-picker{border-color:#40544a!important;background:#1f2b25!important;color:#edf6f1!important;opacity:1!important}body.theme-dark .picker-time input{border-color:#40544a!important;background:#26362e!important;color:#edf6f1!important}
.field-required-line{display:grid;grid-template-columns:minmax(0,1fr) minmax(190px,auto);align-items:start;gap:14px;margin-bottom:12px}.field-required-line>.field-setting-check{margin:9px 0 0!important}.field-setting-stages{position:relative;min-width:0}.field-setting-stages.disabled{opacity:.55;pointer-events:none}.field-stage-selector-toggle{display:flex;width:100%;min-height:38px;align-items:center;justify-content:space-between;gap:10px;border:1px solid var(--line);border-radius:19px;background:color-mix(in srgb,var(--surface) 88%,var(--muted) 12%);padding:0 13px;color:var(--ink);font:600 9px Manrope;cursor:pointer}.field-stage-selector-toggle:disabled{cursor:default}.field-stage-selector-list{position:absolute;z-index:45;right:0;top:44px;display:grid;width:min(360px,calc(100vw - 48px));max-height:330px;overflow:auto;border:1px solid var(--line);border-radius:16px;background:var(--surface);padding:10px;box-shadow:0 18px 38px rgba(14,35,25,.24)}.field-stage-selector-list[hidden]{display:none!important}.field-stage-selector-list label{display:flex;align-items:center;gap:9px;min-height:34px;margin:0 0 5px;border-radius:17px;background:var(--stage);padding:0 12px;color:#fff;font:650 9px Manrope;cursor:pointer}.field-stage-selector-list input{width:16px!important;height:16px!important;accent-color:#2b7dea}.field-setting-stages>select[hidden]{display:none!important}
body.theme-dark .field-stage-selector-toggle,body.theme-dark .field-stage-selector-list{border-color:#40544a;background:#223129;color:#edf6f1}
@media(max-width:720px){.field-required-line{grid-template-columns:1fr}.field-required-line>.field-setting-check{margin-top:0!important}.field-stage-selector-list{position:fixed;left:12px;right:12px;top:auto;bottom:18px;width:auto;max-height:56vh}.deal-view-layout-row .bitrix-date-picker,.quick-date-field .bitrix-date-picker{width:min(286px,calc(100vw - 48px))!important}}

/* One stage shape and one motion language for Kanban and automation. */
.automation-grid .stage-cap{position:relative;width:100%;min-height:29px;margin:0 0 4px;overflow:hidden;border:0!important;border-radius:7px 0 0 7px!important;background:var(--stage)!important;padding:6px 15px 6px 9px!important;clip-path:polygon(0 0,calc(100% - 7px) 0,100% 50%,calc(100% - 7px) 100%,0 100%);box-shadow:none!important;transition:filter .16s ease,transform .16s ease!important}
.automation-grid .stage-cap::before,.automation-grid .stage-cap::after{display:none!important;content:none!important}
.automation-grid .stage-cap:hover{filter:brightness(1.07);transform:translateY(-1px)}
.automation-grid .robot-column{overflow:hidden!important;border:0!important}
.automation-grid .robot-card::before,.drawer-robots .robot-card::before{display:none!important;content:none!important}
body.theme-dark .automation-grid .robot-card,body.theme-dark .drawer-robots .robot-card{background:#22322b!important;border-color:#40564b!important;color:#edf7f2!important}

@media(max-width:720px){.deal-view-layout-row{grid-template-columns:24px minmax(0,1fr) 34px}.deal-view-field-drag,.deal-view-field-gear{opacity:1}.deal-view-field-main>em{display:none}.deal-view-field-menu{position:fixed;left:12px;right:12px;top:auto;bottom:18px;width:auto}}

/* v60-owner-messenger-clean-wall */
.deal-work-wall{margin-top:18px;min-width:0}
.deal-work-wall .deal-section-title{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-bottom:14px}
.deal-work-wall .deal-section-title h3{margin:0;font-size:13px;letter-spacing:.06em}
.deal-work-wall .deal-section-title small,.deal-wall-empty{color:var(--muted)}
.deal-work-wall .deal-feed{margin:0}
.deal-wall-empty{padding:28px 18px;text-align:center;border:1px dashed color-mix(in srgb,var(--muted) 35%,transparent);border-radius:14px}
body[data-theme="dark"] .deal-work-wall,body.dark .deal-work-wall{color:var(--text)}
@media(max-width:720px){.deal-work-wall .deal-section-title{align-items:flex-start;flex-direction:column;gap:4px}}
.required-fields-open{overflow:hidden}
.required-fields-backdrop{position:fixed;inset:0;z-index:2500;display:grid;place-items:center;padding:24px;background:rgba(4,12,9,.7);backdrop-filter:blur(6px)}
.required-fields-modal{width:min(620px,100%);max-height:min(760px,calc(100vh - 48px));overflow:auto;border:1px solid var(--line);border-radius:24px;background:var(--panel);color:var(--text);box-shadow:0 28px 80px rgba(0,0,0,.38)}
.required-fields-modal header,.required-fields-modal footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:22px 24px;border-bottom:1px solid var(--line)}
.required-fields-modal footer{justify-content:flex-end;border-top:1px solid var(--line);border-bottom:0}
.required-fields-modal header h3{margin:3px 0 0}.required-fields-modal header small,.required-fields-modal>p{color:var(--muted)}
.required-fields-modal header [data-required-close]{width:42px;height:42px;border:0;border-radius:50%;background:var(--soft);color:var(--text);font-size:28px;line-height:1}
.required-fields-modal>p{margin:20px 24px 8px}.required-fields-list{display:grid;gap:16px;padding:12px 24px 24px}
.required-fields-list label{display:grid;gap:8px}.required-fields-list label>span{font-size:14px;color:var(--muted)}.required-fields-list em{color:#f05b4f;font-style:normal;font-weight:800}
.required-fields-list input,.required-fields-list select,.required-fields-list textarea{width:100%;min-height:48px;border:1px solid var(--line);border-radius:12px;background:var(--input);color:var(--text);padding:11px 13px}
.deal-view-layout-row.settings-open{z-index:8}.deal-view-layout-row.settings-open>.deal-field-settings{grid-column:1/-1;width:100%;margin-top:10px}.deal-view-layout-row.settings-open>.deal-view-field-menu{display:none!important}
.deal-config-mode .rule-required,.deal-edit-form .rule-required,.bitrix-inline-edit .rule-required{display:inline!important;visibility:visible!important;opacity:1!important;color:#f05b4f!important;background:transparent!important;box-shadow:none!important;font-style:normal;font-weight:800;margin-left:3px}
.field-stage-selector-list .field-stage-selector-all{position:sticky;top:0;z-index:2;background:var(--panel)!important;color:var(--ink)!important;border:1px solid var(--line);box-shadow:0 5px 14px rgba(0,0,0,.12)}
.field-stage-selector-list .field-stage-selector-divider{padding:10px 8px 5px;color:var(--muted);font-size:10px;font-weight:800;text-align:center;letter-spacing:.04em}
@media(max-width:640px){.required-fields-backdrop{padding:10px;align-items:end}.required-fields-modal{max-height:88vh;border-radius:20px 20px 12px 12px}.required-fields-modal header,.required-fields-modal footer{padding:16px}.required-fields-list{padding:10px 16px 20px}}

/* v74: stable deal geometry and shared inline controls */
.bitrix-amount-value {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.bitrix-amount-value strong {
  transition: color .16s ease;
}

.bitrix-amount-value:hover strong,
.bitrix-amount-value:focus-visible strong {
  color: var(--accent, #6ed1a7);
}

.bitrix-amount-value:focus-visible {
  outline: 2px solid var(--accent, #6ed1a7);
  outline-offset: 6px;
  border-radius: 4px;
}

.bitrix-amount .inline-field-value {
  flex: 1 1 220px;
  max-width: 280px;
}

.bitrix-date-picker footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

@media (min-width: 561px) {
  .drawer-backdrop {
    overflow: auto !important;
    padding-top: 0 !important;
  }

  .deal-drawer {
    left: max(52px, calc(100vw - max(960px, 78vw))) !important;
    right: auto !important;
    top: 0 !important;
    bottom: 0 !important;
    width: max(960px, 78vw) !important;
    min-width: 960px !important;
    max-width: none !important;
    height: 100dvh !important;
  }

  .drawer-external-close {
    position: fixed !important;
    left: calc(max(52px, calc(100vw - max(960px, 78vw))) - 44px) !important;
    right: auto !important;
    top: 28px !important;
    width: 44px !important;
    height: 52px !important;
    border-radius: 12px 0 0 12px !important;
    font-size: 22px !important;
  }

  .bitrix-card-grid {
    grid-template-columns: minmax(360px, .88fr) minmax(480px, 1.25fr) !important;
    min-width: 862px;
  }

  .drawer-stage-scroll {
    display: block !important;
  }

  .drawer-stage-mobile {
    display: none !important;
  }
}

@media (max-width: 560px) {
  .drawer-backdrop {
    padding-top: 0 !important;
  }

  .deal-drawer {
    top: 0 !important;
    height: 100dvh !important;
  }

  .drawer-external-close {
    top: 12px !important;
    right: 0 !important;
    width: 42px !important;
    height: 46px !important;
    border-radius: 12px 0 0 12px !important;
    font-size: 20px !important;
  }

  .drawer-head {
    padding-right: 58px;
  }
}
/* v93-attached-close-rail */
.compact-stage-required-dialog {
  width: min(540px, calc(100vw - 32px)) !important;
  max-width: 540px !important;
  max-height: min(78dvh, 680px) !important;
  margin: auto !important;
  border-radius: 18px !important;
  overflow: auto !important;
}

.compact-stage-required-dialog > header,
.compact-stage-required-dialog .modal-header,
.compact-stage-required-dialog .dialog-header {
  padding: 16px 20px 14px !important;
}

.compact-stage-required-dialog form,
.compact-stage-required-dialog .modal-body,
.compact-stage-required-dialog .dialog-body {
  padding: 16px 20px !important;
}

.compact-stage-required-dialog h1,
.compact-stage-required-dialog h2,
.compact-stage-required-dialog h3 {
  margin: 0 !important;
  font-size: 18px !important;
  line-height: 1.25 !important;
}

.compact-stage-required-dialog p,
.compact-stage-required-dialog label,
.compact-stage-required-dialog .field-label {
  font-size: 13px !important;
  line-height: 1.35 !important;
}

.compact-stage-required-dialog input,
.compact-stage-required-dialog select,
.compact-stage-required-dialog textarea,
.compact-stage-required-dialog button {
  min-height: 40px !important;
  font-size: 14px !important;
}

.compact-stage-required-dialog input,
.compact-stage-required-dialog select,
.compact-stage-required-dialog textarea {
  padding: 8px 12px !important;
  border-radius: 10px !important;
}

.compact-stage-required-dialog footer,
.compact-stage-required-dialog .modal-footer,
.compact-stage-required-dialog .dialog-footer,
.compact-stage-required-dialog .form-actions {
  gap: 10px !important;
  padding: 14px 20px 16px !important;
}

.compact-stage-required-dialog footer button,
.compact-stage-required-dialog .modal-footer button,
.compact-stage-required-dialog .dialog-footer button,
.compact-stage-required-dialog .form-actions button {
  min-width: 112px !important;
  padding: 9px 15px !important;
}

.kanban-drop-placeholder {
  box-sizing: border-box;
  display: block;
  width: calc(100% - 10px);
  min-height: 96px;
  height: var(--kanban-drop-height, 168px);
  margin: 5px 5px 10px;
  border: 1px dashed color-mix(in srgb, var(--accent, #68cfa5) 55%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent, #68cfa5) 7%, var(--surface, #fff));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, #68cfa5) 8%, transparent);
  pointer-events: none;
  animation: kanban-drop-slot-in 140ms ease-out both;
}

.kanban-drop-placeholder::after {
  content: '';
  display: block;
}

.column-cards.kanban-drop-active > .column-empty,
.column-cards.kanban-drop-active > .empty-column,
.column-cards.kanban-drop-active > .empty-state,
.column-cards.kanban-drop-active > [data-empty-state] {
  display: none !important;
}

.lead-card.is-dragging-card,
.orbito-kanban-card.is-dragging-card {
  opacity: .48 !important;
  transform: rotate(2deg) scale(.985) !important;
  transform-origin: 50% 50%;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .28) !important;
}

.kanban-scroll-arrow.kanban-drag-scroll-active {
  opacity: 1 !important;
  transform: translateY(-50%) scale(1.08) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, #68cfa5) 20%, transparent),
    0 10px 28px rgba(0, 0, 0, .28) !important;
}

@keyframes kanban-drop-slot-in {
  from { opacity: 0; transform: scaleY(.92); }
  to { opacity: 1; transform: scaleY(1); }
}

@media (max-width: 640px) {
  .compact-stage-required-dialog {
    width: calc(100vw - 20px) !important;
    max-height: 82dvh !important;
    border-radius: 16px !important;
  }

  .compact-stage-required-dialog form,
  .compact-stage-required-dialog .modal-body,
  .compact-stage-required-dialog .dialog-body {
    padding: 14px 16px !important;
  }
}

.compact-stage-required-dialog input[type="date"],
.compact-stage-required-dialog input[type="datetime-local"],
.compact-stage-required-dialog input[type="time"],
.compact-stage-required-dialog input[type="date"]::-webkit-calendar-picker-indicator,
.compact-stage-required-dialog input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.compact-stage-required-dialog input[type="time"]::-webkit-calendar-picker-indicator {
  pointer-events: auto !important;
  cursor: pointer !important;
  opacity: 1 !important;
}

.required-shared-date{position:relative;isolation:isolate;z-index:1;width:100%}.required-date-trigger{display:flex!important;width:100%;min-height:42px!important;align-items:center;justify-content:space-between;border:1px solid var(--line);border-radius:10px;background:var(--input,var(--panel,#fff));padding:9px 40px 9px 12px;color:var(--text,var(--ink));font:600 12px Manrope!important;text-align:left;cursor:pointer}.required-date-trigger::after{content:'▣';position:absolute;right:13px;color:var(--muted)}.required-date-trigger:hover,.required-date-trigger:focus-visible{border-color:var(--green);outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--green) 14%,transparent)}.required-date-native.is-invalid+.required-date-trigger{border-color:#e36b5d}.required-shared-date .bitrix-date-picker{left:0;top:calc(100% + 6px);z-index:2605}.required-fields-modal{width:min(540px,calc(100vw - 32px));border-radius:18px}.required-fields-modal header,.required-fields-modal footer{padding:16px 20px}.required-fields-modal>p{margin:14px 20px 6px}.required-fields-list{gap:12px;padding:10px 20px 18px}.required-fields-list input,.required-fields-list select,.required-fields-list textarea{min-height:42px}.required-fields-modal .bitrix-date-picker input{display:block!important}

/* v93-attached-close-rail: desktop drawer stops shrinking before its
   two-column workspace becomes unusable. Narrow windows scroll instead. */
@media (min-width: 721px) {
  .deal-drawer {
    min-width: 960px !important;
    overflow-x: auto !important;
  }

  .deal-drawer .drawer-body {
    min-width: 900px !important;
  }

  .deal-drawer .bitrix-card-grid {
    display: grid !important;
    grid-template-columns: minmax(360px, .88fr) minmax(480px, 1.25fr) !important;
    min-width: 862px !important;
    align-items: start !important;
  }

  .deal-drawer .bitrix-deal-panel,
  .deal-drawer .deal-work-wall,
  .deal-drawer .deal-section,
  .deal-drawer .bitrix-amount {
    min-width: 0 !important;
  }
}
/* v93-attached-close-rail: the backdrop covers the viewport; only its child
   is the compact form. This prevents the giant black panel and nested scroll. */
.required-fields-backdrop.compact-stage-required-dialog,
.required-fields-backdrop.compact-stage-required-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2600 !important;
  display: grid !important;
  place-items: center !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 20px !important;
  overflow: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: rgba(7, 15, 12, .68) !important;
  box-shadow: none !important;
}

.required-fields-backdrop > .required-fields-modal {
  position: relative !important;
  inset: auto !important;
  width: min(520px, calc(100vw - 40px)) !important;
  min-width: 0 !important;
  max-width: 520px !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: calc(100dvh - 40px) !important;
  margin: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  border-radius: 18px !important;
}

.required-fields-modal .required-shared-date .bitrix-date-picker {
  width: min(340px, 100%) !important;
  max-width: 100% !important;
  max-height: min(430px, calc(100dvh - 190px)) !important;
  overflow-y: auto !important;
}

.bitrix-deal-panel > .bitrix-amount {
  position: relative !important;
  inset: auto !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 10px 18px !important;
  min-height: 92px !important;
  margin: 0 !important;
  padding-bottom: 14px !important;
}

.bitrix-deal-panel > .responsible-control {
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  clear: both !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 82px !important;
  margin: 0 0 20px !important;
}

@media (max-width: 720px) {
  .required-fields-backdrop.compact-stage-required-dialog,
  .required-fields-backdrop.compact-stage-required-backdrop {
    padding: 10px !important;
  }

  .required-fields-backdrop > .required-fields-modal {
    width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    border-radius: 15px !important;
  }
}
/* v93-attached-close-rail: desktop never swaps or collapses the two
   deal columns. At the minimum width the drawer scrolls horizontally. */
@media (hover: hover) and (pointer: fine) {
  .deal-drawer {
    min-width: 960px !important;
    overflow-x: auto !important;
  }

  .deal-drawer .drawer-body {
    min-width: 900px !important;
  }

  .deal-drawer .bitrix-card-grid {
    display: grid !important;
    grid-template-columns: minmax(360px, .88fr) minmax(480px, 1.25fr) !important;
    grid-template-areas: "deal wall" !important;
    min-width: 862px !important;
    align-items: start !important;
  }

  .deal-drawer .bitrix-card-left {
    grid-area: deal !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }

  .deal-drawer .bitrix-card-right {
    grid-area: wall !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }
}

#dealTaskDue {
  cursor: pointer !important;
}

#dealTaskDue:focus {
  caret-color: transparent;
}
/* v93-attached-close-rail */
.bitrix-date-picker [data-picker-save]:disabled {
  cursor: not-allowed !important;
  opacity: .42 !important;
  filter: saturate(.35) !important;
  box-shadow: none !important;
}

.bitrix-date-picker .picker-time input:required:invalid {
  border-color: color-mix(in srgb, #e56a5d 70%, var(--line)) !important;
}

/* v84: keep the two-column deal workspace left-anchored on narrow viewports. */
.deal-drawer .deal-composer,
.deal-drawer .deal-composer form,
.deal-drawer .deal-section:has(#dealTaskDue),
.deal-drawer .task-composer-controls,
.deal-drawer .task-composer-controls label,
.deal-drawer .quick-date-field {
  overflow: visible !important;
}
.deal-drawer .deal-composer:has(.bitrix-date-picker),
.deal-drawer .deal-section:has(#dealTaskDue):has(.bitrix-date-picker),
.deal-drawer .quick-date-field:has(.bitrix-date-picker) {
  position: relative;
  z-index: 90 !important;
}
.deal-drawer .bitrix-date-picker {
  z-index: 120 !important;
}

@media (max-width: 1180px) {
  .drawer-backdrop {
    display: block;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior: contain;
  }
  .deal-drawer {
    left: 0 !important;
    right: auto !important;
    width: 1040px !important;
    min-width: 1040px !important;
    max-width: none !important;
  }
  .deal-drawer .drawer-body {
    overflow-x: visible !important;
  }
  .deal-drawer .bitrix-card-grid {
    display: grid !important;
    grid-template-columns: minmax(410px, .82fr) minmax(570px, 1.18fr) !important;
    gap: 18px !important;
    min-width: 992px !important;
  }
  .deal-drawer .bitrix-card-left,
  .deal-drawer .bitrix-card-right {
    min-width: 0 !important;
    margin: 0 !important;
  }
  /* Кнопка закрытия лежит рядом со шторкой, а не внутри неё: селектор
     .deal-drawer #drawerClose не срабатывал никогда, а компенсирующий отступ
     под неё оставался — заголовок сделки был сдвинут вправо на пустое место. */
  .drawer-backdrop #drawerClose {
    position: fixed !important;
    top: 12px !important;
    left: 8px !important;
    right: auto !important;
    z-index: 140 !important;
  }
  .deal-drawer .drawer-head {
    min-height: 72px;
    padding-left: 28px !important;
  }
}

/* v86: amount value keeps its natural shape; spacing belongs to the row. */
.deal-drawer .bitrix-amount {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 16px !important;
  min-height: 96px !important;
  padding: 10px 0 16px !important;
  margin-bottom: 14px !important;
  overflow: visible !important;
}

.deal-drawer .bitrix-amount-value {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-self: start !important;
  gap: 4px !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

.deal-drawer .bitrix-amount-value small,
.deal-drawer .bitrix-amount-value strong {
  width: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
}

.deal-drawer .bitrix-amount-value strong {
  line-height: 1.05 !important;
}

.deal-drawer .bitrix-amount > span {
  align-self: end !important;
  margin-bottom: 8px !important;
  white-space: nowrap;
}

.deal-drawer .bitrix-amount + .responsible-control {
  position: relative;
  z-index: 1;
  margin-top: 0 !important;
}

@media (max-width: 1180px) {
  .deal-drawer .bitrix-amount {
    min-height: 104px !important;
    padding-bottom: 18px !important;
  }
}

/* v87: the shared calendar stays inside the compact stage-transition dialog. */
.required-fields-backdrop.compact-stage-required-backdrop {
  align-items: center !important;
  padding: 12px !important;
  overflow: hidden !important;
}

.required-fields-modal.compact-stage-required-dialog {
  max-height: calc(100dvh - 24px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.compact-stage-required-dialog .required-fields-list {
  overflow: visible !important;
}

.compact-stage-required-dialog .required-shared-date {
  position: relative !important;
}

.compact-stage-required-dialog .required-shared-date:has(.bitrix-date-picker) {
  padding-bottom: 442px !important;
}

.compact-stage-required-dialog .required-shared-date > .bitrix-date-picker {
  top: 46px !important;
  bottom: auto !important;
  max-width: 100% !important;
}

@media (max-height: 620px) {
  .compact-stage-required-dialog .required-shared-date:has(.bitrix-date-picker) {
    padding-bottom: 362px !important;
  }

  .compact-stage-required-dialog .required-shared-date > .bitrix-date-picker {
    max-height: 350px !important;
  }
}

/* v88: the stage calendar is a popover and may leave the dialog bounds. */
.required-fields-backdrop.compact-stage-required-backdrop {
  overflow: auto !important;
}

.required-fields-modal.compact-stage-required-dialog:has(.bitrix-date-picker) {
  max-height: none !important;
  overflow: visible !important;
}

.compact-stage-required-dialog .required-shared-date:has(.bitrix-date-picker) {
  padding-bottom: 0 !important;
}

.compact-stage-required-dialog .required-shared-date > .bitrix-date-picker {
  top: 46px !important;
  z-index: 60 !important;
}

/* v89: stable kanban slot and one visual language for deal controls. */
.kanban-drop-placeholder {
  pointer-events: none !important;
  contain: layout paint;
  isolation: isolate;
  animation: none !important;
  transition: none !important;
  border-radius: 10px !important;
  background: rgba(104, 207, 165, 0.13) !important;
  border-color: rgba(104, 207, 165, 0.58) !important;
  box-shadow: inset 0 0 0 1px rgba(104, 207, 165, 0.1) !important;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

@media (max-width: 1180px) {
  .drawer-backdrop .deal-drawer {
    left: 64px !important;
    right: auto !important;
    transform: none !important;
  }

  .drawer-backdrop .drawer-external-close {
    left: 20px !important;
    right: auto !important;
    width: 44px !important;
  }
}

.deal-drawer {
  --deal-control-radius: 9px;
  --deal-control-height: 40px;
  transform: none !important;
}

.deal-drawer .deal-section-title > button {
  min-height: 34px;
  padding: 0 12px !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--deal-control-radius) !important;
  background: transparent !important;
  color: var(--green) !important;
  font: 700 9px Manrope, sans-serif !important;
}

.deal-drawer .deal-composer nav button {
  min-height: var(--deal-control-height);
  padding: 0 12px !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--muted) !important;
  font: 700 10px Manrope, sans-serif !important;
}

.deal-drawer .deal-composer nav button.active,
.deal-drawer .deal-composer nav button[aria-selected="true"] {
  border-bottom-color: var(--green) !important;
  color: var(--green) !important;
}

.deal-drawer .composer-actions button,
.deal-drawer .client-chat-actions button,
.deal-drawer .client-chat-actions a {
  min-height: var(--deal-control-height);
  padding: 0 14px !important;
  border: 1px solid transparent !important;
  border-radius: var(--deal-control-radius) !important;
  background: var(--green) !important;
  color: #fff !important;
  font: 700 9px Manrope, sans-serif !important;
}

.deal-drawer .client-chat-actions a + a {
  border-color: var(--line) !important;
  background: transparent !important;
  color: var(--green) !important;
}

.deal-drawer .composer-toolbar button,
.deal-drawer .composer-actions select,
.deal-drawer .composer-actions [role="button"] {
  min-height: var(--deal-control-height);
  border-radius: var(--deal-control-radius) !important;
}

.deal-drawer .chat-status {
  border-radius: 8px !important;
}

.deal-drawer .discussion-invite {
  border-radius: 14px !important;
}

/* v90: one control language inside the deal drawer. */
.deal-drawer {
  --deal-action-height: 40px;
  --deal-action-radius: 9px;
  --deal-status-radius: 8px;
}

.deal-drawer .deal-section-title > button,
.deal-drawer .composer-actions button,
.deal-drawer .client-chat-actions button,
.deal-drawer .client-chat-actions a {
  min-height: var(--deal-action-height) !important;
  height: var(--deal-action-height) !important;
  padding-inline: 16px !important;
  border-radius: var(--deal-action-radius) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.deal-drawer .deal-composer nav button {
  min-height: var(--deal-action-height) !important;
  height: var(--deal-action-height) !important;
  padding: 0 14px !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: var(--deal-status-radius) var(--deal-status-radius) 0 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  line-height: 1 !important;
}

.deal-drawer .deal-composer nav button.active,
.deal-drawer .deal-composer nav button[aria-selected="true"] {
  color: var(--accent, #68cfa5) !important;
  border-bottom-color: var(--accent, #68cfa5) !important;
  background: color-mix(in srgb, var(--accent, #68cfa5) 8%, transparent) !important;
}

.deal-drawer .chat-status {
  min-height: 30px !important;
  padding-inline: 12px !important;
  border-radius: var(--deal-status-radius) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.deal-drawer button:focus-visible,
.deal-drawer a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent, #68cfa5) 72%, white) !important;
  outline-offset: 2px !important;
}

/* Компактная запись смены стадии + история отправок роботов */
.deal-feed-item.stage-compact{grid-template-columns:38px 1fr;gap:12px;padding:9px 18px;background:transparent;box-shadow:none;border:1px solid rgba(140,152,160,.2);border-radius:13px;align-items:center}
body.theme-dark .deal-feed-item.stage-compact{background:transparent;box-shadow:none;border-color:rgba(147,160,154,.28)}
body.theme-dark .deal-feed-item.robot-planned{background:transparent;box-shadow:none;border-color:rgba(147,160,154,.4)}
.deal-feed-item.stage-compact .deal-feed-icon{width:24px;height:24px;background:transparent;color:#9aa3aa;font-size:11px}
.stage-compact-body{display:flex;align-items:center;gap:10px;min-width:0}
.stage-compact-path{font:600 10px Onest;color:#58636c;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stage-compact-body time{margin-left:auto;color:#a0a8ae;font-size:8px;white-space:nowrap}
.deal-feed-item.robot-planned{opacity:1;border:1px dashed rgba(140,152,160,.45);background:transparent}
.deal-feed-item .robot-text{margin:8px 0 0;white-space:pre-wrap}
.deal-feed-item .robot-meta{opacity:1;color:var(--muted);font-size:9px}
body.theme-dark .deal-feed-item.stage-compact{border-color:rgba(147,160,154,.24)}
body.theme-dark .stage-compact-path{color:#c6d0ca}

/* Редактируемое название сделки в шапке карточки */
#drawerTitle{cursor:text}
#drawerTitle:hover{text-decoration:underline dotted rgba(140,152,160,.5);text-underline-offset:4px}
.drawer-title-input{width:100%;border:1px solid #83cfff;border-radius:8px;background:#fff;padding:4px 8px;color:inherit;font:inherit;outline:0}
body.theme-dark .drawer-title-input{background:#1b2620;border-color:#3d5a4b;color:#e7efe9}

/* Компактная строка отправки робота на стене сделки: канал, статус, время.
   Текст сообщения намеренно не показываем — он лежит во вкладке «История». */
.deal-wall-robot-rows{margin-bottom:10px}
.deal-feed-item.stage-compact.robot-row .stage-compact-path b{font-weight:700}
body.theme-dark .deal-feed-item.stage-compact.robot-row{background:transparent;box-shadow:none}

/* Меню шестерёнки у поля сделки.
   Было две беды: фон брался из необъявленной переменной, поэтому меню
   выглядело полностью прозрачным, и соседние строки перекрывали его,
   потому что открытая строка не поднималась над ними. */
.deal-view-layout-row:has(> .deal-view-field-menu:not([hidden])){z-index:60}
.deal-view-field-menu{
  z-index:60;
  background:var(--panel,#fff);
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  box-shadow:0 18px 44px rgba(15,38,28,.28);
}
body.theme-dark .deal-view-field-menu{background:#223129}
/* Тот же фон для раскрытой панели настроек поля и списка стадий. */
.deal-field-settings{background:var(--panel,#fff);backdrop-filter:none}
body.theme-dark .deal-field-settings{background:#1f2b25;border-color:#35463e}
.field-stage-selector-list{background:var(--panel,#fff);backdrop-filter:none}
body.theme-dark .field-stage-selector-list{background:#223129}

/* ============================================================
   Мобильная карточка сделки и меню поля — правки 19.08.2026
   ============================================================ */

/* Меню шестерёнки у нижних полей уходило под соседнюю секцию: поднимаем всю
   секцию, в которой меню открыто, и разворачиваем меню вверх для последних
   строк, чтобы оно не вылезало за низ карточки. */
.deal-section:has(.deal-view-field-menu:not([hidden])),
.bitrix-card-left:has(.deal-view-field-menu:not([hidden])),
.bitrix-field-stack:has(.deal-view-field-menu:not([hidden])){position:relative;z-index:70}
.deal-view-layout-row:nth-last-child(-n+3) > .deal-view-field-menu{top:auto;bottom:46px}

/* Смена стадии и порядок колонок на телефоне.
   Раньше шторка сделки была жёстко 1040 px даже на телефоне (правило с
   !important на 1180 px перебивало мобильное), поэтому карточку приходилось
   таскать вбок, а первым в поле зрения оказывался правый столбец. */
@media (max-width: 900px) {
  .drawer-backdrop{overflow-x:hidden!important;overflow-y:auto!important}
  .deal-drawer{
    left:0!important;right:0!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
    border-radius:0!important;
  }
  .deal-drawer .drawer-head{padding:16px 16px 12px!important;min-height:0!important}
  .drawer-backdrop #drawerClose{position:fixed!important;top:10px!important;right:10px!important;left:auto!important;z-index:140!important}

  /* «О сделке» идёт первым, комментарии и чат — следом. */
  .deal-drawer .bitrix-card-grid{display:flex!important;flex-direction:column!important;min-width:0!important;gap:12px!important}
  .deal-drawer .bitrix-card-left{order:1!important;min-width:0!important;margin:0!important}
  .deal-drawer .bitrix-card-right{order:2!important;min-width:0!important;margin:0!important}
  .deal-drawer .bitrix-card-grid .deal-section{padding:16px!important}

  /* Ленту из 22 микроскопических стадий прячем, оставляем крупный выбор. */
  .deal-drawer .drawer-stage-scroll{display:none!important}
  .drawer-stage-mobile{display:flex!important;width:100%;min-width:0;gap:8px}
  .mobile-current-stage,.mobile-neighbor-stage{min-height:52px}
}

/* v94-owner-deal-density: Bitrix-like information density on desktop.
   This final override deliberately changes spacing only; typography and the
   view/edit DOM keep the same geometry and therefore do not jump on focus. */
@media (min-width: 901px) {
  .deal-drawer .drawer-body{
    padding:14px 16px 22px!important;
  }
  .deal-drawer .bitrix-card-grid{
    gap:14px!important;
  }
  .deal-drawer .bitrix-card-grid .deal-section{
    padding:16px!important;
  }
  .deal-drawer .deal-section-title{
    margin-bottom:9px!important;
  }
  .deal-drawer .bitrix-deal-panel>.deal-section-title{
    padding-bottom:9px!important;
  }
  .deal-drawer .bitrix-stage-field{
    padding:9px 0 5px!important;
  }
  .deal-drawer .bitrix-amount{
    min-height:74px!important;
    margin-bottom:8px!important;
    padding:6px 0 10px!important;
  }
  .deal-drawer .bitrix-deal-panel>.responsible-control{
    min-height:62px!important;
    margin:0 0 10px!important;
    padding:8px 10px!important;
  }
  .deal-drawer .deal-subhead{
    margin:12px 0 6px!important;
  }
  .deal-drawer .bitrix-contact-card{
    padding:12px 14px!important;
  }
  .deal-drawer .bitrix-field-stack{
    margin-top:5px!important;
  }
  .deal-drawer .deal-view-layout-row{
    min-height:56px!important;
  }
  .deal-drawer .deal-view-field-main{
    min-height:55px!important;
    padding:6px 0!important;
  }
  .deal-drawer .deal-view-field-main>span{
    gap:3px!important;
  }
  .deal-drawer .deal-view-field-main strong{
    margin-top:0!important;
  }
  .deal-drawer .deal-work-wall{
    margin-top:12px!important;
  }
  .deal-drawer .deal-work-wall .deal-section-title{
    margin-bottom:10px!important;
  }
  .deal-drawer .deal-feed{
    gap:8px!important;
  }
  .deal-drawer .deal-feed-item{
    padding:12px 14px!important;
  }
}

/* v94-owner-deal-density: a phone owns the viewport. Reset every desktop
   minimum width after the 1180px and fine-pointer rules, and leave one
   vertical scroll owner (.drawer-body) so horizontal dragging is impossible. */
@media (max-width: 900px) {
  .drawer-backdrop{
    inset:0!important;
    padding:0!important;
    overflow:hidden!important;
  }
  .drawer-backdrop .deal-drawer{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    min-width:0!important;
    max-width:100vw!important;
    height:100dvh!important;
    min-height:100dvh!important;
    max-height:100dvh!important;
    overflow:hidden!important;
    border-radius:0!important;
  }
  .deal-drawer .drawer-head,
  .deal-drawer .drawer-stage,
  .deal-drawer .drawer-tabs,
  .deal-drawer .drawer-body{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  .deal-drawer .drawer-body{
    flex:1 1 auto!important;
    padding:10px 8px 24px!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior-y:contain;
  }
  .deal-drawer .bitrix-card-grid,
  .deal-drawer .bitrix-card-left,
  .deal-drawer .bitrix-card-right,
  .deal-drawer .deal-section{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  .drawer-backdrop #drawerClose,
  .deal-drawer .drawer-external-close,
  .deal-drawer #editDealBtn,
  .deal-drawer .bitrix-amount>[data-edit-field],
  .deal-drawer .deal-view-field-drag,
  .deal-drawer .deal-view-field-gear,
  .deal-drawer .deal-section-title>button,
  .deal-drawer .composer-actions button,
  .deal-drawer .client-chat-actions button,
  .deal-drawer .client-chat-actions a{
    min-width:44px!important;
    min-height:44px!important;
  }
  .deal-drawer .drawer-tabs button,
  .deal-drawer .mobile-current-stage,
  .deal-drawer .mobile-neighbor-stage,
  .deal-drawer .inline-field-input,
  .deal-drawer .inline-system-field input,
  .deal-drawer .inline-system-field select{
    min-height:44px!important;
  }
}

/* v95-owner-edit-stability: editing stays in the same geometry and all field
   controls remain visible. Shared calendars must never be clipped by columns. */
.deal-drawer .bitrix-deal-panel.deal-config-mode .bitrix-inline-edit{
  padding:0!important;
}
.deal-drawer #cancelDealEdit{
  width:91px!important;
  min-width:91px!important;
  height:40px!important;
  min-height:40px!important;
  box-sizing:border-box!important;
  border:1px solid var(--line)!important;
  border-radius:9px!important;
  background:transparent!important;
  padding:0 10px!important;
  color:#175b45!important;
  font:700 14px/14px Manrope!important;
}
.deal-drawer .deal-view-field-drag,
.deal-drawer .deal-view-field-gear,
.deal-drawer .deal-config-mode .deal-field-drag,
.deal-drawer .deal-config-mode .deal-field-gear{
  opacity:1!important;
}
.deal-drawer .deal-view-layout-row>.editable-deal-field.editing{
  grid-column:2/3!important;
  justify-self:stretch!important;
  width:100%!important;
  max-width:none!important;
  transform:none!important;
}
.deal-drawer .deal-view-field-tools{
  margin-top:12px!important;
  padding-top:10px!important;
  border-top:1px solid var(--line)!important;
}
.deal-drawer .bitrix-card-left:has(.bitrix-date-picker),
.deal-drawer .deal-section:has(.bitrix-date-picker),
.deal-drawer .bitrix-deal-panel:has(.bitrix-date-picker){
  position:relative!important;
  z-index:150!important;
  overflow:visible!important;
}
.deal-drawer .deal-edit-shared-date:has(.bitrix-date-picker),
.deal-drawer .deal-view-layout-row:has(.bitrix-date-picker){
  position:relative!important;
  z-index:160!important;
}
.deal-drawer .deal-edit-shared-date>.bitrix-date-picker,
.deal-drawer .deal-view-layout-row>.bitrix-date-picker{
  left:0!important;
  right:auto!important;
  max-width:min(286px,calc(100vw - 48px))!important;
}
body.theme-dark .deal-drawer #cancelDealEdit{
  border-color:#42564d!important;
  background:#26372f!important;
  color:#8fe3bd!important;
}

/* v96-edit-is-the-same-card: switching to edit changes controls, not the
   visual language or field geometry. */
.deal-drawer .deal-config-mode .deal-layout-row{
  grid-template-columns:26px minmax(0,1fr) 32px!important;
  align-items:start!important;
  gap:7px!important;
  min-height:58px!important;
  padding:1px 0!important;
  box-sizing:border-box!important;
  border-radius:9px!important;
}
.deal-drawer .deal-config-mode .deal-field-control{
  gap:3px!important;
  color:var(--muted)!important;
  font-size:10px!important;
  font-weight:500!important;
  line-height:13.5px!important;
}
.deal-drawer .deal-config-mode .deal-field-control>span{
  min-height:14px!important;
  color:var(--muted)!important;
  font:500 10px/13.5px Manrope!important;
}
.deal-drawer .deal-config-mode .deal-field-control>input:not([type="checkbox"]),
.deal-drawer .deal-config-mode .deal-field-control>select,
.deal-drawer .deal-config-mode .deal-edit-date-trigger{
  width:100%!important;
  height:34px!important;
  min-height:34px!important;
  box-sizing:border-box!important;
  border:1px solid var(--line)!important;
  border-radius:9px!important;
  background:var(--surface)!important;
  padding:0 10px!important;
  color:var(--ink)!important;
  font:650 13px/18.85px Manrope!important;
}
.deal-drawer .deal-config-mode .deal-field-control>textarea{
  min-height:60px!important;
  border:1px solid var(--line)!important;
  border-radius:9px!important;
  background:var(--surface)!important;
  color:var(--ink)!important;
  font:650 13px/18.85px Manrope!important;
}
.deal-drawer .deal-config-mode .deal-field-drag,
.deal-drawer .deal-config-mode .deal-field-gear{
  width:26px!important;
  min-width:26px!important;
  height:38px!important;
  min-height:38px!important;
  margin-top:10px!important;
}
.deal-drawer .deal-view-layout-row{
  min-height:58px!important;
  padding:1px 0!important;
  box-sizing:border-box!important;
}
.deal-drawer .deal-view-field-main{
  min-height:56px!important;
  padding:5px 0!important;
}
body.theme-dark .deal-drawer .deal-config-mode .deal-field-control>input:not([type="checkbox"]),
body.theme-dark .deal-drawer .deal-config-mode .deal-field-control>select,
body.theme-dark .deal-drawer .deal-config-mode .deal-field-control>textarea,
body.theme-dark .deal-drawer .deal-config-mode .deal-edit-date-trigger{
  border-color:#42564d!important;
  background:#1f2d26!important;
  color:#edf6f1!important;
}
@media(max-width:900px){
  .deal-drawer .deal-config-mode .deal-field-control>input:not([type="checkbox"]),
  .deal-drawer .deal-config-mode .deal-field-control>select,
  .deal-drawer .deal-config-mode .deal-edit-date-trigger{
    height:44px!important;
    min-height:44px!important;
  }
  .deal-drawer .deal-config-mode .deal-layout-row{
    min-height:86px!important;
    padding:5px 0!important;
  }
  .deal-drawer .deal-view-layout-row{
    min-height:64px!important;
    padding:4px 0!important;
  }
}

/* v97: identical geometry before and after clicking Edit */
.deal-drawer .deal-view-layout-row,
.deal-drawer .deal-layout-row{grid-template-columns:26px minmax(0,1fr) 32px!important;column-gap:7px!important;align-items:center!important}
.deal-drawer .deal-view-field-drag,
.deal-drawer .deal-field-drag{display:grid!important;place-items:center!important;width:26px!important;height:38px!important;margin:0!important;padding:0!important;font-size:20px!important;line-height:1!important;color:#9aa69f!important}
.deal-drawer .deal-view-field-main>small,
.deal-drawer .deal-field-control>span{display:inline-flex!important;align-items:center!important;justify-self:start!important;gap:0!important;margin:0!important;font:500 10px/1.25 Manrope!important;color:var(--muted)!important}
.deal-drawer .deal-view-field-main .rule-required,
.deal-drawer .deal-field-control .rule-required{margin-left:3px!important}
.deal-drawer .deal-section-title>h3{font:700 13px/1.2 Onest!important;letter-spacing:0!important}

/* v98-robot-kanban-parity: robot lanes use the same geometry and visual base
   as the deals Kanban while keeping robot-specific controls and content. */
.automation-grid{
  grid-template-columns:none!important;
  grid-auto-flow:column!important;
  grid-auto-columns:var(--compact-column)!important;
  gap:var(--kanban-gap)!important;
  align-items:start!important;
  padding:0 0 8px!important;
  scrollbar-width:thin;
}
.automation-grid .robot-column{
  display:flex!important;
  flex-direction:column!important;
  width:var(--compact-column)!important;
  min-width:var(--compact-column)!important;
  max-width:var(--compact-column)!important;
  height:var(--kanban-column-height)!important;
  min-height:var(--kanban-column-height)!important;
  max-height:var(--kanban-column-height)!important;
  padding:0 3px!important;
  border:0!important;
  border-right:1px dashed rgba(68,91,80,.16)!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
}
.automation-grid .stage-cap{
  flex:0 0 var(--kanban-stage-height)!important;
  height:var(--kanban-stage-height)!important;
  min-height:var(--kanban-stage-height)!important;
  max-height:var(--kanban-stage-height)!important;
  font-family:Manrope,Arial,sans-serif!important;
}
.automation-grid .robot-trigger{
  flex:0 0 24px!important;
  height:24px!important;
  min-height:24px!important;
  margin:0 0 3px!important;
  border-radius:5px!important;
  background:rgba(255,255,255,.42)!important;
}
.automation-grid .robot-stack{
  flex:1!important;
  min-height:0!important;
  display:grid!important;
  grid-auto-rows:minmax(var(--kanban-card-height),auto)!important;
  align-content:start!important;
  gap:4px!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:2px 3px 18px 1px!important;
  overscroll-behavior:contain;
  scrollbar-width:thin;
}
.automation-grid .robot-card{
  width:100%!important;
  min-height:var(--kanban-card-height)!important;
  margin:0!important;
  padding:8px!important;
  overflow:hidden!important;
  border:1px solid rgba(255,255,255,.46)!important;
  border-left:3px solid #4ba77a!important;
  border-radius:9px!important;
  background:rgba(255,255,255,.68)!important;
  box-shadow:0 2px 8px rgba(28,52,42,.08),inset 0 1px 0 rgba(255,255,255,.55)!important;
  backdrop-filter:blur(11px) saturate(118%)!important;
  font-family:Manrope,Arial,sans-serif!important;
}
.automation-grid .robot-card:hover{
  transform:translateY(-1px)!important;
  background:rgba(255,255,255,.76)!important;
  box-shadow:0 4px 12px rgba(28,52,42,.11),inset 0 1px 0 rgba(255,255,255,.7)!important;
}
.automation-grid .empty-robots{
  flex:1!important;
  min-height:120px!important;
  background:transparent!important;
}
body.theme-dark .automation-grid .robot-column{
  border-color:rgba(255,255,255,.08)!important;
  background:transparent!important;
}
body.theme-dark .automation-grid .robot-trigger{background:rgba(18,28,23,.35)!important}
body.theme-dark .automation-grid .robot-card{
  border-color:rgba(255,255,255,.09)!important;
  border-left-color:#4ba77a!important;
  background:rgba(29,42,35,.68)!important;
  box-shadow:0 2px 8px rgba(0,0,0,.20),inset 0 1px 0 rgba(255,255,255,.07)!important;
}
body.theme-dark .automation-grid .robot-card:hover{background:rgba(36,51,43,.76)!important}

/* v99-field-cleanup: keep technical controls useful and visually secondary. */
.deal-drawer .deal-view-field-main>small,
.deal-drawer .deal-field-control>span{
  color:#9aa6ad!important;
}
.deal-drawer .deal-view-field-drag,
.deal-drawer .deal-field-drag{
  color:#aab4b0!important;
}
body.theme-dark .deal-drawer .deal-view-field-main>small,
body.theme-dark .deal-drawer .deal-field-control>span{
  color:#aebbb5!important;
}
body.theme-dark .deal-drawer .deal-view-field-drag,
body.theme-dark .deal-drawer .deal-field-drag{
  color:#a7b5ae!important;
}

/* v105-deal-type-system: one calm interface scale without changing the
   approved drawer geometry, edit layout, drag handles or mobile targets. */
.deal-drawer{
  --deal-type-ui:Manrope,Arial,sans-serif;
  --deal-type-display:Onest,Manrope,Arial,sans-serif;
}
.deal-drawer .drawer-head h2{
  font-family:var(--deal-type-display)!important;
  font-size:25px!important;
  font-weight:600!important;
  line-height:1.16!important;
}
.deal-drawer .drawer-stage-step span{
  font:600 9px/1.2 var(--deal-type-ui)!important;
}
.deal-drawer .drawer-tabs button{
  font:500 11px/1.2 var(--deal-type-ui)!important;
}
.deal-drawer .drawer-tabs button.active{
  font-weight:600!important;
}
.deal-drawer .deal-section-title>h3,
.deal-drawer .deal-subhead,
.deal-drawer .client-chat-card h3{
  font-family:var(--deal-type-ui)!important;
  font-size:13px!important;
  font-weight:600!important;
  line-height:1.25!important;
  letter-spacing:0!important;
}
.deal-drawer #editDealBtn,
.deal-drawer #cancelDealEdit,
.deal-drawer #dealComposerSubmit,
.deal-drawer .client-chat-card button,
.deal-drawer .client-chat-card a{
  font:600 13px/1 var(--deal-type-ui)!important;
}
.deal-drawer .deal-composer nav button{
  font:500 13px/1.2 var(--deal-type-ui)!important;
}
.deal-drawer .deal-composer nav button.active,
.deal-drawer .deal-composer nav button[aria-selected="true"]{
  font-weight:600!important;
}
.deal-drawer .deal-view-field-main>small,
.deal-drawer .deal-field-control>span,
.deal-drawer .bitrix-stage-field small,
.deal-drawer .bitrix-amount small,
.deal-drawer .bitrix-contact-card small,
.deal-drawer .responsible-control small{
  font:500 10px/1.25 var(--deal-type-ui)!important;
}
.deal-drawer .deal-view-field-main>strong,
.deal-drawer .deal-field-control>input:not([type="checkbox"]),
.deal-drawer .deal-field-control>select,
.deal-drawer .deal-field-control>textarea,
.deal-drawer .deal-edit-date-trigger,
.deal-drawer .bitrix-contact-card>strong,
.deal-drawer .responsible-control select{
  font-family:var(--deal-type-ui)!important;
  font-size:13px!important;
  font-weight:500!important;
  line-height:1.45!important;
}
.deal-drawer .client-chat-card>p,
.deal-drawer .client-chat-card small,
.deal-drawer .chat-status,
.deal-drawer .composer-actions small,
.deal-drawer .deal-feed time{
  font-family:var(--deal-type-ui)!important;
  font-size:9px!important;
  font-weight:400!important;
  line-height:1.45!important;
}
.deal-drawer .bitrix-amount-value strong{
  font-family:var(--deal-type-display)!important;
  font-weight:600!important;
}
.orbito-chat-date{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:10px;
  margin:8px 0 2px;
  color:#92aaa0;
  font:500 11px/1.2 Manrope,Arial,sans-serif;
}
.orbito-chat-date::before,
.orbito-chat-date::after{
  content:"";
  height:1px;
  background:rgba(183,231,212,.13);
}
.orbito-chat-date span{
  padding:5px 10px;
  border-radius:999px;
  background:rgba(111,151,135,.14);
}
@media(max-width:900px){
  .deal-drawer #editDealBtn,
  .deal-drawer #cancelDealEdit,
  .deal-drawer #dealComposerSubmit,
  .deal-drawer .client-chat-card button,
  .deal-drawer .client-chat-card a{
    min-height:44px!important;
  }
}
/* v106: explicit robot deletion, kept visually secondary to configuration. */
.robot-card-delete{border:0;border-radius:5px;padding:4px 6px;cursor:pointer;font:700 7px Manrope;color:#a34f4f;background:#f8eeee}.robot-card-delete:hover{background:#f1dddd}

/* Field-management feedback is independent from the column calculation. */
.deal-drawer .deal-view-layout-row.drop-target,
.deal-drawer .deal-layout-row.drop-target{
  background:color-mix(in srgb,var(--green) 8%,transparent)!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--green) 55%,transparent)!important;
}

/* v108-deal-sections: section-based field constructor, equal paired rows,
   explicit dark-stage progress and a readable scheduled-robot countdown. */
.deal-drawer .deal-field-sections{
  display:grid;
  gap:14px;
  margin-top:12px;
}
.deal-drawer .deal-field-section{
  min-width:0;
  padding:10px 12px 4px;
  border:1px solid var(--line);
  border-radius:12px;
  background:color-mix(in srgb,var(--panel,#fff) 74%,transparent);
}
.deal-drawer .deal-field-section>header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:30px;
  padding:0 2px 8px;
  border-bottom:1px solid var(--line);
}
.deal-drawer .deal-field-section>header h4{
  margin:0;
  color:var(--ink);
  font:600 11px/1.25 var(--deal-type-ui,Manrope,Arial,sans-serif);
  text-transform:uppercase;
  letter-spacing:.01em;
}
.deal-drawer .deal-field-section>header>small{
  color:var(--muted);
  font:400 9px/1.2 var(--deal-type-ui,Manrope,Arial,sans-serif);
}
.deal-drawer .deal-field-section-edit>header{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
}
.deal-drawer .deal-field-section-edit>header input,
.deal-drawer .deal-field-section-edit>header select{
  min-width:0;
  height:34px;
  border:1px solid var(--line);
  border-radius:8px;
  padding:0 9px;
  color:var(--ink);
  background:var(--panel,#fff);
  font:500 11px/1 var(--deal-type-ui,Manrope,Arial,sans-serif);
}
.deal-drawer .deal-field-section-edit>header label{
  display:flex;
  align-items:center;
  gap:6px;
  color:var(--muted);
  font:500 9px/1 var(--deal-type-ui,Manrope,Arial,sans-serif);
}
.deal-drawer .deal-field-section-edit>header button[data-section-delete]{
  height:34px;
  border:1px solid color-mix(in srgb,var(--danger,#c2503f) 35%,var(--line));
  border-radius:8px;
  padding:0 10px;
  background:transparent;
  color:var(--danger,#c2503f);
  cursor:pointer;
  font:600 9px/1 var(--deal-type-ui,Manrope,Arial,sans-serif);
}
.deal-drawer .deal-section-empty{
  grid-column:1/-1;
  min-height:46px;
  display:grid;
  place-items:center;
  color:var(--muted);
  border:1px dashed var(--line);
  border-radius:8px;
  font:500 10px/1.3 var(--deal-type-ui,Manrope,Arial,sans-serif);
}
.deal-drawer .deal-section-empty[hidden]{display:none!important}
.deal-drawer .deal-layout-editor.drop-target,
.deal-drawer .deal-view-layout.drop-target{
  background:color-mix(in srgb,var(--green) 7%,transparent);
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--green) 42%,transparent);
}
.deal-drawer .deal-section-creator{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(150px,.55fr);
  gap:10px;
  margin-top:12px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel,#fff);
}
.deal-drawer .deal-section-creator[hidden]{display:none!important}
.deal-drawer .deal-section-creator label{display:grid;gap:5px;color:var(--muted);font-size:10px}
.deal-drawer .deal-section-creator input,
.deal-drawer .deal-section-creator select{height:38px;border:1px solid var(--line);border-radius:8px;padding:0 10px;background:var(--panel,#fff);color:var(--ink)}
.deal-drawer .deal-section-creator>div{grid-column:1/-1;display:flex;justify-content:flex-end;gap:8px}
.deal-drawer .robot-row.robot-planned .robot-countdown,
.deal-drawer .robot-row.robot-planned time{
  color:color-mix(in srgb,var(--ink) 72%,var(--muted));
  font-weight:500!important;
  white-space:normal;
  text-align:right;
}
body.theme-dark .deal-drawer .drawer-stage-strip:not(.previewing) .drawer-stage-step.passed,
body.theme-dark .deal-drawer .drawer-stage-strip:not(.previewing) .drawer-stage-step.active{
  background:var(--current-stage)!important;
  color:#fff!important;
  filter:saturate(1.08) brightness(1.08);
}
body.theme-dark .deal-drawer .drawer-stage-strip:not(.previewing) .drawer-stage-step.passed::after,
body.theme-dark .deal-drawer .drawer-stage-strip:not(.previewing) .drawer-stage-step.active::after{
  background:rgba(255,255,255,.82)!important;
}
body.theme-dark .deal-drawer .deal-field-section,
body.theme-dark .deal-drawer .deal-section-creator{
  border-color:#35463e;
  background:#1c2a23;
}
@media (max-width:900px){
  .deal-drawer .deal-field-section{padding:8px 9px 3px}
  .deal-drawer .deal-field-section-edit>header{grid-template-columns:minmax(0,1fr);align-items:stretch}
  .deal-drawer .deal-field-section-edit>header label{justify-content:space-between}
  .deal-drawer .deal-section-creator{grid-template-columns:minmax(0,1fr)}
  .deal-drawer .deal-section-creator>div{grid-column:1}
}

/* v109-readable-deal-fields: a section may be narrow even on a desktop
   viewport (browser zoom, split window or the fixed two-pane deal drawer).
   Base the field columns on the real panel width so controls never collapse
   to 90px-wide inputs while the viewport media query still says desktop. */
.deal-drawer .bitrix-deal-panel{
  container-type:inline-size;
  container-name:deal-panel;
}
.deal-drawer .deal-field-section{
  container-type:inline-size;
  container-name:deal-field-section;
}
@container deal-field-section (max-width:699px){
  .deal-drawer .deal-field-section-edit>header{
    grid-template-columns:minmax(0,1fr)!important;
    align-items:stretch!important;
  }
  .deal-drawer .deal-field-section-edit>header label{
    justify-content:space-between;
  }
}
@container deal-panel (max-width:699px){
  .deal-drawer .deal-section-creator{
    grid-template-columns:minmax(0,1fr)!important;
  }
  .deal-drawer .deal-section-creator>div{
    grid-column:1!important;
  }
}

/* v113-desktop-two-column-stable: desktop sections keep their configured two
   columns. At zoomed/narrow desktop widths the surrounding card stacks before
   the field cells can collapse; only the mobile breakpoint becomes one column. */
.deal-drawer .deal-view-layout,
.deal-drawer .deal-layout-editor,
.deal-drawer .deal-section-columns-1,
.deal-drawer .deal-section-columns-2{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  align-items:stretch!important;
  column-gap:18px!important;
  width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
}
@container deal-field-section (min-width:520px){
  .deal-drawer .deal-section-columns-2{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}
@media (min-width:601px) and (max-width:1800px){
  .deal-drawer .bitrix-card-grid{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
  }
  .deal-drawer .bitrix-card-left{order:1!important}
  .deal-drawer .bitrix-card-right{order:2!important}
}
.deal-drawer :is(.deal-view-layout-row,.deal-layout-row){
  align-self:stretch!important;
  justify-self:stretch!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:100%!important;
  box-sizing:border-box!important;
}
.deal-drawer :is(.deal-view-layout-row,.deal-layout-row).settings-open,
.deal-drawer .deal-layout-row:has(.deal-field-settings:not([hidden])){
  grid-column:1/-1!important;
}
.deal-drawer .deal-view-field-main,
.deal-drawer .deal-field-control,
.deal-drawer .deal-view-field-main>span,
.deal-drawer .deal-view-field-main small,
.deal-drawer .deal-view-field-main strong{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  box-sizing:border-box!important;
}
.deal-drawer .deal-view-field-main{
  justify-content:flex-start!important;
  height:100%!important;
}
.deal-drawer .deal-view-field-main>span{
  flex:1 1 100%!important;
}
.deal-drawer .deal-view-field-main small,
.deal-drawer .deal-view-field-main strong{
  display:block!important;
  word-break:normal!important;
  overflow-wrap:break-word!important;
  hyphens:none!important;
}
.deal-drawer .deal-field-control{
  height:100%!important;
}
@media (hover:hover) and (pointer:fine){
  .deal-drawer :is(.deal-view-layout-row,.deal-layout-row){
    position:relative!important;
    grid-template-columns:minmax(0,1fr)!important;
  }
  .deal-drawer .deal-view-layout-row>.deal-view-field-main,
  .deal-drawer .deal-layout-row>.deal-field-control{
    grid-column:1/-1!important;
    justify-self:stretch!important;
  }
  .deal-drawer :is(.deal-view-field-drag,.deal-view-field-gear,.deal-field-drag,.deal-field-gear){
    position:absolute!important;
    top:50%!important;
    z-index:2!important;
    margin:0!important;
    opacity:0!important;
    pointer-events:none!important;
    transform:translateY(-50%)!important;
  }
  .deal-drawer :is(.deal-view-field-drag,.deal-field-drag){left:-26px!important}
  .deal-drawer :is(.deal-view-field-gear,.deal-field-gear){right:0!important}
  .deal-drawer .deal-view-layout-row:is(:hover,:focus-within,.dragging,.settings-open) :is(.deal-view-field-drag,.deal-view-field-gear),
  .deal-drawer .deal-layout-row:is(:hover,:focus-within,.dragging,.drop-target) :is(.deal-field-drag,.deal-field-gear){
    opacity:1!important;
    pointer-events:auto!important;
  }
  .deal-drawer .deal-layout-row>.deal-field-settings{
    grid-column:1/-1!important;
    width:100%!important;
    min-width:0!important;
  }
}
@media (hover:none),(pointer:coarse){
  .deal-drawer :is(.deal-view-field-drag,.deal-view-field-gear,.deal-field-drag,.deal-field-gear){
    opacity:1!important;
    pointer-events:auto!important;
  }
}
@media (max-width:600px){
  .deal-drawer .deal-section-columns-1,
  .deal-drawer .deal-section-columns-2{
    grid-template-columns:minmax(0,1fr)!important;
  }
}

/* v114-deal-canvas-controls-stable: a resized desktop keeps one readable
   1200px deal canvas. The viewport owns horizontal scrolling while the drawer
   body remains the only vertical scroll owner. Real touch/mobile surfaces keep
   the compact layout and expand field controls directly below their row. */
@media (hover:hover) and (pointer:fine){
  .drawer-backdrop{
    overflow-x:auto!important;
    overflow-y:hidden!important;
  }
  .drawer-backdrop .deal-drawer{
    left:max(52px,calc(100vw - max(1200px,78vw)))!important;
    right:auto!important;
    width:max(1200px,78vw)!important;
    min-width:1200px!important;
    max-width:none!important;
    overflow:hidden!important;
  }
  .drawer-backdrop .drawer-external-close{
    left:calc(max(52px,calc(100vw - max(1200px,78vw))) - 44px)!important;
  }
  .deal-drawer .drawer-body{
    min-width:0!important;
    overflow-x:hidden!important;
  }
  .deal-drawer .bitrix-card-grid{
    display:grid!important;
    grid-template-columns:minmax(590px,.96fr) minmax(520px,1.04fr)!important;
    grid-template-areas:"deal wall"!important;
    min-width:1124px!important;
    align-items:start!important;
  }
  .deal-drawer .bitrix-card-left{
    grid-area:deal!important;
    grid-column:1!important;
    grid-row:1!important;
  }
  .deal-drawer .bitrix-card-right{
    grid-area:wall!important;
    grid-column:2!important;
    grid-row:1!important;
  }
  .deal-drawer .deal-section-columns-2{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .deal-drawer :is(.deal-view-layout-row,.deal-layout-row){
    padding-left:30px!important;
    padding-right:36px!important;
  }
  .deal-drawer :is(.deal-view-field-drag,.deal-field-drag){left:2px!important}
  .deal-drawer :is(.deal-view-field-gear,.deal-field-gear){right:2px!important}
  .deal-drawer .deal-view-layout-row>.editable-deal-field.editing{
    grid-column:1/-1!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  .deal-drawer .deal-view-layout-row:has(>.editable-deal-field.editing)
    :is(.deal-view-field-drag,.deal-view-field-gear){
    opacity:0!important;
    pointer-events:none!important;
  }
}

@media (max-width:900px) and (hover:none),
       (max-width:900px) and (pointer:coarse){
  .deal-drawer .deal-view-layout-row{
    scroll-margin-top:150px;
  }
  .deal-drawer .deal-view-layout-row>.deal-view-field-menu,
  .deal-drawer .deal-view-layout-row>.deal-field-settings{
    position:relative!important;
    inset:auto!important;
    grid-column:1/-1!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:7px 0 12px!important;
    box-sizing:border-box!important;
  }
  .deal-drawer .deal-view-layout-row>.deal-view-field-menu{
    display:grid;
  }
  .deal-drawer .deal-view-layout-row>.deal-field-settings{
    max-height:none!important;
    overflow:visible!important;
  }
}

/* v117-deal-config-geometry: editing tools always occupy their own columns.
   Do not depend on hover/pointer media features: desktop touch devices and the
   embedded browser can report a coarse pointer even at a desktop width. */
.deal-drawer .deal-config-mode .deal-layout-row{
  position:relative!important;
  display:grid!important;
  grid-template-columns:26px minmax(0,1fr) 32px!important;
  column-gap:7px!important;
  align-items:start!important;
  padding:1px 0!important;
  width:auto!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
.deal-drawer .deal-config-mode .deal-layout-row>.deal-field-drag,
.deal-drawer .deal-config-mode .deal-layout-row>.deal-field-gear{
  position:static!important;
  inset:auto!important;
  z-index:2!important;
  margin:18px 0 0!important;
  opacity:1!important;
  pointer-events:auto!important;
  transform:none!important;
}
.deal-drawer .deal-config-mode .deal-layout-row>.deal-field-drag{
  grid-column:1!important;
  grid-row:1!important;
}
.deal-drawer .deal-config-mode .deal-layout-row>.deal-field-control{
  grid-column:2!important;
  grid-row:1!important;
  justify-self:stretch!important;
  width:auto!important;
  min-width:0!important;
  max-width:100%!important;
}
.deal-drawer .deal-config-mode .deal-layout-row>.deal-field-gear{
  grid-column:3!important;
  grid-row:1!important;
}
.deal-drawer .deal-config-mode .deal-layout-row>.deal-field-settings,
.deal-drawer .deal-config-mode .deal-layout-row>.deal-field-mobile-order{
  grid-column:1/-1!important;
  width:100%!important;
  min-width:0!important;
}
.deal-drawer .deal-edit-savebar:not([hidden]){
  position:fixed!important;
  left:max(52px,calc(100vw - max(1200px,78vw)))!important;
  right:0!important;
  bottom:0!important;
  z-index:65!important;
  margin:0!important;
  box-sizing:border-box!important;
}
.deal-drawer .drawer-body:has(.deal-edit-savebar:not([hidden])){
  padding-bottom:94px!important;
}
@media (max-width:900px) and (hover:none),
       (max-width:900px) and (pointer:coarse){
  .deal-drawer .deal-edit-savebar:not([hidden]){
    left:0!important;
  }
}

/* Accepted UI release: compact deal task uses the shared date contract. */
.bitrix-task-editor-compact .required-shared-date{flex:1;min-width:0}
.bitrix-task-bell{flex:0 0 auto;width:40px;height:40px;border:0;border-radius:8px;background:transparent;color:var(--muted);font-size:18px;cursor:pointer}
.bitrix-task-bell.active{color:#e5a42e}
.bitrix-task-bell:hover,.bitrix-task-bell:focus-visible{background:var(--hover-tint);color:var(--ink);outline:0}
.bitrix-task-file{display:inline-grid;place-items:center;width:40px;height:40px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--muted);padding:0;cursor:pointer}
.bitrix-task-file svg{pointer-events:none}
.bitrix-task-file:hover,.bitrix-task-file:focus-visible{border-color:var(--green);color:var(--ink);background:var(--hover-tint);outline:0;box-shadow:0 0 0 3px color-mix(in srgb,var(--green) 14%,transparent)}
.deal-drawer .discussion-invite{display:none!important}
body.theme-dark .bitrix-task-bell{color:#9dafa5}
body.theme-dark .bitrix-task-bell:hover,body.theme-dark .bitrix-task-bell:focus-visible{background:#2b3a33;color:#e8f3ed}
body.theme-dark .bitrix-task-file{background:var(--panel);border-color:var(--line);color:#9dafa5}
body.theme-dark .bitrix-task-file:hover,body.theme-dark .bitrix-task-file:focus-visible{border-color:#6fe9b8;color:#e8f3ed;background:#24372e}

/* Accepted UI release: created task history stays dark without light pills. */
body.theme-dark .deal-feed-item.task .deal-due,
body.theme-dark .deal-feed-item.task .deal-task-meta span,
body.theme-dark .deal-feed-item.task .deal-task-meta a{
  background:#263a30!important;
  border:1px solid #42574d!important;
  color:#d8eee1!important;
}
body.theme-dark .deal-feed-item.task .deal-task-meta a:hover{background:#2d4538!important;color:#fff!important}

/* Accepted UI release: deals and robots share one desktop arrow contract. */
.kanban-scroll-arrow,.automation-scroll-arrow{
  position:fixed!important;top:50vh!important;transform:translateY(-50%)!important;
  display:grid!important;place-items:center;z-index:30!important;
  width:40px!important;height:64px!important;border:1px solid rgba(55,76,67,.16)!important;border-radius:12px!important;
  background:rgba(255,255,255,.38)!important;box-shadow:0 8px 24px rgba(27,40,33,.08)!important;
  backdrop-filter:blur(10px) saturate(1.12)!important;-webkit-backdrop-filter:blur(10px) saturate(1.12)!important;
  color:rgba(55,76,67,.62)!important;opacity:.72!important;
  appearance:none!important;-webkit-appearance:none!important;forced-color-adjust:none!important;
  font-family:Arial,sans-serif!important;font-weight:400!important;font-size:24px!important;line-height:24px!important;
  text-shadow:none!important;
  transition:opacity .16s ease,color .16s ease,background .16s ease,border-color .16s ease,box-shadow .16s ease!important;
}
.kanban-scroll-arrow.left,.automation-scroll-arrow.left{left:246px!important;right:auto!important}
.kanban-scroll-arrow.right,.automation-scroll-arrow.right{right:16px!important;left:auto!important}
.kanban-scroll-shell:hover .kanban-scroll-arrow,.automation-scroll-shell:hover .automation-scroll-arrow{opacity:.82!important}
.kanban-scroll-arrow:hover,.kanban-scroll-arrow:focus-visible,
.automation-scroll-arrow:hover,.automation-scroll-arrow:focus-visible{
  transform:translateY(-50%)!important;background:rgba(255,255,255,.72)!important;
  border-color:rgba(23,91,69,.28)!important;box-shadow:0 10px 28px rgba(27,40,33,.14)!important;
  color:var(--green)!important;opacity:1!important;outline:0;
}
.kanban-scroll-arrow:active,.automation-scroll-arrow:active{transform:translateY(-50%)!important;background:rgba(235,244,239,.82)!important;opacity:1!important}
body.theme-dark .kanban-scroll-arrow,body.theme-dark .automation-scroll-arrow{border-color:rgba(221,239,231,.14)!important;background:rgba(20,34,28,.58)!important;color:rgba(221,239,231,.68)!important;box-shadow:0 8px 26px rgba(0,0,0,.2)!important}
body.theme-dark .kanban-scroll-arrow:hover,body.theme-dark .kanban-scroll-arrow:focus-visible,
body.theme-dark .automation-scroll-arrow:hover,body.theme-dark .automation-scroll-arrow:focus-visible{border-color:rgba(111,233,184,.32)!important;background:rgba(35,55,46,.78)!important;color:#8fe3bd!important}
.kanban-scroll-arrow:disabled,.automation-scroll-arrow:disabled{opacity:0!important;pointer-events:none}
.kanban-scroll-shell:not(.has-horizontal-overflow) .kanban-scroll-arrow,
.automation-scroll-shell:not(.has-horizontal-overflow) .automation-scroll-arrow{opacity:0!important;pointer-events:none}
@media(max-width:1000px){.kanban-scroll-arrow.left,.automation-scroll-arrow.left{left:238px!important}}
@media(max-width:720px){.kanban-scroll-arrow,.automation-scroll-arrow{display:none!important}}
.app-shell.sidebar-collapsed .kanban-scroll-arrow.left,
.app-shell.sidebar-collapsed .automation-scroll-arrow.left{left:80px!important}

/* v124-deal-edit-summary: the four system fields use a compact, aligned
   two-column matrix. View mode keeps its existing layout unchanged. */
.deal-drawer .deal-edit-summary-grid{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px 12px!important;margin:12px 0 14px!important;align-items:end!important;
}
.deal-drawer .deal-edit-summary-grid>.inline-system-field,
.deal-drawer .deal-edit-summary-grid>.bitrix-stage-field,
.deal-drawer .deal-edit-summary-grid>.bitrix-amount,
.deal-drawer .deal-edit-summary-grid>.responsible-control{
  width:100%!important;min-width:0!important;min-height:76px!important;height:76px!important;
  margin:0!important;padding:8px 10px!important;box-sizing:border-box!important;
  border:1px solid var(--line)!important;border-radius:10px!important;background:color-mix(in srgb,var(--panel) 88%,transparent)!important;
}
.deal-drawer .deal-edit-summary-grid>.inline-system-field{display:grid!important;align-content:end!important}
.deal-drawer .deal-edit-summary-grid>.bitrix-stage-field,
.deal-drawer .deal-edit-summary-grid>.bitrix-amount{display:grid!important;grid-template-columns:minmax(0,1fr)!important;align-items:end!important}
.deal-drawer .deal-edit-summary-grid>.responsible-control{display:flex!important;align-items:center!important;gap:9px!important}
.deal-drawer .deal-edit-summary-grid input,
.deal-drawer .deal-edit-summary-grid select{height:38px!important;min-height:38px!important;margin-top:5px!important}
body.theme-dark .deal-drawer .deal-edit-summary-grid>.inline-system-field,
body.theme-dark .deal-drawer .deal-edit-summary-grid>.bitrix-stage-field,
body.theme-dark .deal-drawer .deal-edit-summary-grid>.bitrix-amount,
body.theme-dark .deal-drawer .deal-edit-summary-grid>.responsible-control{border-color:#35463e!important;background:rgba(31,42,37,.72)!important}
@media(max-width:720px){.deal-drawer .deal-edit-summary-grid{grid-template-columns:1fr!important}}
 
/* v118-robot-card-compact: stable one-column layout, fits lane, readable disabled */
.automation-grid .robot-stack{grid-auto-rows:minmax(min-content,auto)!important}
.automation-grid .robot-card,
.drawer-robots .robot-card{
  display:flex!important;flex-direction:column!important;gap:6px!important;
  width:100%!important;max-width:100%!important;
  min-height:auto!important;height:auto!important;
  padding:8px!important;margin:0!important;box-sizing:border-box!important;
  background:var(--panel)!important;border:1px solid var(--line)!important;border-left:3px solid #4ba77a!important;border-radius:9px!important;
  box-shadow:0 2px 8px rgba(28,52,42,.08)!important;
  font:500 11px/1.45 Manrope,Arial,sans-serif!important;
  backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
  overflow:hidden!important;
}
body.theme-dark .automation-grid .robot-card,
body.theme-dark .drawer-robots .robot-card{
  background:var(--panel)!important;border-color:var(--line)!important;border-left-color:#4ba77a!important;color:#e9f2ed!important;
}
.automation-grid .robot-card:hover,
.drawer-robots .robot-card:hover{transform:translateY(-1px)!important;background:var(--panel)!important}
.robot-card-header{
  display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0;
}
.robot-card-status{
  flex:0 0 auto;max-width:74px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  border:0;border-radius:6px;padding:4px 7px;
  background:#edf0ed;color:#7c8580;font:700 9px/1 Manrope;cursor:pointer;
}
.robot-card-status.on{background:#dff0e5;color:#28724f}
.robot-card-status:hover{filter:brightness(.96)}
.robot-card-actions{display:flex;align-items:center;gap:4px;margin:0}
.robot-card-actions button{
  display:grid;place-items:center;width:24px;height:24px;border:0;border-radius:6px;
  background:#eef3ef;color:var(--green);font-size:13px;line-height:1;cursor:pointer;
}
.robot-card-actions button:hover{background:#dcebe1}
.robot-card-actions .robot-card-delete{color:#a34f4f;background:#f8eeee}
.robot-card-actions .robot-card-delete:hover{background:#f1dddd}
.robot-card-body{display:flex;flex-direction:column;gap:3px;min-width:0}
.robot-card-body .robot-when{color:var(--muted);font-size:10px;line-height:1.35}
.robot-card-body .robot-title{display:flex;align-items:flex-start;gap:6px;min-width:0}
.robot-card-body .robot-title .robot-icon{flex:0 0 auto;color:var(--green);font-size:14px;line-height:1.2}
.robot-card-body .robot-title strong{flex:1 1 auto;min-width:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px;font-weight:700;color:var(--ink)}
.robot-card-body .robot-recipient{display:flex;align-items:baseline;gap:4px;min-width:0;color:var(--muted);font-size:10px}
.robot-card-body .robot-recipient b{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink);font-weight:600}
.robot-card-body .robot-conditions,
.robot-card-body .robot-off-note{min-width:0}
.robot-card-body .robot-conditions em,
.robot-card-body .robot-off-note em{display:block;min-width:0;max-height:2.8em;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-style:normal;font-size:10px;line-height:1.4;color:var(--muted)}
.robot-card-body .robot-off-note em{color:#a67c7c}
body.theme-dark .robot-card-body .robot-title strong{color:#fff}
body.theme-dark .robot-card-body .robot-recipient b{color:#e9f2ed}
body.theme-dark .robot-card-body .robot-conditions em,
body.theme-dark .robot-card-body .robot-off-note em{color:#c3d0c9}
body.theme-dark .robot-card-body .robot-off-note em{color:#d49b9b}
.robot-card.disabled{opacity:.9}
.robot-card.disabled .robot-card-status,
.robot-card.disabled .robot-card-actions button{opacity:.85}

/* v118-robot-editor-opaque: solid dialog surfaces and no background bleed */
.robot-editor-backdrop{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;background:rgba(17,25,22,.55)!important}
.robot-editor-dialog,
body.theme-dark .robot-editor-dialog{
  background:var(--panel)!important;border:1px solid var(--line)!important;box-shadow:var(--shadow)!important;
  backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
}
.robot-editor-dialog>header,
.robot-editor-dialog>footer,
.robot-editor-dialog .robot-editor-switch,
.robot-editor-dialog .robot-editor-check,
.robot-editor-dialog .robot-condition-editor,
.robot-editor-dialog .robot-editor-grid,
.robot-editor-dialog label,
.robot-editor-dialog input:not([type="checkbox"]):not([type="color"]),
.robot-editor-dialog textarea,
.robot-editor-dialog .robot-select-trigger{
  background:var(--panel)!important;
}
body.theme-dark .robot-editor-dialog>header,
body.theme-dark .robot-editor-dialog>footer,
body.theme-dark .robot-editor-dialog .robot-editor-switch,
body.theme-dark .robot-editor-dialog .robot-editor-check,
body.theme-dark .robot-editor-dialog .robot-condition-editor,
body.theme-dark .robot-editor-dialog label,
body.theme-dark .robot-editor-dialog input:not([type="checkbox"]):not([type="color"]),
body.theme-dark .robot-editor-dialog textarea,
body.theme-dark .robot-editor-dialog .robot-select-trigger{
  background:var(--panel)!important;
}
.robot-editor-dialog>header h2{color:var(--ink)!important}
.robot-editor-dialog .robot-condition-editor header{flex-wrap:nowrap!important;gap:12px!important;overflow:visible!important}
.robot-editor-dialog .robot-condition-editor header>div{flex:1 1 auto!important;min-width:0!important;max-width:calc(100% - 170px)!important;overflow:hidden!important}
.robot-editor-dialog .robot-condition-editor header small{display:block!important;color:var(--muted)!important;min-width:0!important;max-width:100%!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
#robotConditionAdd{flex:0 0 auto!important;max-width:170px!important}
.robot-editor-dialog .robot-condition-empty{color:var(--muted)!important}
.robot-editor-dialog header button:hover,
.robot-editor-dialog header button:focus-visible{transform:none!important;background:#e3e7e0!important}

/* v118-robot-editor-compact: tighter vertical rhythm, no hover transforms on controls */
.robot-editor-dialog{padding:18px 20px!important}
.robot-editor-dialog>header{padding-bottom:12px!important;margin-bottom:12px!important}
.robot-editor-dialog>form>label{margin-bottom:10px!important;color:#48544e!important}
.robot-editor-dialog input:not([type="checkbox"]):not([type="color"]),
.robot-editor-dialog textarea{height:38px!important;padding:0 11px!important;margin-top:5px!important}
.robot-editor-dialog textarea{height:auto!important;min-height:70px!important;padding:10px 11px!important}
.robot-editor-dialog .robot-editor-switch{height:40px!important;padding:8px 12px!important;margin-bottom:10px!important}
.robot-editor-dialog .robot-editor-check{height:36px!important;margin-bottom:10px!important}
.robot-editor-dialog .robot-editor-grid{gap:10px!important;margin-bottom:10px!important}
.robot-editor-dialog .robot-editor-grid.robot-field-action{grid-template-columns:1fr 1fr!important}
.robot-editor-dialog .robot-condition-editor header{align-items:center!important;margin-bottom:8px!important}
.robot-condition-row{margin-bottom:6px!important;align-items:center!important}
.robot-condition-row [data-condition-remove]:hover,
.robot-condition-row [data-condition-remove]:focus-visible{transform:none!important;background:#fbeeec!important;color:#a8443c!important}
#robotConditionAdd{
  display:inline-flex!important;align-items:center!important;gap:6px!important;
  flex:0 0 auto!important;width:auto!important;min-width:auto!important;max-width:170px!important;
  height:32px!important;padding:0 12px!important;border:1px dashed var(--line)!important;border-radius:8px!important;
  background:transparent!important;color:var(--muted)!important;font:600 12px/1 Manrope!important;
  cursor:pointer!important;white-space:nowrap!important;
}
#robotConditionAdd:hover,
#robotConditionAdd:focus-visible{border-color:var(--green)!important;color:var(--green)!important;background:var(--soft)!important;outline:0!important}
#robotConditionAdd:active{transform:none!important}

/* v118-robot-custom-select: keyboard-accessible popover inside editor */
.robot-select-wrap{position:relative;display:block;width:100%}
.robot-select-native{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important;opacity:0!important;pointer-events:none!important}
.robot-select-trigger{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  width:100%;min-height:38px;padding:6px 11px;border:1px solid var(--line);border-radius:8px;
  background:var(--panel);color:var(--ink);font:500 13px/1.3 Manrope;text-align:left;cursor:pointer;
}
.robot-select-trigger:hover,
.robot-select-trigger:focus-visible{border-color:var(--green);outline:0}
.robot-select-trigger[aria-expanded="true"]{border-color:var(--green);box-shadow:0 0 0 3px rgba(23,91,69,.08)}
.robot-select-trigger::after{content:"";color:var(--muted);pointer-events:none}
.robot-select-trigger .robot-select-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.robot-select-popover{
  position:fixed;z-index:80;min-width:120px;max-width:min(320px,calc(100vw - 24px));max-height:260px;overflow:auto;
  background:rgba(255,255,255,.88);border:1px solid rgba(60,86,73,.22);border-radius:12px;
  box-shadow:0 18px 50px rgba(19,44,32,.16),inset 0 1px 0 rgba(255,255,255,.55);
  backdrop-filter:blur(16px) saturate(1.25);-webkit-backdrop-filter:blur(16px) saturate(1.25);
  padding:6px 0;
}
.robot-select-option{
  display:flex;align-items:center;gap:8px;border:0;background:transparent;padding:8px 14px;
  color:var(--ink);font:500 13px Manrope;text-align:left;cursor:pointer;border-radius:6px;margin:0 6px;width:calc(100% - 12px);
}
.robot-select-option:hover,
.robot-select-option:focus-visible,
.robot-select-option-active{background:rgba(23,91,69,.08);outline:0}
.robot-select-option[aria-selected="true"]{color:var(--green);font-weight:600}
.robot-select-option[aria-selected="true"]::before{content:"✓";margin-right:2px}
body.theme-dark .robot-select-popover{background:rgba(25,35,30,.9);border-color:rgba(255,255,255,.12);box-shadow:0 18px 50px rgba(0,0,0,.35),inset 0 1px 0 rgba(255,255,255,.08)}
body.theme-dark .robot-select-option:hover,
body.theme-dark .robot-select-option:focus-visible,
body.theme-dark .robot-select-option-active{background:rgba(255,255,255,.10)!important}

/* v119-robot-editor-contrast: dark labels read against opaque panel, no white patches */
body.theme-dark .robot-editor-dialog>form>label{color:var(--ink)!important}
body.theme-dark .robot-editor-dialog>header .eyebrow,
body.theme-dark .robot-editor-dialog>header small,
body.theme-dark .robot-editor-dialog .robot-condition-editor header small,
body.theme-dark .robot-editor-dialog .robot-condition-empty,
body.theme-dark .robot-editor-dialog .robot-editor-hint,
body.theme-dark .robot-editor-dialog .robot-editor-switch small{color:#c3d0c9!important}
.robot-editor-hint{margin:0 0 12px;background:transparent;color:var(--muted);font-size:12px;line-height:1.5}
.robot-variable-list{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
.robot-variable-list button{border:1px solid var(--line);border-radius:999px;background:var(--soft);color:var(--ink);padding:5px 11px;font:600 11px/1.3 Manrope;cursor:pointer}
.robot-variable-list button:hover{background:var(--line)}
body.theme-dark .robot-variable-list button{background:#33423b!important;border-color:#3a4b43!important;color:#e9f2ed!important}

/* v120-messenger-package-a: real name search, deal link, real avito chat action */
.orbito-chat-list-item[hidden]{display:none!important}
.orbito-chat-search-empty{margin:0;padding:18px;color:#9db2a9;font-size:13px;text-align:center}
.orbito-chat-pane>header{display:flex;align-items:center;justify-content:space-between;gap:16px}
.orbito-chat-header-main{min-width:0}
.orbito-chat-header-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}
.orbito-chat-deal-name{display:block;max-width:100%;padding:0;border:0;background:transparent;color:inherit;font:700 14px Manrope;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.orbito-chat-deal-name::after{content:" →";color:#75d3ad}
.orbito-chat-deal-name:hover,.orbito-chat-deal-name:focus-visible{color:#75d3ad;text-decoration:underline;text-underline-offset:3px}
.orbito-chat-open-deal,.orbito-chat-open-avito{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 14px;border:1px solid rgba(177,230,209,.25);border-radius:10px;background:rgba(23,52,42,.72);color:#eaf6f0;font:600 12px Manrope;text-decoration:none;cursor:pointer}
.orbito-chat-open-avito:hover,.orbito-chat-open-deal:hover{background:rgba(74,187,142,.22)}
.orbito-chat-no-url{display:inline-flex;align-items:center;height:34px;padding:0 14px;border:1px solid rgba(177,230,209,.18);border-radius:10px;background:rgba(15,35,28,.9);color:#8ba89c;font-size:12px}
.orbito-chat-pane>footer textarea:disabled{cursor:not-allowed;opacity:.72}
.orbito-chat-pane>footer button:disabled{cursor:not-allowed;filter:saturate(.25);opacity:.42}

@media(max-width:720px){
  .orbito-chat-pane>header{align-items:flex-start;flex-direction:column}
  .orbito-chat-header-actions{width:100%}
  .robot-editor-dialog{padding:14px!important}
  .robot-editor-dialog .robot-editor-grid{grid-template-columns:1fr 1fr!important}
  .robot-select-popover{max-width:calc(100vw - 24px)}
}

/* v121-robot-editor-compact-contract: compact desktop form with aligned controls */
.robot-editor-dialog{
  width:min(760px,calc(100vw - 32px))!important;
  max-width:760px!important;
  max-height:calc(100vh - 32px)!important;
  padding:14px 18px!important;
  box-sizing:border-box!important;
}
.robot-editor-dialog>header{padding-bottom:8px!important;margin-bottom:8px!important}
.robot-editor-dialog h2{font-size:21px!important;margin:2px 0!important}
.robot-editor-dialog>form>label{margin-bottom:7px!important}
.robot-editor-dialog .robot-editor-grid{gap:8px!important;margin-bottom:7px!important;align-items:end!important}
.robot-editor-dialog .robot-editor-grid>label{min-width:0!important;margin:0!important}
.robot-editor-dialog .robot-editor-pair{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}
.robot-editor-dialog .robot-schedule-grid{
  grid-template-columns:minmax(150px,1.35fr) minmax(72px,.55fr) minmax(92px,.7fr) minmax(160px,1.35fr)!important;
}
.robot-editor-dialog input:not([type="checkbox"]):not([type="color"]),
.robot-editor-dialog .robot-select-trigger{
  width:100%!important;height:38px!important;min-height:38px!important;
  margin-top:5px!important;padding:0 11px!important;box-sizing:border-box!important;
}
.robot-editor-dialog .robot-editor-switch{height:38px!important;margin-bottom:7px!important}
.robot-editor-dialog .robot-editor-check{height:28px!important;margin-bottom:7px!important}
.robot-editor-dialog .robot-condition-editor{padding:9px 11px!important;margin-bottom:7px!important}
.robot-editor-dialog .robot-condition-editor header{margin-bottom:5px!important}
.robot-editor-dialog textarea{min-height:54px!important;max-height:86px!important}
.robot-editor-dialog .robot-variable-list{gap:5px!important;margin:0 0 7px!important}
.robot-editor-dialog .robot-variable-list button{padding:4px 8px!important}
.robot-editor-dialog .robot-editor-hint{margin:0 0 8px!important;padding:7px 10px!important;line-height:1.4!important}
.robot-editor-dialog footer{gap:8px!important}
.robot-editor-dialog footer button{min-height:36px!important}

@media(max-width:720px){
  .robot-editor-dialog{width:calc(100vw - 24px)!important;max-height:calc(100vh - 24px)!important;padding:12px!important}
  .robot-editor-dialog .robot-editor-pair,
  .robot-editor-dialog .robot-editor-grid.robot-field-action{grid-template-columns:1fr!important}
  .robot-editor-dialog .robot-schedule-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}
  .robot-editor-dialog .robot-condition-row{grid-template-columns:52px minmax(0,1fr) minmax(0,1fr) 32px!important}
}

/* v122-robot-editor-fit: keep the complete desktop editor visible without vertical wandering */
.robot-editor-dialog .robot-editor-data-grid{
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr)!important;
}
.robot-editor-dialog .robot-editor-lower-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:8px!important;
  align-items:stretch!important;
  margin-bottom:6px!important;
}
.robot-editor-dialog .robot-editor-lower-grid .robot-condition-editor,
.robot-editor-dialog .robot-editor-lower-grid .robot-editor-message{
  min-width:0!important;
  margin:0!important;
}
.robot-editor-dialog .robot-editor-lower-grid .robot-condition-editor{
  min-height:74px!important;
}
.robot-editor-dialog .robot-editor-message textarea{
  min-height:64px!important;
  max-height:240px!important;
}
.robot-editor-dialog .robot-variable-list{
  flex-wrap:nowrap!important;
  overflow-x:auto!important;
  scrollbar-width:thin;
  padding-bottom:2px!important;
}
.robot-editor-dialog .robot-variable-list button{
  flex:0 0 auto!important;
  white-space:nowrap!important;
}
.robot-editor-dialog .robot-editor-hint{
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  padding-block:5px!important;
}
@media(max-width:720px){
  .robot-editor-dialog .robot-editor-data-grid,
  .robot-editor-dialog .robot-editor-lower-grid{grid-template-columns:1fr!important}
  .robot-editor-dialog .robot-variable-list{flex-wrap:wrap!important;overflow-x:visible!important}
  .robot-editor-dialog .robot-editor-hint{white-space:normal!important}
}

/* v123-full-cell-focus: inline inputs highlight the complete field cell, exactly
   like a field with the shared calendar opened. */
#drawerBody .deal-view-layout-row:has(>.editable-deal-field.editing){
  z-index:5!important;
  border-radius:12px!important;
  background:color-mix(in srgb,var(--green) 7%,transparent)!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--green) 16%,transparent)!important;
}
.deal-drawer .deal-view-layout-row>.editable-deal-field.editing{
  background:transparent!important;
  box-shadow:none!important;
}
body.theme-dark #drawerBody .deal-view-layout-row:has(>.editable-deal-field.editing){
  background:color-mix(in srgb,#60d4a4 9%,#1d2a24)!important;
  box-shadow:inset 0 0 0 1px rgba(96,212,164,.18)!important;
}

/* v123-action-aware-robot-editor: Bitrix-like compact composition without
   controls that do not apply to the selected action. */
.robot-editor-dialog{width:min(720px,calc(100vw - 32px))!important;max-width:720px!important}
.robot-editor-dialog>header{align-items:center!important}
.robot-editor-header-actions{display:flex;align-items:center;gap:10px;flex:0 0 auto}
.robot-editor-active-compact,
.robot-editor-dialog .robot-editor-check{
  display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;
  min-height:32px!important;margin:0!important;padding:4px 8px!important;border:1px solid var(--line)!important;
  border-radius:999px!important;background:color-mix(in srgb,var(--panel) 88%,var(--green) 12%)!important;
  color:var(--ink)!important;font:650 10px/1 Manrope!important;cursor:pointer!important;
}
.robot-editor-active-compact input,
.robot-editor-dialog .robot-editor-check input{
  appearance:none!important;-webkit-appearance:none!important;position:relative!important;
  width:32px!important;height:18px!important;margin:0!important;border:1px solid var(--line)!important;
  border-radius:999px!important;background:var(--soft)!important;cursor:pointer!important;transition:.16s ease!important;
}
.robot-editor-active-compact input::after,
.robot-editor-dialog .robot-editor-check input::after{
  content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;
  background:var(--muted);transition:transform .16s ease,background .16s ease;
}
.robot-editor-active-compact input:checked,
.robot-editor-dialog .robot-editor-check input:checked{border-color:var(--green)!important;background:color-mix(in srgb,var(--green) 28%,transparent)!important}
.robot-editor-active-compact input:checked::after,
.robot-editor-dialog .robot-editor-check input:checked::after{transform:translateX(14px);background:var(--green)}
.robot-editor-active-compact input:focus-visible,
.robot-editor-dialog .robot-editor-check input:focus-visible{outline:0;box-shadow:0 0 0 3px color-mix(in srgb,var(--green) 18%,transparent)!important}
.robot-editor-dialog .robot-editor-check{width:max-content!important;margin-bottom:7px!important;padding-left:11px!important}
.robot-editor-dialog [data-robot-action-field][hidden]{display:none!important}
.robot-editor-dialog .robot-editor-data-grid{
  grid-template-columns:repeat(var(--robot-editor-data-count,2),minmax(0,1fr))!important;
}
.robot-editor-dialog .robot-editor-lower-grid.message-hidden{grid-template-columns:minmax(0,1fr)!important}
.robot-editor-dialog .robot-editor-lower-grid.message-hidden .robot-condition-editor{min-height:64px!important}
body.theme-dark .robot-editor-active-compact,
body.theme-dark .robot-editor-dialog .robot-editor-check{background:rgba(96,212,164,.07)!important;border-color:#3a4b43!important;color:#e9f2ed!important}
@media(max-width:720px){
  .robot-editor-dialog{width:calc(100vw - 24px)!important;max-width:none!important}
  .robot-editor-dialog>header{align-items:flex-start!important}
  .robot-editor-header-actions{gap:6px}
  .robot-editor-active-compact{padding-inline:7px!important}
  .robot-editor-dialog .robot-editor-data-grid{grid-template-columns:1fr!important}
}

/* v125-messenger-theme-sync: the contact-center follows the CRM theme while
   retaining the same translucent visual contract in both modes. */
.orbito-messenger-workspace{
  --messenger-page:rgba(240,246,242,.94);
  --messenger-page-accent:rgba(57,173,126,.15);
  --messenger-panel:rgba(255,255,255,.66);
  --messenger-panel-strong:rgba(246,250,247,.84);
  --messenger-field:rgba(255,255,255,.72);
  --messenger-line:rgba(38,84,64,.16);
  --messenger-text:#17251f;
  --messenger-muted:#687970;
  --messenger-accent:#217a59;
  --messenger-selected:rgba(52,167,120,.14);
  background:
    radial-gradient(circle at 85% 8%,var(--messenger-page-accent),transparent 30%),
    linear-gradient(145deg,var(--messenger-page),rgba(229,239,233,.96))!important;
  color:var(--messenger-text)!important;
}
body.theme-dark .orbito-messenger-workspace{
  --messenger-page:rgba(7,19,14,.96);
  --messenger-page-accent:rgba(95,215,166,.12);
  --messenger-panel:rgba(10,27,20,.72);
  --messenger-panel-strong:rgba(15,35,28,.88);
  --messenger-field:rgba(10,29,22,.82);
  --messenger-line:rgba(182,236,214,.18);
  --messenger-text:#edf8f2;
  --messenger-muted:#93aaa0;
  --messenger-accent:#75d3ad;
  --messenger-selected:rgba(78,186,142,.16);
}
.orbito-messenger-layout{
  border-color:var(--messenger-line)!important;
  background:var(--messenger-panel)!important;
  backdrop-filter:blur(22px) saturate(1.2);
  -webkit-backdrop-filter:blur(22px) saturate(1.2);
}
.orbito-chat-list{
  border-color:var(--messenger-line)!important;
  background:var(--messenger-panel)!important;
}
.orbito-chat-list>label,
.orbito-chat-pane>header,
.orbito-chat-pane>footer{
  border-color:var(--messenger-line)!important;
  background:var(--messenger-panel-strong)!important;
  color:var(--messenger-text)!important;
  backdrop-filter:blur(18px) saturate(1.15);
  -webkit-backdrop-filter:blur(18px) saturate(1.15);
}
.orbito-chat-list input,
.orbito-chat-pane textarea{
  border-color:var(--messenger-line)!important;
  background:var(--messenger-field)!important;
  color:var(--messenger-text)!important;
}
.orbito-chat-list>label span,
.orbito-chat-list-item small,
.orbito-chat-pane>header small,
.orbito-chat-empty-state p,
.orbito-chat-empty-state small,
.orbito-chat-search-empty,
.orbito-chat-list-empty{
  color:var(--messenger-muted)!important;
}
.orbito-chat-list-item,
.orbito-chat-deal-name{
  color:var(--messenger-text)!important;
}
.orbito-chat-list-item:hover,
.orbito-chat-list-item.active{
  background:var(--messenger-selected)!important;
}
.orbito-chat-body{
  background:
    radial-gradient(circle at 20% 20%,var(--messenger-page-accent),transparent 30%),
    color-mix(in srgb,var(--messenger-panel) 72%,transparent)!important;
}
.orbito-chat-open-avito,
.orbito-chat-open-deal,
.orbito-chat-no-url,
.orbito-channel-tabs button,
.orbito-messenger-close{
  border-color:var(--messenger-line)!important;
  background:var(--messenger-panel-strong)!important;
  color:var(--messenger-text)!important;
}
.orbito-chat-deal-name::after,
.orbito-chat-deal-name:hover,
.orbito-chat-deal-name:focus-visible{
  color:var(--messenger-accent)!important;
}

/* v126-robot-editor-reference: compact glass editor with a collapsed empty
   state and vertical growth only when schedule details or conditions exist. */
.robot-editor-backdrop{
  padding:16px!important;
  background:rgba(5,15,11,.56)!important;
  backdrop-filter:blur(6px) saturate(1.05)!important;
  -webkit-backdrop-filter:blur(6px) saturate(1.05)!important;
}
.robot-editor-dialog,
body.theme-dark .robot-editor-dialog{
  width:min(640px,calc(100vw - 32px))!important;
  max-width:640px!important;
  max-height:calc(100dvh - 32px)!important;
  overflow:auto!important;
  padding:16px 20px!important;
  border:1px solid rgba(183,229,207,.32)!important;
  border-radius:18px!important;
  background:linear-gradient(145deg,rgba(31,51,42,.78),rgba(12,29,22,.70))!important;
  box-shadow:0 28px 80px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.12)!important;
  backdrop-filter:blur(24px) saturate(1.3)!important;
  -webkit-backdrop-filter:blur(24px) saturate(1.3)!important;
  color:#edf7f1!important;
}
body:not(.theme-dark) .robot-editor-dialog{
  border-color:rgba(46,105,78,.22)!important;
  background:linear-gradient(145deg,rgba(247,252,249,.82),rgba(227,239,232,.74))!important;
  box-shadow:0 28px 80px rgba(24,61,44,.22),inset 0 1px 0 rgba(255,255,255,.78)!important;
  color:#183027!important;
}
.robot-editor-dialog>header,
body.theme-dark .robot-editor-dialog>header{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:14px!important;
  margin:0 0 14px!important;
  padding:0 0 12px!important;
  border-bottom:1px solid rgba(181,225,205,.18)!important;
  background:transparent!important;
}
.robot-editor-heading{display:flex;align-items:baseline;gap:10px;min-width:0}
.robot-editor-dialog .robot-editor-heading h2{
  margin:0!important;
  color:inherit!important;
  font:650 20px/1.2 Onest!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.robot-editor-dialog .robot-editor-heading small{
  margin:0!important;
  color:rgba(221,238,229,.72)!important;
  font:500 11px/1.2 Manrope!important;
  white-space:nowrap;
}
body:not(.theme-dark) .robot-editor-dialog .robot-editor-heading small{color:#61786d!important}
.robot-editor-header-actions{gap:8px!important}
.robot-editor-dialog>header #robotEditorClose{
  width:32px!important;
  height:32px!important;
  border:1px solid rgba(181,225,205,.22)!important;
  border-radius:50%!important;
  background:rgba(255,255,255,.05)!important;
  color:inherit!important;
  line-height:1!important;
}
.robot-editor-dialog>header #robotEditorClose:hover,
.robot-editor-dialog>header #robotEditorClose:focus-visible{
  background:rgba(105,211,165,.14)!important;
  outline:0!important;
}
.robot-editor-dialog form{display:grid;gap:10px}
.robot-editor-dialog .robot-editor-grid,
.robot-editor-dialog label,
.robot-editor-dialog .robot-condition-editor,
.robot-editor-dialog footer,
body.theme-dark .robot-editor-dialog .robot-editor-grid,
body.theme-dark .robot-editor-dialog label,
body.theme-dark .robot-editor-dialog .robot-condition-editor,
body.theme-dark .robot-editor-dialog footer{
  background:transparent!important;
}
.robot-editor-dialog label{
  margin:0!important;
  color:rgba(221,238,229,.78)!important;
  font:650 10px/1.25 Manrope!important;
}
body:not(.theme-dark) .robot-editor-dialog label{color:#526a5f!important}
.robot-editor-dialog .robot-editor-title-action{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:12px!important;
  margin:0!important;
}
.robot-editor-runtime{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:10px 12px;
  padding-top:10px;
  border-top:1px solid rgba(181,225,205,.16);
}
.robot-editor-runtime>.robot-editor-grid{
  display:contents!important;
  margin:0!important;
}
.robot-editor-runtime label{min-width:0!important}
.robot-editor-runtime .robot-schedule-when{grid-column:span 3}
.robot-editor-runtime .robot-schedule-value{grid-column:span 1}
.robot-editor-runtime .robot-schedule-unit{grid-column:span 2}
.robot-editor-runtime .robot-schedule-basis{grid-column:span 2}
.robot-editor-runtime .robot-editor-data-grid>label{grid-column:span 3}
.robot-editor-runtime.is-before .robot-schedule-when{grid-column:span 2}
.robot-editor-dialog [hidden]{display:none!important}
.robot-editor-dialog input:not([type="checkbox"]):not([type="color"]),
.robot-editor-dialog textarea,
.robot-editor-dialog .robot-select-trigger,
body.theme-dark .robot-editor-dialog input:not([type="checkbox"]):not([type="color"]),
body.theme-dark .robot-editor-dialog textarea,
body.theme-dark .robot-editor-dialog .robot-select-trigger{
  width:100%!important;
  height:42px!important;
  min-height:42px!important;
  margin-top:5px!important;
  padding:0 12px!important;
  border:1px solid rgba(181,225,205,.22)!important;
  border-radius:9px!important;
  background:rgba(7,24,17,.28)!important;
  color:#edf7f1!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04)!important;
}
body:not(.theme-dark) .robot-editor-dialog input:not([type="checkbox"]):not([type="color"]),
body:not(.theme-dark) .robot-editor-dialog textarea,
body:not(.theme-dark) .robot-editor-dialog .robot-select-trigger{
  border-color:rgba(50,96,75,.22)!important;
  background:rgba(255,255,255,.42)!important;
  color:#183027!important;
}
.robot-editor-dialog input:not([type="checkbox"]):focus,
.robot-editor-dialog textarea:focus,
.robot-editor-dialog .robot-select-trigger:focus-visible,
.robot-editor-dialog .robot-select-trigger[aria-expanded="true"]{
  border-color:#62d5a3!important;
  box-shadow:0 0 0 3px rgba(98,213,163,.14),inset 0 1px 0 rgba(255,255,255,.08)!important;
  outline:0!important;
}
.robot-editor-active-compact,
.robot-editor-dialog .robot-editor-check,
body.theme-dark .robot-editor-active-compact,
body.theme-dark .robot-editor-dialog .robot-editor-check{
  border-color:rgba(181,225,205,.18)!important;
  background:rgba(7,24,17,.20)!important;
  color:inherit!important;
}
.robot-editor-dialog .robot-editor-check{
  width:100%!important;
  min-height:38px!important;
  padding:6px 10px!important;
  border-radius:9px!important;
  box-sizing:border-box!important;
}
.robot-editor-dialog .robot-editor-lower-grid,
.robot-editor-dialog .robot-editor-lower-grid.message-hidden{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:10px!important;
  margin:0!important;
}
.robot-editor-dialog .robot-editor-lower-grid.message-hidden{grid-template-columns:minmax(0,1fr)!important}
.robot-editor-dialog .robot-condition-editor{
  min-height:0!important;
  margin:0!important;
  padding:10px 12px!important;
  border:1px solid rgba(181,225,205,.20)!important;
  border-radius:10px!important;
}
.robot-editor-dialog .robot-condition-editor>header{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  margin:0!important;
}
.robot-editor-dialog .robot-condition-editor>header>div{
  max-width:none!important;
  overflow:visible!important;
}
.robot-editor-dialog .robot-condition-editor>header strong{color:inherit!important;font-size:12px!important}
.robot-editor-dialog .robot-condition-editor>header small{
  margin-top:3px!important;
  color:rgba(221,238,229,.56)!important;
  font-size:9px!important;
}
body:not(.theme-dark) .robot-editor-dialog .robot-condition-editor>header small{color:#71857b!important}
.robot-editor-dialog .robot-condition-empty{
  margin:8px 0 0!important;
  color:rgba(221,238,229,.66)!important;
  font-size:10px!important;
}
body:not(.theme-dark) .robot-editor-dialog .robot-condition-empty{color:#667b70!important}
.robot-editor-dialog .robot-condition-editor.has-conditions #robotConditionList{margin-top:8px}
.robot-editor-dialog .robot-condition-row{
  grid-template-columns:52px minmax(0,1.25fr) minmax(0,1fr) minmax(0,1fr) 30px!important;
  gap:6px!important;
  margin:6px 0 0!important;
}
.robot-editor-dialog .robot-condition-row .robot-select-trigger,
.robot-editor-dialog .robot-condition-row input{height:34px!important;min-height:34px!important;margin:0!important;padding-inline:8px!important}
.robot-editor-dialog .robot-editor-message textarea{height:auto;min-height:76px!important;max-height:240px!important;resize:vertical!important;overflow-y:auto!important;padding:10px 12px!important}
.robot-editor-dialog .robot-variable-list{margin:0!important;padding:0!important}
.robot-editor-dialog .robot-editor-hint{display:none!important}
.robot-editor-dialog>form>footer{
  display:flex!important;
  justify-content:flex-end!important;
  gap:10px!important;
  margin-top:2px!important;
  padding-top:12px!important;
  border-top:1px solid rgba(181,225,205,.16)!important;
}
.robot-editor-dialog>form>footer button{min-width:118px!important;min-height:38px!important}

@media(max-width:720px){
  .robot-editor-dialog,
  body.theme-dark .robot-editor-dialog{
    width:calc(100vw - 20px)!important;
    max-height:calc(100dvh - 20px)!important;
    padding:14px!important;
  }
  .robot-editor-heading{display:block}
  .robot-editor-dialog .robot-editor-heading small{margin-top:3px!important}
  .robot-editor-dialog .robot-editor-title-action{grid-template-columns:1fr!important}
  .robot-editor-runtime{grid-template-columns:repeat(2,minmax(0,1fr))}
  .robot-editor-runtime .robot-schedule-when,
  .robot-editor-runtime.is-before .robot-schedule-when,
  .robot-editor-runtime .robot-schedule-basis,
  .robot-editor-runtime .robot-editor-data-grid>label{grid-column:1/-1}
  .robot-editor-runtime .robot-schedule-value,
  .robot-editor-runtime .robot-schedule-unit{grid-column:span 1}
  .robot-editor-dialog .robot-editor-lower-grid{grid-template-columns:1fr!important}
  .robot-editor-dialog .robot-condition-row{grid-template-columns:46px minmax(0,1fr) minmax(0,1fr) 30px!important}
  .robot-editor-dialog .robot-condition-row [data-condition-value]{grid-column:2/4}
}

/* v127-robot-editor-polish: one measured visual contract for every editor
   control, a real CSS chevron, and the same switch inside and outside cards. */
.robot-card-status,
.robot-card-status.on,
.robot-card.disabled .robot-card-status{
  position:relative!important;
  display:inline-block!important;
  flex:0 0 34px!important;
  width:34px!important;
  height:20px!important;
  max-width:none!important;
  padding:0!important;
  overflow:visible!important;
  border:1px solid rgba(67,101,85,.32)!important;
  border-radius:999px!important;
  background:rgba(92,111,102,.20)!important;
  color:transparent!important;
  opacity:1!important;
  box-shadow:inset 0 1px 2px rgba(0,0,0,.10)!important;
  transition:border-color .16s ease,background .16s ease,box-shadow .16s ease!important;
}
.robot-card-status::after{
  content:"";
  position:absolute;
  top:2px;
  left:2px;
  width:14px;
  height:14px;
  border-radius:50%;
  background:#7d8c84;
  box-shadow:0 1px 3px rgba(0,0,0,.22);
  transition:transform .16s ease,background .16s ease;
}
.robot-card-status.on{
  border-color:rgba(52,153,108,.58)!important;
  background:rgba(74,190,139,.26)!important;
}
.robot-card-status.on::after{transform:translateX(14px);background:#43bd87}
.robot-card-status:hover{filter:none!important;border-color:#53bd8d!important}
.robot-card-status:focus-visible{outline:0!important;box-shadow:0 0 0 3px rgba(83,189,141,.18)!important}
.robot-card-status-label{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}
body.theme-dark .robot-card-status,
body.theme-dark .robot-card.disabled .robot-card-status{border-color:rgba(190,224,208,.24)!important;background:rgba(216,233,224,.10)!important}
body.theme-dark .robot-card-status.on{border-color:rgba(84,211,154,.56)!important;background:rgba(55,186,128,.25)!important}

.robot-editor-dialog{
  --robot-control-height:44px;
  --robot-control-radius:10px;
  --robot-control-font:14px;
  --robot-label-font:11px;
  --robot-control-pad:13px;
}
.robot-editor-dialog form{gap:12px!important}
.robot-editor-dialog label{
  font:650 var(--robot-label-font)/1.3 Manrope!important;
  letter-spacing:0!important;
}
.robot-editor-dialog .robot-editor-title-action,
.robot-editor-runtime{gap:12px!important}
.robot-editor-dialog input:not([type="checkbox"]):not([type="color"]),
.robot-editor-dialog textarea,
.robot-editor-dialog .robot-select-trigger,
.robot-editor-dialog .robot-condition-row input,
.robot-editor-dialog .robot-condition-row .robot-select-trigger{
  box-sizing:border-box!important;
  width:100%!important;
  height:var(--robot-control-height)!important;
  min-height:var(--robot-control-height)!important;
  margin-top:6px!important;
  padding:0 38px 0 var(--robot-control-pad)!important;
  border-radius:var(--robot-control-radius)!important;
  font:500 var(--robot-control-font)/1.2 Manrope!important;
  letter-spacing:0!important;
}
.robot-editor-dialog input:not([type="checkbox"]):not([type="color"]),
.robot-editor-dialog textarea,
.robot-editor-dialog .robot-condition-row input{padding-right:var(--robot-control-pad)!important}
.robot-editor-dialog .robot-select-trigger{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  text-align:left!important;
}
.robot-editor-dialog .robot-select-trigger::after{
  content:""!important;
  position:absolute!important;
  right:15px!important;
  top:50%!important;
  width:8px!important;
  height:8px!important;
  margin-top:-6px!important;
  border:0!important;
  border-right:1.5px solid currentColor!important;
  border-bottom:1.5px solid currentColor!important;
  opacity:.62!important;
  transform:rotate(45deg)!important;
  transform-origin:center!important;
  transition:transform .14s ease,opacity .14s ease!important;
}
.robot-editor-dialog .robot-select-trigger[aria-expanded="true"]::after{
  margin-top:-2px!important;
  opacity:.9!important;
  transform:rotate(225deg)!important;
}
.robot-editor-dialog .robot-select-trigger:hover::after{opacity:.9!important}
.robot-editor-dialog .robot-condition-editor{
  padding:12px!important;
  border-radius:12px!important;
}
.robot-editor-dialog .robot-condition-editor.has-conditions #robotConditionList{margin-top:10px!important}
.robot-editor-dialog .robot-condition-row{
  display:grid!important;
  grid-template-columns:74px minmax(150px,1.35fr) minmax(132px,1fr) minmax(130px,1fr) 40px!important;
  align-items:center!important;
  gap:8px!important;
  margin:8px 0 0!important;
}
.robot-editor-dialog .robot-condition-row .robot-select-trigger,
.robot-editor-dialog .robot-condition-row input{margin:0!important}
.robot-editor-dialog .robot-condition-row [data-condition-remove]{
  width:40px!important;
  height:var(--robot-control-height)!important;
  border:1px solid rgba(180,92,92,.20)!important;
  border-radius:var(--robot-control-radius)!important;
  background:rgba(181,78,78,.10)!important;
  color:#a65b58!important;
  font:400 20px/1 Manrope!important;
}
.robot-editor-dialog .robot-condition-row [data-condition-remove]:hover,
.robot-editor-dialog .robot-condition-row [data-condition-remove]:focus-visible{
  background:rgba(181,78,78,.18)!important;
  color:#91433f!important;
  outline:0!important;
  box-shadow:0 0 0 3px rgba(181,78,78,.10)!important;
}
#robotConditionAdd{
  min-height:38px!important;
  padding:0 13px!important;
  border:1px dashed rgba(64,153,112,.48)!important;
  border-radius:9px!important;
  background:rgba(60,178,125,.08)!important;
  color:var(--green)!important;
  font:650 12px/1 Manrope!important;
}
.robot-editor-dialog .robot-editor-check{
  min-height:44px!important;
  padding:7px 12px!important;
  border-radius:10px!important;
  font-size:12px!important;
}
.robot-editor-dialog .robot-editor-message textarea{
  height:auto;
  min-height:88px!important;
  max-height:240px!important;
  resize:vertical!important;
  overflow-y:auto!important;
  padding:12px var(--robot-control-pad)!important;
  line-height:1.45!important;
}
.robot-editor-dialog>form>footer button{
  min-width:126px!important;
  height:42px!important;
  min-height:42px!important;
  border-radius:10px!important;
  font-size:13px!important;
}
.robot-select-popover{
  padding:6px!important;
  border-radius:12px!important;
  background:rgba(241,248,244,.82)!important;
  border-color:rgba(59,103,81,.22)!important;
  box-shadow:0 20px 54px rgba(22,52,38,.22),inset 0 1px 0 rgba(255,255,255,.72)!important;
  backdrop-filter:blur(22px) saturate(1.25)!important;
  -webkit-backdrop-filter:blur(22px) saturate(1.25)!important;
}
.robot-select-option{
  min-height:40px!important;
  padding:9px 11px!important;
  border-radius:8px!important;
  color:#20352b!important;
  font:500 13px/1.25 Manrope!important;
}
.robot-select-option:hover,
.robot-select-option:focus-visible,
.robot-select-option-active{background:rgba(55,166,117,.12)!important}
body.theme-dark .robot-select-popover{
  background:rgba(15,31,24,.84)!important;
  border-color:rgba(185,229,208,.18)!important;
  box-shadow:0 22px 58px rgba(0,0,0,.42),inset 0 1px 0 rgba(255,255,255,.09)!important;
}
body.theme-dark .robot-select-option{color:#edf7f1!important}

@media(max-width:720px){
  .robot-editor-dialog .robot-condition-row{
    grid-template-columns:68px minmax(0,1fr) 40px!important;
  }
  .robot-editor-dialog .robot-condition-row [data-condition-field],
  .robot-editor-dialog .robot-condition-row [data-condition-operator],
  .robot-editor-dialog .robot-condition-row [data-condition-value]{grid-column:span 1!important}
  .robot-editor-dialog .robot-condition-row .robot-select-wrap:nth-of-type(2){grid-column:2/3!important}
  .robot-editor-dialog .robot-condition-row .robot-select-wrap:nth-of-type(3){grid-column:1/3!important}
  .robot-editor-dialog .robot-condition-row [data-condition-value]{grid-column:1/3!important}
  .robot-editor-dialog .robot-condition-row [data-condition-remove]{grid-column:3;grid-row:1}
}

/* v128-robot-design-system: align the editor with the CRM's established
   Manrope control typography and keep every repeated control proportional. */
:root{
  --crm-ui-font:Manrope,Arial,sans-serif;
  --crm-control-font-size:13px;
  --crm-label-font-size:10px;
  --crm-control-height:40px;
  --crm-control-radius:9px;
}
.robot-editor-dialog{
  --robot-control-height:var(--crm-control-height);
  --robot-control-radius:var(--crm-control-radius);
  --robot-control-font:var(--crm-control-font-size);
  --robot-label-font:var(--crm-label-font-size);
}
.robot-editor-dialog form,
.robot-editor-dialog input,
.robot-editor-dialog textarea,
.robot-editor-dialog button,
.robot-select-popover{font-family:var(--crm-ui-font)!important}
.robot-editor-dialog label{
  font-family:var(--crm-ui-font)!important;
  font-size:var(--crm-label-font-size)!important;
  font-weight:650!important;
  line-height:1.35!important;
}
.robot-editor-dialog input:not([type="checkbox"]):not([type="color"]),
.robot-editor-dialog textarea,
.robot-editor-dialog .robot-select-trigger,
.robot-editor-dialog .robot-condition-row input,
.robot-editor-dialog .robot-condition-row .robot-select-trigger{
  height:var(--crm-control-height)!important;
  min-height:var(--crm-control-height)!important;
  border-radius:var(--crm-control-radius)!important;
  font-family:var(--crm-ui-font)!important;
  font-size:var(--crm-control-font-size)!important;
  font-weight:500!important;
  line-height:1.3!important;
}
.robot-editor-dialog .robot-select-label{
  display:block!important;
  min-width:0!important;
  font:500 var(--crm-control-font-size)/1.3 var(--crm-ui-font)!important;
}
.robot-editor-dialog .robot-editor-heading h2{font:650 20px/1.2 Onest,Manrope,sans-serif!important}
.robot-editor-dialog .robot-editor-heading small,
.robot-editor-dialog .robot-condition-editor>header small,
.robot-editor-dialog .robot-condition-empty{
  font-family:var(--crm-ui-font)!important;
  font-size:10px!important;
  line-height:1.4!important;
}
.robot-editor-dialog .robot-condition-editor>header strong{
  font:650 13px/1.25 var(--crm-ui-font)!important;
}
.robot-editor-dialog .robot-condition-row{
  grid-template-columns:62px minmax(150px,1.35fr) minmax(132px,1fr) minmax(130px,1fr) 32px!important;
  align-items:center!important;
  gap:8px!important;
}
.robot-editor-dialog .robot-condition-row>*{align-self:center!important;min-width:0!important}
.robot-editor-dialog .robot-condition-row .robot-select-trigger,
.robot-editor-dialog .robot-condition-row input{margin:0!important}
.robot-editor-dialog .robot-condition-row [data-condition-remove]{
  position:relative!important;
  align-self:center!important;
  width:32px!important;
  height:32px!important;
  min-height:32px!important;
  padding:0!important;
  border:0!important;
  border-radius:50%!important;
  background:transparent!important;
  color:transparent!important;
  font-size:0!important;
  box-shadow:none!important;
}
.robot-editor-dialog .robot-condition-row [data-condition-remove]::before,
.robot-editor-dialog .robot-condition-row [data-condition-remove]::after{
  content:"";
  position:absolute;
  left:9px;
  top:15px;
  width:14px;
  height:1.5px;
  border-radius:2px;
  background:#9a625f;
}
.robot-editor-dialog .robot-condition-row [data-condition-remove]::before{transform:rotate(45deg)}
.robot-editor-dialog .robot-condition-row [data-condition-remove]::after{transform:rotate(-45deg)}
.robot-editor-dialog .robot-condition-row [data-condition-remove]:hover,
.robot-editor-dialog .robot-condition-row [data-condition-remove]:focus-visible{
  border:0!important;
  background:rgba(167,82,76,.08)!important;
  color:transparent!important;
  box-shadow:none!important;
  outline:0!important;
}
.robot-select-option{
  min-height:38px!important;
  padding:8px 11px!important;
  font:500 var(--crm-control-font-size)/1.3 var(--crm-ui-font)!important;
}
.robot-editor-dialog .robot-select-trigger::after{
  right:14px!important;
  width:7px!important;
  height:7px!important;
  border-width:0 1.5px 1.5px 0!important;
}
.robot-editor-dialog .robot-editor-check{font-size:11px!important}
.robot-editor-dialog>form>footer button{height:40px!important;min-height:40px!important;font:650 12px/1 var(--crm-ui-font)!important}

.robot-card-status,
.robot-card-status.on,
.robot-card.disabled .robot-card-status,
.robot-editor-active-compact input,
.robot-editor-dialog .robot-editor-check input{
  width:30px!important;
  height:18px!important;
  min-width:30px!important;
  min-height:18px!important;
  flex:0 0 30px!important;
}
.robot-card-status,
.robot-card-status.on,
.robot-card.disabled .robot-card-status{max-width:30px!important}
.robot-card-status::after,
.robot-editor-active-compact input::after,
.robot-editor-dialog .robot-editor-check input::after{
  top:2px!important;
  left:2px!important;
  width:12px!important;
  height:12px!important;
}
.robot-card-status.on::after,
.robot-editor-active-compact input:checked::after,
.robot-editor-dialog .robot-editor-check input:checked::after{transform:translateX(12px)!important}

@media(max-width:720px){
  .robot-editor-dialog .robot-condition-row{grid-template-columns:62px minmax(0,1fr) 32px!important}
}

/* v129-robot-visual-qa: dense desktop geometry, collision-free content,
   consistent state emphasis, and anchored iconography. */
.robot-editor-dialog{
  --robot-control-height:36px;
  --robot-control-radius:8px;
  --robot-control-font:13px;
  --robot-label-font:11px;
  padding:14px 18px!important;
}
.robot-editor-dialog>header{
  margin-bottom:10px!important;
  padding-bottom:10px!important;
}
.robot-editor-dialog form{gap:8px!important}
.robot-editor-dialog label{
  font-size:var(--robot-label-font)!important;
  line-height:1.3!important;
}
.robot-editor-dialog .robot-editor-title-action,
.robot-editor-runtime{gap:8px 10px!important}
.robot-editor-runtime{padding-top:8px!important}
.robot-editor-dialog input:not([type="checkbox"]):not([type="color"]),
.robot-editor-dialog textarea,
.robot-editor-dialog .robot-select-trigger,
.robot-editor-dialog .robot-condition-row input,
.robot-editor-dialog .robot-condition-row .robot-select-trigger{
  height:var(--robot-control-height)!important;
  min-height:var(--robot-control-height)!important;
  margin-top:4px!important;
  padding-left:11px!important;
  padding-right:34px!important;
  border-radius:var(--robot-control-radius)!important;
  font-size:var(--robot-control-font)!important;
  line-height:1.25!important;
}
.robot-editor-dialog input:not([type="checkbox"]):not([type="color"]),
.robot-editor-dialog textarea,
.robot-editor-dialog .robot-condition-row input{padding-right:11px!important}
.robot-editor-dialog .robot-select-trigger::after{display:none!important}
.robot-select-chevron{
  display:block;
  flex:0 0 14px;
  width:14px;
  height:14px;
  margin-left:4px;
  color:currentColor;
  opacity:.54;
  pointer-events:none;
}
.robot-editor-dialog .robot-select-trigger{padding-right:8px!important}
.robot-editor-dialog .robot-select-label{flex:1 1 auto!important}
.robot-editor-dialog .robot-condition-row input{margin:0!important}
.robot-editor-dialog .robot-condition-row>.robot-select-wrap:first-child .robot-select-trigger{
  justify-content:center!important;
  padding:0 20px 0 7px!important;
}
.robot-editor-dialog .robot-condition-row>.robot-select-wrap:first-child .robot-select-label{
  flex:0 0 auto!important;
  width:auto!important;
  max-width:24px!important;
  overflow:visible!important;
}
.robot-editor-dialog .robot-condition-row>.robot-select-wrap:first-child .robot-select-chevron{
  position:absolute!important;
  right:5px!important;
  width:12px!important;
  height:12px!important;
  margin:0!important;
}
.robot-editor-dialog .robot-condition-row input:not([type="checkbox"]):not([type="color"]){margin:0!important}
.robot-select-trigger:hover .robot-select-chevron,
.robot-select-trigger:focus-visible .robot-select-chevron,
.robot-select-trigger[aria-expanded="true"] .robot-select-chevron{opacity:.86}
.robot-editor-dialog .robot-editor-check{
  min-height:36px!important;
  padding:5px 10px!important;
  font-size:11px!important;
}
.robot-editor-active-compact span,
.robot-editor-dialog .robot-editor-check span{transition:opacity .15s ease,color .15s ease}
.robot-editor-active-compact:has(input:not(:checked)) span,
.robot-editor-dialog .robot-editor-check:has(input:not(:checked)) span{
  color:var(--muted)!important;
  opacity:.52!important;
}
.robot-editor-active-compact:has(input:not(:checked)),
.robot-editor-dialog .robot-editor-check:has(input:not(:checked)){
  background:rgba(90,108,99,.08)!important;
  border-color:rgba(104,125,115,.16)!important;
}
.robot-editor-dialog .robot-editor-lower-grid,
.robot-editor-dialog .robot-editor-lower-grid.message-hidden{
  grid-template-columns:minmax(0,1fr)!important;
  gap:8px!important;
}
.robot-editor-dialog .robot-condition-editor{
  width:100%!important;
  min-width:0!important;
  padding:9px 10px!important;
  border-radius:10px!important;
}
.robot-editor-dialog .robot-condition-editor>header{gap:10px!important}
.robot-editor-dialog .robot-condition-editor>header strong{font-size:12px!important}
.robot-editor-dialog .robot-condition-editor>header small{
  margin-top:2px!important;
  font-size:9px!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
#robotConditionAdd{
  min-height:32px!important;
  padding:0 11px!important;
  border-radius:8px!important;
  font-size:11px!important;
}
.robot-editor-dialog .robot-condition-editor.has-conditions #robotConditionList{margin-top:6px!important}
.robot-editor-dialog .robot-condition-row{
  grid-template-columns:54px minmax(135px,1.35fr) minmax(118px,1fr) minmax(120px,1fr) 28px!important;
  gap:6px!important;
  margin-top:6px!important;
}
.robot-editor-dialog .robot-condition-row .robot-select-trigger,
.robot-editor-dialog .robot-condition-row input{margin:0!important}
.robot-editor-dialog .robot-condition-row [data-condition-remove]{
  display:grid!important;
  place-items:center!important;
  width:28px!important;
  height:28px!important;
  min-width:28px!important;
  min-height:28px!important;
  margin:0!important;
  padding:0!important;
  color:#9a625f!important;
  background:transparent!important;
  border:0!important;
  border-radius:7px!important;
}
.robot-editor-dialog .robot-condition-row [data-condition-remove]::before,
.robot-editor-dialog .robot-condition-row [data-condition-remove]::after{display:none!important}
.robot-editor-dialog .robot-condition-row [data-condition-remove] svg{
  display:block;
  width:17px;
  height:17px;
  pointer-events:none;
}
.robot-editor-dialog .robot-condition-row [data-condition-remove]:hover,
.robot-editor-dialog .robot-condition-row [data-condition-remove]:focus-visible{
  color:#874a46!important;
  background:rgba(167,82,76,.09)!important;
  outline:0!important;
}
body.theme-dark .robot-editor-dialog .robot-editor-message textarea,
body:not(.theme-dark) .robot-editor-dialog .robot-editor-message textarea,
.robot-editor-dialog .robot-editor-message textarea{
  height:var(--robot-message-height,auto);
  min-height:64px!important;
  max-height:240px!important;
  resize:vertical!important;
  overflow-y:auto!important;
  margin-top:4px!important;
  padding:9px 11px!important;
  line-height:1.4!important;
  scrollbar-width:thin;
}
.robot-editor-dialog .robot-variable-list{gap:5px!important}
.robot-editor-dialog .robot-variable-list button{
  padding:5px 8px!important;
  font-size:9px!important;
  line-height:1.2!important;
}
.robot-editor-dialog>form>footer{
  margin-top:0!important;
  padding-top:9px!important;
}
.robot-editor-dialog>form>footer button{
  height:36px!important;
  min-height:36px!important;
  min-width:112px!important;
  font-size:11px!important;
}

.automation-grid .robot-card,
.drawer-robots .robot-card{overflow:hidden!important}
.robot-card-body,
.robot-card-body>*{max-width:100%!important;min-width:0!important}
.robot-card-body .robot-when{
  width:100%!important;
  margin:0!important;
  overflow:hidden!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
}
.robot-card-body .robot-title strong{
  max-width:100%!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
}
.robot-card-body .robot-recipient b{max-width:100%!important}
.robot-card-body .robot-conditions,
.robot-card-body .robot-off-note{width:100%!important;overflow:hidden!important}
.robot-card-body .robot-conditions em,
.robot-card-body .robot-off-note em{
  width:100%!important;
  max-width:100%!important;
  margin:3px 0 0!important;
  padding:3px 5px!important;
  overflow:hidden!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
}
.robot-card-body .robot-conditions em{
  color:#315a49!important;
  background:rgba(48,117,87,.09)!important;
  border:1px solid rgba(48,117,87,.14)!important;
  border-radius:6px!important;
  font-weight:650!important;
}
body.theme-dark .robot-card-body .robot-conditions em{
  color:#d6e9df!important;
  background:rgba(92,177,136,.12)!important;
  border-color:rgba(134,213,176,.18)!important;
}
.robot-card-body .robot-off-note em{
  color:#865f5f!important;
  background:rgba(156,85,85,.07)!important;
  border:1px solid rgba(156,85,85,.12)!important;
  border-radius:6px!important;
  font-weight:650!important;
}
body.theme-dark .robot-card-body .robot-off-note em{
  color:#ddb5b5!important;
  background:rgba(184,99,99,.11)!important;
  border-color:rgba(221,154,154,.16)!important;
}

@media(max-width:720px){
  .robot-editor-dialog{--robot-control-height:40px;padding:12px!important}
  .robot-editor-dialog .robot-condition-row{
    grid-template-columns:54px minmax(0,1fr) 28px!important;
  }
}

/* v136-local-messenger-kanban-filter: immediate controls and scan-friendly data. */
.pipeline-filter{overflow:visible!important;position:relative;padding:0 4px 0 0!important}
.pipeline-filter>span{flex:0 0 auto;margin-right:2px!important}
.pipeline-filter input{height:100%!important;min-width:0!important}
.pipeline-filter>button{
  flex:0 0 auto;height:30px;padding:0 10px;border:1px solid color-mix(in srgb,var(--green) 20%,var(--line));
  border-radius:7px;background:color-mix(in srgb,var(--panel) 86%,transparent);color:var(--green);
  font:700 9px/1 Manrope;cursor:pointer;
}
.pipeline-filter>button.active{background:color-mix(in srgb,var(--green) 12%,var(--panel));border-color:color-mix(in srgb,var(--green) 42%,var(--line))}
.deal-filter-panel{
  position:relative;z-index:35;width:min(720px,100%);margin:-4px 0 12px;padding:14px;
  border:1px solid var(--liquid-line);border-radius:12px;background:var(--liquid-fill-strong);
  -webkit-backdrop-filter:blur(18px) saturate(135%);backdrop-filter:blur(18px) saturate(135%);
  box-shadow:var(--liquid-shadow);
}
.deal-filter-panel[hidden]{display:none!important}
.deal-filter-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.deal-filter-grid label{min-width:0;color:var(--muted);font:650 9px/1.2 Manrope}
.deal-filter-grid label>span{display:block;margin-bottom:6px}
.deal-filter-grid input,.deal-filter-grid select{
  width:100%;height:36px;padding:0 10px;border:1px solid var(--line);border-radius:8px;
  background:color-mix(in srgb,var(--panel) 88%,transparent);color:var(--ink);font:550 11px/1 Manrope;outline:0;
}
.deal-filter-grid input:focus,.deal-filter-grid select:focus{border-color:var(--green);box-shadow:var(--ring)}
.deal-filter-panel footer{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid var(--line)}
.deal-filter-panel footer>span{margin-right:auto;color:var(--muted);font:600 9px/1.2 Manrope}
.deal-filter-panel footer>button{height:32px;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:transparent;color:var(--ink);font:700 9px/1 Manrope;cursor:pointer}
.deal-filter-panel footer>.primary-button{border:0;background:var(--green);color:#fff}
body.theme-dark .deal-filter-panel{border-color:var(--liquid-line);background:var(--liquid-fill-strong)}
body.theme-dark .deal-filter-grid input,body.theme-dark .deal-filter-grid select{border-color:var(--liquid-line-soft);background:rgba(20,34,28,.68);color:var(--ink)}

.board:not(.list-mode) .lead-meta{
  display:grid!important;grid-template-columns:auto minmax(max-content,1fr)!important;justify-content:start!important;align-items:center!important;
  column-gap:8px!important;white-space:nowrap!important;
}
.board:not(.list-mode) .lead-meta span{width:auto!important;max-width:none!important;overflow:visible!important;text-overflow:clip!important;text-align:left!important}
.board:not(.list-mode) .source{max-width:100%!important;overflow:visible!important;text-overflow:clip!important}
.lead-card.state-unread{border-left-color:#d94d4d!important}
.lead-card.state-unread .lead-flag{background:#d94d4d!important;color:#fff!important}
body.theme-dark .lead-card.state-unread .lead-flag{background:#c74646!important;color:#fff!important}
body.theme-dark .board:not(.list-mode) .lead-card:hover .source{background:#3a4a42!important;color:#e3eee8!important}

.orbito-chat-composer textarea{
  min-height:64px!important;max-height:192px!important;resize:none!important;overflow-y:hidden!important;
  transition:height .12s ease!important;
}
.orbito-chat-attach:not(:disabled){cursor:pointer!important;color:var(--messenger-accent)!important;background:var(--messenger-panel-strong)!important}
.orbito-chat-attach:not(:disabled):hover,.orbito-chat-attach:not(:disabled):focus-visible{border-color:var(--messenger-accent)!important;outline:0!important}

@media(max-width:720px){
  .deal-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .deal-filter-panel footer{flex-wrap:wrap}
  .deal-filter-panel footer>span{width:100%}
  .orbito-chat-composer textarea{min-height:56px!important;max-height:168px!important}
}

/* v134-local-messenger-live-avito: compact inbox, real read/send controls. */
.orbito-messenger-header{
  justify-content:flex-start!important;
  gap:14px!important;
  padding:16px clamp(16px,3vw,34px) 8px!important;
}
.orbito-messenger-header>div{min-width:0}
.orbito-messenger-header h1{font-size:clamp(28px,3vw,40px)!important;line-height:1.05!important}
.orbito-messenger-close{
  order:-1;width:38px!important;height:38px!important;border-radius:10px!important;
  font-size:22px!important;flex:0 0 auto;
}
.orbito-channel-tabs{
  gap:6px!important;padding:0 clamp(68px,6vw,86px) 10px!important;align-items:center!important;
}
.orbito-channel-tabs span{color:var(--messenger-muted);font:600 10px/1 Manrope}
.orbito-channel-tabs strong{padding:5px 9px;border:1px solid var(--messenger-line);border-radius:8px;background:var(--messenger-panel-strong);color:var(--messenger-text);font:750 10px/1 Manrope}
.orbito-channel-tabs button{
  min-width:72px!important;height:32px!important;padding:0 13px!important;border-radius:9px!important;
  font:700 11px/1 Manrope!important;
}
.orbito-channel-tabs button:disabled{opacity:.45;cursor:not-allowed}
.orbito-messenger-layout{border-radius:14px!important}
.orbito-chat-list{scrollbar-width:thin;scrollbar-color:var(--messenger-muted) transparent}
.orbito-chat-list>label{padding:10px 12px!important}
.orbito-chat-list>label span{margin-bottom:4px!important;font-size:10px!important}
.orbito-chat-list input{height:36px!important;padding:0 11px!important;border-radius:9px!important;font-size:12px!important}
.orbito-chat-list-group{
  position:sticky;top:70px;z-index:1;padding:6px 12px 4px;
  background:var(--messenger-panel-strong);color:var(--messenger-muted);
  font:800 9px/1.2 Manrope;letter-spacing:.06em;text-transform:uppercase;
}
.orbito-chat-list-group[hidden]{display:none!important}
.orbito-chat-list-item{
  grid-template-columns:30px minmax(0,1fr) auto!important;align-items:center!important;gap:8px!important;
  min-height:48px!important;padding:7px 11px!important;border-left:3px solid transparent!important;
}
.orbito-chat-list-item.unread{border-left-color:#d94d4d!important;background:rgba(217,77,77,.08)!important}
.orbito-chat-list-item strong{font-size:12px!important;line-height:1.2!important}
.orbito-chat-list-item small{margin-top:2px!important;font-size:9px!important;line-height:1.2!important}
.orbito-chat-avatar{width:30px!important;height:30px!important;font-size:11px!important}
.orbito-chat-unread{
  min-width:19px!important;height:19px!important;padding:0 5px!important;border-radius:7px!important;
  background:#d94d4d!important;color:#fff!important;font:800 9px/19px Manrope!important;
}
.orbito-chat-pane>header{min-height:58px;padding:10px 14px!important}
.orbito-chat-header-actions{gap:6px!important;flex-wrap:wrap;justify-content:flex-end}
.orbito-chat-open-deal,.orbito-chat-open-avito,.orbito-chat-claim,.orbito-chat-claimed,.orbito-chat-no-url{
  display:inline-flex;align-items:center;height:30px!important;padding:0 10px!important;border:1px solid var(--messenger-line)!important;
  border-radius:8px!important;background:var(--messenger-panel-strong)!important;color:var(--messenger-text)!important;
  font:650 10px/1 Manrope!important;text-decoration:none;
}
.orbito-chat-claim{border-color:color-mix(in srgb,var(--messenger-accent) 60%,transparent)!important;color:var(--messenger-accent)!important;cursor:pointer}
.orbito-chat-claimed{color:var(--messenger-muted)!important}
.orbito-chat-body{scrollbar-width:none}
.orbito-chat-body::-webkit-scrollbar{display:none}
.orbito-chat-composer{
  grid-template-columns:42px minmax(0,1fr) 42px!important;align-items:end!important;gap:8px!important;
  padding:10px 14px!important;
}
.orbito-chat-composer textarea{
  height:64px!important;min-height:64px!important;max-height:180px!important;padding:10px 12px!important;border-radius:9px!important;
  resize:vertical!important;overflow:auto!important;
  color:var(--messenger-text)!important;font:500 12px/1.45 Manrope!important;
}
.orbito-chat-composer>button{
  width:42px!important;height:42px!important;min-width:0!important;padding:0!important;border:1px solid var(--messenger-line)!important;
  border-radius:9px!important;display:grid!important;place-items:center!important;
}
.orbito-chat-composer>[data-messenger-send]{width:42px!important;height:42px!important;background:var(--messenger-accent)!important;color:#0a251a!important}
.orbito-chat-composer button svg{width:18px;height:18px}
.orbito-chat-composer button:disabled{opacity:.38!important;cursor:not-allowed!important}

@media(max-width:720px){
  .orbito-messenger-header{padding:10px!important}
  .orbito-messenger-header h1{font-size:24px!important}
  .orbito-channel-tabs{padding:0 10px 8px!important}
  .orbito-chat-list-item{grid-template-columns:26px minmax(0,1fr) auto!important;padding:6px!important}
  .orbito-chat-avatar{width:26px!important;height:26px!important}
  .orbito-chat-header-actions{width:100%;justify-content:flex-start}
  .orbito-chat-composer{grid-template-columns:38px minmax(0,1fr) 38px!important;padding:8px!important}
  .orbito-chat-composer>button,.orbito-chat-composer>[data-messenger-send]{width:38px!important;height:38px!important}
  .orbito-chat-composer textarea{height:56px!important;min-height:56px!important;max-height:150px!important}
}

/* Final composer sizing: JS grows this field upward to exactly three rows of control height. */
.orbito-chat-composer textarea{height:64px!important;min-height:64px!important;max-height:192px!important;resize:none!important;overflow-y:hidden!important;transition:height .12s ease!important}
@media(max-width:720px){.orbito-chat-composer textarea{height:56px!important;min-height:56px!important;max-height:168px!important}}
.kanban-scroll-arrow,.automation-scroll-arrow{transition:color .16s ease,background .16s ease,border-color .16s ease,box-shadow .16s ease!important}

/* v137-local-review: reversible composer, unified filters and calm kanban metadata. */
::selection{background:#ffd166;color:#102018;text-shadow:none}
input::selection,textarea::selection,[contenteditable]::selection{background:#ffd166;color:#102018;text-shadow:none}

.orbito-chat-composer textarea{
  transition:none!important;resize:none!important;overflow-y:hidden!important;
}

.kanban-scroll-arrow,.automation-scroll-arrow{opacity:.32!important;background:rgba(244,249,246,.2)!important;box-shadow:none!important}
.kanban-scroll-shell:hover .kanban-scroll-arrow,.automation-scroll-shell:hover .automation-scroll-arrow{opacity:.45!important}
.kanban-scroll-arrow:hover,.kanban-scroll-arrow:focus-visible,
.automation-scroll-arrow:hover,.automation-scroll-arrow:focus-visible{opacity:.78!important;background:rgba(240,248,244,.58)!important}
body.theme-dark .kanban-scroll-arrow,body.theme-dark .automation-scroll-arrow{opacity:.3!important;background:rgba(18,34,27,.22)!important}
body.theme-dark .kanban-scroll-arrow:hover,body.theme-dark .kanban-scroll-arrow:focus-visible,
body.theme-dark .automation-scroll-arrow:hover,body.theme-dark .automation-scroll-arrow:focus-visible{opacity:.76!important;background:rgba(35,55,46,.58)!important}

.board:not(.list-mode) .lead-meta{
  display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;
  gap:1px!important;margin-top:4px!important;padding:3px 0!important;min-height:29px!important;white-space:nowrap!important;
}
.board:not(.list-mode) .lead-meta span{
  display:block!important;width:100%!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;
  text-align:left!important;font-size:8px!important;line-height:1.35!important;
}

.crm-toolbar{align-items:center!important}
.crm-toolbar .quick-create,.crm-toolbar .pipeline-select,.crm-toolbar .robots-link,
.pipeline-filter,.pipeline-filter input,.pipeline-filter>span,.pipeline-filter>button{
  font-family:Manrope,Arial,sans-serif!important;font-size:11px!important;line-height:1!important;
}
.pipeline-filter{
  height:40px!important;display:flex!important;align-items:stretch!important;gap:0!important;padding:0!important;overflow:visible!important;
  border:1px solid var(--line)!important;border-radius:10px!important;background:color-mix(in srgb,var(--panel) 78%,transparent)!important;
  box-shadow:0 8px 24px rgba(20,37,29,.06)!important;-webkit-backdrop-filter:blur(14px) saturate(125%);backdrop-filter:blur(14px) saturate(125%);
}
.pipeline-filter>span{
  display:flex!important;align-items:center!important;flex:0 0 auto!important;margin:0!important;padding:0 11px!important;
  border-right:1px solid var(--line)!important;background:transparent!important;color:var(--muted)!important;font-weight:650!important;
}
.pipeline-filter input{
  min-width:180px!important;height:100%!important;padding:0 12px!important;border:0!important;border-radius:0!important;
  background:transparent!important;color:var(--ink)!important;font-weight:550!important;outline:0!important;box-shadow:none!important;
}
.pipeline-filter input:focus{box-shadow:inset 0 -2px 0 color-mix(in srgb,var(--green) 72%,transparent)!important}
.pipeline-filter>button{
  height:auto!important;margin:3px!important;padding:0 12px!important;border:0!important;border-left:1px solid var(--line)!important;
  border-radius:7px!important;background:transparent!important;color:var(--green)!important;font-weight:750!important;
}
.pipeline-filter>button:hover,.pipeline-filter>button:focus-visible,.pipeline-filter>button.active{background:color-mix(in srgb,var(--green) 10%,transparent)!important;outline:0!important}
body.theme-dark .pipeline-filter{border-color:var(--liquid-line-soft)!important;background:rgba(17,32,25,.66)!important}
body.theme-dark .pipeline-filter>span,body.theme-dark .pipeline-filter>button{border-color:var(--liquid-line-soft)!important}

.deal-filter-panel{
  position:fixed!important;z-index:60!important;display:grid!important;grid-template-columns:170px minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;
  width:auto!important;margin:0!important;padding:0!important;overflow:hidden!important;max-height:calc(100vh - 140px)!important;
  border:1px solid var(--liquid-line)!important;border-radius:12px!important;background:rgba(248,250,247,.97)!important;
  -webkit-backdrop-filter:blur(20px) saturate(135%)!important;backdrop-filter:blur(20px) saturate(135%)!important;box-shadow:0 24px 60px rgba(16,32,24,.22)!important;
}
.deal-filter-panel[hidden],.deal-filter-field-picker[hidden]{display:none!important}
.deal-filter-presets{display:flex;flex-direction:column;gap:4px;padding:16px 12px;border-right:1px solid var(--line);min-height:0;overflow-y:auto}
.deal-filter-presets>strong{padding:0 8px 8px;color:var(--ink);font:750 12px/1.2 Manrope}
.deal-filter-presets>button{width:100%;padding:9px 8px;border:0;border-radius:8px;background:transparent;color:var(--muted);font:650 10px/1.2 Manrope;text-align:left;cursor:pointer}
.deal-filter-presets>button:hover,.deal-filter-presets>button.active{background:color-mix(in srgb,var(--green) 11%,transparent);color:var(--ink)}
.deal-filter-presets>small{margin-top:auto;padding:10px 8px 0;color:var(--muted);font:500 8px/1.45 Manrope}
.deal-filter-main{position:relative;min-width:0;padding:16px;min-height:0;overflow-y:auto}
.deal-filter-main>header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.deal-filter-main>header>div{display:grid;gap:3px}
.deal-filter-main>header strong{color:var(--ink);font:750 12px/1.2 Manrope}
.deal-filter-main>header span{color:var(--muted);font:550 9px/1.2 Manrope}
.deal-filter-main>header>button{height:32px;padding:0 11px;border:1px dashed color-mix(in srgb,var(--green) 54%,var(--line));border-radius:8px;background:transparent;color:var(--green);font:700 9px/1 Manrope;cursor:pointer}
.deal-filter-grid{display:grid!important;grid-template-columns:1fr!important;gap:10px!important}
.deal-filter-grid label{min-width:0;color:var(--muted);font:650 9px/1.2 Manrope}
.deal-filter-grid label>span{display:block;margin-bottom:5px}
.deal-filter-grid input,.deal-filter-grid select{
  width:100%;height:36px;padding:0 10px;border:1px solid var(--line);border-radius:8px;
  background:color-mix(in srgb,var(--panel) 84%,transparent);color:var(--ink);font:550 11px/1 Manrope;outline:0;
}
.deal-filter-grid input:focus,.deal-filter-grid select:focus{border-color:var(--green);box-shadow:var(--ring)}
.deal-filter-empty{grid-column:1/-1;margin:8px 0;color:var(--muted);font:550 10px/1.4 Manrope}
.deal-filter-field-picker{
  position:absolute;z-index:3;top:55px;right:16px;width:min(430px,calc(100% - 32px));padding:12px;border:1px solid var(--liquid-line);
  border-radius:10px;background:var(--liquid-fill-strong);-webkit-backdrop-filter:blur(20px) saturate(135%);backdrop-filter:blur(20px) saturate(135%);box-shadow:var(--liquid-shadow);
}
.deal-filter-field-picker>strong{display:block;margin-bottom:9px;color:var(--ink);font:750 10px/1.2 Manrope}
.deal-filter-field-picker>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 10px}
.deal-filter-field-picker label{display:flex;align-items:center;gap:7px;min-width:0;padding:6px;border-radius:6px;color:var(--ink);font:600 9px/1.2 Manrope;cursor:pointer}
.deal-filter-field-picker label:hover{background:color-mix(in srgb,var(--green) 9%,transparent)}
.deal-filter-field-picker input{accent-color:var(--green)}
.deal-filter-panel footer{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:12px;padding-top:11px;border-top:1px solid var(--line)}
.deal-filter-panel footer>button{height:32px;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:transparent;color:var(--ink);font:700 9px/1 Manrope;cursor:pointer}
.deal-filter-panel footer>.primary-button{border-color:var(--green);background:var(--green);color:#fff}
body.theme-dark .deal-filter-panel{background:rgba(23,35,29,.98)!important;border-color:rgba(151,180,165,.3)!important}
body.theme-dark .deal-filter-presets{border-color:var(--liquid-line-soft)}
body.theme-dark .deal-filter-grid input,body.theme-dark .deal-filter-grid select{border-color:var(--liquid-line-soft);background:rgba(20,34,28,.68);color:var(--ink)}

@media(max-width:720px){
  .deal-filter-panel{grid-template-columns:132px minmax(0,1fr)!important}
  .deal-filter-presets{padding:12px 8px;border-right:1px solid var(--line)}
  .deal-filter-presets>strong{font:700 11px/1.2 Manrope;padding:0 6px 8px}
  .deal-filter-presets>small{display:none}
  .deal-filter-presets>button{text-align:left;padding:8px 6px;font-size:9px}
  .deal-filter-main{padding:12px}
  .deal-filter-grid{grid-template-columns:1fr!important}
  .deal-filter-field-picker{top:52px;right:12px;width:calc(100% - 24px)}
  .deal-filter-field-picker>div{grid-template-columns:1fr}
}

/* v138-local-review: precise messenger controls, content-sized deal cards and solid overlays. */
.orbito-chat-composer{align-items:end!important}
.orbito-chat-composer textarea{
  height:42px!important;min-height:42px!important;max-height:126px!important;
  padding:10px 12px!important;line-height:20px!important;overflow-y:hidden!important;
}
.orbito-chat-composer>button{
  width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;
  padding:0!important;display:grid!important;place-items:center!important;line-height:0!important;
}
.orbito-chat-composer>button svg{display:block!important;width:20px!important;height:20px!important;margin:0!important;transform:none!important}
.orbito-chat-composer>[data-messenger-send] svg{width:21px!important;height:21px!important;transform:translateY(1px)!important}

.board:not(.list-mode) .lead-card{
  flex:0 0 auto!important;block-size:auto!important;height:auto!important;min-height:0!important;max-height:none!important;
}
.board:not(.list-mode) .lead-meta{
  gap:2px!important;margin-top:5px!important;padding:3px 0!important;min-height:0!important;
}
.board:not(.list-mode) .lead-meta span{
  display:flex!important;align-items:center!important;gap:4px!important;width:100%!important;max-width:100%!important;
  font:600 9px/1.35 Manrope!important;
}
.board:not(.list-mode) .lead-meta span>i{
  display:inline-grid!important;place-items:center!important;flex:0 0 11px!important;width:11px!important;height:11px!important;
  margin:0!important;color:inherit!important;font:normal 9px/1 Manrope!important;
}
.board:not(.list-mode) .lead-meta span>b{min-width:0;overflow:hidden;text-overflow:ellipsis;font:600 9px/1.35 Manrope!important;color:inherit!important}
.board:not(.list-mode) .lead-messenger>b{font-weight:700!important}
.board:not(.list-mode) .card-owner{margin-top:5px!important}
.board:not(.list-mode) .lead-value,.board:not(.list-mode) .card-field,.board:not(.list-mode) .card-owner{border-top:0!important}

.deal-filter-field-picker{
  background:rgba(248,250,247,.96)!important;
  -webkit-backdrop-filter:blur(22px) saturate(118%)!important;backdrop-filter:blur(22px) saturate(118%)!important;
}
body.theme-dark .deal-filter-field-picker{background:rgba(23,35,29,.97)!important;border-color:rgba(151,180,165,.28)!important}

.stage-manager-row{position:relative;transition:border-color .12s ease,box-shadow .12s ease,transform .12s ease}
.stage-manager-row.drop-before::before,.stage-manager-row.drop-after::after{
  content:"";position:absolute;z-index:3;left:10px;right:10px;height:4px;border-radius:999px;
  background:#61d6a6;box-shadow:0 0 0 2px color-mix(in srgb,#61d6a6 22%,transparent),0 4px 12px rgba(32,133,94,.28);
}
.stage-manager-row.drop-before::before{top:-7px}
.stage-manager-row.drop-after::after{bottom:-7px}
.stage-manager-row.drop-before,.stage-manager-row.drop-after{border-color:#61d6a6!important;box-shadow:0 0 0 2px rgba(97,214,166,.16)!important}
body.theme-dark .stage-manager{background:#1b2822!important;border:1px solid #3b4c43!important}
body.theme-dark .stage-manager>header,body.theme-dark .stage-add-form,body.theme-dark .stage-manager>footer{background:#202e27!important;border-color:#3b4c43!important}
body.theme-dark .stage-manager-list{background:#18231e!important}
body.theme-dark .stage-manager-row{background:#26352e!important;border-color:#405249!important;box-shadow:none!important}
body.theme-dark .stage-manager-row:hover{background:#2b3b33!important}
body.theme-dark .stage-manager-row input{background:#1d2a24!important;border-color:#465a50!important;color:#dce9e2!important}
body.theme-dark .stage-manager-row button{background:#2b3a33!important;border-color:#465a50!important;color:#c9d7d0!important}
body.theme-dark .stage-manager-row .stage-delete{color:#f09288!important}

@media(max-width:720px){
  .orbito-chat-composer textarea{height:38px!important;min-height:38px!important;max-height:114px!important;padding:8px 10px!important;line-height:20px!important}
  .orbito-chat-composer>button,.orbito-chat-composer>[data-messenger-send]{width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important}
  .orbito-chat-composer>button svg{width:19px!important;height:19px!important}
  .orbito-chat-composer>[data-messenger-send] svg{width:20px!important;height:20px!important}
}

/* v139-local-review: live filters, shared calendar and consistent deal metadata. */
.pipeline-filter>#dealFilterQuickReset{
  color:#a84b43!important;border-left:1px solid var(--line)!important;font-weight:700!important;
}
.pipeline-filter>#dealFilterQuickReset:hover,.pipeline-filter>#dealFilterQuickReset:focus-visible{
  background:color-mix(in srgb,#d65c51 11%,transparent)!important;color:#8f352e!important;
}
.deal-filter-date{position:relative;width:100%}
.deal-filter-date-range{display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:center;width:100%}
.deal-filter-date-range .deal-filter-date-from,.deal-filter-date-range .deal-filter-date-to{width:100%}
.deal-filter-date-range .deal-filter-date{width:100%}
.deal-filter-date-cap{margin:0 6px 0 0;color:var(--muted);font:700 9px/1 Manrope}
.deal-filter-date>button{
  display:flex;width:100%;height:36px;align-items:center;justify-content:space-between;gap:10px;padding:0 10px;
  border:1px solid var(--line);border-radius:8px;background:color-mix(in srgb,var(--panel) 84%,transparent);
  color:var(--ink);font:550 11px/1 Manrope;cursor:pointer;text-align:left;
}
.deal-filter-date>button:hover,.deal-filter-date>button:focus-visible{border-color:var(--green);outline:0;box-shadow:var(--ring)}
.deal-filter-date>button svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;color:var(--muted)}
.deal-filter-date .bitrix-date-picker{left:0!important;top:calc(100% + 6px)!important;width:286px!important;z-index:80!important}
.bitrix-date-picker[data-deal-filter-calendar]{z-index:180!important;margin:0!important}
.bitrix-date-picker[data-deal-filter-calendar] footer{display:none!important}
.deal-filter-presets>small{display:none!important}
.deal-filter-panel footer>#dealFilterApply{display:none!important}
.deal-filter-panel footer>button{flex:0 0 118px!important;width:118px!important;padding:0 10px!important}
.deal-filter-field-picker{
  background:rgba(248,250,247,.9)!important;
  -webkit-backdrop-filter:blur(26px) saturate(125%)!important;backdrop-filter:blur(26px) saturate(125%)!important;
}
body.theme-dark .deal-filter-field-picker{background:rgba(23,35,29,.92)!important}
body.theme-dark .deal-filter-date>button{border-color:var(--liquid-line-soft);background:rgba(20,34,28,.68);color:var(--ink)}

.board:not(.list-mode) .lead-top>span{font-size:12px!important;line-height:1.3!important}
.board:not(.list-mode) .lead-value,.board:not(.list-mode) .card-field{font-size:10px!important}
.board:not(.list-mode) .lead-meta span,.board:not(.list-mode) .lead-meta span>b{font:650 10px/1.35 Manrope!important}
.board:not(.list-mode) .lead-meta span>i{
  display:grid!important;place-items:center!important;flex:0 0 12px!important;width:12px!important;height:12px!important;
}
.board:not(.list-mode) .lead-meta span>i svg{
  display:block;width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.35;stroke-linecap:round;stroke-linejoin:round;
}
.board:not(.list-mode) .card-owner{display:flex!important;width:100%!important;align-items:center!important;padding-top:3px!important}
.board:not(.list-mode) .card-owner>button{
  display:inline-flex;align-items:center;gap:6px;width:auto;max-width:100%;padding:2px 0;border:0;background:transparent;
  color:var(--ink);font:600 9px/1.3 Manrope;text-align:left;cursor:pointer;
}
.board:not(.list-mode) .card-owner>button:hover strong,.board:not(.list-mode) .card-owner>button:focus-visible strong{color:var(--green);text-decoration:underline}
.board:not(.list-mode) .card-owner>button:focus-visible{outline:2px solid color-mix(in srgb,var(--green) 46%,transparent);outline-offset:2px;border-radius:4px}
.board:not(.list-mode) .card-owner>button>span:last-child{min-width:0}

/* v137-robot-editor-mobile: lock the condition-row trash into its 28px column and
   keep the footer fully on-screen at <=720px. Additive only — old blocks untouched. */
@media(max-width:720px){
  .robot-editor-dialog .robot-condition-row [data-condition-remove]{
    width:28px!important;min-width:28px!important;max-width:28px!important;
    height:var(--robot-control-height,40px)!important;
  }
  .robot-editor-dialog>form>footer{position:static!important;bottom:auto!important}
  .robot-editor-dialog>form>footer button{flex:1!important;min-height:42px!important}
}
.board:not(.list-mode) .card-owner>button strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px!important}

/* v138-kanban-flag-slot: warning flags appear/disappear without changing card
   height or shifting content. The kanban card height was forced to auto
   (styles.css:6377), so a flow-child flag grew/shrank the card. We reserve a
   constant top slot via padding and take the flag out of flow (absolute), so
   presence/absence is layout-neutral. Kanban (grid) view only; list mode keeps
   its own inline flag. Old blocks untouched — purely additive. */
.board:not(.list-mode) .lead-card{
  padding-top:30px!important;
  /* State changes alter the border color; do not animate that change. */
  transition:transform .15s,box-shadow .15s!important;
  animation:none!important;
}
.board:not(.list-mode) .lead-card .lead-flag{
  position:absolute;top:0;left:8px;right:8px;
  height:20px;margin:0;display:block;
  box-sizing:border-box;padding:0 7px;border-radius:5px;
  font:700 9px/20px Manrope;letter-spacing:.01em;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  transition:none!important;animation:none!important;
}

.robot-column .stage-cap strong{min-width:0}

/* Drag-and-drop of robot cards within and across stages. */
.robot-card[draggable="true"]{cursor:grab}
.robot-card.dragging{opacity:.5;cursor:grabbing}
.robot-drop-indicator{height:3px;background:var(--green);border-radius:2px;margin:4px 2px}

/* RBT-008: robot cards share the deal-card glass surface and kanban drag state. */
.automation-grid .robot-card{
  border:1px solid var(--liquid-line)!important;
  border-radius:12px!important;
  background:var(--liquid-fill-strong)!important;
  box-shadow:var(--liquid-shadow)!important;
  -webkit-backdrop-filter:blur(18px) saturate(125%)!important;
  backdrop-filter:blur(18px) saturate(125%)!important;
}
.robot-card-header,.robot-card-actions,.stage-cap,.robot-trigger{align-items:center!important}
.robot-card-actions{display:flex!important;gap:4px!important}
.robot-card-actions>.robot-card-config,
.robot-card-actions>.robot-card-clone,
.robot-card-actions>.robot-card-delete{
  display:grid!important;place-items:center!important;
  width:28px!important;height:28px!important;min-width:28px!important;padding:0!important;
}
.robot-card.is-dragging-card{opacity:.5!important;cursor:grabbing!important}
.robot-stack.kanban-drop-active{outline:0!important}
.robot-stack.kanban-drop-active>.empty-robots{border-color:var(--green)!important}
.automation-grid .kanban-drop-placeholder{margin:4px 2px!important}
.robot-editor-dialog .robot-editor-message{position:relative!important}
.robot-editor-dialog .robot-editor-message textarea{
  min-height:64px!important;max-height:240px!important;resize:none!important;overflow-y:auto!important;
}
.robot-message-resize-grip{
  position:absolute;right:8px;bottom:8px;z-index:2;width:12px;height:12px;
  cursor:ns-resize;touch-action:none;
}
.robot-message-resize-grip::before{
  content:"";position:absolute;inset:2px;
  background:repeating-linear-gradient(135deg,transparent 0 2px,color-mix(in srgb,var(--muted) 50%,transparent) 2px 3px);
  opacity:.75;pointer-events:none;
}

/* RBT-008: disabled robots keep the shared glass card, without legacy striping. */
.automation-grid .robot-card.disabled{
  opacity:.82!important;
  filter:saturate(.72)!important;
  border-left-color:color-mix(in srgb,var(--muted) 54%,var(--liquid-line))!important;
}
.automation-grid .robot-card.disabled::after{
  content:none!important;
  display:none!important;
  background:none!important;
}

/* RBT-009: explicit unsaved draft, confirmed save state and unsaved-changes dialog.
   Purely additive — shared glass tokens, dark/light safe, no rotate/scale, no shift
   of the editor grid, fits <=720px. */
.robot-editor-draft #robotEditorTitle::before{
  content:"";display:inline-block;width:8px;height:8px;border-radius:50%;
  margin-right:8px;vertical-align:middle;background:#e7a33a;
  box-shadow:0 0 0 3px color-mix(in srgb,#e7a33a 22%,transparent);
}
.robot-editor-draft #robotEditorStage{color:var(--muted)!important;font-style:normal!important}
.robot-editor-error{
  display:block;margin:0 0 10px;padding:9px 12px;border:1px solid color-mix(in srgb,#d65c51 50%,var(--line));
  border-radius:9px;background:color-mix(in srgb,#d65c51 9%,transparent);color:#a8403a;
  font:650 10px/1.4 Manrope;
}
body.theme-dark .robot-editor-error{background:rgba(214,92,81,.12);color:#f0a79f;border-color:rgba(214,92,81,.42)}
.robot-editor-error[hidden]{display:none!important}
.robot-editor-dialog button[type="submit"][disabled]{opacity:.7!important;cursor:progress!important}

.robot-unsaved-backdrop{
  position:fixed;inset:0;z-index:200;display:flex;align-items:center;justify-content:center;
  padding:16px;background:rgba(16,32,24,.34);
  -webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);
}
.robot-unsaved-dialog{
  width:min(360px,100%);padding:18px;border:1px solid var(--liquid-line);border-radius:14px;
  background:var(--liquid-fill-strong);
  -webkit-backdrop-filter:blur(20px) saturate(135%);backdrop-filter:blur(20px) saturate(135%);
  box-shadow:var(--liquid-shadow);
}
.robot-unsaved-dialog .robot-unsaved-text{margin:0 0 14px;color:var(--ink);font:700 13px/1.4 Manrope}
.robot-unsaved-actions{display:flex;flex-wrap:wrap;gap:8px}
.robot-unsaved-actions button{
  flex:1 1 auto;min-width:104px;height:38px;padding:0 12px;border:1px solid var(--line);border-radius:9px;
  background:transparent;color:var(--ink);font:700 10px/1 Manrope;cursor:pointer;
}
.robot-unsaved-actions button.primary-button{border:0;background:var(--green);color:#fff}
.robot-unsaved-actions button.ghost-button{color:var(--muted)}
.robot-unsaved-actions button:hover,.robot-unsaved-actions button:focus-visible{outline:2px solid color-mix(in srgb,var(--green) 42%,transparent);outline-offset:2px}
body.theme-dark .robot-unsaved-dialog{background:var(--liquid-fill-strong);border-color:rgba(151,180,165,.3)}
@media(max-width:720px){
  .robot-unsaved-dialog{padding:14px}
  .robot-unsaved-actions button{flex:1 1 100%;min-width:0}
}

/* CAL-010: unified calendar contract, centered period divider, no auto-save hint,
   dark-theme surfaces without white gaps. Additive — shared glass tokens only. */
.deal-filter-presets>small{display:none!important}
.deal-filter-date-range{position:relative}
.deal-filter-date-range::before{content:"";position:absolute;left:50%;top:10px;bottom:10px;transform:translateX(-50%);width:1px;background:var(--line);pointer-events:none}
body.theme-dark .deal-filter-date-range::before{background:var(--liquid-line-soft)}

body.theme-dark .calendar-owner-bar{border-color:var(--liquid-line-soft)}
body.theme-dark .calendar-owner-bar button{border-color:var(--liquid-line-soft);background:rgba(20,34,28,.6);color:var(--muted)}
body.theme-dark .calendar-owner-bar button.active{border-color:color-mix(in srgb,var(--green) 60%,transparent);background:color-mix(in srgb,var(--green) 18%,transparent);color:#cfe9da}
body.theme-dark .calendar-navigation button,body.theme-dark .calendar-view-switch button{border-color:var(--liquid-line-soft);background:var(--liquid-fill-strong);color:var(--ink)}
body.theme-dark .calendar-navigation .today-button{color:#bfe6cf}
body.theme-dark .calendar-view-switch{background:rgba(20,34,28,.5)}
body.theme-dark .calendar-view-switch button.active{background:rgba(40,60,50,.92);color:#cfe9da}
body.theme-dark .calendar-range-title{color:var(--ink)}
body.theme-dark .calendar-time-view{border-color:var(--liquid-line-soft);background:var(--liquid-fill-strong)}
body.theme-dark .calendar-time-head{background:rgba(20,34,28,.5);border-color:var(--liquid-line-soft)}
body.theme-dark .calendar-time-head>span{border-color:var(--liquid-line-soft)}
body.theme-dark .calendar-time-head>button{border-color:var(--liquid-line-soft);color:var(--muted)}
body.theme-dark .calendar-time-head small{color:var(--muted)}
body.theme-dark .calendar-time-head button.today strong{background:#3fae84;color:#06231a}
body.theme-dark .calendar-time-labels{background:rgba(20,34,28,.5);border-color:var(--liquid-line-soft)}
body.theme-dark .calendar-time-labels span{color:var(--muted)}
body.theme-dark .calendar-time-column{border-color:var(--liquid-line-soft)}
body.theme-dark .calendar-time-column>i{border-color:rgba(151,180,165,.14)}
body.theme-dark .calendar-month-view{border-color:var(--liquid-line-soft);background:var(--liquid-fill-strong)}
body.theme-dark .calendar-month-weekdays{background:rgba(20,34,28,.5);border-color:var(--liquid-line-soft)}
body.theme-dark .calendar-month-weekdays span{color:var(--muted)}
body.theme-dark .calendar-month-grid{border-color:var(--liquid-line-soft)}
body.theme-dark .calendar-month-day{background:var(--liquid-fill-strong);border-color:var(--liquid-line-soft);color:var(--ink)}
body.theme-dark .calendar-month-day.outside{background:rgba(20,34,28,.55);color:var(--muted)}

/* CAL-011: the clock, time rows and day columns derive from one grid contract. */
.calendar-time-view{--calendar-row-height:58px;--calendar-row-count:19}
.calendar-time-labels{grid-template-rows:repeat(var(--calendar-row-count),var(--calendar-row-height))}
.calendar-time-column{min-height:calc(var(--calendar-row-count)*var(--calendar-row-height))}
.calendar-time-column>i{height:var(--calendar-row-height)}

/* CAL-012: one Orbito visual system for the calendar screen.
   Controls, glass surfaces, event cards and the 720px contract all reuse one
   token set. Light + dark. Minimal overrides, no new functionality. */

.calendar-layout{
  --cal-control-height:32px;
  --cal-radius:9px;
  background:var(--liquid-fill-strong)!important;
  -webkit-backdrop-filter:blur(16px) saturate(125%);
  backdrop-filter:blur(16px) saturate(125%);
  border:1px solid var(--liquid-line)!important;
  box-shadow:var(--liquid-shadow)!important;
}
.calendar-owner-bar{border-bottom:1px solid var(--liquid-line-soft)!important}
.calendar-owner-bar button{
  height:var(--cal-control-height)!important;
  border:1px solid var(--liquid-line)!important;
  border-radius:var(--cal-radius)!important;
  background:color-mix(in srgb,var(--panel) 70%,transparent)!important;
  color:var(--ink)!important;
  padding:0 12px!important;
  font:600 10px/1 Manrope!important;
  display:inline-flex;align-items:center;gap:7px;flex:0 0 auto;
  box-shadow:none!important;
}
.calendar-owner-bar button:hover{border-color:var(--green)!important;color:var(--green)!important}
.calendar-owner-bar button.active{
  border-color:var(--green)!important;
  background:color-mix(in srgb,var(--green) 12%,var(--panel))!important;
  color:var(--green)!important;
}
.calendar-owner-bar i{
  width:22px;height:22px;border-radius:50%;
  background:var(--avatar);color:#fff;font-style:normal;font-size:8px;
  display:grid;place-items:center;
}
.calendar-toolbar{padding:14px 0 10px!important;gap:10px!important}
.calendar-navigation{display:flex;align-items:center;gap:4px}
.calendar-navigation button{
  width:var(--cal-control-height)!important;
  height:var(--cal-control-height)!important;
  border:1px solid var(--liquid-line)!important;
  border-radius:var(--cal-radius)!important;
  background:color-mix(in srgb,var(--panel) 70%,transparent)!important;
  color:var(--ink)!important;
  padding:0!important;font-size:16px!important;
  display:grid;place-items:center;box-shadow:none!important;
}
.calendar-navigation button:hover{border-color:var(--green)!important;color:var(--green)!important}
.calendar-navigation .today-button{
  width:auto!important;padding:0 14px!important;
  color:var(--green)!important;font:700 10px/1 Manrope!important;
}
.calendar-view-switch{
  display:flex;align-items:center;gap:0;
  background:color-mix(in srgb,var(--panel) 55%,transparent)!important;
  border:1px solid var(--liquid-line-soft)!important;
  border-radius:var(--cal-radius)!important;padding:3px!important;
}
.calendar-view-switch button{
  height:calc(var(--cal-control-height) - 8px)!important;
  border:0!important;border-radius:calc(var(--cal-radius) - 3px)!important;
  background:transparent!important;color:var(--muted)!important;
  padding:0 12px!important;font:600 10px/1 Manrope!important;
  box-shadow:none!important;
}
.calendar-view-switch button.active{
  background:var(--panel)!important;color:var(--green)!important;
  box-shadow:0 1px 4px rgba(23,40,31,.10)!important;
}
.calendar-range-title{font:600 15px Onest!important;color:var(--ink)!important;padding:0 0 12px!important}

.calendar-time-view,.calendar-month-view{
  background:color-mix(in srgb,var(--panel) 60%,transparent)!important;
  border:1px solid var(--liquid-line-soft)!important;
  border-radius:10px!important;overflow:hidden;
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
}
.calendar-time-head{background:color-mix(in srgb,var(--panel) 75%,transparent)!important;border-bottom:1px solid var(--liquid-line-soft)!important}
.calendar-time-head>span{border-right:1px solid var(--liquid-line-soft)!important}
.calendar-time-head>button{border:0!important;border-left:1px solid var(--liquid-line-soft)!important;background:transparent!important;color:var(--muted)!important}
.calendar-time-head small{color:var(--muted)!important}
.calendar-time-head strong{color:var(--ink)!important}
.calendar-time-head button.today strong{background:var(--green)!important;color:#fff!important}
.calendar-time-labels{background:color-mix(in srgb,var(--panel) 65%,transparent)!important;border-right:1px solid var(--liquid-line-soft)!important}
.calendar-time-labels span{color:var(--muted)!important}
.calendar-time-column{border-right:1px solid var(--liquid-line-soft)!important}
.calendar-time-column:last-child{border-right:0!important}
.calendar-time-column>i{border-bottom:1px solid var(--liquid-line-soft)!important}
.calendar-time-column.is-calendar-dragging{background:color-mix(in srgb,var(--green) 8%,transparent)!important}
.calendar-event{
  border:1px solid var(--liquid-line)!important;
  border-left:3px solid var(--calendar-appointment-color,var(--green))!important;
  border-radius:8px!important;
  background:var(--liquid-fill-strong)!important;
  color:var(--ink)!important;
  padding:7px 8px!important;
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);
  box-shadow:0 2px 6px rgba(20,30,25,.06)!important;
  font:600 9px/1.3 Manrope!important;
}
.calendar-event b,.calendar-event span,.calendar-event small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
.calendar-event b{font-size:9px!important;color:var(--green)!important}
.calendar-event span{margin-top:2px!important;color:var(--ink)!important}
.calendar-event small{margin-top:2px!important;color:var(--muted)!important;opacity:1!important;font-weight:500!important}
.calendar-event:hover{box-shadow:0 6px 14px rgba(20,30,25,.12)!important;transform:translateY(-1px)}
.calendar-now-line{background:var(--orange,#e89052)!important}
.calendar-now-line i{background:var(--orange,#e89052)!important}
.calendar-month-weekdays{background:color-mix(in srgb,var(--panel) 75%,transparent)!important;border-bottom:1px solid var(--liquid-line-soft)!important}
.calendar-month-weekdays span{color:var(--muted)!important}
.calendar-month-day{background:color-mix(in srgb,var(--panel) 55%,transparent)!important;border-right:1px solid var(--liquid-line-soft)!important;border-bottom:1px solid var(--liquid-line-soft)!important;color:var(--ink)!important}
.calendar-month-day:nth-child(7n){border-right:0!important}
.calendar-month-day.outside{background:color-mix(in srgb,var(--panel) 30%,transparent)!important;color:var(--muted)!important}
.calendar-month-day>button{color:var(--ink)!important}
.calendar-month-day.today>button{background:var(--green)!important;color:#fff!important}
.calendar-month-day .calendar-event{min-height:18px!important;padding:2px 5px!important;border-left-width:2px!important;font-size:7px!important}
.calendar-month-day .calendar-event b,.calendar-month-day .calendar-event span{display:inline!important}
.calendar-month-day.weekend{background:color-mix(in srgb,var(--orange,#e89052) 5%,transparent)!important}
.calendar-quick-create{
  border:1px solid var(--liquid-line)!important;
  border-radius:10px!important;
  background:var(--liquid-fill-strong)!important;
  box-shadow:var(--liquid-shadow)!important;
  -webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);
}
.calendar-quick-create>input{border-bottom:1px solid var(--liquid-line-soft)!important;color:var(--ink)!important}
.calendar-quick-create input[type="time"]{border:1px solid var(--liquid-line-soft)!important;color:var(--ink)!important;background:transparent!important}
.calendar-quick-create button{background:color-mix(in srgb,var(--panel) 70%,transparent)!important;color:var(--muted)!important}
.calendar-quick-create button[type="submit"]{background:var(--green)!important;color:#fff!important}
.calendar-draft-preview{border-left:3px solid var(--green)!important;border-radius:6px!important;background:color-mix(in srgb,var(--green) 10%,var(--panel))!important;color:var(--ink)!important}
.schedule .meeting-row{border-bottom:1px solid var(--liquid-line-soft)!important}
.schedule .meeting-row:hover{background:color-mix(in srgb,var(--panel) 50%,transparent)!important}
.empty{color:var(--muted)!important}
.calendar-section-head{margin-bottom:12px!important;min-height:0!important}

body.theme-dark .calendar-layout{background:var(--liquid-fill-strong)!important;border-color:var(--liquid-line-soft)!important;box-shadow:var(--liquid-shadow)!important}
body.theme-dark .calendar-owner-bar{border-color:var(--liquid-line-soft)!important}
body.theme-dark .calendar-owner-bar button{background:rgba(20,34,28,.5)!important;border-color:var(--liquid-line-soft)!important;color:var(--ink)!important}
body.theme-dark .calendar-owner-bar button:hover{border-color:var(--green)!important;color:var(--green)!important}
body.theme-dark .calendar-owner-bar button.active{background:rgba(62,207,154,.15)!important;border-color:var(--green)!important;color:var(--green)!important}
body.theme-dark .calendar-navigation button{background:rgba(20,34,28,.5)!important;border-color:var(--liquid-line-soft)!important;color:var(--ink)!important}
body.theme-dark .calendar-navigation button:hover{border-color:var(--green)!important;color:var(--green)!important}
body.theme-dark .calendar-view-switch{background:rgba(20,34,28,.4)!important;border-color:var(--liquid-line-soft)!important}
body.theme-dark .calendar-view-switch button.active{background:var(--panel)!important;color:var(--green)!important}
body.theme-dark .calendar-time-view,body.theme-dark .calendar-month-view{background:rgba(20,34,28,.4)!important;border-color:var(--liquid-line-soft)!important}
body.theme-dark .calendar-time-head,body.theme-dark .calendar-month-weekdays{background:rgba(20,34,28,.55)!important;border-color:var(--liquid-line-soft)!important}
body.theme-dark .calendar-time-column,body.theme-dark .calendar-month-day{border-color:var(--liquid-line-soft)!important}
body.theme-dark .calendar-event{background:var(--liquid-fill-strong)!important;border-color:var(--liquid-line-soft)!important;border-left-color:var(--calendar-appointment-color,var(--green))!important;color:var(--ink)!important}
body.theme-dark .calendar-month-day.outside{background:rgba(20,34,28,.3)!important}
body.theme-dark .calendar-month-day.weekend{background:rgba(232,144,82,.06)!important}
body.theme-dark .calendar-quick-create{background:var(--liquid-fill-strong)!important;border-color:var(--liquid-line-soft)!important}
body.theme-dark .calendar-draft-preview{background:rgba(62,207,154,.12)!important}

@media(max-width:720px){
  .calendar-layout{padding:12px!important}
  .calendar-owner-bar{flex-wrap:nowrap!important;overflow-x:auto!important;padding-bottom:10px!important}
  .calendar-owner-bar button{flex:0 0 auto!important}
  .calendar-toolbar{align-items:stretch!important;flex-wrap:wrap!important;gap:8px!important}
  .calendar-navigation{justify-content:space-between}
  .calendar-view-switch{width:100%!important;overflow-x:auto!important;flex:0 0 auto!important}
  .calendar-view-switch button{flex:1 1 auto!important;white-space:nowrap!important}
  .calendar-grid-shell{overflow-x:auto!important;padding-bottom:6px!important}
  .calendar-time-view{--calendar-days:7;min-width:0!important}
  .calendar-time-head{grid-template-columns:var(--time-gutter) repeat(var(--calendar-days,7),minmax(84px,1fr))!important}
  .calendar-time-columns{grid-template-columns:repeat(var(--calendar-days,7),minmax(84px,1fr))!important}
  .calendar-month-view{min-width:0!important}
  .calendar-month-weekdays,.calendar-month-grid{grid-template-columns:repeat(7,minmax(72px,1fr))!important}
  .calendar-month-day{min-height:70px!important}
  .calendar-range-title{font-size:13px!important}
}

/* CAL-012 review: the seven-day frame must not crop a day on a normal desktop.
   Use one shrinkable grid contract at every width; the work surface stays dense
   enough that the decorative background cannot read as offset calendar cells. */
.calendar-time-view{min-width:0!important}
.calendar-time-head{grid-template-columns:var(--time-gutter) repeat(var(--calendar-days,7),minmax(0,1fr))!important;padding-right:var(--calendar-scrollbar-gutter,0px)!important}
.calendar-time-columns{grid-template-columns:repeat(var(--calendar-days,7),minmax(0,1fr))!important}
.calendar-time-view,.calendar-month-view{background:color-mix(in srgb,var(--panel) 96%,#eef3ef)!important}
.calendar-time-head,.calendar-month-weekdays,.calendar-time-labels{background:color-mix(in srgb,var(--panel) 98%,#eef3ef)!important}
body.theme-dark .calendar-time-view,body.theme-dark .calendar-month-view{background:color-mix(in srgb,var(--panel) 94%,#0a130f)!important}
body.theme-dark .calendar-time-head,body.theme-dark .calendar-month-weekdays,body.theme-dark .calendar-time-labels{background:color-mix(in srgb,var(--panel) 96%,#0a130f)!important}

/* CAL-012 refinement: the calendar is a work surface first.  Grid strokes
   stay visible in white and dark themes, and quick creation has one clear
   title, one primary action and a separately labelled dismissal. */
.calendar-time-view{
  --calendar-grid-line:rgba(48,76,62,.22);
  --calendar-grid-line-strong:rgba(48,76,62,.34);
}
.calendar-time-head{border-bottom-color:var(--calendar-grid-line-strong)!important}
.calendar-time-head>span,.calendar-time-head>button,.calendar-time-labels,.calendar-time-column{border-color:var(--calendar-grid-line-strong)!important}
.calendar-time-column>i{border-bottom-color:var(--calendar-grid-line)!important}
.calendar-time-head>button:last-child{border-right:0!important}
body.theme-dark .calendar-time-view{
  --calendar-grid-line:rgba(205,229,215,.18);
  --calendar-grid-line-strong:rgba(205,229,215,.31);
}

.calendar-quick-create{
  min-width:236px!important;
  padding:12px!important;
  border-color:color-mix(in srgb,var(--green) 42%,var(--liquid-line))!important;
  border-radius:14px!important;
  box-shadow:0 16px 34px rgba(12,31,22,.24)!important;
}
.calendar-quick-create-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.calendar-quick-create-head>strong{font:700 12px/1.2 Onest;color:var(--ink)}
.calendar-quick-close{
  display:grid!important;place-items:center!important;width:26px!important;height:26px!important;
  min-width:26px!important;padding:0!important;border:1px solid var(--liquid-line-soft)!important;
  border-radius:8px!important;background:transparent!important;color:var(--muted)!important;
  font:700 16px/1 Arial!important;
}
.calendar-quick-close:hover,.calendar-quick-close:focus-visible{border-color:var(--green)!important;color:var(--green)!important;outline:0}
.calendar-quick-field{display:grid!important;gap:5px;margin:0!important;color:var(--muted)!important;font:600 9px/1.2 Manrope!important}
.calendar-quick-field>span{display:block;color:var(--muted);font:700 8px/1.2 Manrope;text-transform:uppercase;letter-spacing:.045em}
.calendar-quick-field>input{
  box-sizing:border-box!important;width:100%!important;height:34px!important;margin:0!important;
  border:1px solid var(--liquid-line-soft)!important;border-radius:8px!important;
  background:color-mix(in srgb,var(--panel) 72%,transparent)!important;color:var(--ink)!important;
  padding:0 9px!important;font:600 10px/1 Manrope!important;outline:0!important;
}
.calendar-quick-field>input::placeholder{color:var(--muted);opacity:.78}
.calendar-quick-field>input:focus{border-color:var(--green)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--green) 16%,transparent)!important}
.calendar-quick-time{display:flex;align-items:end;gap:8px;margin-top:10px}
.calendar-quick-time .calendar-quick-field{width:91px;flex:0 0 91px}
.calendar-quick-time input[type="time"]{padding:0 7px!important}
.calendar-quick-duration{min-height:34px;display:flex;align-items:center;flex:1 1 auto;color:var(--ink);font:700 9px/1.35 Manrope}
.calendar-quick-help{display:block;margin-top:9px;color:var(--muted);font:500 8px/1.35 Manrope}
.calendar-quick-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;margin-top:12px}
.calendar-quick-actions button{height:32px!important;margin:0!important;border-radius:8px!important;padding:0 11px!important;font:700 9px/1 Manrope!important}
.calendar-quick-cancel{border:1px solid var(--liquid-line-soft)!important;background:transparent!important;color:var(--muted)!important}
.calendar-quick-submit{border:1px solid var(--green)!important;background:var(--green)!important;color:#fff!important}
.calendar-quick-submit:hover,.calendar-quick-submit:focus-visible{filter:brightness(1.06);outline:2px solid color-mix(in srgb,var(--green) 38%,transparent);outline-offset:2px}
.calendar-quick-submit:disabled{cursor:wait;opacity:.72}
.calendar-draft-preview{border-left-color:var(--green)!important;background:color-mix(in srgb,var(--green) 13%,var(--panel))!important}
body.theme-dark .calendar-quick-create{background:color-mix(in srgb,var(--panel) 94%,#07110c)!important}
body.theme-dark .calendar-quick-field>input{background:rgba(8,22,15,.58)!important}
@media(max-width:720px){
  .calendar-quick-create{min-width:220px!important;left:4px!important;right:4px!important}
  .calendar-quick-actions button{flex:1 1 auto}
}

/* CAL-014 — header dates and time cells are one scrollable grid, never two drifting layers. */
.calendar-time-view{
  --calendar-day-min-width:112px;
  max-height:680px;
  overflow:auto!important;
  scrollbar-gutter:stable;
}
.calendar-time-head{
  position:sticky;
  top:0;
  z-index:6;
  width:max-content;
  min-width:100%;
  padding-right:0!important;
  grid-template-columns:var(--time-gutter) repeat(var(--calendar-days,7),minmax(var(--calendar-day-min-width),1fr))!important;
}
.calendar-time-head>span{position:sticky;left:0;z-index:8;background:inherit}
.calendar-time-body{
  width:max-content;
  min-width:100%;
  max-height:none!important;
  overflow:visible!important;
}
.calendar-time-columns{
  grid-template-columns:repeat(var(--calendar-days,7),minmax(var(--calendar-day-min-width),1fr))!important;
}
.calendar-time-labels{position:sticky;left:0;z-index:4}
@media(max-width:720px){.calendar-time-view{--calendar-day-min-width:104px}}

/* CAL-015: the sticky date header and the first time row share one continuous seam;
   the body is pulled flush so there is no empty band between dates and grid. */
.calendar-time-body{
  margin-top:-1px;
  border-top:1px solid var(--calendar-grid-line-strong)!important;
}

/* CAL-016: header and body share one grid contract so vertical day borders align. */
.calendar-time-view{
  display:grid!important;
  grid-template-columns:var(--time-gutter) repeat(var(--calendar-days,7),minmax(var(--calendar-day-min-width),1fr))!important;
}
.calendar-time-head{
  grid-column:1 / -1!important;
  display:grid!important;
  grid-template-columns:subgrid!important;
  width:auto!important;
  min-width:auto!important;
}
.calendar-time-body{
  display:contents!important;
}
.calendar-time-labels{
  grid-column:1!important;
}
.calendar-time-columns{
  grid-column:2 / -1!important;
  display:grid!important;
  grid-template-columns:subgrid!important;
}

/* CAL-017: month events stay readable, list view stays stable in dark theme,
   and quick-create keeps the right labels and local creation flow. */
.calendar-month-event{
  display:flex!important;
  align-items:baseline!important;
  gap:5px!important;
  min-height:18px!important;
  padding:2px 5px!important;
  border-left-width:2px!important;
  border-radius:5px!important;
  background:var(--liquid-fill-strong)!important;
  font:500 10px/1.25 Manrope!important;
  text-align:left!important;
  white-space:nowrap!important;
  overflow:hidden!important;
}
.calendar-month-event b{flex:0 0 auto;color:var(--green)!important;font-weight:700!important}
.calendar-month-event span{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--ink)!important}
.calendar-month-more{
  display:block;width:100%;
  border:0;border-radius:5px;
  padding:2px 5px;
  background:transparent;
  color:var(--muted);
  font:500 10px/1.25 Manrope;
  text-align:left;
  cursor:pointer;
}
.calendar-month-more:hover{color:var(--green);background:color-mix(in srgb,var(--green) 8%,transparent)}
.calendar-month-view{
  --calendar-grid-line:rgba(48,76,62,.22);
  --calendar-grid-line-strong:rgba(48,76,62,.34);
}
.calendar-month-weekdays,.calendar-month-grid,.calendar-month-day{border-color:var(--calendar-grid-line-strong)!important}
.schedule{background:var(--panel)!important}
.meeting-row{background:var(--panel)!important;transition:none!important}
body.theme-dark .calendar-month-view{
  --calendar-grid-line:rgba(205,229,215,.18);
  --calendar-grid-line-strong:rgba(205,229,215,.31);
}
body.theme-dark .schedule,body.theme-dark .meeting-row{background:var(--panel)!important}

/* Mobile stage-transition date picker: it must remain in the dialog's own
   scroll flow. Leaving it as an absolutely positioned popover sends its
   lower half beneath the mobile browser chrome. Desktop keeps the v88 popover
   behavior; this narrow override only affects the compact phone dialog. */
@media (max-width: 720px) {
  .required-fields-backdrop.compact-stage-required-backdrop {
    align-items: start !important;
    overflow-y: auto !important;
  }

  .required-fields-backdrop > .required-fields-modal.compact-stage-required-dialog:has(.bitrix-date-picker) {
    max-height: calc(100dvh - 20px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .compact-stage-required-dialog .required-shared-date > .bitrix-date-picker {
    position: static !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    box-sizing: border-box !important;
    margin: 8px 0 0 !important;
  }
}

/* v144 — Android/coarse-pointer safety: the viewport owns the deal drawer,
   card swipes reach the horizontal board, and calendar days remain tappable. */
@media (max-width:900px), (hover:none), (pointer:coarse) {
  .drawer-backdrop{inset:0!important;padding:0!important;overflow:hidden!important}
  .drawer-backdrop .deal-drawer{
    position:fixed!important;inset:0!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
    height:100dvh!important;max-height:100dvh!important;overflow:hidden!important;
  }
  .deal-drawer .drawer-body{
    width:100%!important;min-width:0!important;max-width:100%!important;
    overflow-x:hidden!important;overflow-y:auto!important;
  }
  .deal-drawer .bitrix-card-grid{
    display:flex!important;flex-direction:column!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
  }
  .deal-drawer .bitrix-card-left,
  .deal-drawer .bitrix-card-right,
  .deal-drawer .deal-section,
  .deal-drawer .deal-view-layout,
  .deal-drawer .deal-layout-editor,
  .deal-drawer .deal-section-columns-1,
  .deal-drawer .deal-section-columns-2{
    width:100%!important;min-width:0!important;max-width:100%!important;
  }
  .deal-drawer :is(.deal-view-layout-row,.deal-layout-row,.deal-view-field-main,.deal-field-control){
    width:100%!important;min-width:0!important;max-width:100%!important;
  }
  .board:not(.list-mode){
    touch-action:pan-x!important;overscroll-behavior-x:contain!important;
    -webkit-overflow-scrolling:touch;
  }
  .board:not(.list-mode) .column,
  .board:not(.list-mode) .column-cards,
  .board:not(.list-mode) .lead-card{
    touch-action:pan-x pan-y!important;
    overscroll-behavior-x:auto!important;overscroll-behavior-y:contain!important;
  }
  .board:not(.list-mode) .lead-card{
    -webkit-user-drag:none;transition:none!important;
  }
  .drawer-backdrop{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  .deal-drawer{animation:none!important}
  .bitrix-date-picker [data-picker-day]{
    min-width:40px!important;min-height:44px!important;height:44px!important;
    touch-action:manipulation!important;-webkit-tap-highlight-color:transparent;
  }
}

/* The phone layout is one column even when a mobile browser reports a wide
   layout viewport. A narrow fine-pointer desktop keeps its configured pairs. */
@media (hover:none), (pointer:coarse), (any-pointer:coarse) {
  .deal-drawer .deal-view-layout,
  .deal-drawer .deal-layout-editor,
  .deal-drawer .deal-section-columns-1,
  .deal-drawer .deal-section-columns-2{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
  }
}

/* v152 — Android browsers can expose a desktop-sized layout viewport and a
   fine pointer. The runtime class is based on UA, touch and physical screen
   evidence, so the actual phone contract does not depend on unreliable media
   features. Keep the entire deal canvas inside the device and always stack
   configured field pairs into one readable column. */
html.orbito-mobile-device,
html.orbito-mobile-device body{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  overflow-x:hidden!important;
}
html.orbito-mobile-device .drawer-backdrop{
  position:fixed!important;
  inset:0!important;
  width:100%!important;
  max-width:100%!important;
  padding:0!important;
  overflow:hidden!important;
}
html.orbito-mobile-device .drawer-backdrop .deal-drawer{
  position:fixed!important;
  inset:0!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:100dvh!important;
  max-height:100dvh!important;
  overflow:hidden!important;
}
html.orbito-mobile-device .deal-drawer .drawer-body{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
}
html.orbito-mobile-device .deal-drawer .bitrix-card-grid{
  display:flex!important;
  flex-direction:column!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
}
html.orbito-mobile-device .deal-drawer :is(
  .bitrix-card-left,.bitrix-card-right,.deal-section,.bitrix-deal-panel,
  .deal-field-section,.deal-view-layout,.deal-layout-editor,
  .deal-section-columns-1,.deal-section-columns-2
){
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
html.orbito-mobile-device .deal-drawer :is(
  .deal-view-layout,.deal-layout-editor,
  .deal-section-columns-1,.deal-section-columns-2
){
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
}
html.orbito-mobile-device .deal-drawer :is(
  .deal-view-layout-row,.deal-layout-row,.deal-view-field-main,
  .deal-field-control,.deal-view-field-main>span
){
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}

/* v149: Messenger is a real CRM section. It aligns exactly with the current
   sidebar, fully covers the previous page and never reveals the calendar or
   kanban through translucent page layers. */
.orbito-messenger-workspace{
  inset:0 0 0 var(--sidebar-wide)!important;
  z-index:92!important;
  background:var(--panel)!important;
  isolation:isolate;
}
body:has(.app-shell.sidebar-collapsed) .orbito-messenger-workspace{
  left:var(--sidebar-narrow)!important;
}
.orbito-messenger-workspace::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background:
    radial-gradient(circle at 85% 8%,color-mix(in srgb,var(--green) 12%,transparent),transparent 30%),
    var(--panel);
}
.orbito-messenger-layout,
.orbito-chat-list,
.orbito-chat-list>label,
.orbito-chat-pane>header,
.orbito-chat-pane>footer{
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
.orbito-messenger-mobile-exit{display:none}
.orbito-messenger-mobile-exit[data-messenger-return-deal]{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--ink);font:600 13px Manrope,Arial,sans-serif;cursor:pointer}
@media(max-width:720px){
  .orbito-messenger-workspace{inset:0!important;z-index:140!important}
  .orbito-messenger-mobile-exit{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--ink);font:600 13px Manrope,Arial,sans-serif;cursor:pointer}
}

/* v153: Messenger is an opaque CRM workspace. The previous page must never
   bleed through its title bar or gutters while the internal panels retain
   their own depth and theme treatment. */
.orbito-messenger-workspace{
  --messenger-page-solid:#eef4f0;
  --messenger-bar-solid:#f6faf7;
  background:var(--messenger-page-solid)!important;
}
body.theme-dark .orbito-messenger-workspace{
  --messenger-page-solid:#07130e;
  --messenger-bar-solid:#0f231c;
}
.orbito-messenger-workspace::before{
  background:
    radial-gradient(circle at 85% 8%,color-mix(in srgb,var(--green) 12%,transparent),transparent 30%),
    var(--messenger-page-solid)!important;
}
.orbito-chat-list>label,
.orbito-chat-pane>header,
.orbito-chat-pane>footer{
  background:var(--messenger-bar-solid)!important;
}

/* v154: employees such as Irina do not receive field-management controls.
   The old v97 rule still forced every view row into the owner's three-column
   control grid, so the only remaining field button auto-landed in the 26px
   drag-handle column. Collapse those control-less rows to the actual content
   column, including the inline editor and its date picker. */
body:not(.can-manage-fields) .deal-drawer .deal-view-layout-row.no-layout-tools{
  grid-template-columns:minmax(0,1fr)!important;
}
body:not(.can-manage-fields) .deal-drawer .deal-view-layout-row.no-layout-tools > :is(
  .deal-view-field-main,
  .editable-deal-field.editing,
  .bitrix-date-picker
){
  grid-column:1/-1!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}

/* v155: a schedule value is both a text field and a calendar field. Managers
   can select the visible value, erase it and save an explicit empty schedule;
   the adjacent button preserves the existing shared calendar. */
.deal-drawer .inline-date-text-editor{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:6px!important;
}
.deal-drawer .inline-date-text-controls{
  display:grid;
  grid-template-columns:minmax(0,1fr) 40px;
  align-items:stretch;
  gap:7px;
  min-width:0;
  width:100%;
}
.deal-drawer .inline-date-text-input{
  grid-column:1!important;
  width:100%!important;
  min-width:0!important;
  min-height:40px;
  border:1px solid color-mix(in srgb,var(--line) 86%,#9aa9a1)!important;
  border-radius:9px;
  background:var(--input,var(--panel,#fff));
  color:var(--ink);
  padding:9px 11px!important;
  font:600 12px/1.35 Manrope;
}
.deal-drawer .inline-date-text-input:focus{
  border-color:var(--green)!important;
  outline:none;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--green) 14%,transparent);
}
.deal-drawer .inline-date-text-input.is-invalid{
  border-color:#d95b4f!important;
  box-shadow:0 0 0 3px rgba(217,91,79,.12);
}
.deal-drawer .inline-date-calendar-button{
  grid-column:2!important;
  display:grid;
  width:40px!important;
  min-width:40px;
  max-width:40px!important;
  min-height:40px;
  place-items:center;
  border:1px solid color-mix(in srgb,var(--line) 86%,#9aa9a1);
  border-radius:9px;
  background:var(--input,var(--panel,#fff));
  color:var(--muted);
  font:700 17px/1 Manrope;
  cursor:pointer;
}
.deal-drawer .inline-date-calendar-button:hover,
.deal-drawer .inline-date-calendar-button:focus-visible{
  border-color:var(--green);
  color:var(--green);
  outline:none;
}
@media(max-width:720px){
  .deal-drawer .inline-date-text-controls{grid-template-columns:minmax(0,1fr) 44px!important}
  .deal-drawer .deal-view-layout-row>.editable-deal-field.editing .inline-date-text-controls>.inline-date-text-input{grid-column:1!important;min-width:0!important;max-width:100%!important}
  .deal-drawer .inline-date-calendar-button{grid-column:2!important;width:44px!important;min-width:44px!important;max-width:44px!important;min-height:44px}
  .deal-drawer .inline-date-text-input{min-height:44px}
}

/* v185-kanban-content-rows: compact cards render only rows that have content. */
:root{
  --kanban-type-title:13px;
  --kanban-type-body:11px;
  --kanban-type-meta:10px;
  --kanban-type-label:9px;
  --kanban-type-price:16px;
}
.board:not(.list-mode) .lead-card{
  display:flex!important;
  flex-direction:column!important;
  width:100%!important;
  flex:0 0 auto!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:hidden!important;
  padding:8px 8px 5px!important;
  gap:0!important;
  transition:transform .15s,box-shadow .15s!important;
  animation:none!important;
  font-family:Manrope,Arial,sans-serif!important;
}
.board:not(.list-mode) .lead-card.has-flag{padding-top:22px!important}
.board:not(.list-mode) .lead-card *{font-family:Manrope,Arial,sans-serif!important}
.board:not(.list-mode) .lead-top>span{font:700 var(--kanban-type-title)/1.25 Manrope,Arial,sans-serif!important;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis}
.board:not(.list-mode) .lead-card>p{margin:2px 0 3px!important;font:500 var(--kanban-type-body)/1.3 Manrope,Arial,sans-serif!important;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis}
.board:not(.list-mode) .lead-value{flex:0 0 28px!important;min-height:28px!important;padding:3px 0!important;font:600 var(--kanban-type-body)/1.2 Manrope,Arial,sans-serif!important}
.board:not(.list-mode) .lead-value strong{font:800 var(--kanban-type-price)/1.2 Manrope,Arial,sans-serif!important;color:var(--green)!important}
.board:not(.list-mode) .source{font:600 var(--kanban-type-meta)/1 Manrope,Arial,sans-serif!important;padding:3px 5px!important}
.board:not(.list-mode) .card-field{flex:0 0 21px!important;min-height:21px!important;margin-top:2px!important;padding-top:3px!important}
.board:not(.list-mode) .card-field{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:6px!important}
.board:not(.list-mode) .card-field small{font:500 var(--kanban-type-label)/1.2 Manrope,Arial,sans-serif!important}
.board:not(.list-mode) .card-field b{min-width:0;font:650 var(--kanban-type-body)/1.2 Manrope,Arial,sans-serif!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.board:not(.list-mode) .lead-meta{display:block!important;flex:0 0 14px!important;min-height:14px!important;margin-top:0!important;padding:1px 0!important;font:600 var(--kanban-type-meta)/1.3 Manrope,Arial,sans-serif!important;overflow:hidden!important}
.board:not(.list-mode) .lead-meta span,.board:not(.list-mode) .lead-meta span>b{font:600 var(--kanban-type-meta)/1.3 Manrope,Arial,sans-serif!important}
.board:not(.list-mode) .lead-messenger{display:flex!important;align-items:center!important;gap:4px!important;min-height:14px!important;padding:1px 0!important;color:var(--muted);font:600 var(--kanban-type-meta)/1.3 Manrope,Arial,sans-serif!important;white-space:nowrap!important;overflow:hidden!important}
.board:not(.list-mode) .lead-messenger>i{display:grid!important;place-items:center!important;flex:0 0 12px!important;width:12px!important;height:12px!important}
.board:not(.list-mode) .lead-messenger>i svg{display:block;width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.35;stroke-linecap:round;stroke-linejoin:round}
.board:not(.list-mode) .lead-messenger>b{min-width:0;overflow:hidden;text-overflow:ellipsis;font:700 var(--kanban-type-meta)/1.3 Manrope,Arial,sans-serif!important;color:inherit!important}
.board:not(.list-mode) .card-owner{flex:0 0 21px!important;min-height:21px!important;margin-top:0!important;padding-top:2px!important}
.board:not(.list-mode) .card-owner>button{font:650 var(--kanban-type-meta)/1.25 Manrope,Arial,sans-serif!important}
.board:not(.list-mode) .card-owner>button strong{font-size:var(--kanban-type-meta)!important}
@media (min-width:901px){
  .deal-drawer .drawer-body{padding:12px 14px 18px!important}
  .deal-drawer .deal-section{padding:14px 15px!important;margin-bottom:9px!important}
  .deal-drawer .deal-field-sections{gap:10px!important;margin-top:9px!important}
  .deal-drawer .deal-field-section{padding:8px 10px 2px!important}
  .deal-drawer .deal-view-layout-row{min-height:48px!important}
  .deal-drawer .deal-view-field-main{min-height:47px!important;padding:5px 0!important}
  .deal-drawer .bitrix-amount{min-height:76px!important}
}

/* v187-kanban-typography-readonly-total: approved compact hierarchy. */
:root{
  --kanban-type-title:15px;
  --kanban-type-body:13px;
  --kanban-type-meta:12px;
  --kanban-type-label:11px;
  --kanban-type-price:20px;
}
.board:not(.list-mode) .stage-cap strong{
  min-width:0;
  font:700 13px/1.2 Manrope,Arial,sans-serif!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.board:not(.list-mode) .stage-cap>span{font:700 11px/1 Manrope,Arial,sans-serif!important}
.board:not(.list-mode) .column-total{
  display:grid!important;
  place-items:center!important;
  align-content:center!important;
  flex:0 0 auto!important;
  height:auto!important;
  min-height:38px!important;
  margin:0 0 3px!important;
  padding:4px 5px!important;
  line-height:1.1!important;
}
.board:not(.list-mode) .column-total>strong{
  display:block;
  max-width:100%;
  font:750 14px/1.15 Manrope,Arial,sans-serif!important;
  color:var(--ink);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.board:not(.list-mode) .column-total>small{
  display:block;
  margin-top:2px;
  font:600 9px/1 Manrope,Arial,sans-serif!important;
  color:var(--muted);
}
.board:not(.list-mode) .lead-card{
  padding:10px 10px 8px!important;
  gap:5px!important;
}
.board:not(.list-mode) .lead-card.has-flag{padding-top:27px!important}
.board:not(.list-mode) .lead-card>p{display:none!important;margin:0!important;min-height:0!important}
.board:not(.list-mode) .lead-top{display:flex!important;min-width:0!important;width:100%!important}
.board:not(.list-mode) .lead-top>span{
  display:block!important;
  min-width:0!important;
  width:100%!important;
  font:750 var(--kanban-type-title)/1.25 Manrope,Arial,sans-serif!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.board:not(.list-mode) .lead-value{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  flex:0 0 auto!important;
  min-height:0!important;
  padding:0!important;
}
.board:not(.list-mode) .lead-value strong{
  min-width:0;
  font:800 var(--kanban-type-price)/1.1 Manrope,Arial,sans-serif!important;
  white-space:nowrap!important;
}
.board:not(.list-mode) .source{
  flex:0 1 auto!important;
  max-width:72px!important;
  padding:4px 7px!important;
  font:700 var(--kanban-type-label)/1 Manrope,Arial,sans-serif!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.board:not(.list-mode) .card-field{
  flex:0 0 auto!important;
  min-height:0!important;
  margin:0!important;
  padding:1px 0 0!important;
  border:0!important;
}
.board:not(.list-mode) .card-field small{font:500 var(--kanban-type-label)/1.2 Manrope,Arial,sans-serif!important}
.board:not(.list-mode) .card-field b{font:700 var(--kanban-type-body)/1.2 Manrope,Arial,sans-serif!important}
.board:not(.list-mode) .lead-meta,
.board:not(.list-mode) .lead-messenger{
  flex:0 0 auto!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  font:600 var(--kanban-type-meta)/1.3 Manrope,Arial,sans-serif!important;
}
.board:not(.list-mode) .lead-meta span,
.board:not(.list-mode) .lead-meta span>b,
.board:not(.list-mode) .lead-messenger>b{font:650 var(--kanban-type-meta)/1.3 Manrope,Arial,sans-serif!important}
.board:not(.list-mode) .card-owner{
  flex:0 0 auto!important;
  min-height:0!important;
  margin:1px 0 0!important;
  padding:0!important;
}
.board:not(.list-mode) .card-owner>button{width:100%;min-width:0;font:700 var(--kanban-type-meta)/1.25 Manrope,Arial,sans-serif!important}
.board:not(.list-mode) .card-owner>button span:last-child{min-width:0}
.board:not(.list-mode) .card-owner>button small{display:none!important}
.board:not(.list-mode) .card-owner>button strong{
  display:block;
  min-width:0;
  font:700 var(--kanban-type-meta)/1.25 Manrope,Arial,sans-serif!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.deal-drawer .computed-deal-total{
  cursor:not-allowed!important;
  color:var(--ink)!important;
  background:color-mix(in srgb,var(--panel,#fff) 72%,var(--line))!important;
  opacity:1!important;
}
.deal-drawer .bitrix-amount-value.is-readonly{cursor:default!important}
.deal-drawer .bitrix-amount-value.is-readonly>em,
.deal-drawer .deal-view-field-main.is-readonly>span>em{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font:600 9px/1.2 Manrope,Arial,sans-serif;
  font-style:normal;
}
.deal-drawer .deal-view-field-main.is-readonly{cursor:default!important}

/* v189-kanban-compact-proportions: owner-approved compact Kanban scale. */
:root{
  --compact-column:210px;
  --kanban-stage-height:35px;
  --kanban-type-stage:12px;
  --kanban-type-title:14px;
  --kanban-type-body:12px;
  --kanban-type-meta:12px;
  --kanban-type-label:10px;
  --kanban-type-price:13px;
}
.topbar h1{font-size:26px!important}
.board:not(.list-mode){
  grid-template-columns:repeat(var(--stage-count,22),var(--compact-column))!important;
  grid-auto-columns:var(--compact-column)!important;
}
.board:not(.list-mode) .column{
  flex:0 0 var(--compact-column)!important;
  inline-size:var(--compact-column)!important;
  width:var(--compact-column)!important;
  min-width:var(--compact-column)!important;
  max-width:var(--compact-column)!important;
}
.board:not(.list-mode) .stage-cap{
  height:var(--kanban-stage-height)!important;
  min-height:var(--kanban-stage-height)!important;
  padding:6px 11px!important;
}
.board:not(.list-mode) .stage-cap strong,
.board:not(.list-mode) .stage-cap>span{
  font:650 var(--kanban-type-stage)/1.2 Manrope,Arial,sans-serif!important;
}
.board:not(.list-mode) .column-total{
  min-height:35px!important;
  margin:0 0 3px!important;
  padding:3px 7px!important;
}
.board:not(.list-mode) .column-total>strong{
  font:650 14px/1.25 Manrope,Arial,sans-serif!important;
}
.board:not(.list-mode) .column-total>small{
  margin-top:1px!important;
  font:500 10px/1.25 Manrope,Arial,sans-serif!important;
}
.board:not(.list-mode) .column-cards{
  padding:2px 2px 14px!important;
  scrollbar-width:thin;
}
.board:not(.list-mode) .column-cards::-webkit-scrollbar{width:4px}
.board:not(.list-mode) .lead-card{
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0 0 6px!important;
  padding:10px!important;
  gap:6px!important;
  border-radius:10px!important;
  font-family:Manrope,Arial,sans-serif!important;
}
.board:not(.list-mode) .lead-card.has-flag{padding-top:36px!important}
.board:not(.list-mode) .lead-flag{
  top:7px!important;
  left:10px!important;
  right:10px!important;
  width:auto!important;
  height:auto!important;
  min-height:20px!important;
  padding:3px 6px!important;
  font:600 10px/1.2 Manrope,Arial,sans-serif!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.board:not(.list-mode) .lead-top>span{
  font:650 var(--kanban-type-title)/1.3 Manrope,Arial,sans-serif!important;
  min-width:0!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.board:not(.list-mode) .lead-value{
  gap:6px!important;
  min-height:16px!important;
}
.board:not(.list-mode) .lead-value strong{
  font:650 var(--kanban-type-price)/1.2 Manrope,Arial,sans-serif!important;
  white-space:nowrap!important;
}
.board:not(.list-mode) .source{
  max-width:82px!important;
  padding:4px 7px!important;
  border-radius:999px!important;
  font:650 var(--kanban-type-label)/1 Manrope,Arial,sans-serif!important;
}
.board:not(.list-mode) .card-field,
.board:not(.list-mode) .lead-meta,
.board:not(.list-mode) .lead-messenger,
.board:not(.list-mode) .card-owner{
  min-height:16px!important;
  margin:0!important;
  padding:0!important;
}
.board:not(.list-mode) .card-field{
  display:grid!important;
  grid-template-columns:14px auto minmax(0,1fr)!important;
  align-items:center!important;
  justify-content:stretch!important;
  column-gap:6px!important;
}
.board:not(.list-mode) .card-field small{
  font:500 var(--kanban-type-body)/1.3 Manrope,Arial,sans-serif!important;
}
.board:not(.list-mode) .card-field b{
  font:700 var(--kanban-type-body)/1.3 Manrope,Arial,sans-serif!important;
  text-align:left!important;
}
.board:not(.list-mode) .card-row-icon,
.board:not(.list-mode) .lead-meta span>i,
.board:not(.list-mode) .lead-messenger>i{
  display:grid!important;
  place-items:center!important;
  flex:0 0 14px!important;
  width:14px!important;
  height:14px!important;
  color:var(--muted)!important;
}
.board:not(.list-mode) .card-row-icon svg,
.board:not(.list-mode) .lead-meta span>i svg,
.board:not(.list-mode) .lead-messenger>i svg{
  display:block!important;
  width:14px!important;
  height:14px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.6!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
.board:not(.list-mode) .lead-meta span,
.board:not(.list-mode) .lead-messenger{
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
  font:500 var(--kanban-type-meta)/1.3 Manrope,Arial,sans-serif!important;
}
.board:not(.list-mode) .lead-meta span>b,
.board:not(.list-mode) .lead-messenger>b{
  font:500 var(--kanban-type-meta)/1.3 Manrope,Arial,sans-serif!important;
}
.board:not(.list-mode) .card-owner>button{
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
  width:100%!important;
  min-width:0!important;
  font:650 var(--kanban-type-meta)/1.3 Manrope,Arial,sans-serif!important;
}
.board:not(.list-mode) .card-owner>button strong{
  font:650 var(--kanban-type-meta)/1.3 Manrope,Arial,sans-serif!important;
}
@media(max-width:720px){
  :root{--compact-column:210px;--kanban-stage-height:35px;}
  .board:not(.list-mode){
    grid-template-columns:repeat(var(--stage-count,22),var(--compact-column))!important;
    grid-auto-columns:var(--compact-column)!important;
  }
}
:root .manual-deal-tasks:empty{display:none}
.manual-task-status{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:0 12px 12px;font:inherit}
.manual-task-status small{font-size:12px;line-height:1.4}
.manual-task-actions{display:flex;flex-wrap:wrap;gap:8px}
.manual-task-actions button{font:inherit;font-size:12px;padding:6px 10px}

/* V193 — calendar appointment backbone */
.appointment-form label{display:block;margin:0 0 12px;color:#48544e;font:700 10px Manrope}
.appointment-form input:not([type=number]):not([type=hidden]),
.appointment-form select,
.appointment-form textarea{display:block;width:100%;margin-top:6px;border:1px solid #dfe5df;border-radius:8px;padding:9px 11px;background:#fff;color:var(--ink);font:500 12px Manrope;outline:none}
.appointment-form input[type=number]{display:block;width:100%;margin-top:6px;border:1px solid #dfe5df;border-radius:8px;padding:9px 11px;background:#fff;color:var(--ink);font:500 12px Manrope;outline:none}
.appointment-form textarea{resize:vertical;min-height:64px}
.appointment-form input:focus,.appointment-form select:focus,.appointment-form textarea:focus{border-color:var(--green)}
.appointment-kind-toggle{display:flex;gap:6px;padding:4px;margin-bottom:14px;background:#f0f2ed;border-radius:10px}
.appointment-kind-toggle button{flex:1;border:0;border-radius:8px;padding:9px 10px;background:transparent;color:#65706a;font:600 10px Manrope;cursor:pointer}
.appointment-kind-toggle button.active{background:#fff;color:var(--green);box-shadow:0 1px 4px rgba(23,40,31,.12)}
.appointment-form[data-kind=availability] .appointment-field-booking{display:none}
.appointment-form[data-kind=booking] .appointment-field-availability{display:none}
.appointment-status-row{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid #dfe5df;border-radius:10px;margin-bottom:12px;background:#f8f9f6}
.appointment-status-row[hidden]{display:none}
.appointment-status-row select{flex:1}
.appointment-status-row .status-label{font:700 9px Manrope;color:#65706a;text-transform:uppercase;letter-spacing:.04em}
.appointment-audit-summary{font:500 10px Manrope;color:#65706a;padding:8px 10px;border-top:1px dashed #dfe5df;margin-top:6px}
.appointment-audit-summary b{font:700 9px Manrope;color:var(--green)}
.appointment-error{font:600 11px Manrope;color:#b42318;background:#fef3f2;border:1px solid #fda29b;border-radius:8px;padding:10px 12px;margin-bottom:10px}
.appointment-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;margin-top:6px}
.appointment-actions button{flex:0 0 auto}
.appointment-actions .primary-button{background:var(--green);color:#fff;border:0;border-radius:8px;padding:10px 14px;font:700 11px Manrope;cursor:pointer}
.appointment-actions .primary-button[disabled]{opacity:.6;cursor:wait}
.appointment-actions .secondary-button{background:#eef0eb;color:#48544e;border:0;border-radius:8px;padding:9px 12px;font:600 11px Manrope;cursor:pointer}
.appointment-actions .secondary-button:hover{background:#e3e7df}
.calendar-appointment-row{position:relative;padding-left:14px}
.calendar-appointment-row::before{content:"";position:absolute;left:4px;top:8px;bottom:8px;width:4px;border-radius:2px;background:var(--calendar-appointment-color,#9ca3af)}
.calendar-appointment-row.status-archived{opacity:.65}
.calendar-appointment-row.status-archived::before{background:#9ca3af}
.calendar-appointment-row.status-completed::before{background:#22c55e}
.calendar-appointment-row.status-cancelled,.calendar-appointment-row.status-no_show::before{background:#ef4444}
.calendar-appointment-row.status-confirmed_paid::before{background:#8b5cf6}
.calendar-appointment-row.status-reserved_unpaid::before{background:#3f9ce1}
.calendar-appointment-row.status-needs_outcome::before{background:#f97316}
.calendar-appointment-row.status-available::before{background:#facc15}
.calendar-appointment-row .compact-line{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:11px;color:#48544e}
.calendar-appointment-row .compact-line .sum{font-weight:700;color:var(--ink)}
.calendar-appointment-row .compact-line .pill{display:inline-block;padding:2px 7px;border-radius:10px;background:#eef3ef;color:var(--green);font:700 8px Manrope;text-transform:uppercase;letter-spacing:.04em}
.calendar-appointment-row .compact-line .pill.archived{background:#eef0eb;color:#65706a}
.calendar-appointment-row .row-actions{display:flex;gap:6px;margin-top:6px;flex-wrap:wrap}
.calendar-appointment-row .row-actions button{border:1px solid #dfe5df;background:#fff;color:#48544e;border-radius:8px;padding:5px 9px;font:600 9px Manrope;cursor:pointer}
.calendar-appointment-row .row-actions button:hover{background:#f5f7f4}
.calendar-appointment-row .row-actions button.danger{color:#b42318;border-color:#fda29b;background:#fef3f2}
.calendar-appointment-row .row-actions button.primary{color:#fff;background:var(--green);border-color:var(--green)}
body.theme-dark .appointment-form input,body.theme-dark .appointment-form select,body.theme-dark .appointment-form textarea{background:#1c2624;color:#dfeae4;border-color:#2a3631}
body.theme-dark .appointment-status-row{background:#1f2a27;border-color:#2a3631;color:#dfeae4}
body.theme-dark .calendar-appointment-row .row-actions button{background:#1c2624;color:#dfeae4;border-color:#2a3631}
body.theme-dark .appointment-error{background:#3b1817;border-color:#7f1d1d;color:#fecaca}

/* V194 — calendar clarity: stable controls, readable titles and full-width month events. */
.calendar-appointment-row{
  grid-template-columns:72px 4px minmax(220px,1fr) auto!important;
  gap:14px!important;
  margin:7px 0!important;
  padding:14px 12px 14px 18px!important;
  border:1px solid color-mix(in srgb,var(--calendar-appointment-color) 28%,var(--liquid-line-soft))!important;
  border-radius:12px!important;
  background:color-mix(in srgb,var(--calendar-appointment-color) 8%,var(--panel))!important;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease!important;
}
.calendar-appointment-row>i{background:var(--calendar-appointment-color)!important}
.calendar-appointment-row strong{font:700 14px/1.3 Onest!important;color:var(--ink)!important}
.calendar-appointment-row small{display:flex!important;align-items:center;gap:8px;margin-top:6px!important;font:500 10px/1.25 Manrope!important}
.appointment-state-badge{
  display:inline-flex;align-items:center;min-height:22px;padding:3px 8px;border-radius:999px;
  background:color-mix(in srgb,var(--calendar-appointment-color) 18%,transparent);
  color:var(--ink);font:700 9px/1 Manrope;
}
.calendar-appointment-row .row-actions{align-items:center;justify-content:flex-end;flex-wrap:nowrap!important;margin:0!important}
.calendar-appointment-row .row-actions button{white-space:nowrap}
.appointment-status-picker{display:grid!important;grid-template-columns:auto 132px;align-items:center;gap:7px;margin:0!important;color:var(--muted)!important}
.appointment-status-picker>span{font:700 8px/1 Manrope;text-transform:uppercase;letter-spacing:.05em}
.appointment-status-picker select{
  width:132px;height:31px;margin:0!important;padding:0 26px 0 9px!important;
  border:1px solid color-mix(in srgb,var(--calendar-appointment-color) 35%,var(--liquid-line-soft))!important;
  border-radius:8px;background:var(--panel);color:var(--ink);font:700 9px/1 Manrope;
}
.calendar-month-day{min-width:0!important;padding:8px!important}
.calendar-month-day .calendar-event.calendar-month-event{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto auto auto!important;align-items:start!important;gap:2px!important;
  width:100%!important;max-width:100%!important;height:auto!important;min-height:50px!important;
  margin-top:5px!important;padding:6px 8px!important;overflow:hidden!important;
  border-left:4px solid var(--calendar-appointment-color,var(--green))!important;
  background:color-mix(in srgb,var(--calendar-appointment-color,var(--green)) 11%,var(--panel))!important;
  box-sizing:border-box!important;
}
.calendar-month-day .calendar-month-event b{display:block!important;margin:0!important;color:var(--calendar-appointment-color,var(--ink))!important;font:800 10px/1.15 Manrope!important}
.calendar-month-day .calendar-month-event span{display:-webkit-box!important;min-width:0!important;margin:0!important;color:var(--ink)!important;font:600 10px/1.2 Manrope!important;white-space:normal!important;overflow:hidden!important;text-overflow:ellipsis!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow-wrap:anywhere}
.calendar-month-day .calendar-month-event small{display:block!important;min-width:0!important;margin:0!important;color:var(--muted)!important;font:600 8px/1.15 Manrope!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.calendar-month-grid{min-height:900px!important}
.calendar-month-day{min-height:150px!important}
.appointment-form label{color:var(--muted)!important;font:700 11px/1.25 Manrope!important}
.appointment-form input:not([type=hidden]),.appointment-form select,.appointment-form textarea{
  min-height:43px!important;border-color:var(--liquid-line-soft)!important;background:var(--panel)!important;color:var(--ink)!important;
}
body.theme-dark .appointment-form label{color:#9fb0a8!important}
body.theme-dark .appointment-form input[type=date],body.theme-dark .appointment-form input[type=time]{color-scheme:dark;background:#1c2624!important;color:#dfeae4!important}
body.theme-dark .calendar-appointment-row{background:color-mix(in srgb,var(--calendar-appointment-color) 13%,var(--panel))!important}
body.theme-dark .appointment-status-picker select{background:#16211d!important;color:#e7f0eb!important}
@media(max-width:1100px){
  .calendar-appointment-row{grid-template-columns:58px 4px minmax(180px,1fr)!important}
  .calendar-appointment-row .row-actions{grid-column:3;justify-content:flex-start;flex-wrap:wrap!important}
}

/* V195 — one compact booking form; availability is a calendar tool, not a client row. */
.calendar-section-head{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:12px!important;flex-wrap:wrap}
.calendar-create-mode{display:flex;align-items:center;gap:4px;padding:3px;border:1px solid var(--liquid-line-soft);border-radius:9px;background:color-mix(in srgb,var(--panel) 82%,transparent)}
.calendar-create-mode>span{padding:0 7px;color:var(--muted);font:650 9px/1 Manrope}
.calendar-create-mode button{height:29px;border:0;border-radius:6px;padding:0 10px;background:transparent;color:var(--muted);font:700 9px/1 Manrope;cursor:pointer;white-space:nowrap}
.calendar-create-mode button.active{background:var(--panel);color:var(--green);box-shadow:0 1px 4px rgba(23,40,31,.12)}
.appointment-form-context{display:flex;align-items:baseline;justify-content:space-between;gap:14px;margin:0 0 14px;padding:0 0 11px;border-bottom:1px solid var(--liquid-line-soft)}
.appointment-form-context strong{color:var(--ink);font:700 14px/1.2 Onest}
.appointment-form-context small{color:var(--muted);font:550 9px/1.3 Manrope;text-align:right}
.appointment-form[data-kind=availability] .form-row{grid-template-columns:repeat(3,minmax(0,1fr))}
.appointment-actions button.danger{border-color:#f3a9a3!important;background:#fff5f4!important;color:#b42318!important}
body.theme-dark .appointment-actions button.danger{border-color:#7f312d!important;background:#351b19!important;color:#fda29b!important}
.appointment-status-row{display:grid!important;grid-template-columns:105px minmax(0,1fr);align-items:center!important;gap:10px!important;padding:8px 10px!important}
.appointment-status-row[hidden]{display:none!important}
.appointment-form select,.appointment-status-row select,.appointment-status-picker select{
  appearance:none!important;-webkit-appearance:none!important;
  padding-right:36px!important;
  position:relative!important;
}
.appointment-form select::after,.appointment-status-row select::after,.appointment-status-picker select::after{
  content:"";position:absolute;right:11px;top:50%;width:16px;height:16px;transform:translateY(-50%) rotate(0deg);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m5 7.5 5 5 5-5' stroke='%2388948d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:center;background-size:16px 16px;pointer-events:none;transition:transform .15s ease;
}
.appointment-form select:focus,.appointment-status-row select:focus,.appointment-status-picker select:focus{
  border-color:var(--green)!important;
  box-shadow:0 0 0 3px rgba(106,174,245,.11)!important;
}
.appointment-form select:focus::after,.appointment-status-row select:focus::after,.appointment-status-picker select:focus::after{
  transform:translateY(-50%) rotate(180deg);
}
.calendar-event-position{
  left:4px!important;right:4px!important;box-sizing:border-box!important;
}
.calendar-event-position .calendar-event{
  display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;
  width:100%!important;height:100%;min-height:100%!important;box-sizing:border-box!important;
  gap:2px!important;padding:6px 7px!important;border-radius:7px!important;
}
.calendar-event-position.availability-position{z-index:1}
.calendar-event-position.booking-position{z-index:3}
#calendarPage[data-create-mode=booking] .calendar-event-position.availability-position{
  left:0!important;right:0!important;pointer-events:none!important;
}
.calendar-availability-background{
  width:100%;height:100%;min-height:100%;box-sizing:border-box;
  border:0;border-left:3px solid color-mix(in srgb,var(--green) 52%,transparent);
  border-radius:5px;
  background:color-mix(in srgb,var(--green) 7%,transparent);
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--green) 9%,transparent);
  pointer-events:none;
}
.calendar-time-view .calendar-event b{margin:0!important;font:750 9px/1.1 Manrope!important}
.calendar-time-view .calendar-event span{margin:0!important;font:650 9px/1.2 Manrope!important}
.calendar-time-view .calendar-event small{display:none!important}
.calendar-event.availability-block{
  border:1px dashed color-mix(in srgb,#facc15 58%,var(--liquid-line-soft))!important;
  border-left:3px solid #facc15!important;
  background:repeating-linear-gradient(135deg,color-mix(in srgb,#facc15 8%,var(--panel)) 0 10px,color-mix(in srgb,#facc15 13%,var(--panel)) 10px 20px)!important;
  color:var(--muted)!important;box-shadow:none!important;
}
#calendarPage[data-create-mode=booking] .calendar-time-column>i.outside-availability{
  cursor:not-allowed!important;
  background:repeating-linear-gradient(135deg,transparent 0 9px,color-mix(in srgb,var(--muted) 5%,transparent) 9px 10px)!important;
}
#calendarPage[data-create-mode=booking] .calendar-time-column>i.outside-availability:hover{
  background-color:color-mix(in srgb,var(--muted) 5%,transparent)!important;
}
#calendarPage[data-create-mode=availability] .calendar-time-column{cursor:cell}
body.theme-dark .calendar-create-mode{background:rgba(20,34,28,.5)}
body.theme-dark .calendar-create-mode button.active{background:#1c2624}
body.theme-dark .appointment-form select,body.theme-dark .appointment-status-row select,body.theme-dark .appointment-status-picker select{background-color:#1c2624!important;color:#dfeae4!important}
body.theme-dark .appointment-form select::after,body.theme-dark .appointment-status-row select::after,body.theme-dark .appointment-status-picker select::after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m5 7.5 5 5 5-5' stroke='%239fb0a8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")!important}
@media(max-width:720px){
  .calendar-create-mode{width:100%;display:grid;grid-template-columns:1fr 1fr}
  .calendar-create-mode>span{grid-column:1/-1;padding:5px 7px 3px}
  .appointment-form-context{align-items:flex-start;flex-direction:column;gap:4px}
  .appointment-form-context small{text-align:left}
  .appointment-form[data-kind=availability] .form-row{grid-template-columns:1fr}
}

/* V196 — owner-only direct availability editing and compact overview modes. */
.calendar-create-mode[hidden]{display:none!important}
.calendar-event.availability-block{cursor:grab!important;touch-action:none}
.calendar-event.availability-block:active{cursor:grabbing!important}
.calendar-event.availability-block.availability-locked{cursor:default!important;touch-action:auto}
.calendar-time-column.is-availability-editing{user-select:none}
.availability-resize-handle{position:absolute;left:5px;right:5px;bottom:0;height:9px;border:0;border-radius:4px;cursor:ns-resize;background:linear-gradient(transparent 2px,color-mix(in srgb,#b78b00 58%,transparent) 2px 4px,transparent 4px)!important;opacity:.75}
.calendar-event-position.is-availability-drag-source,.calendar-event.is-availability-drag-source{opacity:.2!important}
.calendar-availability-drag-preview{position:fixed!important;z-index:220!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;box-sizing:border-box!important;margin:0!important;padding:6px 7px!important;overflow:hidden!important;border:1px dashed #d1a800!important;border-left:3px solid #facc15!important;border-radius:7px!important;background:color-mix(in srgb,#facc15 18%,var(--panel))!important;color:var(--ink)!important;box-shadow:0 18px 42px rgba(23,32,29,.25)!important;pointer-events:none!important;transform:scale(1.015);transform-origin:center;transition:left .05s linear,top .05s linear,width .05s linear,height .05s linear}
.calendar-availability-drag-preview b,.calendar-availability-drag-preview span{display:block!important;margin:0!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.calendar-availability-drag-preview b{font:750 9px/1.1 Manrope!important}.calendar-availability-drag-preview span{font:650 9px/1.2 Manrope!important}
.calendar-time-column.calendar-availability-drop-target{background:color-mix(in srgb,var(--green) 5%,transparent)!important;box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--green) 45%,transparent)!important}
.calendar-time-column>i.calendar-availability-drop-cell{background:color-mix(in srgb,var(--green) 16%,transparent)!important;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--green) 58%,transparent)!important}
.calendar-event.booking-draggable{cursor:grab!important;touch-action:none}
.calendar-event.booking-draggable:active{cursor:grabbing!important}
.calendar-time-column .calendar-event.booking-draggable,
.calendar-month-day .calendar-event.calendar-month-event.booking-draggable,
.calendar-two-weeks-day .calendar-event.calendar-month-event.booking-draggable{
  border-color:color-mix(in srgb,var(--calendar-appointment-color,var(--green)) 44%,var(--liquid-line-soft))!important;
  border-left-color:var(--calendar-appointment-color,var(--green))!important;
  background:color-mix(in srgb,var(--calendar-appointment-color,var(--green)) 26%,var(--panel))!important;
}
.calendar-event-position.is-booking-drag-source,.calendar-event.is-booking-drag-source{opacity:.2!important}
.calendar-booking-drag-preview{position:fixed!important;z-index:222!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;box-sizing:border-box!important;margin:0!important;padding:6px 7px!important;overflow:hidden!important;border:1px solid color-mix(in srgb,var(--calendar-appointment-color,var(--green)) 45%,var(--liquid-line-soft))!important;border-left:4px solid var(--calendar-appointment-color,var(--green))!important;border-radius:7px!important;background:color-mix(in srgb,var(--calendar-appointment-color,var(--green)) 14%,var(--panel))!important;color:var(--ink)!important;box-shadow:0 18px 42px rgba(23,32,29,.28)!important;pointer-events:none!important;transform:scale(1.015);transform-origin:center;transition:left .05s linear,top .05s linear,width .05s linear,height .05s linear}
.calendar-booking-drag-preview b,.calendar-booking-drag-preview span{display:block!important;margin:0!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.calendar-booking-drag-preview b{font:750 9px/1.1 Manrope!important}.calendar-booking-drag-preview span{font:650 9px/1.2 Manrope!important}
.calendar-time-column.calendar-booking-drop-target,.calendar-two-weeks-day.calendar-booking-drop-target{background:color-mix(in srgb,var(--green) 9%,var(--panel))!important;box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--green) 55%,transparent)!important}
.calendar-time-column>i.calendar-booking-drop-cell{background:color-mix(in srgb,var(--green) 18%,transparent)!important;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--green) 62%,transparent)!important}
.calendar-time-column.calendar-booking-drop-invalid,.calendar-two-weeks-day.calendar-booking-drop-invalid{background:color-mix(in srgb,#ef4444 8%,var(--panel))!important;box-shadow:inset 0 0 0 2px color-mix(in srgb,#ef4444 55%,transparent)!important}
.calendar-time-column.calendar-booking-drop-invalid>i.calendar-booking-drop-cell{background:color-mix(in srgb,#ef4444 16%,transparent)!important;box-shadow:inset 0 0 0 1px color-mix(in srgb,#ef4444 62%,transparent)!important}
.calendar-two-weeks-day.has-availability{background:color-mix(in srgb,var(--green) 4%,var(--panel))!important}
.calendar-two-weeks-date>span{display:flex;align-items:baseline;gap:4px}
.calendar-two-weeks-date>em{margin-left:auto;padding:2px 5px;border-radius:999px;background:color-mix(in srgb,var(--green) 10%,transparent);color:var(--green);font:700 8px/1.1 Manrope;font-style:normal;white-space:nowrap}

.calendar-month-grid{min-height:620px!important}
.calendar-month-day{min-height:103px!important;padding:6px!important}
.calendar-month-day .calendar-event.calendar-month-event,
.calendar-two-weeks-day .calendar-event.calendar-month-event{
  display:flex!important;align-items:center!important;gap:5px!important;
  width:100%!important;max-width:100%!important;height:24px!important;min-height:24px!important;
  margin-top:3px!important;padding:3px 5px!important;overflow:hidden!important;
  border-left:3px solid var(--calendar-appointment-color,var(--green))!important;
  border-radius:5px!important;background:color-mix(in srgb,var(--calendar-appointment-color,var(--green)) 11%,var(--panel))!important;
  box-sizing:border-box!important;
}
.calendar-month-day .calendar-month-event b,
.calendar-two-weeks-day .calendar-month-event b{display:block!important;flex:0 0 auto!important;margin:0!important;color:var(--calendar-appointment-color,var(--ink))!important;font:750 8px/1 Manrope!important}
.calendar-month-day .calendar-month-event span,
.calendar-two-weeks-day .calendar-month-event span{display:block!important;flex:1 1 auto!important;min-width:0!important;margin:0!important;color:var(--ink)!important;font:650 8px/1.15 Manrope!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.calendar-month-day .calendar-month-event small,.calendar-two-weeks-day .calendar-month-event small{display:none!important}

.calendar-two-weeks{border:1px solid var(--liquid-line-soft);border-radius:10px;overflow:hidden;background:var(--panel)}
.calendar-two-weeks-grid{display:grid;grid-template-columns:repeat(7,minmax(105px,1fr))}
.calendar-two-weeks-day{position:relative;min-height:142px;padding:6px;border-right:1px solid var(--liquid-line-soft);border-bottom:1px solid var(--liquid-line-soft);background:var(--panel);overflow:hidden}
.calendar-two-weeks-day.calendar-availability-drop-target{background:color-mix(in srgb,var(--green) 10%,var(--panel))!important;box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--green) 52%,transparent)!important}
.calendar-two-weeks-date{display:flex;align-items:baseline;gap:5px;width:max-content;height:24px;border-radius:999px;padding:0 7px;color:var(--ink);font:650 10px Onest}.calendar-two-weeks-date small{color:var(--muted);font:650 7px Manrope;text-transform:uppercase}.calendar-two-weeks-day.today>.calendar-two-weeks-date{background:var(--green);color:#fff}.calendar-two-weeks-day.today>.calendar-two-weeks-date small{color:inherit}
.calendar-two-weeks-day:nth-child(7n){border-right:0}
.calendar-two-weeks-day:nth-last-child(-n+7){border-bottom:0}
.calendar-two-weeks-day.weekend{background:color-mix(in srgb,var(--panel) 94%,#f0a35a)}
.calendar-two-weeks-day .availability-overview-block{cursor:grab!important;touch-action:none;border-style:dashed!important}
body.theme-dark .calendar-two-weeks{background:color-mix(in srgb,var(--panel) 94%,#0a130f)}
@media(max-width:720px){.calendar-two-weeks{min-width:735px}.calendar-two-weeks-day{min-height:118px}.calendar-month-day{min-height:92px!important}}

.calendar-source-legend{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 0 0}.calendar-source-legend[hidden]{display:none}.calendar-source-pill{display:inline-flex;align-items:center;gap:6px;min-height:28px;border:1px solid var(--line);border-radius:999px;background:var(--surface);padding:4px 9px;color:var(--muted);font:600 9px Manrope}.calendar-source-pill>i{width:10px;height:10px;border-radius:3px;background:var(--calendar-source-color);box-shadow:inset 0 0 0 1px rgba(0,0,0,.08)}.calendar-source-pill>strong{color:var(--ink);font-weight:750}.calendar-source-pill>small{font-size:8px;color:var(--muted)}.calendar-source-inline{border:1px solid var(--line);border-radius:999px;padding:4px 7px;color:var(--muted);font-size:8px;font-weight:700}
@media(max-width:720px){.calendar-source-legend{flex-wrap:nowrap;overflow-x:auto}.calendar-source-pill{flex:0 0 auto}}
.calendar-sync-status{margin-top:10px;padding:10px 12px;border:1px solid var(--line);border-left:3px solid #e2a348;border-radius:10px;background:var(--panel);color:var(--ink);font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.calendar-sync-status[hidden]{display:none}
.external-calendar-details{box-sizing:border-box;width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 40px);margin:auto;padding:24px;overflow:auto;border:1px solid var(--line);border-radius:20px;background:var(--panel,#fff);color:var(--ink,#17251f);box-shadow:0 24px 80px #0005;font:14px/1.55 Manrope,system-ui,sans-serif}
.external-calendar-details::backdrop{background:#071b1590;backdrop-filter:blur(5px)}
.external-calendar-details>header{display:flex;justify-content:space-between;align-items:center;color:var(--muted);gap:16px}
.external-calendar-details>header button{width:40px;height:40px;flex-shrink:0;border:1px solid var(--line);border-radius:50%;background:transparent;color:inherit;font-size:26px;cursor:pointer}
.external-calendar-details h2{font-size:22px;line-height:1.3;overflow-wrap:anywhere;margin:12px 0 20px}
.external-calendar-details dt{font-weight:700;color:var(--muted);margin-top:14px}
.external-calendar-details dd{margin:4px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}
.external-calendar-details>p,.calendar-event-link p{font:12px/1.5 Manrope,system-ui,sans-serif;color:var(--muted);overflow-wrap:anywhere}
.calendar-event-link a{display:inline-flex;text-decoration:none;max-width:100%;box-sizing:border-box;white-space:normal;font:700 14px/1.4 Manrope,system-ui,sans-serif;background:#146c50;color:#fff;box-shadow:none;opacity:1}
.calendar-event-link[hidden],.calendar-event-link a[hidden],#externalCalendarDeal[hidden]{display:none}
.external-calendar-details :focus-visible{outline:2px solid var(--green,#21855f);outline-offset:3px}
@media(max-width:480px){.external-calendar-details{padding:18px}.external-calendar-details h2{font-size:20px}}

/* The appointment editor owns scrolling; the grid behind it is inactive. */
body.appointment-modal-open{overflow:hidden;overscroll-behavior:none}
#modalBackdrop[data-modal-type="appointment"] .modal{max-height:calc(100dvh - 40px);overflow-y:auto;overscroll-behavior:contain}
body.appointment-modal-open .calendar-availability-drag-preview,
body.appointment-modal-open .calendar-booking-drag-preview{display:none!important}
#appointmentDateField{min-width:0}
#appointmentDateField>label{margin-bottom:7px}
#appointmentDateButton{width:100%;text-align:left;min-height:44px}
#appointmentDateField .bitrix-date-picker{position:relative;inset:auto;width:100%;min-width:0;margin-top:10px}
#appointmentDateField .picker-days,#appointmentDateField .picker-weekdays{grid-template-columns:repeat(7,minmax(0,1fr))}
#appointmentDateField .bitrix-date-picker [data-picker-day]{min-width:0!important;width:100%;padding-left:0;padding-right:0}
@media(min-width:641px){#appointmentDateField:has(.bitrix-date-picker){grid-column:1/-1}#appointmentDateField .bitrix-date-picker{max-width:360px}}
.stage-transition-feedback{margin:10px 0;padding:12px;border:1px solid #c6a768;border-radius:8px;background:#fff8e8;color:#453921;font-size:14px;line-height:1.45;overflow-wrap:anywhere;white-space:normal}
.stage-transition-feedback p{margin:0 0 8px}
.stage-transition-feedback button{max-width:100%;white-space:normal}
/* Mobile robot statuses must remain readable, unlike compact stage history. */
@media(max-width:720px){
 #dealWorkWall .robot-row{grid-template-columns:24px minmax(0,1fr);align-items:start;min-height:auto;height:auto;gap:8px;padding:12px}
 #dealWorkWall .robot-row .stage-compact-body{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;min-width:0}
 #dealWorkWall .robot-row .stage-compact-path{font-size:13px;line-height:1.45;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
 #dealWorkWall .robot-row .stage-compact-body time{margin-left:0;font-size:12px;line-height:1.45;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
}

/* V257: every deal tab, including WhatsApp, must be visible without a
   horizontal gesture on phone-sized drawers. */
@media(max-width:900px){
 .deal-drawer .drawer-tabs{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:0 8px!important;
  padding:0 8px!important;
  overflow:visible!important;
 }
 .deal-drawer .drawer-tabs button{
  width:100%!important;
  min-width:0!important;
  min-height:44px!important;
  padding:10px 2px 8px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
 }
}
