:root {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #162f4c;
  background: #f2f6fa;
  color-scheme: light;
  --blue: #0055a5;
  --blue-dark: #004483;
  --blue-pale: #eaf2fb;
  --red: #c5002c;
  --ink: #162f4c;
  --muted: #4b6077;
  --line: #cdd9e7;
  --white: #fff;
}

* { box-sizing: border-box; }
body { min-width: 0; margin: 0; }
[hidden] { display: none !important; }
a { color: var(--blue-dark); }
button, input, select { color: inherit; font: inherit; }
button, select, input[type="date"], input[type="checkbox"] { cursor: pointer; }
button, input, select, .button-link { touch-action: manipulation; }
button, .button-link {
  min-height: 40px;
  padding: .45rem .7rem;
  border: 1px solid #afc4db;
  border-radius: 6px;
  background: var(--white);
  font-weight: 650;
}
button:hover, .button-link:hover { background: var(--blue-pale); }
button:disabled { opacity: .5; cursor: default; }
.primary, .button-link.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--white);
}
.primary:hover, .button-link.primary:hover { background: var(--blue-dark); }
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
button.quiet { background: transparent; }
input:not([type="checkbox"]), select {
  min-width: 0;
  min-height: 42px;
  max-width: 100%;
  padding: .47rem .55rem;
  border: 1px solid #a9bed4;
  border-radius: 6px;
  background: var(--white);
}
input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--blue);
}
:where(a, button, input, select, .grid):focus-visible {
  z-index: 5;
  outline: 3px solid var(--blue-dark);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  top: -5rem;
  left: .75rem;
  z-index: 10;
  padding: .6rem .8rem;
  background: var(--white);
}
.skip:focus { top: .5rem; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.top {
  border-bottom: 4px solid var(--red);
  background: var(--blue);
  color: var(--white);
}
.top-inner {
  display: flex;
  min-height: 60px;
  max-width: 1480px;
  margin-inline: auto;
  padding: .35rem clamp(.75rem, 3vw, 2rem);
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
}
.brand img { display: block; object-fit: contain; }
.top button.quiet { border-color: #b8d1ed; color: var(--white); }
.top button.quiet:hover { background: var(--blue-dark); }
.top button:focus-visible { outline-color: var(--white); }

main {
  max-width: 1480px;
  margin-inline: auto;
  padding: 1.25rem clamp(.6rem, 3vw, 2rem) 2rem;
}
.heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: .55rem;
  margin-bottom: 1rem;
}
.heading h1 {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(1.55rem, 4vw, 2.32rem);
  line-height: 1.13;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
.heading p, .board-head p, .sign-in p {
  margin: .33rem 0 0;
  color: var(--muted);
}
.badge {
  display: inline-block;
  padding: .3rem .56rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: #e8f2fb;
  color: #234e7a;
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
}
.badge.preview {
  border-color: #e7cf97;
  background: #fff5db;
  color: #684200;
}

.card {
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 4px 25px #2040670a;
}
.sign-in {
  max-width: 36rem;
  padding: 1.25rem;
  border-top: 3px solid var(--blue);
}
.sign-in h2, .board-head h2 {
  margin: 0;
  color: var(--blue-dark);
  font-size: 1.19rem;
  letter-spacing: -.02em;
}
.sign-in p { margin-bottom: .8rem; }
.sign-in [role="alert"] { overflow-wrap: anywhere; }
.sign-in-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.board-head {
  display: flex;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #f6faff;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
}
.board-head p { font-size: .85rem; }
.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .32rem;
}
.nav button:first-child, .nav button:nth-child(3) {
  min-width: 40px;
  padding-block: .25rem;
  font-size: 1.45rem;
  line-height: 1;
}
.nav input { min-width: 9rem; }
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .55rem;
  padding: .65rem 1rem .38rem;
}
.filter {
  display: grid;
  min-width: 0;
  flex: 0 1 14rem;
  gap: .25rem;
}
.filter span { color: #304e70; font-size: .82rem; font-weight: 700; }
.search { flex: 1 1 16rem; max-width: 22rem; }
.reset { min-height: 42px; color: var(--blue-dark); font-size: .85rem; }
.toggles {
  display: flex;
  min-inline-size: 0;
  margin: 0;
  padding: .16rem 1rem;
  border: 0;
  gap: .2rem 1rem;
  flex-wrap: wrap;
}
.toggles label {
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: .36rem;
  color: #344f6b;
  font-size: .86rem;
  cursor: pointer;
}
.key {
  display: inline-block;
  width: .8rem;
  height: .8rem;
  border: 1px solid;
  border-radius: 3px;
}
.status-line, .scroll-hint {
  min-height: 1.4rem;
  margin: 0;
  padding: .18rem 1rem .38rem;
  color: var(--muted);
  font-size: .81rem;
}
.scroll-hint { display: none; }
.grid {
  position: relative;
  max-height: min(67vh, 39rem);
  overflow: auto;
  overscroll-behavior-x: contain;
}
.grid:focus-visible { outline-offset: -3px; }
.empty {
  margin: 0 1rem .75rem;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--blue-pale);
}

