/* Day navigation is a view preference only; ledger records stay in place. */
.attendance-layout-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 8px;
}
.attendance-day-jumps { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.attendance-layout-label { color: #5b7163; font-size: 12px; font-weight: 600; margin-right: 4px; }
.attendance-layout-button {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #ccdacd;
  border-radius: 8px;
  background: #fff;
  color: #235b3e;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}
.attendance-layout-button:hover { background: #edf5ed; border-color: #a7c2ad; }
.attendance-layout-button:focus-visible { outline: 3px solid #41885b; outline-offset: 2px; }
.attendance-layout-button:disabled { color: #718174; background: #f5f7f3; }
.attendance-expand-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex-shrink: 0; border-color: #93b89f; background: #f0f7ef; }
.attendance-expand-button[aria-pressed="true"] { border-color: #185e3c; background: #185e3c; color: #fff; }
.attendance-top-scroll {
  width: 100%;
  height: 20px;
  margin: 0 0 6px;
  overflow-x: scroll;
  overflow-y: hidden;
  border: 1px solid #d5e2d7;
  border-radius: 6px;
  background: #edf3ed;
  scrollbar-color: #8fab96 #edf3ed;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.attendance-top-scroll-track { height: 1px; }
.attendance-top-scroll::-webkit-scrollbar { height: 14px; }
.attendance-top-scroll::-webkit-scrollbar-track { background: #edf3ed; border-radius: 6px; }
.attendance-top-scroll::-webkit-scrollbar-thumb { background: #91ad98; border: 3px solid #edf3ed; border-radius: 7px; }
.attendance-top-scroll:focus-visible { outline: 3px solid #41885b; outline-offset: 2px; }
.attendance-top-scroll[hidden], .attendance-layout-backdrop[hidden] { display: none !important; }
/* Keep consumer identity pinned while allowing metadata to move out of the way. */
#attendance .matrix td.date, #attendance .matrix td.group, #attendance .matrix td.hours { position: static; }
#attendance .matrix th.date, #attendance .matrix th.group, #attendance .matrix th.hours { left: auto; z-index: 4; }
#attendance .matrix th.name, #attendance .matrix td.name { box-shadow: 2px 0 #dce5de; }
.attendance-layout-backdrop { position: fixed; inset: 0; z-index: 59; background: rgba(7, 42, 28, .42); }
body.attendance-is-expanded { overflow: hidden; }
body.attendance-is-expanded .toast { z-index: 120; }
#attendance.attendance-expanded {
  position: fixed;
  inset: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
  padding: 20px 24px;
  overflow: hidden;
  border: 1px solid #cbdacf;
  border-radius: 14px;
  background: #f5f7f3;
  box-shadow: 0 20px 80px rgba(7, 42, 28, .2);
}
#attendance.attendance-expanded > .summary,
#attendance.attendance-expanded > .legend:not(.attendance-code-key) { display: none; }
#attendance.attendance-expanded > .eyebrow { margin-bottom: 5px; font-size: 10px; }
#attendance.attendance-expanded .title-row { flex-direction: row; align-items: center; gap: 20px; margin-bottom: 14px; }
#attendance.attendance-expanded .title-row h1 { font-size: 29px; }
#attendance.attendance-expanded .title-row .lede { display: none; }
#attendance.attendance-expanded .title-row > .actions { width: auto; justify-content: flex-end; }
#attendance.attendance-expanded .controls { margin-bottom: 8px; }
#attendance.attendance-expanded .attendance-code-key { margin: 4px 0 6px; font-size: 11px; }
#attendance.attendance-expanded .attendance-layout-toolbar { margin-top: 8px; }
#attendance.attendance-expanded > .eyebrow,
#attendance.attendance-expanded > .title-row,
#attendance.attendance-expanded > .controls,
#attendance.attendance-expanded > .attendance-code-key,
#attendance.attendance-expanded > .attendance-layout-toolbar,
#attendance.attendance-expanded > .attendance-top-scroll { flex-shrink: 0; }
#attendance.attendance-expanded .matrix-shell { flex: 1 1 auto; max-height: none; min-height: 160px; }

@media (max-width: 850px) {
  .attendance-layout-toolbar { align-items: stretch; flex-wrap: wrap; gap: 8px; }
  .attendance-day-jumps { flex: 1 1 100%; }
  .attendance-expand-button { margin-left: auto; }
  #attendance.attendance-expanded { inset: 10px; height: calc(100vh - 20px); height: calc(100dvh - 20px); padding: 16px; }
  #attendance.attendance-expanded .title-row { align-items: flex-start; flex-direction: column; gap: 12px; }
  #attendance.attendance-expanded .title-row > .actions { width: 100%; justify-content: flex-start; }
  #attendance.attendance-expanded .controls { gap: 8px; }
}
@media (max-width: 600px) {
  .attendance-day-jumps { gap: 5px; }
  .attendance-layout-label { flex: 1 1 100%; margin-bottom: 2px; }
  .attendance-layout-button { padding: 9px 10px; font-size: 11px; }
  #attendance.attendance-expanded {
    inset: 0;
    height: 100vh;
    height: 100dvh;
    padding: max(14px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    overflow-y: auto;
    border: 0;
    border-radius: 0;
  }
  #attendance.attendance-expanded .title-row h1 { font-size: 26px; }
  #attendance.attendance-expanded .title-row { margin-bottom: 10px; }
  #attendance.attendance-expanded .matrix-shell { min-height: 240px; }
}
