/* Manual KW only. Horizontal categories leave the full page for sheets. */
body.portal-active .kw-category-bar,body.portal-active .kw-area-tabs{display:flex;gap:6px;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;padding:4px 0 9px;white-space:nowrap}
body.portal-active .kw-category-bar{border-bottom:1px solid #dedede;margin-bottom:7px}
body.portal-active .kw-category-bar button,body.portal-active .kw-area-tabs button{flex:0 0 auto;min-height:38px;font-size:13px;padding:9px 14px;border-radius:7px;border:1px solid #dedede;background:#fff;color:#001e46}
body.portal-active .kw-category-bar button[aria-pressed=true]{background:#001e46;color:#fff;border-color:#001e46;font-weight:700}
body.portal-active .kw-area-tabs button{border:0;border-bottom:3px solid transparent;border-radius:0;background:transparent}
body.portal-active .kw-area-tabs button[aria-pressed=true]{border-bottom-color:#168153;color:#11683f;font-weight:700}
body.portal-active .kw-category-bar button:focus-visible,body.portal-active .kw-area-tabs button:focus-visible{outline:2px solid #a9640b;outline-offset:2px}
body.portal-active .kw-module>.p-heading{display:block;min-width:0}
body.portal-active .kw-module .p-heading h1{margin:12px 0 4px}
body.portal-active .kw-dialog{width:min(920px,calc(100vw - 28px));max-width:calc(100vw - 28px);max-height:90vh;overflow:auto;border:1px solid #c8c8c8;border-radius:14px;padding:25px;background:#fff;color:#001e46;box-shadow:0 20px 65px #001e4640}
body.portal-active .kw-dialog::backdrop{background:#001e4670}
body.portal-active .kw-dialog .p-error:empty{display:none}
body.portal-active .kw-form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:22px 0}
body.portal-active .kw-form-grid label{font-weight:600;line-height:1.5}
body.portal-active .kw-form-grid small{font-weight:400}
body.portal-active .kw-detail-grid{display:grid;grid-template-columns:minmax(150px,.8fr) minmax(0,2fr);margin:20px 0}
body.portal-active .kw-detail-grid dt,body.portal-active .kw-detail-grid dd{padding:10px;margin:0;border-bottom:1px solid #e4e4e4;overflow-wrap:anywhere;font-size:13px}
body.portal-active .kw-detail-grid dt{background:#f5f5f5;font-weight:600}
body.portal-active .kw-history-note{border-left:4px solid #a9640b;background:#fff5e4;padding:12px}
body.portal-active .kw-revealed{background:#fff5e4;padding:12px;border:1px solid #d6bd95;overflow-wrap:anywhere}
body.portal-active .kw-table{max-height:65vh;border-radius:10px;background:#fff;border:1px solid #dedede}
body.portal-active .kw-table td,body.portal-active .kw-table th{min-width:140px;max-width:360px;overflow-wrap:anywhere}
body.portal-active .kw-table thead{position:sticky;top:0;z-index:1;background:#f3f3f3}
body.portal-active .kw-columns{background:#fff;border:1px solid #dedede;padding:12px 16px;border-radius:8px;margin:12px 0}
body.portal-active .kw-columns summary{cursor:pointer;font-weight:600;font-size:13px}
body.portal-active .kw-columns>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding-top:15px}
body.portal-active .kw-columns label{flex-direction:row;align-items:center;gap:8px;overflow-wrap:anywhere}
body.portal-active .kw-module[aria-busy=true] .kw-table{opacity:.7}
body.portal-active .kw-access-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:16px 0}
body.portal-active .kw-access-grid fieldset{border:1px solid #dedede;border-radius:8px;padding:14px;min-width:0}
body.portal-active .kw-access-grid legend{font-weight:600;font-size:13px;padding:0 6px}
body.portal-active .kw-access-grid label{flex-direction:row;gap:9px;align-items:center;margin:10px 0}
body.portal-active .kw-dialog [hidden]{display:none!important}
body.portal-active .kw-week-view{max-width:100%;background:#fff;border:1px solid #c9c9c9;border-radius:10px;overflow:visible}
body.portal-active .kw-week-top{position:sticky;top:0;z-index:8;background:#fff;border-bottom:1px solid #d9e1ea;padding:8px 10px;border-radius:10px 10px 0 0}
body.portal-active .kw-week-title{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:3px 2px}
body.portal-active .kw-fullscreen-close{display:none}
body.portal-active .kw-native-scroll{max-width:100%;overflow-x:auto;overflow-y:visible;overscroll-behavior-x:contain;background:#fff}
body.portal-active .kw-native-grid{table-layout:fixed;border-collapse:collapse;font-size:12px;margin:0}
body.portal-active .kw-native-grid col:first-child{width:42px}
body.portal-active .kw-native-grid td,body.portal-active .kw-native-grid th{border:1px solid #dedede;padding:0;min-width:0;text-align:left;vertical-align:middle;overflow:hidden}
body.portal-active .kw-native-grid thead{position:sticky;top:116px;z-index:4;background:#f0f0f0;pointer-events:none}
body.portal-active .kw-native-grid th{padding:5px;text-align:center;font-weight:600;background:#f0f0f0}
body.portal-active .kw-native-grid tbody th{position:sticky;left:0;z-index:1}
body.portal-active .kw-native-grid .kw-source-hidden-row{display:none}
body.portal-active .kw-cell-button{display:block;width:100%;height:100%;min-height:20px;border:0;border-radius:0;padding:4px 6px;margin:0;text-align:left;background:transparent;color:#001e46;font-size:12px;line-height:1.35;overflow-wrap:anywhere;white-space:pre-wrap}
body.portal-active .kw-cell-button:disabled{opacity:1;cursor:default;color:#001e46}
/* Source cells retain their Excel formatting. Portal navigation must not recolor them. */
body.portal-active .kw-native-grid .kw-source-header,body.portal-active .kw-native-grid td.kw-day-title{position:static}
body.portal-active .kw-native-grid .kw-unlinked{box-shadow:inset 3px 0 #a9640b}
body.portal-active .kw-native-grid .kw-cell-match{background:#ffebbd;outline:2px solid #a9640b;outline-offset:-2px}
body.portal-active .kw-grid-days{display:flex;gap:6px;max-width:100%;overflow:auto;padding:8px 0;margin:4px 0;white-space:nowrap}
body.portal-active .kw-grid-days button{flex:0 0 auto;font-size:12px}
body.portal-active .kw-week-search{margin:4px 0 0}
body.portal-active .kw-week-view:fullscreen{width:100vw;height:100vh;max-width:none;border:0;border-radius:0;overflow:hidden;background:#fff;padding:0}
body.portal-active .kw-week-view:fullscreen .kw-fullscreen-close{display:inline-flex}
body.portal-active .kw-week-view:fullscreen .kw-week-top{position:relative;border-radius:0}
body.portal-active .kw-week-view:fullscreen .kw-native-scroll{height:calc(100vh - 124px);overflow:auto}
body.portal-active .kw-week-view:fullscreen .kw-native-grid thead{top:0}
@media(max-width:700px){body.portal-active .kw-week-top{position:relative}body.portal-active .kw-native-grid thead{top:0}.kw-week-title{align-items:flex-start;flex-direction:column}}
body.portal-active .kw-grid-dialog form>label{margin:12px 0}
@media(max-width:700px){body.portal-active .kw-form-grid,body.portal-active .kw-columns>div{grid-template-columns:1fr}body.portal-active .kw-dialog{padding:16px}body.portal-active .kw-detail-grid{grid-template-columns:minmax(100px,.8fr) minmax(0,1fr)}}
@media(max-width:600px){body.portal-active .kw-access-grid{grid-template-columns:1fr}}
.kw-sheet-native{max-height:66vh;overflow:auto}.kw-sheet-native table{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%}.kw-sheet-native th{position:sticky;top:0;background:#fff;z-index:2}.kw-sheet-native tbody th{left:0;z-index:1}.kw-sheet-native td{padding:0!important;min-width:105px;max-width:260px;border:1px solid #ddd}.kw-sheet-native td button{display:block;width:100%;min-height:34px;text-align:left;background:transparent;border:0;border-radius:0;white-space:pre-wrap;color:inherit;font-weight:400}.kw-sheet-native .kw-cell-formula::before{content:"ƒ ";color:#666}.kw-sheet-native .kw-cell-error{background:#fff0ef;color:#a5251b}.kw-sheet-native .kw-cell-review{box-shadow:inset 3px 0 #b97400}.kw-sheet-dialog textarea{width:100%;min-height:90px}.kw-sheet-dialog form{display:grid;gap:12px}.kw-sheet-dialog label{display:grid;gap:5px}
body.portal-active .kw-sheet-native table{table-layout:fixed;border-collapse:collapse}
body.portal-active .kw-sheet-native td button{font:inherit;text-align:inherit;line-height:1.3;height:100%;min-height:26px}
body.portal-active .kw-sheet-native td{min-width:0;max-width:none;overflow-wrap:anywhere}
.kw-sheet-dialog details>div{display:grid;gap:12px;margin-top:12px}
/* Readable KW records and supplementary sheets. Never recolor .kw-native-grid (Grafik). */
body.portal-active #module-kw .p-table-wrap table,body.portal-active .kw-dialog .p-table-wrap table{color:#172b4d;background:#fff;font-size:14px;line-height:1.5}
body.portal-active #module-kw .p-table-wrap th,body.portal-active .kw-dialog .p-table-wrap th{color:#fff;background:#001e46;border-color:#41516a;font-size:13px}
body.portal-active #module-kw .p-table-wrap td,body.portal-active .kw-dialog .p-table-wrap td{color:#172b4d;background:#fff;border-color:#d3d9e0}
body.portal-active #module-kw .p-table-wrap tbody tr:nth-child(even) td{background:#f3f5f7}
body.portal-active #module-kw .p-table-wrap tbody tr:hover td{background:#e9edf1}
body.portal-active #module-kw .p-table-wrap th button{color:#fff;background:#001e46}
body.portal-active #module-kw .kw-sheet-native td button,body.portal-active #module-kw .kw-table-cell-button{color:inherit;background:transparent;opacity:1;font-size:14px;font-style:normal;font-weight:400;line-height:1.5;min-height:36px}
body.portal-active #module-kw .kw-table-cell-button{display:block;text-align:left;width:100%;border:0;border-radius:0;padding:8px;white-space:pre-wrap}
body.portal-active #module-kw .kw-sheet-native .kw-cell-error{background:#fff0ed;color:#92251c}
body.portal-active #module-kw .kw-sheet-native .kw-cell-formula::before{color:#41516a}
body.portal-active #module-kw .kw-sheet-native button:focus-visible,body.portal-active #module-kw .kw-table-cell-button:focus-visible{outline:3px solid #a9640b;outline-offset:-3px}
body.portal-active .kw-edit-notice{color:#172b4d;background:#f3f5f7;border-left:4px solid #168153;padding:12px 16px;line-height:1.5}
body.portal-active .kw-dialog label,body.portal-active .kw-dialog input,body.portal-active .kw-dialog select,body.portal-active .kw-dialog textarea{color:#172b4d}
body.portal-active .kw-dialog input,body.portal-active .kw-dialog select,body.portal-active .kw-dialog textarea{background:#fff;border:1px solid #8794a5}
/* Working record panel. All authorized source fields remain available. */
body.portal-active .kw-record-drawer{position:fixed;inset:0 0 0 auto;margin:0;width:min(620px,100vw);height:100dvh;max-height:100dvh;max-width:100vw;border-radius:0;border-width:0 0 0 1px;padding:24px;box-sizing:border-box;box-shadow:-12px 0 40px #001e4620}
body.portal-active .kw-record-drawer::backdrop{background:#001e4618}
body.portal-active .kw-record-drawer .kw-form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
body.portal-active .kw-record-drawer form>.p-toolbar{position:sticky;bottom:-24px;padding:16px 0;margin-bottom:-24px;background:#fff;border-top:1px solid #d3d9e0;z-index:2}
body.portal-active .kw-record-drawer h2{font-size:21px;line-height:1.3}
body.portal-active .kw-record-drawer input{min-height:40px}
@media(max-width:480px){body.portal-active .kw-record-drawer .kw-form-grid{grid-template-columns:1fr}body.portal-active .kw-record-drawer{padding:16px}}
/* Weekly web layout. Original cells remain accessible in the source view. */
.kw-week-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;align-items:start}
.kw-week-cards[hidden],.kw-week-cards [hidden],.kw-native-scroll[hidden],.kw-grid-days[hidden]{display:none!important}
.kw-day-card{min-width:0;border:1px solid #537382;border-radius:5px;overflow:hidden;background:#fff}
.kw-day-card h3{margin:0;padding:9px 12px;background:#bfe5ef;color:#00264a;font-size:16px;font-weight:700}
.kw-day-scroll{overflow-x:auto;max-width:100%}
.kw-day-card table{width:100%;min-width:350px;border-collapse:collapse;table-layout:fixed;margin:0}
.kw-day-card td{border:1px solid #637780;padding:0;overflow-wrap:anywhere;vertical-align:middle}
.kw-day-card .kw-cell-button{width:100%;min-height:30px;white-space:normal;padding:4px 5px;font-size:12px!important;line-height:1.3}
.kw-day-card .kw-cell-button:disabled{opacity:1}
.kw-week-modes button[aria-pressed="true"]{background:#05244c;color:#fff;border-color:#05244c}
@media(max-width:1000px){.kw-week-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.kw-week-cards{grid-template-columns:minmax(0,1fr)}}
.kw-route-layout{max-height:none;background:#fff}
.kw-route-layout:fullscreen{max-height:100vh;padding:16px;box-sizing:border-box;overflow:auto}
.kw-route-blocks{display:grid;gap:20px}.kw-route-blocks table{width:100%;table-layout:fixed;border-collapse:collapse}
.kw-route-blocks td{overflow-wrap:anywhere;padding:0!important}.kw-route-blocks td button{background:transparent!important;border:0;width:100%;text-align:inherit;white-space:pre-wrap;border-radius:0}
.kw-route-blocks .p-table-wrap{max-height:none}.kw-route-blocks:fullscreen{padding:16px;background:#fff;overflow:auto;display:block}.kw-route-blocks:fullscreen>.p-table-wrap{margin-bottom:20px}
.kw-route-all>summary{padding:14px;cursor:pointer;color:#001e46}
@media(max-width:650px){.kw-route-blocks table{min-width:900px}}
body.portal-active #module-kw .kw-route-layout td button{font-style:inherit;font-weight:inherit;color:inherit;line-height:1.25;min-height:24px;font-size:13px;padding:2px 4px}
.kw-download-status{position:fixed;right:18px;bottom:18px;z-index:1000;background:#fff;border:1px solid #b5c0c9;box-shadow:0 5px 25px #001e4630;max-width:min(480px,calc(100vw - 36px));padding:16px;color:#001e46;border-radius:8px}
.kw-row-editor{width:min(720px,100vw);max-width:100vw;max-height:100vh}
.kw-row-editor form{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
.kw-row-editor form>.p-error,.kw-row-editor form>.kw-history-note{grid-column:1/-1}
.kw-row-field{display:grid;grid-template-columns:minmax(0,1fr) 95px;gap:8px}
.kw-sheet-filtered td.kw-number button{text-align:right!important;font-variant-numeric:tabular-nums}
.kw-sheet-filtered th:first-child,.kw-sheet-filtered td:first-child{position:sticky;left:0;z-index:2}
.kw-sheet-filtered th:nth-child(2),.kw-sheet-filtered td:nth-child(2){min-width:180px}
@media(max-width:650px){.kw-row-editor form{grid-template-columns:1fr}.kw-row-editor{margin:0;border-radius:0}}
/* KB: complete employee card and inline seven-day schedule. */
body.portal-active .kw-card-section-title{grid-column:1/-1;margin:10px 0 0;padding-bottom:8px;border-bottom:1px solid #d3d9e0;font-size:16px;color:#001e46}
body.portal-active .kw-employment-section{grid-column:1/-1;border-top:1px solid #d3d9e0;padding-top:14px}
body.portal-active .kw-employment-section summary{font-weight:600;cursor:pointer}
body.portal-active .kw-employment-section .kw-form-grid{margin:12px 0}
body.portal-active .kw-staff-tabs{margin:4px 0 12px}
body.portal-active .kw-inline-tools{padding:10px 12px;margin:0;border-bottom:1px solid #d3d9e0;background:#f3f5f7;position:sticky;top:114px;z-index:6}
body.portal-active .kw-inline-message{margin:0;padding:0 12px;color:#92300a;font-size:13px}
body.portal-active .kw-inline-message:empty{display:none}
body.portal-active .kw-inline-message:not(:empty){padding-top:8px;padding-bottom:8px;background:#fff6e8}
body.portal-active .kw-inline-add{flex-basis:100%;margin:8px 0}
body.portal-active .kw-day-card .kw-inline-td{background:#fff!important;color:#172b4d!important;border-color:#d3d9e0!important;font-size:13px!important;font-style:normal!important;min-width:0}
body.portal-active .kw-day-card .kw-web-heading{background:#001e46!important;color:#fff!important;border-color:#41516a!important}
body.portal-active .kw-day-card .kw-web-heading .kw-cell-button{color:#fff!important;font-weight:600!important;min-height:36px}
body.portal-active .kw-day-card .kw-inline-cell{display:block;width:100%;max-width:100%;min-width:0;box-sizing:border-box;margin:0;border:1px solid transparent;border-radius:0;background:transparent;color:#172b4d;padding:7px 4px;min-height:36px;font:13px/1.35 Arial,sans-serif}
body.portal-active .kw-day-card .kw-inline-cell:focus{outline:2px solid #168153;outline-offset:-2px;background:#f0faf4}
body.portal-active .kw-day-card .kw-inline-cell:disabled{opacity:1;color:#5b6778;background:#f3f5f7}
body.portal-active .kw-day-card .kw-inline-person{background:#f0f5f9}
body.portal-active .kw-day-card h3{background:#e7eff7;color:#001e46;border-bottom:3px solid #168153}
body.portal-active .kw-week-view:fullscreen .kw-week-cards{height:calc(100vh - 200px);overflow:auto;padding:12px;box-sizing:border-box}
@media(max-width:700px){body.portal-active .kw-inline-tools{position:relative;top:0}}
body.portal-active .kw-screen-notes-tools:not([hidden]){display:flex;gap:8px;justify-content:flex-end;padding:8px 14px;background:#edf4f8;border-bottom:1px solid #d3dee8}
body.portal-active .kw-screen-notes-tools button{background:#fff;border:1px solid #ccd5df;border-radius:6px;color:#001e46;padding:8px 12px;cursor:pointer}
body.portal-active .kw-record-drawer textarea{width:100%;min-height:100px;box-sizing:border-box;resize:vertical}