table {
  width: 100%;
  min-width: 834px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: .82rem;
}
th, td {
  padding: .28rem .38rem;
  border-bottom: 1px solid #dce5f0;
  text-align: center;
}
.who {
  width: 167px;
  padding-left: .75rem;
  text-align: left;
  overflow-wrap: anywhere;
}
.dept { width: 163px; text-align: left; }
.dept-name {
  color: #334f70;
  font-size: .8rem;
  text-align: left;
  overflow-wrap: anywhere;
}
.mobile-department { display: none; }
.department-note {
  display: block;
  margin-top: .12rem;
  color: #684971;
  font-size: .69rem;
  font-weight: 500;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  border-top: 1px solid var(--line);
  background: var(--blue-pale);
  color: var(--ink);
}
thead .who, thead .dept {
  background: var(--blue);
  color: var(--white);
  vertical-align: bottom;
}
.day { padding: 0; }
.day strong, .day time { display: block; }
.day strong { padding-top: .34rem; text-transform: capitalize; }
.day time { padding-top: .08rem; padding-bottom: .35rem; font-weight: 550; }
.day-total {
  display: block;
  padding: .22rem .1rem;
  background: var(--blue);
  color: var(--white);
  font-size: .71rem;
  font-weight: 750;
}
.day-total.strong-total { background: #cbead5; color: #184831; }
.day-total.low-total { background: #f8dda0; color: #5a3500; }
thead .day.current { background: #ffe7ed; box-shadow: inset 0 3px var(--red); }
thead .day.weekend:not(.current) { background: #dce6f0; }
tbody tr { --row: #fff; }
tbody tr:nth-child(even) { --row: #f0f5fc; }
tbody tr:hover, tbody tr:focus-within { --row: #e5effb; }
tbody th, tbody td { background: var(--row); }
tbody td.weekend { background: #e8eef5; }
tbody td.current-day { background: #fff1f4; }
tbody tr:nth-child(even) td.current-day { background: #f9e7ed; }
.frozen { position: sticky; left: 0; z-index: 1; box-shadow: 2px 0 4px #16375814; }
thead .frozen { z-index: 4; }

.chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: .17rem .28rem;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: .71rem;
  font-weight: 660;
  line-height: 1.16;
  white-space: nowrap;
}
.chip.present { background: #dff1e6; border-color: #b8dbc6; color: #165337; }
.chip.partial { background: #ffefd1; border-color: #e6c889; color: #614003; }
.chip.away, .key.away { background: #f9dce5; border-color: #e5b3c3; color: #77223e; }
.chip.free, .key.free { background: #fff0af; border-color: #ddc871; color: #554002; }
.chip.missing { background: #e9edf3; border-color: #cfd9e5; color: #425369; }
button.chip:hover { filter: brightness(.94); }
.chip[aria-hidden="true"] { color: #526782; background: transparent; border-color: transparent; }
.chip:has(.slot-hours) { flex-direction: column; }
.slot-hours { display: block; margin-top: .12rem; font-weight: 550; }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .56rem 1rem;
  background: #f5f9fe;
}
.legend .chip { min-height: 24px; cursor: default; }

dialog {
  width: min(420px, calc(100% - 1.5rem));
  max-height: calc(100% - 1.5rem);
  border: 1px solid #a9bed4;
  border-radius: 9px;
  color: var(--ink);
}
dialog::backdrop { background: #122b4f80; }
.dialog-body { padding: .3rem; }
.dialog-body h2 { margin: 0; color: var(--blue-dark); font-size: 1.2rem; }
.dialog-body p { margin: .25rem 0 0; color: var(--muted); }
dl div {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  padding: .6rem 0;
  border-top: 1px solid var(--line);
}
dt { font-weight: 650; }
dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

@media (max-width: 850px) {
  .scroll-hint { display: block; }
}

@media (max-width: 660px) {
  .top-inner { min-height: 49px; }
  .brand img { width: 39px; height: 37px; }
  .heading { align-items: start; flex-direction: column; }
  .heading p { font-size: .9rem; }
  .board-head { align-items: start; flex-direction: column; }
  .board-head, .filters, .toggles, .status-line, .scroll-hint, .legend {
    padding-inline: .65rem;
  }
  .filter { flex: 1 1 8rem; }
  .search { flex: 1 1 100%; max-width: none; }
  .filter input, .filter select { width: 100%; }
  .grid { max-height: none; }
  table { min-width: 688px; }
  .who { width: 116px; padding-left: .48rem; }
  .dept, .dept-name { display: none; }
  .mobile-department {
    display: block;
    margin-top: .11rem;
    color: #3c5572;
    font-size: .69rem;
    font-weight: 500;
  }
  .day-total { font-size: .68rem; }
}

