.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}
.cal-legend .occ {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
}
.cal-legend .occ.checkout {
  background: var(--lilac);
}
.cal-legend .occ.turnover {
  background: var(--pink);
}
.cal-legend .occ.arrival {
  background: var(--gold);
}
.cal-legend .occ.stayover {
  background: var(--stayover);
}
.cal-legend .occ.vacant {
  background: var(--vacant);
}

.cal-wrap {
  overflow: auto;
  max-width: 100%;
  max-height: 58vh;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table.cal {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

table.cal th,
table.cal td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 6px;
  min-width: 108px;
  vertical-align: top;
}

table.cal th:first-child,
table.cal td.apt-name,
table.cal .apt-name {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
  min-width: 220px;
  text-align: left;
}

table.cal thead th {
  position: sticky;
  top: 0;
  background: var(--cal-head);
  z-index: 2;
  text-align: center;
}

table.cal th.apt-name {
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

table.cal .house-row th {
  background: var(--pine);
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
}

table.cal thead th:first-child {
  z-index: 3;
}

table.cal th.is-today button,
table.cal th.is-selected {
  box-shadow: inset 0 -3px 0 var(--pine);
}
table.cal thead th button {
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 100%;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: center;
}
table.cal .linkish {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

table.cal td.occ span,
table.cal td.occ .linkish,
table.cal td.occ em {
  display: block;
}

table.cal td.occ em {
  margin-top: 4px;
  font-style: normal;
  font-weight: 700;
}

table.cal td.occ.checkout {
  background: var(--lilac);
}
table.cal td.occ.turnover {
  background: var(--pink);
}
table.cal td.occ.arrival {
  background: var(--gold);
}
table.cal td.occ.stayover {
  background: var(--stayover);
}
table.cal td.occ.vacant {
  background: var(--vacant);
}
