/* Employee check-in and attendance management share records, with separate entry layouts. */
.attendance-personal-page #attForm {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-width:900px;margin:12px 0}
.attendance-personal-page #attForm .attendance-submit-state {grid-column:1/-1;margin:0}
.attendance-personal-page #attForm .attendance-submit-state:empty {display:none}
.attendance-personal-page .attendance-mobile-actions {grid-column:1/-1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.attendance-personal-page .attendance-mobile-action {display:grid;gap:4px;min-height:64px;padding:10px;border:1px solid #d5e1ef;border-radius:6px;background:#f7f9fc;color:#23466c;text-align:left}
.attendance-personal-page .attendance-mobile-action small {color:#637991;font-weight:400}
.attendance-personal-page .attendance-mobile-action.selected {border-color:#175fc6;background:#edf4ff;box-shadow:inset 0 0 0 1px #175fc6}
.attendance-personal-page #attForm .attendance-project-wrap {grid-column:1/-1;display:grid;gap:6px}
.attendance-personal-page #attForm .attendance-project-wrap.hidden {display:none}
.attendance-personal-page #attForm .attendance-photo-picker {grid-column:1/-1;display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0}
.attendance-personal-page #attForm .attendance-photo-picker input {flex:1;min-width:160px}
.attendance-personal-page #attForm > input {min-width:0}
.attendance-personal-page #attForm > button[type=submit] {grid-column:1/-1;justify-self:end;min-width:160px;width:auto}
.attendance-personal-page .attendance-personal-summary {display:flex;gap:10px 24px;align-items:center;flex-wrap:wrap;padding:10px 12px;border:1px solid #dce5ef;border-radius:6px;background:#f7f9fc;font-size:13px}
.attendance-personal-page .attendance-personal-summary strong {margin-left:5px;color:#175fc6;font-size:18px}
.attendance-personal-page .attendance-photo-preview:empty {display:none}
.attendance-personal-page :is(.attendance-photo-state,.attendance-geo-note,.attendance-site-note) {margin:8px 0;font-size:12px}
.attendance-personal-page .attendance-filter-strip {grid-template-columns:repeat(2,minmax(130px,1fr)) repeat(2,minmax(100px,1fr)) repeat(3,auto)}
.attendance-personal-header{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px}
.attendance-personal-header h3{margin:0}
.attendance-personal-header #attendanceRecordsOpen{margin-left:auto;width:auto;flex:none}
.attendance-today-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:8px 0}
.attendance-today-item{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:5px 12px;padding:10px 12px;border:1px solid #dce5ef;border-radius:6px;background:#f7f9fc;font-size:13px;min-width:0}
.attendance-today-item>strong{grid-row:1/3;color:#23466c}
.attendance-today-item small{font-size:12px;color:#637991}
.attendance-today-status{display:flex;align-items:center;flex-wrap:wrap;gap:5px 8px}
.attendance-today-item .attendance-today-exception{color:#a33a24}
.attendance-records-modal{position:fixed;inset:0;z-index:1250;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(15,23,42,.55);box-sizing:border-box}
.attendance-records-modal[hidden]{display:none!important}
#attendanceRecordsModal .attendance-records-panel{display:flex;flex-direction:column;width:min(1200px,100%);height:calc(100vh - 48px);height:calc(100dvh - 48px);min-height:0;min-width:0;margin:0;padding:16px;gap:10px;overflow:hidden;background:#fff;border-radius:10px;box-sizing:border-box}
#attendanceRecordsModal .attendance-records-panel>*{flex-shrink:0;min-width:0}
.attendance-records-header{display:flex;align-items:center;justify-content:space-between;gap:16px}
.attendance-records-header h3{margin:0;font-size:18px}
.attendance-records-header p{margin:4px 0 0;font-size:12px}
.attendance-records-header button{width:auto;flex:none}
#attendanceRecordsModal .attendance-filter-strip{display:grid;grid-template-columns:repeat(2,minmax(120px,1fr)) repeat(2,minmax(105px,1fr)) repeat(3,auto);align-items:end;gap:8px;padding:0;margin:0}
#attendanceRecordsModal .attendance-filter-strip>*{min-width:0;width:auto;margin:0;box-sizing:border-box}
#attendanceRecordsModal .attendance-filter-divider{display:none}
#attendanceRecordsModal .attendance-list-toolbar{margin:0}
#attendanceRecordsModal .app-list-sort-summary{flex-wrap:wrap;margin:0}
#attendanceRecordsModal .attendance-records-panel>.table-scroll{flex:1;min-height:70px!important;height:auto!important;max-height:none;overflow:auto;overscroll-behavior:contain}
#attendanceRecordsModal #attendanceMainTable{table-layout:fixed;width:100%;min-width:820px;max-width:none;margin:0}
#attendanceRecordsModal #attendanceMainTable th{position:sticky;top:0;z-index:1;background:#f7f9fc}
#attendanceRecordsModal #attendanceMainTable th:nth-child(1){width:22%}
#attendanceRecordsModal #attendanceMainTable th:nth-child(2){width:15%}
#attendanceRecordsModal #attendanceMainTable th:nth-child(3){width:30%}
#attendanceRecordsModal #attendanceMainTable :is(td,th){white-space:normal;overflow-wrap:anywhere}
#attendanceRecordsModal .customer-fixed-pagination{flex:none;margin:0;padding-top:0}
#content>#attendancePhotoModal{z-index:1260}
@media screen and (max-width:1100px){
  .attendance-today-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .attendance-records-modal{padding:12px}
  #attendanceRecordsModal .attendance-records-panel{height:calc(100vh - 24px);height:calc(100dvh - 24px);padding:12px;gap:8px}
  #attendanceRecordsModal .attendance-filter-strip{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media screen and (max-width:768px){
  .attendance-today-item{padding:8px;font-size:12px;gap:4px 8px}
  .attendance-personal-header #attendanceRecordsOpen{margin-left:0}
  #attendanceRecordsModal .attendance-filter-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
  #attendanceRecordsModal .attendance-filter-strip :is(input,select,button){min-height:38px}
  #attendanceRecordsModal #attendanceMainTable{min-width:0;table-layout:auto}
}
/* Personal desktop check-in stays within the window; management and mobile retain their layout. */
@media screen and (min-width:769px) {
  body.pc-ui-preview:not(.mobile-ui-active):has(#content > .attendance-personal-page) {overflow:hidden}
  body.pc-ui-preview:not(.mobile-ui-active) .main-view:has(> #content > .attendance-personal-page) {height:100vh;height:100dvh;min-height:0;grid-template-rows:64px minmax(0,1fr)}
  body.pc-ui-preview:not(.mobile-ui-active) .main-view > #content:has(> .attendance-personal-page) {display:flex;flex-direction:column;min-height:0;overflow:hidden;padding-top:12px;padding-bottom:16px;gap:10px}
  body.pc-ui-preview:not(.mobile-ui-active) #content:has(> .attendance-personal-page) > .cw-attendance-toolbar {flex:none;margin:0}
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-personal-page {display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;margin:0;gap:8px}
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-page > * {flex-shrink:0}
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-page .attendance-personal-header {display:flex;align-items:center;flex-wrap:wrap;gap:6px 16px}
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-header > h3 {margin:0;font-size:16px}
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-header .attendance-personal-summary {padding:5px 10px;gap:8px 16px}
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-header .attendance-summary-line {margin:0;font-size:12px}
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-page .attendance-checkin-workspace {flex:1;min-height:90px;overflow:auto;overscroll-behavior:contain;display:grid;align-content:start;gap:4px;padding-right:4px}
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-page #attForm {grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;max-width:none;margin:0;gap:8px}
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-page .attendance-mobile-action {min-height:52px;padding:6px 10px}
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-page #attForm .attendance-photo-picker {padding:5px 10px}
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-page #attForm > button[type=submit] {grid-column:auto;margin:0;min-height:34px}
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-page :is(.attendance-photo-state,.attendance-geo-note,.attendance-site-note) {margin:0;line-height:1.5}
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-page .attendance-site-note {padding:5px 10px}
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-page > .table-scroll {flex:1;min-height:76px!important;height:auto!important;max-height:none;overflow:auto;overscroll-behavior:contain}
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-page #attendanceMainTable th {position:sticky;top:0;z-index:1;background:#f7f9fc}
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-page > .customer-fixed-pagination {margin:0;padding-top:0}
}
@media(max-width:768px), (hover:none) and (pointer:coarse) and (max-width:1024px) {
  body.mobile-ui-active .attendance-personal-page #attForm {grid-template-columns:minmax(0,1fr);gap:10px;max-width:none}
  body.mobile-ui-active .attendance-personal-page .attendance-mobile-actions {grid-template-columns:repeat(2,minmax(0,1fr))}
  body.mobile-ui-active .attendance-personal-page #attForm > button[type=submit] {width:100%;min-height:44px}
  body.mobile-ui-active .attendance-personal-page .attendance-personal-summary {gap:8px 14px;font-size:12px;padding:10px}
  body.mobile-ui-active .attendance-personal-page .attendance-personal-summary strong {font-size:16px}
  body.mobile-ui-active .attendance-personal-page #attForm .attendance-photo-clear {width:auto;min-height:36px;padding:6px 10px}
  body.mobile-ui-active .attendance-management-page .attendance-filter-strip {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  body.mobile-ui-active .attendance-management-page .attendance-filter-strip>* {min-width:0;width:100%;box-sizing:border-box}
  body.mobile-ui-active .attendance-management-page .attendance-filter-divider {display:none}
  body.mobile-ui-active #content .attendance-page #attendanceMainTable,
  body.mobile-ui-active #content .attendance-page #attendanceMainTable > tbody {width:100%;min-width:0;max-width:100%}
  body.mobile-ui-active .mobile-system-shell .attendance-page .table-scroll > table tbody > tr:not(.attendance-empty-row) {grid-template-columns:repeat(2,minmax(0,1fr))}
  body.mobile-ui-active .mobile-system-shell .attendance-page .table-scroll > table tbody > tr:not(.attendance-empty-row) > td {width:auto;max-width:100%;min-width:0;white-space:normal}
  body.mobile-ui-active .mobile-system-shell .attendance-page .table-scroll > table tbody > tr:not(.attendance-empty-row) > td:nth-child(8) {white-space:normal;overflow-wrap:anywhere}
  body.mobile-ui-active .cw-toolbar.cw-attendance-toolbar {display:flex!important;align-items:center;gap:8px;flex-wrap:wrap;padding:10px;margin-bottom:10px;border:1px solid #dce5ef;background:#fff;border-radius:8px}
  body.mobile-ui-active .cw-attendance-toolbar button {min-height:44px}
  body.mobile-ui-active:has(.attendance-page) .cw-modal[data-workflow-kind="hrRequests"],
  body.mobile-ui-active:has(.attendance-page) .cw-modal[data-workflow-kind="attendanceMonths"] {display:flex!important;position:fixed;inset:0;z-index:160;align-items:center;justify-content:center;padding:8px;background:#15263b88;box-sizing:border-box;color:#172c43}
  body.mobile-ui-active:has(.attendance-page) .cw-modal .cw-shell {width:100%;max-height:calc(100dvh - 16px);display:flex;flex-direction:column;background:#fff;border-radius:10px;min-width:0;overflow:hidden}
  body.mobile-ui-active:has(.attendance-page) .cw-modal .cw-header {display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px;border-bottom:1px solid #dce5ef}
  body.mobile-ui-active:has(.attendance-page) .cw-modal .cw-header h2 {font-size:18px;margin:0}
  body.mobile-ui-active:has(.attendance-page) .cw-modal .cw-header > button {flex:0 0 auto;width:auto;min-width:60px;background:#fff;border:1px solid #d4e0ee;color:#175fc6}
  body.mobile-ui-active:has(.attendance-page) .cw-modal .cw-kicker {display:none}
  body.mobile-ui-active:has(.attendance-page) .cw-modal .cw-body {min-height:0;min-width:0;overflow:auto;padding:12px;overscroll-behavior:contain}
  body.mobile-ui-active:has(.attendance-page) .cw-modal .cw-message:not(:empty) {padding:10px 12px;flex-shrink:0}
  body.mobile-ui-active:has(.attendance-page) .cw-modal .cw-error {color:#b42318;background:#fff5f3}
  body.mobile-ui-active:has(.attendance-page) .cw-modal :is(.cw-form,.cw-detail) {display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin:12px 0}
  body.mobile-ui-active:has(.attendance-page) .cw-modal .cw-field {display:grid;gap:6px;min-width:0;font-size:14px;margin:0}
  body.mobile-ui-active:has(.attendance-page) .cw-modal :is(input:not([type=checkbox]),select,textarea) {box-sizing:border-box;width:100%;min-width:0;min-height:44px;font-size:16px}
  body.mobile-ui-active:has(.attendance-page) .cw-modal :is(.cw-actions,.cw-footer) {display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
  body.mobile-ui-active:has(.attendance-page) .cw-modal :is(.cw-actions,.cw-footer) button {width:auto}
  body.mobile-ui-active:has(.attendance-page) .cw-modal button {min-height:44px;white-space:normal}
  body.mobile-ui-active:has(.attendance-page) .cw-modal .cw-table-wrap {max-width:100%;overflow:auto}
  body.mobile-ui-active:has(.attendance-page) .cw-modal :is(td,th) {padding:8px;white-space:normal;overflow-wrap:anywhere}
  body.mobile-ui-active:has(.attendance-page) .cw-modal .cw-filters {display:flex;flex-wrap:wrap;gap:8px}
  body.mobile-ui-active:has(.attendance-page) .cw-modal .cw-filters>* {flex:1 1 120px;min-width:0}
  body.mobile-ui-active:has(.attendance-page) .cw-modal .cw-detail dd {margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
}

/* Short desktop windows reserve space for every paging control. */
@media screen and (min-width:769px) and (max-height:700px) {
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-personal-page {
    padding:12px;
    gap:6px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-page .attendance-checkin-workspace {
    min-height:72px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-personal-page .attendance-filter-strip {
    padding:4px 8px;
    gap:6px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) .attendance-personal-header .attendance-personal-summary {
    padding:4px 8px;
  }
}

/* Desktop personal attendance opens records directly; check-in remains in the mobile view. */
@media screen and (min-width:769px) {
 body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-desktop-note {margin-left:auto;font-size:12px;}
 body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-filter-strip {display:grid;grid-template-columns:repeat(2,minmax(120px,1fr)) repeat(2,minmax(100px,1fr)) repeat(3,auto);align-items:end;gap:8px;padding:0;margin:0;}
 body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-filter-strip>* {min-width:0;width:auto;margin:0;box-sizing:border-box;}
 body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-filter-divider {display:none;}
 body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-list-toolbar {margin:0;}
 body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline #attendanceMainTable {table-layout:fixed;width:100%;min-width:700px;max-width:none;margin:0;}
 body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline #attendanceMainTable th:nth-child(1) {width:22%;}
 body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline #attendanceMainTable th:nth-child(2) {width:15%;}
 body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline #attendanceMainTable th:nth-child(3) {width:30%;}
 body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline #attendanceMainTable :is(td,th) {white-space:normal;overflow-wrap:anywhere;}
}
@media screen and (min-width:769px) and (max-width:1200px) {
 body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-filter-strip {grid-template-columns:repeat(4,minmax(0,1fr));}
}

@media screen and (min-width:769px) {
 body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-today-summary {grid-template-columns:repeat(4,minmax(0,1fr));}
}

/* Device location is read-only; a separate field carries the user's supplement. */
.attendance-personal-page #attForm .attendance-location-row {grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 10px;align-items:start;min-width:0;}
.attendance-personal-page #attForm .attendance-location-heading {font-size:13px;color:#526b83;}
.attendance-personal-page #attForm .attendance-location-readonly {min-width:0;overflow-wrap:anywhere;font-size:14px;line-height:1.5;}
.attendance-personal-page #attForm .attendance-location-readonly strong {display:block;font-weight:600;}
.attendance-personal-page #attForm #attendanceGetLocation {min-height:36px;width:auto;margin:0;white-space:nowrap;padding:6px 10px;}
.attendance-personal-page #attForm .attendance-location-state {grid-column:1/-1;font-size:12px;line-height:1.5;}
.attendance-personal-page #attForm .attendance-location-supplement-field {display:grid;gap:4px;min-width:0;margin:0;font-size:12px;color:#526b83;}
.attendance-personal-page #attForm .attendance-location-supplement-field input {width:100%;min-width:0;box-sizing:border-box;margin:0;}
.attendance-coordinate-details {font-size:12px;line-height:1.5;margin:3px 0;color:#526b83;overflow-wrap:anywhere;}
.attendance-coordinate-details>summary {cursor:pointer;list-style:revert;font-size:12px;line-height:1.5;min-height:0;padding:2px 0;border:0;background:transparent;}
.attendance-location-record {min-width:0;overflow-wrap:anywhere;}
.attendance-location-supplement,.attendance-location-feedback {font-size:12px;line-height:1.5;color:#526b83;white-space:pre-wrap;overflow-wrap:anywhere;}
.attendance-location-feedback {display:block;}
.attendance-location-record .attendance-resolve-location {width:auto;min-height:30px;font-size:12px;padding:4px 8px;margin:3px 0;}

/* Nested location evidence stays compact inside monthly review dialogs. */
.cw-modal .attendance-coordinate-details {margin:3px 0;padding:0;border:0;background:transparent;}
.cw-modal .attendance-coordinate-details>summary {padding:2px 0;min-height:0;font-size:12px;line-height:1.5;background:transparent;}

/* Attendance review: concise status, explicit reasons, no guilt inference. */
.attendance-risk-badge{display:inline-flex;align-items:center;margin:4px 4px 0 0;padding:3px 7px;border-radius:5px;font-size:12px;font-weight:600;line-height:1.4;white-space:normal;background:#fff1d8;color:#85500a}
.attendance-risk-badge.risk-verified{background:#e6f4ec;color:#215a3e}
.attendance-risk-badge.risk-follow_up{background:#fff1dc;color:#85500a}
.attendance-risk-summary{display:block;margin-top:6px;font-size:12px;color:#627685}
.attendance-location-record button.attendance-risk-open{display:inline-block;width:auto;min-height:32px;padding:4px 8px;margin:7px 0 0;font-size:12px;line-height:1.4}
dialog.attendance-risk-dialog{box-sizing:border-box;width:min(590px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 28px);padding:0;border:1px solid #d5e1e9;border-radius:14px;color:#193b4e;background:#fff;overflow:auto;overscroll-behavior:contain}
.attendance-risk-dialog::backdrop{background:rgba(15,36,55,.38)}
.attendance-risk-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:10px;position:sticky;top:0;z-index:1;background:#f4f8fc;padding:14px 16px;border-bottom:1px solid #dce6ee}
.attendance-risk-dialog>header h2{font-size:18px;line-height:1.4;margin:0;min-width:0}
.attendance-risk-dialog>header>div{display:flex;align-items:center;gap:8px;flex:none}
.attendance-risk-dialog button{width:auto;min-height:36px;padding:7px 11px;font-size:14px;line-height:1.4;flex:none}
.attendance-risk-dialog button.attendance-help-button{width:30px;min-height:30px;height:30px;padding:0;border-radius:50%}
.attendance-risk-body{padding:16px;overflow-wrap:anywhere}
.attendance-risk-heading{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:16px}
.attendance-risk-record{margin:6px 0 16px;color:#667d8b;font-size:12px}
.attendance-risk-reasons{padding:0 0 0 20px;margin:0 0 16px}
.attendance-risk-reasons li{padding:0 0 12px;line-height:1.6}
.attendance-risk-reasons strong{font-size:14px}
.attendance-risk-reasons p,.attendance-risk-latest p{font-size:14px;margin:4px 0;color:#375268}
.attendance-risk-body h3{font-size:15px;margin:0 0 10px;color:#193b4e}
.attendance-risk-latest,.attendance-risk-form{border-top:1px solid #e1e9ef;padding-top:14px;margin-top:14px}
.attendance-risk-history{margin:14px 0;font-size:13px;color:#496174}
.attendance-risk-history summary{cursor:pointer;min-height:28px}
.attendance-risk-history ol{padding-left:20px}.attendance-risk-history time{display:block;color:#6c7c88}.attendance-risk-history p{margin:4px 0 12px}
.attendance-risk-form label{display:grid;gap:6px;margin:12px 0;font-size:14px;font-weight:600;color:#284a5b}
.attendance-risk-form select,.attendance-risk-form textarea{box-sizing:border-box;display:block;width:100%;max-width:100%;min-width:0;font-size:16px;padding:10px;border:1px solid #cad9e3;border-radius:8px;background:#fff;color:#193b4e}
.attendance-risk-form textarea{resize:vertical;min-height:90px;scroll-margin:90px 0}
.attendance-risk-form footer{display:flex;justify-content:flex-end;margin-top:12px}.attendance-risk-feedback{font-size:14px;line-height:1.5;color:#8c4b12;white-space:pre-wrap}.attendance-risk-feedback:empty{display:none}
@media(max-width:380px){.attendance-risk-dialog>header{padding:12px;gap:6px}.attendance-risk-dialog>header h2{font-size:16px}.attendance-risk-body{padding:12px}.attendance-risk-dialog>header>div{gap:5px}}

.attendance-risk-evidence{font-size:14px;margin:10px 0;color:#496174}.attendance-risk-evidence summary{cursor:pointer;min-height:28px}.attendance-risk-photos{display:flex;gap:8px;flex-wrap:wrap}.attendance-risk-photo{display:block;width:100%;height:auto;max-height:60vh;object-fit:contain;margin-top:8px}.attendance-risk-photo[hidden]{display:none}

.attendance-risk-help-copy{padding:10px 12px;background:#f4f8fc;color:#486172;font-size:13px;line-height:1.7;border-radius:8px}
/* Attendance management: compact overview and records; personal check-in is unchanged. */
#content > .attendance-management-page .attendance-management-test,
#content > .attendance-management-page .attendance-management-review {display:inline-block;font-size:12px;line-height:1.5;font-weight:500;white-space:normal;overflow-wrap:anywhere;}
#content > .attendance-management-page .attendance-management-test {margin-left:7px;padding:1px 6px;border-radius:4px;background:#eef0f4;color:#58687b;vertical-align:middle;}
#content > .attendance-management-page .attendance-management-review {color:#9b570b;}
#content > .attendance-management-page .attendance-filter-note {display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center;}
#content > .attendance-management-page .attendance-query-range {color:#6b7b90;}
#content > .attendance-management-page .attendance-management-shortcuts {display:flex;gap:4px;align-items:center;}
#content > .attendance-management-page .attendance-management-shortcuts button {width:auto;min-width:0;min-height:34px;margin:0;padding:6px 9px;font-size:13px;line-height:20px;white-space:nowrap;}
#content > .attendance-management-page .attendance-management-shortcuts button.selected {background:#eaf1ff;border-color:#8eafea;color:#154d9f;}
#content > .attendance-management-page .attendance-management-menu {position:relative;margin:0;padding:0;border:0;background:none;}
#content > .attendance-management-page .attendance-management-menu > summary {display:flex;align-items:center;gap:6px;min-height:34px;box-sizing:border-box;cursor:pointer;list-style:none;padding:6px 10px;border:1px solid #c7d7ec;border-radius:6px;background:#fff;color:#245a9f;font-size:13px;line-height:20px;white-space:nowrap;}
#content > .attendance-management-page .attendance-management-menu > summary::-webkit-details-marker {display:none;}
#content > .attendance-management-page .attendance-management-menu > summary::after {content:'⌄';}
#content > .attendance-management-page .attendance-management-menu:not([open]) > .attendance-management-menu-body {display:none!important;}
#content > .attendance-management-page .attendance-management-menu-body {position:fixed;z-index:1850;display:grid;gap:9px;box-sizing:border-box;padding:10px;background:white;border:1px solid #cedaeb;border-radius:7px;box-shadow:0 6px 20px #17365d24;overflow:auto;overscroll-behavior:contain;}
#content > .attendance-management-page .attendance-management-menu-body :is(select,button) {width:100%;min-width:0;min-height:36px;margin:0;font-size:14px;}
#content > .attendance-management-page .attendance-management-record > summary {display:inline-flex;align-items:center;min-height:32px;cursor:pointer;font-size:13px;line-height:20px;color:#245a9f;padding:4px 0;}
#content > .attendance-management-page .attendance-management-record > summary::before {content:'▸';margin-right:5px;}
#content > .attendance-management-page .attendance-management-record[open] > summary::before {content:'▾';}
#content > .attendance-management-page .attendance-management-record > summary::-webkit-details-marker {display:none;}
#content > .attendance-management-page .attendance-management-record-body {padding:8px 0 5px;border-top:1px solid #e4eaf2;line-height:1.6;overflow-wrap:anywhere;}
#content > .attendance-management-page .attendance-management-record-body p {margin:6px 0;white-space:pre-wrap;}
#content > .attendance-management-page .attendance-management-record-body .attendance-photo-inline {margin-top:7px;}
#content > .attendance-management-page .attendance-management-note {color:#5b6d82;font-size:13px;line-height:1.5;overflow-wrap:anywhere;}
#content > .attendance-management-page .attendance-management-location {font-size:13px;line-height:1.5;overflow-wrap:anywhere;}
#content > .attendance-management-page .attendance-management-status {display:flex;flex-wrap:wrap;gap:3px 6px;align-items:center;margin-top:3px;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page {gap:8px;padding:14px 16px;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page > h3 {font-size:14px;line-height:22px;margin:0;font-weight:600;color:#51677e;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page > .cards {margin:0;gap:8px;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page > .cards .stat {padding:8px 10px;min-height:0;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page > .cards .stat .num {font-size:22px;line-height:26px;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page .attendance-filter-strip {display:flex;flex-wrap:wrap;gap:7px;align-items:end;padding:9px 10px;margin:0;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page .attendance-filter-strip > * {width:auto;flex:none;min-width:0;margin:0;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page .attendance-filter-strip > .support-attendance-date {width:138px;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page .attendance-filter-strip > #attendanceFilterUserId {width:180px;max-width:100%;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page .attendance-filter-strip > .attendance-management-export {margin-left:auto;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page .attendance-list-toolbar {margin:0;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page #attendanceMainTable {table-layout:fixed;width:100%;min-width:680px;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page #attendanceMainTable th:nth-child(1) {width:21%;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page #attendanceMainTable th:nth-child(2) {width:19%;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page #attendanceMainTable th:nth-child(3) {width:28%;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page #attendanceMainTable td {padding:8px 10px;vertical-align:top;white-space:normal;line-height:1.5;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page #attendanceMainTable .attendance-subtext {font-size:12px;line-height:18px;margin-top:3px;}
body.pc-ui-preview:not(.mobile-ui-active) #content:has(> .attendance-management-page) > .cw-attendance-toolbar {padding:8px 12px;margin-bottom:8px;}
body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page .attendance-management-record-row .attendance-management-review {display:block;flex-basis:100%;}
body.mobile-ui-active #content > .attendance-management-page .attendance-management-shortcuts {flex-wrap:wrap;}
body.mobile-ui-active #content > .attendance-management-page .attendance-management-status {justify-content:flex-end;}
body.mobile-ui-active #content > .attendance-management-page .attendance-management-review {display:block;}
body.mobile-ui-active #content > .attendance-management-page .attendance-filter-note {gap:2px 8px;}
body.mobile-ui-active #content > .attendance-management-page .attendance-management-test {font-size:10px;margin-left:5px;}

body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page #attendanceMainTable .attendance-management-record-row > td:first-child > strong {display:inline;}
#content > .attendance-management-page [data-attendance-review-month][hidden] {display:none!important;}

/* Attendance management only: return vertical space to the record list. */
@media screen and (min-width: 769px) {
  body.pc-ui-preview:not(.mobile-ui-active) #content:has(> .attendance-management-page) {
    padding: 10px 16px 20px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content:has(> .attendance-management-page) > .cw-attendance-toolbar {
    min-height: 34px;
    padding: 0;
    margin: 0 0 5px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content:has(> .attendance-management-page) > .cw-attendance-toolbar > span {
    display: none;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
    padding: 10px 14px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page > h3 {
    grid-column: 1;
    grid-row: 1;
    line-height: 32px;
    white-space: nowrap;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page > .cards {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    grid-column: 2;
    grid-row: 1;
    gap: 0;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page > .cards .stat {
    flex: 0 0 auto;
    width: auto;
    min-height: 30px;
    gap: 6px;
    padding: 0 10px;
    border: 0;
    border-left: 1px solid #d8e2ee;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page > .cards .stat .stat-label {
    white-space: nowrap;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page > .cards .stat .num {
    margin: 0;
    font-size: 17px;
    line-height: 24px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page > .attendance-admin-tools:not([open]) {
    grid-column: 3;
    grid-row: 1;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page > .attendance-admin-tools:not([open]) > summary {
    min-height: 30px;
    padding: 4px 8px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page > .attendance-admin-tools[open] {
    grid-column: 1 / -1;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page .attendance-filter-strip {
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page .attendance-filter-strip > .support-attendance-date {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    width: auto;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page .attendance-filter-strip > .support-attendance-date > input {
    width: 132px;
    height: 32px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page .attendance-management-shortcuts button,
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page .attendance-management-menu > summary {
    min-height: 32px;
    padding-top: 5px;
    padding-bottom: 5px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page .attendance-filter-strip > #attendanceFilterUserId {
    height: 32px;
  }
}
@media screen and (min-width: 769px) and (max-width: 1199px) {
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page > .cards {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-management-page > .attendance-admin-tools:not([open]) {
    grid-column: 2;
  }
}

/* Personal desktop attendance: keep today's context and all filters above the records. */
@media screen and (min-width: 769px) {
  body.pc-ui-preview:not(.mobile-ui-active) #content:has(> .attendance-records-inline) {
    padding-top: 10px;
    gap: 6px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content:has(> .attendance-records-inline) > .cw-attendance-toolbar {
    min-height: 34px;
    padding: 0;
    margin: 0 0 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content:has(> .attendance-records-inline) > .cw-attendance-toolbar > span {
    display: none;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline {
    gap: 6px;
    padding: 10px 14px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-today-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
    margin: 0;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-today-item {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px 7px;
    min-height: 28px;
    padding: 3px 10px;
    border: 0;
    border-left: 1px solid #d8e2ee;
    border-radius: 0;
    background: transparent;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-today-item:first-child {
    border-left: 0;
    padding-left: 0;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-today-item > strong {
    grid-row: auto;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-field-status:not(.attendance-field-warning) {
    gap: 4px 12px;
    padding: 4px 0;
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-field-status:not(.attendance-field-warning) > div:first-child {
    flex: 0 1 auto;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-field-status:not(.attendance-field-warning) :is(strong,span) {
    display: inline;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-field-status:not(.attendance-field-warning) span:not(:empty) {
    margin-left: 8px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-filter-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 6px;
    padding: 4px 0 2px;
    border: 0;
    background: transparent;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-filter-strip > * {
    flex: none;
    width: auto;
    min-width: 0;
    margin: 0;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-filter-strip > .support-attendance-date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    white-space: nowrap;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-filter-strip > .support-attendance-date > input {
    width: 128px;
    height: 32px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-filter-strip > select {
    width: 122px;
    height: 32px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-filter-strip > #attendanceFilterRisk {
    width: 128px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-filter-strip > button {
    min-height: 32px;
    padding: 5px 9px;
    font-size: 13px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-filter-note {
    margin: 0;
  }
}

/* Keep the second personal record fully visible on a short, narrow desktop. */
@media screen and (min-width: 769px) and (max-width: 1100px) and (max-height: 780px) {
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline {
    gap: 4px;
    padding: 8px 12px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-today-item {
    min-height: 26px;
    padding: 2px 8px;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-field-status:not(.attendance-field-warning) {
    padding: 2px 0;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline .attendance-filter-strip {
    gap: 4px;
    padding: 2px 0 0;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline #attendanceMainTable td {
    padding: 6px 8px;
    line-height: 1.4;
  }
  body.pc-ui-preview:not(.mobile-ui-active) #content > .attendance-records-inline #attendanceMainTable .attendance-resolve-location {
    min-height: 28px;
    margin: 2px 0;
    padding: 3px 7px;
  }
}
/* Attendance management detail is a dialog, not a table-row menu. */
#content > .attendance-management-page .attendance-management-record-open {
  display:inline-flex;align-items:center;min-height:32px;width:auto;margin:0;padding:4px 0;
  border:0;border-radius:0;background:transparent;box-shadow:none;color:#245a9f;
  font-size:13px;line-height:20px;cursor:pointer;text-align:left;
}
#content > .attendance-management-page .attendance-management-record-open::before {content:'▸';margin-right:5px;}
#content > .attendance-management-page .attendance-management-record-open:hover {text-decoration:underline;}
#content > .attendance-management-page .attendance-management-record-open:focus-visible {outline:2px solid #3271d2;outline-offset:2px;}
#content > .attendance-detail-overlay[hidden] {display:none!important;}
#content > .attendance-detail-overlay {
  position:fixed;inset:0;z-index:1900;display:grid;place-items:center;
  box-sizing:border-box;padding:20px;
}
#content > .attendance-detail-overlay .attendance-detail-backdrop {
  position:absolute;inset:0;background:rgba(15,35,60,.48);
}
#content > .attendance-detail-overlay .attendance-detail-panel {
  position:relative;z-index:1;display:flex;flex-direction:column;
  box-sizing:border-box;width:min(680px,100%);max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);
  overflow:hidden;border:1px solid #cedceb;border-radius:10px;background:#fff;
  box-shadow:0 18px 48px rgba(18,39,66,.28);color:#183653;
}
#content > .attendance-detail-overlay .attendance-detail-header {
  display:flex;justify-content:space-between;align-items:start;gap:12px;
  flex:none;padding:14px 18px;border-bottom:1px solid #dce6ef;background:#f6f9fd;
}
#content > .attendance-detail-overlay .attendance-detail-header h3 {margin:0 0 4px;font-size:18px;line-height:1.4;}
#content > .attendance-detail-overlay .attendance-detail-header p {margin:0;font-size:13px;line-height:1.5;overflow-wrap:anywhere;}
#content > .attendance-detail-overlay .attendance-detail-header button {flex:none;width:auto;min-height:36px;margin:0;padding:6px 12px;}
#content > .attendance-detail-overlay .attendance-detail-content {
  min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 18px 18px;
}
#content > .attendance-detail-overlay .attendance-management-record-body {padding:0;border:0;line-height:1.6;overflow-wrap:anywhere;}
#content > .attendance-detail-overlay .attendance-detail-section {padding:14px 0;border-bottom:1px solid #e1e9f1;}
#content > .attendance-detail-overlay .attendance-detail-section:last-child {border-bottom:0;}
#content > .attendance-detail-overlay .attendance-detail-section h4 {margin:0 0 8px;font-size:15px;line-height:1.5;color:#254b72;}
#content > .attendance-detail-overlay .attendance-detail-section p {margin:6px 0;white-space:pre-wrap;}
#content > .attendance-detail-overlay .attendance-detail-facts {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 18px;}
#content > .attendance-detail-overlay .attendance-detail-facts > div {min-width:0;overflow-wrap:anywhere;}
#content > .attendance-detail-overlay .attendance-detail-facts > div > span:first-child {display:block;margin-bottom:3px;color:#647991;font-size:12px;}
#content > .attendance-detail-overlay .attendance-detail-facts strong {display:block;margin-bottom:3px;font-size:14px;font-weight:600;}
#content > .attendance-detail-overlay .attendance-detail-facts .attendance-management-status {display:flex;flex-wrap:wrap;gap:3px 6px;align-items:center;}
#content > .attendance-detail-overlay .attendance-location-record {line-height:1.6;}
#content > .attendance-detail-overlay .attendance-photo-inline {margin-top:8px;}
#content > #attendancePhotoModal.attendance-detail-photo-layer {z-index:1910;}
@media screen and (max-width:768px) {
  #content > .attendance-detail-overlay {padding:10px;}
  #content > .attendance-detail-overlay .attendance-detail-panel {width:100%;max-height:calc(100vh - 20px);max-height:calc(100dvh - 20px);border-radius:9px;}
  #content > .attendance-detail-overlay .attendance-detail-header {padding:12px;}
  #content > .attendance-detail-overlay .attendance-detail-header h3 {font-size:17px;}
  #content > .attendance-detail-overlay .attendance-detail-content {padding:0 12px 12px;}
  #content > .attendance-detail-overlay .attendance-detail-section {padding:12px 0;}
  #content > .attendance-detail-overlay .attendance-detail-facts {grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 12px;}
  #content > .attendance-detail-overlay .attendance-detail-facts > div:last-child {grid-column:1/-1;}
}
