/* Slice ERP 01: inherit the existing Frame Design staff brand. */
.orders-mode #note-section,.orders-mode #journal-section{display:none!important}
.orders-mode #export{display:none!important}
#erp-section{border-top:0;padding-top:12px}
.erp-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:26px;flex-wrap:wrap}
.erp-heading h2{margin-bottom:8px}.erp-heading p{margin:0}
.erp-caption{font-size:12px;letter-spacing:.1em;text-transform:uppercase;color:#bac3be}
.erp-workspace>div{min-width:0}
.erp-workspace{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:24px;align-items:start}
.erp-board{display:grid;grid-template-columns:repeat(7,minmax(220px,1fr));gap:16px;overflow-x:auto;padding-bottom:12px}
.erp-lane{min-width:0;background:linear-gradient(155deg,#303735cc,#171d1bcc);border:1px solid #78827c;padding:18px}
.erp-lane h3{font-size:20px;font-weight:400;margin:0 0 18px;display:flex;justify-content:space-between;gap:12px}
.erp-card{width:100%;display:block;text-align:left;margin:0 0 12px;padding:16px;background:#161b19b3;border-color:#69766d;overflow-wrap:anywhere}
.erp-card[aria-pressed=true]{border-color:#d1ed73;background:#c6d5c512}
.erp-card strong{display:block;font-size:20px;font-weight:450;line-height:1.25;margin:8px 0}
.erp-card span{display:block;font-size:14px}.erp-card .erp-card-meta{font-size:12px;color:#bac4be;margin-top:8px}
.erp-card .erp-reminder{margin-top:8px;color:#d1ed73;font-size:13px}
.erp-detail{min-width:0;border:1px solid #818b85;padding:24px;background:linear-gradient(140deg,#303735e8,#171d1bed)}
.erp-detail h3{font-weight:400;font-size:26px;line-height:1.2;margin:0 0 12px;overflow-wrap:anywhere}
.erp-detail h4{font-size:18px;font-weight:450;margin:24px 0 12px}
.erp-detail dl{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px 18px;margin:0 0 20px;font-size:15px}
.erp-detail dt{color:#bdc3bf}.erp-detail dd{margin:0;overflow-wrap:anywhere}
.erp-description{white-space:pre-wrap;overflow-wrap:anywhere;font-size:17px}
.erp-files{list-style:none;padding:0;margin:0}.erp-files li{margin:0;padding:12px 0;border-block-end:1px solid #78837b66}
.erp-files a{overflow-wrap:anywhere}.erp-files small{display:block;margin-top:4px}
.erp-history{list-style:none;padding:0;margin:0}.erp-history li{padding:10px 0;border-block-end:1px solid #78837b66;font-size:15px}.erp-history small{display:block}
#erp-take{background:var(--staff-satin);color:#18201b;border-color:#adb5b1;width:100%;margin-top:18px}
#erp-reminders{padding:16px 20px;border:1px solid #909b7f;color:#d1ed73;background:#b5bf7510;margin:0 0 20px}
#erp-denied,#erp-empty{padding:24px;border:1px solid var(--staff-line);background:#171c1bb3}
#erp-status{min-height:24px;margin-bottom:12px;color:#bdc3bf}
.erp-pagination{margin-top:16px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.erp-access-row{display:grid;grid-template-columns:minmax(140px,1fr) minmax(140px,1fr) minmax(130px,1fr) auto;gap:16px;align-items:end;padding:18px 0;border-bottom:1px solid #7e888866}
.erp-access-row p{margin-bottom:0}.erp-access-row label{margin:0 0 6px;font-size:13px}.erp-access-row input,.erp-access-row select{width:100%}
.erp-access-row button{height:46px}.erp-access-row input{min-width:0}
@media(max-width:1100px){.erp-workspace{grid-template-columns:minmax(0,1fr)}.erp-access-row{grid-template-columns:1fr 1fr}.erp-detail{padding:20px}}
@media(max-width:540px){.erp-board{grid-template-columns:minmax(0,1fr);overflow-x:visible}.erp-lane{padding:14px}.erp-detail{padding:18px 16px}.erp-detail dl{grid-template-columns:1fr;gap:4px}.erp-detail dd{margin-bottom:10px}.erp-access-row{grid-template-columns:1fr}.erp-heading{gap:16px}.erp-card strong{font-size:20px}}

.erp-stage-form{display:grid;gap:10px}.erp-stage-form select{width:100%;min-width:0}.erp-stage-form button{background:var(--staff-satin);color:#18201b}

.erp-task{padding:16px;border:1px solid #78837b88;margin-bottom:12px;overflow-wrap:anywhere}.erp-task h5{font-size:19px;font-weight:450;margin:0 0 10px}.erp-task p{margin-bottom:8px}.erp-task .erp-reminder{color:#d1ed73}.erp-task-create{margin-top:16px}.erp-task-create summary{cursor:pointer;min-height:44px;padding:10px 0}.erp-task-create input,.erp-task-create textarea{min-width:0;width:100%}

.erp-messages{margin-top:24px;border-top:1px solid #78837b88}.erp-message-list{padding:0;list-style:none;margin:0 0 16px}.erp-message{border:1px solid #78837b88;padding:14px;margin:10px 0;overflow-wrap:anywhere}.erp-message.mine{border-color:#a9b6a3;background:#c6d5c508}.erp-message strong,.erp-message small{display:block}.erp-message-text{white-space:pre-wrap;margin:10px 0 0}.erp-message-form{display:grid;gap:10px;margin-top:16px}.erp-message-form textarea{min-width:0;width:100%;min-height:110px}.erp-message-form button{background:var(--staff-satin);color:#18201b}

#erp-discussions,#erp-notifications{padding:16px 0;border-bottom:1px solid #78837b88;margin-bottom:20px}
.erp-discussion-link{display:block;width:100%;text-align:left;margin:8px 0;overflow-wrap:anywhere}
.erp-notification{padding:12px;border:1px solid #78837b66;margin:8px 0;display:flex;gap:10px;align-items:center;flex-wrap:wrap}.erp-notification.unread{border-color:#d1ed73}.erp-notification small{display:block;color:#bdc3bf}
.erp-participant{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:10px 0;padding:12px;border:1px solid #78837b66}.erp-participant span{flex:1 1 180px;overflow-wrap:anywhere}.erp-participants details{margin:16px 0}.erp-participants summary{cursor:pointer;padding:12px 0}.erp-participants details button{display:block;margin:8px 0}.erp-participants input{width:100%;min-width:0}.erp-message-form select{width:100%;min-width:0}

.erp-folders{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}.erp-folders button{font-size:14px;padding:10px;min-height:44px}.erp-folders button[aria-pressed=true]{background:var(--staff-satin);color:#18201b}.erp-material-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:12px}.erp-material-card{display:flex;flex-direction:column;gap:10px;padding:14px;border:1px solid #78837b88;min-width:0;overflow-wrap:anywhere}.erp-material-card img{display:block;width:100%;max-height:240px;object-fit:contain;background:#18201b}.erp-material-card strong,.erp-material-card small{display:block}.erp-material-card a{padding:8px 0}.erp-category-form{display:grid;gap:8px}.erp-category-form select{width:100%;min-width:0}.erp-selected-files{padding-left:20px;overflow-wrap:anywhere}.erp-message-form input[type=file]{max-width:100%;min-width:0}.erp-materials{margin:24px 0;border-block:1px solid #78837b88;padding-bottom:18px}

/* Task ERP 06.02: messenger workspace. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.orders-mode .team-header-inner{min-height:72px;width:calc(100% - 32px);padding:8px 0;gap:20px}
.orders-mode .team-brand img{width:38px;height:50px}.orders-mode .team-title p{font-size:22px}.orders-mode .team-nav{margin:0;padding:0;border:0}
body.orders-mode #voice-panel{width:calc(100% - 32px);padding:12px 0;margin:auto;max-width:1900px}
.orders-mode #voice-panel>p:first-of-type,.orders-mode #voice-panel>h1,.orders-mode #message:empty,.orders-mode .erp-heading,.orders-mode .team-footer{display:none}
.orders-mode #message{margin:0;min-height:0;font-size:12px}.orders-mode #workspace>.row{padding:0 0 10px}.orders-mode #person{font-size:13px}.orders-mode #workspace>.row button{min-height:32px;padding:4px 12px;font-size:13px}
.orders-mode #erp-section{padding:0;border:0}.erp-workspace{height:calc(100dvh - 152px);min-height:520px;display:grid;grid-template-columns:270px 280px minmax(0,1fr);gap:0;align-items:stretch;border:1px solid #69766d;background:#202625}
.erp-orders-pane,.erp-materials-pane{overflow-y:auto;min-width:0;min-height:0;border-right:1px solid #69766d;padding:14px;background:#202625;scrollbar-width:thin}
.erp-list-header{position:sticky;top:-14px;background:#202625;z-index:2;padding:12px 0}.erp-list-header h3{font-size:20px;margin:0 0 12px}.erp-list-header input,.erp-list-header select{width:100%;min-height:38px;font-size:13px;margin-bottom:8px;padding:8px}
.erp-board{display:block;overflow:visible;padding:0}.erp-card{padding:14px 12px;margin:0 0 8px;border-color:#65726c;background:#19201f;border-radius:8px}.erp-card[aria-pressed=true]{background:#37443b;border-color:#aabda6}.erp-card strong{font-size:17px;margin:8px 0 6px}.erp-card-top{display:flex!important;align-items:center;justify-content:space-between;gap:8px}.erp-card .erp-stage-badge{font-size:10px;padding:3px 6px;border-radius:4px;background:#50634a;color:#dfebd6}.erp-card .stage-new{background:#716748;color:#eee3ba}.erp-card .stage-completed,.erp-card .stage-cancelled{background:#434c49;color:#bac3be}.erp-card .erp-card-preview{font-size:13px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.erp-card .erp-card-meta{font-size:11px;margin-top:8px}
#erp-status{font-size:11px;margin:6px 0 12px;min-height:0}#erp-reminders{font-size:12px;padding:10px;margin:0 0 10px}#erp-empty{padding:12px;font-size:13px}#erp-discussions{padding:0;border:0;margin:0}.erp-workspace[data-access=erp] #erp-discussions{display:none}
.erp-inbox{margin-top:14px;padding-top:12px;border-top:1px solid #69766d}.erp-inbox summary{cursor:pointer;font-size:13px}.erp-inbox #erp-notifications{padding:8px 0;margin:0;border:0}.erp-inbox h3{font-size:14px}.erp-notification{padding:8px;gap:6px}.erp-notification button{font-size:12px;padding:6px;min-height:32px}
.erp-materials-pane .erp-materials{margin:0;padding:0;border:0}.erp-materials-pane h4{font-size:18px;margin:0 0 12px}.erp-materials-pane .erp-folders{display:grid;grid-template-columns:1fr;gap:4px;margin:0 0 18px}.erp-materials-pane .erp-folders button{text-align:left;font-size:12px;min-height:34px;padding:7px 10px;border-color:transparent;border-radius:5px}.erp-materials-pane .erp-material-list{display:block}.erp-materials-pane .erp-material-card{margin:0 0 12px;font-size:13px;padding:10px;border-radius:8px}.erp-materials-pane .erp-material-card img{height:140px;max-height:140px}.erp-material-card button,.erp-material-card select{font-size:12px;min-height:34px;padding:6px 10px}.erp-material-card small{font-size:11px}.erp-material-edit summary{cursor:pointer;font-size:11px;padding:6px 0}.erp-material-edit select{width:100%}
.erp-detail{position:relative;display:flex;flex-direction:column;min-height:0;padding:0;border:0;background:#18201e;overflow:hidden}.erp-chat-header{padding:16px 22px;background:#2c3531;border-bottom:1px solid #69766d;flex:none}.erp-chat-header h3{font-size:21px;margin:2px 0 4px}.erp-chat-header p{margin:0;font-size:10px}.erp-chat-header small{font-size:12px}.erp-chat-toolbar{display:flex;gap:6px;flex-wrap:wrap;padding:8px 16px;background:#26302b;border-bottom:1px solid #69766d;flex:none}.erp-chat-toolbar button{font-size:12px;padding:5px 10px;min-height:32px;border-color:#59695f;border-radius:5px}.erp-chat-toolbar button[aria-expanded=true]{background:#566650}
.erp-detail .erp-messages{display:grid;grid-template-rows:minmax(0,1fr) auto auto auto;flex:1;min-height:0;overflow:hidden;margin:0;padding:0;border:0;position:relative}.erp-message-list{position:relative;overflow-y:auto;min-height:0;padding:20px 24px;margin:0;display:flex;flex-direction:column;align-items:flex-start;gap:12px;scrollbar-width:thin}.erp-message{max-width:min(88%,640px);margin:0;padding:12px 16px;border:1px solid #596a60;border-radius:12px 12px 12px 3px;background:#303c36;flex-shrink:0}.erp-message.mine{align-self:flex-end;background:#465744;border-color:#788c70;border-radius:12px 12px 3px 12px}.erp-message strong{font-size:13px;color:#dde9d7}.erp-message small{font-size:10px}.erp-message-text{font-size:15px;line-height:1.5;margin:6px 0}.erp-message .erp-material-card{margin-top:10px;background:#16221b40;border-color:#7c8d7755;border-radius:6px;padding:10px}.erp-message .erp-material-card img{height:180px;max-height:220px}.erp-message .erp-material-card button{align-self:flex-start}
.erp-message-form{margin:0;padding:12px 18px;grid-template-columns:minmax(0,1fr) auto;gap:8px;background:#27312c;border-top:1px solid #69766d;max-height:min(380px,45dvh);overflow:auto}.erp-message-form textarea{min-height:64px;max-height:160px;resize:vertical;border-radius:8px;background:#1b241f;padding:12px;font-size:15px}.erp-message-form>button[type=submit]{border-radius:8px;align-self:end;font-size:13px;max-width:150px}.erp-compose-options{grid-column:1/-1}.erp-compose-options summary{font-size:12px;cursor:pointer;min-height:30px;color:#d0dcc9}.erp-compose-options>div{display:grid;grid-template-columns:1fr 1fr;gap:6px 12px;padding:10px 0}.erp-compose-options label{font-size:12px;margin:4px 0;grid-column:1/-1}.erp-compose-options input,.erp-compose-options small,.erp-compose-options ul{grid-column:1/-1}.erp-compose-options select{font-size:13px;grid-column:1/-1}.erp-selected-files{margin:0;font-size:12px}.erp-messages>p[role=status]{font-size:11px;margin:0;padding:0 18px;background:#27312c}.erp-messages>button{margin:4px 18px;font-size:12px;min-height:32px}
.erp-inspector{position:absolute;right:0;top:0;bottom:0;width:min(390px,100%);z-index:5;background:#29332f;border-left:1px solid #91a387;box-shadow:-16px 0 30px #0005;display:flex;flex-direction:column;padding:14px}.erp-inspector>button{align-self:flex-end;font-size:12px;min-height:32px;padding:6px 12px}.erp-inspector-content{overflow-y:auto;padding:16px 4px;min-height:0}.erp-inspector h4{margin:8px 0 16px}.erp-inspector .erp-participants{padding:0;margin:0;border:0}.erp-inspector .erp-order-data{font-size:14px}.erp-inspector .erp-description{font-size:15px}.erp-inspector button,.erp-inspector select{font-size:13px}.erp-inspector .erp-participant{padding:10px;gap:6px}.erp-inspector .erp-participant span{flex-basis:100%}
.erp-mobile-tabs{display:none}
@media(max-width:1100px){.orders-mode .team-header-inner{display:flex;min-height:62px;gap:12px}.orders-mode .team-title{text-align:left}.orders-mode .team-title p{font-size:18px}.orders-mode .team-nav{display:none}.orders-mode .team-brand img{width:30px;height:40px}.erp-mobile-tabs{display:flex;gap:6px;margin-bottom:8px}.erp-mobile-tabs button{flex:1;font-size:13px;min-height:36px;padding:6px;border-radius:6px}.erp-mobile-tabs button[aria-pressed=true]{background:var(--staff-satin);color:#18201b}.erp-workspace{grid-template-columns:minmax(0,1fr);height:calc(100dvh - 174px);min-height:440px}.erp-workspace[data-pane=orders] .erp-materials-pane,.erp-workspace[data-pane=orders] .erp-detail,.erp-workspace[data-pane=materials] .erp-orders-pane,.erp-workspace[data-pane=materials] .erp-detail,.erp-workspace[data-pane=chat] .erp-orders-pane,.erp-workspace[data-pane=chat] .erp-materials-pane{display:none}.erp-orders-pane,.erp-materials-pane{border-right:0}.erp-materials-pane .erp-folders{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:540px){body.orders-mode #voice-panel{width:calc(100% - 16px);padding-top:8px}.orders-mode .team-header-inner{width:calc(100% - 16px)}.erp-workspace{height:calc(100dvh - 180px);min-height:400px}.erp-chat-header{padding:12px}.erp-chat-header h3{font-size:18px}.erp-chat-toolbar{padding:6px 10px;gap:4px}.erp-chat-toolbar button{font-size:11px;padding:4px 7px}.erp-message-list{padding:14px 10px}.erp-message{max-width:94%;padding:10px 12px}.erp-message-form{padding:8px;grid-template-columns:minmax(0,1fr)}.erp-message-form>button[type=submit]{justify-self:end;max-width:none;min-height:36px}.erp-message-form textarea{min-height:58px}.erp-materials-pane .erp-folders{grid-template-columns:1fr}}

/* ERP 07: compact chat workspace */
body.orders-mode .team-header,body.orders-mode #message,body.orders-mode .team-footer{display:none}
body.orders-mode #voice-panel{width:calc(100% - 16px);max-width:none;padding:6px 0 0}
.orders-mode .row{margin:0;gap:8px}.orders-mode #account{font-size:11px}.orders-mode #logout,.orders-mode #erp-refresh{min-height:28px;padding:4px 8px;font-size:11px}
.erp-workspace{position:relative;grid-template-columns:270px minmax(0,1fr);height:calc(100dvh - 50px);min-height:360px;margin-top:6px}
.erp-orders-pane{padding:10px}.erp-list-title{display:flex;align-items:center;justify-content:space-between;gap:6px}.erp-list-title a{font-size:11px}.erp-list-title button{min-height:30px;padding:4px 8px;font-size:12px}.erp-list-header h3{font-size:17px;margin:10px 0}.erp-list-header input,.erp-list-header select{min-height:32px;padding:6px;font-size:12px}.erp-card{padding:10px;margin-bottom:7px}.erp-card strong{font-size:14px}.erp-card .erp-card-preview{font-size:12px}
.erp-chat-header{padding:8px 12px}.erp-chat-header>div{display:flex;align-items:center;gap:12px;min-width:0}.erp-chat-header p{font-size:9px;flex:none}.erp-chat-header h3{font-size:15px;line-height:1.3;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.erp-chat-header small{font-size:11px;white-space:nowrap;margin-left:auto}
.erp-chat-toolbar{padding:4px 10px;gap:5px;flex-wrap:nowrap;overflow-x:auto}.erp-chat-toolbar button{font-size:11px;min-height:28px;padding:4px 8px;white-space:nowrap}
.erp-workspace .erp-materials-pane{position:absolute;z-index:4;top:74px;bottom:70px;left:270px;right:0;padding:12px;background:#26302bf5;display:block;border:1px solid #73816f;box-shadow:0 8px 24px #0006}.erp-materials-pane[hidden]{display:none!important}.erp-materials-pane>button{float:right;min-height:28px;padding:4px 8px;font-size:11px}.erp-materials-pane .erp-folders{display:flex;flex-wrap:wrap;gap:4px;margin:12px 0}.erp-materials-pane .erp-folders button{min-height:28px}.erp-materials-pane .erp-material-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px}
.erp-message-list{padding:12px 16px;gap:8px}.erp-message{padding:8px 10px;max-width:min(85%,620px)}.erp-message-text{font-size:14px;margin:4px 0}.erp-message .erp-material-card{gap:5px;padding:7px;font-size:12px}.erp-message .erp-material-card img{height:120px}.erp-material-card audio{width:100%;max-width:320px;height:34px}.erp-category-form textarea{min-height:44px;padding:6px;font-size:12px}.erp-file-note{margin:0;font-size:12px;color:#e4eecb}
.erp-message-form{display:block;padding:6px 10px;max-height:45dvh}.erp-composer-row{display:flex;align-items:center;gap:6px}.erp-composer-row textarea{flex:1;min-width:0;min-height:36px;height:36px;max-height:110px;padding:7px 10px;font-size:14px;resize:vertical}.erp-composer-row button{flex:none;width:36px;height:36px;min-height:36px;padding:4px;font-size:18px;border-radius:8px}.erp-compose-options{display:block;margin-bottom:3px}.erp-compose-options summary{min-height:16px;font-size:10px}.erp-compose-options select{width:100%;min-height:30px;padding:4px}.erp-selected-files:empty{display:none}.erp-selected-files{padding:4px 0 4px 20px;font-size:11px}.erp-message-form>button{min-height:26px;padding:3px 8px;font-size:11px}.erp-voice-preview{width:100%;height:32px;margin:4px 0}.erp-messages>p[role=status]:empty{display:none}.erp-messages>p[role=status]{font-size:10px;padding:0 10px}
.erp-create-dialog{max-width:500px;width:calc(100% - 32px);padding:20px;background:#26302b;color:#edf1e9;border:1px solid #8b9c80}.erp-create-dialog::backdrop{background:#0009}.erp-create-dialog form{display:grid;gap:10px}.erp-create-dialog h3{font-size:18px;margin:0 0 10px}.erp-create-dialog label{font-size:13px}.erp-create-dialog input,.erp-create-dialog textarea{width:100%;padding:8px}.erp-create-dialog textarea{min-height:90px}
@media(max-width:1100px){.erp-workspace{grid-template-columns:240px minmax(0,1fr)}.erp-mobile-tabs{display:none}.erp-workspace[data-pane] .erp-orders-pane{display:block}.erp-workspace[data-pane] .erp-detail{display:flex}.erp-workspace .erp-materials-pane{left:240px}.erp-chat-header small{display:none}}
@media(max-width:650px){.erp-mobile-tabs{display:flex;margin:4px 0}.erp-mobile-tabs button{min-height:28px;padding:4px;font-size:12px}.erp-workspace{grid-template-columns:1fr;height:calc(100dvh - 90px);min-height:320px}.erp-workspace[data-pane=orders] .erp-detail,.erp-workspace[data-pane=chat] .erp-orders-pane{display:none}.erp-workspace .erp-materials-pane{left:0;top:68px;bottom:64px}.erp-chat-header p{display:none}.erp-chat-header h3{font-size:14px}.erp-message-list{padding:10px}.erp-composer-row{gap:4px}.erp-composer-row button{width:32px;height:34px;min-height:34px}.erp-message-form{padding:5px}.erp-message-form textarea{min-height:34px;height:34px}.erp-chat-toolbar{padding:4px 6px}.erp-chat-toolbar button{font-size:10px;padding:4px 6px}}

.orders-mode #frd-staff-microphone{display:none!important}
.erp-window-close{float:right;width:30px;height:30px;min-height:30px!important;padding:0!important;font-size:22px!important;line-height:1;border-radius:6px}
.erp-category-form{position:relative}.erp-category-form .erp-window-close{justify-self:end}.erp-category-form [role=status]{margin:2px 0;font-size:11px}
.erp-create-dialog>.erp-window-close{position:absolute;top:8px;right:8px}
.erp-workspace[data-pane] .erp-materials-pane:not([hidden]){display:block!important}
@media(max-width:650px){.erp-workspace{height:calc(100dvh - 130px)}}
/* ERP 08: compact topic workspace alongside the order chat. */
.erp-topic-link{font-size:11px!important;min-height:26px!important;padding:4px 8px!important;text-align:left;max-width:100%;overflow-wrap:anywhere}
.erp-topic-pane{position:absolute;right:0;top:72px;bottom:0;width:48%;z-index:3;display:flex;flex-direction:column;min-height:0;background:#24302a;border-left:1px solid #91a387;box-shadow:-8px 0 18px #0003;padding:10px}
.erp-topic-pane[hidden]{display:none!important}.erp-topic-open>.erp-messages{margin-right:48%}
.erp-topic-pane h4{margin:0 0 6px;font-size:16px}.erp-topic-heading{flex:none;padding:0 0 8px}.erp-topic-heading small{font-size:11px}.erp-topic-root{flex:none;max-height:140px;overflow:auto;padding:8px 10px;border-left:3px solid #b6c7a1;background:#1a241f;font-size:13px}.erp-topic-root p{white-space:pre-wrap;margin:4px 0}.erp-topic-root small{font-size:11px}.erp-topic-root .erp-material-card{padding:6px}.erp-topic-root img{max-height:70px}
.erp-topic-settings{flex:none;max-height:45%;overflow:auto;font-size:12px;padding:8px 0}.erp-topic-settings summary{cursor:pointer;font-size:11px}.erp-topic-settings input,.erp-topic-settings textarea,.erp-topic-settings select{display:block;width:100%;min-height:30px;padding:6px;margin:5px 0;font-size:12px}.erp-topic-settings textarea{min-height:55px}.erp-topic-settings p{margin:5px 0}.erp-topic-pane>.erp-messages{flex:1;min-height:0}.erp-topic-pane .erp-message-list{padding:8px 2px}.erp-topic-pane .erp-message{max-width:96%}.erp-topic-index{overflow:auto;min-height:0}.erp-topic-index button{display:block;width:100%;margin:8px 0;padding:10px!important;background:#334338}.erp-topic-index strong,.erp-topic-index small{display:block}.erp-topic-index p{font-size:12px;white-space:pre-wrap}.erp-topic-pane>p{font-size:12px}
@media(max-width:1000px){.erp-topic-pane{width:min(460px,100%)}.erp-topic-open>.erp-messages{margin-right:0}.erp-topic-pane{z-index:6}}
/* ERP 09: one palette for a topic, its source, replies, and final decision. */
[data-topic-color=sage]{--topic-bg:#344538;--topic-border:#b0c598;--topic-ink:#e8f4df}
[data-topic-color=blue]{--topic-bg:#293f55;--topic-border:#91bbdd;--topic-ink:#e1f0ff}
[data-topic-color=amber]{--topic-bg:#51432c;--topic-border:#d9bc7e;--topic-ink:#fff0ce}
[data-topic-color=violet]{--topic-bg:#443851;--topic-border:#bfa1da;--topic-ink:#f2e5ff}
[data-topic-color=rose]{--topic-bg:#50383f;--topic-border:#d9a1b1;--topic-ink:#ffe9ef}
[data-topic-color=teal]{--topic-bg:#294844;--topic-border:#90cbbd;--topic-ink:#defff4}
.erp-message[data-topic-color],.erp-message.mine[data-topic-color]{background:var(--topic-bg);border-color:var(--topic-border);border-left:4px solid var(--topic-border)}
.erp-topic-message-label{font-size:11px;font-weight:600;color:var(--topic-ink);margin-bottom:6px;line-height:1.4}
.erp-topic-start{border-top:2px solid var(--topic-border)!important}.erp-topic-decision{border-bottom:3px solid var(--topic-border)!important}.erp-topic-decision .erp-message-text{font-weight:600}.erp-decision-author{display:block;margin-top:6px;color:var(--topic-ink)}
.erp-topic-pane[data-topic-color]{border-left:3px solid var(--topic-border)}.erp-topic-pane[data-topic-color] .erp-topic-root{border-color:var(--topic-border);background:var(--topic-bg)}
.erp-topic-index button[data-topic-color]{border-left:4px solid var(--topic-border);background:var(--topic-bg);color:var(--topic-ink)}.erp-topic-index .erp-decision-entry{margin-top:8px;border-top:1px solid var(--topic-border);padding-top:8px}.erp-topic-index p{margin:6px 0;line-height:1.45}.erp-topic-index small{font-size:11px}
.erp-topic-decision-summary{flex:none;max-height:160px;overflow:auto;margin:6px 0;padding:8px 10px;border:1px solid var(--topic-border);background:var(--topic-bg);font-size:12px;color:var(--topic-ink)}.erp-topic-decision-summary:empty{display:none}.erp-topic-decision-summary strong,.erp-topic-decision-summary small{display:block}.erp-topic-decision-summary p{margin:5px 0;white-space:pre-wrap}.erp-topic-decision-summary small{font-size:10px}
.erp-topic-settings input:disabled,.erp-topic-settings textarea:disabled{opacity:.8;color:#eef1e8}

/* ERP 10: one anchored block per topic; messages retain their original time. */
.erp-thread-block { width:100%; box-sizing:border-box; list-style:none; margin:10px 0; padding:10px; border:1px solid var(--topic-border); border-left:4px solid var(--topic-border); border-radius:12px; background:var(--topic-bg); color:var(--topic-ink); }
.erp-thread-heading { display:flex; align-items:center; gap:12px; justify-content:space-between; padding-bottom:8px; border-bottom:1px solid var(--topic-border); }
.erp-thread-heading button { text-align:left; font-weight:600; max-width:85%; }
.erp-thread-messages { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:8px; }
.erp-thread-messages .erp-message { max-width:90%; margin:0; border-left-width:1px; }
.erp-thread-messages .erp-message.mine { align-self:flex-end; }
.erp-message-accepted { margin-top:8px; font-weight:600; border-top:1px solid var(--topic-border); padding-top:6px; }
.erp-accept-decision { margin-top:8px; font-size:12px; padding:5px 8px; }
.erp-accepted-proposal { outline:2px solid var(--topic-border); }

/* ERP 10.02: closed-topic digest with optional complete history. */
.erp-thread-summary { cursor:pointer; padding:8px 0; list-style:none; }
.erp-thread-summary::-webkit-details-marker { display:none; }
.erp-thread-summary p { margin:5px 0; white-space:pre-wrap; overflow-wrap:anywhere; font-size:14px; line-height:1.4; }
.erp-thread-summary small { display:block; margin-top:4px; font-size:11px; }
.erp-thread-resolution { font-weight:600; }
.erp-thread-cue { display:block; margin-top:8px; font-size:12px; text-decoration:underline; }
.erp-thread-cue::before { content:'▸ '; }
.erp-thread-history[open] .erp-thread-cue::before { content:'▾ '; }
.erp-thread-history[open] .erp-thread-summary { border-bottom:1px solid var(--topic-border); margin-bottom:10px; }
.erp-thread-history:not([open]) > .erp-thread-messages { display:none; }

/* ERP11: one color per sales stage, shared by counters and order badges. */
.stage-new {--stage-bg:#304a64;--stage-fg:#d8eaff}
.stage-in_progress {--stage-bg:#425e49;--stage-fg:#dff4dc}
.stage-measurement {--stage-bg:#67552c;--stage-fg:#fff0bb}
.stage-quotation {--stage-bg:#534266;--stage-fg:#ecddff}
.stage-approval {--stage-bg:#285b60;--stage-fg:#d5f8fa}
.stage-completed {--stage-bg:#36654d;--stage-fg:#c6ffd9}
.stage-cancelled {--stage-bg:#623b42;--stage-fg:#ffdae0}
.erp-stage-badge,.erp-funnel-stage {background:var(--stage-bg);color:var(--stage-fg);border-color:var(--stage-fg)}
.erp-sales-strip {display:flex;gap:6px;overflow-x:auto;margin:0 0 8px}
.erp-funnel-stage {flex:1;min-width:102px;padding:6px 10px;border-radius:8px;display:flex;gap:9px;align-items:center;justify-content:center;font-size:12px}
.erp-funnel-stage strong {font-size:20px}
.erp-funnel-stage[aria-pressed=true] {outline:2px solid #fff;outline-offset:-3px}
.erp-box-tabs {display:flex;gap:8px;padding:0 0 8px}
.erp-box-tabs button {padding:6px 14px;font-size:13px}
.erp-box-tabs [aria-pressed=true] {background:#4d6049;color:#f0ffdf}
.erp-box-channels {display:flex;flex-wrap:wrap;gap:5px;margin:8px 0;font-size:11px}
.erp-channel {border:1px solid #778377;border-radius:6px;padding:5px}
.erp-unread {align-self:flex-start;background:#c9e78a;color:#23301b;padding:3px 7px;border-radius:12px;font-size:11px}
.erp-box-messages {overflow-y:auto;flex:1;min-height:0}
.erp-box-reply-hint {font-size:12px;margin:6px 12px}
.erp-box-messages a {display:block;margin-top:8px}
@media(max-width:700px){.erp-funnel-stage {min-width:90px}.erp-sales-strip {margin-top:6px}}
.erp-card .erp-stage-badge {background:var(--stage-bg);color:var(--stage-fg)}
.erp-workspace {height:calc(100dvh - 154px)}
@media(max-width:1100px){.erp-workspace {height:calc(100dvh - 202px)}}
@media(max-width:650px){.erp-workspace {height:calc(100dvh - 224px);min-height:280px}}
.erp-box-tabs button {min-height:28px}
.erp-funnel-stage {min-height:36px}
.erp-box-header {display:flex;align-items:center;gap:12px;justify-content:space-between}
.erp-box-header>div {flex:1;flex-wrap:wrap}
.erp-box-header>button {font-size:12px;min-height:28px;padding:4px 9px;flex:none}
.erp-box-messages .erp-message small {font-size:11px}
.erp-box-messages a {font-size:12px}
.erp-unread {justify-self:start;width:max-content}
.erp-workspace {height:calc(100dvh - 134px)}
@media(max-width:1100px){.erp-workspace {height:calc(100dvh - 174px)}}
@media(max-width:650px){.erp-workspace {height:calc(100dvh - 198px)}}
.erp-order-chat {display:flex;flex-direction:column;flex:1;min-height:0;padding:0;border:0;margin:0}

/* Task ERP 13.01: compact channel states and private contact blocklist. */
.erp-box-channels {align-items:center;gap:7px;min-height:36px;margin:4px 0 8px}
.erp-messenger-icon {display:inline-flex;width:25px;height:25px;align-items:center;justify-content:center;border-radius:50%;color:#fff;font:700 16px system-ui;flex:none}
.channel-telegram {background:#248cca}.channel-max {background:#6555df}.channel-whatsapp {background:#258957}
.erp-channel-button {position:relative;display:inline-flex;padding:4px!important;min-width:34px;min-height:34px;border:1px solid #5c665d;border-radius:9px;background:#262d28}
.erp-channel-state {position:absolute;right:-3px;bottom:-3px;border:2px solid #242925;border-radius:50%;width:15px;height:15px;font:700 10px system-ui;text-align:center;line-height:15px}
.erp-channel-state.connected {background:#a5ce71;color:#193310}.erp-channel-state.disconnected {background:#ed6767;color:#220a0a}.erp-channel-state.unknown {background:#929b92;color:#182018}
.erp-sync-status {font-size:10px;color:#b6c0b5;max-width:100px}
.erp-blocklist-button {font-size:10px!important;padding:4px 6px!important;min-height:26px!important;margin-left:auto}
.erp-card>.erp-messenger-icon {float:left;margin-right:6px;width:20px;height:20px;font-size:13px}
.erp-blocklist {width:min(560px,88vw);max-height:80dvh;overflow:auto;background:#252d27;color:#edf1e9;border:1px solid #727d6e;border-radius:12px;padding:24px}
.erp-blocklist p {font-size:13px}.erp-blocklist-row {display:flex;gap:10px;align-items:center;padding:12px 0;border-bottom:1px solid #475147}.erp-blocklist-row strong {flex:1}.erp-blocklist-row button {font-size:11px}

/* Task ERP 13.02: persistent brand marks and contact actions. */
.erp-messenger-icon {background:transparent;border-radius:0}
.erp-messenger-icon img {display:block;width:100%;height:100%;object-fit:contain}
.erp-box-channels {display:grid;grid-template-columns:34px 34px 34px 1fr;gap:8px;min-height:68px;align-content:start}
.erp-sync-status {width:78px;max-width:none;white-space:nowrap;justify-self:end}
.erp-blocklist-button {grid-column:1/-1;justify-self:end;margin:0}
.erp-box-card {display:flex;flex-direction:column;gap:7px;cursor:default}
.erp-box-card[data-selected=true] {background:#354335;border-color:#b3cd94}
.erp-box-card-heading {display:flex;gap:5px;align-items:center;min-width:0}
.erp-box-open {display:flex;gap:6px;align-items:center;flex:1;min-width:0;padding:0!important;background:transparent!important;border:0!important;color:inherit;text-align:left;min-height:32px}
.erp-box-open strong {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.erp-box-open .erp-messenger-icon {width:22px;height:22px}
.erp-box-action {display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;min-width:28px;min-height:28px!important;padding:0!important;border-radius:50%;flex:none;font-size:10px!important;background:#273029;border:1px solid #677563;color:#dce8d5}
.erp-box-action.create {font-size:21px!important;color:#d4edb1;border-color:#789565}
.erp-box-action.block {color:#e2b7b5;border-color:#946a67}
.erp-box-action:hover {background:#40523b}.erp-box-action.block:hover {background:#543332}
.erp-box-action:focus-visible,.erp-box-open:focus-visible,.erp-box-preview:focus-visible {outline:2px solid #c8dfab;outline-offset:2px}
.erp-box-preview {display:block;padding:0!important;border:0!important;background:transparent!important;min-height:0!important;font-size:12px;line-height:1.4;text-align:left;color:#d6dfd1;overflow-wrap:anywhere}
.erp-box-header>div.erp-box-header-actions {flex:none;display:flex;gap:8px}
.erp-box-header .erp-box-action {width:32px;height:32px;min-width:32px}

/* Task ERP 13.03: one order context and a horizontal participant strip. */
.erp-participant-strip {display:flex;align-items:center;gap:6px;padding:5px 10px;overflow-x:auto;flex:none;min-height:34px;border-bottom:1px solid #65725c55;background:#222b25;scrollbar-width:thin}
.erp-participant-chip,.erp-participant-add {display:inline-flex;align-items:center;flex:none;white-space:nowrap;border-radius:18px;padding:4px 10px!important;min-height:27px!important;font-size:11px!important;border:1px solid #6b7962;background:#2c382d;color:#e5ecdc}
.erp-participant-chip.owner {background:#43573a;border-color:#a7c482}.erp-participant-chip.unassigned {color:#bdc5b9;border-style:dashed}
.erp-participant-add {background:transparent;border-style:dashed}
.erp-participant-menu {width:min(420px,88vw);max-height:80dvh;overflow:auto;padding:24px;background:#27312a;color:#eef2e9;border:1px solid #7a896e;border-radius:12px}
.erp-participant-menu>button:not(.erp-window-close) {display:block;width:100%;margin:10px 0;font-size:13px}
.erp-participant-menu small {display:block;color:#becbb8;font-size:11px}
.erp-client-origin {display:flex;gap:6px;align-items:center;margin-bottom:6px;color:#b2d9f2;font-size:11px}
.erp-client-origin .erp-messenger-icon {width:18px;height:18px}
.erp-message.erp-client-message {border-left:3px solid #61a6d0;background:#283b42}
.erp-client-channel {display:inline-flex;align-items:center;gap:5px;padding:4px 7px;border:1px solid #607b88;border-radius:5px;font-size:11px;color:#c0dfef;white-space:nowrap}
.erp-client-channel .erp-messenger-icon {width:16px;height:16px}

/* Task ERP 13.04: deliberate external sending, compact message actions. */
.erp-message-actions{display:flex;gap:6px;justify-content:flex-end;margin-top:5px}
.erp-message-action{width:29px;height:29px;min-height:0;padding:0;display:inline-flex;align-items:center;justify-content:center;border:1px solid #d3dbd5;border-radius:50%;background:#f7faf7;color:#335344;font-weight:700;font-size:18px;cursor:pointer}
.erp-message-action:hover{background:#e2eee5;border-color:#73927f}
.erp-message-action svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:round}
.erp-message-action-question{color:#30648a;background:#eef6fc;border-color:#c3d8e8}
.erp-client-send-status{display:block;color:#30648a;margin-top:4px;font-size:11px}
.erp-client-confirm{max-width:480px;width:calc(100vw - 32px)}
.erp-client-confirm-text{color:#233d2d;white-space:pre-wrap;overflow-wrap:anywhere;max-height:35vh;overflow:auto;margin:0;padding:12px;background:#f1f6f2;border-left:3px solid #709782;border-radius:8px}
.erp-client-confirm-recipient{font-weight:600;margin:2px 0}
.erp-client-confirm-send{background:#35654b;color:white}
/* ERP 13.05 — anchored reply composer, isolated from refreshed messages. */
.erp-box-composer {position:relative;flex:none;padding:7px 12px 6px;border-top:1px solid #55634f;background:#29342b;display:flex;flex-direction:column;gap:5px}
.erp-box-recipient {font-size:11px;color:#b9cbb0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.erp-box-compose-line {display:flex;align-items:flex-end;gap:7px}
.erp-box-compose-line textarea {flex:1;min-width:0;min-height:36px!important;max-height:110px;padding:8px 10px;resize:none;line-height:1.4;border-radius:17px;background:#344135;color:#edf3e8;border:1px solid #61705b;font-size:13px}
.erp-box-compose-line textarea::placeholder {color:#bdc8b7}
.erp-box-tool,.erp-box-send {width:34px;height:34px;min-height:34px!important;min-width:34px;padding:0!important;border-radius:50%;display:grid;place-items:center;font-size:21px;border:1px solid #687760;background:#344135;color:#d8e9cd}
.erp-box-send {background:#c5dca7;color:#273b23;font-size:20px}
.erp-box-compose-status {font-size:11px;line-height:1.4;margin:0;color:#d4dfca}.erp-box-compose-status:empty{display:none}
.erp-box-attachments {display:flex;flex-wrap:wrap;gap:5px}.erp-box-attachments:empty{display:none}
.erp-box-file-chip {display:flex;align-items:center;gap:6px;max-width:100%;font-size:11px;background:#40513c;padding:3px 8px;border-radius:10px}
.erp-box-file-chip>span {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.erp-box-file-chip button{padding:0!important;width:22px;min-height:22px!important;border:0;background:transparent;color:#dbe8d1;font-size:17px}
.erp-emoji-panel {position:absolute;bottom:calc(100% + 6px);left:12px;width:min(328px,calc(100% - 24px));padding:12px;border:1px solid #778568;border-radius:18px;background:#f0f4ea;color:#2d412b;box-shadow:0 12px 40px #0005;z-index:5}.erp-emoji-panel[hidden]{display:none}
.erp-emoji-tabs {display:flex;gap:5px;margin-bottom:8px}.erp-emoji-tabs button{border:0;border-radius:10px;background:transparent;padding:4px!important;min-height:32px!important;width:40px;font-size:24px}.erp-emoji-tabs button[aria-pressed=true]{background:#d1e2bf}
.erp-emoji-panel small{display:block;margin-bottom:7px;font-size:11px;color:#576c4c}
.erp-emoji-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:4px}.erp-emoji-grid button{font-family:'Apple Color Emoji','Segoe UI Emoji','Noto Color Emoji',sans-serif;font-size:27px;border:0;border-radius:10px;background:transparent;padding:4px!important;min-height:40px!important}.erp-emoji-grid button:hover{background:#dae8cd;transform:scale(1.1)}
.erp-box-messages .erp-message {max-width:85%;align-self:flex-start;border-radius:14px 14px 14px 3px}.erp-box-messages .erp-box-outgoing {margin-left:auto;background:#40543a;border-color:#6f8660;border-radius:14px 14px 3px 14px}.erp-box-delivery{display:block;margin-top:7px;color:#c4d8b0}
@media(max-width:600px){.erp-box-composer{padding:6px 8px}.erp-box-compose-line{gap:4px}.erp-box-tool,.erp-box-send{width:30px;min-width:30px;height:30px;min-height:30px!important}.erp-box-messages .erp-message{max-width:94%}}

/* Task ERP 13.07: the conversation owns the available height. */
body.orders-mode #voice-panel{width:calc(100% - 12px);height:100dvh;padding:2px 0 0;box-sizing:border-box}
.orders-mode #workspace{height:100%;display:flex;flex-direction:column;min-height:0}
.orders-mode #workspace>.row{flex:none;padding:0 2px 2px;min-height:16px;gap:8px;align-items:center}
.orders-mode #person{font-size:10px;line-height:1.2;width:auto}
.orders-mode #workspace>.row button{min-height:16px;height:16px;padding:0 5px;font-size:10px;line-height:1.2;border-color:transparent;background:transparent;color:#b7c6b4}
.orders-mode #workspace>.row button:hover{color:#edf5e4;background:#344035}
.orders-mode #erp-section,.orders-mode #erp-content{display:flex;flex-direction:column;flex:1;min-height:0}
.orders-mode .erp-workspace{height:auto;min-height:0;flex:1;margin:0 0 5px;grid-template-columns:248px minmax(0,1fr)}
.erp-sales-strip{flex:none;gap:4px;margin:0 0 3px;scrollbar-width:thin}
.erp-funnel-stage{min-height:20px;height:20px;padding:0 7px;gap:6px;border-radius:5px;font-size:10px;min-width:85px;line-height:1.1}
.erp-funnel-stage strong{font-size:12px;font-weight:600}
.erp-orders-pane{padding:7px}
.erp-list-header{top:-7px;padding:3px 0 4px}
.erp-list-title{min-height:24px;gap:6px}
.erp-list-title a{font-size:10px;color:#b9c6b3;white-space:nowrap}
.erp-list-section-title{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:3px 0 5px}
.erp-list-section-title h3{margin:0;font-size:13px;font-weight:500}
.erp-list-section-title #erp-new-order{min-height:23px;width:23px;height:23px;padding:0;font-size:19px;line-height:1;border-radius:50%}
.erp-box-tabs{display:flex;gap:3px;padding:0;margin:0;margin-left:auto}
.erp-box-tabs button{position:relative;width:25px;height:25px;min-height:25px;padding:3px;border-radius:6px;color:#aabca4;background:transparent;border:1px solid #4b5a48}
.erp-box-tabs button[aria-pressed=true]{color:#e6f5db;background:#42563c;border-color:#809b6f}
.erp-box-tabs svg{width:17px;height:17px;display:block;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round}
#erp-box-unread{position:absolute;right:-3px;top:-4px;min-width:11px;height:11px;padding:1px 2px;box-sizing:content-box;border-radius:8px;background:#c7e49d;color:#253520;font-size:8px;line-height:11px}
.erp-list-header input,.erp-list-header select{min-height:27px;height:27px;font-size:11px;padding:4px 6px;margin-bottom:4px}
.erp-box-channels{grid-template-columns:28px 28px 28px 1fr;gap:7px;min-height:53px;margin:2px 0 5px}
.erp-channel-button{min-height:27px;min-width:27px;padding:3px!important}
.erp-channel-button .erp-messenger-icon{width:20px;height:20px}
.erp-channel-state{width:12px;height:12px;font-size:8px;line-height:12px}
.erp-blocklist-button{min-height:18px!important;padding:1px 5px!important;font-size:9px!important}
.erp-card{padding:7px 8px;margin-bottom:5px}
.erp-card strong{font-size:13px;margin:4px 0}
.erp-card .erp-card-preview,.erp-box-preview{font-size:11px;line-height:1.35}
.erp-box-card{gap:4px}
.erp-box-action{width:24px;height:24px;min-width:24px;min-height:24px!important}
#erp-status{margin:2px 0 5px;font-size:9px}
.erp-chat-header{flex:none;padding:4px 9px;min-height:29px;box-sizing:border-box}
.erp-chat-header>div{gap:8px;flex-wrap:nowrap}
.erp-chat-header h3{font-size:13px;font-weight:500;line-height:1.25}
.erp-chat-header small{font-size:10px}
.erp-chat-header p{margin:0;font-size:8px}
.erp-box-header .erp-box-action{width:24px;height:24px;min-width:24px;min-height:24px!important}
.erp-box-header>div.erp-box-header-actions{gap:5px}
.erp-chat-toolbar{padding:2px 7px;gap:4px;min-height:24px}
.erp-chat-toolbar button{font-size:10px;min-height:22px;padding:2px 6px}
.erp-client-channel{padding:2px 5px;font-size:9px}
.erp-participant-strip{padding:2px 7px;gap:4px;min-height:23px}
.erp-participant-chip,.erp-participant-add{padding:2px 7px!important;min-height:21px!important;font-size:10px!important}
.erp-message-list{padding:8px 10px;gap:6px;scrollbar-width:thin}
.erp-message{padding:6px 8px;max-width:min(88%,680px)}
.erp-message strong{font-size:11px}
.erp-message small,.erp-box-messages .erp-message small{font-size:10px;line-height:1.25}
.erp-message-text{font-size:13px;line-height:1.4;margin:3px 0}
.erp-message-actions{gap:4px;margin-top:3px}
.erp-message-action{width:22px;height:22px;font-size:14px;min-height:22px;padding:0}
.erp-message-action svg{width:14px;height:14px}
.erp-message .erp-material-card{padding:5px;gap:3px}
.erp-message .erp-material-card img{height:auto;max-height:100px}
.erp-message audio{display:block;width:100%;max-width:320px;height:30px;margin-top:5px}
/* Shared compact composer: team, topic and client. */
.erp-message-form,.erp-box-composer{position:relative;flex:none;display:block;padding:4px 7px;background:#29342b;max-height:40dvh;border-top:1px solid #55634f}
.erp-composer-row,.erp-box-compose-line{display:flex;align-items:center;gap:4px}
.erp-composer-row textarea,.erp-box-compose-line textarea{flex:1;min-width:0;min-height:29px!important;height:29px;max-height:88px;padding:5px 8px;font-size:12px;line-height:1.4;resize:none;border:1px solid #61705b;border-radius:13px;background:#344135;color:#edf3e8;box-sizing:border-box}
.erp-composer-row button,.erp-box-tool,.erp-box-send{width:27px;height:27px;min-width:27px;min-height:27px!important;padding:0!important;font-size:16px;border-radius:50%;display:grid;place-items:center;flex:none;border:1px solid #61705b;background:#344135;color:#e0ecd4}
.erp-composer-row button[type=submit],.erp-box-send{background:#c5dca7;color:#273b23;font-size:17px}
.erp-composer-row button[data-recording],.erp-box-tool[data-recording]{color:#ffd4ce;border-color:#d99187;background:#683c36}
.erp-compose-options{margin:0 0 2px;font-size:10px}
.erp-compose-options summary{font-size:9px;line-height:1.2;min-height:12px;padding:0;cursor:pointer;width:max-content}
.erp-compose-options[open]{max-height:130px;overflow:auto}
.erp-compose-options label,.erp-compose-options select{font-size:11px}
.erp-selected-files{font-size:10px;padding:1px 0 1px 15px;max-height:65px;overflow:auto}
.erp-message-form>button{min-height:20px;padding:1px 5px;font-size:9px}
.erp-voice-preview{height:30px;width:min(320px,100%);margin:2px 0 4px;display:block}
.erp-box-attachments{gap:4px;max-height:70px;overflow:auto;margin:0 0 3px}
.erp-box-attachments:empty{margin:0}
.erp-box-file-chip{font-size:10px;padding:2px 6px}
.erp-box-compose-status{font-size:10px;line-height:1.3;margin:2px 0 0;max-height:48px;overflow:auto}
.erp-message-form+.muted:empty{display:none}
.erp-emoji-panel{bottom:calc(100% + 4px);left:7px;width:min(300px,calc(100% - 14px));max-height:45dvh;overflow:auto;padding:8px;border-radius:12px}
.erp-emoji-tabs{gap:3px;margin-bottom:5px}
.erp-emoji-tabs button{width:35px;min-height:27px!important;font-size:20px}
.erp-emoji-grid{gap:2px}
.erp-emoji-grid button{min-height:32px!important;font-size:24px;padding:2px!important}
/* A topic is expanded at its place in the timeline, never into a narrow column. */
.erp-topic-open>.erp-messages{margin-right:0}
.erp-thread-block{margin:4px 0;padding:6px;border-radius:9px}
.erp-thread-composer{min-width:0;margin-top:5px}
.erp-thread-composer>.erp-messages{display:block;margin:0;overflow:visible}
.erp-thread-composer .erp-message-form{margin:0;border-color:var(--topic-border);background:var(--topic-bg)}
.erp-thread-composer .erp-composer-row textarea{min-width:0}
.erp-thread-composer .erp-messages>.muted:empty{display:none}
.erp-thread-heading{gap:6px;padding-bottom:4px}
.erp-thread-heading button{max-width:calc(100% - 90px);font-size:12px!important;padding:2px 4px!important;min-height:22px!important;line-height:1.4;color:var(--topic-ink);white-space:normal}
.erp-thread-heading small{font-size:9px;white-space:nowrap}
.erp-window-close{width:22px;height:22px;min-height:22px!important;font-size:17px!important;border-radius:50%}
.erp-topic-pane:not(.erp-topic-inline){width:100%;box-sizing:border-box;top:82px;bottom:0;padding:8px;z-index:3}
.erp-topic-pane.erp-topic-inline{position:relative;inset:auto;width:100%;height:min(440px,65dvh);min-height:260px;max-height:none;box-sizing:border-box;z-index:auto;padding:0;border:0;box-shadow:none;background:var(--topic-bg);margin:0}
.erp-inline-topic-active>.erp-thread-messages,.erp-inline-topic-active>.erp-thread-history,.erp-inline-topic-active>.erp-thread-composer{display:none}
.erp-topic-inline .erp-topic-heading{padding:3px 0;display:flex;align-items:center;justify-content:flex-end;gap:8px;min-height:22px}
.erp-topic-inline .erp-topic-heading h4{display:none}
.erp-topic-inline .erp-topic-heading small{order:-1;font-size:9px;color:var(--topic-ink)}
.erp-topic-inline .erp-topic-root{padding:2px 0;background:transparent;border:0;max-height:80px;display:flex;gap:4px;overflow:auto}
.erp-topic-inline .erp-topic-root>p,.erp-topic-inline .erp-topic-root>small,.erp-topic-inline .erp-topic-root>.erp-accept-decision{display:none}
.erp-topic-inline .erp-topic-root .erp-material-card{min-width:140px;padding:4px}
.erp-topic-people{display:flex;align-items:center;gap:4px;flex:none;overflow-x:auto;scrollbar-width:thin;padding:1px 0 3px}
.erp-topic-person{flex:none;white-space:nowrap;padding:2px 6px;border:1px solid var(--topic-border);border-radius:12px;color:var(--topic-ink);font-size:10px;line-height:1.3}
.erp-topic-inline .erp-topic-settings{padding:0 0 2px;font-size:10px;max-height:35%;position:relative}
.erp-topic-inline .erp-topic-settings summary{font-size:9px;line-height:1.3;padding:2px 0;cursor:pointer}
.erp-topic-inline .erp-topic-settings input,.erp-topic-inline .erp-topic-settings select{font-size:11px;padding:4px;min-height:25px;height:25px;margin:3px 0}
.erp-topic-inline .erp-topic-settings textarea{font-size:11px;padding:4px;min-height:40px;margin:3px 0}
.erp-topic-inline .erp-topic-settings>p:first-of-type{display:none}
.erp-topic-inline .erp-message-list{padding:6px 3px;gap:5px}
.erp-topic-inline .erp-message{max-width:90%}
.erp-topic-pane>.muted{margin:2px 0;font-size:10px}
.erp-topic-inline .erp-topic-decision-summary{max-height:80px;margin:3px 0;padding:4px 6px;font-size:11px}
.erp-topic-inline .erp-accept-decision{min-height:20px;padding:2px 5px;font-size:10px;margin-top:3px}
@media(max-width:1100px){.orders-mode .erp-workspace{grid-template-columns:220px minmax(0,1fr)}.erp-workspace .erp-materials-pane{left:220px}}
@media(max-width:650px){body.orders-mode #voice-panel{width:calc(100% - 8px)}.orders-mode .erp-workspace{grid-template-columns:1fr}.erp-mobile-tabs{flex:none;margin:1px 0 3px;gap:4px}.erp-mobile-tabs button{min-height:22px;height:22px;padding:2px 5px;font-size:10px}.erp-orders-pane{padding:5px}.erp-chat-header{padding:3px 6px}.erp-chat-header small{display:block;font-size:9px}.erp-chat-header>div{gap:6px}.erp-chat-toolbar button{min-height:21px;font-size:9px}.erp-participant-strip{padding:2px 5px}.erp-message-list{padding:6px}.erp-topic-inline .erp-message-list{padding:5px 2px}.erp-thread-heading button{max-width:calc(100% - 70px)}.erp-thread-block{padding:5px}.erp-topic-pane.erp-topic-inline{height:62dvh;min-height:240px}.erp-message-form,.erp-box-composer{padding:4px}.erp-message-action{width:22px;height:22px}.erp-workspace .erp-materials-pane{left:0;top:67px;bottom:45px}}
.erp-topic-inline .erp-topic-heading{min-height:0;height:0;padding:0;position:relative;overflow:visible}
.erp-topic-inline .erp-topic-heading small{display:none}
.erp-topic-inline .erp-topic-heading .erp-window-close{position:absolute;right:0;top:3px;z-index:1}
.erp-topic-inline .erp-topic-people{padding:4px 28px 2px 0;min-height:22px}
.erp-topic-pane.erp-topic-inline{height:min(440px,calc(100dvh - 215px));min-height:220px}
.erp-inbox{margin-top:8px;padding-top:6px}
.erp-inbox summary{font-size:11px;padding:3px 0}
.erp-box-header small{display:block;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:650px){.erp-topic-pane.erp-topic-inline{height:min(440px,calc(100dvh - 255px));min-height:210px}}

/* ERP 13.09: original media and native reply context. */
.erp-original-media{display:block;max-width:100%;max-height:300px;border-radius:9px;margin:6px 0;object-fit:contain}audio.erp-original-media{width:280px;height:36px}.erp-source-quote{display:block;border:0;border-left:3px solid #869b91;background:#edf1ee;border-radius:4px;padding:5px 9px;margin:5px 0;max-width:100%;text-align:left;font:inherit;font-size:12px;white-space:pre-wrap;color:#465b51;cursor:pointer}.erp-media-status{display:block;color:#7b6950;font-size:11px}.erp-source-focus{outline:2px solid #6c9683;outline-offset:2px}

/* ERP 14.01: compact topic invitation and department directory. */
.erp-topic-add-person{display:inline-flex!important;align-items:center;justify-content:center;flex:none;width:26px;height:26px;min-height:26px!important;padding:4px!important;border-radius:50%;border:1px dashed #a7c482;background:#29362d;color:#d9edbf}
.erp-topic-add-person svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.erp-topic-person{display:inline-flex;align-items:center;gap:5px}
.erp-topic-invite-state{font-size:10px;color:#c8dfa9}
.erp-participant-picker{position:fixed;width:min(420px,90vw);max-height:75dvh;padding:18px;background:#222e27;color:#eff4e9;border:1px solid #72856a;border-radius:14px;overflow:auto}
.erp-participant-picker::backdrop{background:#080c0a99}
.erp-participant-picker h3{margin:0 28px 6px 0;font-size:17px}
.erp-participant-picker input{width:100%;box-sizing:border-box;margin:12px 0;font-size:13px;padding:8px 10px}
.erp-department-group h4{font-size:11px;color:#a6bd99;margin:12px 0 5px;text-transform:uppercase;letter-spacing:.06em}
.erp-department-person{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px!important;min-height:34px!important;margin:3px 0;background:#2b3a2f;border:1px solid #56674d;border-radius:8px;color:#eef4e7;font-size:13px!important;text-align:left}
.erp-department-person small{font-size:10px;white-space:nowrap;color:#bdd5a5}
.erp-department-person:disabled{opacity:.6}
.erp-participant-picker>[role=status]{font-size:11px;margin:12px 0 0}
.erp-access-row{grid-template-columns:minmax(160px,1fr) minmax(140px,1fr) minmax(130px,1fr) minmax(150px,1fr) minmax(90px,.6fr)}
@media(max-width:1100px){.erp-access-row{grid-template-columns:1fr 1fr}}
.erp-department-group{padding:0;margin:0;border:0;min-height:0}
.erp-participant-picker>small{display:block;font-size:11px}
.erp-participant-picker input{height:34px;min-height:34px;line-height:1.3}

.erp-native-reply-note{display:block;font-size:10px;line-height:1.25;opacity:.65;margin-top:3px}

/* ERP 14.04: focus must not change mobile scale or intrinsic page width. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
@media(max-width:650px){
  body.orders-mode{width:100%;max-width:100%;overflow:hidden}
  body.orders-mode #voice-panel{height:var(--frd-app-height,100dvh);max-width:100%;
    padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
  body input,body textarea,body select,
  body .erp-topic-inline .erp-topic-settings input,
  body .erp-topic-inline .erp-topic-settings textarea,
  body .erp-topic-inline .erp-topic-settings select,
  body .erp-list-header input,body .erp-list-header select,
  body .erp-composer-row textarea,body .erp-box-compose-line textarea{font-size:16px!important}
  .erp-workspace,.erp-detail,.erp-orders-pane,.erp-messages,.erp-topic-pane,
  .erp-message-list,.erp-thread-block,.erp-thread-messages,.erp-message-form,
  .erp-box-compose-line,.erp-composer-row,.erp-box-shell{min-width:0;max-width:100%}
  .erp-workspace{min-height:0!important}
  .erp-message,.erp-thread-heading,.erp-thread-heading button{min-width:0;overflow-wrap:anywhere}
  .erp-message-text,.erp-topic-decision-summary{overflow-wrap:anywhere;word-break:normal}
  .erp-message video,.erp-message audio,.erp-material-card img{max-width:100%}
  .erp-composer-row textarea,.erp-box-compose-line textarea{line-height:1.25;min-height:34px;padding:6px 8px}
  .erp-topic-pane.erp-topic-inline{height:min(440px,calc(var(--frd-app-height,100dvh) - 160px));min-height:150px}
  dialog{box-sizing:border-box;max-width:calc(100vw - 16px)!important;
    max-height:calc(var(--frd-app-height,100dvh) - 16px);overflow:auto}
  .erp-inspector{max-width:100%}
}

/* ERP 14.05: the keyboard must not pan the whole conversation off screen. */
@media(max-width:650px){
  body.orders-mode{position:fixed;inset:0;margin:0;overscroll-behavior:none}
  body.orders-mode #voice-panel{position:fixed;top:var(--frd-app-top,0px);left:4px;right:4px;
    margin:0;width:auto;overflow:hidden}
  .erp-message-list{overscroll-behavior:contain}
  body.orders-mode.frd-keyboard-open #voice-panel{padding-top:0;padding-bottom:0}
  .orders-mode.frd-keyboard-open #workspace>.row,
  .orders-mode.frd-keyboard-open .erp-sales-strip,
  .orders-mode.frd-keyboard-open .erp-mobile-tabs,
  .orders-mode.frd-keyboard-open .erp-chat-toolbar{display:none}
  .frd-keyboard-open .erp-chat-header{min-height:22px;padding:2px 6px}
  .frd-keyboard-open .erp-participant-strip{min-height:19px;padding:1px 5px}
  .frd-topic-input .erp-detail>.erp-messages>.erp-message-form,
  .frd-topic-input .erp-detail>.erp-messages>p[role=status],
  .frd-topic-input .erp-detail>.erp-messages>button{display:none}
  .frd-topic-input .erp-detail>.erp-messages{grid-template-rows:minmax(0,1fr)}
  .frd-topic-input .erp-inline-topic-active{display:flex;flex-direction:column;
    height:100%;min-height:0;flex-shrink:0;margin:0;overflow:hidden}
  .frd-topic-input .erp-inline-topic-active>.erp-thread-heading{flex:none;max-height:42px;overflow:auto}
  .frd-topic-input .erp-topic-pane.erp-topic-inline{flex:1;height:auto;min-height:0;overflow:hidden}
  .frd-topic-input .erp-composer-topic-focus{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden;flex-shrink:0;margin:0}
  .frd-topic-input .erp-composer-topic-focus>.erp-thread-header{flex:none;max-height:65px;overflow:auto}
  .frd-topic-input .erp-composer-topic-focus>.erp-thread-messages{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
  .frd-topic-input .erp-composer-topic-focus>.erp-thread-composer{flex:none}
  .frd-keyboard-open .erp-compose-options:not([open]){display:none}
}

/* ERP 14.06: one horizontal stage rail and a continuous bottom composer. */
.erp-sales-strip{overflow-x:auto;overflow-y:hidden;touch-action:pan-x;
  overscroll-behavior:none;align-items:center;scrollbar-width:none}
.erp-sales-strip::-webkit-scrollbar{display:none}
.erp-sales-strip .erp-funnel-stage{flex:none;white-space:nowrap;box-sizing:border-box}
.erp-sales-strip .erp-funnel-stage span{white-space:nowrap}
@media(max-width:650px){
  body.orders-mode #voice-panel{padding-bottom:0}
  .orders-mode .erp-workspace{margin-bottom:0}
  .erp-sales-strip{height:22px;min-height:22px;max-height:22px}
  .erp-sales-strip .erp-funnel-stage{height:22px;min-height:22px;max-height:22px}
  .erp-detail>.erp-messages>.erp-message-form,
  .erp-order-chat>.erp-box-composer{padding-bottom:max(4px,env(safe-area-inset-bottom))}
  .frd-topic-input .erp-topic-inline .erp-message-form,
  .frd-keyboard-open .erp-detail>.erp-messages>.erp-message-form,
  .frd-keyboard-open .erp-order-chat>.erp-box-composer{padding-bottom:4px}
}

/* ERP 14.07: topic identity and people never depend on opening its chat. */
.erp-thread-header{flex:none;min-width:0}
.erp-thread-header .erp-thread-heading{display:flex;align-items:flex-start;gap:5px;padding:2px 0 4px}
.erp-thread-question-title{flex:1;min-width:0;margin:0;font-size:12px;line-height:1.35;
  font-weight:600;white-space:pre-wrap;overflow-wrap:anywhere;max-height:64px;overflow:auto}
.erp-thread-tools{display:flex;align-items:center;gap:3px;flex:none}
.erp-topic-status{display:inline-flex;align-items:center;gap:3px;white-space:nowrap;
  font-size:9px;line-height:1.25;padding:3px 5px;border:1px solid var(--topic-border);border-radius:12px}
.erp-topic-status[data-status=resolved]{font-weight:600;background:#b6d59b22}
.erp-topic-status[data-status=waiting]{background:#edd59b22}
.erp-thread-heading .erp-thread-tools button{width:23px;height:23px;min-height:23px!important;
  max-width:none;padding:0!important;font-size:15px!important;border-radius:50%;border:1px solid var(--topic-border)}
.erp-thread-people{display:flex;align-items:center;gap:4px;min-width:0;overflow-x:auto;
  overflow-y:hidden;touch-action:pan-x;overscroll-behavior:contain;padding:4px 0;scrollbar-width:thin}
.erp-thread-people .erp-topic-person{flex:none;white-space:nowrap;font-size:10px}
.erp-thread-next{font-size:11px;padding:3px 0;max-height:80px;overflow:auto}
.erp-thread-next p{margin:2px 0;white-space:pre-wrap;overflow-wrap:anywhere}
.erp-inline-topic-active>.erp-topic-inline>.erp-topic-people{display:none}
.frd-topic-input .erp-inline-topic-active>.erp-thread-header{max-height:115px;overflow:auto;flex:none}
.frd-topic-input .erp-thread-question-title{max-height:38px}
@media(max-width:650px){.erp-thread-header .erp-thread-heading{flex-wrap:wrap}
  .erp-thread-question-title{flex-basis:100%;max-height:48px}
  .erp-thread-tools{margin-left:auto}
  .erp-thread-header .erp-thread-heading{padding-bottom:2px}}

/* ERP 12.06: all connection sources share one compact row. */
.erp-box-channels{grid-template-columns:repeat(4,28px) minmax(0,1fr)}
.erp-sync-status{width:auto;white-space:normal;justify-self:end}
.erp-messenger-icon svg{display:block;width:100%;height:100%;flex:none}

/* ERP 24.01: readable employee sources and native phone handoff. */
#erp-box-channels[data-sources]{display:flex;flex-wrap:wrap;gap:8px;overflow:visible;min-height:0}
#erp-box-channels .erp-source-button{align-items:center;gap:6px;max-width:220px;min-width:0}
#erp-box-channels .erp-source-label{max-width:170px;white-space:normal;overflow-wrap:anywhere;font-size:11px;line-height:1.3}
.erp-object-call-dialog{width:min(520px,calc(100vw - 32px));max-height:85dvh;overflow:auto;box-sizing:border-box;padding:20px;border:1px solid var(--tg-line,#a6c5db);border-radius:16px;background:var(--tg-surface,#fff);color:var(--tg-text,#203448);font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.erp-object-call-dialog::backdrop{background:rgb(15 32 48 / .45)}
.erp-object-call-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.erp-object-call-heading h3{margin:0;font-size:18px}
.erp-object-call-heading .erp-window-close{position:static}
.erp-object-call-form{display:grid;gap:12px}
.erp-object-call-form label{display:grid;gap:5px;margin:0;font-size:12px;color:var(--tg-muted,#526a7b)}
.erp-object-call-form select{width:100%;min-height:40px;border:1px solid var(--tg-line,#a6c5db);border-radius:8px;background:var(--tg-field,#f0f6fa);color:var(--tg-text,#203448);padding:8px}
.erp-object-call-dialog :is(button,a){min-height:36px;color:var(--tg-accent,#2389cc);border-radius:8px}
.erp-object-call-history{margin-top:18px}
.erp-object-call-entry{display:grid;gap:4px;padding:12px 0;border-top:1px solid var(--tg-line,#a6c5db);overflow-wrap:anywhere}
.erp-object-call-entry button{justify-self:start;font-size:12px}
@media(max-width:650px){#erp-box-channels .erp-source-button{max-width:calc(50% - 8px)}#erp-box-channels .erp-source-label{max-width:140px}.erp-chat-header{flex-wrap:wrap}.erp-object-call-dialog{padding:16px}}
