.accounting-page .month-stage-timeline {
  display: grid;
  position: relative;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: 18px 0 12px;
}

.accounting-page .month-stage {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 96px;
  grid-template-rows: 20px 32px auto;
  place-items: center;
  gap: 6px;
  padding: 0 8px;
  color: #526278;
  text-align: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: 0;
}

.accounting-page .month-stage:hover { background: transparent; }

.accounting-page .month-stage:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  top: 41px;
  left: calc(50% + 16px);
  display: block;
  width: calc(100% - 32px);
  height: 2px;
  content: "";
  background: #d7dee8;
}

.accounting-page .month-stage.complete:not(:last-child)::after { background: #10b981; }

.accounting-page .month-stage > b {
  grid-row: 1;
  overflow: hidden;
  color: #526278;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-page .month-stage > i {
  z-index: 1;
  display: grid;
  width: 26px;
  height: 26px;
  grid-row: 2;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  background: #a8b3c2;
  border: 2px solid #a8b3c2;
  border-radius: 50%;
}

.accounting-page .month-stage.complete > i {
  color: #fff;
  background: #10b981;
  border-color: #10b981;
}

.accounting-page .month-stage.current > i {
  color: #fff;
  background: #f59e0b;
  border-color: #f59e0b;
}

.accounting-page .month-stage.selected {
  background: transparent;
  border: 0;
}

.accounting-page .month-stage.selected > i { box-shadow: 0 0 0 4px #fff7e6; }
.accounting-page .month-stage.selected > b { color: #10213d; font-weight: 700; }

.accounting-page .month-stage-meta {
  display: flex;
  min-width: 0;
  grid-row: 3;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  color: #7a889c;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.accounting-page .month-stage-meta time { font-variant-numeric: tabular-nums; }

.accounting-page .month-stage-meta em {
  display: inline-flex;
  align-items: center;
  color: #7a889c;
  font-style: normal;
  font-weight: 600;
}

.accounting-page .month-stage-meta em::before { display: none; content: none; }

.accounting-page .month-stage.complete .month-stage-meta em { color: #087f5b; }
.accounting-page .month-stage.current .month-stage-meta em { color: #ad6800; }

.accounting-page .month-stage:focus-visible > i {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1677ff;
}

@media (max-width: 1120px) {
  .accounting-page .month-stage { padding-inline: 4px; }
  .accounting-page .month-stage small { display: flex; }
  .accounting-page .month-stage-meta { gap: 1px; }
}

@media (max-width: 960px) {
  .accounting-page .month-stage-timeline { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .accounting-page .month-stage:not(:last-child)::after { display: block; }
  .accounting-page .month-stage-meta { gap: 1px; }
}

@media (max-width: 720px) {
  .accounting-page .month-stage-timeline {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 0 8px;
  }

  .accounting-page .month-stage {
    min-height: 64px;
    grid-template: auto auto / 32px minmax(0, 1fr);
    place-items: initial;
    column-gap: 10px;
    row-gap: 2px;
    padding: 8px 0;
    text-align: left;
  }

  .accounting-page .month-stage > b {
    grid-area: 1 / 2;
    align-self: end;
  }

  .accounting-page .month-stage > i {
    grid-area: 1 / 1 / 3 / 2;
    align-self: center;
    justify-self: center;
  }

  .accounting-page .month-stage-meta {
    display: flex;
    grid-area: 2 / 2;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  .accounting-page .month-stage:not(:last-child)::after {
    top: calc(50% + 13px);
    left: 15px;
    width: 2px;
    height: calc(50% + 38px);
  }
}
