*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: Verdana, Arial, sans-serif;
  background: #f2f3f4;
  color: #202020;
}

main {
  display: grid;
  gap: 1.25rem;
  width: min(22rem, calc(100vw - 2rem));
  padding: 1.75rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid #bec5c9;
  border-radius: 5px;
}

.loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.75rem;
  background: #f2f3f4;
  pointer-events: none;
}

.loading::before {
  content: "";
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid #bec5c9;
  border-top-color: #202020;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.htmx-request.loading {
  pointer-events: auto;
}

main:has(:not(:defined)) {
  visibility: hidden;
}

section {
  display: grid;
  gap: 1.25rem;
}

section.existing {
  padding-top: 1.25rem;
  border-top: 1px solid #bec5c9;
}

form {
  display: grid;
  gap: 1rem;
}

p {
  margin: 0;
}

main.week {
  width: min(56rem, calc(100vw - 2rem));
  overflow: auto;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -1.75rem -1.75rem 0;
  padding: 1rem 1.75rem;
  border-bottom: 1px solid #bec5c9;
}

.topbar kol-heading {
  flex-shrink: 0;
}

@media (max-width: 40rem) {
  .topbar kol-heading {
    flex: 1 1 100%;
  }
}

.topbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.week-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border: 1px solid #bec5c9;
  text-align: center;
}

th {
  padding: 0.35rem;
}

td {
  position: relative;
  height: 1.5rem;
  padding: 0;
  line-height: 0;
  vertical-align: top;
}

a.cell {
  display: flex;
  position: absolute;
  inset: 0;
  text-decoration: none;
}

.lane {
  flex: 1;
  position: relative;
  min-width: 0;
}

.lane-fill {
  position: absolute;
  left: 0;
  right: 0;
}

ul {
  margin: 0;
  padding-left: 1.25rem;
}

.person-color {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.4em;
  vertical-align: middle;
  border: 1px solid #bec5c9;
}