.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}}
