/* Shared visual contract. Business state, user note colours and permissions are not styled away. */
:root{--ui-blue:#2563eb;--ui-title:#173354;--ui-text:#334155;--ui-muted:#64748b;--ui-line:#dbe7f5;--ui-bg:#f5f8ff;--ui-radius:12px;--ui-list-height:clamp(280px,55dvh,560px)}
html{scrollbar-gutter:stable;overflow-y:auto}
@supports not (scrollbar-gutter:stable){html{overflow-y:scroll}}
html.ui-modal-open{overflow-y:hidden}
body{font-family:"Microsoft YaHei","PingFang SC",system-ui,sans-serif}
:where(button,input,select,textarea){font-family:inherit}
:where(.main,#content,.content,main){min-width:0}
:where(#content,.wo,.wc-page,.dw-page,.mw-page,.tw-page){font-size:14px;line-height:1.6}
:where(button,a,input,select,textarea,summary):focus-visible{outline:2px solid var(--ui-blue);outline-offset:3px}
:where(.wo-scroll,.mt-table-scroll,.np-table-scroll,.np-month-scroll,.wc-day,.tw-input-scroll,.tw-metric-scroll,.tw-review-scroll){scrollbar-gutter:stable;overscroll-behavior:contain}
:where(.wo-summary,.wf2-summary,.ah-kpis,.eh-stats,.np-stats,.mt-workbench,.stat){font-variant-numeric:tabular-nums}
#content :is(.weekly-head,.np-head,.mt-head,.sm-head,.fw-page>header,.dynamic-project-head,.countdown-detail-head,.profile-head) h1,
.wo-page main h1,.dw-page main h1,.wc-page main h1,.mw-page h1,body:has(#pendingCount) h1{font-size:28px;line-height:1.35;font-weight:600;color:var(--ui-title);margin:8px 0}
#content :is(.weekly-head,.np-head,.mt-head,.sm-head)>div>p{font-size:14px;line-height:1.6;color:var(--ui-muted);margin:6px 0 0}
#content :is(.weekly-head,.np-head,.mt-head){min-height:116px;margin:0 0 24px;align-items:center}
#content:has(>.workforce-tabs),#content:has(>.wo-own-entry){max-width:none;margin:0;padding:32px clamp(24px,4vw,64px) 64px}
.workforce-tabs{min-height:48px;margin:0 0 24px;gap:10px}
.workforce-tabs button{height:48px;min-height:48px;font-size:14px;padding:10px 16px;border-radius:8px}
.workforce-tabs button span{font-size:12px}
.wo-own-entry{height:40px;display:inline-flex;align-items:center;margin:0 0 16px;font-size:14px}
.np-head .eyebrow,.mt-head .eyebrow,.sm-head .eyebrow,.weekly-head .eyebrow{font-size:12px;line-height:1.4;color:var(--ui-blue)}
#content :is(.np-stats,.mt-panel,.wo-box,.sm-group,.fw-box,.team-member-panel,.team-report-panel,.team-report-detail){border-radius:var(--ui-radius);border-color:var(--ui-line)}
:is(.np-stats,.mt-panel,.wo-box,.fw-box,.mw-page,.sm-group) h2{font-size:18px;line-height:1.5;font-weight:600}
:is(.mt-panel,.wo-box,.fw-box,.mw-page,.dynamic-timeline,.team-report-detail) h3{font-size:16px;line-height:1.5}
:is(.mt-workbench,.np-page,.sm-head,.sm-filters,.fw-actions,.wo-toolbar,.dw-page,.mw-page,.wc-toolbar) :is(button,input,select),
:is(.np-dialog,.mt-dialog,.fw-editor,.wc-dialog,.wo-dialog,.dynamic-report-modal) :is(button,input:not([type=checkbox]):not([type=radio]),select:not([multiple])){min-height:40px;font-size:14px;line-height:1.4;border-radius:8px}
:is(.mt-workbench,.np-page,.sm-filters,.fw-editor,.wc-dialog,.wo-toolbar) label{font-size:13px}
:is(.mt-workbench,.np-page,.sm-head,.sm-group,.fw-page,.wo,.mw-page,.dw-page,.team-weekly-board,.employee-weekly-board) small{font-size:12px;line-height:1.5}
:is(.np-stats,.wo,.mt-workbench) table{font-size:14px}
.np-stats :is(td,th){font-size:14px}
.np-stats .np-table-scroll{height:210px;overflow:auto}
.np-stats .np-table-scroll th{position:sticky;top:0;background:#f5f8ff;z-index:1}
.np-month{height:420px;min-height:420px;overflow:hidden}
.np-month>.np-codes{flex:1;min-height:0;overflow:auto;align-content:start;scrollbar-gutter:stable}
.np-month>.np-show-month{flex:none;margin-top:8px}
.np-product{height:106px;overflow:auto;scrollbar-gutter:stable;font-size:14px!important}
.np-product>span:first-child{line-height:1.5}
.np-legend{min-height:24px}
.np-load-state{height:24px;min-height:24px;max-height:24px;margin:0 0 8px;overflow:auto;font-size:12px}
.np-stats-loading{height:290px;border:1px solid var(--ui-line);border-radius:12px;background:#fff;padding:20px;margin-bottom:22px;color:var(--ui-muted)}
.np-months-loading .np-month{color:var(--ui-muted)}
.mt-table-scroll,.wo-scroll,.team-report-rows,.employee-history-rows{height:var(--ui-list-height);max-height:none;overflow:auto}
.mt-check-grid article{height:620px;display:flex;flex-direction:column;min-height:0;overflow:hidden}
.mt-check-grid article>.mt-auto-observation{flex:1;min-height:0;overflow:auto;scrollbar-gutter:stable}
.mt-check-grid article>.mt-identity{max-height:135px;overflow:auto;flex-shrink:0}
.mt-check-grid article>p{max-height:85px;overflow:auto;flex-shrink:0}
.mt-check-grid article>[data-check]{align-self:flex-start;flex-shrink:0}
.mt-records{height:180px;max-height:none;overflow:auto}
.mt-ai-bar .mt-analysis-rules{min-height:80px}
.mt-ai-bar .mt-analysis-rules details[open]{max-height:230px;overflow:auto;scrollbar-gutter:stable}
.sm-card .sm-style{height:160px;min-height:160px;overflow:auto}
.sm-card .sm-style small{font-size:12px}
.sm-preview-scroll{height:300px;max-height:none;overflow:auto}
.fw-step>.fw-grid>div>p{max-height:180px;overflow:auto;scrollbar-gutter:stable}
.fw-step>.fw-evidence{max-height:320px;overflow:auto;scrollbar-gutter:stable}
.fw-files{max-height:180px;overflow:auto}
.dynamic-action-result,.dynamic-event p,.employee-history-field p{max-height:180px;overflow:auto;font-size:14px;line-height:1.6}
.dynamic-timeline-list,.fw-editor #fw-file-list,.dr-team{max-height:var(--ui-list-height);overflow:auto;scrollbar-gutter:stable}
.wc-grid:not(.wc-week) .wc-day{height:260px;min-height:260px;max-height:260px}
.wc-week .wc-day{height:420px;min-height:420px;max-height:420px}
.wc-note-lines,.wc-company-notes ol{font-size:14px}
.wc-note-editor{height:260px;resize:vertical;max-height:50dvh}
.np-dialog,.mt-dialog,.wc-dialog,.wo-dialog,.fw-editor,.dynamic-report-modal,.modal.project-create-modal{max-height:88dvh;overflow:auto;scrollbar-gutter:stable;overscroll-behavior:contain;font-size:14px}
dialog.mt-dialog,dialog.wc-dialog,dialog.wo-dialog{height:min(660px,88dvh);box-sizing:border-box}
:is(.np-dialog,.mt-dialog,.wc-dialog,.wo-dialog,.fw-editor)>header{position:sticky;top:-24px;z-index:4;background:#fff;padding:8px 0}
:is(.np-dialog,.mt-dialog,.wc-dialog,.wo-dialog,.fw-editor) h2{font-size:20px;line-height:1.5}
.tracking-basics-dialog{height:min(650px,88dvh)}
.tracking-basics-dialog .tb-footer{position:sticky;bottom:-26px;background:white;padding-bottom:14px;z-index:3}
.tracking-basics-dialog .tb-header h2{font-size:20px}
.tracking-basics-dialog .tb-info{max-height:380px;overflow:auto}
.tracking-basics-dialog .tb-photo{flex-shrink:0}
.tw-inline-editor form{grid-template-rows:auto minmax(0,1fr) 56px}
.tw-inline-editor form>footer{min-height:56px;box-sizing:border-box}
#content :is(.dynamic-project-head,.countdown-detail-head,.profile-head) p{font-size:14px;color:var(--ui-muted);line-height:1.6}
#content :is(.employee-weekly-board,.employee-weekly-archive,.team-weekly-board,.fw-page,.dynamic-actions,.countdown-stage,.profile-card,.message-wall-page,.collaboration-work) :is(p,label,textarea){font-size:14px;line-height:1.6}
#content :is(.team-weekly-board,.employee-weekly-archive,.fw-page,.dynamic-actions,.countdown-stage,.profile-card) :is(small,time){font-size:12px;line-height:1.5}
.fw-notice,.fw-step>.fw-grid .fw-step-meta,.countdown-detail-description{max-height:180px;overflow:auto}
.dr-team article p{max-height:180px;overflow:auto;white-space:pre-wrap}
.employee-history-list{height:clamp(320px,60dvh,600px);overflow:auto}
.weekly-deadline{font-size:12px;line-height:1.6}
.np-page,.style-management-shell,.mt-workbench{overflow-anchor:none}
.dynamic-tag,.dynamic-state,.fw-step-meta,.fw-toggle-label,.fw-step-heading small,.fw-completion-note,.project-card-people span,.ah-project-meta,.eh-project-next,.meeting-card-meta,.meeting-agenda>b,.meeting-prep>b,.team-read-state,.employee-history-date,.employee-history-status{font-size:12px;line-height:1.5}
.team-member-copy small,.team-report-main small,.team-report-meta,.team-member-item i{font-size:12px}
.team-member-copy b,.team-report-main b{font-size:14px}
.dynamic-action h3,.employee-history-main b,.fw-step-heading strong{font-size:16px}
.dynamic-summary-grid b{font-size:14px}
.dynamic-summary-grid small,.countdown-submit-row small,.countdown-detail-head small{font-size:12px}
.profile-fields label,.profile-upload,.profile-fields input,.employee-weekly-field label{font-size:14px}
.wo-summary b,.wf2-summary b,.stat b{font-size:28px}
.wo-tag.good,.wf2-badge.done{color:#166534;background:#ecfdf5}
.wo-tag.bad{color:#b42318;background:#fff1f2}
.wo-tag.warn,.wf2-badge.attention{color:#92400e;background:#fffbeb}
body:has(#pendingCount) :is(.desc,.user,.action){font-size:14px}
body:has(#pendingCount) :is(.user small,.stat span,.panel-head span,.badge){font-size:12px}
body:has(#pendingCount) .users{max-height:65dvh;overflow:auto;scrollbar-gutter:stable}
:is(.admin-home-v2,.employee-home-v2) :is(.ah-welcome,.ah-quick,.ah-routine,.ah-calendar,.ah-message,.eh-welcome,.eh-daily,.eh-tasks,.eh-calendar,.eh-message){height:258px!important;min-height:258px!important;max-height:258px!important;min-width:0;overflow:auto;scrollbar-gutter:stable}
:is(.admin-home-v2,.employee-home-v2) #temporaryNoticeSlot{height:258px!important;min-height:0!important;max-height:258px!important}
:is(.admin-home-v2,.employee-home-v2) :is(.ah-welcome,.ah-quick,.ah-routine,.ah-calendar,.ah-message,.eh-welcome,.eh-daily,.eh-tasks,.eh-calendar,.eh-message) :is(p,small){font-size:12px;line-height:1.6}
.calendar-dual-grid{min-height:0;overflow:auto;scrollbar-gutter:stable}
.calendar-dual-grid :is(small,ol,li:before){font-size:12px}
.calendar-dual-grid li>span{white-space:normal;overflow-wrap:anywhere}
.ah-project-grid,.eh-project-grid{grid-auto-rows:340px}
:is(.ah-project,.eh-project):not(.countdown-home-card){overflow:auto;scrollbar-gutter:stable}
@media(max-width:800px){#content:has(>.workforce-tabs),#content:has(>.wo-own-entry){padding:24px 16px 60px}.workforce-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px}.workforce-tabs button{min-width:0;width:100%;padding:8px;font-size:13px}.workforce-tabs button span{display:none}#content :is(.weekly-head,.np-head,.mt-head){min-height:116px;align-items:flex-start}#content :is(.weekly-head,.np-head,.mt-head,.sm-head,.fw-page>header,.dynamic-project-head) h1{font-size:24px}.np-months{grid-template-columns:1fr}.np-month{height:400px;min-height:400px}.mt-check-grid article{height:620px}.wc-week .wc-day{height:300px;min-height:300px;max-height:300px}.tracking-basics-dialog .tb-info{max-height:250px}.tracking-basics-dialog{height:min(760px,88dvh)}.mt-table-scroll,.wo-scroll,.team-report-rows,.employee-history-rows{height:420px}:is(.admin-home-v2,.employee-home-v2) :is(.ah-welcome,.ah-quick,.ah-routine,.ah-calendar,.ah-message,.eh-welcome,.eh-daily,.eh-tasks,.eh-calendar,.eh-message){height:258px!important;min-height:258px!important}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}}
.top .user-greeting{min-width:0;max-width:min(300px,45vw);overflow:hidden}
.top .user-greeting>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.top .user-greeting .top-avatar{flex-shrink:0}
