:root{font-family:-apple-system,BlinkMacSystemFont,'PingFang TC','Noto Sans TC',sans-serif;color:#3f382c;background:#faf9f5;--ink:#3f382c;--line:#e5dfd2;--accent:#775214;--selected:#f5da85;--on-selected:#4a3514}*{box-sizing:border-box}body{margin:0}header{min-height:92px;display:flex;align-items:center;justify-content:space-between;padding:18px 30px;background:#fff0b8;border-bottom:1px solid var(--line)}header>div{display:flex;align-items:baseline;gap:20px;flex-wrap:wrap}.brand{font-size:28px;letter-spacing:4px}h1{font-size:22px;margin:0}h2{font-size:20px;margin:0 0 6px}h3{font-size:17px}a{color:var(--accent)}header span,.muted{color:#756449;font-size:13px}.test-banner{padding:10px 30px;background:#fff5da;color:#6c4b14;font-size:13px;line-height:1.6;border-bottom:1px solid #e8d9b5}main{max-width:1700px;margin:auto;padding:22px 28px}.toolbar,.filters{display:flex;align-items:end;gap:16px;flex-wrap:wrap}.toolbar-right{margin-left:auto;display:flex;gap:16px;align-items:center}label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600}input,select,textarea,button{font:inherit}input,select,textarea{min-height:42px;padding:9px 10px;border:1px solid #998b72;border-radius:5px;background:white;color:var(--ink)}button{min-height:42px;padding:9px 15px;border:1px solid #998b72;border-radius:5px;background:#fff;color:var(--ink);cursor:pointer;white-space:nowrap}button:hover{background:#fff4cf}button.primary{background:var(--selected);color:var(--on-selected);border-color:#b58a2e}button:disabled{opacity:.45;cursor:not-allowed}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #896111;outline-offset:3px}nav{display:flex;flex-wrap:wrap;gap:3px;margin:22px 0 18px;border-bottom:2px solid #e3c57b;padding-bottom:8px}nav button{border-color:transparent;background:transparent}nav button[aria-current=page]{background:var(--selected);color:var(--on-selected)}.filters{margin-bottom:18px}.search{margin-left:auto}.section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:18px 0 14px}.section-head p{margin:6px 0;color:#756449;font-size:13px;line-height:1.6}.actions{display:flex;gap:8px;flex-wrap:wrap}.table-wrap{overflow:auto;max-height:64vh;border:1px solid var(--line);border-radius:6px;background:#fff;overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin}table{border-collapse:separate;border-spacing:0;width:100%;font-size:14px;white-space:nowrap}th{background:#fff6dc;color:#59401a;text-align:left;z-index:1;font-size:13px}thead th{position:sticky;top:0;z-index:3}th,td{padding:10px 12px;border-bottom:1px solid #eee5d1;max-width:360px}tbody tr:last-child td{border-bottom:0}tbody tr:hover{background:#fff9e8}.name-col{position:sticky;left:0;background:#fff}.num{text-align:right;font-variant-numeric:tabular-nums}.empty{padding:55px 20px;text-align:center;background:#fff;border:1px solid var(--line);border-radius:6px;color:#756449}.status{display:inline-block;padding:4px 8px;border-radius:4px;font-size:12px;background:#f8f0dc;color:#665334}.status.pending,.status.failed,.status.stale{background:#fff0d6;color:#845214}.status.succeeded,.status.approved{background:#fff1bc;color:#6b4d16}#error{padding:14px;background:#ffebe8;color:#942e24;border:1px solid #efc9c3;border-radius:5px;margin:12px 0}footer{display:flex;align-items:center;justify-content:space-between;margin:16px 0;color:#756449;font-size:13px}footer button{margin-left:8px}details{margin:10px 0;font-size:13px;line-height:1.8}.rule-note{padding:12px 16px;background:#fff;border:1px solid var(--line)}summary{cursor:pointer;font-weight:600}.notice{padding:12px 16px;background:#fff7e6;border-left:3px solid #b88938;font-size:13px;line-height:1.8}.sync-line{display:flex;gap:12px;align-items:center;padding:9px 0;border-bottom:1px solid var(--line);font-size:13px}.progress{padding:10px;background:#fff0c2;margin-bottom:12px}dialog{width:min(820px,94vw);border:1px solid #c9b582;border-radius:9px;padding:26px;max-height:88vh;overflow:auto;color:var(--ink)}dialog::backdrop{background:#49371f66}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.form-grid .full{grid-column:1/-1}.form-grid input,.form-grid select{width:100%}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:24px}#dialog-error{color:#942e24}textarea{min-height:180px;width:100%;font-family:ui-monospace,monospace;font-size:12px}pre{white-space:pre-wrap;word-break:break-word;background:#faf4e6;padding:12px;max-height:260px;overflow:auto;font-size:12px}.pay-summary{display:flex;gap:28px;flex-wrap:wrap;padding:16px 0}.pay-summary strong{display:block;margin-top:5px;font-size:24px}.wide{min-width:900px}.rule-list li{margin:8px 0}.minor{font-size:12px}.check-label{flex-direction:row;align-items:center}.check-label input{width:18px;min-height:18px}.link-button{border:0;background:transparent;color:var(--accent);padding:0;min-height:32px;text-decoration:underline}.print-title{display:none}@media(max-width:720px){header{padding:16px;gap:12px}header>div{gap:8px}header span{width:100%}h1{font-size:18px}.brand{font-size:22px}.test-banner{padding:10px 16px}main{padding:16px 12px}.toolbar,.filters{gap:10px}.toolbar label,.filters label{flex:1;min-width:130px}.toolbar-right{margin-left:0;width:100%;justify-content:space-between}nav{flex-wrap:nowrap;overflow:auto;margin-top:18px;padding-bottom:10px}nav button{font-size:14px}.search{margin-left:0;flex-basis:100%!important}.section-head{align-items:start;flex-direction:column}.form-grid{grid-template-columns:1fr}.form-grid .full{grid-column:auto}.table-wrap{max-height:60vh}th,td{padding:11px}dialog{padding:18px}.pay-summary{gap:16px}footer{align-items:start;gap:8px}}@media print{body>header,.test-banner,main,.dialog-actions,#dialog-error{display:none}dialog{position:static;display:block;border:0;max-height:none;width:100%;padding:0}dialog::backdrop{display:none}.print-title{display:block}.notice{border:1px solid #aaa}.table-wrap{max-height:none;overflow:visible}}

.table-wrap:focus-visible{outline:3px solid #896111}table th:first-child,table td:first-child{position:sticky;left:0;background:#fff;z-index:1}table thead th:first-child{z-index:4;background:#fff6dc}table button{font-size:13px} [hidden]{display:none!important}

#auth-gate{max-width:480px;margin:40px auto;padding:24px;background:white;border:1px solid var(--line);border-radius:8px}#login-form{display:grid;gap:16px}#login-error{color:#942e24}.group-row th{position:static!important;background:#f8e9b9!important;border-bottom:1px solid #ddbd65;font-size:14px}.group-row:hover{background:#f8e9b9}
/* Calendar reference remains distinct from employee shifts and paid leave. */
.calendar-reference{border:1px solid #e3cf94;border-radius:6px;padding:12px;margin:12px 0;background:#fffaf0}
.calendar-reference summary{cursor:pointer;min-height:32px;font-weight:600;line-height:1.6}
.calendar-reference p{line-height:1.6}.calendar-reference a{color:#775214;text-decoration:underline}
.calendar-legend{font-size:13px;color:#756449;line-height:1.6}
.calendar-heading{display:block}.calendar-heading button{min-width:48px;min-height:48px;padding:6px;line-height:1.4;background:transparent;color:inherit;border-color:currentColor}
.calendar-heading small{display:block;font-size:12px;font-weight:500;white-space:nowrap}
.calendar-heading .calendar-holiday-name{display:block;width:5em;margin:5px auto 3px;font-size:13px;font-weight:600;white-space:normal;overflow-wrap:anywhere;line-height:1.5}
th.calendar-date{vertical-align:top;text-align:center}
td.calendar-date{text-align:center}
td.calendar-date button{background:transparent;color:inherit}
.calendar-date.calendar-saturday,.calendar-key.saturday{background:#edf3fa;color:#2c4d70}
.calendar-date.calendar-sunday,.calendar-key.sunday{background:#f6eff8;color:#654276}
.calendar-date.calendar-national,.calendar-key.national{background:#fff0ee;color:#792d24}
.calendar-date.calendar-substitute,.calendar-key.substitute{background:#fff8e6;color:#664d14}
.calendar-key{display:inline-block;padding:3px 8px;margin:0 6px 4px 0;border-radius:4px;font-weight:600}
.calendar-heading button:hover,td.calendar-date button:hover{box-shadow:inset 0 0 0 2px currentColor}
.calendar-heading button:focus-visible,.calendar-reference summary:focus-visible{outline:3px solid #896111;outline-offset:2px}

.clock-preview{width:min(1150px,96vw);background:#fffdf6}.clock-preview>label{margin:12px 0}.clock-preview .actions{align-items:center;margin:14px 0}.clock-preview .clock-notes{white-space:normal;min-width:180px}.clock-preview textarea:focus-visible{outline:3px solid #896111}.clock-preview button{min-height:44px}.clock-preview #clock-status{line-height:1.7}.clock-preview input[type=file]{max-width:100%;min-width:0}

.clock-calendar .clock-day{display:flex;flex-direction:column;gap:5px;min-width:105px;line-height:1.45;font-variant-numeric:tabular-nums}.clock-day strong{font-size:12px;color:#775214}.clock-day small{color:#756449}.clock-day.review{color:#8a3822}.clock-calendar td{vertical-align:top}.clock-applied{background:#fff8e6;font-weight:600}

.schedule-area-switch{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0 16px}.schedule-area-switch button{min-height:44px;min-width:132px;font-weight:600}.schedule-area-switch button[aria-pressed=true]{box-shadow:inset 0 -3px 0 #896111}
.plan-grid .plan-person{position:sticky;left:0;z-index:2;min-width:174px;background:#fff6dc;vertical-align:top}.plan-grid thead .plan-person{z-index:4}.plan-grid tbody .plan-person{top:auto}.plan-person>small{display:block;font-weight:400;font-size:12px;line-height:1.8;white-space:normal}.plan-person>button{margin-top:8px;padding:8px 10px}.plan-grid td{padding:6px;vertical-align:top}.plan-cell{display:flex;flex-direction:column;align-items:stretch;width:100%;min-width:136px;max-width:190px;padding:8px;text-align:left;white-space:normal;background:#ffffffc9;border-color:#dccfae;line-height:1.5}.plan-cell:hover{background:#fff4c9}.plan-layer,.actual-layer{display:flex;flex-direction:column;gap:5px;min-height:44px}.plan-layer>small,.actual-layer>small{font-size:11px;color:#756449}.plan-layer>span>small{display:block;font-size:11px}.actual-layer{border-top:1px dashed #c9b582;margin-top:6px;padding-top:6px;font-size:12px}.actual-layer .clock-day{display:flex;flex-direction:column;gap:3px}.actual-layer .clock-day small{font-size:11px}.compare-note{display:block;border-left:3px solid #b35f37;margin-top:8px;padding-left:5px;color:#8a3822;font-size:11px;line-height:1.5}.plan-time-group,.plan-leave-group{border:1px solid #dac89d;border-radius:5px;margin:16px 0;padding:12px;min-width:0}.plan-time-group[hidden],.plan-leave-group[hidden]{display:none}#week-copy-result{font-size:13px}@media(max-width:720px){.plan-grid .plan-person{min-width:133px;max-width:133px}.plan-cell{min-width:132px}.plan-grid th,.plan-grid td{padding:5px}.plan-time-group input,.plan-leave-group input{min-width:0}}
/* Keep the month grid compact; complete punch spans remain in attendance statistics. */
.plan-grid .actual-layer .clock-day>strong,.plan-grid .actual-layer .clock-day>small{display:none}.plan-grid .actual-layer{font-size:13px}.plan-grid .actual-layer .clock-day{gap:2px}.plan-source-details{margin:8px 0}

/* Bulk private scheduling: lightweight selection, no per-cell listeners. */
.plan-fill{display:block;min-height:32px;margin:4px 0 0 auto;padding:3px 8px;font-size:11px;cursor:ew-resize;user-select:none;touch-action:pan-y}.plan-selected{outline:3px solid #9b6314;outline-offset:-3px;background:#ffe7a3!important}.bulk-weekdays{display:flex;flex-wrap:wrap;gap:12px;margin:16px 0;border:1px solid #dac89d;padding:12px}.bulk-weekdays label{display:flex;align-items:center;gap:5px}.bulk-weekdays input{width:auto;min-height:auto}.bulk-date-list{max-height:220px;overflow:auto;font-size:13px}.bulk-date-list p{padding:6px;border-bottom:1px solid #ecdcb3}.plan-time-group input[type="time"]{min-width:0;width:100%}@media(max-width:720px){.plan-fill{min-height:44px;min-width:70px;cursor:pointer}.bulk-weekdays label{min-height:44px}}

.leave-shortcuts{border:1px solid #dac89d;border-radius:5px;padding:12px;margin:16px 0;min-width:0}.leave-shortcuts p{line-height:1.7;margin:8px 0}.leave-shortcuts button{min-height:44px}.plan-leave-group input[type="hidden"]{display:none}
@media(max-width:720px){.leave-shortcuts .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.leave-shortcuts .actions button{white-space:nowrap;padding:8px;font-size:14px}.leave-shortcuts .actions button:last-child{grid-column:1/-1}}

/* Salary brackets keep the established warm palette and a scrollable table. */
.insurance-preview .table-wrap{max-width:100%;margin-top:12px}
.insurance-preview table{min-width:1120px}
.insurance-preview td{vertical-align:top;min-width:110px}
.insurance-preview td:nth-child(2){min-width:190px;max-width:250px}
.insurance-preview td:last-child{min-width:240px;max-width:300px;white-space:normal}
.insurance-preview small{display:block;white-space:normal;line-height:1.5}
.insurance-preview li{white-space:normal;font-size:14px;line-height:1.6}
.insurance-preview ul{padding-left:18px;margin:8px 0}
.insurance-preview details p{white-space:normal;overflow-wrap:anywhere}
.insurance-preview summary,.insurance-premiums>summary{min-height:44px;padding:10px 4px;cursor:pointer}
.insurance-pending{white-space:normal;color:#794709}
.insurance-sources{margin:12px 0}

.audit-summary{padding:12px 16px;background:#fff0b8;border-radius:5px;line-height:1.8;font-size:14px}.audit-filters{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.audit-filters button{min-height:44px}.audit-table table{min-width:950px}.audit-table td{vertical-align:top}.audit-table small{display:block;font-size:13px;line-height:1.7}.audit-table .audit-findings{white-space:normal;min-width:190px;max-width:300px}.audit-label{display:block;line-height:1.7}.audit-issue{color:#8a3822}.audit-table td>button{display:block;margin:0 0 6px;min-height:44px}.audit-detail p,.audit-detail li,.audit-source-issues li{white-space:normal;overflow-wrap:anywhere;line-height:1.7}.audit-monthly>summary,.audit-source-issues>summary{min-height:44px;padding:8px 0}.audit-table:focus-visible{outline:3px solid #896111}

/* Bounded schedule pages and fixed column widths avoid all-cell intrinsic sizing. */
.plan-grid{--plan-person-width:174px;--plan-day-width:166px}
.plan-grid table{table-layout:fixed}
.plan-grid .plan-person{white-space:normal;overflow-wrap:anywhere}
.plan-grid .plan-cell{min-width:0;max-width:none}
.plan-grid th{white-space:normal;overflow-wrap:anywhere}
@media(max-width:600px){.plan-grid{--plan-person-width:133px;--plan-day-width:148px}}

.plan-grid .plan-name-column{width:var(--plan-person-width)}
.plan-grid .plan-date-column{width:var(--plan-day-width)}
.plan-days-28 table{width:calc(var(--plan-person-width) + 28 * var(--plan-day-width))}
.plan-days-29 table{width:calc(var(--plan-person-width) + 29 * var(--plan-day-width))}
.plan-days-30 table{width:calc(var(--plan-person-width) + 30 * var(--plan-day-width))}
.plan-days-31 table{width:calc(var(--plan-person-width) + 31 * var(--plan-day-width))}

.insurance-dependent-select{min-height:44px;min-width:174px;max-width:220px;}

/* One viewport and one primary vertical scroll area in the embedded workspace. */
.erp-embedded,.erp-embedded body{height:100%;overflow:hidden}
.erp-embedded body>header,.erp-embedded body>.test-banner,.erp-embedded #tabs{display:none}
.erp-embedded main{height:100%;max-width:none;padding:0 20px;display:flex;flex-direction:column;min-height:0;overflow:hidden}
.erp-embedded .toolbar{flex:none;padding:10px 0;border-top:1px solid var(--line);gap:10px;align-items:center}
.erp-embedded .toolbar>label{flex-direction:row;align-items:center;gap:8px}.erp-embedded .toolbar>label:has(#store){display:none}
.erp-embedded .toolbar-right{gap:10px;position:relative;font-size:12px;flex-wrap:wrap;justify-content:flex-end}
.erp-embedded .toolbar input,.erp-embedded .toolbar button{min-height:38px;font-size:13px;padding:7px 10px}
.erp-embedded .filters{flex:none;gap:12px;margin:0 0 10px;align-items:center}.erp-embedded .filters label{flex-direction:row;align-items:center;font-size:12px;gap:6px}
.erp-embedded .filters select,.erp-embedded .filters input{min-height:36px;padding:7px 9px;font-size:13px;max-width:180px;min-width:0}
.erp-embedded #content{flex:1;min-height:0;overflow:auto;padding:0 2px 2px;scrollbar-width:thin}
.erp-embedded #content .table-wrap{max-height:none}
/* Table views scroll within the table, keeping their controls and column headings visible. */
.erp-embedded #content:has(>.table-wrap),.erp-embedded #content:has(>.attendance-days),.erp-embedded #content:has(>.insurance-preview .table-wrap){display:flex;flex-direction:column;overflow:hidden}
.erp-embedded #content>*{flex-shrink:0}
.erp-embedded #content>.table-wrap,.erp-embedded #content>.attendance-days,.erp-embedded #content>.insurance-preview:has(.table-wrap){flex:1;min-height:0;overflow:auto}
.erp-embedded #content>.attendance-days,.erp-embedded #content>.insurance-preview:has(.table-wrap){display:flex;flex-direction:column;overflow:hidden}
.erp-embedded .attendance-days>.table-wrap,.erp-embedded .insurance-preview>.table-wrap{flex:1;min-height:0;margin-top:6px}
.erp-embedded #content>details{margin:3px 0 7px;padding:0;border:0;background:transparent;max-height:190px;overflow:auto}
.erp-embedded #content>details>summary{font-size:12px;color:#6c6354;min-height:26px;padding:3px 0}
.erp-embedded #content>details[open]{padding:8px 10px;border:1px solid var(--line);background:#fff}
.erp-embedded .section-head{flex:none;align-items:center;margin:2px 0 8px;gap:10px}.erp-embedded .section-head h2{display:none}.erp-embedded .section-head p{font-size:12px;margin:0;line-height:1.5}
.erp-embedded .section-head button{font-size:12px;min-height:36px;padding:6px 10px}.erp-embedded .section-head .actions{flex-wrap:nowrap}
.erp-embedded .schedule-area-switch{margin:0 0 6px;gap:6px}.erp-embedded .schedule-area-switch button{min-height:38px;min-width:108px;font-size:14px;padding:6px 12px}.schedule-area-switch button[aria-pressed=true]{box-shadow:none;border-color:#85601a}
.erp-embedded #content>.notice,.erp-embedded .audit-summary{padding:8px 10px;margin:4px 0 8px;font-size:12px;line-height:1.6}
.erp-embedded .audit-filters{flex-wrap:nowrap;overflow:auto;gap:6px;margin:4px 0 7px;flex-shrink:0}.erp-embedded .audit-filters button{min-height:36px;padding:6px 9px;font-size:12px}
.erp-embedded footer{flex:none;margin:0;padding:7px 0;font-size:12px;min-height:44px}.erp-embedded footer button{min-height:32px;padding:5px 9px;font-size:12px}
.erp-embedded .rule-note{flex:none;margin:0;padding:4px 0;border:0;background:transparent;max-height:160px;overflow:auto;font-size:11px}.erp-embedded .rule-note summary{min-height:26px;color:#6c6354}
.erp-embedded #content>.minor{font-size:11px;margin:4px 0 7px;line-height:1.5}.erp-embedded .insurance-preview>h2{font-size:16px;margin:2px 0 3px}
.erp-embedded .insurance-preview>.view-guide{margin:0;flex:none}.erp-embedded .insurance-preview>.view-guide[open]{max-height:170px;overflow:auto}
.erp-embedded .insurance-preview>.view-guide>summary{min-height:30px;padding:3px 0;font-size:12px}
.release-label{margin:0;padding:4px 8px;background:#fff8e1;border:1px solid #d6c397;border-radius:4px;color:#65532f;font-size:12px;white-space:nowrap;font-weight:400}
.workspace-recovery{margin:0;font-size:12px;position:relative}.workspace-recovery>summary{min-height:38px;padding:9px 10px;border:1px solid #998b72;border-radius:5px;background:#fff}
.workspace-recovery[open]{position:absolute;right:0;top:0;width:min(440px,calc(100vw - 32px));z-index:8;background:#fff;padding:12px;border:1px solid var(--line);border-radius:6px;box-shadow:0 6px 20px #3f382c20}
.workspace-recovery[open]>summary{border:0;padding:0 0 6px;min-height:30px}.workspace-recovery p{white-space:normal;line-height:1.7}.workspace-recovery button{margin:4px 6px 0 0}
/* Dialog content scrolls; action buttons stay visible. */
#dialog{padding:22px;overflow:hidden;max-height:90dvh}
#dialog #detail-form{display:flex;flex-direction:column;max-height:calc(90dvh - 46px);min-height:0}
#dialog #dialog-content{overflow:auto;min-height:0;padding:2px 4px;scrollbar-width:thin;scrollbar-gutter:stable}
#dialog .dialog-actions{flex-shrink:0;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
#dialog #dialog-error{flex-shrink:0;margin:6px 0 0}#dialog .table-wrap,#dialog .bulk-date-list{max-height:none}
#dialog .notice{padding:10px 12px;line-height:1.6}#dialog .dialog-actions button{min-height:44px}
@media(max-width:720px){
 .erp-embedded main{padding:0 10px}.erp-embedded .toolbar{padding:8px 0;gap:6px;align-items:start}
 .erp-embedded .toolbar>label{flex:none;min-width:0;font-size:12px;flex-direction:column;align-items:start;gap:3px}
 .erp-embedded .toolbar-right{width:auto;flex:1;gap:6px;margin-left:auto;align-items:end}
 .erp-embedded #live-state{display:none}.erp-embedded #save-state{font-size:11px;width:100%;text-align:right;line-height:1.4}
 .erp-embedded .toolbar input{max-width:142px;min-height:40px}.erp-embedded .toolbar button,.workspace-recovery>summary{min-height:40px;padding:8px}
 .erp-embedded .filters{display:flex;gap:8px;margin-bottom:7px;align-items:end}.erp-embedded .filters label{flex:1;flex-direction:column;align-items:stretch;min-width:0;gap:3px;font-size:11px}
 .erp-embedded .filters select,.erp-embedded .filters input{width:100%;max-width:none;min-height:40px;font-size:12px;padding:6px}
 .erp-embedded .filters .search{flex-basis:0!important;min-width:80px}
 .erp-embedded .section-head{flex-direction:column;align-items:stretch;gap:5px}.erp-embedded .section-head .actions{flex-wrap:wrap}.erp-embedded .section-head button{min-height:40px}
 .erp-embedded .schedule-area-switch button{min-height:40px}.erp-embedded #content>details>summary{min-height:30px}
 .erp-embedded footer{font-size:11px;align-items:center;gap:5px}.erp-embedded footer button{margin-left:4px;min-height:40px;white-space:nowrap}.erp-embedded footer>div{display:flex;flex-shrink:0}
 .erp-embedded .rule-note{font-size:11px}.erp-embedded #content>.table-wrap,.erp-embedded #content>.attendance-days,.erp-embedded #content>.insurance-preview:has(.table-wrap){min-height:100px}
 #dialog{padding:14px;width:96vw}#dialog #detail-form{max-height:calc(90dvh - 30px)}.release-label{font-size:11px}
}
@media(max-height:480px){.erp-embedded main{overflow:auto;display:block}.erp-embedded .filters{margin-bottom:4px}.erp-embedded #content{overflow:visible!important;display:block!important;min-height:0}.erp-embedded #content>.table-wrap{height:50vh;min-height:160px;max-height:none}.erp-embedded .toolbar{padding:4px 0}}
@media print{#dialog{overflow:visible;max-height:none}#dialog #detail-form,#dialog #dialog-content{display:block;overflow:visible;max-height:none}.erp-embedded main{display:none}.release-label{display:none}}

.plan-time-group select{min-width:0;width:100%;font-variant-numeric:tabular-nums}
.dialog-actions{flex-wrap:wrap}.plan-save-bulk{margin-right:auto}
@media(max-width:720px){.release-label{padding:8px 12px;font-size:12px}.plan-save-bulk{width:100%;margin:0}.dialog-actions{gap:8px}.plan-fill{font-size:12px}}

.source-formula{display:block;white-space:pre-wrap;overflow-wrap:anywhere;max-width:36rem;font-size:.8rem}.payroll-reconciliation{padding:1rem;border:1px solid var(--line,#dfcc91);border-radius:.6rem;margin:1rem 0;background:var(--surface,#fffdf6)}

/* Calendar tools occupy two compact rows; the table receives remaining height. */
.erp-embedded #content[data-module="schedule"]:has(>.plan-grid){display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto minmax(140px,1fr);gap:6px 14px}
.erp-embedded #content[data-module="schedule"]>.schedule-area-switch{grid-column:1;grid-row:1;margin:0}
.erp-embedded #content[data-module="schedule"]>.plan-source-details{grid-column:2;grid-row:1;align-self:center;margin:0;max-width:340px}
.erp-embedded #content[data-module="schedule"]>.section-head{grid-column:1;grid-row:2;margin:0;align-items:center;flex-wrap:wrap}
.erp-embedded #content[data-module="schedule"]>.view-guide{grid-column:2;grid-row:2;align-self:center;margin:0;max-width:340px}
.erp-embedded #content[data-module="schedule"]>.plan-grid{grid-column:1/-1;grid-row:3;min-height:0;max-height:none}
.plan-grid thead th{padding:7px 8px}.plan-grid .calendar-heading button{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:baseline;gap:4px;padding:4px;min-height:36px;border:0;font-size:14px}
.plan-grid .calendar-heading small{font-size:11px}.plan-grid .calendar-heading .calendar-holiday-name{width:auto;max-width:100%;flex-basis:100%;margin:2px 0;font-size:11px;line-height:1.4}
.plan-grid .plan-layer>small,.plan-grid .actual-layer>small{color:#6b604e}.plan-grid .plan-person{background:#fffaf0}
@media(max-width:720px){
.erp-embedded .toolbar-right{display:grid;grid-template-columns:auto auto auto;align-items:start}
.erp-embedded #save-state{grid-row:2;grid-column:1/-1;max-width:230px}
.erp-embedded .workspace-recovery{grid-column:3;grid-row:1}
.erp-embedded #content[data-module="schedule"]:has(>.plan-grid){grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto minmax(120px,1fr);gap:4px}
.erp-embedded #content[data-module="schedule"]>.schedule-area-switch{grid-column:1;grid-row:1}
.erp-embedded #content[data-module="schedule"]>.plan-source-details{grid-column:1;grid-row:2;max-width:none}
.erp-embedded #content[data-module="schedule"]>.section-head{grid-column:1;grid-row:3;flex-direction:row;flex-wrap:wrap}
.erp-embedded #content[data-module="schedule"]>.section-head p{display:none}
.erp-embedded #content[data-module="schedule"]>.view-guide{grid-column:1;grid-row:5;max-width:none;font-size:11px}
.erp-embedded #content[data-module="schedule"]>.plan-grid{grid-column:1;grid-row:4}
}

@media(min-width:721px){
.erp-embedded #content[data-module="payroll"]:has(>.table-wrap){display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto auto minmax(120px,1fr);gap:6px 14px}
.erp-embedded #content[data-module="payroll"]>.section-head{grid-column:1;grid-row:1;flex-wrap:wrap;margin:0}
.erp-embedded #content[data-module="payroll"]>.plan-source-details{grid-column:2;grid-row:1;margin:0;align-self:center;max-width:340px}
.erp-embedded #content[data-module="payroll"]>.payroll-cost-summary{grid-column:1;grid-row:2;margin:0}
.erp-embedded #content[data-module="payroll"]>.payroll-reconciliation{grid-column:2;grid-row:2;margin:0;max-width:340px}
.erp-embedded #content[data-module="payroll"]>.notice{grid-column:1/-1;grid-row:3;margin:0}
.erp-embedded #content[data-module="payroll"]>.table-wrap{grid-column:1/-1;grid-row:4;min-height:0}
}
