/* Keep responsive containers shrinkable at the default 80% workspace scale. */
@media screen {
  #screen-app .app-body, #screen-app .main-content, #screen-app .page { min-width: 0; }
  #screen-app .main-content { flex: 1 1 0; }
  .attendance-module-heading-copy { overflow-wrap: anywhere; }
  .table-wrap { min-width: 0; max-width: 100%; overscroll-behavior-inline: contain; }
  .table-wrap > table { max-width: none; }
  .form-row > *, .coaching-picker-grid > *, .coaching-details-grid > * { min-width: 0; }
  .modal-overlay[data-centered-modal] > .modal,
  dialog[open] { max-width: calc(125vw - 32px) !important; max-height: calc(125dvh - 32px) !important; }
  #screen-login { min-height: 125dvh; padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
}
@media screen and (max-width: 1100px) {
  .attendance-module-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .attendance-module-header > .attendance-module-heading { grid-column: 1; grid-row: 1; min-width: 0; }
  .attendance-module-header > .attendance-module-notifications { grid-column: 2; grid-row: 1; }
  .attendance-module-header > .attendance-module-header-actions { grid-column: 1 / -1; width: 100%; min-width: 0; margin: 0; flex-wrap: wrap; overflow: visible; }
  .attendance-module-header > .attendance-module-header-actions:empty { display: none; }
  .attendance-module-header-actions .attendance-date-tools { flex-wrap: wrap; min-width: 0; }
  .attendance-module-header-actions .attendance-date-range { flex-wrap: wrap; min-width: 0; }
  .attendance-module-header-actions .search-input { min-width: 0; max-width: 100%; }
}
@media screen and (max-width: 860px) {
  .app-header-inner, .brand-wrap, .app-user { min-width: 0; }
  .app-header-inner { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .app-logo { overflow: hidden; text-overflow: ellipsis; }
  .app-user { flex-shrink: 0; }
  .sidebar { max-height: calc(125dvh - 56px); padding-bottom: max(24px, env(safe-area-inset-bottom)); overscroll-behavior: contain; }
  .attendance-notification-popover { width: min(540px, calc(125vw - 40px)); max-width: calc(125vw - 40px); max-height: min(548px, calc(125dvh - 160px)); }
  .table-bar { flex-wrap: wrap; gap: 10px; }
  .table-bar > *, .coaching-toolbar { min-width: 0; max-width: 100%; }
  .coaching-toolbar { flex-wrap: wrap; }
  .coaching-toolbar > :is(input, select) { min-width: 0; max-width: 100%; }
  .attendance-module-heading p { overflow-wrap: anywhere; }
}
@media screen and (max-width: 500px) {
  #page-punch .punch-label { font-size: clamp(10px, 3vw, 12px); }
  .form-actions { flex-wrap: wrap; gap: 8px; }
  .form-actions > button { min-width: 0; max-width: 100%; }
  .modal-overlay[data-centered-modal] > .modal, dialog[open] { max-width: calc(125vw - 24px) !important; max-height: calc(125dvh - 24px) !important; }
  .attendance-modal-title { overflow-wrap: anywhere; }
}
@media screen and (max-height: 500px) {
  #screen-login { justify-content: flex-start; }
  .modal-overlay[data-centered-modal] { align-items: flex-start !important; }
}

#work-schedule-calendar button.work-schedule-entry { width:100%;text-align:left;font-family:inherit;border:0;border-left:3px solid #16a34a;cursor:pointer;white-space:normal;overflow-wrap:anywhere; }
#work-schedule-calendar button.work-schedule-entry.rest { border-left-color:#64748b; }
#work-schedule-calendar button.work-schedule-entry:focus-visible { outline:2px solid #347be8;outline-offset:2px; }

.reimbursement-summary-intro,.reimbursement-summary-note { margin:8px 0 10px;color:var(--text2);font-size:11px;line-height:1.5; }
.reimbursement-summary-note { margin-bottom:0; }
#profile-medical-reimbursement-summary { border-left-color:#347be8; }
.reimbursement-history-heading { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px; }
.reimbursement-history-heading h2 { margin:0;font-size:18px; }
#modal-profile-reimbursements .table-wrap { overflow-x:auto; }
#modal-profile-reimbursements table { min-width:850px;width:100%; }

.profile-statistics-panel { margin-top:16px;min-width:0;border:1px solid var(--border);border-radius:10px;overflow:hidden;background:var(--surface,#fff); }
.profile-statistics-tabs { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:7px;background:var(--surface2,#f3f7fd);border-bottom:1px solid var(--border); }
.profile-statistics-tabs button { min-width:0;padding:9px 7px;min-height:36px;border:0;border-radius:6px;background:transparent;color:var(--text2);font:inherit;font-size:11px;font-weight:750;line-height:1.35;cursor:pointer; }
.profile-statistics-tabs button[aria-selected="true"] { background:#347be8;color:#fff; }
.profile-statistics-tabs button:focus-visible { outline:2px solid #347be8;outline-offset:1px; }
.profile-statistics-panel > .profile-coaching-summary { margin:0;border:0;border-radius:0;padding:13px; }
.profile-statistics-panel > [hidden] { display:none!important; }
