/* order-calendars.css */
.orders-mode .frd-calendar-entry{white-space:nowrap;flex-shrink:0;padding:3px 10px!important;font-size:12px!important;min-height:26px!important;border:0!important;border-radius:16px!important;color:var(--tg-link,#318fcd)!important;background:var(--tg-surface,#fff)!important}.frd-calendar-dialog{box-sizing:border-box;width:min(760px,calc(100vw - 20px));max-width:calc(100vw - 20px);max-height:88dvh;overflow:auto;padding:0!important;border:1px solid #cfdce7!important;border-radius:16px!important;background:#fff!important;color:#273c50!important;font:14px/1.4 Arial,sans-serif}.frd-calendar-dialog::backdrop{background:#071b2a88}.frd-calendar-dialog>header{display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:inherit;z-index:2;padding:10px 16px;border-bottom:1px solid #dce5eb}.frd-calendar-dialog h2{font-size:18px;margin:0}.frd-calendar-dialog h3{font-size:15px;margin:10px 0}.frd-calendar-dialog button{min-height:34px!important;padding:6px 10px!important;margin:0!important;border:0!important;border-radius:8px!important;font-size:14px!important;color:#2586c8!important;background:#eef6fc!important;cursor:pointer}.frd-calendar-dialog header button{font-size:24px!important}.frd-calendar-body{padding:12px 16px}.frd-calendar-status{margin:0!important;padding:8px 16px!important;font-size:12px;color:#658196;position:sticky;bottom:0;background:inherit}.frd-calendar-nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:8px 0}.frd-calendar-nav strong{flex:1;text-align:center}.frd-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}.frd-calendar-grid>small{text-align:center;padding:4px}.frd-calendar-grid button{position:relative;min-height:32px!important}.frd-calendar-grid button[data-selected=true]{background:#278ace!important;color:#fff!important}.frd-calendar-count{display:block;font-size:10px}.frd-calendar-event{display:flex!important;flex-direction:column;align-items:flex-start;width:100%;text-align:left;margin:8px 0!important;gap:3px;overflow-wrap:anywhere}.frd-calendar-event small{font-size:12px}.frd-calendar-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}.frd-calendar-form label{display:block!important;margin:0!important;font-size:13px}.frd-calendar-form input:not([type=checkbox]),.frd-calendar-form select{display:block;box-sizing:border-box;width:100%;min-width:0;min-height:38px!important;padding:7px!important;border-radius:8px!important;border:1px solid #ccdce6!important;background:#fff!important;color:#263c50!important;font-size:16px!important}.frd-calendar-form input[type=checkbox]{width:16px!important;height:16px!important;min-height:0!important;display:inline-block!important;margin-right:7px;vertical-align:middle}.frd-calendar-form fieldset{min-width:0;border:1px solid #dce7ee;border-radius:8px;padding:8px}.frd-calendar-form fieldset label{overflow-wrap:anywhere;margin:6px 0!important}.frd-calendar-form :disabled{opacity:.65}html[data-chat-theme=dark] .frd-calendar-dialog{background:#172430!important;color:#d7e5ef!important;border-color:#334b5c!important}html[data-chat-theme=dark] .frd-calendar-dialog button{background:#263c4d!important;color:#6ab8ed!important}html[data-chat-theme=dark] .frd-calendar-grid button[data-selected=true]{background:#246597!important;color:#fff!important}html[data-chat-theme=dark] .frd-calendar-form input:not([type=checkbox]),html[data-chat-theme=dark] .frd-calendar-form select{background:#213644!important;color:#d7e5ef!important;border-color:#446078!important}.erp-work-role{display:inline-flex!important;align-items:center;gap:5px;margin:5px 12px 5px 0!important;font-size:14px}.erp-work-role input{width:16px!important;min-height:0!important}.orders-mode .frd-order-schedule{margin-left:auto!important;font-size:12px!important;padding:5px 8px!important;min-height:28px!important}@media(max-width:550px){.frd-calendar-body{padding:8px}.frd-calendar-form{grid-template-columns:1fr}.frd-calendar-dialog>header{padding:8px}.frd-calendar-grid{gap:3px}.frd-calendar-nav{gap:4px}.frd-calendar-nav strong{font-size:13px}.frd-calendar-grid button{min-height:32px!important}.frd-calendar-dialog{max-height:90dvh}}
.orders-mode #erp-sales-strip .frd-calendar-entry{background-image:none!important;box-shadow:none!important}.orders-mode #erp-sales-strip .calendar-measurement{color:#d69a29!important;background:#d69a2914!important}.orders-mode #erp-sales-strip .calendar-supply{color:#aa7ad0!important;background:#aa7ad014!important}.orders-mode #erp-sales-strip .calendar-installation{color:#52aa8b!important;background:#52aa8b14!important}
/* ERP 17.08 — Google Calendar layout, existing order cards. */
.frd-calendar-dialog.frd-google-calendar{width:min(1200px,calc(100vw - 24px));height:90dvh;max-height:90dvh;display:flex;flex-direction:column;overflow:hidden;border-radius:24px!important;font-family:Arial,sans-serif}.frd-google-calendar .frd-calendar-body{padding:0 12px 8px;display:flex;flex:1;min-height:0;flex-direction:column}.frd-google-calendar>header{position:static;flex-shrink:0;border-bottom:0;padding:12px 20px}.frd-google-calendar .frd-calendar-status{position:static;flex-shrink:0;padding:4px 16px!important}.frd-gcal-toolbar{display:flex;align-items:center;gap:8px;flex-shrink:0;padding:6px 10px 16px}.frd-gcal-toolbar strong{font-size:20px;font-weight:500;flex:1}.frd-gcal-toolbar select,.frd-gcal-toolbar input{width:auto;min-width:0;font-size:16px!important;min-height:34px;padding:6px 10px;border:1px solid #dadce0;border-radius:18px;background:transparent;color:inherit}.frd-gcal-toolbar input{display:none}.frd-gcal-layout{display:grid;grid-template-columns:200px minmax(0,1fr);flex:1;min-height:0;gap:16px}.frd-gcal-sidebar{padding:0 8px;overflow:auto}.frd-gcal-sidebar h3{font-size:14px;text-transform:capitalize;margin:6px 0 16px}.frd-gcal-mini{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px;text-align:center}.frd-calendar-dialog .frd-gcal-mini button{min-height:26px!important;width:26px;padding:3px!important;font-size:12px!important;border-radius:50%!important;background:transparent!important;color:inherit!important}.frd-gcal-mini small{font-size:10px;color:#70757a;padding:5px 0}.frd-gcal-mini button[data-selected=true]{background:#d3e3fd!important;color:#0842a0!important}.frd-gcal-mini button[data-today=true]{background:#0b57d0!important;color:#fff!important}.frd-gcal-mini button[data-outside=true],.frd-gcal-month-cell[data-outside=true]{opacity:.45}.frd-gcal-zone{font-size:11px;color:#70757a}.frd-gcal-kind{font-size:13px;border-left:4px solid #4285f4;padding-left:8px}.frd-gcal-main{margin:0!important;padding:0!important;min-width:0;min-height:0;border:1px solid #dadce0!important;border-radius:16px;overflow:hidden}.frd-gcal-time-frame{height:100%;display:flex;min-height:0;flex-direction:column}.frd-gcal-days{display:grid;grid-template-columns:54px repeat(var(--days),minmax(0,1fr));flex-shrink:0;padding-right:12px;border-bottom:1px solid #dadce0;min-height:72px}.frd-gcal-days>small{align-self:end;font-size:10px;text-align:center;padding-bottom:8px;color:#70757a}.frd-gcal-day{text-align:center;padding:6px 0;color:#70757a}.frd-gcal-day small{display:block;text-transform:uppercase;font-size:11px}.frd-gcal-day strong{display:inline-flex;justify-content:center;align-items:center;border-radius:50%;font-size:25px;font-weight:400;width:42px;height:42px;margin-top:3px;color:inherit}.frd-gcal-day[data-today=true]{color:#0b57d0}.frd-gcal-day[data-today=true] strong{background:#0b57d0;color:#fff}.frd-gcal-time-scroll{overflow:auto;flex:1;min-height:0;overscroll-behavior:contain;touch-action:pan-x pan-y}.frd-gcal-timeline{display:grid;grid-template-columns:54px repeat(var(--days),minmax(0,1fr));height:1484px;position:relative}.frd-gcal-axis{position:sticky;left:0;background:#fff;z-index:2}.frd-gcal-axis span{position:absolute;right:8px;font-size:10px;color:#70757a;transform:translateY(-5px)}.frd-gcal-axis span:first-child{transform:none}.frd-gcal-time-column{position:relative;border-left:1px solid #dadce0;background:repeating-linear-gradient(to bottom,#dadce0 0px,#dadce0 1px,transparent 1px,transparent 30px,#edf0f3 30px,#edf0f3 31px,transparent 31px,transparent 60px)}.frd-calendar-dialog .frd-gcal-time-event{position:absolute;box-sizing:border-box;height:42px;min-height:15px!important;padding:4px 6px!important;border-radius:5px!important;background:#d3e3fd!important;color:#0842a0!important;display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:2px;overflow:hidden;z-index:1;line-height:15px!important;font-size:11px!important;border-left:3px solid #4285f4!important}.frd-gcal-time-event strong,.frd-gcal-time-event span{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}.frd-calendar-dialog .frd-gcal-time-event.kind-installation,.frd-calendar-dialog .frd-gcal-month-event.kind-installation{background:#ceead6!important;color:#0d652d!important;border-left-color:#34a853!important}.frd-calendar-dialog .frd-gcal-time-event.kind-measurement,.frd-calendar-dialog .frd-gcal-month-event.kind-measurement{background:#feefc3!important;color:#6b4e00!important;border-left-color:#fbbc04!important}.frd-calendar-dialog .frd-gcal-time-event.kind-supply,.frd-calendar-dialog .frd-gcal-month-event.kind-supply{background:#e9d2fd!important;color:#681da8!important;border-left-color:#a142f4!important}.frd-gcal-time-event[data-status=cancelled]{opacity:.5;text-decoration:line-through}.frd-gcal-now{position:absolute;left:0;right:0;border-top:2px solid #ea4335;pointer-events:none;z-index:3}.frd-gcal-now:before{content:'';position:absolute;left:-4px;top:-5px;width:8px;height:8px;background:#ea4335;border-radius:50%}.frd-gcal-month{height:100%;overflow:auto;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));grid-template-rows:24px;grid-auto-rows:minmax(95px,1fr)}.frd-gcal-month>small{text-align:center;padding:5px;font-size:11px;color:#70757a}.frd-gcal-month-cell{border-top:1px solid #dadce0;border-right:1px solid #dadce0;min-width:0;padding:2px}.frd-calendar-dialog .frd-gcal-month-cell>button:first-child{background:transparent!important;color:inherit!important;min-height:28px!important;border-radius:50%!important;margin:0 auto!important;display:block;padding:4px!important;font-size:12px!important;width:28px}.frd-calendar-dialog .frd-gcal-month-cell>button[data-today=true]:first-child{background:#0b57d0!important;color:#fff!important}.frd-calendar-dialog .frd-gcal-month-event{width:100%;padding:2px 3px!important;margin:2px 0!important;min-height:26px!important;border-radius:4px!important;font-size:10px!important;line-height:12px!important;text-align:left;overflow:hidden}.frd-gcal-month-event span{display:none}.frd-gcal-month-event strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[data-chat-theme=dark] .frd-google-calendar{background:#1f1f1f!important;color:#e3e3e3!important;border-color:#444746!important}html[data-chat-theme=dark] .frd-gcal-main,html[data-chat-theme=dark] .frd-gcal-days,html[data-chat-theme=dark] .frd-gcal-month-cell,html[data-chat-theme=dark] .frd-gcal-time-column{border-color:#444746!important}html[data-chat-theme=dark] .frd-gcal-axis{background:#1f1f1f}html[data-chat-theme=dark] .frd-gcal-time-column{background:repeating-linear-gradient(to bottom,#444746 0px,#444746 1px,transparent 1px,transparent 30px,#303333 30px,#303333 31px,transparent 31px,transparent 60px)}html[data-chat-theme=dark] .frd-gcal-toolbar select,html[data-chat-theme=dark] .frd-gcal-toolbar input{color:#e3e3e3;border-color:#747775;background:#1f1f1f}html[data-chat-theme=dark] .frd-gcal-day,html[data-chat-theme=dark] .frd-gcal-zone,html[data-chat-theme=dark] .frd-gcal-axis span{color:#b8bcbc}html[data-chat-theme=dark] .frd-gcal-mini button{background:transparent!important;color:#e3e3e3!important}html[data-chat-theme=dark] .frd-gcal-mini button[data-selected=true]{background:#0842a0!important;color:#d3e3fd!important}html[data-chat-theme=dark] .frd-gcal-mini button[data-today=true]{background:#a8c7fa!important;color:#003355!important}
@media(max-width:650px){.frd-calendar-dialog.frd-google-calendar{width:calc(100vw - 12px);max-width:calc(100vw - 12px);height:92dvh;max-height:92dvh;border-radius:16px!important}.frd-google-calendar>header{padding:8px 12px}.frd-google-calendar h2{font-size:16px}.frd-google-calendar .frd-calendar-body{padding:0 5px 5px}.frd-gcal-layout{grid-template-columns:minmax(0,1fr);gap:0}.frd-gcal-sidebar{display:none}.frd-gcal-toolbar{flex-wrap:wrap;gap:5px;padding:4px 4px 8px}.frd-gcal-toolbar strong{font-size:15px;min-width:140px}.frd-gcal-toolbar input{display:block;max-width:145px;flex:1;padding:4px;min-height:32px}.frd-gcal-toolbar select{font-size:14px!important;min-height:32px;padding:4px 8px}.frd-gcal-days{grid-template-columns:42px repeat(var(--days),minmax(0,1fr));min-height:65px;padding-right:0}.frd-gcal-timeline{grid-template-columns:42px repeat(var(--days),minmax(0,1fr))}.frd-gcal-day strong{font-size:20px;width:35px;height:35px}.frd-gcal-day small{font-size:9px}.frd-gcal-month{grid-auto-rows:minmax(75px,1fr)}.frd-calendar-dialog .frd-gcal-month-event{font-size:9px!important}.frd-gcal-main{border-radius:10px}.frd-gcal-time-event span{font-size:10px}}

.frd-google-calendar .frd-gcal-day[data-today=true] strong{color:#fff!important}.frd-gcal-kind.kind-measurement{border-color:#fbbc04}.frd-gcal-kind.kind-supply{border-color:#a142f4}.frd-gcal-kind.kind-installation{border-color:#34a853}

.frd-gcal-time-event{cursor:pointer}.frd-calendar-dialog .frd-gcal-resize{position:absolute;left:0;right:0;width:100%;height:8px!important;min-height:8px!important;padding:0!important;background:transparent!important;border-radius:0!important;cursor:ns-resize;touch-action:none;z-index:4}.frd-gcal-resize.start{top:0}.frd-gcal-resize.end{bottom:0}.frd-gcal-resize:after{content:'';display:block;margin:2px auto;width:24px;height:3px;border-radius:3px;background:currentColor;opacity:.5}.frd-gcal-time-event[data-dragging=true]{opacity:.8;z-index:5}.frd-gcal-draft{outline:2px dashed #4285f4;z-index:6!important;overflow:visible!important}.frd-calendar-dialog .frd-gcal-create{font-size:11px!important;min-height:20px!important;padding:1px 6px!important;margin:4px 0!important}.frd-calendar-body>select{max-width:100%;font-size:16px}.frd-gcal-time-column{cursor:crosshair}

.frd-calendar-dialog .frd-gcal-resize{color:inherit!important;box-shadow:none!important;border:0!important;margin:0!important}.frd-gcal-time-event strong{color:inherit!important}
html[data-chat-theme=dark] .frd-calendar-dialog .frd-gcal-resize{background:transparent!important;color:inherit!important}

/* Horizontal period swipes; native vertical scrolling. */
.frd-gcal-main,.frd-gcal-main .frd-gcal-time-scroll,.frd-gcal-month{touch-action:pan-y pinch-zoom}.frd-gcal-main{user-select:none}

/* ERP 17.11 — compact period switch and today icon. */
.frd-google-calendar>header{gap:8px}.frd-google-calendar>header h2{flex:1;min-width:0}
.frd-calendar-dialog .frd-gcal-today{position:relative;width:34px;height:34px;min-height:34px!important;padding:5px!important;flex-shrink:0;display:grid;place-items:center;border-radius:10px!important}
.frd-gcal-today svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.frd-gcal-today span{position:absolute;top:16px;left:0;right:0;text-align:center;font:700 9px/1 Arial,sans-serif}
.frd-gcal-views{display:flex;gap:3px;flex-shrink:0;padding:3px;border-radius:12px;background:#edf2f7}
.frd-calendar-dialog .frd-gcal-views button{min-height:30px!important;padding:5px 12px!important;background:transparent!important;color:#647589!important;font-size:13px!important;border-radius:9px!important;transition:background .15s,color .15s,box-shadow .15s}
.frd-calendar-dialog .frd-gcal-views button[aria-pressed=true]{background:#fff!important;color:#0b57d0!important;box-shadow:0 1px 4px #20344820}
html[data-chat-theme=dark] .frd-gcal-views{background:#30383f}html[data-chat-theme=dark] .frd-calendar-dialog .frd-gcal-views button{background:transparent!important;color:#b8c7d3!important}html[data-chat-theme=dark] .frd-calendar-dialog .frd-gcal-views button[aria-pressed=true]{background:#425466!important;color:#b9dcff!important}
.frd-gcal-views button:focus-visible,.frd-gcal-today:focus-visible{outline:2px solid #4285f4;outline-offset:2px}

/* ERP 24.28 — отчёт исполнителя внутри события. */
.frd-calendar-reports{grid-column:1/-1;margin:16px 0 4px;padding:12px;border:1px solid #dce7ee;border-radius:10px}
.frd-calendar-reports h3{margin:0 0 8px}.frd-calendar-report-list{display:grid;gap:7px}
.frd-calendar-report-item{display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;padding:8px;background:#f5f9fc;border-radius:7px;overflow-wrap:anywhere}
.frd-calendar-report-item strong{min-width:0;flex:1 1 180px}.frd-calendar-report-item small{color:#658196}.frd-calendar-report-item a{color:#237bbb}
.frd-calendar-report-status{min-height:18px;color:#658196}.frd-calendar-report-controls{display:grid;gap:8px}
.frd-calendar-report-controls textarea{box-sizing:border-box;width:100%;min-height:64px;resize:vertical;font:16px/1.4 Arial,sans-serif;border:1px solid #b9cbd8;border-radius:8px;padding:8px;background:transparent;color:inherit}
.frd-calendar-report-controls .frd-task-files-list{overflow-wrap:anywhere}.frd-calendar-legacy{grid-column:1/-1}
html[data-chat-theme=dark] .frd-calendar-reports{border-color:#405361}html[data-chat-theme=dark] .frd-calendar-report-item{background:#22303d}html[data-chat-theme=dark] .frd-calendar-report-item small,html[data-chat-theme=dark] .frd-calendar-report-status{color:#9eb1c1}
@media(max-width:650px){.frd-gcal-toolbar strong{font-size:13px;min-width:110px}.frd-gcal-toolbar input{flex:0 1 116px;max-width:116px}.frd-gcal-toolbar>button{width:28px;min-height:30px!important;padding:3px!important}.frd-gcal-views{flex-basis:100%;justify-content:center}.frd-calendar-dialog .frd-gcal-views button{flex:1}.frd-gcal-today{margin-left:auto!important}}

/* ERP 17.12 — source context, coloured choices and background calendars. */
.frd-calendar-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:12px 0}
.frd-calendar-dialog .frd-calendar-choice{min-height:70px!important;font-weight:600;border-left:4px solid!important;background:#f6f8fa!important}
.frd-calendar-dialog .frd-calendar-choice.kind-measurement{color:#946500!important;border-color:#fbbc04!important;background:#fff6d9!important}
.frd-calendar-dialog .frd-calendar-choice.kind-supply{color:#8240b0!important;border-color:#a142f4!important;background:#f3e5ff!important}
.frd-calendar-dialog .frd-calendar-choice.kind-installation{color:#24844a!important;border-color:#34a853!important;background:#e5f6eb!important}
.frd-calendar-contacts{white-space:pre-line;font-size:13px;color:#658196;overflow-wrap:anywhere;margin:4px 0 12px}
.frd-calendar-source-link{margin:8px 0}
.frd-calendar-form textarea{box-sizing:border-box;display:block;width:100%;resize:vertical;min-height:70px;font:16px/1.4 Arial,sans-serif;border:1px solid #b9cbd8;border-radius:8px;padding:8px;background:transparent;color:inherit}
.frd-calendar-form label:has(textarea){grid-column:1/-1}
.frd-gcal-related-switch{display:flex!important;align-items:center;gap:5px;font-size:11px;white-space:nowrap;color:#70757a;margin:0!important}
.frd-gcal-related-switch input{display:inline-block!important;min-height:0!important;width:14px!important;height:14px!important;margin:0!important;flex:none!important}
.frd-calendar-dialog .frd-gcal-time-event[data-related=true]{opacity:.24;z-index:0;border-style:dashed!important}
.frd-calendar-dialog .frd-gcal-month-event[data-related=true]{opacity:.28}
.frd-calendar-dialog [data-related=true]:hover,.frd-calendar-dialog [data-related=true]:focus-visible{opacity:.65}
.frd-gcal-legend-related{opacity:.4}
html[data-chat-theme=dark] .frd-calendar-card,html[data-chat-theme=dark] .frd-calendar-dialog:has(.frd-calendar-choices){background:#17212b!important;color:#dce7ef!important;border-color:#3b4b59!important}
html[data-chat-theme=dark] .frd-calendar-card input:not([type=checkbox]),html[data-chat-theme=dark] .frd-calendar-card select,html[data-chat-theme=dark] .frd-calendar-card textarea{background:#22303d!important;color:#dce7ef!important;border-color:#405361!important}
html[data-chat-theme=dark] .frd-calendar-contacts,html[data-chat-theme=dark] .frd-gcal-related-switch{color:#9eb1c1}
@media(max-width:650px){.frd-calendar-choices{gap:6px}.frd-calendar-dialog .frd-calendar-choice{font-size:12px!important;padding:6px!important}.frd-gcal-related-switch{flex:1}.frd-calendar-dialog .frd-gcal-source-card{font-size:11px!important;min-height:26px!important;padding:3px 7px!important}}
.orders-mode .erp-message-action-calendar{border:0!important;background:transparent!important;box-shadow:none!important;color:var(--tg-link,#62b0ec)!important;border-radius:0!important}
.frd-gcal-toolbar{flex-wrap:wrap}.frd-calendar-source-link button{font-size:12px!important}.frd-calendar-card .frd-calendar-events[hidden]{display:none!important}
/* ERP 24.15 — count for the selected calendar, above the date. */
.frd-gcal-date{position:relative;overflow:visible}
.frd-gcal-day-count{position:absolute;top:-3px;right:-5px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:15px;height:15px;padding:0 3px;border-radius:9px;background:#237bbb;color:#fff;font:500 9px/1 Arial,sans-serif;box-shadow:0 0 0 2px #fff;pointer-events:none}
.frd-gcal-mini{row-gap:6px;padding-top:4px}
.frd-gcal-mini .frd-gcal-day-count{top:-4px;right:-4px;min-width:14px;height:14px;font-size:8px}
.frd-calendar-dialog .frd-gcal-month-cell>button.frd-gcal-date:first-child{margin-top:4px!important}
html[data-chat-theme=dark] .frd-gcal-day-count{background:#8dc6f0;color:#12344e;box-shadow:0 0 0 2px #1f1f1f}

/* overlay.css */
/* Isolated from the public site: all styles live in the staff parent document. */
.staff-embedded #note-section{display:none}
body.overlay-mode{padding:0;margin:0;max-width:none;height:100dvh;overflow:hidden}
.overlay-mode #review-site{position:fixed;inset:0;width:100%;height:100%;border:0;background:#171a19}
.overlay-mode #voice-panel{position:fixed;z-index:2;right:max(12px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));width:min(440px,calc(100% - 24px));box-sizing:border-box;padding:12px 14px;max-height:65dvh;overflow:auto;overscroll-behavior:contain;background:linear-gradient(135deg,#303735f5,#191e1df5);border:1px solid #8c9690;box-shadow:0 8px 30px #0006;color:#eee;border-radius:8px;backdrop-filter:blur(16px)}
.overlay-mode #overlay-toolbar{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.overlay-mode #overlay-toolbar strong{font-size:14px;font-weight:500;margin-right:auto}
.overlay-mode #overlay-toolbar button{font-size:20px;padding:0;width:36px;height:36px;line-height:1}
.overlay-mode #voice-panel>p:first-of-type,.overlay-mode h1,.overlay-mode #note-section h2,.overlay-mode #workspace>.row{display:none}
.overlay-mode #note-section{padding:0;margin:0;border:0}
.overlay-mode #note-section>p{font-size:13px;line-height:1.4;margin:6px 0 10px}
.overlay-mode #note-section>p:last-child{font-size:11px;margin:8px 0 0}
.overlay-mode.voice-started #note-section>p{display:none}
.overlay-mode #message{font-size:12px;line-height:1.3;min-height:0;margin:6px 0;color:#c8d2ca}
.overlay-mode button,.overlay-mode #download-audio{min-height:40px;font-size:13px;padding:8px}
.overlay-mode .row{gap:8px}
.overlay-mode #record-time{font-size:12px;font-variant-numeric:tabular-nums;margin-right:auto}
.overlay-mode #review-recording>.muted{font-size:11px;line-height:1.4}
.overlay-mode #review-recording audio{height:36px;margin-top:8px}
.overlay-mode #save-audio{width:100%;background:#cbd0cb;color:#18201b;font-weight:600}
.overlay-mode #restore-panel{position:fixed;right:12px;bottom:max(12px,env(safe-area-inset-bottom));z-index:3;background:#222927;color:#eee;border:1px solid #98a39c;border-radius:7px;box-shadow:0 4px 20px #0005;min-height:44px;padding:10px 14px}
.overlay-mode #restore-panel[data-recording=true]{border-color:#d78a7b;color:#ffb6a7}
.overlay-mode #compact-time{margin-left:8px;font-variant-numeric:tabular-nums}
@media(max-width:480px){.overlay-mode #voice-panel{padding:10px;bottom:max(6px,env(safe-area-inset-bottom));right:6px;width:calc(100% - 12px)}.overlay-mode #overlay-toolbar{margin-bottom:4px}.overlay-mode #record{max-width:45%}}

/* erp.css */
/* 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}}

/* ERP 24.29: existing intake text, separate from authored messages. */
.erp-intake-description{list-style:none;margin:0 0 12px;padding:10px 12px;border:1px solid var(--tg-line,#b8cede);border-radius:8px;color:inherit;background:transparent}
.erp-intake-description>strong{font-size:12px;opacity:.75}
.erp-intake-description .erp-description{margin:5px 0 0;font-size:14px;line-height:1.45}

/* telegram.css */
/* Slice ERP 15.01: messenger surfaces, scoped to the orders workspace. */
:root{
  --tg-surface:#fff;--tg-text:#17212b;--tg-muted:#707f8c;--tg-line:#e9edf0;
  --tg-field:#f1f3f5;--tg-hover:#f4f6f7;--tg-active:#3390ec;--tg-accent:#3390ec;
  --tg-chat:#dbe7d8;--tg-incoming:#fff;--tg-outgoing:#effdde;--tg-out-ink:#4b7451;
  --tg-shadow:0 1px 2px #00000015;--tg-overlay:#0005;--tg-topic:#f4f9ff;
}
:root[data-chat-theme=dark]{
  --tg-surface:#17212b;--tg-text:#f5f5f5;--tg-muted:#8095a6;--tg-line:#243342;
  --tg-field:#242f3d;--tg-hover:#202d3b;--tg-active:#2b5278;--tg-accent:#6ab3f3;
  --tg-chat:#0e1621;--tg-incoming:#182533;--tg-outgoing:#2b5278;--tg-out-ink:#a8c6e3;
  --tg-shadow:0 1px 2px #0003;--tg-overlay:#0009;--tg-topic:#182b3f;
}
body.orders-mode{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  color:var(--tg-text);background:var(--tg-surface);padding:0;color-scheme:light}
:root[data-chat-theme=dark] body.orders-mode{color-scheme:dark}
body:not(.orders-mode) #frd-theme-toggle{display:none}
body.orders-mode .staff-texture{display:none}
body.orders-mode #voice-panel{width:100%;margin:0;padding:0;background:var(--tg-surface);
  height:var(--frd-app-height,100dvh);max-width:none;border:0;box-shadow:none}
.orders-mode #workspace>.row{padding:1px 10px;min-height:22px;gap:9px;
  background:var(--tg-surface);border-bottom:1px solid var(--tg-line);color:var(--tg-muted)}
.orders-mode #person{font-size:10px;color:var(--tg-muted);margin-right:auto}
.orders-mode #workspace>.row button{color:var(--tg-muted);font-size:10px;line-height:20px;height:20px}
.orders-mode #workspace>.row button:hover{background:var(--tg-field);color:var(--tg-accent)}
.orders-mode #frd-theme-toggle{display:grid;place-items:center;width:22px;min-height:20px;
  padding:1px;border:0;border-radius:50%}
.orders-mode #frd-theme-toggle svg{width:16px;height:16px;fill:none;stroke:currentColor;
  stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.orders-mode button,.orders-mode input,.orders-mode textarea,.orders-mode select{color:var(--tg-text)}
.orders-mode button:focus-visible,.orders-mode a:focus-visible{outline:2px solid var(--tg-accent);outline-offset:2px}
.orders-mode input,.orders-mode select,.orders-mode textarea{border-color:var(--tg-line);
  background:var(--tg-field);border-radius:9px;outline-color:var(--tg-accent)}
.orders-mode .erp-sales-strip{background:var(--tg-surface);padding:4px 10px;margin:0;
  gap:5px;min-height:30px;height:30px;max-height:30px;border-bottom:1px solid var(--tg-line)}
.orders-mode .erp-funnel-stage{border:0!important;border-radius:15px;padding:4px 10px!important;
  min-height:22px;height:22px;font-size:11px;background:var(--tg-field);color:var(--tg-muted)}
.orders-mode .erp-funnel-stage strong{font-weight:600;font-size:11px}
.orders-mode .erp-funnel-stage[aria-pressed=true]{outline:none}
.orders-mode .erp-funnel-stage[aria-pressed=true]{color:var(--tg-accent);background:color-mix(in srgb,var(--tg-accent) 13%,var(--tg-surface))}
.orders-mode .stage-new{--stage-dot:#428ac7}
.orders-mode .stage-in_progress{--stage-dot:#48a266}
.orders-mode .stage-measurement{--stage-dot:#c69330}
.orders-mode .stage-quotation{--stage-dot:#9a71c6}
.orders-mode .stage-approval{--stage-dot:#369ba5}
.orders-mode .stage-completed{--stage-dot:#38965e}
.orders-mode .stage-cancelled{--stage-dot:#d26875}
.orders-mode .erp-funnel-stage:before{content:"";width:5px;height:5px;border-radius:50%;
  background:var(--stage-dot,var(--tg-accent));margin-right:3px}
.orders-mode .erp-workspace{grid-template-columns:320px minmax(0,1fr);border:0;margin:0;
  background:var(--tg-surface);min-height:0;flex:1}
.orders-mode .erp-orders-pane{background:var(--tg-surface);padding:0 8px 8px;
  border-right:1px solid var(--tg-line);scrollbar-color:var(--tg-line) transparent}
.orders-mode .erp-list-header{top:0;padding:10px 4px 6px;background:var(--tg-surface)}
.orders-mode .erp-list-title{min-height:32px;margin-bottom:8px;gap:8px}
.orders-mode .erp-list-title>a{font-size:12px;color:var(--tg-muted);text-decoration:none;
  border:0;padding:4px 0;background:none}
.orders-mode .erp-box-tabs{gap:4px}
.orders-mode .erp-box-tabs button{width:34px;height:32px;min-height:32px;background:transparent;
  color:var(--tg-muted);border:0;border-radius:9px}
.orders-mode .erp-box-tabs button[aria-pressed=true]{color:var(--tg-accent);background:var(--tg-field)}
.orders-mode .erp-list-section-title{margin-bottom:8px;align-items:center}
.orders-mode .erp-list-section-title h3{font-size:19px;font-weight:600;letter-spacing:-.3px;margin:0}
.orders-mode #erp-new-order{color:var(--tg-accent);background:var(--tg-field);width:30px;
  height:30px;min-height:30px;font-size:23px;border:0;border-radius:50%}
.orders-mode .erp-list-header input{height:36px;min-height:36px;padding:8px 12px;
  font-size:13px;border:0;border-radius:20px;margin-bottom:7px}
.orders-mode .erp-list-header select{height:28px;min-height:28px;font-size:11px;border:0;
  color:var(--tg-muted);background:transparent;padding:3px 7px}
.orders-mode #erp-status{font-size:10px;color:var(--tg-muted);padding:0 8px;margin:3px 0 6px}
.orders-mode .erp-board{padding:0;display:block}
.orders-mode .erp-card{display:flex;align-items:center;gap:12px;width:100%;min-height:78px;
  border:0;border-radius:10px;padding:10px 8px;margin:0 0 2px;text-align:left;
  color:var(--tg-text);background:var(--tg-surface);box-shadow:none}
.orders-mode .erp-card:hover{background:var(--tg-field)}
.orders-mode .erp-card[aria-pressed=true],.orders-mode .erp-box-card[data-selected=true]{
  background:var(--tg-active);color:#fff}
.frd-chat-avatar{display:inline-flex;align-items:center;justify-content:center;flex:none;
  width:48px;height:48px;border-radius:50%;color:#fff;font-size:18px;font-weight:500;
  background:linear-gradient(145deg,#56b8f1,#3884d3);user-select:none}
.frd-chat-avatar[data-palette="1"]{background:linear-gradient(145deg,#b497f4,#8c6ed0)}
.frd-chat-avatar[data-palette="2"]{background:linear-gradient(145deg,#ffa783,#e3785e)}
.frd-chat-avatar[data-palette="3"]{background:linear-gradient(145deg,#79c98a,#47a363)}
.frd-chat-avatar[data-palette="4"]{background:linear-gradient(145deg,#67cfcd,#31a1a6)}
.frd-chat-avatar[data-palette="5"]{background:linear-gradient(145deg,#ef99be,#d56698)}
.orders-mode .erp-card>.frd-chat-avatar{display:flex;align-items:center;justify-content:center}
.orders-mode .frd-chat-card-body{display:flex;flex-direction:column;flex:1;min-width:0;position:relative}
.orders-mode .erp-card{position:relative;flex-wrap:nowrap;writing-mode:horizontal-tb}
.orders-mode .erp-card>.frd-chat-card-body{flex:1 1 0;width:0;overflow:hidden}
.orders-mode .erp-card>.erp-reminder{position:absolute;right:8px;bottom:3px;max-width:75%;white-space:nowrap;font-size:9px;overflow:hidden;text-overflow:ellipsis}
.orders-mode .erp-card-top{order:2;margin-top:4px;justify-content:space-between}
.orders-mode .erp-card .erp-stage-badge{position:absolute;right:0;top:0;white-space:nowrap;line-height:16px}
.orders-mode .erp-card strong{padding-right:76px}
.orders-mode .erp-card .erp-caption{font-size:9px;color:var(--tg-muted)}
.orders-mode .erp-card strong{font-size:14px;line-height:20px;margin:0 0 3px;font-weight:600;
  white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.orders-mode .erp-card .erp-card-preview{font-size:12px;line-height:17px;color:var(--tg-muted);
  -webkit-line-clamp:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
.orders-mode .erp-card-meta{display:none}
.orders-mode .erp-card .erp-stage-badge{font-size:9px;padding:1px 6px;border-radius:10px;
  background:var(--tg-field);color:var(--tg-muted);border:0}
.orders-mode .erp-card[aria-pressed=true] .erp-card-preview,
.orders-mode .erp-card[aria-pressed=true] .erp-caption,
.orders-mode .erp-box-card[data-selected=true] .erp-box-preview{color:#ffffffbf}
.orders-mode .erp-card[aria-pressed=true] .erp-stage-badge{background:#ffffff25;color:#fff}
.orders-mode .erp-card .erp-stage-badge{color:var(--stage-dot,var(--tg-muted));background:color-mix(in srgb,var(--stage-dot,var(--tg-muted)) 12%,var(--tg-surface))}
.orders-mode .erp-box-card{display:grid;grid-template-columns:48px minmax(0,1fr);gap:4px 12px;
  position:relative;align-content:center}
.orders-mode .erp-box-card>.frd-chat-avatar{grid-row:1/3}
.orders-mode .erp-box-card-heading{grid-column:2;gap:4px;min-width:0}
.orders-mode .erp-box-open{gap:5px;font-size:14px;min-width:0;color:inherit;padding:0!important}
.orders-mode .erp-box-open .erp-messenger-icon{width:14px;height:14px;flex:none}
.orders-mode .erp-box-card .erp-box-preview{grid-column:2;text-align:left;padding:0!important;
  min-height:18px!important;font-size:12px;color:var(--tg-muted);overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;border:0;background:transparent}
.orders-mode .erp-unread{position:absolute;right:9px;bottom:6px;background:var(--tg-accent);
  color:#fff;font-size:10px;padding:2px 6px;border-radius:12px}
.orders-mode .erp-box-action{border:0;background:var(--tg-field);color:var(--tg-muted);
  min-width:24px;width:24px;height:24px;min-height:24px!important;font-size:10px}
.orders-mode .erp-box-card[data-selected=true] .erp-box-action{color:#fff;background:#ffffff25}
.orders-mode .erp-box-channels{padding:4px 8px;margin:0 0 6px;border:0;background:var(--tg-surface)}
.orders-mode .erp-channel-button{background:var(--tg-field);border:0;border-radius:50%}
.orders-mode .erp-blocklist-button{color:var(--tg-muted);background:transparent;border:0}
.orders-mode .erp-inbox{border-color:var(--tg-line);padding:8px;margin:6px 0}
.orders-mode .erp-inbox summary{color:var(--tg-muted);font-size:12px}
.orders-mode .erp-detail{background:var(--tg-chat);border:0;padding:0;overflow:hidden;
  background-image:radial-gradient(circle at 15% 35%,#ffffff08 0,transparent 45%)}
.orders-mode .erp-detail>p{color:var(--tg-muted);text-align:center;align-self:center;margin:auto;padding:24px}
.orders-mode .erp-chat-header{display:flex;align-items:center;gap:11px;padding:8px 18px;
  min-height:60px;background:var(--tg-surface);border-bottom:1px solid var(--tg-line)}
.orders-mode .erp-chat-header>.frd-chat-avatar{width:40px;height:40px;font-size:15px}
.orders-mode .erp-chat-header>div{display:flex;flex-direction:column;gap:3px;align-items:flex-start;
  flex:1;min-width:0}
.orders-mode .erp-chat-header h3{font-size:15px;font-weight:600;margin:0;line-height:20px;
  max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.orders-mode .erp-chat-header small{margin:0;align-self:flex-start;font-size:11px;color:var(--tg-muted);display:block;max-width:100%}
.orders-mode .erp-chat-header .erp-caption{display:none}
.orders-mode .erp-chat-header>.erp-box-header-actions{flex-direction:row;flex:none;gap:8px}
.orders-mode .erp-participant-strip{background:var(--tg-surface);border:0;padding:2px 18px 6px;
  min-height:25px;gap:5px;scrollbar-width:none}
.orders-mode .erp-participant-chip,.orders-mode .erp-participant-add{border:0!important;
  border-radius:12px;background:var(--tg-field);color:var(--tg-muted);font-size:10px!important;padding:3px 9px!important}
.orders-mode .erp-participant-chip.owner{color:var(--tg-accent)}
.orders-mode .erp-chat-toolbar{background:var(--tg-surface);border-bottom:1px solid var(--tg-line);
  padding:3px 14px 6px;gap:4px;scrollbar-width:none}
.orders-mode .erp-chat-toolbar button{border:0;background:transparent;color:var(--tg-muted);
  border-radius:6px;font-size:10px;min-height:24px;padding:3px 7px}
.orders-mode .erp-chat-toolbar button:hover{background:var(--tg-field);color:var(--tg-accent)}
.orders-mode .erp-client-channel{border:0;background:var(--tg-field);color:var(--tg-muted);border-radius:12px}
.orders-mode .erp-messages{border:0;background:transparent;margin:0}
.orders-mode .erp-message-list{padding:16px max(16px,calc((100% - 820px)/2));gap:7px;
  scrollbar-color:color-mix(in srgb,var(--tg-muted) 25%,transparent) transparent}
.orders-mode .erp-message{border:0!important;background:var(--tg-incoming);color:var(--tg-text);
  box-shadow:var(--tg-shadow);border-radius:12px 12px 12px 4px;padding:8px 11px;margin:0;
  max-width:min(82%,560px);min-width:90px;align-self:flex-start;position:relative}
.orders-mode .erp-message.mine,.orders-mode .erp-message.erp-box-outgoing{background:var(--tg-outgoing);
  border-radius:12px 12px 4px 12px;align-self:flex-end;margin-left:auto;color:var(--tg-text)}
.orders-mode .erp-message strong{font-size:12px;font-weight:600;color:var(--tg-accent);line-height:17px}
.orders-mode .erp-message-text{font-size:14px;line-height:1.45;margin:3px 0 5px;white-space:pre-wrap}
.orders-mode .frd-message-time{display:block;text-align:right;clear:both;font-size:10px;
  color:var(--tg-muted);line-height:12px;float:none;margin:0 0 3px 0}
.orders-mode .erp-message.mine .frd-message-time,.orders-mode .erp-box-outgoing .frd-message-time{color:var(--tg-out-ink)}
.orders-mode .erp-message small{color:var(--tg-muted);font-size:10px;line-height:1.35}
.orders-mode .erp-client-origin,.orders-mode .erp-topic-message-label{font-size:10px;color:var(--tg-muted);margin:0 0 3px}
.orders-mode .erp-message-actions{justify-content:flex-end;gap:5px;margin:4px 0 0;clear:both}
.orders-mode .erp-message-action{border:0;background:color-mix(in srgb,var(--tg-accent) 10%,var(--tg-incoming));
  color:var(--tg-accent);width:24px;height:24px;min-height:24px;box-shadow:none}
.orders-mode .erp-accept-decision{border:0;background:color-mix(in srgb,var(--tg-accent) 8%,var(--tg-incoming));
  color:var(--tg-accent);padding:5px 9px;border-radius:7px;font-size:10px;min-height:25px;margin-top:4px}
.orders-mode .erp-box-delivery,.orders-mode .erp-native-reply-note{color:var(--tg-muted);font-size:10px;clear:both}
.orders-mode .erp-message.mine small,.orders-mode .erp-box-outgoing small,
.orders-mode .erp-box-outgoing .erp-client-origin{color:var(--tg-out-ink)}
.orders-mode .erp-source-quote{color:var(--tg-text);background:var(--tg-field);border-color:var(--tg-accent)}
.orders-mode .erp-message .erp-material-card{border:0;background:transparent;padding:3px 0;margin:4px 0;gap:4px}
.orders-mode .erp-message .erp-material-card img{max-height:240px;border-radius:9px;background:var(--tg-field)}
.orders-mode a{color:var(--tg-accent)}
.orders-mode .erp-message-form,.orders-mode .erp-box-composer{background:var(--tg-surface);
  color:var(--tg-text);border:0;padding:7px 14px;margin:0;box-shadow:0 -1px 0 var(--tg-line)}
.orders-mode .erp-composer-row,.orders-mode .erp-box-compose-line{gap:5px;align-items:center}
.orders-mode .erp-composer-row textarea,.orders-mode .erp-box-compose-line textarea{
  border:0!important;border-radius:0;background:transparent;color:var(--tg-text);
  font-size:14px;line-height:1.4;height:36px;min-height:36px!important;padding:8px 6px;scrollbar-width:none}
.orders-mode textarea::placeholder,.orders-mode input::placeholder{color:var(--tg-muted);opacity:1}
.orders-mode .erp-composer-row button,.orders-mode .erp-box-tool,.orders-mode .erp-box-send{
  display:grid;place-items:center;width:32px;height:32px;min-width:32px;min-height:32px!important;
  border:0;background:transparent;color:var(--tg-muted);padding:5px!important;border-radius:50%}
.orders-mode .erp-composer-row button svg,.orders-mode .erp-box-tool svg,.orders-mode .erp-box-send svg{
  width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.orders-mode .erp-composer-row button[type=submit],.orders-mode .erp-box-send{color:var(--tg-accent);background:transparent}
.orders-mode .erp-composer-row button:hover,.orders-mode .erp-box-tool:hover{background:var(--tg-field)}
.orders-mode .erp-composer-row button[data-recording],.orders-mode .erp-box-tool[data-recording]{color:#e45454;background:#e4545415}
.orders-mode .erp-compose-options{font-size:10px;color:var(--tg-muted);margin:0}
.orders-mode .erp-compose-options summary{color:var(--tg-muted);font-size:10px;margin:0 0 2px}
.orders-mode .erp-box-recipient{color:var(--tg-accent);font-size:10px;margin-bottom:3px}
.orders-mode .erp-box-compose-status,.orders-mode .erp-messages>p[role=status]{background:transparent;color:var(--tg-muted)}
.orders-mode .erp-emoji-panel{background:var(--tg-surface);color:var(--tg-text);border:1px solid var(--tg-line);
  box-shadow:0 4px 24px #0002;border-radius:14px;padding:10px}
.orders-mode .erp-emoji-panel button{background:transparent;border:0;border-radius:8px}
.orders-mode .erp-emoji-panel button:hover{background:var(--tg-field)}
.orders-mode .erp-thread-block{border:1px solid color-mix(in srgb,var(--topic-border) 38%,var(--tg-surface));
  background:color-mix(in srgb,var(--topic-border) 9%,var(--tg-surface));color:var(--tg-text);
  border-radius:14px;padding:9px;margin:6px 0;box-shadow:var(--tg-shadow)}
.orders-mode .erp-thread-question-title{font-size:13px;color:var(--tg-text);line-height:1.45;max-height:76px}
.orders-mode .erp-thread-people{padding:3px 0 7px;gap:4px}
.orders-mode .erp-topic-person{color:var(--tg-muted);border:0;background:var(--tg-field);font-size:10px;padding:3px 8px}
.orders-mode .erp-topic-status{border:0;background:var(--tg-field);color:var(--tg-muted);font-size:10px}
.orders-mode .erp-thread-settings,.orders-mode .erp-topic-add-person{border:0;background:transparent;
  color:var(--tg-accent);border-radius:50%}
.orders-mode .erp-thread-messages{gap:6px;padding:3px 0 0}
.orders-mode .erp-thread-messages .erp-message{max-width:86%}
.orders-mode .erp-thread-composer{margin-top:8px;border-top:1px solid var(--tg-line);border-radius:0 0 10px 10px;overflow:visible}
.orders-mode .erp-thread-composer .erp-message-form{background:var(--tg-surface);border-radius:10px;
  padding:4px 6px;box-shadow:none}
.orders-mode .erp-thread-composer>.erp-messages{background:transparent}
.orders-mode .erp-thread-summary{color:var(--tg-text);background:transparent;border:0;padding:6px}
.orders-mode .erp-thread-summary small,.orders-mode .erp-thread-cue{color:var(--tg-muted)}
.orders-mode .erp-topic-pane{background:var(--tg-surface);color:var(--tg-text);border-color:var(--tg-line);border-radius:10px}
.orders-mode .erp-topic-inline{background:transparent}
.orders-mode .erp-topic-settings{color:var(--tg-text)}
.orders-mode .erp-topic-settings summary{color:var(--tg-accent)}
.orders-mode .erp-topic-settings input,.orders-mode .erp-topic-settings textarea,.orders-mode .erp-topic-settings select{
  background:var(--tg-field);border:1px solid var(--tg-line);color:var(--tg-text);border-radius:8px}
.orders-mode .erp-materials-pane,.orders-mode .erp-inspector{background:var(--tg-surface);
  color:var(--tg-text);border-color:var(--tg-line);box-shadow:-8px 0 22px #0001}
.orders-mode .erp-inspector{padding:15px;border-radius:0;width:min(390px,100%)}
.orders-mode .erp-inspector-content{padding:10px 4px}
.orders-mode .erp-inspector h4{font-size:18px}
.orders-mode .erp-window-close{border:0;background:var(--tg-field);color:var(--tg-muted)}
.orders-mode dialog{background:var(--tg-surface);color:var(--tg-text);border:0;border-radius:14px;
  box-shadow:0 10px 50px #0003;padding:20px;max-width:calc(100vw - 24px)}
.orders-mode dialog::backdrop{background:var(--tg-overlay)}
.orders-mode dialog small,.orders-mode dialog .muted,.orders-mode .erp-inspector .muted{color:var(--tg-muted)}
.orders-mode dialog button,.orders-mode .erp-inspector button,.orders-mode .erp-materials-pane button{
  background:var(--tg-field);color:var(--tg-accent);border:0;border-radius:8px}
.orders-mode .erp-department-group h4{color:var(--tg-accent)}
.orders-mode .erp-department-person{background:var(--tg-field);color:var(--tg-text);border:0}
.orders-mode .erp-department-person small{color:var(--tg-muted)}
.orders-mode .erp-material-card,.orders-mode .erp-task,.orders-mode .erp-participant{
  border-color:var(--tg-line);border-radius:10px;background:var(--tg-surface)}
.orders-mode .erp-material-card small,.orders-mode .erp-file-note{color:var(--tg-muted)}
.orders-mode .erp-folders button{background:var(--tg-field);color:var(--tg-muted);border:0;border-radius:20px}
.orders-mode .erp-folders button[aria-pressed=true]{background:var(--tg-active);color:#fff}
.orders-mode .erp-mobile-tabs{background:var(--tg-surface);margin:0;padding:2px 6px;gap:6px}
.orders-mode .erp-mobile-tabs button{background:transparent;color:var(--tg-muted);border:0;border-radius:0;
  min-height:28px;height:28px;font-size:11px;padding:3px 8px;position:relative}
.orders-mode .erp-mobile-tabs button[aria-pressed=true]{background:transparent;color:var(--tg-accent)}
.orders-mode .erp-mobile-tabs button[aria-pressed=true]:after{content:"";position:absolute;bottom:0;
  left:25%;right:25%;height:2px;border-radius:2px;background:var(--tg-accent)}
@media(min-width:651px) and (max-width:1000px){.orders-mode .erp-workspace{grid-template-columns:285px minmax(0,1fr)}}
@media(max-width:650px){
  body.orders-mode #voice-panel{left:0;right:0;width:100%;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
  .orders-mode #workspace>.row{padding:0 6px;gap:5px;min-height:20px}
  .orders-mode #person{font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:52%}
  .orders-mode #workspace>.row button{font-size:9px;padding:0 3px}
  .orders-mode .erp-sales-strip{padding:3px 6px;min-height:26px;height:26px;max-height:26px}
  .orders-mode .erp-workspace{grid-template-columns:1fr;margin:0}
  .orders-mode .erp-chat-header{padding:6px 10px;min-height:50px;gap:9px}
  .orders-mode .erp-chat-header>.frd-chat-avatar{width:34px;height:34px;font-size:13px}
  .orders-mode .erp-chat-header h3{font-size:14px}
  .orders-mode .erp-chat-header small{font-size:10px}
  .orders-mode .erp-participant-strip{padding:1px 8px 5px;min-height:23px}
  .orders-mode .erp-chat-toolbar{padding:2px 6px 4px}
  .orders-mode .erp-chat-toolbar button{font-size:9px;min-height:22px;padding:3px 6px}
  .orders-mode .erp-message-list{padding:9px 8px;gap:6px}
  .orders-mode .erp-message{max-width:88%;padding:7px 10px}
  .orders-mode .erp-message-text{font-size:14px;line-height:1.4}
  .orders-mode .erp-thread-block{padding:7px;margin:5px 0}
  .orders-mode .erp-thread-question-title{font-size:12px}
  .orders-mode .erp-thread-tools{gap:2px}
  .orders-mode .erp-topic-status{font-size:9px;padding:3px 4px}
  .orders-mode .erp-message-form,.orders-mode .erp-box-composer{padding:5px 7px max(5px,env(safe-area-inset-bottom))}
  .orders-mode .erp-thread-composer .erp-message-form{padding:3px 3px}
  .orders-mode .erp-composer-row,.orders-mode .erp-box-compose-line{gap:2px}
  .orders-mode .erp-composer-row textarea,.orders-mode .erp-box-compose-line textarea{font-size:16px!important;
    min-height:34px!important;height:34px;padding:6px 3px}
  .orders-mode .erp-composer-row button,.orders-mode .erp-box-tool,.orders-mode .erp-box-send{width:28px;height:30px;
    min-width:28px;min-height:30px!important;padding:3px!important}
  .orders-mode .erp-composer-row button svg,.orders-mode .erp-box-tool svg,.orders-mode .erp-box-send svg{width:21px;height:21px}
  .orders-mode.frd-keyboard-open .erp-chat-header{min-height:36px;padding:2px 8px}
  .orders-mode.frd-keyboard-open .erp-chat-header>.frd-chat-avatar{width:28px;height:28px;font-size:11px}
  .orders-mode.frd-keyboard-open .erp-message-form,.orders-mode.frd-keyboard-open .erp-box-composer{padding-bottom:4px}
  .orders-mode.frd-topic-input .erp-composer-topic-focus{margin:0;padding:5px;box-sizing:border-box}
  .orders-mode .erp-workspace .erp-materials-pane{left:0}
}

.orders-mode .frd-day-separator{align-self:center;list-style:none;background:color-mix(in srgb,var(--tg-chat) 75%,var(--tg-muted));color:var(--tg-text);padding:3px 12px;border-radius:15px;font-size:11px;margin:5px 0;box-shadow:var(--tg-shadow)}

.orders-mode .erp-composer-row textarea::-webkit-scrollbar,.orders-mode .erp-box-compose-line textarea::-webkit-scrollbar{display:none}

/* ERP 15.02: one action slot and emoji inside the editing field. */
.orders-mode .frd-compose-field{position:relative;flex:1;min-width:0;display:flex;align-items:center}
.orders-mode .frd-compose-field textarea{width:100%;padding-right:38px!important;box-sizing:border-box}
.orders-mode .frd-compose-field > button{position:absolute;right:4px;bottom:3px;width:30px!important;height:30px!important;min-height:30px!important;padding:5px!important;background:transparent!important;color:var(--tg-muted)!important}
.orders-mode .frd-compose-action{display:flex;align-items:center;flex:0 0 36px;width:36px}
.orders-mode .frd-compose-action > button{width:36px!important;height:36px!important;min-height:36px!important;padding:8px!important;border-radius:50%!important}
.orders-mode .erp-thread-header .erp-thread-heading{display:flex;align-items:center;gap:8px;min-width:0}
.orders-mode .erp-thread-header .erp-thread-question-title{flex:1;min-width:0;margin:0}
.orders-mode .erp-thread-header .erp-thread-tools{display:flex;align-items:center;gap:5px;flex-shrink:0;margin:0}
.orders-mode .erp-thread-header .erp-thread-tools .erp-thread-settings{display:grid;place-items:center;width:26px;height:26px;min-height:26px!important;padding:4px!important;border:0;border-radius:50%;line-height:1;background:transparent;color:var(--tg-muted)}
.orders-mode .erp-thread-settings svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:600px){.orders-mode .erp-thread-header .erp-thread-heading{flex-wrap:wrap}.orders-mode .erp-thread-header .erp-thread-tools{margin-left:auto}}

/* ERP 15.03: notification list follows the messenger theme. */
.orders-mode .erp-inbox{margin:8px 0 0;padding:0;border:0;border-radius:12px;background:var(--tg-surface);color:var(--tg-text)}
.orders-mode .erp-inbox>summary{display:flex;align-items:center;gap:8px;list-style:none;padding:10px 12px;font-size:13px;font-weight:600;border-radius:10px;color:var(--tg-muted)}
.orders-mode .erp-inbox>summary::-webkit-details-marker{display:none}
.orders-mode .frd-notification-bell{display:flex;color:var(--tg-accent)}
.orders-mode .frd-notification-bell svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.orders-mode .erp-inbox>summary:after{content:'⌄';margin-left:auto;font-size:17px;transition:transform .15s}
.orders-mode .erp-inbox[open]>summary:after{transform:rotate(180deg)}
.orders-mode .erp-inbox>summary:hover{background:var(--tg-field)}
.orders-mode .erp-inbox #erp-notifications{padding:0;margin:0;border:0}
.orders-mode #erp-notifications h3{display:flex;align-items:center;gap:7px;margin:0;padding:8px 12px;font-size:12px;font-weight:500;color:var(--tg-muted)}
.orders-mode .frd-notification-count{background:var(--tg-accent);color:white;min-width:18px;padding:2px 4px;border-radius:12px;font-size:10px;text-align:center}
.orders-mode .erp-notification{display:flex;flex-wrap:nowrap;align-items:center;gap:3px;margin:0;padding:0 4px;border:0;border-radius:10px;background:var(--tg-surface)}
.orders-mode .erp-notification:hover{background:var(--tg-field)}
.orders-mode .erp-notification .frd-notification-link{display:flex;align-items:center;flex:1;gap:9px;min-width:0;text-align:left;padding:10px 5px;border:0;border-radius:9px;background:transparent;font-size:12px}
.orders-mode .frd-notification-link>.frd-chat-avatar{flex:0 0 34px;width:34px;height:34px;font-size:12px}
.orders-mode .frd-notification-body{display:flex;flex:1;min-width:0;flex-direction:column;gap:3px}
.orders-mode .frd-notification-body strong{font-size:12px;color:var(--tg-text);overflow-wrap:anywhere}
.orders-mode .frd-notification-body>span{font-size:11px;line-height:1.35;color:var(--tg-muted);overflow-wrap:anywhere}
.orders-mode .frd-notification-link time{flex-shrink:0;font-size:10px;align-self:flex-start;margin-top:1px;color:var(--tg-muted)}
.orders-mode .erp-notification .frd-notification-read{flex:0 0 26px;width:26px;height:26px;min-height:26px;padding:0;border:0;border-radius:50%;background:color-mix(in srgb,var(--tg-accent) 14%,var(--tg-surface));color:var(--tg-accent);font-size:15px}
.orders-mode .erp-notification.unread .frd-notification-link time{color:var(--tg-accent)}
.orders-mode #erp-notifications>p{margin:0;padding:12px;font-size:12px;color:var(--tg-muted)}
.orders-mode #erp-notifications>button{display:block;width:100%;border:0;border-radius:9px;padding:8px;background:var(--tg-field);color:var(--tg-accent);font-size:12px}

/* ERP 15.04: scrolling over topic headers must reach the chat timeline. */
.orders-mode .erp-thread-people{touch-action:pan-x pan-y;overscroll-behavior-x:contain;overscroll-behavior-y:auto}
.orders-mode .erp-thread-header,.orders-mode .erp-thread-question-title,.orders-mode .erp-thread-next{overscroll-behavior-y:auto;touch-action:pan-x pan-y}
/* ERP 15.05–15.06: light controls, hold-to-record and message-based decisions. */
.orders-mode .erp-composer-row button svg,.orders-mode .erp-box-compose-line button svg{width:18px;height:18px;stroke-width:1.35}
.orders-mode .frd-compose-field>button svg{width:18px;height:18px}
.orders-mode .frd-compose-action>button{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.orders-mode .erp-message-form,.orders-mode .erp-box-composer{position:relative}
.orders-mode .frd-record-lock{position:absolute;right:8px;bottom:55px;z-index:4;padding:7px 10px!important;border:1px solid var(--tg-line);border-radius:18px;background:var(--tg-surface);color:var(--tg-accent);font-size:11px!important;box-shadow:var(--tg-shadow);min-height:30px!important}
.orders-mode .erp-message-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px}
.orders-mode .erp-message-actions .erp-accept-decision{margin:0;padding:4px 8px;min-height:26px;font-size:10px;font-weight:400;border:0;border-radius:15px;background:var(--tg-field);color:var(--tg-muted)}
.orders-mode .erp-accept-decision[aria-pressed=true]{background:var(--tg-accent)!important;color:white!important}
.orders-mode .erp-message-action-question{width:26px;height:26px;min-height:26px;border:1px solid var(--tg-line);background:transparent!important;color:var(--tg-accent);font-size:17px;font-weight:400}
.orders-mode .erp-message-action-question span{font-weight:400;font-size:17px;line-height:1}
.orders-mode .frd-topic-colors{display:flex;align-items:center;gap:6px;padding:5px 0}
.orders-mode .frd-topic-color{width:14px;height:14px;min-height:14px;min-width:14px;padding:0;border:2px solid var(--tg-surface);border-radius:50%;background:var(--dot-color);box-shadow:0 0 0 1px transparent}
.orders-mode .frd-topic-color[aria-pressed=true]{box-shadow:0 0 0 1px var(--tg-muted)}
.orders-mode .frd-topic-color[data-topic-color=sage]{--dot-color:#70aa80}
.orders-mode .frd-topic-color[data-topic-color=blue]{--dot-color:#65a4d8}
.orders-mode .frd-topic-color[data-topic-color=amber]{--dot-color:#d3ae57}
.orders-mode .frd-topic-color[data-topic-color=violet]{--dot-color:#ab89d1}
.orders-mode .frd-topic-color[data-topic-color=rose]{--dot-color:#cf889d}
.orders-mode .frd-topic-color[data-topic-color=teal]{--dot-color:#69afa9}
.orders-mode .frd-decisions-confirm{padding:5px 10px;min-height:28px;border:0;border-radius:14px;background:var(--tg-accent);color:white;font-size:11px;margin:4px 0}
.orders-mode .erp-topic-status[role=button]{cursor:pointer}

/* ERP 15.07: composers use content height after keyboard dismissal. */
.orders-mode .erp-detail>.erp-messages{display:flex;flex-direction:column}
.orders-mode .erp-detail>.erp-messages>.erp-message-list{flex:1;min-height:0}
.orders-mode .erp-detail>.erp-messages>.erp-message-form,
.orders-mode .erp-thread-composer .erp-message-form{flex:none;height:auto;min-height:0;align-self:stretch}
@media(max-width:650px){
  body.orders-mode #voice-panel{padding-bottom:0}
  .orders-mode .erp-detail>.erp-messages>.erp-message-form,
  .orders-mode .erp-order-chat>.erp-box-composer{padding-bottom:max(5px,min(34px,env(safe-area-inset-bottom)))}
  .orders-mode.frd-keyboard-open .erp-detail>.erp-messages>.erp-message-form,
  .orders-mode.frd-keyboard-open .erp-order-chat>.erp-box-composer{padding-bottom:5px}
  .orders-mode .erp-thread-composer .erp-message-form{padding-bottom:3px}
}

/* ERP 15.08: no spare space inside the composer; unclipped attachment icon. */
.orders-mode .erp-detail>.erp-messages>.erp-message-form,
.orders-mode .erp-thread-composer .erp-message-form,
.orders-mode .erp-order-chat>.erp-box-composer{height:fit-content;min-height:0;align-content:start;justify-content:flex-start;padding:5px 10px!important;box-sizing:border-box}
.orders-mode .erp-thread-composer .erp-message-form{padding:3px 6px!important}
.orders-mode .erp-composer-row,.orders-mode .erp-box-compose-line{flex:none;min-height:36px;height:auto}
.orders-mode .frd-compose-field{align-self:center;min-height:0}
.orders-mode .erp-composer-row>button,.orders-mode .erp-box-compose-line>button{flex:0 0 32px;width:32px;min-width:32px;height:32px;min-height:32px!important;padding:6px!important;overflow:visible}
.orders-mode .erp-composer-row>button svg,.orders-mode .erp-box-compose-line>button svg{display:block;width:18px;height:18px;overflow:visible}
@media(max-width:650px){body.orders-mode #voice-panel{padding-bottom:min(20px,env(safe-area-inset-bottom))}}

/* ERP 16.01: compact event strip and Telegram event drawers. */
#erp-activity-bar{display:flex;gap:2px;align-items:center;overflow-x:auto;touch-action:pan-x;flex-shrink:0}
.orders-mode .erp-list-title{flex-wrap:wrap;gap:4px}
.orders-mode #erp-activity-bar button{position:relative;min-width:26px;width:26px;height:28px;padding:2px;border:0;background:transparent;color:var(--tg-muted);font-size:18px;border-radius:50%}
#erp-activity-bar button.has-events{color:var(--tg-accent)}
#erp-activity-bar button.urgent.has-events{color:#e25a64}
#erp-activity-bar button span{position:absolute;right:0;top:0;border-radius:8px;background:var(--tg-accent);color:white;font-size:9px;min-width:12px;padding:0 2px}
.frd-activity-dialog,.erp-task-dialog{background:var(--tg-surface);color:var(--tg-text);border:1px solid var(--tg-line);border-radius:18px;padding:18px;width:min(420px,calc(100vw - 24px));max-height:80dvh;overflow:auto}
.frd-activity-dialog h3{font-size:16px;padding-right:26px}
.frd-activity-dialog .frd-notification-link{width:100%;text-align:left;border:0;border-radius:12px;background:transparent;padding:10px;display:flex;gap:10px;color:inherit}
.frd-activity-dialog .unread{background:var(--tg-field)}
.frd-activity-dialog .frd-notification-body{flex:1;min-width:0}
.frd-activity-dialog .frd-notification-body span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:240px}
@media(max-width:650px){.orders-mode #erp-activity-bar{display:flex}.orders-mode .erp-orders-pane:has(#erp-activity-bar){overflow:hidden}}

.orders-mode #erp-activity-bar{height:30px;min-height:30px;justify-content:flex-end;background:var(--tg-surface);border-bottom:1px solid var(--tg-line);padding:0 8px}

#erp-activity-bar svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.orders-mode #erp-activity-bar button{min-height:28px!important;max-height:28px;height:28px!important;flex:0 0 26px}
.orders-mode #erp-activity-bar{overflow:hidden;touch-action:manipulation;overscroll-behavior:none;box-sizing:border-box;width:100%;flex-shrink:0;scrollbar-width:none}
.orders-mode #erp-activity-bar::-webkit-scrollbar{display:none;width:0;height:0}

.orders-mode #refresh{display:none!important}
.frd-pull-refresh{position:fixed;z-index:2000;left:50%;top:calc(var(--frd-app-top,0px) + 28px);transform:translateX(-50%);padding:7px 14px;background:var(--tg-surface);color:var(--tg-accent);box-shadow:0 2px 12px #0003;border-radius:20px;font-size:12px;pointer-events:none;white-space:nowrap}

/* ERP 16.02: client questions and tasks stay distinct from delivery ticks. */
.orders-mode .erp-message-action-question{flex:none;border-color:var(--tg-accent)}
.orders-mode .erp-message-action-question:disabled{opacity:.45;cursor:default}
.orders-mode .erp-message-action-task svg{stroke-linecap:round;stroke-width:1.5}

/* ERP 16.03: one small circular action size for decisions, questions and tasks. */
.orders-mode .erp-message-actions .erp-message-action{width:24px;height:24px;min-height:24px!important;min-width:24px;padding:0!important;border:1px solid var(--tg-line);border-radius:50%;margin:0;flex:0 0 24px;background:transparent!important;display:inline-flex;align-items:center;justify-content:center}
.orders-mode .erp-message-actions .erp-message-action svg{width:15px;height:15px;stroke-width:1.5;stroke-linecap:round}
.orders-mode .erp-message-actions .erp-message-action-question span{font-size:14px;line-height:1;font-weight:400}
.orders-mode .erp-message-actions .erp-accept-decision[aria-pressed=true]{border-color:var(--tg-accent);background:var(--tg-field)!important;color:var(--tg-accent)}

/* ERP 16.04: text decisions, unframed question/task icons. */
.orders-mode .erp-message-actions .erp-accept-decision{width:auto;min-width:0;flex:0 0 auto;height:24px;padding:0 7px!important;border:0;border-radius:6px;font-size:10px;white-space:nowrap}
.orders-mode .erp-message-actions .erp-message-action-question,
.orders-mode .erp-message-actions .erp-message-action-task{border:0;box-shadow:none;border-radius:0}
.orders-mode .frd-decision-reopen{font-size:10px;min-height:24px;padding:3px 8px;border:0;color:var(--tg-accent);background:var(--tg-field);border-radius:6px}

/* ERP 16.06: decision action matches question/task accent in both themes. */
.orders-mode .erp-message-actions .erp-accept-decision{color:var(--tg-accent);background:transparent;font-weight:500}
.orders-mode .erp-message-actions .erp-accept-decision[aria-pressed=true]{background:var(--tg-accent)!important;color:var(--tg-out-ink)!important}

.orders-mode .erp-message-focus{outline:2px solid var(--tg-accent);outline-offset:2px}
/* ERP 17.05: one telephone event, shared by every matching contact. */
.orders-mode .erp-phone-call{display:flex;flex-direction:column;gap:8px;max-width:560px;min-width:0;color:var(--tg-text)}
.orders-mode .erp-phone-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.orders-mode .erp-phone-call small{font-size:11px;color:var(--tg-muted)}
.orders-mode .erp-phone-call audio{display:block;width:100%;max-width:100%;height:36px}
.orders-mode .erp-phone-call summary{cursor:pointer;color:var(--tg-accent);font-size:13px;padding:5px 0}
.orders-mode .erp-phone-warning{padding:5px 8px;border-radius:8px;background:color-mix(in srgb,#d89735 14%,var(--tg-incoming));color:var(--tg-text)!important}
.orders-mode .erp-phone-content{padding-top:8px;overflow-wrap:anywhere}
.orders-mode .erp-phone-fact{padding:10px 0;border-bottom:1px solid var(--tg-line)}
.orders-mode .erp-phone-fact p{margin:5px 0}
.orders-mode .erp-phone-fact strong{font-size:12px}
.orders-mode .erp-phone-fact blockquote{font-size:12px;margin:5px 0;padding:5px 10px;border-left:2px solid var(--tg-accent);white-space:pre-wrap}
.orders-mode .erp-phone-transcript{white-space:pre-wrap;font-size:13px;line-height:1.5}
.orders-mode .erp-phone-files{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0;font-size:12px}
.orders-mode .erp-phone-event{max-width:min(95%,600px)}
@media(max-width:700px){.orders-mode .erp-phone-heading{gap:6px}.orders-mode .erp-phone-heading strong{font-size:13px}.orders-mode .erp-phone-call{max-width:100%}}
.orders-mode article.erp-phone-call{border:0;padding:0;margin:0;background:transparent;box-shadow:none}
.orders-mode .erp-phone-call>.erp-message-text{margin:2px 0}

/* ERP 17.14.7: compact call actions override shared message controls. */
.orders-mode .erp-call-plan{max-width:100%;width:100%;flex-shrink:0;background:var(--tg-surface)!important;padding:8px!important;overflow:visible;touch-action:pan-y}
.erp-call-plan-table{width:100%;min-width:0;overflow:visible}.erp-call-plan-table h3{font-size:14px;margin:0 0 6px}
.erp-call-plan-info{display:grid;grid-template-columns:auto minmax(0,1fr);gap:3px 10px;font-size:12px}.erp-call-plan-info dt{color:var(--tg-muted)}.erp-call-plan-info dd{margin:0}
.erp-plan-about{font-size:11px;color:var(--tg-muted);margin-bottom:6px}.erp-plan-about p{font-size:12px;line-height:1.4}.erp-plan-about summary{cursor:pointer}
.erp-plan-caption{font-size:11px;color:var(--tg-muted);margin:6px 0}
.erp-plan-item{padding:7px 0;border-bottom:1px solid var(--tg-line);min-width:0;touch-action:pan-y}
.erp-plan-heading{display:flex;align-items:flex-start;gap:7px}.erp-plan-heading input[type=checkbox]{width:16px;height:16px;min-height:16px;margin:2px 0 0;padding:0;flex:none}
.erp-plan-description{flex:1;min-width:0}.erp-plan-description summary{font-size:13px;font-weight:500;cursor:pointer;line-height:20px}.erp-plan-description p{font-size:12px;line-height:1.45;margin:5px 0;white-space:pre-line}
.orders-mode .erp-plan-icons{display:flex;gap:6px;justify-content:flex-start;margin:5px 0 0 23px;flex-wrap:nowrap}
.orders-mode .erp-plan-icons .erp-message-action{width:27px;height:27px;min-height:27px!important;min-width:27px;flex:0 0 27px;border:0!important;border-radius:6px;color:var(--tg-accent);background:transparent!important;opacity:1}
.orders-mode .erp-plan-icons .erp-message-action svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.orders-mode .erp-plan-icons .erp-message-action[aria-pressed=true]{background:var(--tg-active)!important;color:white}
.orders-mode .erp-plan-icons .erp-message-action:disabled{opacity:.55;cursor:default}.orders-mode .erp-plan-icons .erp-message-action-question span{font-size:19px;font-weight:500}
.erp-plan-values{font-size:10px;color:var(--tg-muted);margin:3px 0 0 23px;line-height:1.4}.erp-plan-values:empty{display:none}
.erp-plan-item[data-priority=urgent]{border-left:2px solid #ed6675;padding-left:5px}.erp-plan-item[data-priority=high]{border-left:2px solid #e0a847;padding-left:5px}
.erp-plan-dialog{width:min(360px,calc(100vw - 28px));max-height:75dvh;overflow-y:auto}.erp-plan-dialog h3{font-size:16px}.erp-plan-dialog select,.erp-plan-dialog input{width:100%;max-width:100%;font-size:16px;min-height:40px;box-sizing:border-box}
.erp-plan-apply,.erp-order-remove,.erp-trash-open{font-size:12px!important;min-height:30px!important;margin:6px;padding:6px 10px!important;border-radius:8px!important}
.erp-plan-apply{background:var(--tg-accent)!important;color:white!important}.erp-order-remove{align-self:flex-end;color:var(--tg-muted)}

/* ERP 17.14.8: tooltips stay outside clipped chat containers. */
.frd-icon-tooltip{position:fixed;inset:auto;margin:0;max-width:min(240px,calc(100vw - 12px));width:max-content;box-sizing:border-box;padding:5px 8px;border:1px solid var(--tg-line,#536171);border-radius:6px;background:var(--tg-surface,#182532);color:var(--tg-text,#e6edf3);font:400 11px/1.35 system-ui,-apple-system,sans-serif;letter-spacing:.01em;box-shadow:0 3px 12px #0002;pointer-events:none;z-index:10000;overflow-wrap:anywhere}
.frd-icon-tooltip[hidden]{display:none}

/* phone-book.css */
body.phone-book-mode{background:#f3f6f9;color:#243547;font-family:Arial,sans-serif;font-size:15px}.phone-book-mode .staff-texture,.phone-book-mode #note-section,.phone-book-mode #journal-section,.phone-book-mode #erp-access,.phone-book-mode #voice-panel>h1,.phone-book-mode #voice-panel>.muted{display:none}.phone-book-mode #voice-panel{width:100%;max-width:none;margin:0;padding:0 16px;background:transparent;box-shadow:none;border:0}.phone-book-mode .team-header{background:#fff;border-color:#dce4eb}.phone-book-mode .team-brand,.phone-book-mode .team-title{display:none}.phone-book-mode .team-header-inner{padding:10px 16px;min-height:0}.phone-book-mode #workspace>.row{font-size:12px;padding:6px 0}.phone-book-mode #workspace>.row button{min-height:28px;padding:4px 8px}.phone-book-mode section{border:0;padding:12px 0}.phone-book-mode input,.phone-book-mode select{background:#fff;color:#243547;border:1px solid #dce4eb;border-radius:8px;min-height:38px;padding:8px;font-size:16px;max-width:100%}.phone-book-mode button{min-height:34px;border:0;border-radius:8px;padding:7px 12px;background:#e7f1fb;color:#2685c5;font-size:14px}.phone-book-mode a{color:#2685c5}.phone-book-mode small{display:block;font-size:12px;color:#71869b}.pb-toolbar,.pb-actions,.pb-chips{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.pb-toolbar input{flex:1}.pb-grid{display:grid;grid-template-columns:280px minmax(0,1fr);gap:16px;align-items:start}.pb-grid aside{position:sticky;top:12px;max-height:80vh;overflow-y:auto}.pb-contact{display:block;width:100%;text-align:left;margin:4px 0!important;background:#fff!important}.pb-contact[data-selected=true]{background:#d5eafa!important}.pb-contact strong{display:block}.pb-card{min-width:0;background:#fff;border-radius:12px;padding:18px}.pb-card section{border-top:1px solid #e8edf2;padding:16px 0}.pb-card h2{margin:0;font-size:23px}.pb-card h3{margin:0 0 10px;font-size:17px}.pb-card article{padding:12px;margin:10px 0;border:1px solid #e2e9ef;border-radius:10px;background:#f6f9fc}.pb-card p{margin:8px 0}.pb-card label{display:block;font-size:13px;min-width:0}.pb-card label input:not([type=checkbox]),.pb-card label select{display:block;width:100%;margin:4px 0 10px}.pb-chips label{display:flex;align-items:center;gap:5px;background:#eaf3fb;padding:4px 8px;border-radius:18px}.pb-chips input{min-height:0;width:16px;margin:0}.pb-card form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}.pb-card blockquote{margin:8px 0;padding:7px 10px;border-left:3px solid #62b0e5;color:#596e81}.pb-card a{display:inline-block;margin:6px 10px 6px 0}.pb-card pre{white-space:pre-wrap;overflow-wrap:anywhere;font:14px/1.6 Arial}.pb-card article[data-status=rejected]{opacity:.65}.pb-status{min-height:20px;margin:0;color:#397eae}.pb-card audio{width:100%;color-scheme:light}body.phone-book-mode dialog{border:1px solid #dce4eb;border-radius:12px;background:#fff;color:#243547;max-width:90vw}body.phone-book-mode dialog input{display:block}html[data-chat-theme=dark] body.phone-book-mode{background:#0f1720;color:#dae5ee}html[data-chat-theme=dark] .phone-book-mode .pb-card,html[data-chat-theme=dark] .phone-book-mode .team-header,html[data-chat-theme=dark] .phone-book-mode input,html[data-chat-theme=dark] .phone-book-mode select{background:#172430;color:#dae5ee}html[data-chat-theme=dark] .phone-book-mode .pb-contact{background:#172430!important}html[data-chat-theme=dark] .phone-book-mode .pb-card article{background:#20313e}#phone-book-shortcut{font-size:13px;padding:4px 8px;white-space:nowrap}@media(max-width:650px){.pb-grid{grid-template-columns:1fr}.pb-grid aside{position:static;max-height:200px}.pb-card{padding:12px}.pb-card form{grid-template-columns:1fr}.phone-book-mode #voice-panel{padding:0 8px}.pb-toolbar{gap:4px}}

.orders-mode .erp-partner-commissions{padding:4px 12px;background:#d49a2720;font-size:12px;flex-shrink:0}.orders-mode .erp-partner-commissions a{display:block;color:var(--tg-link,#4fa7df)}
.phone-book-mode #refresh,.phone-book-mode #export,.phone-book-mode #phone-book-shortcut,.phone-book-mode #restore-panel,.phone-book-mode #message,.phone-book-mode .team-nav>[aria-disabled]{display:none!important}.phone-book-mode .team-header-inner{padding:6px 16px}.phone-book-mode .team-nav{gap:18px;justify-content:flex-start;font-size:14px}.phone-book-mode .team-header{backdrop-filter:none;box-shadow:none}.phone-book-mode #workspace>.row{margin:0;min-height:32px}.phone-book-mode #workspace>.row #person{margin-right:auto}.phone-book-mode #workspace{padding:0}.phone-book-mode .pb-toolbar{margin-bottom:10px}.phone-book-mode #phone-book-section{padding-top:0}.phone-book-mode #entry-button{display:none!important}.pb-chips label{color:#28485f}.pb-card input[type=checkbox]{accent-color:#328bd0}html[data-chat-theme=dark] .phone-book-mode button,html[data-chat-theme=dark] .phone-book-mode .pb-chips label{background:#294459;color:#c3e2fa}html[data-chat-theme=dark] .phone-book-mode .pb-card section,html[data-chat-theme=dark] .phone-book-mode .pb-card article,html[data-chat-theme=dark] .phone-book-mode input,html[data-chat-theme=dark] .phone-book-mode select{border-color:#344c5d}html[data-chat-theme=dark] .phone-book-mode .pb-contact[data-selected=true]{background:#284f6c!important}html[data-chat-theme=dark] .phone-book-mode dialog{background:#172430;color:#dae5ee}.pb-toolbar .pb-theme{white-space:nowrap}
.phone-book-mode .pb-call-review{width:min(760px,calc(100% - 24px));max-width:none;max-height:88dvh;padding:14px;overflow-y:auto;overscroll-behavior:contain;border-color:var(--tg-line);background:var(--tg-surface);color:var(--tg-text)}
.pb-call-review>header{display:flex;align-items:center;justify-content:space-between;gap:12px}.pb-call-review h3{margin:0;font-size:18px}.pb-call-review p{font-size:13px;margin:8px 0}
.phone-book-mode .pb-call-review textarea{display:block;width:100%;min-width:0;color:var(--tg-text);background:var(--tg-field);border:1px solid var(--tg-line);border-radius:9px;font-size:16px;line-height:1.4;padding:8px;box-sizing:border-box}
.pb-review-transcript{height:220px;resize:vertical}.pb-review-fragment{margin:10px 0;padding:10px;border:1px solid var(--tg-line);border-radius:10px;display:grid;grid-template-columns:1fr 1fr;gap:8px}
.pb-review-fragment>blockquote,.pb-review-fragment>small,.pb-review-fragment>details,.pb-review-fragment>.pb-actions{grid-column:1/-1}
.pb-review-fragment blockquote{margin:0;white-space:pre-wrap;padding:8px 10px;border-left:3px solid var(--tg-accent);background:var(--tg-field);font-size:13px;overflow-wrap:anywhere}
.pb-review-fragment label{font-size:12px;min-width:0}.phone-book-mode .pb-review-fragment input,.phone-book-mode .pb-review-fragment select{width:100%;box-sizing:border-box;color:var(--tg-text);background:var(--tg-field);border-color:var(--tg-line);min-height:34px;padding:6px;font-size:16px;margin-top:4px}
.pb-review-fragment details{font-size:12px}.pb-review-fragment details label{display:inline-block;width:calc(50% - 8px);margin:8px 8px 0 0}.pb-review-fragment details summary{cursor:pointer;color:var(--tg-accent)}
.pb-call-review button{font-size:12px!important;min-height:30px!important}.pb-call-review>header button{border-radius:50%;width:30px;height:30px;padding:0!important}.pb-call-review small{color:var(--tg-muted)}
.pb-call-review .muted{color:var(--tg-muted);opacity:1;line-height:1.5}
@media(max-width:650px){.phone-book-mode .pb-call-review{padding:10px;max-height:90dvh}.pb-review-fragment{grid-template-columns:1fr}.pb-review-fragment>blockquote,.pb-review-fragment>small,.pb-review-fragment>details,.pb-review-fragment>.pb-actions{grid-column:auto}.pb-review-transcript{height:180px}}
/* Contacts use the same compact staff chrome as the personal cabinet. */
.phone-book-mode .team-footer,.phone-book-mode #frd-staff-microphone,.phone-book-mode #voice-panel>p:first-of-type{display:none!important}
.phone-book-mode .team-header-inner{width:100%;display:flex;gap:0;padding:4px 12px;box-sizing:border-box}
.phone-book-mode .team-header .team-nav{margin:0;gap:0 16px;max-width:100%;min-width:0;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;touch-action:pan-x;scrollbar-width:none}
.phone-book-mode .team-header .team-nav::-webkit-scrollbar{display:none}
.phone-book-mode .team-header .team-nav a{font-size:12px;min-height:28px;white-space:nowrap;padding:2px 0}
.phone-book-mode #workspace>.row{flex-wrap:nowrap;align-items:center;gap:8px;padding:4px 0;min-height:26px}
.phone-book-mode #person{width:auto;min-width:0;font-size:11px;line-height:1.3;overflow-wrap:anywhere}
.phone-book-mode #logout{font-size:11px;min-height:26px;padding:3px 6px;white-space:nowrap}
body.phone-book-mode #frd-theme-toggle{display:grid;place-items:center;width:28px;min-width:28px;height:28px;min-height:28px;padding:5px;background:none}
.phone-book-mode #frd-theme-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.pb-context{margin:0 0 12px;padding:12px;border:1px solid var(--tg-line);border-radius:10px;background:var(--tg-surface)}
.pb-context p{margin:6px 0}
.phone-book-mode .pb-create-dialog{width:min(420px,calc(100% - 24px));padding:16px}
.pb-create-dialog form,.pb-create-dialog label{display:grid;gap:6px}
.pb-create-dialog form{gap:10px}
.pb-create-dialog h3{margin:0}

/* employees.css */
.profile-mode #note-section,.profile-mode #journal-section{display:none!important}
.frd-employee-editor{grid-column:1/-1;border:1px solid var(--tg-border,#78909c55);border-radius:12px;padding:10px 12px;min-width:0}
.frd-employee-editor summary{cursor:pointer;font-size:14px;color:var(--tg-accent,#56a8e8)}
.frd-employee-editor[open]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.frd-employee-editor summary,.frd-employee-editor>p,.frd-employee-editor>small{grid-column:1/-1}
.frd-employee-editor textarea{width:100%;min-height:74px;resize:vertical;font-size:16px}
.frd-profile-card{padding:18px;border:1px solid var(--tg-border,#78909c55);border-radius:16px;margin:12px 0;background:var(--tg-panel,transparent)}
.frd-profile-card dl{display:grid;grid-template-columns:minmax(120px,1fr) 2fr;gap:10px}.frd-profile-card dd{margin:0;overflow-wrap:anywhere}.frd-profile-card dt{opacity:.7}.frd-profile-card a{display:block;margin:10px 0;color:var(--tg-accent,#56a8e8)}
.erp-work-role{display:inline-flex!important;gap:7px;align-items:center;margin-right:12px!important}.erp-work-role input{width:auto!important}
@media(max-width:650px){.frd-employee-editor[open]{grid-template-columns:1fr}.frd-profile-card dl{grid-template-columns:1fr;gap:4px}.frd-profile-card dd{margin-bottom:10px}}
.frd-employee-sources{grid-column:1/-1;min-width:0}.frd-employee-sources>summary,.frd-source-settings>summary,.frd-source-create>summary{cursor:pointer;color:var(--tg-accent,#56a8e8);font-size:14px}
.frd-source-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:10px;margin-top:10px;min-width:0}
.frd-source-card{padding:12px;border:1px solid var(--tg-border,#78909c55);border-radius:12px;display:flex;flex-direction:column;gap:5px;min-width:0;overflow-wrap:anywhere}
.frd-source-actions,.frd-task-scopes{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.frd-source-actions a{font-size:14px;margin:4px 0}.frd-source-actions button,.frd-task-scopes button,.frd-activity-more{border:0;border-radius:10px;background:var(--tg-field,#263744);color:var(--tg-accent,#56a8e8);padding:7px 10px;font-size:14px;cursor:pointer}
.frd-task-scopes [aria-pressed=true]{background:var(--tg-accent,#56a8e8);color:var(--tg-surface,#17212b)}
.frd-source-settings[open],.frd-source-create form{display:grid;gap:8px;margin-top:8px}.frd-source-settings input:not([type=checkbox]),.frd-source-settings select,.frd-source-create input,.frd-source-create select{width:100%;min-width:0;font-size:16px}.frd-source-settings label{display:flex;align-items:center;gap:8px}.frd-source-settings input[type=checkbox]{width:auto}
.frd-source-create{grid-column:1/-1}.frd-profile-task{padding:10px 0;border-bottom:1px solid var(--tg-border,#78909c55);text-decoration:none}.frd-profile-task strong,.frd-profile-task small{display:block}.frd-profile-task small{margin-top:4px;color:var(--tg-muted,#8ea2b1)}
.frd-task-history-toggle{display:flex;gap:6px;align-items:center;font-size:13px;color:var(--tg-muted,#8ea2b1)}.frd-task-history-toggle input{width:auto}
/* Task ERP 19.03: the personal cabinet shares the messenger theme. */
body.profile-mode{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;background:var(--tg-field);color:var(--tg-text);padding:0;min-height:100dvh;color-scheme:light}
:root[data-chat-theme=dark] body.profile-mode{color-scheme:dark}
.profile-mode .staff-texture,.profile-mode .team-footer,.profile-mode .team-brand,.profile-mode .team-nav>span,.profile-mode #refresh,.profile-mode #export,.profile-mode #frd-staff-microphone{display:none!important}
.profile-mode .team-header{background:var(--tg-surface);border-bottom:1px solid var(--tg-line);box-shadow:none;backdrop-filter:none}
.profile-mode .team-header-inner{width:min(960px,calc(100% - 24px));min-height:0;display:flex;flex-wrap:wrap;gap:4px 16px;padding:8px 0}
.profile-mode .team-title{flex:none;text-align:left}.profile-mode .team-title p{font-size:14px;font-weight:600;line-height:24px;letter-spacing:0}
.profile-mode .team-header .team-nav{margin-left:auto;gap:4px 16px;min-width:0;max-width:100%;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;touch-action:pan-x;scrollbar-width:none}
.profile-mode .team-header .team-nav::-webkit-scrollbar{display:none}
.profile-mode .team-header .team-nav a{font-size:12px;min-height:28px;padding:2px 0;white-space:nowrap;color:var(--tg-muted)}
.profile-mode .team-header .team-nav a[aria-current=page]{color:var(--tg-accent);border-color:var(--tg-accent)}
body.profile-mode #voice-panel{width:min(960px,calc(100% - 24px));padding:10px 0 24px;margin:0 auto}
.profile-mode #voice-panel>p:first-of-type,.profile-mode #voice-panel>h1{display:none}
.profile-mode #message{font-size:12px;min-height:0;color:var(--tg-muted);margin:0 0 8px}
.profile-mode #workspace>.row{padding:0 0 8px;align-items:center;gap:8px;flex-wrap:nowrap}
.profile-mode #person{width:auto;font-size:11px;color:var(--tg-muted);overflow-wrap:anywhere}
.profile-mode #workspace>.row a{font-size:12px;white-space:nowrap;color:var(--tg-accent)}
.profile-mode button{background:var(--tg-field);color:var(--tg-accent);border:0;border-radius:10px;min-height:32px;padding:6px 10px;font-size:13px;cursor:pointer}
.profile-mode #logout{font-size:11px;min-height:26px;padding:3px 6px;white-space:nowrap}
body.profile-mode #frd-theme-toggle{display:grid;place-items:center;width:28px;min-width:28px;height:28px;min-height:28px;padding:5px;background:none}
.profile-mode #frd-theme-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.profile-mode input,.profile-mode select{background:var(--tg-field);color:var(--tg-text);border:1px solid var(--tg-line);border-radius:9px;min-height:34px;font-size:16px;padding:6px 9px}
.profile-mode input[type=checkbox]{min-height:0;padding:0}
.profile-mode .frd-profile-card{background:var(--tg-surface);border-color:var(--tg-line);border-radius:14px;padding:12px 14px;margin:8px 0}
.profile-mode h2{font-size:17px;font-weight:600;letter-spacing:0;margin:0 0 10px}
.profile-mode p{font-size:13px;margin:6px 0}.profile-mode .muted,.profile-mode small{font-size:12px;color:var(--tg-muted)}
.profile-mode .frd-profile-card dl{font-size:13px;gap:6px 12px;margin:10px 0}
.profile-mode .frd-profile-card dt{color:var(--tg-muted);opacity:1}
.profile-mode .frd-profile-card a{font-size:13px;margin:6px 0}
.profile-mode .frd-source-card{border-color:var(--tg-line);background:var(--tg-surface);padding:10px;font-size:13px}
.profile-mode .frd-profile-task{border-color:var(--tg-line);padding:9px 0}
.profile-mode .frd-task-scopes{gap:6px}.profile-mode .frd-task-scopes button{min-height:30px;padding:5px 12px}
.profile-mode button:focus-visible,.profile-mode a:focus-visible{outline:2px solid var(--tg-accent);outline-offset:2px}
@media(max-width:650px){.profile-mode .team-title{width:100%}.profile-mode .team-header .team-nav{margin:0;width:100%}.profile-mode .frd-profile-card dl{gap:2px}.profile-mode .frd-profile-card dd{margin-bottom:6px}.profile-mode #phone-book-shortcut{display:none}}
.orders-mode .erp-box-channels[data-sources]{display:flex;flex-wrap:wrap;gap:6px;min-height:34px;overflow:visible}
.orders-mode .erp-source-button{align-items:center;gap:5px;border-radius:14px;min-height:28px;min-width:28px;flex:none;color:var(--tg-muted)}
.orders-mode .erp-source-label{font-size:9px;line-height:12px;max-width:68px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--tg-muted)}
.orders-mode .erp-source-button .erp-channel-state{right:0;bottom:0;width:11px;height:11px;font-size:8px;line-height:11px;border-color:var(--tg-surface)}
.orders-mode .erp-box-channels[data-sources] .erp-sync-status{font-size:9px;color:var(--tg-muted)}
/* Task ERP 21.04: staff editor layout stays separate from auth and chat surfaces. */
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .erp-access-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:start;gap:14px 16px;padding:18px;margin:14px 0;background:var(--tg-surface);border:1px solid var(--tg-line);border-radius:14px;min-width:0}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .erp-access-row>p{grid-column:1/-1;margin:0}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .erp-access-row>p:first-child{font-size:17px;font-weight:600;line-height:1.35;color:var(--tg-text);overflow-wrap:anywhere}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .erp-access-row>p.muted:not([role=status]){grid-column:auto;align-self:center;margin-top:24px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .erp-access-row>div{min-width:0}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .erp-access-row>div:has(>.erp-work-role){grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 12px;padding:12px 0;border-block:1px solid var(--tg-line)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .erp-access-row .erp-work-role{display:flex!important;align-items:center;gap:9px;font-size:13px;line-height:1.4;min-height:36px;margin:0!important;padding:6px 9px;border-radius:8px;background:var(--tg-field);color:var(--tg-text)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .erp-access-row input[type=checkbox]{width:18px!important;height:18px;min-height:18px;margin:0;flex:none;accent-color:var(--tg-accent)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .erp-access-row :is(input:not([type=checkbox]),select){width:100%;min-width:0;font-size:16px;min-height:40px;background:var(--tg-field);color:var(--tg-text);border:1px solid var(--tg-line);border-radius:9px;padding:8px 10px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .erp-access-row>div>label:not(.erp-work-role){display:block;margin:0 0 7px;font-size:13px;line-height:1.45;color:var(--tg-muted)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .erp-access-row :is([role=status],small){display:block;font-size:12px;line-height:1.5;color:var(--tg-muted);min-height:18px;margin:6px 0 0;overflow-wrap:anywhere}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .erp-access-row>div:has(>.erp-work-role)>small{grid-column:1/-1;margin:0}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-employee-editor{grid-column:1/-1;width:100%;border:1px solid var(--tg-line);background:var(--tg-field);border-radius:11px;padding:11px 12px;min-width:0}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-employee-editor[open]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 14px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-employee-editor :is(summary,p,small,.frd-employee-sources){grid-column:1/-1}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-employee-editor summary{font-size:14px;font-weight:500;color:var(--tg-accent);cursor:pointer}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-employee-editor>label{display:block;font-size:13px;color:var(--tg-muted);margin:0;min-width:0}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-employee-editor>label :is(input,select,textarea){display:block;margin:7px 0 0;width:100%;min-width:0;background:var(--tg-surface);font-size:16px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-employee-editor textarea{min-height:74px;border:1px solid var(--tg-line);border-radius:9px;padding:8px 10px;color:var(--tg-text)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-profile-card{background:var(--tg-surface);border:1px solid var(--tg-line);border-radius:14px;padding:16px 18px;margin:12px 0;min-width:0}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-profile-card dl{font-size:14px;gap:8px 14px;grid-template-columns:minmax(150px,1fr) 2fr}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-profile-card dt{color:var(--tg-muted);opacity:1}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-profile-card a{font-size:14px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-source-card{background:var(--tg-surface);border-color:var(--tg-line);padding:12px;font-size:13px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-profile-task{border-color:var(--tg-line);padding:10px 0}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-task-history-toggle{margin:0;font-size:12px}
@media(max-width:650px){
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) :is(.erp-access-row,.frd-employee-editor[open]){grid-template-columns:minmax(0,1fr)}
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .erp-access-row{padding:14px;gap:12px}
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .erp-access-row>p.muted:not([role=status]){grid-column:1/-1;margin:0}
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .erp-access-row>div:has(>.erp-work-role){grid-template-columns:repeat(2,minmax(0,1fr))}
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-profile-card{padding:14px}
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-profile-card dl{grid-template-columns:1fr;gap:3px}
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-profile-card dd{margin-bottom:8px}
}
@media(max-width:380px){body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .erp-access-row>div:has(>.erp-work-role){grid-template-columns:minmax(0,1fr)}}
/* Task ERP 23.01: server diagnostics reuse the cabinet palette in both themes. */
.frd-health{--health-warning:#9f650c;--health-error:#bd4343}
:root[data-chat-theme=dark] .frd-health{--health-warning:#e4b359;--health-error:#ee8a8a}
.frd-health-header{display:flex;align-items:center;justify-content:space-between;gap:12px}
.frd-health .frd-health-header h2{margin:0;font-size:17px}
.frd-health-header button{flex:none;min-height:36px}.frd-health-header button:disabled{opacity:.6;cursor:wait}
.frd-health .frd-health-status{display:flex;align-items:center;gap:8px;margin:12px 0 6px;font-size:14px;font-weight:500;color:var(--tg-accent)}
.frd-health-status::before{content:"";width:7px;height:7px;flex:none;border-radius:50%;background:currentColor}
.frd-health[data-state=attention] .frd-health-status{color:var(--health-warning)}
.frd-health[data-state=unavailable] .frd-health-status{color:var(--health-error)}
.frd-health[data-state=checking] .frd-health-status{color:var(--tg-muted)}
.frd-health-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:14px 0}
.frd-health-metric,.frd-health-backup,.frd-health-jino{display:flex;flex-direction:column;gap:8px;min-width:0;padding:14px;background:var(--tg-field);border:1px solid var(--tg-line);border-radius:11px;overflow-wrap:anywhere}
.frd-health :is(.frd-health-metric,.frd-health-backup,.frd-health-jino,.frd-health-services) h3{margin:0;font-size:13px;font-weight:500;line-height:1.4;color:var(--tg-muted)}
.frd-health-metric>strong{font-size:18px;font-weight:600;line-height:1.3;color:var(--tg-text)}
.frd-health-metric>small{line-height:1.5;font-size:12px;color:var(--tg-muted)}
.frd-health-load{font-size:13px;color:var(--tg-accent)}
.frd-health-metric progress{display:block;appearance:none;width:100%;height:5px;overflow:hidden;border:0;border-radius:4px;background:var(--tg-line);accent-color:var(--tg-accent)}
.frd-health-metric progress::-webkit-progress-bar{background:var(--tg-line);border-radius:4px}
.frd-health-metric progress::-webkit-progress-value{background:var(--tg-accent);border-radius:4px}
.frd-health-metric progress::-moz-progress-bar{background:var(--tg-accent);border-radius:4px}
.frd-health-backup{gap:5px;margin:14px 0}.frd-health-backup>strong{font-size:14px;color:var(--tg-accent)}
.frd-health-backup[data-state=failed]>strong{color:var(--health-error)}
.frd-health-backup:is([data-state=stale],[data-state=missing],[data-state=unavailable],[data-state=unknown])>strong{color:var(--health-warning)}
.frd-health .frd-health-backup p{margin:2px 0;font-size:12px}
.frd-health-jino{gap:5px;margin:14px 0}.frd-health-jino>strong{font-size:18px;font-weight:600;color:var(--tg-accent)}
.frd-health-jino:not([data-state=ok])>strong,.frd-health-jino .frd-health-jino-warning{color:var(--health-warning)}
.frd-health .frd-health-jino p{margin:2px 0;font-size:12px}.frd-health .frd-health-jino>a{margin:5px 0 0;font-size:13px}
.frd-health-services{margin-top:16px}.frd-health-services>h3{padding-bottom:6px}
.frd-health-service{display:flex;align-items:baseline;justify-content:space-between;gap:8px 16px;padding:8px 0;border-bottom:1px solid var(--tg-line);font-size:13px}
.frd-health-service>strong{font-weight:500;color:var(--tg-accent);white-space:nowrap}
.frd-health-service[data-state=failed]>strong{color:var(--health-error)}.frd-health-service[data-state=unknown]>strong{color:var(--tg-muted)}
.frd-health-problems{margin:14px 0 0;padding:12px 12px 12px 28px;background:color-mix(in srgb,var(--health-warning) 9%,var(--tg-surface));border-radius:9px;color:var(--health-warning);font-size:13px;line-height:1.6}
@media(max-width:650px){.frd-health-metrics{grid-template-columns:minmax(0,1fr)}.frd-health-metric{padding:12px}.frd-health-service{flex-wrap:wrap}}

/* cabinet.css */
/* Task ERP 21.04. Full-page staff chrome; auth, overlay and orders keep their layouts. */
body.cabinet-mode:not(.auth-mode):not(.overlay-mode){
  --staff-line:var(--tg-line);--staff-satin:var(--tg-accent);
  --tg-border:var(--tg-line);--tg-panel:var(--tg-surface);
  --pb-surface:var(--tg-surface);--pb-field:var(--tg-field);--pb-ink:var(--tg-text);
  --pb-muted:var(--tg-muted);--pb-line:var(--tg-line);--pb-accent:var(--tg-accent);
  --pb-selected:color-mix(in srgb,var(--tg-accent) 14%,var(--tg-surface));
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  background:var(--tg-field);color:var(--tg-text);color-scheme:light;
  max-width:none;min-height:100dvh;margin:0;padding:0;line-height:1.5;
}
:root[data-chat-theme=dark] body.cabinet-mode:not(.auth-mode):not(.overlay-mode){color-scheme:dark}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) :is(.staff-texture,.team-footer,.team-brand){display:none!important}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .team-header{background:var(--tg-surface);border-bottom:1px solid var(--tg-line);box-shadow:none;backdrop-filter:none}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .team-header:not([hidden]){display:block!important}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .team-header-inner{width:min(1120px,calc(100% - 32px));min-height:60px;padding:8px 0;margin:auto;display:flex;align-items:center;gap:12px 24px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .team-title{display:block;flex:none;width:auto;text-align:left}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .team-title p{font-size:15px;font-weight:600;letter-spacing:0;line-height:24px;margin:0}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .team-header .team-nav{margin:0 0 0 auto;padding:0;border:0;min-width:0;max-width:100%;gap:0 18px;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;touch-action:pan-x}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .team-header .team-nav:not([hidden]){display:flex!important}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .team-nav::-webkit-scrollbar{display:none}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .team-header .team-nav :is(a,span){flex:none;font-size:13px;min-height:38px;padding:8px 0;white-space:nowrap;letter-spacing:0;color:var(--tg-muted);text-decoration:none}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .team-header .team-nav>span{display:flex!important;align-items:center;flex-direction:row;gap:6px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .team-nav small{border:0;background:var(--tg-field);color:var(--tg-muted);border-radius:6px;padding:2px 5px;font-size:9px;letter-spacing:0}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .team-header .team-nav a[aria-current=page]{color:var(--tg-accent);border-bottom:2px solid var(--tg-accent)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #voice-panel{width:min(1120px,calc(100% - 32px));max-width:none;height:auto;padding:14px 0 32px;margin:0 auto;background:transparent;border:0;box-shadow:none}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #voice-panel>:is(h1,p:first-of-type){display:none}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #workspace>.row{padding:0 0 12px;margin:0 0 18px;min-height:38px;display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;border-bottom:1px solid var(--tg-line);background:transparent}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #person{font-size:12px;line-height:1.4;color:var(--tg-muted);width:auto;min-width:0;margin-right:auto;overflow-wrap:anywhere}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #workspace>.row :is(a,button){font-size:12px;white-space:nowrap;min-height:32px;padding:5px 9px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #frd-theme-toggle{display:grid;place-items:center;width:32px;min-width:32px;height:32px;min-height:32px;padding:6px;background:transparent;border:0;border-radius:9px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #frd-theme-toggle svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .pb-theme{display:none}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) :is(button,input,textarea,select){color:var(--tg-text);font-family:inherit;max-width:100%;box-sizing:border-box}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) button{background:var(--tg-field);color:var(--tg-accent);border:1px solid var(--tg-line);border-radius:9px;font-size:14px;min-height:38px;padding:8px 12px;cursor:pointer}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) button:hover{background:var(--tg-hover)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) :is(input,select,textarea){background:var(--tg-field);border:1px solid var(--tg-line);border-radius:9px;font-size:16px;min-height:40px;min-width:0;padding:8px 10px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) textarea{line-height:1.45}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) input:is([type=checkbox],[type=radio]){width:18px;height:18px;min-height:18px;padding:0;margin:0;flex:none;accent-color:var(--tg-accent)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) :is(button,a,input,select,textarea,summary):focus-visible{outline:2px solid var(--tg-accent);outline-offset:3px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) a{color:var(--tg-accent)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) label{font-size:13px;line-height:1.45;color:var(--tg-text);margin:10px 0 6px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) h2{font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;margin:0 0 14px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) h3{font-size:16px;font-weight:600;line-height:1.35;letter-spacing:0;margin:0 0 10px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) p{font-size:14px;margin:8px 0 12px;overflow-wrap:anywhere}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) :is(.muted,small){color:var(--tg-muted);font-size:12px;line-height:1.5}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #message{font-size:12px;color:var(--tg-muted);min-height:0;margin:0 0 10px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) :is(#employee-profile,#phone-book-section,#erp-access,#admin){padding:0;margin:0 0 20px;border:0;min-width:0}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) :is(#note-section,#journal-section){padding:20px;background:var(--tg-surface);border:1px solid var(--tg-line);border-radius:14px;margin:0 0 18px;max-width:none;min-width:0}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #note-section>p{font-size:14px;line-height:1.6;max-width:780px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #note-section>:is(p.muted,p:last-child){font-size:12px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #note-form{margin-top:18px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) :is(#record,#save-audio,.frd-auth-primary){background:var(--tg-accent);border-color:var(--tg-accent);color:var(--tg-surface);font-weight:600}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #record[data-recording=true]{background:var(--tg-active);color:#fff}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #record-time{color:var(--tg-muted)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #review-recording{padding:14px;border:1px solid var(--tg-line);background:var(--tg-field);border-radius:11px;margin-top:16px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) audio{color-scheme:inherit;accent-color:var(--tg-accent)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #notes{gap:12px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #notes article{background:var(--tg-field);border:1px solid var(--tg-line);border-radius:11px;padding:14px;margin:0}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) :is(.note-head,.note-report){border-color:var(--tg-line)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .note-state{background:var(--tg-surface);color:var(--tg-muted);border:1px solid var(--tg-line);border-radius:7px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) :is(.note-pictures,#image-previews) img{border-color:var(--tg-line);border-radius:7px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #note-images{font-size:16px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #frd-staff-microphone{background:var(--tg-accent)!important;color:var(--tg-surface)!important;border-color:var(--tg-line)!important;box-shadow:var(--tg-shadow)!important}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .pb-card{background:var(--pb-surface);color:var(--pb-ink);border:1px solid var(--pb-line);border-radius:14px;padding:16px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .pb-card :is(section,article){border-color:var(--pb-line)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .pb-card article{background:var(--pb-field);border-radius:10px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .pb-contact{background:var(--pb-surface)!important;color:var(--pb-ink);border-color:var(--pb-line);border-radius:10px;min-height:54px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .pb-contact[data-selected=true]{background:var(--pb-selected)!important;color:var(--pb-accent)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .pb-chips label{background:var(--pb-field);color:var(--pb-ink);border:1px solid var(--pb-line);margin:4px 0;gap:7px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .pb-card blockquote{color:var(--pb-muted);border-color:var(--pb-accent);background:var(--pb-field);border-radius:0 7px 7px 0}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .pb-status{color:var(--pb-muted)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .pb-toolbar input{min-width:min(220px,100%)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .pb-grid{gap:14px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .pb-card pre{font-family:inherit;color:var(--pb-ink)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) dialog{background:var(--tg-surface);color:var(--tg-text);border:1px solid var(--tg-line);border-radius:14px;max-width:calc(100% - 24px);box-shadow:var(--tg-shadow)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) dialog::backdrop{background:var(--tg-overlay)}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-member-access-row{display:flex;align-items:center;flex-wrap:wrap;gap:10px 14px;padding:14px 16px;margin:10px 0;background:var(--tg-surface);border:1px solid var(--tg-line);border-radius:12px}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-member-access-name{font-size:14px;font-weight:600;min-width:0;overflow-wrap:anywhere}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-member-access-state{font-size:12px;color:var(--tg-muted);margin-right:auto}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-member-access-switch{display:inline-flex;align-items:center;gap:8px;margin:0}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #admin .frd-member-access-switch input{margin:0}
@media(max-width:720px){
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .team-header-inner{flex-wrap:wrap;gap:0 14px;padding:7px 0}
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .team-title{width:100%}
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .team-header .team-nav{width:100%;margin:0;gap:0 16px}
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .team-header .team-nav :is(a,span){font-size:12px;min-height:36px}
}
@media(max-width:650px){
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) :is(.team-header-inner,#voice-panel){width:calc(100% - 24px)}
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) #voice-panel{padding-top:10px}
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) :is(#note-section,#journal-section){padding:14px}
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .pb-card{padding:12px}
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-member-access-row{padding:12px}
  body.cabinet-mode:not(.auth-mode):not(.overlay-mode) .frd-member-access-name{width:100%}
}
/* Recorder keeps its compact page, with the shared palette and controls. */
body.cabinet-mode:not(.auth-mode):not(.overlay-mode).recorder-mode .team-header{display:none!important}
body.cabinet-mode:not(.auth-mode):not(.overlay-mode).recorder-mode #voice-panel{width:min(540px,calc(100% - 32px));max-width:540px;padding:18px 0 24px}
/* Journal tools belong to the remarks screen. */
body.cabinet-mode.team-mode:not(.auth-mode):not(.overlay-mode) #refresh,
body.cabinet-mode.team-mode:not(.auth-mode):not(.overlay-mode) #export { display: none !important; }

/* catalog-cards.css */
/* Task ERP 24.04. Native dialogs keep focus and Escape behavior. */
.erp-list-section-title #erp-browse-catalog{margin-left:auto;min-height:26px;padding:3px 8px;font-size:11px;border-radius:5px}
.frd-catalog-dialog{width:min(880px,calc(100vw - 20px));max-width:none;max-height:calc(100dvh - 20px);padding:0;border:1px solid var(--staff-line,#8c9b8f);border-radius:12px;background:var(--tg-surface);color:var(--tg-text);color-scheme:inherit;box-shadow:0 20px 60px #0009;overflow:hidden}
.frd-catalog-dialog::backdrop{background:#000a}
.frd-catalog-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-bottom:1px solid var(--tg-line);position:sticky;top:0;background:inherit;z-index:1}
.frd-catalog-dialog h3{margin:0;font-size:18px}.frd-catalog-dialog>header button{min-width:36px;min-height:36px;padding:2px 10px;font-size:22px;line-height:1}
.frd-catalog-dialog-body{display:grid;gap:12px;padding:16px;max-height:calc(100dvh - 75px);overflow:auto;overscroll-behavior:contain}
.frd-catalog-dialog-body[hidden]{display:none}.frd-catalog-dialog-body.frd-catalog-expanded-photo>img{width:100%;max-height:calc(100dvh - 170px)}
.frd-catalog-dialog-body input,.frd-catalog-dialog-body select,.frd-catalog-dialog-body textarea{width:100%;min-width:0;background:var(--tg-field);color:var(--tg-text);border:1px solid var(--tg-line);padding:8px}
.frd-catalog-dialog-body textarea{min-height:80px;resize:vertical}
.frd-catalog-dialog-body>img{max-width:100%;max-height:min(50dvh,500px);object-fit:contain;margin:auto}
.frd-catalog-grid,.frd-catalog-message{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(210px,100%),1fr));gap:10px;min-width:0;align-items:start}
.frd-catalog-card{display:flex;flex-direction:column;gap:6px;min-width:0;padding:10px;border:1px solid var(--tg-line);border-radius:8px;background:var(--tg-field);overflow-wrap:anywhere}
.frd-catalog-card>img{width:100%;height:150px;object-fit:contain;background:var(--tg-surface);border-radius:4px}.frd-catalog-card strong{font-size:14px}.frd-catalog-card small,.frd-catalog-facts small{display:block;font-size:12px;color:var(--tg-muted)}
.frd-catalog-facts{display:grid;gap:3px}.frd-catalog-actions,.frd-catalog-tabs,.frd-catalog-pagination{display:flex;flex-wrap:wrap;gap:6px}.frd-catalog-actions{margin-top:auto;padding-top:6px}
.frd-catalog-dialog button,.frd-catalog-card button{min-height:36px;padding:5px 9px;font-size:12px;color:var(--tg-text);background:var(--tg-hover);border:1px solid var(--tg-line);border-radius:5px;cursor:pointer}
.frd-catalog-dialog button:disabled,.frd-catalog-card button:disabled{opacity:.55;cursor:default}.frd-catalog-tabs button[aria-pressed=true]{background:var(--staff-satin,#aabca8);color:#18201b}
.frd-catalog-groups,.frd-catalog-filters{display:grid;gap:8px;min-width:0}.frd-catalog-group-list,.frd-catalog-facets{display:flex;gap:6px;align-items:center;overflow-x:auto;overscroll-behavior-inline:contain;padding:2px 0 6px}.frd-catalog-group-list button,.frd-catalog-facets button{flex:none;white-space:nowrap}.frd-catalog-group-list button[aria-pressed=true],.frd-catalog-facets button[aria-pressed=true]{background:var(--staff-satin,#aabca8);color:#18201b}.frd-catalog-facets span{flex:none;font-size:12px;color:var(--tg-muted)}.frd-catalog-filters{grid-template-columns:repeat(auto-fit,minmax(min(155px,100%),1fr))}.frd-catalog-facets{grid-column:1/-1}.frd-catalog-filter{display:grid;gap:4px;font-size:12px}.frd-catalog-back{justify-self:start}.frd-catalog-groups small{color:var(--tg-muted)}.frd-catalog-chosen{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:12px}.frd-catalog-chosen button{min-height:30px}
.frd-catalog-status{min-height:20px;font-size:12px;color:var(--tg-muted);white-space:pre-wrap}
.frd-catalog-replies{display:grid;gap:6px;max-height:min(34dvh,260px);overflow:auto}.frd-catalog-reply{display:flex;align-items:flex-start;gap:8px;padding:8px;border:1px solid var(--tg-line);border-radius:5px;white-space:pre-wrap;overflow-wrap:anywhere}.frd-catalog-reply input,.frd-catalog-dialog-body label>input[type=checkbox]{width:auto;min-height:0;flex:none;margin:3px 0}.frd-catalog-dialog-body label:has(>input[type=checkbox]){display:flex;align-items:flex-start;gap:8px}
.erp-message .frd-catalog-message{grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr));margin-top:8px}.erp-message .frd-catalog-card>img{height:120px}
.frd-catalog-site-dialog{width:min(1320px,calc(100vw - 20px));height:calc(100dvh - 20px);display:flex;flex-direction:column}
.frd-catalog-site-dialog>.frd-catalog-dialog-body{flex:1;min-height:0;max-height:none;display:flex;flex-direction:column;gap:8px;overflow:auto}
.frd-catalog-site{flex:1;min-height:260px;border:1px solid var(--tg-line);background:var(--tg-surface);overflow:hidden}
.frd-catalog-site[hidden]{display:none}.frd-catalog-site-frame{display:block;width:100%;height:100%;border:0;background:#f5f3ed}
.frd-catalog-site-dialog .frd-catalog-tabs{flex:none}.frd-catalog-site-dialog .frd-catalog-chosen{flex:none;max-height:90px;overflow:auto}
.frd-catalog-site-dialog .frd-catalog-status{min-height:0;margin:0}.frd-catalog-site-dialog textarea{min-height:52px}
.frd-catalog-options{flex:none;border:1px solid var(--tg-line);border-radius:5px;padding:5px 9px}.frd-catalog-options>summary{cursor:pointer;font-size:12px;color:var(--tg-muted)}
.frd-catalog-options[open]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.frd-catalog-options[open]>summary,.frd-catalog-options[open]>textarea{grid-column:1/-1}
.frd-catalog-site-dialog .frd-catalog-dialog-body>[hidden]{display:none}
.frd-erp-catalog-pick{display:block;margin:10px 0;padding:9px 14px;background:#253a32;color:#fff;border:1px solid #253a32;border-radius:4px;font:inherit;cursor:pointer}
.frd-erp-catalog-pick[aria-pressed=true]{background:#e6eee8;color:#193b2b}.frd-erp-catalog-pick:disabled{opacity:.55}.frd-erp-catalog-error{display:block;color:#9e342b}
.frd-erp-inline-zoom{position:relative;z-index:2}.frd-erp-inline-zoom img{max-height:90svh!important;width:auto!important;max-width:100%!important;object-fit:contain!important}
.bamboo-card.frd-erp-inline-zoom{grid-column:1/-1}.bamboo-card.frd-erp-inline-zoom .bamboo-swatch{width:100%;height:min(75svh,850px)}.bamboo-card.frd-erp-inline-zoom .bamboo-open{cursor:zoom-out}
.bamboo-catalog #bamboo-view{display:none!important}
.catalog-design-choice,.hardware-contact,.material-contact{display:none!important}
html body.hardware-page #main-content div.hardware-filters{top:0!important;background:var(--surface-tone-bg,#202625)!important}
@media(max-width:600px){html body.hardware-page #main-content div.hardware-filters{position:static!important;top:auto!important}}
@media(max-width:650px){.frd-catalog-dialog{width:calc(100vw - 8px);max-height:calc(100dvh - 8px);border-radius:6px}.frd-catalog-dialog-body{padding:10px;max-height:calc(100dvh - 62px)}.frd-catalog-grid,.frd-catalog-message{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.frd-catalog-card{padding:7px}.frd-catalog-card>img{height:100px}.frd-catalog-actions button{width:100%}}
@media(max-width:650px){.frd-catalog-site-dialog{height:calc(100dvh - 8px)}.frd-catalog-site-dialog>.frd-catalog-dialog-body{max-height:none}.frd-catalog-site{min-height:200px}.frd-catalog-site-dialog .frd-catalog-tabs button{flex:1}.frd-catalog-site-dialog .frd-catalog-chosen{max-height:66px}.frd-catalog-site-dialog textarea{min-height:38px}}
@media(max-width:380px){.frd-catalog-grid,.frd-catalog-message{grid-template-columns:1fr}}
/* Task ERP 24.08: compact staff presentation, independent of the public catalog. */
.frd-catalog-dialog{width:min(760px,calc(100vw - 20px));border-color:var(--tg-line);border-radius:8px;box-shadow:0 8px 32px #102a4329}
.frd-catalog-dialog>header{padding:8px 12px;gap:8px}.frd-catalog-dialog h3{font-size:14px;line-height:1.3;font-weight:600;letter-spacing:0}
.frd-catalog-dialog>header button{min-width:28px;min-height:28px;height:28px;font-size:19px;padding:0 6px}
.frd-catalog-dialog-body{gap:8px;padding:10px;max-height:calc(100dvh - 64px);font-size:13px;line-height:1.35}
.frd-catalog-dialog-body p{margin:0}.frd-catalog-dialog button,.frd-catalog-card button{min-height:28px;font-size:11px;line-height:1.3;padding:4px 7px;border:1px solid var(--tg-line);border-radius:5px;color:var(--tg-accent);background:var(--tg-surface)}
.frd-catalog-dialog button:hover:not(:disabled),.frd-catalog-card button:hover:not(:disabled){background:var(--tg-hover)}
.frd-catalog-card{padding:7px;gap:5px;border-color:var(--tg-line);border-radius:6px;background:var(--tg-surface)}
.frd-catalog-card-copy{display:grid;align-content:start;gap:3px;min-width:0}.frd-catalog-card-copy>*{margin:0}
.frd-catalog-card-copy strong{font-size:13px;line-height:1.3;font-weight:600;color:var(--tg-text)}
.frd-catalog-card small,.frd-catalog-facts small{font-size:11px;line-height:1.3;margin:0;color:var(--tg-muted)}
.frd-catalog-facts{gap:3px}.frd-catalog-actions{padding-top:2px;gap:4px;align-items:center}
.frd-catalog-detail{display:grid;grid-template-columns:minmax(150px,240px) minmax(0,1fr);align-items:start;gap:12px}
.frd-catalog-detail-media{display:grid;gap:5px;min-width:0}.frd-catalog-detail-media>img{width:100%;height:auto;max-height:280px;object-fit:contain;border:1px solid var(--tg-line);border-radius:5px;background:var(--tg-field)}
.frd-catalog-detail-media>button{justify-self:start}.frd-catalog-detail-copy{display:grid;gap:7px;min-width:0;overflow-wrap:anywhere}.frd-catalog-detail-copy .frd-catalog-facts{gap:0}
.frd-catalog-detail-copy .frd-catalog-facts small{padding:4px 0;border-bottom:1px solid var(--tg-line);color:var(--tg-text);font-size:12px}
.frd-catalog-detail:not(:has(.frd-catalog-detail-media)){grid-template-columns:1fr}
.frd-catalog-detail.frd-catalog-expanded-photo .frd-catalog-detail-media{grid-column:1/-1}.frd-catalog-detail.frd-catalog-expanded-photo .frd-catalog-detail-media>img{max-height:75dvh}
.frd-catalog-site-dialog{width:min(1180px,calc(100vw - 16px));height:calc(100dvh - 16px)}
.frd-catalog-site-dialog>.frd-catalog-dialog-body{padding:8px;gap:6px}.frd-catalog-site-dialog .frd-catalog-site{border-radius:5px;min-height:260px}
.frd-catalog-site-dialog .frd-catalog-tabs{gap:4px}.frd-catalog-site-dialog .frd-catalog-tabs button{min-height:28px;padding:4px 10px}
.frd-catalog-site-dialog .frd-catalog-tabs button[aria-pressed=true]{color:var(--tg-accent);border-color:color-mix(in srgb,var(--tg-accent) 35%,var(--tg-line));background:var(--tg-topic)}
.frd-catalog-site-dialog .frd-catalog-chosen{max-height:58px;gap:4px}.frd-catalog-site-dialog .frd-catalog-chosen button{min-height:24px;padding:3px 6px;font-size:10px}
.frd-catalog-options{padding:4px 7px}.frd-catalog-options>summary{font-size:11px}.frd-catalog-site-dialog .frd-catalog-status:empty{display:none}
.frd-catalog-message{grid-template-columns:1fr;gap:5px}
.frd-catalog-message>.frd-catalog-card{display:grid;grid-template-columns:76px minmax(0,1fr);column-gap:8px;row-gap:4px}
.frd-catalog-message>.frd-catalog-card>img{width:76px;height:86px;grid-column:1;grid-row:1/3;object-fit:contain;margin:0;align-self:start}
.frd-catalog-message>.frd-catalog-card>.frd-catalog-card-copy,.frd-catalog-message>.frd-catalog-card>.frd-catalog-actions{grid-column:2}
.frd-catalog-message>.frd-catalog-card:not(:has(>img)){grid-template-columns:1fr}.frd-catalog-message>.frd-catalog-card:not(:has(>img))>*{grid-column:1}
.orders-mode .erp-message{padding:6px 8px;border-radius:8px 8px 8px 3px;box-shadow:none}.orders-mode .erp-message.mine{border-radius:8px 8px 3px 8px}
.orders-mode .erp-message-text{font-size:13px;line-height:1.35;margin:2px 0 3px}.orders-mode .erp-message-list{gap:5px;padding-top:10px;padding-bottom:10px}
.orders-mode .erp-message strong{line-height:1.3}.orders-mode .erp-message .frd-catalog-message{margin-top:5px;grid-template-columns:1fr}
.orders-mode .erp-message .frd-catalog-card{padding:6px;border:1px solid var(--tg-line)}
.orders-mode .erp-message .frd-catalog-card-copy strong{color:var(--tg-text);font-size:12px;line-height:1.3}
.orders-mode .erp-message .frd-catalog-card>img{width:76px;height:86px}.orders-mode .erp-message .frd-catalog-actions button{min-height:26px;font-size:10px;padding:3px 6px;white-space:normal}
.orders-mode .erp-message:has(.frd-catalog-message){max-width:min(94%,560px)}
@media(max-width:650px){.frd-catalog-dialog{width:calc(100vw - 8px);max-height:calc(100dvh - 8px)}.frd-catalog-dialog>header{padding:7px 9px}.frd-catalog-dialog-body{padding:8px;gap:7px}.frd-catalog-detail{grid-template-columns:1fr;gap:8px}.frd-catalog-detail-media{justify-items:center}.frd-catalog-detail-media>img{max-height:180px;width:auto;max-width:100%}.frd-catalog-detail-media>button{justify-self:center}.frd-catalog-card button,.frd-catalog-dialog button{min-height:32px}.frd-catalog-actions button{width:auto}.frd-catalog-site-dialog{height:calc(100dvh - 8px)}.frd-catalog-site-dialog .frd-catalog-site{min-height:190px}.frd-catalog-site-dialog .frd-catalog-tabs button{min-height:32px}.frd-catalog-message>.frd-catalog-card{grid-template-columns:62px minmax(0,1fr);gap:5px}.frd-catalog-message>.frd-catalog-card>img,.orders-mode .erp-message .frd-catalog-card>img{width:62px;height:74px}.frd-catalog-message>.frd-catalog-card>.frd-catalog-actions{grid-column:1/-1}.orders-mode .erp-message .frd-catalog-actions button{min-height:30px}.orders-mode .erp-message:has(.frd-catalog-message){max-width:98%}}
.orders-mode .erp-message .frd-catalog-card{margin:0}
.orders-mode .erp-message-actions>button:not(.erp-accept-decision){display:inline-grid;place-items:center;width:26px;height:26px;min-height:26px;padding:3px;border:0;border-radius:5px;background:var(--tg-hover);color:var(--tg-accent);font-size:14px}
.orders-mode .erp-message:has(.frd-catalog-message)>.frd-message-time{position:absolute;top:7px;right:8px;clear:none;width:auto;margin:0}
.orders-mode .erp-message:has(.frd-catalog-message)>strong{padding-right:44px}

.orders-mode button.frd-catalog-trigger{display:inline-grid;place-items:center;min-width:28px;width:28px;height:28px;min-height:28px;padding:3px!important;border:0!important;background:transparent!important;box-shadow:none!important;color:var(--tg-accent)!important;border-radius:5px}
.orders-mode button.frd-catalog-trigger:hover{background:var(--tg-hover)!important}.frd-catalog-trigger svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.frd-catalog-actions a.frd-catalog-site-link{font-size:11px;line-height:1.3;color:var(--tg-accent);text-decoration:none;border:0;border-radius:4px;padding:4px 5px;min-height:26px;display:inline-flex;align-items:center;gap:3px}.frd-catalog-actions a.frd-catalog-site-link:hover{text-decoration:underline}
.frd-catalog-picker-footer{display:flex;align-items:center;gap:8px;flex:none;min-width:0}.frd-catalog-picker-footer>.frd-catalog-chosen{flex:1;min-width:0}.frd-catalog-picker-footer>button{flex:none;min-height:30px;white-space:nowrap}
@media(max-width:650px){.frd-catalog-picker-footer{gap:5px}.frd-catalog-picker-footer>button{min-height:32px;font-size:11px;padding:4px 7px}}

.frd-catalog-choice{display:flex;flex-wrap:wrap;align-content:start;gap:4px 10px;min-width:0;margin:0;padding:5px 7px;border:1px solid var(--tg-line);border-radius:5px;font-size:11px;line-height:1.3}.frd-catalog-choice legend{padding:0 3px;color:var(--tg-muted)}
.frd-catalog-dialog-body .frd-catalog-choice label{display:inline-flex;align-items:center;gap:5px;min-height:28px;margin:0;cursor:pointer}.frd-catalog-dialog-body .frd-catalog-choice input[type=checkbox]{width:14px;height:14px;min-height:0;padding:0;margin:0;accent-color:var(--tg-accent)}
.frd-catalog-choice small{color:var(--tg-muted)}
.frd-catalog-card>img,.frd-catalog-detail-media>img{display:block;position:static;inset:auto;transform:none;box-sizing:border-box;min-width:0;max-width:100%;object-fit:contain;object-position:center;padding:3px}
@media(max-width:450px){.frd-catalog-options[open]{grid-template-columns:1fr}.frd-catalog-choice{gap:4px 8px}}

.frd-catalog-options[open]{display:block}.frd-catalog-options-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding-top:5px}.frd-catalog-options-fields>textarea{grid-column:1/-1;box-sizing:border-box;font:inherit;font-size:12px;min-height:40px}.frd-catalog-options:not([open])>.frd-catalog-options-fields{display:none}
@media(max-width:650px){.frd-catalog-options-fields{grid-template-columns:1fr}.frd-catalog-choice{padding:3px 6px}.frd-catalog-options-fields>textarea{height:42px}}

/* message-edits.css */
/* Task ERP 24.09: one calm, accessible dialog for edits, swaps and audit. */
.frd-order-card-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.frd-order-card-form :is(input:not([type=checkbox]),select){box-sizing:border-box;width:100%;min-width:0;min-height:36px;padding:7px;border:1px solid var(--tg-line);border-radius:5px;background:var(--tg-field);color:var(--tg-text);font:inherit;font-size:14px}
.frd-order-card-form label:has(textarea){grid-column:1/-1}
.frd-order-card-form label{margin:0;align-content:start}
.frd-order-card-form label:has(input[type=checkbox]){display:flex;align-items:center;gap:8px;min-height:36px}
.frd-order-card-form>.frd-message-edit-primary{grid-column:1/-1;justify-self:end;align-self:start}
.frd-order-card-form input[type=checkbox]{width:16px;height:16px;accent-color:var(--tg-accent)}
.frd-order-card-action{flex:none;width:30px;height:30px;padding:5px!important;border:0!important;background:transparent!important;color:var(--tg-accent)!important;cursor:pointer}
.frd-order-card-action svg{width:18px;height:18px}
.erp-message-hidden{font-size:12px;color:var(--tg-muted);font-style:italic}
@media(max-width:600px){.frd-order-card-form{grid-template-columns:1fr}.frd-order-card-form :is(input:not([type=checkbox]),select){font-size:16px}}
.frd-message-edit-dialog{box-sizing:border-box;width:min(680px,calc(100vw - 20px));max-width:none;max-height:calc(100dvh - 20px);padding:0;overflow:hidden;border:1px solid var(--tg-line);border-radius:8px;background:var(--tg-surface);color:var(--tg-text);box-shadow:0 16px 48px #102a4330}
.frd-message-edit-dialog::backdrop{background:#101b2aa8}
.frd-message-edit-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 12px;border-bottom:1px solid var(--tg-line)}
.frd-message-edit-dialog h3{margin:0;font-size:15px;line-height:1.3;font-weight:600}
.frd-message-edit-content{display:grid;gap:10px;box-sizing:border-box;max-height:calc(100dvh - 73px);padding:12px;overflow:auto;overscroll-behavior:contain;font-size:12px;line-height:1.4}
.frd-message-edit-content :is(p,small){overflow-wrap:anywhere;white-space:pre-wrap}
.frd-message-edit-content p{margin:0}
.frd-message-edit-content small{display:block;color:var(--tg-muted)}
.frd-message-edit-dialog button{min-height:36px;padding:5px 9px;border:1px solid var(--tg-line);border-radius:5px;background:var(--tg-field);color:var(--tg-text);font:inherit;font-size:12px;cursor:pointer}
.frd-message-edit-dialog button:hover:not(:disabled){background:var(--tg-hover)}
.frd-message-edit-dialog button:disabled{opacity:.55;cursor:default}
.frd-message-edit-dialog button:focus-visible,.frd-message-edit-dialog textarea:focus-visible,.frd-message-edit-dialog input:focus-visible{outline:2px solid var(--tg-accent);outline-offset:2px}
.frd-message-edit-dialog .frd-message-edit-close{min-width:36px;font-size:20px;line-height:1;padding:0}
.frd-message-edit-field{display:grid;gap:5px;color:var(--tg-muted)}
.frd-message-edit-field textarea{box-sizing:border-box;display:block;width:100%;min-height:96px;max-height:40dvh;padding:8px;border:1px solid var(--tg-line);border-radius:5px;background:var(--tg-field);color:var(--tg-text);font:inherit;font-size:13px;line-height:1.4;resize:vertical}
.frd-message-edit-card{display:grid;gap:7px;padding:9px;border:1px solid var(--tg-line);border-radius:6px;background:var(--tg-field)}
.frd-message-edit-card>strong{font-size:12px;overflow-wrap:anywhere}
.frd-message-edit-options{display:flex;flex-wrap:wrap;align-items:center;gap:5px 12px;min-width:0;margin:0;padding:5px 7px;border:1px solid var(--tg-line);border-radius:5px;background:var(--tg-surface)}
.frd-message-edit-options legend{padding:0 3px;color:var(--tg-muted)}
.frd-message-edit-options small{flex:1 1 100%}
.frd-message-edit-choice{display:inline-flex;align-items:center;gap:5px;min-height:36px;cursor:pointer}
.frd-message-edit-dialog .frd-message-edit-choice input{box-sizing:border-box;width:14px;height:14px;min-width:14px;min-height:14px;flex:0 0 14px;margin:0;padding:0;accent-color:var(--tg-accent)}
.frd-message-edit-status{min-height:18px;color:var(--tg-muted)}
.frd-message-edit-dialog .frd-message-edit-primary{justify-self:start;border-color:var(--tg-accent);background:var(--tg-accent);color:#fff}
.frd-message-edit-dialog .frd-message-edit-primary:hover:not(:disabled){background:color-mix(in srgb,var(--tg-accent) 85%,#000)}
.frd-message-edit-swap-trigger{justify-self:start}
.frd-message-edit-partners{display:grid;gap:5px;max-height:24dvh;overflow:auto}
.frd-message-edit-partners button{text-align:left;overflow-wrap:anywhere}
.frd-message-edit-partners button[aria-pressed=true]{border-color:var(--tg-accent);color:var(--tg-accent);background:var(--tg-hover)}
.frd-message-edit-preview{display:grid;gap:5px;padding:8px;border:1px solid var(--tg-line);border-radius:5px;background:var(--tg-field)}
.frd-message-edit-history{display:grid;gap:9px}
.frd-message-edit-record{display:grid;gap:6px;padding:8px;border:1px solid var(--tg-line);border-radius:6px;background:var(--tg-field)}
.frd-message-edit-compare{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.frd-message-edit-snapshot{display:grid;align-content:start;gap:4px;min-width:0;padding:7px;border:1px solid var(--tg-line);border-radius:5px;background:var(--tg-surface)}
.frd-message-edit-snapshot p{overflow-wrap:anywhere}
.frd-message-edit-dialog [hidden]{display:none!important}
@media(max-width:600px){
  .frd-message-edit-dialog{width:calc(100vw - 8px);max-height:calc(100dvh - 8px);border-radius:6px}
  .frd-message-edit-content{max-height:calc(100dvh - 58px);padding:8px;gap:8px}
  .frd-message-edit-dialog button,.frd-message-edit-choice{min-height:42px}
  .frd-message-edit-dialog .frd-message-edit-close{min-width:42px}
  .frd-message-edit-field textarea{min-height:82px;font-size:16px}
  .frd-message-edit-card{padding:7px}
  .frd-message-edit-compare{grid-template-columns:1fr}
}

/* Task ERP 24.10.02: compact shared object fields. */
.frd-order-contacts{grid-column:1/-1;display:grid;gap:9px;min-width:0;font-size:12px}
.frd-contact-field{display:grid;gap:4px;margin:0!important;min-width:0;color:var(--tg-muted)}
.frd-order-contacts :is(input,select,textarea){box-sizing:border-box;width:100%;min-width:0;min-height:36px;margin:0;padding:7px;border:1px solid var(--tg-line);border-radius:5px;background:var(--tg-field);color:var(--tg-text);font:inherit;font-size:14px}
.frd-order-contacts textarea{resize:vertical;min-height:82px}
.frd-contact-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
.frd-contact-list{display:grid;gap:7px}
.frd-contact-row{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:8px;border:1px solid var(--tg-line);border-radius:6px}
.frd-contact-role{grid-column:2}
.frd-contact-remove{grid-column:1;grid-row:2;justify-self:start;align-self:end}
.frd-order-contacts :is(.frd-contact-add,.frd-contact-remove){width:32px;min-height:32px;padding:6px;border:0;background:transparent;color:var(--tg-accent)}
.frd-order-contacts button svg{width:18px;height:18px}
.frd-order-requisites{padding-top:4px;border-top:1px solid var(--tg-line)}
.frd-order-requisites>summary{cursor:pointer;color:var(--tg-accent);padding:7px 0}
.frd-order-requisites[open]{display:grid;gap:8px}
.frd-order-requisites small{color:var(--tg-muted);line-height:1.4}
.frd-contact-summary{margin:0;display:grid;grid-template-columns:auto minmax(0,1fr);gap:5px 12px;font-size:12px}
.frd-contact-summary dt{color:var(--tg-muted)}
.frd-contact-summary dd{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:600px){.frd-order-contacts :is(input,select,textarea){font-size:16px}.frd-contact-row{grid-template-columns:minmax(0,1fr)}.frd-contact-role,.frd-contact-remove{grid-column:1;grid-row:auto}.frd-contact-summary{grid-template-columns:1fr;gap:3px}.frd-contact-summary dd{margin-bottom:5px}}
.frd-order-card-dialog[open]{display:flex;flex-direction:column;padding:0!important}
.frd-order-card-dialog>header{flex:none}
.frd-order-card-dialog>.frd-message-edit-content{min-height:0;max-height:none;flex:1;overflow:auto}
.frd-order-contacts{padding:0!important;margin:0!important;border:0!important}
.erp-create-dialog[open]{display:flex;flex-direction:column;box-sizing:border-box;max-width:680px!important;width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px);padding:0!important;overflow:hidden;background:var(--tg-surface);color:var(--tg-text);border:1px solid var(--tg-line);border-radius:8px}
.erp-create-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:none;padding:9px 12px;border-bottom:1px solid var(--tg-line)}
.erp-create-dialog>header h3{margin:0;font-size:15px;line-height:1.3}
.erp-create-dialog>header .erp-window-close{position:static;float:none;flex:none;width:32px;height:32px;min-height:32px!important;background:var(--tg-field);color:var(--tg-muted)}
.erp-create-dialog>header svg{width:18px;height:18px}
.erp-create-dialog>form{min-height:0;flex:1;overflow:auto;margin:0;padding:12px;gap:6px}
.erp-create-dialog>form>button[type=submit]{justify-self:start;width:auto;padding:8px 14px;background:var(--tg-accent);color:#fff;border:0;border-radius:5px}
@media(max-width:600px){.erp-create-dialog>form{padding:8px}.erp-create-dialog>form>input,.erp-create-dialog>form>textarea{font-size:16px}}

/* Task ERP 24.18: one compact registry snapshot and its preserved source. */
.frd-counterparty-dialog :is(section,details,form){margin:0!important;padding:0;border:0}
.frd-counterparty-search{display:flex;align-items:end;gap:8px}
.frd-counterparty-search label{flex:1}
.frd-counterparty-dialog input{box-sizing:border-box;width:100%;min-width:0;min-height:36px;padding:7px;border:1px solid var(--tg-line);border-radius:5px;background:var(--tg-field);color:var(--tg-text);font:inherit;font-size:14px}
.frd-counterparty-dialog .frd-counterparty-snapshot{display:grid;gap:9px;padding:10px!important;border:1px solid var(--tg-line);border-radius:6px;background:var(--tg-field)}
.frd-counterparty-links{display:flex;flex-wrap:wrap;gap:8px 16px}
.frd-counterparty-dialog a{color:var(--tg-accent);text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere}
.frd-counterparty-dialog summary{padding:8px 0;cursor:pointer;color:var(--tg-accent)}
.frd-counterparty-dialog details[open]{display:grid;gap:9px}
.frd-counterparty-upload{display:grid;gap:8px}
.frd-counterparty-upload button{justify-self:start}
.frd-counterparty-warning{padding:8px;border-left:2px solid var(--tg-accent);background:var(--tg-hover)}
.frd-counterparty-row{display:block;margin-top:8px;padding:7px 0!important;border:0!important;background:transparent!important;color:var(--tg-accent)!important;font:inherit;font-size:12px;cursor:pointer}
@media(max-width:600px){.frd-counterparty-dialog input{font-size:16px}.frd-counterparty-search{align-items:stretch;flex-direction:column}.frd-counterparty-search button{align-self:start}}
.frd-calendar-workflow-card{display:grid;gap:4px;min-width:0;padding:9px;border:1px solid var(--tg-line);border-left:2px solid #86bde5;border-radius:6px;background:var(--tg-field);font-size:12px;line-height:1.4}
.frd-calendar-workflow-card.kind-supply{border-left-color:#c5ac73}
.frd-calendar-workflow-card.kind-installation{border-left-color:#91bfa1}
.frd-calendar-workflow-card :is(p,small){margin:0;overflow-wrap:anywhere}
.frd-calendar-workflow-card small{color:var(--tg-muted)}
.frd-calendar-workflow-title{display:flex;gap:7px;align-items:center}
.frd-calendar-workflow-title svg{width:16px;height:16px;color:var(--tg-accent)}
.frd-calendar-workflow-card[data-status=cancelled]{opacity:.6}
.frd-calendar-workflow-card>.erp-message-action{justify-self:end}
.erp-calendar-workflow-message{background:transparent!important;padding:0!important;max-width:100%}
.frd-planned-measurements{border-style:dashed!important}
/* Corrections retain the source decision, delivery and recording. */
.frd-message-edit-notice{display:block;margin:4px 0;padding:5px 7px;border-left:2px solid var(--tg-accent);font-size:11px;line-height:1.4;color:var(--tg-muted);overflow-wrap:anywhere}

/* team-chat.css */
/* Task ERP 24.11. Uses the staff cabinet theme in both color schemes. */
.team-chat-mode #note-section,.team-chat-mode #journal-section,.team-chat-mode #refresh{display:none!important}
#team-chat-section{max-width:900px;min-width:0;margin:0 auto;padding:0;border:1px solid var(--tg-line);border-radius:14px;background:var(--tg-surface);overflow:hidden}
.tc-heading{padding:18px 22px;border-bottom:1px solid var(--tg-line)}.tc-heading h2{margin:0!important}.tc-heading p{margin:5px 0 0!important}
#team-chat-shortcut,#team-chat-link{display:inline-flex;align-items:center;gap:6px;text-decoration:none}.tc-badge{display:inline-flex;justify-content:center;min-width:20px;padding:1px 5px;font-size:11px;font-variant-numeric:tabular-nums;border-radius:12px;background:var(--tg-accent);color:var(--tg-surface)}.tc-mention-badge{background:var(--tg-field);color:var(--tg-accent);border:1px solid var(--tg-accent)}
.orders-mode #team-chat-shortcut{font-size:11px;line-height:1.2;color:var(--tg-accent)}
.tc-feed{height:clamp(240px,47dvh,560px);overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:20px;display:flex;flex-direction:column;gap:14px;background:var(--tg-field);min-width:0}
.tc-message{flex:none;max-width:88%;min-width:150px;align-self:flex-start;border:1px solid var(--tg-line);border-radius:12px;padding:12px 14px;margin:0;background:var(--tg-surface);overflow-wrap:anywhere;color:var(--tg-text)}
.tc-message.tc-mine{align-self:flex-end;background:color-mix(in srgb,var(--tg-accent) 9%,var(--tg-surface))}.tc-message.tc-mentioned{border-color:var(--tg-accent);box-shadow:inset 3px 0 var(--tg-accent)}
.tc-message-heading{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.tc-message-heading strong{font-size:13px}.tc-message-heading time{font-size:11px;color:var(--tg-muted);margin-left:auto}.tc-message-heading .frd-chat-avatar{width:28px;height:28px;min-width:28px;font-size:10px}
.tc-message p.tc-message-text{white-space:pre-wrap;margin:10px 0 0;font-size:14px;line-height:1.5}.tc-message p.tc-message-mentions{font-size:12px;color:var(--tg-accent);margin:8px 0 0}.tc-attachment{margin-top:10px;display:flex;flex-direction:column;gap:6px;min-width:0}.tc-attachment img{width:min(100%,360px);max-height:320px;object-fit:contain;align-self:flex-start;border-radius:6px;background:var(--tg-field)}.tc-attachment a{font-size:12px;overflow-wrap:anywhere}
#team-chat-section .tc-older{display:block;margin:10px auto;max-width:calc(100% - 24px);font-size:12px}.tc-empty{margin:auto!important;text-align:center;color:var(--tg-muted)}
.tc-composer{padding:14px 20px;border-top:1px solid var(--tg-line)}.tc-composer>label{margin-top:0!important}.tc-composer textarea{width:100%;min-height:82px;max-height:260px}.tc-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0}.tc-toolbar button{display:inline-flex;align-items:center;justify-content:center;gap:6px}.tc-toolbar button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.tc-toolbar .tc-send{margin-left:auto;background:var(--tg-accent)!important;color:var(--tg-surface)!important;border-color:var(--tg-accent)!important}
.tc-files,.tc-selected-mentions{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.tc-chip{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;padding:4px 8px!important;border:1px solid var(--tg-line);border-radius:8px;font-size:12px!important;overflow-wrap:anywhere;white-space:normal}.tc-chip span{min-width:0;overflow-wrap:anywhere}.tc-chip button{font-size:11px!important;min-height:28px!important;padding:3px 6px!important}.tc-status{min-height:20px;margin:0!important;padding:0 20px 10px;color:var(--tg-muted);font-size:12px!important}
.tc-dialog{background:var(--tg-surface);color:var(--tg-text);border:1px solid var(--tg-line);border-radius:14px;width:min(440px,calc(100% - 28px));max-height:80dvh;padding:20px}.tc-dialog::backdrop{background:#0008}.tc-members{max-height:45dvh;overflow-y:auto}.tc-member{display:flex!important;align-items:center;gap:12px;padding:9px 0;margin:0!important;overflow-wrap:anywhere}.tc-member input{width:18px!important;height:18px;flex:none}.tc-dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}
@media(max-width:540px){#team-chat-section{border-radius:10px}.tc-heading{padding:14px}.tc-feed{padding:12px 9px;height:42dvh;min-height:240px}.tc-message{max-width:95%;padding:10px}.tc-composer{padding:12px}.tc-toolbar{gap:6px}.tc-toolbar button{font-size:12px!important;padding:7px 9px!important}.tc-toolbar .tc-send{margin-left:0}.tc-status{padding:0 12px 10px}.tc-chip{flex-wrap:wrap}.tc-attachment img{max-height:240px}.team-chat-mode #voice-panel{width:calc(100% - 16px)!important}}
/* Task ERP 24.11.01: one persistent chat panel inside the orders shell. */
.orders-mode #team-chat-shortcut,.orders-mode #team-chat-link{display:none!important}
.orders-mode #erp-team-chat-tab{position:relative;flex:none}.orders-mode #erp-team-chat-counts{position:absolute;top:-5px;right:-3px;display:flex;gap:2px}.orders-mode #erp-team-chat-counts .tc-badge{font-size:9px;min-width:13px;padding:0 3px;line-height:14px}.orders-mode #erp-team-chat-counts .tc-mention-badge{position:absolute;top:13px;right:0;white-space:nowrap}
.orders-mode .erp-workspace[data-team-chat=true] #erp-discussions,.orders-mode .erp-workspace[data-team-chat=true] .erp-inbox{display:none}
.orders-mode #team-chat-section{display:flex;flex-direction:column;min-height:0;height:100%;max-width:none;width:100%;margin:0;border:0;border-radius:0;overflow:hidden}
.orders-mode #team-chat-section .tc-heading{flex:none;padding:12px 18px}.orders-mode #team-chat-section .tc-heading h2{font-size:18px}.orders-mode #team-chat-section .tc-feed{height:auto;flex:1;min-height:0}.orders-mode #team-chat-section .tc-composer{flex:none;padding:10px 14px;max-height:45%;overflow-y:auto}.orders-mode #team-chat-section .tc-status{flex:none}.orders-mode #team-chat-section textarea{min-height:60px;max-height:130px}.orders-mode #team-chat-section .tc-toolbar button{width:auto;height:auto;min-height:34px;font-size:12px}
@media(max-width:1100px){.orders-mode .erp-workspace[data-pane=orders] #team-chat-section{display:none}.orders-mode .erp-workspace[data-team-chat=true]{grid-template-columns:minmax(0,1fr)}.orders-mode .erp-workspace[data-team-chat=true] .erp-orders-pane{display:block!important;grid-row:1;padding:0 8px;overflow:visible}.orders-mode .erp-workspace[data-team-chat=true] .erp-orders-pane>:not(.erp-list-header){display:none!important}.orders-mode .erp-workspace[data-team-chat=true] .erp-list-header>:not(.erp-list-title){display:none!important}.orders-mode .erp-workspace[data-team-chat=true] .erp-list-title{margin:0}.orders-mode .erp-workspace[data-team-chat=true]{grid-template-rows:auto minmax(0,1fr)}.orders-mode .erp-box-tabs{overflow:visible;flex-shrink:0}.orders-mode .erp-workspace[data-team-chat=true] #team-chat-section{grid-row:2}.orders-mode #team-chat-section .tc-heading{padding:10px 12px}.orders-mode #team-chat-section .tc-toolbar{gap:5px}}
/* Task ERP 24.13: shared navigation above every workspace, full-width team chat. */
.orders-mode .erp-workspace-nav{flex:none;display:flex;align-items:center;padding:5px 8px;border:1px solid var(--tg-line);border-bottom:0;background:var(--tg-surface)}
.orders-mode .erp-workspace-nav .erp-box-tabs{margin:0;gap:6px;overflow:visible}
.orders-mode .erp-workspace-nav .erp-box-tabs button{width:34px;height:32px;min-height:32px;border-color:var(--tg-line);color:var(--tg-muted);background:var(--tg-surface)}
.orders-mode .erp-workspace-nav .erp-box-tabs button[aria-pressed=true]{background:color-mix(in srgb,#588bc1 18%,var(--tg-surface));border-color:#588bc1;color:var(--tg-text)}
.orders-mode .erp-workspace[data-team-chat=true]{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
.orders-mode .erp-workspace[data-team-chat=true] .erp-orders-pane{display:none!important}
.orders-mode .erp-workspace[data-team-chat=true] #team-chat-section{grid-column:1;grid-row:1;--tc-blue:#588bc1}
.orders-mode #team-chat-section .tc-heading{padding:8px 14px;display:flex;align-items:center;gap:12px}
.orders-mode #team-chat-section .tc-heading h2{font-size:16px}
.orders-mode #team-chat-section .tc-heading p{font-size:12px;margin:0!important}
.orders-mode #team-chat-section .tc-feed{padding:12px 16px;gap:8px;touch-action:pan-y;-webkit-overflow-scrolling:touch}
.orders-mode #team-chat-section .tc-message{padding:7px 10px;border-radius:9px;max-width:min(86%,780px)}
.orders-mode #team-chat-section .tc-message.tc-mine{background:color-mix(in srgb,#588bc1 12%,var(--tg-surface))}
.orders-mode #team-chat-section .tc-message-text{margin:5px 0 0;font-size:13px;line-height:1.4}
.orders-mode #team-chat-section .tc-message-heading .frd-chat-avatar{width:22px;height:22px;min-width:22px}
.orders-mode #team-chat-section .tc-composer{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;padding:7px 12px;overflow-y:auto;max-height:40%}
.orders-mode #team-chat-section textarea{grid-column:1;grid-row:1;min-height:38px;height:38px;max-height:120px;margin:0;resize:vertical}
.orders-mode #team-chat-section .tc-toolbar{grid-column:2;grid-row:1;flex-wrap:nowrap;margin:0;gap:4px;align-self:end}
#team-chat-section .tc-icon-button{display:inline-flex;align-items:center;justify-content:center;width:34px!important;height:34px!important;min-height:34px;padding:5px!important;font-size:19px!important;line-height:1;border:1px solid var(--tg-line);color:var(--tg-text);background:var(--tg-surface);border-radius:7px}
#team-chat-section .tc-icon-button svg{width:18px;height:18px}
#team-chat-section .tc-send{background:#4f80b3!important;border-color:#4f80b3!important;color:#fff!important;margin-left:0}
#team-chat-section .tc-files,#team-chat-section .tc-selected-mentions{grid-column:1/-1;margin:0}
#team-chat-section .tc-status:empty{display:none}
@media(max-width:650px){.orders-mode #team-chat-section .tc-heading{padding:8px;flex-wrap:wrap;gap:4px 10px}.orders-mode #team-chat-section .tc-feed{padding:8px;gap:7px}.orders-mode #team-chat-section .tc-message{max-width:95%}.orders-mode #team-chat-section .tc-composer{padding:6px;gap:4px}.orders-mode #team-chat-section .tc-toolbar{gap:3px}#team-chat-section .tc-icon-button{width:30px!important;height:34px!important}.orders-mode .erp-workspace-nav{padding:4px 6px}}
.tc-heading-actions{display:flex;gap:4px;margin-left:auto}.tc-message-actions{display:flex;gap:3px;margin-top:6px}.tc-message-actions .tc-icon-button{width:25px!important;height:25px!important;min-height:25px;font-size:15px!important}.tc-context-list{display:flex;gap:5px;flex-wrap:nowrap;overflow-x:auto;flex:none;padding:5px 12px;border-bottom:1px solid var(--tg-line);max-height:84px}.tc-context-list:empty{display:none}.tc-context-list button,.tc-thread-label{font-size:11px!important;padding:4px 7px!important;min-height:25px!important;white-space:nowrap;color:var(--tg-text);background:color-mix(in srgb,#588bc1 9%,var(--tg-surface));border:1px solid var(--tg-line);border-radius:6px}.tc-task-row{flex:none}.tc-dialog form{display:flex;flex-direction:column;gap:8px}.tc-dialog label{display:flex;flex-direction:column;gap:4px}.tc-dialog input,.tc-dialog textarea,.tc-dialog select{width:100%;min-width:0}.tc-dialog>button{float:right}
.tc-thread-source{flex:none;max-height:28%;overflow-y:auto;padding:7px 14px;border-bottom:1px solid var(--tg-line);background:var(--tg-surface)}.tc-thread-source>small{color:var(--tg-muted);font-size:11px}.tc-thread-source .tc-message{margin-top:4px;max-width:100%!important}.tc-thread-source .tc-message-actions{display:none}
/* A shared chat has no sales funnel above its navigation. */
body.orders-mode:has(.erp-workspace[data-team-chat=true]) #erp-sales-strip{display:none}

body.orders-mode:has(.erp-workspace[data-team-chat=true]) .erp-mobile-tabs{display:none!important}

/* Shared ERP actions: the same blue line icons, without separate button frames. */
#team-chat-section .tc-icon-button:not(.tc-send){color:var(--tg-accent);border-color:transparent;background:transparent}
#team-chat-section .tc-icon-button:not(.tc-send):hover{background:color-mix(in srgb,var(--tg-accent) 9%,transparent)}
/* Shared SVG action geometry also covers calendar browsing outside a composer. */
.frd-calendar-entry{display:inline-flex;align-items:center;justify-content:center;gap:6px}
.frd-calendar-entry svg,.frd-calendar-dialog>header>button svg{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6}
/* Task ERP 24.16: reversible message changes and readable audit history. */
#team-chat-section .tc-message-hidden{margin:8px 0 0;color:var(--tg-muted);font-style:italic;font-size:13px}
#team-chat-section .tc-change-dialog{width:min(520px,calc(100% - 28px));max-width:90vw}
#team-chat-section .tc-change-dialog label{display:flex;flex-direction:column;gap:6px}
#team-chat-section .tc-change-dialog textarea{width:100%;min-height:120px;max-height:45dvh;resize:vertical}
#team-chat-section .tc-change-status{min-height:20px;color:var(--tg-muted);font-size:12px}
#team-chat-section .tc-change-controls{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
#team-chat-section .tc-change-history{max-height:55dvh;overflow-y:auto;display:grid;gap:12px}
#team-chat-section .tc-change-record{border-top:1px solid var(--tg-line);padding-top:10px}
#team-chat-section .tc-change-record>strong{font-size:13px}
#team-chat-section .tc-change-compare{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px}
#team-chat-section .tc-change-snapshot{background:var(--tg-field);padding:8px;border-radius:7px;overflow-wrap:anywhere}
#team-chat-section .tc-change-snapshot p{white-space:pre-wrap;margin:6px 0 0}
@media(max-width:540px){#team-chat-section .tc-change-compare{grid-template-columns:1fr}}

/* personal-tasks.css */
/* Task ERP 24.12. Personal tasks share the staff light/dark palette. */
.pt-section{border-top:1px solid var(--tg-line);margin:18px 0 0;padding:18px 0 0;color:var(--tg-text);min-width:0}.pt-heading,.pt-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.pt-heading{justify-content:space-between}.pt-heading h4,.pt-editor h4{font-size:15px;margin:0}.pt-heading button,.pt-actions button{min-height:36px!important;width:auto!important;height:auto!important;padding:7px 10px!important;font-size:13px!important;border:1px solid var(--tg-line)!important;border-radius:8px;background:var(--tg-field);color:var(--tg-accent)}.pt-list{display:flex;flex-direction:column;gap:10px;margin:12px 0}.pt-card{padding:12px;margin:0;border:1px solid var(--tg-line);border-radius:10px;background:var(--tg-field);min-width:0}.pt-card strong,.pt-card small{display:block;overflow-wrap:anywhere}.pt-card small{font-size:12px;color:var(--tg-muted);margin-top:5px}.pt-card p.pt-description{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;margin:8px 0}.pt-actions{margin-top:10px}.pt-feedback{font-size:12px;color:var(--tg-muted);white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0}.pt-feedback:empty{display:none}.pt-overdue{font-size:12px;color:#bf504b}.pt-show-done{display:flex;align-items:center;gap:8px;font-size:13px!important}.pt-show-done input{width:18px!important;min-height:18px!important;height:18px}.pt-editor:empty{display:none}.pt-editor{padding:14px 0;border-bottom:1px solid var(--tg-line)}.pt-form{display:flex;flex-direction:column;gap:5px}.pt-form label{font-size:13px;margin:8px 0 0}.pt-form input,.pt-form textarea,.pt-form select{font:inherit;font-size:16px;color:var(--tg-text);background:var(--tg-field);border:1px solid var(--tg-line);border-radius:8px;min-height:40px;padding:8px;width:100%}.pt-form textarea{min-height:80px;resize:vertical}.pt-form button:disabled{opacity:.5}.pt-form input[type=datetime-local]{min-width:0}.pt-form :is(input,textarea,select,button):focus-visible{outline:2px solid var(--tg-accent);outline-offset:2px}@media(max-width:540px){.pt-heading{align-items:flex-start;flex-direction:column}.pt-section{padding-top:12px}.pt-card{padding:10px}.pt-form{max-width:100%;min-width:0}}

.pt-team-section{border-top:1px solid var(--tg-line);margin-top:18px;padding-top:14px}.pt-team-section h4{font-size:15px;margin:0}.pt-team-source{display:inline-block;margin-top:8px;color:var(--tg-accent);font-size:13px}.pt-team-source:focus-visible{outline:2px solid var(--tg-accent);outline-offset:2px}

/* task-files.css */
.frd-task-files{margin:10px 0}.frd-task-files-button{display:inline-flex;align-items:center;gap:8px}.frd-task-files-list{list-style:none;padding:0;margin:8px 0}.frd-task-files-list li{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:4px 0}.frd-task-files-list button{min-height:32px;padding:3px 8px}.frd-task-files-error{color:#f4ad99}.frd-task-attachments{display:flex;flex-direction:column;gap:4px;margin:8px 0}.frd-task-attachments a{overflow-wrap:anywhere}

/* auth.css */
/* Task ERP 21.03: the staff entry shares the messenger light/dark palette. */
body.auth-mode{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;background:var(--tg-field);color:var(--tg-text);min-height:100dvh;color-scheme:light}
:root[data-chat-theme=dark] body.auth-mode{color-scheme:dark}
.auth-mode .staff-texture,.auth-mode .team-footer,.auth-mode #voice-panel>h1,.auth-mode #voice-panel>p:first-of-type,.auth-mode #message{display:none!important}
.auth-mode .team-header{background:var(--tg-surface);border-bottom:1px solid var(--tg-line);box-shadow:none;backdrop-filter:none}
.auth-mode .team-header-inner{width:min(960px,calc(100% - 32px));min-height:64px;display:flex;padding:8px 0;gap:12px}
.auth-mode .team-brand img{width:32px;height:42px}.auth-mode .team-title p{font-size:17px;letter-spacing:0}
body.auth-mode #voice-panel{width:min(440px,calc(100% - 32px));height:auto;max-width:440px;padding:clamp(24px,6vh,64px) 0 40px;margin:0 auto;background:transparent;box-shadow:none;border:0}
.auth-mode .frd-auth-shell{padding:0;border:0;margin:0}
.frd-auth-card{background:var(--tg-surface);border:1px solid var(--tg-line);border-radius:24px;padding:28px;box-shadow:0 12px 40px #00000008}
.frd-auth-mark{display:grid;place-items:center;width:52px;height:52px;border-radius:16px;background:var(--tg-accent);color:var(--tg-surface);font-size:23px;font-weight:700;letter-spacing:-1px;margin-bottom:22px}
.frd-auth-eyebrow{font-size:10px!important;font-weight:600;letter-spacing:.13em;color:var(--tg-muted);margin:0 0 9px!important}
.frd-auth-card h2{font-size:27px;line-height:1.2;font-weight:650;letter-spacing:-.6px;margin:0 0 12px}
.frd-auth-description{color:var(--tg-muted);font-size:14px;line-height:1.5;margin:0 0 20px;overflow-wrap:anywhere}
.frd-auth-tabs{display:flex;gap:4px;background:var(--tg-field);padding:4px;border-radius:12px;margin:22px 0}
.frd-auth-tabs button{flex:1;background:transparent;border:0;color:var(--tg-muted);border-radius:9px;font-size:14px;min-height:38px;padding:8px}
.frd-auth-tabs button[aria-pressed=true]{background:var(--tg-surface);color:var(--tg-accent);box-shadow:var(--tg-shadow)}
.frd-auth-field{margin-bottom:16px;min-width:0}
.frd-auth-field label,.frd-auth-admin label{color:var(--tg-text);font-size:13px;font-weight:550;margin:0 0 7px;display:block}
.frd-auth-field input,.frd-auth-admin select{width:100%;min-width:0;font-size:16px;min-height:48px;border:1px solid var(--tg-line);background:var(--tg-field);color:var(--tg-text);padding:11px 13px;border-radius:11px}
.frd-auth-password{display:flex;align-items:stretch;border:1px solid var(--tg-line);border-radius:11px;background:var(--tg-field);overflow:hidden}
.frd-auth-password input{border:0!important;background:transparent!important;flex:1;width:0;border-radius:10px 0 0 10px}
.frd-auth-password button{border:0;background:transparent;color:var(--tg-accent);font-size:12px;padding:9px 11px;min-width:75px;min-height:44px;border-radius:0 10px 10px 0}
.frd-auth-password:focus-within{outline:2px solid var(--tg-accent);outline-offset:2px}.frd-auth-password input:focus-visible{outline:none}
.frd-auth-hint{font-size:12px;line-height:1.5;color:var(--tg-muted);margin:8px 0 16px;overflow-wrap:anywhere}
.frd-auth-card button.frd-auth-primary,.frd-auth-account button.frd-auth-primary,.frd-auth-admin button.frd-auth-primary{background:var(--tg-accent);border:0;color:var(--tg-surface);font-weight:600;border-radius:11px;min-height:48px;padding:11px 16px;font-size:15px}
.frd-auth-card form>.frd-auth-primary,.frd-auth-account form>.frd-auth-primary{width:100%}
.frd-auth-card button:focus-visible,.frd-auth-account button:focus-visible,.frd-auth-admin button:focus-visible,.frd-auth-card a:focus-visible{outline:2px solid var(--tg-accent);outline-offset:3px}
.frd-auth-status{color:var(--tg-muted);font-size:13px;line-height:1.5;margin:12px 0 0;overflow-wrap:anywhere}.frd-auth-status:empty{display:none}
.frd-auth-links{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:14px}
.frd-auth-links button,.frd-auth-account>button{background:transparent;border:0;color:var(--tg-accent);font-size:13px;padding:6px;min-height:36px;border-radius:8px}
.frd-auth-divider{display:flex;align-items:center;gap:12px;color:var(--tg-muted);font-size:11px;margin:24px 0 13px;white-space:nowrap}
.frd-auth-divider:before,.frd-auth-divider:after{content:"";height:1px;background:var(--tg-line);flex:1}
.frd-auth-yandex{display:block;text-align:center;background:var(--tg-field);border:1px solid var(--tg-line);border-radius:11px;padding:12px;font-size:14px;color:var(--tg-text);text-decoration:none}
.frd-auth-pending-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:20px}
.frd-auth-pending-actions>button{flex:1;border:1px solid var(--tg-line);background:var(--tg-field);color:var(--tg-text);border-radius:11px;font-size:14px;min-height:44px;padding:10px 14px}
.frd-auth-person{font-size:15px;color:var(--tg-text);overflow-wrap:anywhere}
.frd-auth-account form{max-width:460px}.frd-auth-account .frd-auth-description{margin:6px 0 14px}.frd-auth-account .frd-auth-status{margin:12px 0}
.frd-auth-admin{color:var(--tg-text);background:var(--tg-surface);border:1px solid var(--tg-line);border-radius:16px;padding:20px;margin:0 0 22px}
.frd-auth-admin h2{font-size:22px;font-weight:600;letter-spacing:0;margin-bottom:16px}
.frd-auth-registration{padding:18px;border:1px solid var(--tg-line);border-radius:12px;margin:12px 0;background:var(--tg-surface);max-width:640px}
.frd-auth-registration h3{font-size:17px;font-weight:600;margin:0 0 4px;overflow-wrap:anywhere}.frd-auth-registration .frd-auth-description{margin:0 0 12px}
.frd-auth-sessions{margin-top:20px}.frd-auth-sessions summary{cursor:pointer;color:var(--tg-accent);font-size:14px}
.frd-auth-session-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;border-bottom:1px solid var(--tg-line);padding:10px 0;font-size:14px}
.frd-auth-session-row>span{flex:1;overflow-wrap:anywhere}.frd-auth-session-row>button{background:var(--tg-field);color:var(--tg-accent);border:0;border-radius:9px;font-size:13px;min-height:36px;padding:8px 12px}
.frd-auth-session-row>.frd-auth-status{width:100%;margin:0}
.frd-auth-admin .frd-auth-ownership{display:flex;align-items:flex-start;gap:9px;line-height:1.5;font-size:13px;font-weight:400;margin:16px 0 0;cursor:pointer}
.frd-auth-admin .frd-auth-ownership input{width:18px;height:18px;min-height:18px;flex:none;padding:0;margin:2px 0 0;accent-color:var(--tg-accent)}
.frd-auth-reset-link{width:100%;padding:14px;border:1px solid var(--tg-line);border-radius:11px;background:var(--tg-field);overflow-wrap:anywhere}
.frd-auth-reset-link input{width:100%;min-width:0;font-size:16px;min-height:44px;padding:10px;border:1px solid var(--tg-line);background:var(--tg-surface);color:var(--tg-text);border-radius:9px}
.frd-auth-reset-link>button{background:var(--tg-surface);color:var(--tg-accent);border:1px solid var(--tg-line);border-radius:9px;font-size:13px;min-height:38px;padding:8px 12px;margin:0 8px 0 0}
@media(max-width:480px){.frd-auth-card{padding:24px 20px;border-radius:20px}.frd-auth-card h2{font-size:25px}.frd-auth-admin{padding:14px}.frd-auth-registration{padding:14px}.frd-auth-pending-actions>button{flex:1 1 140px}}

/* palych.css */
/* Independent, compact companion; no global component resets. */
#palych{--p-panel:var(--tg-surface,#fff);--p-ink:var(--tg-text,#202d3a);position:fixed;right:12px;bottom:76px;width:85px;z-index:80;color:var(--p-ink);font:14px/1.45 system-ui,sans-serif;pointer-events:none;padding:0;margin:0;border:0}
#palych[data-side=left]{right:auto;left:12px}
#palych button,#palych a{pointer-events:auto;font:inherit;cursor:pointer;touch-action:manipulation}
#palych button{color:var(--p-ink);background:var(--p-panel);border:1px solid var(--tg-border,#b9c9d8);border-radius:10px;padding:7px 10px;margin:0;min-height:34px}
#palych button:hover{background:var(--tg-hover,#eaf2f9)}
#palych :is(button,a,select,summary):focus-visible{outline:3px solid #3987c7;outline-offset:3px}
#palych .palych-actor{display:block;width:85px;height:93.5px;padding:0;border:0;background:transparent;touch-action:manipulation}
#palych .palych-actor:hover{background:transparent}
#palych canvas{display:block;width:100%;height:100%;object-fit:contain}
#palych .palych-launcher{display:grid;place-items:center;position:fixed;right:8px;bottom:8px;left:auto;width:32px;height:32px;min-height:32px;padding:0;margin:0;box-sizing:border-box;border-radius:50%;font-size:17px;opacity:.65;box-shadow:0 2px 10px #0001}
#palych .palych-launcher:hover,#palych .palych-launcher:focus-visible{opacity:1;box-shadow:0 2px 12px #0003}
#palych .palych-bubble{position:absolute;bottom:132px;right:0;width:245px;max-width:calc(100vw - 32px);box-sizing:border-box;background:var(--p-panel);border:1px solid var(--tg-border,#c1cdd8);box-shadow:0 8px 30px #0002;border-radius:18px 18px 4px 18px;padding:14px;pointer-events:auto}
#palych[data-side=left] .palych-bubble{right:auto;left:0;border-radius:18px 18px 18px 4px}
#palych .palych-bubble p{margin:0 0 10px;font-size:14px;line-height:1.45;color:inherit;white-space:normal}
#palych .palych-bubble a{display:block;color:var(--tg-accent,#2369a5);padding:8px 0;font-weight:600}
#palych .palych-bubble button{margin:3px 5px 0 0;font-size:12px}
#palych.palych-paused .palych-actor,#palych.palych-no-art .palych-actor{display:none}
#palych.palych-busy .palych-actor,#palych.palych-busy .palych-bubble{visibility:hidden}
#palych [hidden]{display:none!important}
@media(max-width:820px),(hover:none) and (pointer:coarse) and (max-width:1024px){#palych{display:none!important}}
@media(prefers-reduced-motion:reduce){#palych *{animation:none!important;transition:none!important}}
/* Leave the task/material inspector's controls clear. The composer stays below the dock. */
@media(min-width:821px){body:has(.erp-inspector:not([hidden])) #palych[data-side=right]{right:min(410px,40vw)}}
#sergeich-settings label{display:grid;gap:6px;margin:12px 0;max-width:280px}
#sergeich-settings .palych-demo{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
#sergeich-settings details{margin:16px 0}

/* Keep the small corner control clear of chat send/record buttons. */
@media(min-width:821px){body.orders-mode:has(#palych) :is(.tc-composer,.erp-message-form,.erp-box-compose){padding-right:52px!important}}

@media(max-width:820px),(hover:none) and (pointer:coarse) and (max-width:1024px){#sergeich-settings{display:none!important}}


